[PATCH 5/6] x86: move Anysize check in operand_size_match()

Jan Beulich jbeulich@suse.com
Wed Apr 30 13:30:56 GMT 2025


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

--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -2604,11 +2604,6 @@ operand_size_match (const insn_template
   /* Check memory and accumulator operand size.  */
   for (j = 0; j < i.operands; j++)
     {
-      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
 
       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 mailing list