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]

PATCH: Simplify 3 and 4 operand match


I am checking in this patch to simplify 3 and 4 operand match.


H.J.
---
2006-12-14  H.J. Lu  <hongjiu.lu@intel.com>

	* config/tc-i386.c (match_template): Simplify 3 and 4 operand
	match.

--- gas/config/tc-i386.c.xxx	2006-12-13 11:31:14.000000000 -0800
+++ gas/config/tc-i386.c	2006-12-14 05:20:52.000000000 -0800
@@ -2734,10 +2734,14 @@ match_template ()
 	  else
 	    {
 	      /* Found a forward 2 operand match here.  */
-	      if (t->operands > 2)
-		overlap2 = i.types[2] & operand_types[2];
-	      if (t->operands > 3)
-		overlap3 = i.types[3] & operand_types[3];
+	      switch (t->operands)
+		{
+		case 4:
+		  overlap3 = i.types[3] & operand_types[3];
+		case 3:
+		  overlap2 = i.types[2] & operand_types[2];
+		  break;
+		}
 
 	      switch (t->operands)
 		{


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