1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -global-isel -o - \
3 ; RUN: -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names -verify-machineinstrs < %s | FileCheck %s
5 define i64 @load_i64(ptr %p) {
6 ; CHECK-LABEL: load_i64:
7 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: ld r3, 0(r3)
11 %ret = load i64, ptr %p, align 8
15 define i64 @load2_i64(ptr %p, i64 %a) {
16 ; CHECK-LABEL: load2_i64:
17 ; CHECK: # %bb.0: # %entry
18 ; CHECK-NEXT: ld r3, 0(r3)
19 ; CHECK-NEXT: add r3, r3, r4
22 %load = load i64, ptr %p, align 8
23 %ret = add i64 %load, %a
27 define float @load3_i64(ptr %p) {
28 ; CHECK-LABEL: load3_i64:
29 ; CHECK: # %bb.0: # %entry
30 ; CHECK-NEXT: ld r3, 0(r3)
31 ; CHECK-NEXT: mtfprd f0, r3
32 ; CHECK-NEXT: xscvsxdsp f1, f0
35 %load = load i64, ptr %p, align 8
36 %ret = sitofp i64 %load to float
40 define double @load4_i64(ptr %p) {
41 ; CHECK-LABEL: load4_i64:
42 ; CHECK: # %bb.0: # %entry
43 ; CHECK-NEXT: ld r3, 0(r3)
44 ; CHECK-NEXT: mtfprd f0, r3
45 ; CHECK-NEXT: xscvsxddp f1, f0
48 %load = load i64, ptr %p, align 8
49 %ret = sitofp i64 %load to double
53 define float @load5_i64(ptr %p) {
54 ; CHECK-LABEL: load5_i64:
55 ; CHECK: # %bb.0: # %entry
56 ; CHECK-NEXT: ld r3, 0(r3)
57 ; CHECK-NEXT: mtfprd f0, r3
58 ; CHECK-NEXT: xscvuxdsp f1, f0
61 %load = load i64, ptr %p, align 8
62 %ret = uitofp i64 %load to float
66 define double @load6_i64(ptr %p) {
67 ; CHECK-LABEL: load6_i64:
68 ; CHECK: # %bb.0: # %entry
69 ; CHECK-NEXT: ld r3, 0(r3)
70 ; CHECK-NEXT: mtfprd f0, r3
71 ; CHECK-NEXT: xscvuxddp f1, f0
74 %load = load i64, ptr %p, align 8
75 %ret = uitofp i64 %load to double
79 define double @load_f64(ptr %p) {
80 ; CHECK-LABEL: load_f64:
81 ; CHECK: # %bb.0: # %entry
82 ; CHECK-NEXT: lfd f1, 0(r3)
85 %ret = load double, ptr %p, align 8
89 define double @load2_f64(ptr %p, double %a) {
90 ; CHECK-LABEL: load2_f64:
91 ; CHECK: # %bb.0: # %entry
92 ; CHECK-NEXT: lfd f0, 0(r3)
93 ; CHECK-NEXT: xsadddp f1, f0, f1
96 %load = load double, ptr %p, align 8
97 %ret = fadd double %load, %a
101 define i64 @load3_f64(ptr %p) {
102 ; CHECK-LABEL: load3_f64:
103 ; CHECK: # %bb.0: # %entry
104 ; CHECK-NEXT: lfd f0, 0(r3)
105 ; CHECK-NEXT: xscvdpsxds f0, f0
106 ; CHECK-NEXT: mffprd r3, f0
109 %load = load double, ptr %p, align 8
110 %ret = fptosi double %load to i64
114 define i64 @load4_f64(ptr %p) {
115 ; CHECK-LABEL: load4_f64:
116 ; CHECK: # %bb.0: # %entry
117 ; CHECK-NEXT: lfd f0, 0(r3)
118 ; CHECK-NEXT: xscvdpuxds f0, f0
119 ; CHECK-NEXT: mffprd r3, f0
122 %load = load double, ptr %p, align 8
123 %ret = fptoui double %load to i64
127 define void @store_i64(ptr %p) {
128 ; CHECK-LABEL: store_i64:
129 ; CHECK: # %bb.0: # %entry
130 ; CHECK-NEXT: li r4, 100
131 ; CHECK-NEXT: std r4, 0(r3)
134 store i64 100, ptr %p, align 8
138 define void @store2_i64(ptr %p, i64 %a, i64 %b) {
139 ; CHECK-LABEL: store2_i64:
140 ; CHECK: # %bb.0: # %entry
141 ; CHECK-NEXT: add r4, r4, r5
142 ; CHECK-NEXT: std r4, 0(r3)
145 %add = add i64 %a, %b
146 store i64 %add, ptr %p, align 8
150 define void @store3_i64(ptr %p, float %a) {
151 ; CHECK-LABEL: store3_i64:
152 ; CHECK: # %bb.0: # %entry
153 ; CHECK-NEXT: xscvdpsxds f0, f1
154 ; CHECK-NEXT: mffprd r4, f0
155 ; CHECK-NEXT: std r4, 0(r3)
158 %conv = fptosi float %a to i64
159 store i64 %conv, ptr %p, align 8
163 define void @store4_i64(ptr %p, double %a) {
164 ; CHECK-LABEL: store4_i64:
165 ; CHECK: # %bb.0: # %entry
166 ; CHECK-NEXT: xscvdpsxds f0, f1
167 ; CHECK-NEXT: mffprd r4, f0
168 ; CHECK-NEXT: std r4, 0(r3)
171 %conv = fptosi double %a to i64
172 store i64 %conv, ptr %p, align 8
176 define void @store5_i64(ptr %p, float %a) {
177 ; CHECK-LABEL: store5_i64:
178 ; CHECK: # %bb.0: # %entry
179 ; CHECK-NEXT: xscvdpuxds f0, f1
180 ; CHECK-NEXT: mffprd r4, f0
181 ; CHECK-NEXT: std r4, 0(r3)
184 %conv = fptoui float %a to i64
185 store i64 %conv, ptr %p, align 8
189 define void @store6_i64(ptr %p, double %a) {
190 ; CHECK-LABEL: store6_i64:
191 ; CHECK: # %bb.0: # %entry
192 ; CHECK-NEXT: xscvdpuxds f0, f1
193 ; CHECK-NEXT: mffprd r4, f0
194 ; CHECK-NEXT: std r4, 0(r3)
197 %conv = fptoui double %a to i64
198 store i64 %conv, ptr %p, align 8
202 define void @store_f64(ptr %p, double %a) {
203 ; CHECK-LABEL: store_f64:
204 ; CHECK: # %bb.0: # %entry
205 ; CHECK-NEXT: stfd f1, 0(r3)
208 store double %a, ptr %p, align 8
212 define void @store2_f64(ptr %p, double %a, double %b) {
213 ; CHECK-LABEL: store2_f64:
214 ; CHECK: # %bb.0: # %entry
215 ; CHECK-NEXT: xsadddp f0, f1, f2
216 ; CHECK-NEXT: stfd f0, 0(r3)
219 %fadd = fadd double %a, %b
220 store double %fadd, ptr %p, align 8
224 define void @store3_f64(ptr %p, i64 %a) {
225 ; CHECK-LABEL: store3_f64:
226 ; CHECK: # %bb.0: # %entry
227 ; CHECK-NEXT: mtfprd f0, r4
228 ; CHECK-NEXT: xscvsxddp f0, f0
229 ; CHECK-NEXT: stfd f0, 0(r3)
232 %conv = sitofp i64 %a to double
233 store double %conv, ptr %p, align 8
237 define void @store4_f64(ptr %p, i64 %a) {
238 ; CHECK-LABEL: store4_f64:
239 ; CHECK: # %bb.0: # %entry
240 ; CHECK-NEXT: mtfprd f0, r4
241 ; CHECK-NEXT: xscvuxddp f0, f0
242 ; CHECK-NEXT: stfd f0, 0(r3)
245 %conv = uitofp i64 %a to double
246 store double %conv, ptr %p, align 8