File: legalize-shl-vec.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 (232 lines) | stat: -rw-r--r-- 8,037 bytes parent folder | download | duplicates (8)
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
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s --check-prefix=X86
; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefix=X64

define <2 x i256> @test_shl(<2 x i256> %In) nounwind {
; X86-LABEL: test_shl:
; X86:       # %bb.0:
; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT:    movl {{[0-9]+}}(%esp), %edx
; X86-NEXT:    shldl $2, %ecx, %edx
; X86-NEXT:    movl %edx, 60(%eax)
; X86-NEXT:    movl {{[0-9]+}}(%esp), %edx
; X86-NEXT:    shldl $2, %edx, %ecx
; X86-NEXT:    movl %ecx, 56(%eax)
; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT:    shldl $2, %ecx, %edx
; X86-NEXT:    movl %edx, 52(%eax)
; X86-NEXT:    movl {{[0-9]+}}(%esp), %edx
; X86-NEXT:    shldl $2, %edx, %ecx
; X86-NEXT:    movl %ecx, 48(%eax)
; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT:    shldl $2, %ecx, %edx
; X86-NEXT:    movl %edx, 44(%eax)
; X86-NEXT:    movl {{[0-9]+}}(%esp), %edx
; X86-NEXT:    shldl $2, %edx, %ecx
; X86-NEXT:    movl %ecx, 40(%eax)
; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT:    shldl $2, %ecx, %edx
; X86-NEXT:    movl %edx, 36(%eax)
; X86-NEXT:    shll $2, %ecx
; X86-NEXT:    movl %ecx, 32(%eax)
; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT:    shll $31, %ecx
; X86-NEXT:    movl %ecx, 28(%eax)
; X86-NEXT:    movl $0, 24(%eax)
; X86-NEXT:    movl $0, 20(%eax)
; X86-NEXT:    movl $0, 16(%eax)
; X86-NEXT:    movl $0, 12(%eax)
; X86-NEXT:    movl $0, 8(%eax)
; X86-NEXT:    movl $0, 4(%eax)
; X86-NEXT:    movl $0, (%eax)
; X86-NEXT:    retl $4
;
; X64-LABEL: test_shl:
; X64:       # %bb.0:
; X64-NEXT:    movq %rdi, %rax
; X64-NEXT:    movq {{[0-9]+}}(%rsp), %rcx
; X64-NEXT:    movq {{[0-9]+}}(%rsp), %rdx
; X64-NEXT:    movq {{[0-9]+}}(%rsp), %rdi
; X64-NEXT:    shldq $2, %rdx, %rcx
; X64-NEXT:    shldq $2, %rdi, %rdx
; X64-NEXT:    shldq $2, %r9, %rdi
; X64-NEXT:    shlq $63, %rsi
; X64-NEXT:    shlq $2, %r9
; X64-NEXT:    movq %rcx, 56(%rax)
; X64-NEXT:    movq %rdx, 48(%rax)
; X64-NEXT:    movq %rdi, 40(%rax)
; X64-NEXT:    movq %r9, 32(%rax)
; X64-NEXT:    movq %rsi, 24(%rax)
; X64-NEXT:    xorps %xmm0, %xmm0
; X64-NEXT:    movaps %xmm0, (%rax)
; X64-NEXT:    movq $0, 16(%rax)
; X64-NEXT:    retq
  %Amt = insertelement <2 x i256> <i256 1, i256 2>, i256 255, i32 0
  %Out = shl <2 x i256> %In, %Amt
  ret <2 x i256> %Out
}

