[cfe-commits] r120881 - in /cfe/trunk: include/clang/Driver/CC1Options.td include/clang/Frontend/CodeGenOptions.h lib/CodeGen/BackendUtil.cpp lib/Frontend/CompilerInvocation.cpp

Peter Collingbourne peter at pcc.me.uk
Fri Dec 3 17:51:33 PST 2010


Author: pcc
Date: Fri Dec  3 19:51:33 2010
New Revision: 120881

URL: http://llvm.org/viewvc/llvm-project?rev=120881&view=rev
Log:
Implement -cl-mad-enable

Modified:
    cfe/trunk/include/clang/Driver/CC1Options.td
    cfe/trunk/include/clang/Frontend/CodeGenOptions.h
    cfe/trunk/lib/CodeGen/BackendUtil.cpp
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp

Modified: cfe/trunk/include/clang/Driver/CC1Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=120881&r1=120880&r2=120881&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/CC1Options.td (original)
+++ cfe/trunk/include/clang/Driver/CC1Options.td Fri Dec  3 19:51:33 2010
@@ -607,3 +607,5 @@
   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__">;
+def cl_mad_enable : Flag<"-cl-mad-enable">,
+  HelpText<"OpenCL only. Enable less precise MAD instructions to be generated.">;

Modified: cfe/trunk/include/clang/Frontend/CodeGenOptions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/CodeGenOptions.h?rev=120881&r1=120880&r2=120881&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/CodeGenOptions.h (original)
+++ cfe/trunk/include/clang/Frontend/CodeGenOptions.h Fri Dec  3 19:51:33 2010
@@ -56,6 +56,8 @@
   unsigned HiddenWeakVTables : 1; /// Emit weak vtables, RTTI, and thunks with
                                   /// hidden visibility
   unsigned InstrumentFunctions : 1; /// Set when -finstrument-functions is enabled
+  unsigned LessPreciseFPMAD  : 1; /// Enable less precise MAD instructions to be
+                                  /// generated.
   unsigned MergeAllConstants : 1; /// Merge identical constants.
   unsigned NoCommon          : 1; /// Set when -fno-common or C++ is enabled.
   unsigned NoImplicitFloat   : 1; /// Set when -mno-implicit-float is enabled.
@@ -123,6 +125,7 @@
     HiddenWeakTemplateVTables = 0;
     HiddenWeakVTables = 0;
     InstrumentFunctions = 0;
+    LessPreciseFPMAD = 0;
     MergeAllConstants = 1;
     NoCommon = 0;
     NoImplicitFloat = 0;

Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=120881&r1=120880&r2=120881&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Fri Dec  3 19:51:33 2010
@@ -183,6 +183,7 @@
     llvm::FloatABIType = llvm::FloatABI::Default;
   }
 
+  llvm::LessPreciseFPMADOption = CodeGenOpts.LessPreciseFPMAD;
   llvm::NoInfsFPMath = CodeGenOpts.NoInfsFPMath;
   llvm::NoNaNsFPMath = CodeGenOpts.NoNaNsFPMath;
   NoZerosInBSS = CodeGenOpts.NoZeroInitializedInBSS;

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=120881&r1=120880&r2=120881&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Fri Dec  3 19:51:33 2010
@@ -897,6 +897,7 @@
   Opts.DisableFPElim = Args.hasArg(OPT_mdisable_fp_elim);
   Opts.FloatABI = Args.getLastArgValue(OPT_mfloat_abi);
   Opts.HiddenWeakVTables = Args.hasArg(OPT_fhidden_weak_vtables);
+  Opts.LessPreciseFPMAD = Args.hasArg(OPT_cl_mad_enable);
   Opts.LimitFloatPrecision = Args.getLastArgValue(OPT_mlimit_float_precision);
   Opts.NoInfsFPMath = Opts.NoNaNsFPMath = Args.hasArg(OPT_cl_finite_math_only)||
                                           Args.hasArg(OPT_cl_fast_relaxed_math);





More information about the cfe-commits mailing list