[PATCH] D24909: fix for not copying fp denormal and trapping options.

Sjoerd Meijer via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 26 05:18:51 PDT 2016


SjoerdMeijer created this revision.
SjoerdMeijer added reviewers: rengolin, jmolloy, olista01.
SjoerdMeijer added a subscriber: cfe-commits.

This is a fix for not copying fp denormal and trapping options, and depends on the nfc cleanups in D24906 and D24907.

https://reviews.llvm.org/D24909

Files:
  lib/CodeGen/BackendUtil.cpp

Index: lib/CodeGen/BackendUtil.cpp
===================================================================
--- lib/CodeGen/BackendUtil.cpp
+++ lib/CodeGen/BackendUtil.cpp
@@ -537,6 +537,13 @@
       .Case("posix", llvm::ThreadModel::POSIX)
       .Case("single", llvm::ThreadModel::Single);
 
+  Options.FPDenormalMode =
+    llvm::StringSwitch<llvm::FPDenormal::DenormalMode>(CodeGenOpts.FPDenormalMode)
+      .Case("ieee", llvm::FPDenormal::IEEE)
+      .Case("preserve-sign", llvm::FPDenormal::PreserveSign)
+      .Case("positive-zero", llvm::FPDenormal::PositiveZero)
+      .Default(llvm::FPDenormal::IEEE);
+
   // Set float ABI type.
   assert((CodeGenOpts.FloatABI == "soft" || CodeGenOpts.FloatABI == "softfp" ||
           CodeGenOpts.FloatABI == "hard" || CodeGenOpts.FloatABI.empty()) &&
@@ -579,6 +586,7 @@
   Options.LessPreciseFPMADOption = CodeGenOpts.LessPreciseFPMAD;
   Options.NoInfsFPMath = CodeGenOpts.NoInfsFPMath;
   Options.NoNaNsFPMath = CodeGenOpts.NoNaNsFPMath;
+  Options.NoTrappingFPMath = CodeGenOpts.NoTrappingMath;
   Options.NoZerosInBSS = CodeGenOpts.NoZeroInitializedInBSS;
   Options.UnsafeFPMath = CodeGenOpts.UnsafeFPMath;
   Options.StackAlignmentOverride = CodeGenOpts.StackAlignment;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24909.72463.patch
Type: text/x-patch
Size: 1224 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160926/2e52a30b/attachment-0001.bin>


More information about the cfe-commits mailing list