[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

llvm-svn: 336596

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

index e3d7138..8cd8a2b 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 c0e8f64..c43915a 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
+}