]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
x86/APX: correct disassembly for EVEX.B4
authorJan Beulich <jbeulich@suse.com>
Wed, 11 Sep 2024 11:52:42 +0000 (13:52 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 11 Sep 2024 11:52:42 +0000 (13:52 +0200)
EVEX.B4 is used only for GPR (or addressing of memory) operands. SIMD
registers encoded via ModR/M.rm (when ModR/M.mod == 3) have their top
bit in EVEX.X3. Supposedly (doc version 004) EVEX.B4 is ignored when
unused, hence also don't flag such encodings as invalid.

opcodes/i386-dis.c

index 26d667a3b0ec07817be5adf5a0b9ff9df4eaee7e..e2c7b1b4ac712863009fb2e45b2dd24d5df22f26 100644 (file)
@@ -13012,14 +13012,15 @@ OP_EX (instr_info *ins, int bytemode, int sizeflag)
   USED_REX (REX_B);
   if (ins->rex & REX_B)
     reg += 8;
-  if (ins->rex2 & REX_B)
-    reg += 16;
   if (ins->vex.evex)
     {
       USED_REX (REX_X);
       if ((ins->rex & REX_X))
        reg += 16;
+      ins->rex2_used &= ~REX_B;
     }
+  else if (ins->rex2 & REX_B)
+    reg += 16;
 
   if ((sizeflag & SUFFIX_ALWAYS)
       && (bytemode == x_swap_mode