[llvm-branch-commits] [llvm-branch] r99550 - in /llvm/branches/Apple/Morbo/lib/Target/ARM: ARMISelLowering.cpp ARMInstrFormats.td ARMInstrInfo.td ARMInstrVFP.td ARMSubtarget.cpp ARMSubtarget.h

Jim Grosbach grosbach at apple.com
Thu Mar 25 13:53:43 PDT 2010


Author: grosbach
Date: Thu Mar 25 15:53:42 2010
New Revision: 99550

URL: http://llvm.org/viewvc/llvm-project?rev=99550&view=rev
Log:
merge 99355 99402 99436 99549

Modified:
    llvm/branches/Apple/Morbo/lib/Target/ARM/ARMISelLowering.cpp
    llvm/branches/Apple/Morbo/lib/Target/ARM/ARMInstrFormats.td
    llvm/branches/Apple/Morbo/lib/Target/ARM/ARMInstrInfo.td
    llvm/branches/Apple/Morbo/lib/Target/ARM/ARMInstrVFP.td
    llvm/branches/Apple/Morbo/lib/Target/ARM/ARMSubtarget.cpp
    llvm/branches/Apple/Morbo/lib/Target/ARM/ARMSubtarget.h

Modified: llvm/branches/Apple/Morbo/lib/Target/ARM/ARMISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/Target/ARM/ARMISelLowering.cpp?rev=99550&r1=99549&r2=99550&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/Target/ARM/ARMISelLowering.cpp Thu Mar 25 15:53:42 2010
@@ -456,6 +456,9 @@
     // Generic (and overly aggressive) if-conversion limits.
     setIfCvtBlockSizeLimit(10);
     setIfCvtDupBlockSizeLimit(2);
+  } else if (Subtarget->hasV7Ops()) {
+    setIfCvtBlockSizeLimit(3);
+    setIfCvtDupBlockSizeLimit(1);
   } else if (Subtarget->hasV6Ops()) {
     setIfCvtBlockSizeLimit(2);
     setIfCvtDupBlockSizeLimit(1);

Modified: llvm/branches/Apple/Morbo/lib/Target/ARM/ARMInstrFormats.td
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/Target/ARM/ARMInstrFormats.td?rev=99550&r1=99549&r2=99550&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/Target/ARM/ARMInstrFormats.td (original)
+++ llvm/branches/Apple/Morbo/lib/Target/ARM/ARMInstrFormats.td Thu Mar 25 15:53:42 2010
@@ -1360,6 +1360,20 @@
   let Inst{4} = op4;
 }
 
+// Double precision, binary, VML[AS] (for additional predicate)
+class ADbI_vmlX<bits<5> opcod1, bits<2> opcod2, bit op6, bit op4, dag oops,
+           dag iops, InstrItinClass itin, string opc, string asm,
+           list<dag> pattern>
+  : VFPAI<oops, iops, VFPBinaryFrm, itin, opc, asm, pattern> {
+  let Inst{27-23} = opcod1;
+  let Inst{21-20} = opcod2;
+  let Inst{11-8}  = 0b1011;
+  let Inst{6} = op6;
+  let Inst{4} = op4;
+  list<Predicate> Predicates = [HasVFP2, UseVMLx];
+}
+
+
 // Single precision, unary
 class ASuI<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4,
            bit opcod5, dag oops, dag iops, InstrItinClass itin, string opc,

Modified: llvm/branches/Apple/Morbo/lib/Target/ARM/ARMInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/Target/ARM/ARMInstrInfo.td?rev=99550&r1=99549&r2=99550&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/Target/ARM/ARMInstrInfo.td (original)
+++ llvm/branches/Apple/Morbo/lib/Target/ARM/ARMInstrInfo.td Thu Mar 25 15:53:42 2010
@@ -137,6 +137,8 @@
 def UseMovt   : Predicate<"Subtarget->useMovt()">;
 def DontUseMovt : Predicate<"!Subtarget->useMovt()">;
 
+def UseVMLx   : Predicate<"Subtarget->useVMLx()">;
+
 //===----------------------------------------------------------------------===//
 // ARM Flag Definitions.
 

Modified: llvm/branches/Apple/Morbo/lib/Target/ARM/ARMInstrVFP.td
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/Target/ARM/ARMInstrVFP.td?rev=99550&r1=99549&r2=99550&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/Target/ARM/ARMInstrVFP.td (original)
+++ llvm/branches/Apple/Morbo/lib/Target/ARM/ARMInstrVFP.td Thu Mar 25 15:53:42 2010
@@ -541,7 +541,7 @@
 // FP FMA Operations.
 //
 
