about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-01-30 00:02:53 -0800
committerKartik Agaram <vc@akkartik.com>2020-01-30 00:02:53 -0800
commit9eac92069d4c06dc17c15fb086b4780378b2e0b0 (patch)
tree1e9b92940df4028a4f8f1a802e346b6f0cacbfd0
parent19e7a418c9da98de81587ab2825ef94717e46aea (diff)
downloadmu-9eac92069d4c06dc17c15fb086b4780378b2e0b0.tar.gz
5957 - bootstrap: stale checks for 2-byte opcodes
-rw-r--r--033check_operands.cc16
1 files 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</*op*/string, /*bitvector*/uint8_t> 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) {