[PATCH] D14066: [FPEnv Core 01/14] Add flags and command-line switches for FPEnv
Sergey Dmitrouk via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 4 11:56:52 PST 2015
sdmitrouk updated this revision to Diff 41906.
sdmitrouk added a comment.
Updated text of comments.
Repository:
rL LLVM
http://reviews.llvm.org/D14066
Files:
include/llvm/CodeGen/CommandFlags.h
include/llvm/Target/TargetOptions.h
Index: include/llvm/Target/TargetOptions.h
===================================================================
--- include/llvm/Target/TargetOptions.h
+++ include/llvm/Target/TargetOptions.h
@@ -71,6 +71,7 @@
TargetOptions()
: PrintMachineCode(false), LessPreciseFPMADOption(false),
UnsafeFPMath(false), NoInfsFPMath(false), NoNaNsFPMath(false),
+ AllowFPExceptAccess(false), AllowFPRoundAccess(false),
HonorSignDependentRoundingFPMathOption(false), NoZerosInBSS(false),
GuaranteedTailCallOpt(false), StackAlignmentOverride(0),
EnableFastISel(false), PositionIndependentExecutable(false),
@@ -119,6 +120,20 @@
/// assume the FP arithmetic arguments and results are never NaNs.
unsigned NoNaNsFPMath : 1;
+ /// AllowFPExceptAccess - This flag is enabled when the
+ /// -enable-except-access-fp-math or -enable-fenv-access-fp-math flag is
+ /// specified on the command line. When this flag is off (the default), the
+ /// code generator is allowed to assume the exceptions part of
+ /// floating-point environment is not accessed by the program.
+ unsigned AllowFPExceptAccess : 1;
+
+ /// AllowFPRoundAccess - This flag is enabled when the
+ /// -enable-control-access-fp-math or -enable-fenv-access-fp-math flag is
+ /// specified on the command line. When this flag is off (the default), the
+ /// code generator is allowed to assume the rounding part of floating-point
+ /// environment is not accessed by the program.
+ unsigned AllowFPRoundAccess : 1;
+
/// HonorSignDependentRoundingFPMath - This returns true when the
/// -enable-sign-dependent-rounding-fp-math is specified. If this returns
/// false (the default), the code generator is allowed to assume that the
Index: include/llvm/CodeGen/CommandFlags.h
===================================================================
--- include/llvm/CodeGen/CommandFlags.h
+++ include/llvm/CodeGen/CommandFlags.h
@@ -130,6 +130,23 @@
cl::desc("Force codegen to assume rounding mode can change dynamically"),
cl::init(false));
+cl::opt<bool>
+EnableFEnvAccessFPMath("enable-fenv-access-fp-math",
+ cl::desc("Disable optimizations that assume the default floating-point "
+ "environment or might change observable floating-point exceptions"),
+ cl::init(false));
+
+cl::opt<bool>
+EnableExceptAccessFPMath("enable-except-access-fp-math",
+ cl::desc("Disable FP math optimizations that affect FP exceptions"),
+ cl::init(false));
+
+cl::opt<bool>
+EnableControlAccessFPMath("enable-control-access-fp-math",
+ cl::desc("Disable optimizations that assume the default floating-point "
+ "environment, including rounding-mode"),
+ cl::init(false));
+
cl::opt<llvm::FloatABI::ABIType>
FloatABIForCalls("float-abi",
cl::desc("Choose float ABI type"),
@@ -268,6 +285,10 @@
Options.NoNaNsFPMath = EnableNoNaNsFPMath;
Options.HonorSignDependentRoundingFPMathOption =
EnableHonorSignDependentRoundingFPMath;
+ Options.AllowFPExceptAccess = EnableExceptAccessFPMath |
+ EnableFEnvAccessFPMath;
+ Options.AllowFPRoundAccess = EnableControlAccessFPMath |
+ EnableFEnvAccessFPMath;
if (FloatABIForCalls != FloatABI::Default)
Options.FloatABIType = FloatABIForCalls;
Options.NoZerosInBSS = DontPlaceZerosInBSS;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14066.41906.patch
Type: text/x-patch
Size: 3394 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151204/ec911ed6/attachment.bin>
More information about the llvm-commits
mailing list