-def VMLAD : ADbI<0b11100, 0b00, 0, 0,
+def VMLAD : ADbI_vmlX<0b11100, 0b00, 0, 0,
                 (outs DPR:$dst), (ins DPR:$dstin, DPR:$a, DPR:$b),
                 IIC_fpMAC64, "vmla", ".f64\t$dst, $a, $b",
                 [(set DPR:$dst, (fadd (fmul DPR:$a, DPR:$b),
@@ -554,7 +554,7 @@
                  [(set SPR:$dst, (fadd (fmul SPR:$a, SPR:$b), SPR:$dstin))]>,
                  RegConstraint<"$dstin = $dst">;
 
-def VNMLSD : ADbI<0b11100, 0b01, 0, 0,
+def VNMLSD : ADbI_vmlX<0b11100, 0b01, 0, 0,
                 (outs DPR:$dst), (ins DPR:$dstin, DPR:$a, DPR:$b),
                 IIC_fpMAC64, "vnmls", ".f64\t$dst, $a, $b",
                 [(set DPR:$dst, (fsub (fmul DPR:$a, DPR:$b),
@@ -567,7 +567,7 @@
                 [(set SPR:$dst, (fsub (fmul SPR:$a, SPR:$b), SPR:$dstin))]>,
                 RegConstraint<"$dstin = $dst">;
 
-def VMLSD : ADbI<0b11100, 0b00, 1, 0,
+def VMLSD : ADbI_vmlX<0b11100, 0b00, 1, 0,
                  (outs DPR:$dst), (ins DPR:$dstin, DPR:$a, DPR:$b),
                  IIC_fpMAC64, "vmls", ".f64\t$dst, $a, $b",
              [(set DPR:$dst, (fadd (fneg (fmul DPR:$a, DPR:$b)),
@@ -585,7 +585,7 @@
 def : Pat<(fsub SPR:$dstin, (fmul SPR:$a, SPR:$b)),
           (VMLSS SPR:$dstin, SPR:$a, SPR:$b)>, Requires<[DontUseNEONForFP]>;
 
-def VNMLAD : ADbI<0b11100, 0b01, 1, 0,
+def VNMLAD : ADbI_vmlX<0b11100, 0b01, 1, 0,
                  (outs DPR:$dst), (ins DPR:$dstin, DPR:$a, DPR:$b),
                  IIC_fpMAC64, "vnmla", ".f64\t$dst, $a, $b",
              [(set DPR:$dst, (fsub (fneg (fmul DPR:$a, DPR:$b)),

Modified: llvm/branches/Apple/Morbo/lib/Target/ARM/ARMSubtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/Target/ARM/ARMSubtarget.cpp?rev=99550&r1=99549&r2=99550&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/Target/ARM/ARMSubtarget.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/Target/ARM/ARMSubtarget.cpp Thu Mar 25 15:53:42 2010
@@ -26,6 +26,10 @@
 UseNEONFP("arm-use-neon-fp",
           cl::desc("Use NEON for single-precision FP"),
           cl::init(false), cl::Hidden);
+static cl::opt<bool>
+UseVMLxInstructions("arm-use-vmlx",
+                    cl::desc("Use VFP vmla and vmls instructions"),
+                    cl::init(true), cl::Hidden);
 
 static cl::opt<bool>
 UseMOVT("arm-use-movt",
@@ -36,6 +40,7 @@
   : ARMArchVersion(V4)
   , ARMFPUType(None)
   , UseNEONForSinglePrecisionFP(UseNEONFP)
+  , UseVMLx(UseVMLxInstructions)
   , IsThumb(isT)
   , ThumbMode(Thumb1)
   , PostRAScheduler(false)
@@ -122,6 +127,12 @@
     // operations with NEON instructions.
     if (UseNEONFP.getPosition() == 0)
       UseNEONForSinglePrecisionFP = true;
+    // The VFP vlma and vlms instructions don't play nicely with others;
+    // disable them.
+    // FIXME: This may be true for other variants as well. Get benchmark
+    // numbers and add them if determined that's the case.
+    if (UseVMLxInstructions.getPosition() == 0)
+      UseVMLx = false;
   }
 }
 

Modified: llvm/branches/Apple/Morbo/lib/Target/ARM/ARMSubtarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/Target/ARM/ARMSubtarget.h?rev=99550&r1=99549&r2=99550&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/Target/ARM/ARMSubtarget.h (original)
+++ llvm/branches/Apple/Morbo/lib/Target/ARM/ARMSubtarget.h Thu Mar 25 15:53:42 2010
@@ -50,6 +50,10 @@
   /// determine if NEON should actually be used.
   bool UseNEONForSinglePrecisionFP;
 
+  /// UseVMLx - If the VFP2 instructions are available, indicates whether
+  /// the VML[AS] instructions should be used.
+  bool UseVMLx;
+
   /// IsThumb - True if we are in thumb mode, false if in ARM mode.
   bool IsThumb;
 
@@ -119,6 +123,7 @@
   bool hasNEON() const { return ARMFPUType >= NEON;  }
   bool useNEONForSinglePrecisionFP() const {
     return hasNEON() && UseNEONForSinglePrecisionFP; }
+  bool useVMLx() const {return hasVFP2() && UseVMLx; }
 
   bool hasFP16() const { return HasFP16; }
 





More information about the llvm-branch-commits mailing list