[llvm-commits] [llvm] r118354 - in /llvm/trunk: lib/Target/X86/X86InstrFPStack.td lib/Target/X86/X86InstrInfo.td test/MC/X86/x86-32-coverage.s test/MC/X86/x86-32.s test/MC/X86/x86-64.s

Chris Lattner sabre at nondot.org
Sat Nov 6 13:55:09 PDT 2010


Author: lattner
Date: Sat Nov  6 15:55:09 2010
New Revision: 118354

URL: http://llvm.org/viewvc/llvm-project?rev=118354&view=rev
Log:
change the fp comparison instructions to not have %st0 explicitly
listed in its asm string, for consistency with the other similar
instructions.


Modified:
    llvm/trunk/lib/Target/X86/X86InstrFPStack.td
    llvm/trunk/lib/Target/X86/X86InstrInfo.td
    llvm/trunk/test/MC/X86/x86-32-coverage.s
    llvm/trunk/test/MC/X86/x86-32.s
    llvm/trunk/test/MC/X86/x86-64.s

Modified: llvm/trunk/lib/Target/X86/X86InstrFPStack.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFPStack.td?rev=118354&r1=118353&r2=118354&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrFPStack.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrFPStack.td Sat Nov  6 15:55:09 2010
@@ -583,16 +583,16 @@
 
 def UCOM_FIr   : FPI<0xE8, AddRegFrm,     // CC = cmp ST(0) with ST(i)
                     (outs), (ins RST:$reg),
-                    "fucomi\t{$reg, %st(0)|%ST(0), $reg}">, DB;
+                    "fucomi\t$reg">, DB;
 def UCOM_FIPr  : FPI<0xE8, AddRegFrm,     // CC = cmp ST(0) with ST(i), pop
                     (outs), (ins RST:$reg),
-                    "fucomip\t{$reg, %st(0)|%ST(0), $reg}">, DF;
+                    "fucomip\t$reg">, DF;
 }
 
 def COM_FIr : FPI<0xF0, AddRegFrm, (outs), (ins RST:$reg),
-                  "fcomi\t{$reg, %st(0)|%ST(0), $reg}">, DB;
+                  "fcomi\t$reg">, DB;
 def COM_FIPr : FPI<0xF0, AddRegFrm, (outs), (ins RST:$reg),
-                   "fcomip\t{$reg, %st(0)|%ST(0), $reg}">, DF;
+                   "fcomip\t$reg">, DF;
 
 // Floating point flag ops.
 let Defs = [AX] in

Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=118354&r1=118353&r2=118354&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Sat Nov  6 15:55:09 2010
@@ -1377,14 +1377,6 @@
 def : InstAlias<"clrl $reg", (XOR32rr GR32:$reg, GR32:$reg)>;
 def : InstAlias<"clrq $reg", (XOR64rr GR64:$reg, GR64:$reg)>;
 
-// The instruction patterns for these instructions were written with st(0)
-// explicitly in the pattern, match the form with implicit st(0).
-// FIXME: Tweak these to work like fadd etc.
-def : InstAlias<"fcomi   $reg", (COM_FIr   RST:$reg)>;
-def : InstAlias<"fcomip  $reg", (COM_FIPr  RST:$reg)>;
-def : InstAlias<"fucomi  $reg", (UCOM_FIr  RST:$reg)>;
-def : InstAlias<"fucomip $reg", (UCOM_FIPr RST:$reg)>;
-
 // Various unary fpstack operations default to operating on on ST1.
 // For example, "fxch" -> "fxch %st(1)"
 def : InstAlias<"faddp",        (ADD_FPrST0  ST1)>;
@@ -1422,6 +1414,11 @@
 defm : FpUnaryAlias<"fdivp",  DIVR_FPrST0>;
 defm : FpUnaryAlias<"fdivr",  DIVR_FST0r>;
 defm : FpUnaryAlias<"fdivrp", DIV_FPrST0>;
+defm : FpUnaryAlias<"fcomi",   COM_FIr>;
+defm : FpUnaryAlias<"fcomip",  COM_FIPr>;
+defm : FpUnaryAlias<"fucomi",  UCOM_FIr>;
+defm : FpUnaryAlias<"fucomip", UCOM_FIPr>;
+
 
 // Handle "f{mulp,addp} st(0), $op" the same as "f{mulp,addp} $op", since they
 // commute.  We also allow fdivrp/fsubrp even though they don't commute, solely

