This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[patch]: i386 gas, intel syntax and IgnoreSize modifier



When using i386 gas with intel syntax I found that gas was
rejecting the following instruction:

	pand	mm1, qword ptr [esi]

which I believe is correct (I'm not too familiar with i386
assembly, but MASM was accepting the instruction). However, when
you removed the `qword' qualifier, the instruction assembled
fine.

The following patch fixes this problem. It essentially ignores
the instruction prefix if the opcode modifier has the IgnoreSize
bit set.

OK to install?


Wed Aug  9 16:28:21 EDT 2000	Diego Novillo <dnovillo@cygnus.com>

	* tc-i386.c (md_assemble): Skip suffix check if the opcode modifier
	has the IgnoreSize bit set.

Index: tc-i386.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-i386.c,v
retrieving revision 1.58
diff -d -c -p -r1.58 tc-i386.c
*** tc-i386.c	2000/08/04 18:43:45	1.58
--- tc-i386.c	2000/08/09 20:27:46
*************** md_assemble (line)
*** 1496,1512 ****
      overlap1 = 0;
      overlap2 = 0;
      found_reverse_match = 0;
!     suffix_check = (i.suffix == BYTE_MNEM_SUFFIX
! 		    ? No_bSuf
! 		    : (i.suffix == WORD_MNEM_SUFFIX
! 		       ? No_wSuf
! 		       : (i.suffix == SHORT_MNEM_SUFFIX
! 			  ? No_sSuf
! 			  : (i.suffix == LONG_MNEM_SUFFIX
! 			     ? No_lSuf
! 			     : (i.suffix == DWORD_MNEM_SUFFIX
! 				? No_dSuf
! 				: (i.suffix == LONG_DOUBLE_MNEM_SUFFIX ? No_xSuf : 0))))));
  
      for (t = current_templates->start;
  	 t < current_templates->end;
--- 1496,1515 ----
      overlap1 = 0;
      overlap2 = 0;
      found_reverse_match = 0;
!     suffix_check = (!(i.tm.opcode_modifier & IgnoreSize))
! 		    & (i.suffix == BYTE_MNEM_SUFFIX
! 		       ? No_bSuf
! 		       : (i.suffix == WORD_MNEM_SUFFIX
! 		 	  ? No_wSuf
! 		 	  : (i.suffix == SHORT_MNEM_SUFFIX
! 		 	     ? No_sSuf
! 		 	     : (i.suffix == LONG_MNEM_SUFFIX
! 		 	        ? No_lSuf
! 		 	        : (i.suffix == DWORD_MNEM_SUFFIX
! 		 		   ? No_dSuf
! 				   : (i.suffix == LONG_DOUBLE_MNEM_SUFFIX 
! 				      ? No_xSuf 
! 				      : 0))))));
  
      for (t = current_templates->start;
  	 t < current_templates->end;
*************** md_assemble (line)
*** 1808,1813 ****
--- 1811,1819 ----
  		}
  #endif
  	  }
+ 	else if (i.tm.opcode_modifier & IgnoreSize)
+ 	  /* Do nothing if the instruction is going to ignore the prefix.  */
+ 	  ;
  	else
  	  abort ();
        }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]