mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 16:17:17 +00:00
Added option to enable generating less precise mad (multiply addition)
for those architectures that support the instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67363 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -26,6 +26,14 @@ namespace llvm {
|
|||||||
/// elimination optimization, this option should disable it.
|
/// elimination optimization, this option should disable it.
|
||||||
extern bool NoFramePointerElim;
|
extern bool NoFramePointerElim;
|
||||||
|
|
||||||
|
/// LessPreciseFPMAD - This flag is enabled when the
|
||||||
|
/// -enable-fp-mad is specified on the command line. When this flag is off
|
||||||
|
/// (the default), the code generator is not allowed to generate mad
|
||||||
|
/// (multiply add) if the result is "less precise" than doing those operations
|
||||||
|
/// individually.
|
||||||
|
extern bool LessPreciseFPMADOption;
|
||||||
|
extern bool LessPreciseFPMAD();
|
||||||
|
|
||||||
/// NoExcessFPPrecision - This flag is enabled when the
|
/// NoExcessFPPrecision - This flag is enabled when the
|
||||||
/// -disable-excess-fp-precision flag is specified on the command line. When
|
/// -disable-excess-fp-precision flag is specified on the command line. When
|
||||||
/// this flag is off (the default), the code generator is allowed to produce
|
/// this flag is off (the default), the code generator is allowed to produce
|
||||||
@@ -39,7 +47,7 @@ namespace llvm {
|
|||||||
/// this flag is off (the default), the code generator is not allowed to
|
/// this flag is off (the default), the code generator is not allowed to
|
||||||
/// produce results that are "less precise" than IEEE allows. This includes
|
/// produce results that are "less precise" than IEEE allows. This includes
|
||||||
/// use of X86 instructions like FSIN and FCOS instead of libcalls.
|
/// use of X86 instructions like FSIN and FCOS instead of libcalls.
|
||||||
/// UnsafeFPMath implies FiniteOnlyFPMath.
|
/// UnsafeFPMath implies FiniteOnlyFPMath and LessPreciseFPMAD.
|
||||||
extern bool UnsafeFPMath;
|
extern bool UnsafeFPMath;
|
||||||
|
|
||||||
/// FiniteOnlyFPMath - This returns true when the -enable-finite-only-fp-math
|
/// FiniteOnlyFPMath - This returns true when the -enable-finite-only-fp-math
|
||||||
|
@@ -22,6 +22,7 @@ using namespace llvm;
|
|||||||
//
|
//
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
bool LessPreciseFPMADOption;
|
||||||
bool PrintMachineCode;
|
bool PrintMachineCode;
|
||||||
bool NoFramePointerElim;
|
bool NoFramePointerElim;
|
||||||
bool NoExcessFPPrecision;
|
bool NoExcessFPPrecision;
|
||||||
@@ -59,6 +60,11 @@ DisableExcessPrecision("disable-excess-fp-precision",
|
|||||||
cl::location(NoExcessFPPrecision),
|
cl::location(NoExcessFPPrecision),
|
||||||
cl::init(false));
|
cl::init(false));
|
||||||
static cl::opt<bool, true>
|
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",
|
EnableUnsafeFPMath("enable-unsafe-fp-math",
|
||||||
cl::desc("Enable optimizations that may decrease FP precision"),
|
cl::desc("Enable optimizations that may decrease FP precision"),
|
||||||
cl::location(UnsafeFPMath),
|
cl::location(UnsafeFPMath),
|
||||||
@@ -198,6 +204,12 @@ void TargetMachine::setCodeModel(CodeModel::Model Model) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace llvm {
|
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
|
/// FiniteOnlyFPMath - This returns true when the -enable-finite-only-fp-math
|
||||||
/// option is specified on the command line. If this returns false (default),
|
/// option is specified on the command line. If this returns false (default),
|
||||||
/// the code generator is not allowed to assume that FP arithmetic arguments
|
/// the code generator is not allowed to assume that FP arithmetic arguments
|
||||||
|
Reference in New Issue
Block a user