1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-unknown-unknown -force-split-store < %s | FileCheck %s
4 define void @int32_float_pair(i32 %tmp1, float %tmp2, ptr %ref.tmp) {
5 ; CHECK-LABEL: int32_float_pair:
7 ; CHECK-NEXT: movl %edi, (%rsi)
8 ; CHECK-NEXT: movss %xmm0, 4(%rsi)
10 %t0 = bitcast float %tmp2 to i32
11 %t1 = zext i32 %t0 to i64
12 %t2 = shl nuw i64 %t1, 32
13 %t3 = zext i32 %tmp1 to i64
15 store i64 %t4, ptr %ref.tmp, align 8
19 define void @float_int32_pair(float %tmp1, i32 %tmp2, ptr %ref.tmp) {
20 ; CHECK-LABEL: float_int32_pair:
22 ; CHECK-NEXT: movss %xmm0, (%rsi)
23 ; CHECK-NEXT: movl %edi, 4(%rsi)
25 %t0 = bitcast float %tmp1 to i32
26 %t1 = zext i32 %tmp2 to i64
27 %t2 = shl nuw i64 %t1, 32
28 %t3 = zext i32 %t0 to i64
30 store i64 %t4, ptr %ref.tmp, align 8
34 define void @int16_float_pair(i16 signext %tmp1, float %tmp2, ptr %ref.tmp) {
35 ; CHECK-LABEL: int16_float_pair:
37 ; CHECK-NEXT: movzwl %di, %eax
38 ; CHECK-NEXT: movl %eax, (%rsi)
39 ; CHECK-NEXT: movss %xmm0, 4(%rsi)
41 %t0 = bitcast float %tmp2 to i32
42 %t1 = zext i32 %t0 to i64
43 %t2 = shl nuw i64 %t1, 32
44 %t3 = zext i16 %tmp1 to i64
46 store i64 %t4, ptr %ref.tmp, align 8
50 define void @int8_float_pair(i8 signext %tmp1, float %tmp2, ptr %ref.tmp) {
51 ; CHECK-LABEL: int8_float_pair:
53 ; CHECK-NEXT: movzbl %dil, %eax
54 ; CHECK-NEXT: movl %eax, (%rsi)
55 ; CHECK-NEXT: movss %xmm0, 4(%rsi)
57 %t0 = bitcast float %tmp2 to i32
58 %t1 = zext i32 %t0 to i64
59 %t2 = shl nuw i64 %t1, 32
60 %t3 = zext i8 %tmp1 to i64
62 store i64 %t4, ptr %ref.tmp, align 8
66 define void @int32_int32_pair(i32 %tmp1, i32 %tmp2, ptr %ref.tmp) {
67 ; CHECK-LABEL: int32_int32_pair:
69 ; CHECK-NEXT: movl %edi, (%rdx)
70 ; CHECK-NEXT: movl %esi, 4(%rdx)
72 %t1 = zext i32 %tmp2 to i64
73 %t2 = shl nuw i64 %t1, 32
74 %t3 = zext i32 %tmp1 to i64
76 store i64 %t4, ptr %ref.tmp, align 8
80 define void @int16_int16_pair(i16 signext %tmp1, i16 signext %tmp2, ptr %ref.tmp) {
81 ; CHECK-LABEL: int16_int16_pair:
83 ; CHECK-NEXT: movw %di, (%rdx)
84 ; CHECK-NEXT: movw %si, 2(%rdx)
86 %t1 = zext i16 %tmp2 to i32
87 %t2 = shl nuw i32 %t1, 16
88 %t3 = zext i16 %tmp1 to i32
90 store i32 %t4, ptr %ref.tmp, align 4
94 define void @int8_int8_pair(i8 signext %tmp1, i8 signext %tmp2, ptr %ref.tmp) {
95 ; CHECK-LABEL: int8_int8_pair:
97 ; CHECK-NEXT: movb %dil, (%rdx)
98 ; CHECK-NEXT: movb %sil, 1(%rdx)
100 %t1 = zext i8 %tmp2 to i16
101 %t2 = shl nuw i16 %t1, 8
102 %t3 = zext i8 %tmp1 to i16
103 %t4 = or i16 %t2, %t3
104 store i16 %t4, ptr %ref.tmp, align 2
108 define void @int31_int31_pair(i31 %tmp1, i31 %tmp2, ptr %ref.tmp) {
109 ; CHECK-LABEL: int31_int31_pair:
111 ; CHECK-NEXT: andl $2147483647, %edi # imm = 0x7FFFFFFF
112 ; CHECK-NEXT: movl %edi, (%rdx)
113 ; CHECK-NEXT: andl $2147483647, %esi # imm = 0x7FFFFFFF
114 ; CHECK-NEXT: movl %esi, 4(%rdx)
116 %t1 = zext i31 %tmp2 to i64
117 %t2 = shl nuw i64 %t1, 32
118 %t3 = zext i31 %tmp1 to i64
119 %t4 = or i64 %t2, %t3
120 store i64 %t4, ptr %ref.tmp, align 8
124 define void @int31_int17_pair(i31 %tmp1, i17 %tmp2, ptr %ref.tmp) {
125 ; CHECK-LABEL: int31_int17_pair:
127 ; CHECK-NEXT: andl $2147483647, %edi # imm = 0x7FFFFFFF
128 ; CHECK-NEXT: movl %edi, (%rdx)
129 ; CHECK-NEXT: andl $131071, %esi # imm = 0x1FFFF
130 ; CHECK-NEXT: movl %esi, 4(%rdx)
132 %t1 = zext i17 %tmp2 to i64
133 %t2 = shl nuw i64 %t1, 32
134 %t3 = zext i31 %tmp1 to i64
135 %t4 = or i64 %t2, %t3
136 store i64 %t4, ptr %ref.tmp, align 8
140 define void @int7_int3_pair(i7 signext %tmp1, i3 signext %tmp2, ptr %ref.tmp) {
141 ; CHECK-LABEL: int7_int3_pair:
143 ; CHECK-NEXT: andb $127, %dil
144 ; CHECK-NEXT: movb %dil, (%rdx)
145 ; CHECK-NEXT: andb $7, %sil
146 ; CHECK-NEXT: movb %sil, 1(%rdx)
148 %t1 = zext i3 %tmp2 to i16
149 %t2 = shl nuw i16 %t1, 8
150 %t3 = zext i7 %tmp1 to i16
151 %t4 = or i16 %t2, %t3
152 store i16 %t4, ptr %ref.tmp, align 2
156 define void @int24_int24_pair(i24 signext %tmp1, i24 signext %tmp2, ptr %ref.tmp) {
157 ; CHECK-LABEL: int24_int24_pair:
159 ; CHECK-NEXT: movw %di, (%rdx)
160 ; CHECK-NEXT: shrl $16, %edi
161 ; CHECK-NEXT: movb %dil, 2(%rdx)
162 ; CHECK-NEXT: movw %si, 4(%rdx)
163 ; CHECK-NEXT: shrl $16, %esi
164 ; CHECK-NEXT: movb %sil, 6(%rdx)
166 %t1 = zext i24 %tmp2 to i48
167 %t2 = shl nuw i48 %t1, 24
168 %t3 = zext i24 %tmp1 to i48
169 %t4 = or i48 %t2, %t3
170 store i48 %t4, ptr %ref.tmp, align 2
174 ; getTypeSizeInBits(i12) != getTypeStoreSizeInBits(i12), so store split doesn't kick in.
176 define void @int12_int12_pair(i12 signext %tmp1, i12 signext %tmp2, ptr %ref.tmp) {
177 ; CHECK-LABEL: int12_int12_pair:
179 ; CHECK-NEXT: movl %esi, %eax
180 ; CHECK-NEXT: shll $12, %eax
181 ; CHECK-NEXT: andl $4095, %edi # imm = 0xFFF
182 ; CHECK-NEXT: orl %eax, %edi
183 ; CHECK-NEXT: shrl $4, %esi
184 ; CHECK-NEXT: movb %sil, 2(%rdx)
185 ; CHECK-NEXT: movw %di, (%rdx)
187 %t1 = zext i12 %tmp2 to i24
188 %t2 = shl nuw i24 %t1, 12
189 %t3 = zext i12 %tmp1 to i24
190 %t4 = or i24 %t2, %t3
191 store i24 %t4, ptr %ref.tmp, align 2
195 ; getTypeSizeInBits(i14) != getTypeStoreSizeInBits(i14), so store split doesn't kick in.
197 define void @int7_int7_pair(i7 signext %tmp1, i7 signext %tmp2, ptr %ref.tmp) {
198 ; CHECK-LABEL: int7_int7_pair:
200 ; CHECK-NEXT: shll $7, %esi
201 ; CHECK-NEXT: andl $127, %edi
202 ; CHECK-NEXT: orl %esi, %edi
203 ; CHECK-NEXT: andl $16383, %edi # imm = 0x3FFF
204 ; CHECK-NEXT: movw %di, (%rdx)
206 %t1 = zext i7 %tmp2 to i14
207 %t2 = shl nuw i14 %t1, 7
208 %t3 = zext i7 %tmp1 to i14
209 %t4 = or i14 %t2, %t3
210 store i14 %t4, ptr %ref.tmp, align 2
214 ; getTypeSizeInBits(i2) != getTypeStoreSizeInBits(i2), so store split doesn't kick in.
216 define void @int1_int1_pair(i1 signext %tmp1, i1 signext %tmp2, ptr %ref.tmp) {
217 ; CHECK-LABEL: int1_int1_pair:
219 ; CHECK-NEXT: addb %sil, %sil
220 ; CHECK-NEXT: subb %dil, %sil
221 ; CHECK-NEXT: andb $3, %sil
222 ; CHECK-NEXT: movb %sil, (%rdx)
224 %t1 = zext i1 %tmp2 to i2
225 %t2 = shl nuw i2 %t1, 1
226 %t3 = zext i1 %tmp1 to i2
228 store i2 %t4, ptr %ref.tmp, align 1
232 define void @mbb_int32_float_pair(i32 %tmp1, float %tmp2, ptr %ref.tmp) {
233 ; CHECK-LABEL: mbb_int32_float_pair:
234 ; CHECK: # %bb.0: # %entry
235 ; CHECK-NEXT: movl %edi, (%rsi)
236 ; CHECK-NEXT: movss %xmm0, 4(%rsi)
239 %t0 = bitcast float %tmp2 to i32
242 %t1 = zext i32 %t0 to i64
243 %t2 = shl nuw i64 %t1, 32
244 %t3 = zext i32 %tmp1 to i64
245 %t4 = or i64 %t2, %t3
246 store i64 %t4, ptr %ref.tmp, align 8
250 define void @mbb_int32_float_multi_stores(i32 %tmp1, float %tmp2, ptr %ref.tmp, ptr %ref.tmp1, i1 %cmp) {
251 ; CHECK-LABEL: mbb_int32_float_multi_stores:
252 ; CHECK: # %bb.0: # %entry
253 ; CHECK-NEXT: movl %edi, (%rsi)
254 ; CHECK-NEXT: movss %xmm0, 4(%rsi)
255 ; CHECK-NEXT: testb $1, %cl
256 ; CHECK-NEXT: je .LBB15_2
257 ; CHECK-NEXT: # %bb.1: # %bb2
258 ; CHECK-NEXT: movl %edi, (%rdx)
259 ; CHECK-NEXT: movss %xmm0, 4(%rdx)
260 ; CHECK-NEXT: .LBB15_2: # %exitbb
263 %t0 = bitcast float %tmp2 to i32
266 %t1 = zext i32 %t0 to i64
267 %t2 = shl nuw i64 %t1, 32
268 %t3 = zext i32 %tmp1 to i64
269 %t4 = or i64 %t2, %t3
270 store i64 %t4, ptr %ref.tmp, align 8
271 br i1 %cmp, label %bb2, label %exitbb
273 store i64 %t4, ptr %ref.tmp1, align 8