define <2 x i256> @test_srl(<2 x i256> %In) nounwind {
; X86-LABEL: test_srl:
; X86:       # %bb.0:
; X86-NEXT:    pushl %ebp
; X86-NEXT:    pushl %ebx
; X86-NEXT:    pushl %edi
; X86-NEXT:    pushl %esi
; X86-NEXT:    subl $8, %esp
; X86-NEXT:    movl {{[0-9]+}}(%esp), %edx
; X86-NEXT:    movl {{[0-9]+}}(%esp), %ebp
; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT:    movl {{[0-9]+}}(%esp), %ebx
; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
; X86-NEXT:    movl {{[0-9]+}}(%esp), %edi
; X86-NEXT:    movl %ebp, %esi
; X86-NEXT:    shldl $28, %edx, %esi
; X86-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
; X86-NEXT:    shldl $28, %ebx, %edx
; X86-NEXT:    movl %edx, (%esp) # 4-byte Spill
; X86-NEXT:    shldl $28, %ecx, %ebx
; X86-NEXT:    movl %ecx, %esi
; X86-NEXT:    shldl $28, %edi, %esi
; X86-NEXT:    shldl $28, %eax, %edi
; X86-NEXT:    movl %eax, %edx
; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
; X86-NEXT:    shldl $28, %eax, %edx
; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT:    shrdl $4, %eax, %ecx
; X86-NEXT:    shrl $4, %ebp
; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
; X86-NEXT:    movl %ebp, 60(%eax)
; X86-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ebp # 4-byte Reload
; X86-NEXT:    movl %ebp, 56(%eax)
; X86-NEXT:    movl (%esp), %ebp # 4-byte Reload
; X86-NEXT:    movl %ebp, 52(%eax)
; X86-NEXT:    movl %ebx, 48(%eax)
; X86-NEXT:    movl %esi, 44(%eax)
; X86-NEXT:    movl %edi, 40(%eax)
; X86-NEXT:    movl %edx, 36(%eax)
; X86-NEXT:    movl %ecx, 32(%eax)
; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT:    shrl $31, %ecx
; X86-NEXT:    movl %ecx, (%eax)
; X86-NEXT:    movl $0, 28(%eax)
; X86-NEXT:    movl $0, 24(%eax)
; X86-NEXT:    movl $0, 20(%eax)
; X86-NEXT:    movl $0, 16(%eax)
; X86-NEXT:    movl $0, 12(%eax)
; X86-NEXT:    movl $0, 8(%eax)
; X86-NEXT:    movl $0, 4(%eax)
; X86-NEXT:    addl $8, %esp
; X86-NEXT:    popl %esi
; X86-NEXT:    popl %edi
; X86-NEXT:    popl %ebx
; X86-NEXT:    popl %ebp
; X86-NEXT:    retl $4
;
; X64-LABEL: test_srl:
; X64:       # %bb.0:
; X64-NEXT:    movq %rdi, %rax
; X64-NEXT:    movq {{[0-9]+}}(%rsp), %rcx
; X64-NEXT:    movq {{[0-9]+}}(%rsp), %rdx
; X64-NEXT:    movq {{[0-9]+}}(%rsp), %rsi
; X64-NEXT:    shrdq $4, %rsi, %r9
; X64-NEXT:    shrdq $4, %rdx, %rsi
; X64-NEXT:    shrdq $4, %rcx, %rdx
; X64-NEXT:    shrq $63, %r8
; X64-NEXT:    shrq $4, %rcx
; X64-NEXT:    movq %rcx, 56(%rdi)
; X64-NEXT:    movq %rdx, 48(%rdi)
; X64-NEXT:    movq %rsi, 40(%rdi)
; X64-NEXT:    movq %r9, 32(%rdi)
; X64-NEXT:    movq %r8, (%rdi)
; X64-NEXT:    xorps %xmm0, %xmm0
; X64-NEXT:    movaps %xmm0, 16(%rdi)
; X64-NEXT:    movq $0, 8(%rdi)
; X64-NEXT:    retq
  %Amt = insertelement <2 x i256> <i256 3, i256 4>, i256 255, i32 0
  %Out = lshr <2 x i256> %In, %Amt
  ret <2 x i256> %Out
}

