Skip to content

Commit 5c18d11

Browse files
committed
[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
1 parent b44007b commit 5c18d11

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

clang/lib/Basic/Targets/PPC.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ bool PPCTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
5959
} else if (Feature == "+prefix-instrs") {
6060
HasPrefixInstrs = true;
6161
} else if (Feature == "+spe" || Feature == "+efpu2") {
62+
HasStrictFP = false;
6263
HasSPE = true;
6364
LongDoubleWidth = LongDoubleAlign = 64;
6465
LongDoubleFormat = &llvm::APFloat::IEEEdouble();

clang/test/CodeGen/builtins-ppc-fpconstrained.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
// RUN: -fallow-half-arguments-and-returns -S -ffp-exception-behavior=strict \
1212
// RUN: -o - %s | FileCheck --check-prefix=CHECK-ASM \
1313
// RUN: --check-prefix=FIXME-CHECK %s
14+
// RUN: %clang_cc1 -triple powerpcspe -S -ffp-exception-behavior=strict \
15+
// RUN: -target-feature +spe -fexperimental-strict-floating-point -emit-llvm \
16+
// RUN: %s -o - | FileCheck --check-prefix=CHECK-CONSTRAINED %s
1417

1518
typedef __attribute__((vector_size(4 * sizeof(float)))) float vec_float;
1619
typedef __attribute__((vector_size(2 * sizeof(double)))) double vec_double;

0 commit comments

Comments
 (0)