[clang] 8ecc852 - [FPEnv] [Clang] Enable constrained FP support for PowerPC

Qiu Chaofan via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 11 09:40:37 PDT 2020


Author: Qiu Chaofan
Date: 2020-09-12T00:39:52+08:00
New Revision: 8ecc8520bc5bc20ae00c13e5ae13f8edbb80642e

URL: https://github.com/llvm/llvm-project/commit/8ecc8520bc5bc20ae00c13e5ae13f8edbb80642e
DIFF: https://github.com/llvm/llvm-project/commit/8ecc8520bc5bc20ae00c13e5ae13f8edbb80642e.diff

LOG: [FPEnv] [Clang] Enable constrained FP support for PowerPC

d4ce862f introduced HasStrictFP to disable generating constrained FP
operations for platforms lacking support. Since work for enabling
constrained FP on PowerPC is almost done, we'd like to enable it.

Reviewed By: kpn, steven.zhang

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/lib/Basic/Targets/PPC.h b/clang/lib/Basic/Targets/PPC.h
index bca06a7a802dd..ec067d8811fc6 100644
--- a/clang/lib/Basic/Targets/PPC.h
+++ b/clang/lib/Basic/Targets/PPC.h
@@ -82,6 +82,7 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public TargetInfo {
     SimdDefaultAlign = 128;
     LongDoubleWidth = LongDoubleAlign = 128;
     LongDoubleFormat = &llvm::APFloat::PPCDoubleDouble();
+    HasStrictFP = true;
   }
 
   // Set the language option for altivec based on our value.

diff  --git a/clang/test/CodeGen/builtins-ppc-fpconstrained.c b/clang/test/CodeGen/builtins-ppc-fpconstrained.c
index 7c770845090fc..880c0c339ef33 100644
--- a/clang/test/CodeGen/builtins-ppc-fpconstrained.c
+++ b/clang/test/CodeGen/builtins-ppc-fpconstrained.c
@@ -2,14 +2,12 @@
 // RUN: %clang_cc1 -triple powerpc64le-gnu-linux -target-feature +vsx \
 // RUN: -emit-llvm %s -o - | FileCheck --check-prefix=CHECK-UNCONSTRAINED %s
 // RUN: %clang_cc1 -triple powerpc64le-gnu-linux -target-feature +vsx \
-// RUN: -fexperimental-strict-floating-point \
 // RUN:  -ffp-exception-behavior=strict -emit-llvm %s -o - | FileCheck \
 // RUN: --check-prefix=CHECK-CONSTRAINED -vv %s
 // RUN: %clang_cc1 -triple powerpc64le-gnu-linux -target-feature +vsx \
 // RUN: -fallow-half-arguments-and-returns -S -o - %s | \
 // RUN: FileCheck --check-prefix=CHECK-ASM --check-prefix=NOT-FIXME-CHECK  %s
 // RUN: %clang_cc1 -triple powerpc64le-gnu-linux -target-feature +vsx \
-// RUN: -fexperimental-strict-floating-point \
 // 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


        


More information about the cfe-commits mailing list