/// this flag is off (the default), the code generator is not allowed to
/// produce results that are "less precise" than IEEE allows. This includes
/// use of X86 instructions like FSIN and FCOS instead of libcalls.
+ /// UnsafeFPMath implies FiniteOnlyFPMath.
extern bool UnsafeFPMath;
- /// FiniteOnlyFPMath - This is enabled when the -enable-finite-only-fp-math
- /// flag is specified on the command line. When this flag is off (default),
+ /// 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
- /// and results are never NaNs or +-Infs. This includes ignoring parity flag
- /// (PF) when checking for FP equality.
- extern bool FiniteOnlyFPMath;
+ /// and results are never NaNs or +-Infs.
+ extern bool FiniteOnlyFPMathOption;
+ extern bool FiniteOnlyFPMath();
} // End llvm namespace
#endif
SDOperand Op1 = getValue(I.getOperand(0));
SDOperand Op2 = getValue(I.getOperand(1));
ISD::CondCode Opcode = SignedOpcode;
- if ((!UnsafeFPMath && !FiniteOnlyFPMath) &&
- I.getOperand(0)->getType()->isFloatingPoint())
+ if (!FiniteOnlyFPMath() && I.getOperand(0)->getType()->isFloatingPoint())
Opcode = FPOpcode;
else if (I.getOperand(0)->getType()->isUnsigned())
Opcode = UnsignedOpcode;
bool NoFramePointerElim;
bool NoExcessFPPrecision;
bool UnsafeFPMath;
- bool FiniteOnlyFPMath;
+ bool FiniteOnlyFPMathOption;
Reloc::Model RelocationModel;
};
namespace {
cl::opt<bool, true>
EnableFiniteOnltFPMath("enable-finite-only-fp-math",
cl::desc("Enable optimizations that assumes non- NaNs / +-Infs"),
- cl::location(FiniteOnlyFPMath),
+ cl::location(FiniteOnlyFPMathOption),
cl::init(false));
cl::opt<llvm::Reloc::Model, true>
DefRelocationModel(
void TargetMachine::setRelocationModel(Reloc::Model Model) {
RelocationModel = Model;
}
+
+namespace llvm {
+ /// 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
+ /// and results are never NaNs or +-Infs.
+ bool FiniteOnlyFPMath() { return UnsafeFPMath || FiniteOnlyFPMathOption; }
+};