]> granicus.if.org Git - clang/commitdiff
[Power9] [CLANG] Add __float128 support for trunc to double round to odd
authorStefan Pintilie <stefanp@ca.ibm.com>
Mon, 9 Jul 2018 20:09:52 +0000 (20:09 +0000)
committerStefan Pintilie <stefanp@ca.ibm.com>
Mon, 9 Jul 2018 20:09:52 +0000 (20:09 +0000)
Add support for this builtin:
double builtin_truncf128_round_to_odd(float128)

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336596 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/BuiltinsPPC.def
test/CodeGen/builtins-ppc-p9-f128.c

index e3d71385eb690dcf7635ffd45a58ff9f3893bc71..8cd8a2be2003083dd67498175842aa06bfeb0c03 100644 (file)
@@ -430,6 +430,7 @@ BUILTIN(__builtin_subf128_round_to_odd, "LLdLLdLLd", "")
 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", "")
index c0e8f6485c4e5220818c9d72438c8f9a1d72689d..c43915ad248956ec639b00b80991b0f218e7b103 100644 (file)
@@ -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
+}