[llvm-branch-commits] [clang] 6279fd1 - [SPE] Disable strict-fp for SPE by default

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jun 4 14:16:34 PDT 2021


Author: Qiu Chaofan
Date: 2021-06-04T17:14:43-04:00
New Revision: 6279fd114acba298b9b743755d7031d615c92d23

URL: https://github.com/llvm/llvm-project/commit/6279fd114acba298b9b743755d7031d615c92d23
DIFF: https://github.com/llvm/llvm-project/commit/6279fd114acba298b9b743755d7031d615c92d23.diff

LOG: [SPE] Disable strict-fp for SPE by default

As discussed in PR50385, strict-fp on PowerPC SPE has not been handled
well. This patch disables it by default for SPE.

Reviewed By: nemanjai, vit9696, jhibbits

Differential Revision: https://reviews.llvm.org/D103235

(cherry picked from commit 5c18d1136665f74b15c0df599f56ac3e2e947fb8)

Added: 
    

Modified: 
    clang/lib/Basic/Targets/PPC.cpp
    clang/test/CodeGen/builtins-ppc-fpconstrained.c

Removed: 
    


################################################################################
diff  --git a/clang/lib/Basic/Targets/PPC.cpp b/clang/lib/Basic/Targets/PPC.cpp
index ff09c0fa2a234..6c3036836c6df 100644
--- a/clang/lib/Basic/Targets/PPC.cpp
+++ b/clang/lib/Basic/Targets/PPC.cpp
@@ -57,6 +57,7 @@ bool PPCTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
     } else if (Feature == "+pcrelative-memops") {
       HasPCRelativeMemops = true;
     } else if (Feature == "+spe" || Feature == "+efpu2") {
+      HasStrictFP = false;
       HasSPE = true;
       LongDoubleWidth = LongDoubleAlign = 64;
       LongDoubleFormat = &llvm::APFloat::IEEEdouble();

diff  --git a/clang/test/CodeGen/builtins-ppc-fpconstrained.c b/clang/test/CodeGen/builtins-ppc-fpconstrained.c
index 880c0c339ef33..909210996064c 100644
--- a/clang/test/CodeGen/builtins-ppc-fpconstrained.c
+++ b/clang/test/CodeGen/builtins-ppc-fpconstrained.c
@@ -11,6 +11,9 @@
 // RUN: -fallow-half-arguments-and-returns -S -ffp-exception-behavior=strict \
 // RUN: -o - %s | FileCheck --check-prefix=CHECK-ASM \
 // RUN: --check-prefix=FIXME-CHECK  %s
+// RUN: %clang_cc1 -triple powerpcspe -S -ffp-exception-behavior=strict \
+// RUN: -target-feature +spe -fexperimental-strict-floating-point -emit-llvm \
+// RUN: %s -o - | FileCheck --check-prefix=CHECK-CONSTRAINED %s
 
 typedef __attribute__((vector_size(4 * sizeof(float)))) float vec_float;
 typedef __attribute__((vector_size(2 * sizeof(double)))) double vec_double;


        


More information about the llvm-branch-commits mailing list