File: wide-scalar-shift-legalization.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (278 lines) | stat: -rw-r--r-- 8,901 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=aarch64-- | FileCheck %s --check-prefixes=ALL
define void @lshr_4bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: lshr_4bytes:
; ALL:       // %bb.0:
; ALL-NEXT:    ldr w8, [x0]
; ALL-NEXT:    ldr w9, [x1]
; ALL-NEXT:    lsr w8, w8, w9
; ALL-NEXT:    str w8, [x2]
; ALL-NEXT:    ret
  %src = load i32, ptr %src.ptr, align 1
  %bitOff = load i32, ptr %bitOff.ptr, align 1
  %res = lshr i32 %src, %bitOff
  store i32 %res, ptr %dst, align 1
  ret void
}
define void @shl_4bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: shl_4bytes:
; ALL:       // %bb.0:
; ALL-NEXT:    ldr w8, [x0]
; ALL-NEXT:    ldr w9, [x1]
; ALL-NEXT:    lsl w8, w8, w9
; ALL-NEXT:    str w8, [x2]
; ALL-NEXT:    ret
  %src = load i32, ptr %src.ptr, align 1
  %bitOff = load i32, ptr %bitOff.ptr, align 1
  %res = shl i32 %src, %bitOff
  store i32 %res, ptr %dst, align 1
  ret void
}
define void @ashr_4bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: ashr_4bytes:
; ALL:       // %bb.0:
; ALL-NEXT:    ldr w8, [x0]
; ALL-NEXT:    ldr w9, [x1]
; ALL-NEXT:    asr w8, w8, w9
; ALL-NEXT:    str w8, [x2]
; ALL-NEXT:    ret
  %src = load i32, ptr %src.ptr, align 1
  %bitOff = load i32, ptr %bitOff.ptr, align 1
  %res = ashr i32 %src, %bitOff
  store i32 %res, ptr %dst, align 1
  ret void
}
define void @lshr_8bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: lshr_8bytes:
; ALL:       // %bb.0:
; ALL-NEXT:    ldr x8, [x0]
; ALL-NEXT:    ldr x9, [x1]
; ALL-NEXT:    lsr x8, x8, x9
; ALL-NEXT:    str x8, [x2]
; ALL-NEXT:    ret
  %src = load i64, ptr %src.ptr, align 1
  %bitOff = load i64, ptr %bitOff.ptr, align 1
  %res = lshr i64 %src, %bitOff
  store i64 %res, ptr %dst, align 1
  ret void
}
define void @shl_8bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: shl_8bytes:
; ALL:       // %bb.0:
; ALL-NEXT:    ldr x8, [x0]
; ALL-NEXT:    ldr x9, [x1]
; ALL-NEXT:    lsl x8, x8, x9
; ALL-NEXT:    str x8, [x2]
; ALL-NEXT:    ret
  %src = load i64, ptr %src.ptr, align 1
  %bitOff = load i64, ptr %bitOff.ptr, align 1
  %res = shl i64 %src, %bitOff
  store i64 %res, ptr %dst, align 1
  ret void
}
define void @ashr_8bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: ashr_8bytes:
; ALL:       // %bb.0:
; ALL-NEXT:    ldr x8, [x0]
; ALL-NEXT:    ldr x9, [x1]
; ALL-NEXT:    asr x8, x8, x9
; ALL-NEXT:    str x8, [x2]
; ALL-NEXT:    ret
  %src = load i64, ptr %src.ptr, align 1
  %bitOff = load i64, ptr %bitOff.ptr, align 1
  %res = ashr i64 %src, %bitOff
  store i64 %res, ptr %dst, align 1
  ret void
}
define void @lshr_16bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: lshr_16bytes:
; ALL:       // %bb.0:
; ALL-NEXT:    ldp x10, x8, [x0]
; ALL-NEXT:    ldr x9, [x1]
; ALL-NEXT:    mvn w12, w9
; ALL-NEXT:    tst x9, #0x40
; ALL-NEXT:    lsl x11, x8, #1
; ALL-NEXT:    lsr x10, x10, x9
; ALL-NEXT:    lsr x8, x8, x9
; ALL-NEXT:    lsl x11, x11, x12
; ALL-NEXT:    orr x9, x11, x10
; ALL-NEXT:    csel x10, xzr, x8, ne
; ALL-NEXT:    csel x8, x8, x9, ne
; ALL-NEXT:    stp x8, x10, [x2]
; ALL-NEXT:    ret
  %src = load i128, ptr %src.ptr, align 1
  %bitOff = load i128, ptr %bitOff.ptr, align 1
  %res = lshr i128 %src, %bitOff
  store i128 %res, ptr %dst, align 1
  ret void
}
define void @shl_16bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: shl_16bytes:
; ALL:       // %bb.0:
; ALL-NEXT:    ldp x8, x10, [x0]
; ALL-NEXT:    ldr x9, [x1]
; ALL-NEXT:    mvn w12, w9
; ALL-NEXT:    tst x9, #0x40
; ALL-NEXT:    lsr x11, x8, #1
; ALL-NEXT:    lsl x10, x10, x9
; ALL-NEXT:    lsl x8, x8, x9
; ALL-NEXT:    lsr x11, x11, x12
; ALL-NEXT:    orr x9, x10, x11
; ALL-NEXT:    csel x10, xzr, x8, ne
; ALL-NEXT:    csel x8, x8, x9, ne
; ALL-NEXT:    stp x10, x8, [x2]
; ALL-NEXT:    ret
  %src = load i128, ptr %src.ptr, align 1
  %bitOff = load i128, ptr %bitOff.ptr, align 1
  %res = shl i128 %src, %bitOff
  store i128 %res, ptr %dst, align 1
  ret void
}
define void @ashr_16bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: ashr_16bytes:
; ALL:       // %bb.0:
; ALL-NEXT:    ldp x9, x8, [x0]
; ALL-NEXT:    ldr x10, [x1]
; ALL-NEXT:    mvn w12, w10
; ALL-NEXT:    tst x10, #0x40
; ALL-NEXT:    lsl x11, x8, #1
; ALL-NEXT:    lsr x9, x9, x10
; ALL-NEXT:    lsl x11, x11, x12
; ALL-NEXT:    asr x12, x8, x10
; ALL-NEXT:    asr x8, x8, #63
; ALL-NEXT:    orr x9, x11, x9
; ALL-NEXT:    csel x8, x8, x12, ne
; ALL-NEXT:    csel x9, x12, x9, ne
; ALL-NEXT:    stp x9, x8, [x2]
; ALL-NEXT:    ret
  %src = load i128, ptr %src.ptr, align 1
  %bitOff = load i128, ptr %bitOff.ptr, align 1
  %res = ashr i128 %src, %bitOff
  store i128 %res, ptr %dst, align 1
  ret void
}
define void @lshr_32bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: lshr_32bytes:
; ALL:       // %bb.0:
; ALL-NEXT:    sub sp, sp, #64
; ALL-NEXT:    ldp x9, x8, [x0, #16]
; ALL-NEXT:    movi v0.2d, #0000000000000000
; ALL-NEXT:    ldr x10, [x1]
; ALL-NEXT:    ldr q1, [x0]
; ALL-NEXT:    stp x9, x8, [sp, #16]
; ALL-NEXT:    ubfx x8, x10, #3, #5
; ALL-NEXT:    mov x9, sp
; ALL-NEXT:    str q1, [sp]
; ALL-NEXT:    and x10, x10, #0x7
; ALL-NEXT:    stp q0, q0, [sp, #32]
; ALL-NEXT:    add x8, x9, x8
; ALL-NEXT:    mvn w13, w10
; ALL-NEXT:    ldp x11, x9, [x8, #16]
; ALL-NEXT:    ldp x8, x12, [x8]
; ALL-NEXT:    lsl x14, x9, #1
; ALL-NEXT:    lsl x15, x11, #1
; ALL-NEXT:    lsr x11, x11, x10
; ALL-NEXT:    lsl x16, x12, #1
; ALL-NEXT:    lsr x9, x9, x10
; ALL-NEXT:    lsr x12, x12, x10
; ALL-NEXT:    lsl x14, x14, x13
; ALL-NEXT:    lsr x8, x8, x10
; ALL-NEXT:    lsl x10, x16, x13
; ALL-NEXT:    lsl x13, x15, x13
; ALL-NEXT:    orr x11, x14, x11
; ALL-NEXT:    stp x11, x9, [x2, #16]
; ALL-NEXT:    orr x8, x10, x8
; ALL-NEXT:    orr x9, x12, x13
; ALL-NEXT:    stp x8, x9, [x2]
; ALL-NEXT:    add sp, sp, #64
; ALL-NEXT:    ret
  %src = load i256, ptr %src.ptr, align 1
  %bitOff = load i256, ptr %bitOff.ptr, align 1
  %res = lshr i256 %src, %bitOff
  store i256 %res, ptr %dst, align 1
  ret void
}
define void @shl_32bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: shl_32bytes:
; ALL:       // %bb.0:
; ALL-NEXT:    sub sp, sp, #64
; ALL-NEXT:    ldp x9, x8, [x0, #16]
; ALL-NEXT:    movi v0.2d, #0000000000000000
; ALL-NEXT:    ldr x10, [x1]
; ALL-NEXT:    ldr q1, [x0]
; ALL-NEXT:    stp x9, x8, [sp, #48]
; ALL-NEXT:    mov x8, sp
; ALL-NEXT:    ubfx x9, x10, #3, #5
; ALL-NEXT:    add x8, x8, #32
; ALL-NEXT:    stp q0, q1, [sp, #16]
; ALL-NEXT:    and x10, x10, #0x7
; ALL-NEXT:    str q0, [sp]
; ALL-NEXT:    sub x8, x8, x9
; ALL-NEXT:    mvn w13, w10
; ALL-NEXT:    ldp x9, x11, [x8]
; ALL-NEXT:    ldp x12, x8, [x8, #16]
; ALL-NEXT:    lsr x14, x9, #1
; ALL-NEXT:    lsr x15, x11, #1
; ALL-NEXT:    lsl x11, x11, x10
; ALL-NEXT:    lsr x16, x12, #1
; ALL-NEXT:    lsl x9, x9, x10
; ALL-NEXT:    lsl x12, x12, x10
; ALL-NEXT:    lsr x14, x14, x13
; ALL-NEXT:    lsl x8, x8, x10
; ALL-NEXT:    lsr x10, x16, x13
; ALL-NEXT:    lsr x13, x15, x13
; ALL-NEXT:    orr x11, x11, x14
; ALL-NEXT:    stp x9, x11, [x2]
; ALL-NEXT:    orr x8, x8, x10
; ALL-NEXT:    orr x9, x12, x13
; ALL-NEXT:    stp x9, x8, [x2, #16]
; ALL-NEXT:    add sp, sp, #64
; ALL-NEXT:    ret
  %src = load i256, ptr %src.ptr, align 1
  %bitOff = load i256, ptr %bitOff.ptr, align 1
  %res = shl i256 %src, %bitOff
  store i256 %res, ptr %dst, align 1
  ret void
}
define void @ashr_32bytes(ptr %src.ptr, ptr %bitOff.ptr, ptr %dst) nounwind {
; ALL-LABEL: ashr_32bytes:
; ALL:       // %bb.0:
; ALL-NEXT:    sub sp, sp, #64
; ALL-NEXT:    ldp x9, x8, [x0, #16]
; ALL-NEXT:    mov x11, sp
; ALL-NEXT:    ldr x10, [x1]
; ALL-NEXT:    ldr q0, [x0]
; ALL-NEXT:    stp x9, x8, [sp, #16]
; ALL-NEXT:    asr x8, x8, #63
; ALL-NEXT:    ubfx x9, x10, #3, #5
; ALL-NEXT:    str q0, [sp]
; ALL-NEXT:    and x10, x10, #0x7
; ALL-NEXT:    stp x8, x8, [sp, #48]
; ALL-NEXT:    add x9, x11, x9
; ALL-NEXT:    mvn w13, w10
; ALL-NEXT:    stp x8, x8, [sp, #32]
; ALL-NEXT:    ldp x11, x8, [x9, #16]
; ALL-NEXT:    ldp x9, x12, [x9]
; ALL-NEXT:    lsl x14, x8, #1
; ALL-NEXT:    lsl x15, x11, #1
; ALL-NEXT:    lsr x11, x11, x10
; ALL-NEXT:    lsl x16, x12, #1
; ALL-NEXT:    asr x8, x8, x10
; ALL-NEXT:    lsr x12, x12, x10
; ALL-NEXT:    lsl x14, x14, x13
; ALL-NEXT:    lsr x9, x9, x10
; ALL-NEXT:    lsl x10, x16, x13
; ALL-NEXT:    lsl x13, x15, x13
; ALL-NEXT:    orr x11, x14, x11
; ALL-NEXT:    stp x11, x8, [x2, #16]
; ALL-NEXT:    orr x8, x10, x9
; ALL-NEXT:    orr x9, x12, x13
; ALL-NEXT:    stp x8, x9, [x2]
; ALL-NEXT:    add sp, sp, #64
; ALL-NEXT:    ret
  %src = load i256, ptr %src.ptr, align 1
  %bitOff = load i256, ptr %bitOff.ptr, align 1
  %res = ashr i256 %src, %bitOff
  store i256 %res, ptr %dst, align 1
  ret void
}