qiucf created this revision. qiucf added reviewers: nemanjai, jhibbits, vit9696, kpn. Herald added subscribers: steven.zhang, kbarton. qiucf requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
As discussed in PR50385 <https://bugs.llvm.org/show_bug.cgi?id=50385>, strict-fp on PowerPC SPE has not been handled well. This patch disables it by default for SPE. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D103235 Files: clang/lib/Basic/Targets/PPC.cpp clang/test/CodeGen/builtins-ppc-fpconstrained.c Index: clang/test/CodeGen/builtins-ppc-fpconstrained.c =================================================================== --- clang/test/CodeGen/builtins-ppc-fpconstrained.c +++ 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; Index: clang/lib/Basic/Targets/PPC.cpp =================================================================== --- clang/lib/Basic/Targets/PPC.cpp +++ clang/lib/Basic/Targets/PPC.cpp @@ -59,6 +59,7 @@ } else if (Feature == "+prefix-instrs") { HasPrefixInstrs = true; } else if (Feature == "+spe" || Feature == "+efpu2") { + HasStrictFP = false; HasSPE = true; LongDoubleWidth = LongDoubleAlign = 64; LongDoubleFormat = &llvm::APFloat::IEEEdouble();
Index: clang/test/CodeGen/builtins-ppc-fpconstrained.c =================================================================== --- clang/test/CodeGen/builtins-ppc-fpconstrained.c +++ 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; Index: clang/lib/Basic/Targets/PPC.cpp =================================================================== --- clang/lib/Basic/Targets/PPC.cpp +++ clang/lib/Basic/Targets/PPC.cpp @@ -59,6 +59,7 @@ } else if (Feature == "+prefix-instrs") { HasPrefixInstrs = true; } else if (Feature == "+spe" || Feature == "+efpu2") { + HasStrictFP = false; HasSPE = true; LongDoubleWidth = LongDoubleAlign = 64; LongDoubleFormat = &llvm::APFloat::IEEEdouble();
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits