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 -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: .cfi_def_cfa_offset 48
10 ; CHECK-LNX-NEXT: .cfi_offset lr, 16
11 ; CHECK-LNX-NEXT: .cfi_offset f31, -8
12 ; CHECK-LNX-NEXT: stfd 31, -8(1) # 8-byte Folded Spill
13 ; CHECK-LNX-NEXT: stdu 1, -48(1)
14 ; CHECK-LNX-NEXT: addis 3, 2, .LCPI0_0@toc@ha
15 ; CHECK-LNX-NEXT: std 0, 64(1)
16 ; CHECK-LNX-NEXT: xssqrtdp 31, 0
17 ; CHECK-LNX-NEXT: lfs 1, .LCPI0_0@toc@l(3)
18 ; CHECK-LNX-NEXT: bl __xl_cos
20 ; CHECK-LNX-NEXT: xsmuldp 0, 31, 1
21 ; CHECK-LNX-NEXT: .p2align 4
22 ; CHECK-LNX-NEXT: .LBB0_1: # %bb2
24 ; CHECK-LNX-NEXT: stfd 0, 0(3)
25 ; CHECK-LNX-NEXT: b .LBB0_1
27 ; CHECK-AIX-LABEL: cos_f64:
28 ; CHECK-AIX: # %bb.0: # %bb
29 ; CHECK-AIX-NEXT: mflr 0
30 ; CHECK-AIX-NEXT: stwu 1, -64(1)
31 ; CHECK-AIX-NEXT: stw 0, 72(1)
32 ; CHECK-AIX-NEXT: stfd 31, 56(1) # 8-byte Folded Spill
33 ; CHECK-AIX-NEXT: bl .sqrt[PR]
35 ; CHECK-AIX-NEXT: lwz 3, L..C0(2) # %const.0
36 ; CHECK-AIX-NEXT: fmr 31, 1
37 ; CHECK-AIX-NEXT: lfs 0, 0(3)
38 ; CHECK-AIX-NEXT: fmr 1, 0
39 ; CHECK-AIX-NEXT: bl .__xl_cos[PR]
41 ; CHECK-AIX-NEXT: fmul 0, 31, 1
42 ; CHECK-AIX-NEXT: L..BB0_1: # %bb2
44 ; CHECK-AIX-NEXT: stfd 0, 0(3)
45 ; CHECK-AIX-NEXT: b L..BB0_1
47 %i1 = getelementptr i8, ptr %arg, i64 undef
51 %i3 = getelementptr inbounds i8, ptr %i1, i64 undef
52 store double undef, ptr %i3, align 8
53 %i7 = tail call afn double @llvm.sqrt.f64(double undef)
54 %i8 = fmul afn double undef, 0x401921FB54442D28
55 %i9 = tail call afn double @llvm.cos.f64(double %i8) #2
56 %i10 = fmul afn double %i7, %i9
57 store double %i10, ptr %i1, align 8
61 define void @log_f64(ptr %arg) {
62 ; CHECK-LNX-LABEL: log_f64:
63 ; CHECK-LNX: # %bb.0: # %bb
64 ; CHECK-LNX-NEXT: mflr 0
65 ; CHECK-LNX-NEXT: .cfi_def_cfa_offset 48
66 ; CHECK-LNX-NEXT: .cfi_offset lr, 16
67 ; CHECK-LNX-NEXT: .cfi_offset f31, -8
68 ; CHECK-LNX-NEXT: stfd 31, -8(1) # 8-byte Folded Spill
69 ; CHECK-LNX-NEXT: stdu 1, -48(1)
70 ; CHECK-LNX-NEXT: addis 3, 2, .LCPI1_0@toc@ha
71 ; CHECK-LNX-NEXT: std 0, 64(1)
72 ; CHECK-LNX-NEXT: xssqrtdp 31, 0
73 ; CHECK-LNX-NEXT: lfs 1, .LCPI1_0@toc@l(3)
74 ; CHECK-LNX-NEXT: bl __xl_log
76 ; CHECK-LNX-NEXT: xsmuldp 0, 31, 1
77 ; CHECK-LNX-NEXT: .p2align 4
78 ; CHECK-LNX-NEXT: .LBB1_1: # %bb2
80 ; CHECK-LNX-NEXT: stfd 0, 0(3)
81 ; CHECK-LNX-NEXT: b .LBB1_1
83 ; CHECK-AIX-LABEL: log_f64:
84 ; CHECK-AIX: # %bb.0: # %bb
85 ; CHECK-AIX-NEXT: mflr 0
86 ; CHECK-AIX-NEXT: stwu 1, -64(1)
87 ; CHECK-AIX-NEXT: stw 0, 72(1)
88 ; CHECK-AIX-NEXT: stfd 31, 56(1) # 8-byte Folded Spill
89 ; CHECK-AIX-NEXT: bl .sqrt[PR]
91 ; CHECK-AIX-NEXT: lwz 3, L..C1(2) # %const.0
92 ; CHECK-AIX-NEXT: fmr 31, 1
93 ; CHECK-AIX-NEXT: lfs 0, 0(3)
94 ; CHECK-AIX-NEXT: fmr 1, 0
95 ; CHECK-AIX-NEXT: bl .__xl_log[PR]
97 ; CHECK-AIX-NEXT: fmul 0, 31, 1
98 ; CHECK-AIX-NEXT: L..BB1_1: # %bb2
100 ; CHECK-AIX-NEXT: stfd 0, 0(3)
101 ; CHECK-AIX-NEXT: b L..BB1_1
103 %i1 = getelementptr i8, ptr %arg, i64 undef
107 %i3 = getelementptr inbounds i8, ptr %i1, i64 undef
108 store double undef, ptr %i3, align 8
109 %i7 = tail call afn double @llvm.sqrt.f64(double undef)
110 %i8 = fmul afn double undef, 0x401921FB54442D28
111 %i9 = tail call afn double @llvm.log.f64(double %i8) #2
112 %i10 = fmul afn double %i7, %i9
113 store double %i10, ptr %i1, align 8
117 declare double @llvm.sqrt.f64(double)
118 declare double @llvm.cos.f64(double)
119 declare double @llvm.log.f64(double)