1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -enable-ppc-gen-scalar-mass -O3 -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck --check-prefix=CHECK-LNX %s
3 ; RUN: llc -enable-ppc-gen-scalar-mass -O3 -mcpu=ppc -mtriple=powerpc-ibm-aix-xcoff < %s | FileCheck --check-prefix=CHECK-AIX %s
5 define void @cos_f64(ptr %arg) {
6 ; CHECK-LNX-LABEL: cos_f64:
7 ; CHECK-LNX: # %bb.0: # %bb
8 ; CHECK-LNX-NEXT: mflr 0
9 ; CHECK-LNX-NEXT: stdu 1, -32(1)
10 ; CHECK-LNX-NEXT: std 0, 48(1)
11 ; CHECK-LNX-NEXT: .cfi_def_cfa_offset 32
12 ; CHECK-LNX-NEXT: .cfi_offset lr, 16
13 ; CHECK-LNX-NEXT: addis 3, 2, .LCPI0_0@toc@ha
14 ; CHECK-LNX-NEXT: lfs 1, .LCPI0_0@toc@l(3)
15 ; CHECK-LNX-NEXT: bl __xl_cos_finite
17 ; CHECK-LNX-NEXT: xssqrtdp 0, 0
18 ; CHECK-LNX-NEXT: xsmuldp 0, 0, 1
19 ; CHECK-LNX-NEXT: .p2align 4
20 ; CHECK-LNX-NEXT: .LBB0_1: # %bb2
22 ; CHECK-LNX-NEXT: stfd 0, 0(3)
23 ; CHECK-LNX-NEXT: b .LBB0_1
25 ; CHECK-AIX-LABEL: cos_f64:
26 ; CHECK-AIX: # %bb.0: # %bb
27 ; CHECK-AIX-NEXT: mflr 0
28 ; CHECK-AIX-NEXT: stwu 1, -64(1)
29 ; CHECK-AIX-NEXT: stw 0, 72(1)
30 ; CHECK-AIX-NEXT: stfd 31, 56(1) # 8-byte Folded Spill
31 ; CHECK-AIX-NEXT: bl .sqrt[PR]
33 ; CHECK-AIX-NEXT: lwz 3, L..C0(2) # %const.0
34 ; CHECK-AIX-NEXT: fmr 31, 1
35 ; CHECK-AIX-NEXT: lfs 0, 0(3)
36 ; CHECK-AIX-NEXT: fmr 1, 0
37 ; CHECK-AIX-NEXT: bl .__xl_cos_finite[PR]
39 ; CHECK-AIX-NEXT: fmul 0, 31, 1
40 ; CHECK-AIX-NEXT: L..BB0_1: # %bb2
42 ; CHECK-AIX-NEXT: stfd 0, 0(3)
43 ; CHECK-AIX-NEXT: b L..BB0_1
45 %i1 = getelementptr i8, ptr %arg, i64 undef
49 %i3 = getelementptr inbounds i8, ptr %i1, i64 undef
50 store double undef, ptr %i3, align 8
51 %i7 = tail call fast double @llvm.sqrt.f64(double undef)
52 %i8 = fmul fast double undef, 0x401921FB54442D28
53 %i9 = tail call fast double @llvm.cos.f64(double %i8) #2
54 %i10 = fmul fast double %i7, %i9
55 store double %i10, ptr %i1, align 8
59 define void @log_f64(ptr %arg) {
60 ; CHECK-LNX-LABEL: log_f64:
61 ; CHECK-LNX: # %bb.0: # %bb
62 ; CHECK-LNX-NEXT: mflr 0
63 ; CHECK-LNX-NEXT: stdu 1, -32(1)
64 ; CHECK-LNX-NEXT: std 0, 48(1)
65 ; CHECK-LNX-NEXT: .cfi_def_cfa_offset 32
66 ; CHECK-LNX-NEXT: .cfi_offset lr, 16
67 ; CHECK-LNX-NEXT: addis 3, 2, .LCPI1_0@toc@ha
68 ; CHECK-LNX-NEXT: lfs 1, .LCPI1_0@toc@l(3)
69 ; CHECK-LNX-NEXT: bl __xl_log_finite
71 ; CHECK-LNX-NEXT: xssqrtdp 0, 0
72 ; CHECK-LNX-NEXT: xsmuldp 0, 0, 1
73 ; CHECK-LNX-NEXT: .p2align 4
74 ; CHECK-LNX-NEXT: .LBB1_1: # %bb2
76 ; CHECK-LNX-NEXT: stfd 0, 0(3)
77 ; CHECK-LNX-NEXT: b .LBB1_1
79 ; CHECK-AIX-LABEL: log_f64:
80 ; CHECK-AIX: # %bb.0: # %bb
81 ; CHECK-AIX-NEXT: mflr 0
82 ; CHECK-AIX-NEXT: stwu 1, -64(1)
83 ; CHECK-AIX-NEXT: stw 0, 72(1)
84 ; CHECK-AIX-NEXT: stfd 31, 56(1) # 8-byte Folded Spill
85 ; CHECK-AIX-NEXT: bl .sqrt[PR]
87 ; CHECK-AIX-NEXT: lwz 3, L..C1(2) # %const.0
88 ; CHECK-AIX-NEXT: fmr 31, 1
89 ; CHECK-AIX-NEXT: lfs 0, 0(3)
90 ; CHECK-AIX-NEXT: fmr 1, 0
91 ; CHECK-AIX-NEXT: bl .__xl_log_finite[PR]
93 ; CHECK-AIX-NEXT: fmul 0, 31, 1
94 ; CHECK-AIX-NEXT: L..BB1_1: # %bb2
96 ; CHECK-AIX-NEXT: stfd 0, 0(3)
97 ; CHECK-AIX-NEXT: b L..BB1_1
99 %i1 = getelementptr i8, ptr %arg, i64 undef
103 %i3 = getelementptr inbounds i8, ptr %i1, i64 undef
104 store double undef, ptr %i3, align 8
105 %i7 = tail call fast double @llvm.sqrt.f64(double undef)
106 %i8 = fmul fast double undef, 0x401921FB54442D28
107 %i9 = tail call fast double @llvm.log.f64(double %i8) #2
108 %i10 = fmul fast double %i7, %i9
109 store double %i10, ptr %i1, align 8
113 declare double @llvm.sqrt.f64(double)
114 declare double @llvm.cos.f64(double)
115 declare double @llvm.log.f64(double)