r342911 - [Power9] [CLANG] Add __float128 exponent GET and SET builtins
Stefan Pintilie via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 24 11:14:50 PDT 2018
Author: stefanp
Date: Mon Sep 24 11:14:50 2018
New Revision: 342911
URL: http://llvm.org/viewvc/llvm-project?rev=342911&view=rev
Log:
[Power9] [CLANG] Add __float128 exponent GET and SET builtins
Added
__builtin_vsx_scalar_extract_expq
__builtin_vsx_scalar_insert_exp_qp
Builtins should behave the same way as in GCC.
Differential Revision: https://reviews.llvm.org/D48184
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=342911&r1=342910&r2=342911&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsPPC.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsPPC.def Mon Sep 24 11:14:50 2018
@@ -431,6 +431,8 @@ BUILTIN(__builtin_mulf128_round_to_odd,
BUILTIN(__builtin_divf128_round_to_odd, "LLdLLdLLd", "")
BUILTIN(__builtin_fmaf128_round_to_odd, "LLdLLdLLdLLd", "")
BUILTIN(__builtin_truncf128_round_to_odd, "dLLd", "")
+BUILTIN(__builtin_vsx_scalar_extract_expq, "ULLiLLd", "")
+BUILTIN(__builtin_vsx_scalar_insert_exp_qp, "LLdLLdULLi", "")
// 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=342911&r1=342910&r2=342911&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/builtins-ppc-p9-f128.c (original)
+++ cfe/trunk/test/CodeGen/builtins-ppc-p9-f128.c Mon Sep 24 11:14:50 2018
@@ -48,3 +48,15 @@ double testTruncOdd() {
// CHECK-NEXT: ret double
}
+__float128 insert_exp_qp(unsigned long long int b) {
+ return __builtin_vsx_scalar_insert_exp_qp(A, b);
+// CHECK: @llvm.ppc.scalar.insert.exp.qp(fp128 %{{.+}}, i64
+// CHECK-NEXT: ret fp128
+}
+
+unsigned long long int extract_exp() {
+ return __builtin_vsx_scalar_extract_expq(A);
+// CHECK: @llvm.ppc.scalar.extract.expq(fp128
+// CHECK-NEXT: ret i64
+}
+
More information about the cfe-commits
mailing list