Added instruction format class 3.15 and floating-point compare instructions.
authorMisha Brukman <brukman+llvm@gmail.com>
Wed, 4 Jun 2003 02:26:14 +0000 (02:26 +0000)
committerMisha Brukman <brukman+llvm@gmail.com>
Wed, 4 Jun 2003 02:26:14 +0000 (02:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6594 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SparcV9/SparcV9.td
lib/Target/SparcV9/SparcV9_F3.td

index adc9e4d1a0ae2c1ec262b0c5516762f9793c5bb8..ca2d0be1ec1edf14bbbf089f96c9cf88ca9fa905 100644 (file)
@@ -188,15 +188,12 @@ def FSUBD : F3_16<2, 0b110100, 0x46, "fsubd">;    // fsubd f, f, f
 def FSUBQ : F3_16<2, 0b110100, 0x47, "fsubq">;    // fsubq f, f, f
 
 // Section A.13: Floating-point compare - p159
-// FIXME: FCMPS, FCMPD, FCMPQ !!!
-#if 0
-def FSTOX : F3_14<2, 0b110100, 0b011001001, "fstod">;   // fstod rs2, rd
-def FDTOX : F3_14<2, 0b110100, 0b011001101, "fstoq">;   // fstoq rs2, rd
-def FQTOX : F3_14<2, 0b110100, 0b011000110, "fstos">;   // fstos rs2, rd
-def FSTOI : F3_14<2, 0b110100, 0b011001110, "fdtoq">;   // fdtoq rs2, rd
-def FDTOI : F3_14<2, 0b110100, 0b011000111, "fqtos">;   // fqtos rs2, rd
-def FQTOI : F3_14<2, 0b110100, 0b011001011, "fqtod">;   // fqtod rs2, rd
-#endif
+def FCMPS  : F3_15<2, 0b110101, 0b010100001, "fcmps">;   // fcmps  %fcc, r1, r2
+def FCMPD  : F3_15<2, 0b110101, 0b010100010, "fcmpd">;   // fcmpd  %fcc, r1, r2
+def FCMPQ  : F3_15<2, 0b110101, 0b010100011, "fcmpq">;   // fcmpq  %fcc, r1, r2
+def FCMPES : F3_15<2, 0b110101, 0b010100101, "fcmpes">;  // fcmpes %fcc, r1, r2
+def FCMPED : F3_15<2, 0b110101, 0b010100110, "fcmped">;  // fcmped %fcc, r1, r2
+def FCMPEQ : F3_15<2, 0b110101, 0b010100111, "fcmpeq">;  // fcmpeq %fcc, r1, r2
 
 // Section A.14: Convert floating-point to integer - p161
 def FSTOX : F3_14<2, 0b110100, 0b010000001, "fstox">;   // fstox rs2, rd
index f29a3f821966066bf497b89c8937c311f3cd26aa..a0033d84ce1f6f457f9a0fcab072b1c2227c3a58 100644 (file)
@@ -202,12 +202,26 @@ class F3_13<bits<2> opVal, bits<6> op3Val, string name> : F3_rs1 {
 }
 
 class F3_14<bits<2> opVal, bits<6> op3Val,
-            bits<9> opfval, string name> : F3_rs2rd {
+            bits<9> opfVal, string name> : F3_rs2rd {
   set op  = opVal;
   set op3 = op3Val;
   set Name = name;
   //set Inst{18-14} = dontcare;
-  set Inst{13-5} = opfval;
+  set Inst{13-5} = opfVal;
+}
+
+class F3_15<bits<2> opVal, bits<6> op3Val,
+            bits<9> opfVal, string name> : F3 {
+  bits<2> cc;
+  bits<5> rs1;
+  bits<5> rs2;
+
+  set op  = opVal;
+  set op3 = op3Val;
+  set Inst{26-25} = cc;
+  set Inst{18-14} = rs1;
+  set Inst{13-5}  = opfVal;
+  set Inst{4-0}   = rs2;
 }
   
 class F3_16<bits<2> opVal,  bits<6> op3Val,