1 | // RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu -emit-llvm \ |
2 | // RUN: -target-cpu pwr9 -target-feature +float128 -o - %s | FileCheck %s |
3 | |
4 | __float128 A; |
5 | __float128 B; |
6 | __float128 C; |
7 | |
8 | |
9 | __float128 testSqrtOdd() { |
10 | return __builtin_sqrtf128_round_to_odd(A); |
11 | // CHECK: @llvm.ppc.sqrtf128.round.to.odd(fp128 |
12 | // CHECK-NEXT: ret fp128 |
13 | } |
14 | |
15 | __float128 testFMAOdd() { |
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 |
19 | } |
20 | |
21 | __float128 testAddOdd() { |
22 | return __builtin_addf128_round_to_odd(A, B); |
23 | // CHECK: @llvm.ppc.addf128.round.to.odd(fp128 %{{.+}}, fp128 |
24 | // CHECK-NEXT: ret fp128 |
25 | } |
26 | |
27 | __float128 testSubOdd() { |
28 | return __builtin_subf128_round_to_odd(A, B); |
29 | // CHECK: @llvm.ppc.subf128.round.to.odd(fp128 %{{.+}}, fp128 |
30 | // CHECK-NEXT: ret fp128 |
31 | } |
32 | |
33 | __float128 testMulOdd() { |
34 | return __builtin_mulf128_round_to_odd(A, B); |
35 | // CHECK: @llvm.ppc.mulf128.round.to.odd(fp128 %{{.+}}, fp128 |
36 | // CHECK-NEXT: ret fp128 |
37 | } |
38 | |
39 | __float128 testDivOdd() { |
40 | return __builtin_divf128_round_to_odd(A, B); |
41 | // CHECK: @llvm.ppc.divf128.round.to.odd(fp128 %{{.+}}, fp128 |
42 | // CHECK-NEXT: ret fp128 |
43 | } |
44 | |
45 | double testTruncOdd() { |
46 | return __builtin_truncf128_round_to_odd(A); |
47 | // CHECK: @llvm.ppc.truncf128.round.to.odd(fp128 |
48 | // CHECK-NEXT: ret double |
49 | } |
50 | |
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 |
55 | } |
56 | |
57 | unsigned long long int extract_exp() { |
58 | return __builtin_vsx_scalar_extract_expq(A); |
59 | // CHECK: @llvm.ppc.scalar.extract.expq(fp128 |
60 | // CHECK-NEXT: ret i64 |
61 | } |
62 | |
63 | |