This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

Re: PATCH: Remove memory check on SVME instructions


>>> "H.J. Lu" <hjl@lucon.org> 09/04/07 4:08 PM >>>
>On Thu, Aug 30, 2007 at 07:19:02PM -0500, rajagopal, dwarak wrote:
>> H.J.,
>> 
>> Yes, SVM instructions have register only operand.  So please fix this.
>> 
>> Thanks,
>> Dwarak
>> 
>
>I am checking this patch to remove memory check on SVME instructions.

Why? Did you check that you get proper warnings/errors for invalid operand
specifications after you removed these checks?

>>>>>>>>>>>>>>>>>>>>>>>>>>>>
H.J.
---
2007-09-04  H.J. Lu  <hongjiu.lu@intel.com>

	* config/tc-i386.c (process_operands): Remove segment override
	check on SVME instructions.
	(i386_index_check): Remove memory operand check on  SVME
	instructions.

--- gas/config/tc-i386.c.bar	2007-08-28 21:59:04.000000000 -0700
+++ gas/config/tc-i386.c	2007-09-04 07:04:48.000000000 -0700
@@ -3477,9 +3477,9 @@ process_operands (void)
       default_seg = &ds;
     }
 
-  if ((i.tm.base_opcode == 0x8d /* lea */
-       || (i.tm.cpu_flags & CpuSVME))
-      && i.seg[0] && !quiet_warnings)
+  if (i.tm.base_opcode == 0x8d /* lea */
+      && i.seg[0]
+      && !quiet_warnings)
     as_warn (_("segment override on `%s' is ineffectual"), i.tm.name);
 
   /* If a segment was explicitly specified, and the specified segment
@@ -4962,30 +4962,7 @@ i386_index_check (const char *operand_st
  tryprefix:
 #endif
   ok = 1;
-  if ((current_templates->start->cpu_flags & CpuSVME)
-      && current_templates->end[-1].operand_types[0] == AnyMem)
-    {
-      /* Memory operands of SVME insns are special in that they only allow
-	 rAX as their memory address and ignore any segment override.  */
-      unsigned RegXX;
-
-      /* SKINIT is even more restrictive: it always requires EAX.  */
-      if (strcmp (current_templates->start->name, "skinit") == 0)
-	RegXX = Reg32;
-      else if (flag_code == CODE_64BIT)
-	RegXX = i.prefix[ADDR_PREFIX] == 0 ? Reg64 : Reg32;
-      else
-	RegXX = ((flag_code == CODE_16BIT) ^ (i.prefix[ADDR_PREFIX] != 0)
-		 ? Reg16
-		 : Reg32);
-      if (!i.base_reg
-	  || !(i.base_reg->reg_type & Acc)
-	  || !(i.base_reg->reg_type & RegXX)
-	  || i.index_reg
-	  || (i.types[0] & Disp))
-	ok = 0;
-    }
-  else if (flag_code == CODE_64BIT)
+  if (flag_code == CODE_64BIT)
     {
       unsigned RegXX = (i.prefix[ADDR_PREFIX] == 0 ? Reg64 : Reg32);
 


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