From 9eac92069d4c06dc17c15fb086b4780378b2e0b0 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Thu, 30 Jan 2020 00:02:53 -0800 Subject: [PATCH] 5957 - bootstrap: stale checks for 2-byte opcodes --- 033check_operands.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/033check_operands.cc b/033check_operands.cc index 910878ca..f5959dbe 100644 --- a/033check_operands.cc +++ b/033check_operands.cc @@ -620,6 +620,14 @@ void test_check_missing_disp32_operand() { ); } +void test_0f_opcode_with_modrm() { + transform( + "== code 0x1\n" + "0f af/multiply 2/mod/*+disp32 5/rm32/ebp 8/disp32 0/r32\n" + ); + CHECK_TRACE_DOESNT_CONTAIN_ERRORS(); +} + :(before "End Globals") map Permitted_operands_0f; :(before "End Init Permitted Operands") @@ -645,9 +653,13 @@ put_new(Permitted_operands_0f, "af", 0x01); :(code) void check_operands_0f(const line& inst, const word& op) { uint8_t expected_bitvector = get(Permitted_operands_0f, op.data); - if (HAS(expected_bitvector, MODRM)) + if (HAS(expected_bitvector, MODRM)) { check_operands_modrm(inst, op); - compare_bitvector(inst, CLEAR(expected_bitvector, MODRM), maybe_name_0f(op)); + compare_bitvector_modrm(inst, expected_bitvector, maybe_name_0f(op)); + } + else { + compare_bitvector(inst, CLEAR(expected_bitvector, MODRM), maybe_name_0f(op)); + } } string maybe_name_0f(const word& op) {