[PATCH 3/3] x86: simplify one case of base opcode setting in optimize_encoding()

Jan Beulich jbeulich@suse.com
Fri Jul 17 07:34:48 GMT 2026


The W property is evaluated only later, so the base opcode can still be
the value found in the corresponding insn template.
---
There are two checks for opcode 0xc7 earlier in the function. Those
could be simplified, too, but only when additionally adjusting LEA
handling near the top of the function. Whether that would be worth it is
unclear.

--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -5458,7 +5458,7 @@ optimize_encoding (void)
 	   andl %rN, %rN  -> testl %rN, %rN
 	   orl %rN, %rN   -> testl %rN, %rN
        */
-      i.tm.base_opcode = 0x84 | (i.tm.base_opcode & 1);
+      i.tm.base_opcode = 0x84;
     }
   else if (!optimize_for_space
 	   && i.tm.base_opcode == 0xd0



More information about the Binutils mailing list