1 !sum
2 # Integers
3 # ShiftAll*
4 - go: ShiftAllLeft
5 specialLower: sftimm
6 asm: "VPSLL[WDQ]"
7 in:
8 - &any
9 go: $t
10 - &vecAsScalar64
11 go: "Uint.*"
12 treatLikeAScalarOfSize: 64
13 name: shift
14 out:
15 - *any
16 - go: ShiftAllRight
17 signed: false
18 specialLower: sftimm
19 asm: "VPSRL[WDQ]"
20 in:
21 - &uint
22 go: $t
23 base: uint
24 - *vecAsScalar64
25 out:
26 - *uint
27 - go: ShiftAllRight
28 signed: true
29 specialLower: sftimm
30 asm: "VPSRA[WDQ]"
31 in:
32 - &int
33 go: $t
34 base: int
35 - *vecAsScalar64
36 out:
37 - *int
38
39 - go: shiftAllLeftConst
40 SSAVariant: "const" # to avoid its name colliding with reg version of this instruction, amend this to its ssa op name.
41 nameAndSizeCheck: true
42 specialLower: "if a==0 => x"
43 asm: "VPSLL[WDQ]"
44 in:
45 - *any
46 - &imm
47 class: immediate
48 immOffset: 0
49 out:
50 - *any
51 - go: shiftAllRightConst
52 SSAVariant: "const" # to avoid its name colliding with reg version of this instruction, amend this to its ssa op name.
53 nameAndSizeCheck: true
54 specialLower: "if a==0 => x"
55 asm: "VPSRA[WDQ]"
56 in:
57 - *int
58 - *imm
59 out:
60 - *int
61 - go: shiftAllRightConst
62 SSAVariant: "const" # to avoid its name colliding with reg version of this instruction, amend this to its ssa op name.
63 nameAndSizeCheck: true
64 specialLower: "if a==0 => x"
65 asm: "VPSRL[WDQ]"
66 in:
67 - *uint
68 - *imm
69 out:
70 - *uint
71
72 # Shift* (variable)
73 - go: ShiftLeft
74 nameAndSizeCheck: true
75 asm: "VPSLLV[WD]"
76 in:
77 - go: $t
78 - go: $t
79 overwriteBase: uint
80 name: shift
81 out:
82 - go: $t
83 # XED data of VPSLLVQ marks the element bits 32 which is off to the actual semantic, we need to overwrite
84 # it to 64.
85 - go: ShiftLeft
86 nameAndSizeCheck: true
87 asm: "VPSLLVQ"
88 in:
89 - go: $t
90 overwriteElementBits: 64
91 - go: $t
92 overwriteElementBits: 64
93 overwriteBase: uint
94 name: shift
95 out:
96 - go: $t
97 overwriteElementBits: 64
98 - go: ShiftRight
99 signed: false
100 nameAndSizeCheck: true
101 asm: "VPSRLV[WD]"
102 in:
103 - go: $t
104 base: uint
105 - go: $t
106 overwriteBase: uint
107 name: shift
108 out:
109 - go: $t
110 base: uint
111 # XED data of VPSRLVQ needs the same overwrite as VPSLLVQ.
112 - go: ShiftRight
113 signed: false
114 nameAndSizeCheck: true
115 asm: "VPSRLVQ"
116 in:
117 - go: $t
118 base: uint
119 overwriteElementBits: 64
120 - go: $t
121 overwriteElementBits: 64
122 overwriteBase: uint
123 name: shift
124 out:
125 - go: $t
126 base: uint
127 overwriteElementBits: 64
128 - go: ShiftRight
129 signed: true
130 nameAndSizeCheck: true
131 asm: "VPSRAV[WDQ]"
132 in:
133 - go: $t
134 base: int
135 - go: $t
136 overwriteBase: uint
137 name: shift
138 out:
139 - go: $t
140 base: int
141
142 # Rotate
143 - go: rotateAllLeft
144 nameAndSizeCheck: true
145 asm: "VPROL[DQ]"
146 in:
147 - *any
148 - &pureImm
149 class: immediate
150 immOffset: 0
151 name: shift
152 out:
153 - *any
154 - go: rotateAllRight
155 nameAndSizeCheck: true
156 asm: "VPROR[DQ]"
157 in:
158 - *any
159 - *pureImm
160 out:
161 - *any
162 - go: RotateLeft
163 nameAndSizeCheck: true
164 asm: "VPROLV[DQ]"
165 in:
166 - *any
167 - *any
168 out:
169 - *any
170 - go: RotateRight
171 nameAndSizeCheck: true
172 asm: "VPRORV[DQ]"
173 in:
174 - *any
175 - *any
176 out:
177 - *any
178
179 # Bizzare shifts.
180 - go: ShiftAllLeftConcatMod16
181 nameAndSizeCheck: true
182 asm: "VPSHLDW"
183 operandOrder: 2I
184 in:
185 - *any
186 - *any
187 - *pureImm
188 out:
189 - *any
190 - go: ShiftAllRightConcatMod16
191 nameAndSizeCheck: true
192 asm: "VPSHRDW"
193 operandOrder: 2I
194 in:
195 - *any
196 - *any
197 - *pureImm
198 out:
199 - *any
200 - go: ShiftLeftConcatMod16
201 nameAndSizeCheck: true
202 asm: "VPSHLDVW"
203 in:
204 - go: $t
205 - go: $t
206 - base: uint
207 name: shift
208 out:
209 - go: $t
210 - go: ShiftRightConcatMod16
211 nameAndSizeCheck: true
212 asm: "VPSHRDVW"
213 in:
214 - go: $t
215 - go: $t
216 - base: uint
217 name: shift
218 out:
219 - go: $t
220 - go: ShiftAllLeftConcatMod32
221 nameAndSizeCheck: true
222 asm: "VPSHLDD"
223 operandOrder: 2I
224 in:
225 - *any
226 - *any
227 - *pureImm
228 out:
229 - *any
230 - go: ShiftAllRightConcatMod32
231 nameAndSizeCheck: true
232 asm: "VPSHRDD"
233 operandOrder: 2I
234 in:
235 - *any
236 - *any
237 - *pureImm
238 out:
239 - *any
240 - go: ShiftLeftConcatMod32
241 nameAndSizeCheck: true
242 asm: "VPSHLDVD"
243 in:
244 - go: $t
245 - go: $t
246 - base: uint
247 name: shift
248 out:
249 - go: $t
250 - go: ShiftRightConcatMod32
251 nameAndSizeCheck: true
252 asm: "VPSHRDVD"
253 in:
254 - go: $t
255 - go: $t
256 - base: uint
257 name: shift
258 out:
259 - go: $t
260 - go: ShiftAllLeftConcatMod64
261 nameAndSizeCheck: true
262 asm: "VPSHLDQ"
263 operandOrder: 2I
264 in:
265 - *any
266 - *any
267 - *pureImm
268 out:
269 - *any
270 - go: ShiftAllRightConcatMod64
271 nameAndSizeCheck: true
272 asm: "VPSHRDQ"
273 operandOrder: 2I
274 in:
275 - *any
276 - *any
277 - *pureImm
278 out:
279 - *any
280 - go: ShiftLeftConcatMod64
281 nameAndSizeCheck: true
282 asm: "VPSHLDVQ"
283 in:
284 - go: $t
285 - go: $t
286 - base: uint
287 name: shift
288 out:
289 - go: $t
290 - go: ShiftRightConcatMod64
291 nameAndSizeCheck: true
292 asm: "VPSHRDVQ"
293 in:
294 - go: $t
295 - go: $t
296 - base: uint
297 name: shift
298 out:
299 - go: $t
300
View as plain text