[llvm-commits] [llvm] r116386 - in /llvm/trunk: lib/Target/ARM/ARMInstrVFP.td test/MC/ARM/simple-fp-encoding.ll

Bill Wendling isanbard at gmail.com
Tue Oct 12 18:17:33 PDT 2010


Author: void
Date: Tue Oct 12 20:17:33 2010
New Revision: 116386

URL: http://llvm.org/viewvc/llvm-project?rev=116386&view=rev
Log:
Add encodings for VNEG and VSQRT. Also add encodings for VMOV, but not a test
just yet.

Modified:
    llvm/trunk/lib/Target/ARM/ARMInstrVFP.td
    llvm/trunk/test/MC/ARM/simple-fp-encoding.ll

Modified: llvm/trunk/lib/Target/ARM/ARMInstrVFP.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrVFP.td?rev=116386&r1=116385&r2=116386&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrVFP.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrVFP.td Tue Oct 12 20:17:33 2010
@@ -427,28 +427,34 @@
                  [/* For disassembly only; pattern left blank */]>;
 
 let neverHasSideEffects = 1 in {
-def VMOVD: ADuI<0b11101, 0b11, 0b0000, 0b01, 0, (outs DPR:$dst), (ins DPR:$a),
-                 IIC_fpUNA64, "vmov", ".f64\t$dst, $a", []>;
-
-def VMOVS: ASuI<0b11101, 0b11, 0b0000, 0b01, 0, (outs SPR:$dst), (ins SPR:$a),
-                 IIC_fpUNA32, "vmov", ".f32\t$dst, $a", []>;
+def VMOVD  : ADuI_Encode<0b11101, 0b11, 0b0000, 0b01, 0,
+                         (outs DPR:$Dd), (ins DPR:$Dm),
+                         IIC_fpUNA64, "vmov", ".f64\t$Dd, $Dm", []>;
+
+def VMOVS  : ASuI_Encode<0b11101, 0b11, 0b0000, 0b01, 0,
+                         (outs SPR:$Sd), (ins SPR:$Sm),
+                         IIC_fpUNA32, "vmov", ".f32\t$Sd, $Sm", []>;
 } // neverHasSideEffects
 
-def VNEGD  : ADuI<0b11101, 0b11, 0b0001, 0b01, 0, (outs DPR:$dst), (ins DPR:$a),
-                 IIC_fpUNA64, "vneg", ".f64\t$dst, $a",
-                 [(set DPR:$dst, (fneg (f64 DPR:$a)))]>;
-
-def VNEGS  : ASuIn<0b11101, 0b11, 0b0001, 0b01, 0,(outs SPR:$dst), (ins SPR:$a),
-                  IIC_fpUNA32, "vneg", ".f32\t$dst, $a",
-                  [(set SPR:$dst, (fneg SPR:$a))]>;
-
-def VSQRTD : ADuI<0b11101, 0b11, 0b0001, 0b11, 0, (outs DPR:$dst), (ins DPR:$a),
-                 IIC_fpSQRT64, "vsqrt", ".f64\t$dst, $a",
-                 [(set DPR:$dst, (fsqrt (f64 DPR:$a)))]>;
-
-def VSQRTS : ASuI<0b11101, 0b11, 0b0001, 0b11, 0, (outs SPR:$dst), (ins SPR:$a),
-                 IIC_fpSQRT32, "vsqrt", ".f32\t$dst, $a",
-                 [(set SPR:$dst, (fsqrt SPR:$a))]>;
+def VNEGD  : ADuI_Encode<0b11101, 0b11, 0b0001, 0b01, 0,
+                         (outs DPR:$Dd), (ins DPR:$Dm),
+                         IIC_fpUNA64, "vneg", ".f64\t$Dd, $Dm",
+                         [(set DPR:$Dd, (fneg (f64 DPR:$Dm)))]>;
+
+def VNEGS  : ASuIn_Encode<0b11101, 0b11, 0b0001, 0b01, 0,
+                          (outs SPR:$Sd), (ins SPR:$Sm),
+                          IIC_fpUNA32, "vneg", ".f32\t$Sd, $Sm",
+                          [(set SPR:$Sd, (fneg SPR:$Sm))]>;
+
+def VSQRTD : ADuI_Encode<0b11101, 0b11, 0b0001, 0b11, 0,
+                         (outs DPR:$Dd), (ins DPR:$Dm),
+                         IIC_fpSQRT64, "vsqrt", ".f64\t$Dd, $Dm",
+                         [(set DPR:$Dd, (fsqrt (f64 DPR:$Dm)))]>;
+
+def VSQRTS : ASuI_Encode<0b11101, 0b11, 0b0001, 0b11, 0,
+                         (outs SPR:$Sd), (ins SPR:$Sm),
+                         IIC_fpSQRT32, "vsqrt", ".f32\t$Sd, $Sm",
+                         [(set SPR:$Sd, (fsqrt SPR:$Sm))]>;
 
 //===----------------------------------------------------------------------===//
 // FP <-> GPR Copies.  Int <-> FP Conversions.

Modified: llvm/trunk/test/MC/ARM/simple-fp-encoding.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/simple-fp-encoding.ll?rev=116386&r1=116385&r2=116386&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/simple-fp-encoding.ll (original)
+++ llvm/trunk/test/MC/ARM/simple-fp-encoding.ll Tue Oct 12 20:17:33 2010
@@ -134,7 +134,7 @@
 define float @f16(float %a) nounwind {
 entry:
 ; CHECK: f16
-; This call generates a "bfc" instruction instead of "vabs.f32".
+; FIXME: This call generates a "bfc" instruction instead of "vabs.f32".
   %call = tail call float @fabsf(float %a)
   ret float %call
 }
@@ -156,3 +156,39 @@
   %conv = fpext float %a to double
   ret double %conv
 }
+
+define double @f19(double %a) nounwind readnone {
+entry:
+; CHECK: f19
+; CHECK: vneg.f64 d16, d16  @ encoding: [0x60,0x0b,0xf1,0xee]
+  %sub = fsub double -0.000000e+00, %a
+  ret double %sub
+}
+
+define float @f20(float %a) nounwind readnone {
+entry:
+; CHECK: f20
+; FIXME: This produces an 'eor' instruction.
+  %sub = fsub float -0.000000e+00, %a
+  ret float %sub
+}
+
+define double @f21(double %a) nounwind readnone {
+entry:
+; CHECK: f21
+; CHECK: vsqrt.f64 d16, d16  @ encoding: [0xe0,0x0b,0xf1,0xee]
+  %call = tail call double @sqrtl(double %a) nounwind
+  ret double %call
+}
+
+declare double @sqrtl(double) readnone
+
+define float @f22(float %a) nounwind readnone {
+entry:
+; CHECK: f22
+; CHECK: vsqrt.f32 s0, s0  @ encoding: [0xc0,0x0a,0xb1,0xee]
+  %call = tail call float @sqrtf(float %a) nounwind
+  ret float %call
+}
+
+declare float @sqrtf(float) readnone





More information about the llvm-commits mailing list