diff options
author | Mon P Wang <wangmp@apple.com> | 2009-03-20 05:06:58 +0000 |
---|---|---|
committer | Mon P Wang <wangmp@apple.com> | 2009-03-20 05:06:58 +0000 |
commit | f67448adf84feb2896c859f6302e99afed949a25 (patch) | |
tree | 11873963841557561fb21566de97e65f889478a7 /llvm/lib/Target/TargetMachine.cpp | |
parent | d972e2247b6330f6a6a252b0ada59fd0f618c0bc (diff) | |
download | llvm-f67448adf84feb2896c859f6302e99afed949a25.zip llvm-f67448adf84feb2896c859f6302e99afed949a25.tar.gz llvm-f67448adf84feb2896c859f6302e99afed949a25.tar.bz2 |
Added option to enable generating less precise mad (multiply addition)
for those architectures that support the instruction.
llvm-svn: 67363
Diffstat (limited to 'llvm/lib/Target/TargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/TargetMachine.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp index 2aed083..870fe61 100644 --- a/llvm/lib/Target/TargetMachine.cpp +++ b/llvm/lib/Target/TargetMachine.cpp @@ -22,6 +22,7 @@ using namespace llvm; // namespace llvm { + bool LessPreciseFPMADOption; bool PrintMachineCode; bool NoFramePointerElim; bool NoExcessFPPrecision; @@ -59,6 +60,11 @@ DisableExcessPrecision("disable-excess-fp-precision", cl::location(NoExcessFPPrecision), cl::init(false)); static cl::opt<bool, true> +EnableFPMAD("enable-fp-mad", + cl::desc("Enable less precise MAD instructions to be generated"), + cl::location(LessPreciseFPMADOption), + cl::init(false)); +static cl::opt<bool, true> EnableUnsafeFPMath("enable-unsafe-fp-math", cl::desc("Enable optimizations that may decrease FP precision"), cl::location(UnsafeFPMath), @@ -198,6 +204,12 @@ void TargetMachine::setCodeModel(CodeModel::Model Model) { } namespace llvm { + /// LessPreciseFPMAD - This flag return true when -enable-fp-mad option + /// is specified on the command line. When this flag is off(default), the + /// code generator is not allowed to generate mad (multiply add) if the + /// result is "less precise" than doing those operations individually. + bool LessPreciseFPMAD() { return UnsafeFPMath || LessPreciseFPMADOption; } + /// FiniteOnlyFPMath - This returns true when the -enable-finite-only-fp-math /// option is specified on the command line. If this returns false (default), /// the code generator is not allowed to assume that FP arithmetic arguments |