define <2 x i256> @test_sra(<2 x i256> %In) nounwind {
; X86-LABEL: test_sra:
; X86:       # %bb.0:
; X86-NEXT:    pushl %ebp
; X86-NEXT:    pushl %ebx
; X86-NEXT:    pushl %edi
; X86-NEXT:    pushl %esi
; X86-NEXT:    subl $8, %esp
; X86-NEXT:    movl {{[0-9]+}}(%esp), %edx
; X86-NEXT:    movl {{[0-9]+}}(%esp), %ebp
; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT:    movl {{[0-9]+}}(%esp), %ebx
; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
; X86-NEXT:    movl {{[0-9]+}}(%esp), %edi
; X86-NEXT:    movl %ebp, %esi
; X86-NEXT:    shldl $26, %edx, %esi
; X86-NEXT:    movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
; X86-NEXT:    shldl $26, %ebx, %edx
; X86-NEXT:    movl %edx, (%esp) # 4-byte Spill
; X86-NEXT:    shldl $26, %ecx, %ebx
; X86-NEXT:    movl %ecx, %esi
; X86-NEXT:    shldl $26, %edi, %esi
; X86-NEXT:    shldl $26, %eax, %edi
; X86-NEXT:    movl %eax, %edx
; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
; X86-NEXT:    shldl $26, %eax, %edx
; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT:    shrdl $6, %eax, %ecx
; X86-NEXT:    sarl $6, %ebp
; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
; X86-NEXT:    movl %ebp, 60(%eax)
; X86-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %ebp # 4-byte Reload
; X86-NEXT:    movl %ebp, 56(%eax)
; X86-NEXT:    movl (%esp), %ebp # 4-byte Reload
; X86-NEXT:    movl %ebp, 52(%eax)
; X86-NEXT:    movl %ebx, 48(%eax)
; X86-NEXT:    movl %esi, 44(%eax)
; X86-NEXT:    movl %edi, 40(%eax)
; X86-NEXT:    movl %edx, 36(%eax)
; X86-NEXT:    movl %ecx, 32(%eax)
; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT:    sarl $31, %ecx
; X86-NEXT:    movl %ecx, 28(%eax)
; X86-NEXT:    movl %ecx, 24(%eax)
; X86-NEXT:    movl %ecx, 20(%eax)
; X86-NEXT:    movl %ecx, 16(%eax)
; X86-NEXT:    movl %ecx, 12(%eax)
; X86-NEXT:    movl %ecx, 8(%eax)
; X86-NEXT:    movl %ecx, 4(%eax)
; X86-NEXT:    movl %ecx, (%eax)
; X86-NEXT:    addl $8, %esp
; X86-NEXT:    popl %esi
; X86-NEXT:    popl %edi
; X86-NEXT:    popl %ebx
; X86-NEXT:    popl %ebp
; X86-NEXT:    retl $4
;
; X64-LABEL: test_sra:
; X64:       # %bb.0:
; X64-NEXT:    movq %rdi, %rax
; X64-NEXT:    movq {{[0-9]+}}(%rsp), %rcx
; X64-NEXT:    movq {{[0-9]+}}(%rsp), %rdx
; X64-NEXT:    movq {{[0-9]+}}(%rsp), %rsi
; X64-NEXT:    shrdq $6, %rsi, %r9
; X64-NEXT:    shrdq $6, %rdx, %rsi
; X64-NEXT:    shrdq $6, %rcx, %rdx
; X64-NEXT:    sarq $63, %r8
; X64-NEXT:    sarq $6, %rcx
; X64-NEXT:    movq %rcx, 56(%rdi)
; X64-NEXT:    movq %rdx, 48(%rdi)
; X64-NEXT:    movq %rsi, 40(%rdi)
; X64-NEXT:    movq %r9, 32(%rdi)
; X64-NEXT:    movq %r8, 24(%rdi)
; X64-NEXT:    movq %r8, 16(%rdi)
; X64-NEXT:    movq %r8, 8(%rdi)
; X64-NEXT:    movq %r8, (%rdi)
; X64-NEXT:    retq
  %Amt = insertelement <2 x i256> <i256 5, i256 6>, i256 255, i32 0
  %Out = ashr <2 x i256> %In, %Amt
  ret <2 x i256> %Out
}