diff --git a/include/llvm/Target/TargetOptions.h b/include/llvm/Target/TargetOptions.h index ea391b77bb6..4d21b0b0603 100644 --- a/include/llvm/Target/TargetOptions.h +++ b/include/llvm/Target/TargetOptions.h @@ -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 diff --git a/lib/Target/TargetMachine.cpp b/lib/Target/TargetMachine.cpp index e4ece7b4d52..7547614a717 100644 --- a/lib/Target/TargetMachine.cpp +++ b/lib/Target/TargetMachine.cpp @@ -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 + GenerateSoftFloatCalls("soft-float", + cl::desc("Generate software floating point library calls"), + cl::location(UseSoftFloat), + cl::init(false)); + cl::opt DefRelocationModel( "relocation-model",