r336596 - [Power9] [CLANG] Add __float128 support for trunc to double round to odd

Stefan Pintilie via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 9 13:09:53 PDT 2018


Author: stefanp
Date: Mon Jul  9 13:09:52 2018
New Revision: 336596

URL: http://llvm.org/viewvc/llvm-project?rev=336596&view=rev
Log:
[Power9] [CLANG] Add __float128 support for trunc to double round to odd

Add support for this builtin:
double builtin_truncf128_round_to_odd(float128)

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

Modified:
    cfe/trunk/include/clang/Basic/BuiltinsPPC.def
    cfe/trunk/test/CodeGen/builtins-ppc-p9-f128.c

Modified: cfe/trunk/include/clang/Basic/BuiltinsPPC.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsPPC.def?rev=336596&r1=336595&r2=336596&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsPPC.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsPPC.def Mon Jul  9 13:09:52 2018
@@ -430,6 +430,7 @@ BUILTIN(__builtin_subf128_round_to_odd,
 BUILTIN(__builtin_mulf128_round_to_odd, "LLdLLdLLd", "")
 BUILTIN(__builtin_divf128_round_to_odd, "LLdLLdLLd", "")
 BUILTIN(__builtin_fmaf128_round_to_odd, "LLdLLdLLdLLd", "")
+BUILTIN(__builtin_truncf128_round_to_odd, "dLLd", "")
 
 // HTM builtins
 BUILTIN(__builtin_tbegin, "UiUIi", "")

Modified: cfe/trunk/test/CodeGen/builtins-ppc-p9-f128.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtins-ppc-p9-f128.c?rev=336596&r1=336595&r2=336596&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/builtins-ppc-p9-f128.c (original)
+++ cfe/trunk/test/CodeGen/builtins-ppc-p9-f128.c Mon Jul  9 13:09:52 2018
@@ -42,4 +42,9 @@ __float128 testDivOdd() {
 // CHECK-NEXT: ret fp128
 }
 
+double testTruncOdd() {
+  return __builtin_truncf128_round_to_odd(A);
+// CHECK: @llvm.ppc.truncf128.round.to.odd(fp128
+// CHECK-NEXT: ret double
+}
 




More information about the cfe-commits mailing list