Implement -cl-fast-relaxed-math
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120880 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Basic/LangOptions.h b/include/clang/Basic/LangOptions.h
index 88e3c8a..29a97d2 100644
--- a/include/clang/Basic/LangOptions.h
+++ b/include/clang/Basic/LangOptions.h
@@ -113,6 +113,8 @@
unsigned SinglePrecisionConstants : 1; // Whether to treat double-precision
// floating point constants as
// single precision constants.
+ unsigned FastRelaxedMath : 1; // OpenCL fast relaxed math (on its own,
+ // defines __FAST_RELAXED_MATH__).
// FIXME: This is just a temporary option, for testing purposes.
unsigned NoBitFieldTypeAlign : 1;
@@ -200,6 +202,7 @@
DumpVTableLayouts = 0;
SpellChecking = 1;
SinglePrecisionConstants = 0;
+ FastRelaxedMath = 0;
NoBitFieldTypeAlign = 0;
}
diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td
index a7b2692..13919aa 100644
--- a/include/clang/Driver/CC1Options.td
+++ b/include/clang/Driver/CC1Options.td
@@ -605,3 +605,5 @@
HelpText<"OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.">;
def cl_unsafe_math_optimizations : Flag<"-cl-unsafe-math-optimizations">,
HelpText<"OpenCL only. Allow unsafe floating-point optimizations. Also implies -cl-no-signed-zeros and -cl-mad-enable">;
+def cl_fast_relaxed_math : Flag<"-cl-fast-relaxed-math">,
+ HelpText<"OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines __FAST_RELAXED_MATH__">;