[llvm-commits] [llvm] r99565 - in /llvm/trunk/lib/Target/ARM: ARM.td ARMSubtarget.cpp ARMSubtarget.h

Jim Grosbach grosbach at apple.com
Thu Mar 25 16:11:16 PDT 2010


Author: grosbach
Date: Thu Mar 25 18:11:16 2010
New Revision: 99565

URL: http://llvm.org/viewvc/llvm-project?rev=99565&view=rev
Log:
switch the use-vml[as] instructions flag to a subtarget 'feature'

Modified:
    llvm/trunk/lib/Target/ARM/ARM.td
    llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp
    llvm/trunk/lib/Target/ARM/ARMSubtarget.h

Modified: llvm/trunk/lib/Target/ARM/ARM.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARM.td?rev=99565&r1=99564&r2=99565&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARM.td (original)
+++ llvm/trunk/lib/Target/ARM/ARM.td Thu Mar 25 18:11:16 2010
@@ -43,6 +43,15 @@
 def FeatureFP16   : SubtargetFeature<"fp16", "HasFP16", "true",
                                      "Enable half-precision floating point">;
 
+// Some processors have multiply-accumulate instructions that don't
+// play nicely with other VFP instructions, and it's generally better
+// to just not use them.
+// FIXME: Currently, this is only flagged for Cortex-A8. It may be true for
+// others as well. We should do more benchmarking and confirm one way or
+// the other.
+def HasSlowVMLx   : SubtargetFeature<"vmlx", "SlowVMLx", "true",
+                                     "Disable VFP MAC instructions">;
+
 //===----------------------------------------------------------------------===//
 // ARM Processors supported.
 //
@@ -106,7 +115,7 @@
 
 // V7 Processors.
 def : Processor<"cortex-a8",        CortexA8Itineraries,
-                [ArchV7A, FeatureThumb2, FeatureNEON]>;
+                [ArchV7A, FeatureThumb2, FeatureNEON, HasSlowVMLx]>;
 def : ProcNoItin<"cortex-a9",       [ArchV7A, FeatureThumb2, FeatureNEON]>;
 
 //===----------------------------------------------------------------------===//

Modified: llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp?rev=99565&r1=99564&r2=99565&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp Thu Mar 25 18:11:16 2010
@@ -26,10 +26,6 @@
 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",
@@ -40,7 +36,7 @@
   : ARMArchVersion(V4)
   , ARMFPUType(None)
   , UseNEONForSinglePrecisionFP(UseNEONFP)
-  , UseVMLx(UseVMLxInstructions)
+  , SlowVMLx(false)
   , IsThumb(isT)
   , ThumbMode(Thumb1)
   , PostRAScheduler(false)
@@ -127,12 +123,6 @@
     // 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/trunk/lib/Target/ARM/ARMSubtarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMSubtarget.h?rev=99565&r1=99564&r2=99565&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMSubtarget.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMSubtarget.h Thu Mar 25 18:11:16 2010
@@ -50,9 +50,9 @@
   /// 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;
+  /// SlowVMLx - If the VFP2 instructions are available, indicates whether
+  /// the VML[AS] instructions are slow (if so, don't use them).
+  bool SlowVMLx;
 
   /// IsThumb - True if we are in thumb mode, false if in ARM mode.
   bool IsThumb;
@@ -123,7 +123,7 @@
   bool hasNEON() const { return ARMFPUType >= NEON;  }
   bool useNEONForSinglePrecisionFP() const {
     return hasNEON() && UseNEONForSinglePrecisionFP; }
-  bool useVMLx() const {return hasVFP2() && UseVMLx; }
+  bool useVMLx() const {return hasVFP2() && !SlowVMLx; }
 
   bool hasFP16() const { return HasFP16; }
 





More information about the llvm-commits mailing list