Modified: llvm/trunk/test/MC/X86/x86-32-coverage.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86-32-coverage.s?rev=118354&r1=118353&r2=118354&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/x86-32-coverage.s (original)
+++ llvm/trunk/test/MC/X86/x86-32-coverage.s Sat Nov  6 15:55:09 2010
@@ -4474,19 +4474,19 @@
 // CHECK:  encoding: [0xdb,0xda]
         	fcmovnu	%st(2),%st
 
-// CHECK: fcomi	%st(2), %st(0)
+// CHECK: fcomi	%st(2)
 // CHECK:  encoding: [0xdb,0xf2]
         	fcomi	%st(2),%st
 
-// CHECK: fucomi	%st(2), %st(0)
+// CHECK: fucomi	%st(2)
 // CHECK:  encoding: [0xdb,0xea]
         	fucomi	%st(2),%st
 
-// CHECK: fcomip	%st(2), %st(0)
+// CHECK: fcomip	%st(2)
 // CHECK:  encoding: [0xdf,0xf2]
         	fcomip	%st(2),%st
 
-// CHECK: fucomip	%st(2), %st(0)
+// CHECK: fucomip	%st(2)
 // CHECK:  encoding: [0xdf,0xea]
         	fucomip	%st(2),%st
 
@@ -14150,16 +14150,16 @@
 // CHECK: 	fcmovnu	%st(2), %st(0)
         	fcmovnu	%st(2),%st
 
-// CHECK: 	fcomi	%st(2), %st(0)
+// CHECK: 	fcomi	%st(2)
         	fcomi	%st(2),%st
 
-// CHECK: 	fucomi	%st(2), %st(0)
+// CHECK: 	fucomi	%st(2)
         	fucomi	%st(2),%st
 
-// CHECK: 	fcomip	%st(2), %st(0)
+// CHECK: 	fcomip	%st(2)
         	fcomip	%st(2),%st
 
-// CHECK: 	fucomip	%st(2), %st(0)
+// CHECK: 	fucomip	%st(2)
         	fucomip	%st(2),%st
 
 // CHECK: 	movnti	%ecx, 3735928559(%ebx,%ecx,8)

Modified: llvm/trunk/test/MC/X86/x86-32.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86-32.s?rev=118354&r1=118353&r2=118354&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/x86-32.s (original)
+++ llvm/trunk/test/MC/X86/x86-32.s Sat Nov  6 15:55:09 2010
@@ -708,27 +708,27 @@
 // CHECK:  encoding: [0x0f,0x01,0x48,0x04]
         	sidtl	4(%eax)
 
-// CHECK: fcomip	%st(2), %st(0)
+// CHECK: fcomip	%st(2)
 // CHECK:  encoding: [0xdf,0xf2]
         	fcompi	%st(2),%st
 
-// CHECK: fcomip	%st(2), %st(0)
+// CHECK: fcomip	%st(2)
 // CHECK:  encoding: [0xdf,0xf2]
         	fcompi	%st(2)
 
-// CHECK: fcomip	%st(1), %st(0)
+// CHECK: fcomip	%st(1)
 // CHECK:  encoding: [0xdf,0xf1]
         	fcompi
 
-// CHECK: fucomip	%st(2), %st(0)
+// CHECK: fucomip	%st(2)
 // CHECK:  encoding: [0xdf,0xea]
         	fucompi	%st(2),%st
 
-// CHECK: fucomip	%st(2), %st(0)
+// CHECK: fucomip	%st(2)
 // CHECK:  encoding: [0xdf,0xea]
         	fucompi	%st(2)
 
-// CHECK: fucomip	%st(1), %st(0)
+// CHECK: fucomip	%st(1)
 // CHECK:  encoding: [0xdf,0xe9]
         	fucompi
 

Modified: llvm/trunk/test/MC/X86/x86-64.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86-64.s?rev=118354&r1=118353&r2=118354&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/x86-64.s (original)
+++ llvm/trunk/test/MC/X86/x86-64.s Sat Nov  6 15:55:09 2010
@@ -261,11 +261,11 @@
 fdivp
 fdivrp
 
-// CHECK: fcomi	%st(1), %st(0)
-// CHECK: fcomi	%st(2), %st(0)
-// CHECK: fucomi	%st(1), %st(0)
-// CHECK: fucomi	%st(2), %st(0)
-// CHECK: fucomi	%st(2), %st(0)
+// CHECK: fcomi	%st(1)
+// CHECK: fcomi	%st(2)
+// CHECK: fucomi	%st(1)
+// CHECK: fucomi	%st(2)
+// CHECK: fucomi	%st(2)
 
 fcomi
 fcomi	%st(2)





More information about the llvm-commits mailing list