Added option -soft-float to generate SW fp library calls instead of fp instructions.
authorEvan Cheng <evan.cheng@apple.com>
Sat, 9 Dec 2006 02:41:30 +0000 (02:41 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Sat, 9 Dec 2006 02:41:30 +0000 (02:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32393 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetOptions.h
lib/Target/TargetMachine.cpp

index ea391b77bb62c73867353c8f6220072f6963f93b..4d21b0b06030d7602b4317b32a510ebd51913459 100644 (file)
@@ -48,6 +48,12 @@ namespace llvm {
   /// and results are never NaNs or +-Infs.
   extern bool FiniteOnlyFPMathOption;
   extern bool FiniteOnlyFPMath();
+  
+  /// UseSoftFloat - This flag is enabled when the -soft-float flag is specified
+  /// on the command line.  When this flag is on, the code generator will
+  /// generate libcalls to the software floating point library instead of
+  /// target FP instructions.
+  extern bool UseSoftFloat;
 } // End llvm namespace
 
 #endif
index e4ece7b4d52b4996504ae872e1b57be5469c50d8..7547614a717425d446f0ac5772b52eae0bd2bef5 100644 (file)
@@ -27,6 +27,7 @@ namespace llvm {
   bool NoExcessFPPrecision;
   bool UnsafeFPMath;
   bool FiniteOnlyFPMathOption;
+  bool UseSoftFloat;
   Reloc::Model RelocationModel;
   CodeModel::Model CMModel;
 }
@@ -55,6 +56,12 @@ namespace {
                cl::desc("Enable optimizations that assumes non- NaNs / +-Infs"),
                cl::location(FiniteOnlyFPMathOption),
                cl::init(false));
+  cl::opt<bool, true>
+  GenerateSoftFloatCalls("soft-float",
+               cl::desc("Generate software floating point library calls"),
+               cl::location(UseSoftFloat),
+               cl::init(false));
+
   cl::opt<llvm::Reloc::Model, true>
   DefRelocationModel(
     "relocation-model",