1 // RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu -emit-llvm \
2 // RUN: -target-cpu pwr9 -target-feature +float128 -o - %s | FileCheck %s
9 __float128
testSqrtOdd(void) {
10 return __builtin_sqrtf128_round_to_odd(A
);
11 // CHECK: @llvm.ppc.sqrtf128.round.to.odd(fp128
12 // CHECK-NEXT: ret fp128
15 __float128
testFMAOdd(void) {
16 return __builtin_fmaf128_round_to_odd(A
, B
, C
);
17 // CHECK: @llvm.ppc.fmaf128.round.to.odd(fp128 %{{.+}}, fp128 %{{.+}}, fp128
18 // CHECK-NEXT: ret fp128
21 __float128
testAddOdd(void) {
22 return __builtin_addf128_round_to_odd(A
, B
);
23 // CHECK: @llvm.ppc.addf128.round.to.odd(fp128 %{{.+}}, fp128
24 // CHECK-NEXT: ret fp128
27 __float128
testSubOdd(void) {
28 return __builtin_subf128_round_to_odd(A
, B
);
29 // CHECK: @llvm.ppc.subf128.round.to.odd(fp128 %{{.+}}, fp128
30 // CHECK-NEXT: ret fp128
33 __float128
testMulOdd(void) {
34 return __builtin_mulf128_round_to_odd(A
, B
);
35 // CHECK: @llvm.ppc.mulf128.round.to.odd(fp128 %{{.+}}, fp128
36 // CHECK-NEXT: ret fp128
39 __float128
testDivOdd(void) {
40 return __builtin_divf128_round_to_odd(A
, B
);
41 // CHECK: @llvm.ppc.divf128.round.to.odd(fp128 %{{.+}}, fp128
42 // CHECK-NEXT: ret fp128
45 double testTruncOdd(void) {
46 return __builtin_truncf128_round_to_odd(A
);
47 // CHECK: @llvm.ppc.truncf128.round.to.odd(fp128
48 // CHECK-NEXT: ret double
51 __float128
insert_exp_qp(unsigned long long int b
) {
52 return __builtin_vsx_scalar_insert_exp_qp(A
, b
);
53 // CHECK: @llvm.ppc.scalar.insert.exp.qp(fp128 %{{.+}}, i64
54 // CHECK-NEXT: ret fp128
57 unsigned long long int extract_exp(void) {
58 return __builtin_vsx_scalar_extract_expq(A
);
59 // CHECK: @llvm.ppc.scalar.extract.expq(fp128
60 // CHECK-NEXT: ret i64
63 int test_data_class_f128(__float128 q
) {
64 return __builtin_ppc_test_data_class(q
, 0);
65 // CHECK-LABEL: @test_data_class_f128
66 // CHECK: [[TMP:%.*]] = call i32 @llvm.ppc.test.data.class.f128(fp128 %0, i32 0)
67 // CHECK-NEXT: ret i32 [[TMP]]