[binutils-gdb] x86: simplify one case of base opcode setting in optimize_encoding()

Jan Beulich jbeulich@sourceware.org
Fri Jul 24 06:25:52 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cf64f1ae2ca36d81a90e49066004260f9cda0cb7

commit cf64f1ae2ca36d81a90e49066004260f9cda0cb7
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri Jul 24 08:23:44 2026 +0200

    x86: simplify one case of base opcode setting in optimize_encoding()
    
    The W property is evaluated only later, so the base opcode can still be
    the value found in the corresponding insn template.

Diff:
---
 gas/config/tc-i386.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 2853f0c76e7..dd6d4381087 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -5461,7 +5461,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-cvs mailing list