[binutils-gdb] x86: move Anysize check in operand_size_match()

Jan Beulich jbeulich@sourceware.org
Fri May 16 08:34:37 GMT 2025


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

commit a7148a799b2a4c7e2be56b21f6d01018a6b27895
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri May 16 10:31:35 2025 +0200

    x86: move Anysize check in operand_size_match()
    
    Anysize is applicable to memory operands only. Move the check to where
    memory operands are handled. (The RegSIMD part there was questionable
    altogether.)

Diff:
---
 gas/config/tc-i386.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 69b56774531..ffde87aef53 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -2604,11 +2604,6 @@ operand_size_match (const insn_template *t)
 	  break;
 	}
 
-      if (i.types[j].bitfield.class != Reg
-	  && i.types[j].bitfield.class != RegSIMD
-	  && t->opcode_modifier.operandconstraint == ANY_SIZE)
-	continue;
-
       if (i.types[j].bitfield.class == Reg
 	  && (t->operand_types[j].bitfield.class == Reg
 	      || (t->operand_types[j].bitfield.instance == Accum
@@ -2636,6 +2631,7 @@ operand_size_match (const insn_template *t)
 
       if ((i.flags[j] & Operand_Mem)
 	  && operand_type_check (t->operand_types[j], anymem)
+	  && t->opcode_modifier.operandconstraint != ANY_SIZE
 	  && !match_mem_size (t, j, j))
 	{
 	  match = 0;


More information about the Binutils-cvs mailing list