1
2
3 package ssa
4
5 import "cmd/compile/internal/types"
6
7 func rewriteValueARM64(v *Value) bool {
8 switch v.Op {
9 case OpARM64ADCSflags:
10 return rewriteValueARM64_OpARM64ADCSflags(v)
11 case OpARM64ADD:
12 return rewriteValueARM64_OpARM64ADD(v)
13 case OpARM64ADDSflags:
14 return rewriteValueARM64_OpARM64ADDSflags(v)
15 case OpARM64ADDconst:
16 return rewriteValueARM64_OpARM64ADDconst(v)
17 case OpARM64ADDshiftLL:
18 return rewriteValueARM64_OpARM64ADDshiftLL(v)
19 case OpARM64ADDshiftRA:
20 return rewriteValueARM64_OpARM64ADDshiftRA(v)
21 case OpARM64ADDshiftRL:
22 return rewriteValueARM64_OpARM64ADDshiftRL(v)
23 case OpARM64AND:
24 return rewriteValueARM64_OpARM64AND(v)
25 case OpARM64ANDconst:
26 return rewriteValueARM64_OpARM64ANDconst(v)
27 case OpARM64ANDshiftLL:
28 return rewriteValueARM64_OpARM64ANDshiftLL(v)
29 case OpARM64ANDshiftRA:
30 return rewriteValueARM64_OpARM64ANDshiftRA(v)
31 case OpARM64ANDshiftRL:
32 return rewriteValueARM64_OpARM64ANDshiftRL(v)
33 case OpARM64ANDshiftRO:
34 return rewriteValueARM64_OpARM64ANDshiftRO(v)
35 case OpARM64BIC:
36 return rewriteValueARM64_OpARM64BIC(v)
37 case OpARM64BICshiftLL:
38 return rewriteValueARM64_OpARM64BICshiftLL(v)
39 case OpARM64BICshiftRA:
40 return rewriteValueARM64_OpARM64BICshiftRA(v)
41 case OpARM64BICshiftRL:
42 return rewriteValueARM64_OpARM64BICshiftRL(v)
43 case OpARM64BICshiftRO:
44 return rewriteValueARM64_OpARM64BICshiftRO(v)
45 case OpARM64CMN:
46 return rewriteValueARM64_OpARM64CMN(v)
47 case OpARM64CMNW:
48 return rewriteValueARM64_OpARM64CMNW(v)
49 case OpARM64CMNWconst:
50 return rewriteValueARM64_OpARM64CMNWconst(v)
51 case OpARM64CMNconst:
52 return rewriteValueARM64_OpARM64CMNconst(v)
53 case OpARM64CMNshiftLL:
54 return rewriteValueARM64_OpARM64CMNshiftLL(v)
55 case OpARM64CMNshiftRA:
56 return rewriteValueARM64_OpARM64CMNshiftRA(v)
57 case OpARM64CMNshiftRL:
58 return rewriteValueARM64_OpARM64CMNshiftRL(v)
59 case OpARM64CMP:
60 return rewriteValueARM64_OpARM64CMP(v)
61 case OpARM64CMPW:
62 return rewriteValueARM64_OpARM64CMPW(v)
63 case OpARM64CMPWconst:
64 return rewriteValueARM64_OpARM64CMPWconst(v)
65 case OpARM64CMPconst:
66 return rewriteValueARM64_OpARM64CMPconst(v)
67 case OpARM64CMPshiftLL:
68 return rewriteValueARM64_OpARM64CMPshiftLL(v)
69 case OpARM64CMPshiftRA:
70 return rewriteValueARM64_OpARM64CMPshiftRA(v)
71 case OpARM64CMPshiftRL:
72 return rewriteValueARM64_OpARM64CMPshiftRL(v)
73 case OpARM64CSEL:
74 return rewriteValueARM64_OpARM64CSEL(v)
75 case OpARM64CSEL0:
76 return rewriteValueARM64_OpARM64CSEL0(v)
77 case OpARM64CSETM:
78 return rewriteValueARM64_OpARM64CSETM(v)
79 case OpARM64CSINC:
80 return rewriteValueARM64_OpARM64CSINC(v)
81 case OpARM64CSINV:
82 return rewriteValueARM64_OpARM64CSINV(v)
83 case OpARM64CSNEG:
84 return rewriteValueARM64_OpARM64CSNEG(v)
85 case OpARM64DIV:
86 return rewriteValueARM64_OpARM64DIV(v)
87 case OpARM64DIVW:
88 return rewriteValueARM64_OpARM64DIVW(v)
89 case OpARM64EON:
90 return rewriteValueARM64_OpARM64EON(v)
91 case OpARM64EONshiftLL:
92 return rewriteValueARM64_OpARM64EONshiftLL(v)
93 case OpARM64EONshiftRA:
94 return rewriteValueARM64_OpARM64EONshiftRA(v)
95 case OpARM64EONshiftRL:
96 return rewriteValueARM64_OpARM64EONshiftRL(v)
97 case OpARM64EONshiftRO:
98 return rewriteValueARM64_OpARM64EONshiftRO(v)
99 case OpARM64Equal:
100 return rewriteValueARM64_OpARM64Equal(v)
101 case OpARM64FADDD:
102 return rewriteValueARM64_OpARM64FADDD(v)
103 case OpARM64FADDS:
104 return rewriteValueARM64_OpARM64FADDS(v)
105 case OpARM64FCMPD:
106 return rewriteValueARM64_OpARM64FCMPD(v)
107 case OpARM64FCMPS:
108 return rewriteValueARM64_OpARM64FCMPS(v)
109 case OpARM64FMOVDfpgp:
110 return rewriteValueARM64_OpARM64FMOVDfpgp(v)
111 case OpARM64FMOVDgpfp:
112 return rewriteValueARM64_OpARM64FMOVDgpfp(v)
113 case OpARM64FMOVDload:
114 return rewriteValueARM64_OpARM64FMOVDload(v)
115 case OpARM64FMOVDloadidx:
116 return rewriteValueARM64_OpARM64FMOVDloadidx(v)
117 case OpARM64FMOVDloadidx8:
118 return rewriteValueARM64_OpARM64FMOVDloadidx8(v)
119 case OpARM64FMOVDstore:
120 return rewriteValueARM64_OpARM64FMOVDstore(v)
121 case OpARM64FMOVDstoreidx:
122 return rewriteValueARM64_OpARM64FMOVDstoreidx(v)
123 case OpARM64FMOVDstoreidx8:
124 return rewriteValueARM64_OpARM64FMOVDstoreidx8(v)
125 case OpARM64FMOVSload:
126 return rewriteValueARM64_OpARM64FMOVSload(v)
127 case OpARM64FMOVSloadidx:
128 return rewriteValueARM64_OpARM64FMOVSloadidx(v)
129 case OpARM64FMOVSloadidx4:
130 return rewriteValueARM64_OpARM64FMOVSloadidx4(v)
131 case OpARM64FMOVSstore:
132 return rewriteValueARM64_OpARM64FMOVSstore(v)
133 case OpARM64FMOVSstoreidx:
134 return rewriteValueARM64_OpARM64FMOVSstoreidx(v)
135 case OpARM64FMOVSstoreidx4:
136 return rewriteValueARM64_OpARM64FMOVSstoreidx4(v)
137 case OpARM64FMULD:
138 return rewriteValueARM64_OpARM64FMULD(v)
139 case OpARM64FMULS:
140 return rewriteValueARM64_OpARM64FMULS(v)
141 case OpARM64FNEGD:
142 return rewriteValueARM64_OpARM64FNEGD(v)
143 case OpARM64FNEGS:
144 return rewriteValueARM64_OpARM64FNEGS(v)
145 case OpARM64FNMULD:
146 return rewriteValueARM64_OpARM64FNMULD(v)
147 case OpARM64FNMULS:
148 return rewriteValueARM64_OpARM64FNMULS(v)
149 case OpARM64FSUBD:
150 return rewriteValueARM64_OpARM64FSUBD(v)
151 case OpARM64FSUBS:
152 return rewriteValueARM64_OpARM64FSUBS(v)
153 case OpARM64GreaterEqual:
154 return rewriteValueARM64_OpARM64GreaterEqual(v)
155 case OpARM64GreaterEqualF:
156 return rewriteValueARM64_OpARM64GreaterEqualF(v)
157 case OpARM64GreaterEqualNoov:
158 return rewriteValueARM64_OpARM64GreaterEqualNoov(v)
159 case OpARM64GreaterEqualU:
160 return rewriteValueARM64_OpARM64GreaterEqualU(v)
161 case OpARM64GreaterThan:
162 return rewriteValueARM64_OpARM64GreaterThan(v)
163 case OpARM64GreaterThanF:
164 return rewriteValueARM64_OpARM64GreaterThanF(v)
165 case OpARM64GreaterThanU:
166 return rewriteValueARM64_OpARM64GreaterThanU(v)
167 case OpARM64LDP:
168 return rewriteValueARM64_OpARM64LDP(v)
169 case OpARM64LessEqual:
170 return rewriteValueARM64_OpARM64LessEqual(v)
171 case OpARM64LessEqualF:
172 return rewriteValueARM64_OpARM64LessEqualF(v)
173 case OpARM64LessEqualU:
174 return rewriteValueARM64_OpARM64LessEqualU(v)
175 case OpARM64LessThan:
176 return rewriteValueARM64_OpARM64LessThan(v)
177 case OpARM64LessThanF:
178 return rewriteValueARM64_OpARM64LessThanF(v)
179 case OpARM64LessThanNoov:
180 return rewriteValueARM64_OpARM64LessThanNoov(v)
181 case OpARM64LessThanU:
182 return rewriteValueARM64_OpARM64LessThanU(v)
183 case OpARM64MADD:
184 return rewriteValueARM64_OpARM64MADD(v)
185 case OpARM64MADDW:
186 return rewriteValueARM64_OpARM64MADDW(v)
187 case OpARM64MNEG:
188 return rewriteValueARM64_OpARM64MNEG(v)
189 case OpARM64MNEGW:
190 return rewriteValueARM64_OpARM64MNEGW(v)
191 case OpARM64MOD:
192 return rewriteValueARM64_OpARM64MOD(v)
193 case OpARM64MODW:
194 return rewriteValueARM64_OpARM64MODW(v)
195 case OpARM64MOVBUload:
196 return rewriteValueARM64_OpARM64MOVBUload(v)
197 case OpARM64MOVBUloadidx:
198 return rewriteValueARM64_OpARM64MOVBUloadidx(v)
199 case OpARM64MOVBUreg:
200 return rewriteValueARM64_OpARM64MOVBUreg(v)
201 case OpARM64MOVBload:
202 return rewriteValueARM64_OpARM64MOVBload(v)
203 case OpARM64MOVBloadidx:
204 return rewriteValueARM64_OpARM64MOVBloadidx(v)
205 case OpARM64MOVBreg:
206 return rewriteValueARM64_OpARM64MOVBreg(v)
207 case OpARM64MOVBstore:
208 return rewriteValueARM64_OpARM64MOVBstore(v)
209 case OpARM64MOVBstoreidx:
210 return rewriteValueARM64_OpARM64MOVBstoreidx(v)
211 case OpARM64MOVBstorezero:
212 return rewriteValueARM64_OpARM64MOVBstorezero(v)
213 case OpARM64MOVBstorezeroidx:
214 return rewriteValueARM64_OpARM64MOVBstorezeroidx(v)
215 case OpARM64MOVDload:
216 return rewriteValueARM64_OpARM64MOVDload(v)
217 case OpARM64MOVDloadidx:
218 return rewriteValueARM64_OpARM64MOVDloadidx(v)
219 case OpARM64MOVDloadidx8:
220 return rewriteValueARM64_OpARM64MOVDloadidx8(v)
221 case OpARM64MOVDnop:
222 return rewriteValueARM64_OpARM64MOVDnop(v)
223 case OpARM64MOVDreg:
224 return rewriteValueARM64_OpARM64MOVDreg(v)
225 case OpARM64MOVDstore:
226 return rewriteValueARM64_OpARM64MOVDstore(v)
227 case OpARM64MOVDstoreidx:
228 return rewriteValueARM64_OpARM64MOVDstoreidx(v)
229 case OpARM64MOVDstoreidx8:
230 return rewriteValueARM64_OpARM64MOVDstoreidx8(v)
231 case OpARM64MOVDstorezero:
232 return rewriteValueARM64_OpARM64MOVDstorezero(v)
233 case OpARM64MOVDstorezeroidx:
234 return rewriteValueARM64_OpARM64MOVDstorezeroidx(v)
235 case OpARM64MOVDstorezeroidx8:
236 return rewriteValueARM64_OpARM64MOVDstorezeroidx8(v)
237 case OpARM64MOVHUload:
238 return rewriteValueARM64_OpARM64MOVHUload(v)
239 case OpARM64MOVHUloadidx:
240 return rewriteValueARM64_OpARM64MOVHUloadidx(v)
241 case OpARM64MOVHUloadidx2:
242 return rewriteValueARM64_OpARM64MOVHUloadidx2(v)
243 case OpARM64MOVHUreg:
244 return rewriteValueARM64_OpARM64MOVHUreg(v)
245 case OpARM64MOVHload:
246 return rewriteValueARM64_OpARM64MOVHload(v)
247 case OpARM64MOVHloadidx:
248 return rewriteValueARM64_OpARM64MOVHloadidx(v)
249 case OpARM64MOVHloadidx2:
250 return rewriteValueARM64_OpARM64MOVHloadidx2(v)
251 case OpARM64MOVHreg:
252 return rewriteValueARM64_OpARM64MOVHreg(v)
253 case OpARM64MOVHstore:
254 return rewriteValueARM64_OpARM64MOVHstore(v)
255 case OpARM64MOVHstoreidx:
256 return rewriteValueARM64_OpARM64MOVHstoreidx(v)
257 case OpARM64MOVHstoreidx2:
258 return rewriteValueARM64_OpARM64MOVHstoreidx2(v)
259 case OpARM64MOVHstorezero:
260 return rewriteValueARM64_OpARM64MOVHstorezero(v)
261 case OpARM64MOVHstorezeroidx:
262 return rewriteValueARM64_OpARM64MOVHstorezeroidx(v)
263 case OpARM64MOVHstorezeroidx2:
264 return rewriteValueARM64_OpARM64MOVHstorezeroidx2(v)
265 case OpARM64MOVQstorezero:
266 return rewriteValueARM64_OpARM64MOVQstorezero(v)
267 case OpARM64MOVWUload:
268 return rewriteValueARM64_OpARM64MOVWUload(v)
269 case OpARM64MOVWUloadidx:
270 return rewriteValueARM64_OpARM64MOVWUloadidx(v)
271 case OpARM64MOVWUloadidx4:
272 return rewriteValueARM64_OpARM64MOVWUloadidx4(v)
273 case OpARM64MOVWUreg:
274 return rewriteValueARM64_OpARM64MOVWUreg(v)
275 case OpARM64MOVWload:
276 return rewriteValueARM64_OpARM64MOVWload(v)
277 case OpARM64MOVWloadidx:
278 return rewriteValueARM64_OpARM64MOVWloadidx(v)
279 case OpARM64MOVWloadidx4:
280 return rewriteValueARM64_OpARM64MOVWloadidx4(v)
281 case OpARM64MOVWreg:
282 return rewriteValueARM64_OpARM64MOVWreg(v)
283 case OpARM64MOVWstore:
284 return rewriteValueARM64_OpARM64MOVWstore(v)
285 case OpARM64MOVWstoreidx:
286 return rewriteValueARM64_OpARM64MOVWstoreidx(v)
287 case OpARM64MOVWstoreidx4:
288 return rewriteValueARM64_OpARM64MOVWstoreidx4(v)
289 case OpARM64MOVWstorezero:
290 return rewriteValueARM64_OpARM64MOVWstorezero(v)
291 case OpARM64MOVWstorezeroidx:
292 return rewriteValueARM64_OpARM64MOVWstorezeroidx(v)
293 case OpARM64MOVWstorezeroidx4:
294 return rewriteValueARM64_OpARM64MOVWstorezeroidx4(v)
295 case OpARM64MSUB:
296 return rewriteValueARM64_OpARM64MSUB(v)
297 case OpARM64MSUBW:
298 return rewriteValueARM64_OpARM64MSUBW(v)
299 case OpARM64MUL:
300 return rewriteValueARM64_OpARM64MUL(v)
301 case OpARM64MULW:
302 return rewriteValueARM64_OpARM64MULW(v)
303 case OpARM64MVN:
304 return rewriteValueARM64_OpARM64MVN(v)
305 case OpARM64MVNshiftLL:
306 return rewriteValueARM64_OpARM64MVNshiftLL(v)
307 case OpARM64MVNshiftRA:
308 return rewriteValueARM64_OpARM64MVNshiftRA(v)
309 case OpARM64MVNshiftRL:
310 return rewriteValueARM64_OpARM64MVNshiftRL(v)
311 case OpARM64MVNshiftRO:
312 return rewriteValueARM64_OpARM64MVNshiftRO(v)
313 case OpARM64NEG:
314 return rewriteValueARM64_OpARM64NEG(v)
315 case OpARM64NEGshiftLL:
316 return rewriteValueARM64_OpARM64NEGshiftLL(v)
317 case OpARM64NEGshiftRA:
318 return rewriteValueARM64_OpARM64NEGshiftRA(v)
319 case OpARM64NEGshiftRL:
320 return rewriteValueARM64_OpARM64NEGshiftRL(v)
321 case OpARM64NotEqual:
322 return rewriteValueARM64_OpARM64NotEqual(v)
323 case OpARM64OR:
324 return rewriteValueARM64_OpARM64OR(v)
325 case OpARM64ORN:
326 return rewriteValueARM64_OpARM64ORN(v)
327 case OpARM64ORNshiftLL:
328 return rewriteValueARM64_OpARM64ORNshiftLL(v)
329 case OpARM64ORNshiftRA:
330 return rewriteValueARM64_OpARM64ORNshiftRA(v)
331 case OpARM64ORNshiftRL:
332 return rewriteValueARM64_OpARM64ORNshiftRL(v)
333 case OpARM64ORNshiftRO:
334 return rewriteValueARM64_OpARM64ORNshiftRO(v)
335 case OpARM64ORconst:
336 return rewriteValueARM64_OpARM64ORconst(v)
337 case OpARM64ORshiftLL:
338 return rewriteValueARM64_OpARM64ORshiftLL(v)
339 case OpARM64ORshiftRA:
340 return rewriteValueARM64_OpARM64ORshiftRA(v)
341 case OpARM64ORshiftRL:
342 return rewriteValueARM64_OpARM64ORshiftRL(v)
343 case OpARM64ORshiftRO:
344 return rewriteValueARM64_OpARM64ORshiftRO(v)
345 case OpARM64REV:
346 return rewriteValueARM64_OpARM64REV(v)
347 case OpARM64REVW:
348 return rewriteValueARM64_OpARM64REVW(v)
349 case OpARM64ROR:
350 return rewriteValueARM64_OpARM64ROR(v)
351 case OpARM64RORW:
352 return rewriteValueARM64_OpARM64RORW(v)
353 case OpARM64SBCSflags:
354 return rewriteValueARM64_OpARM64SBCSflags(v)
355 case OpARM64SLL:
356 return rewriteValueARM64_OpARM64SLL(v)
357 case OpARM64SLLconst:
358 return rewriteValueARM64_OpARM64SLLconst(v)
359 case OpARM64SRA:
360 return rewriteValueARM64_OpARM64SRA(v)
361 case OpARM64SRAconst:
362 return rewriteValueARM64_OpARM64SRAconst(v)
363 case OpARM64SRL:
364 return rewriteValueARM64_OpARM64SRL(v)
365 case OpARM64SRLconst:
366 return rewriteValueARM64_OpARM64SRLconst(v)
367 case OpARM64STP:
368 return rewriteValueARM64_OpARM64STP(v)
369 case OpARM64SUB:
370 return rewriteValueARM64_OpARM64SUB(v)
371 case OpARM64SUBconst:
372 return rewriteValueARM64_OpARM64SUBconst(v)
373 case OpARM64SUBshiftLL:
374 return rewriteValueARM64_OpARM64SUBshiftLL(v)
375 case OpARM64SUBshiftRA:
376 return rewriteValueARM64_OpARM64SUBshiftRA(v)
377 case OpARM64SUBshiftRL:
378 return rewriteValueARM64_OpARM64SUBshiftRL(v)
379 case OpARM64TST:
380 return rewriteValueARM64_OpARM64TST(v)
381 case OpARM64TSTW:
382 return rewriteValueARM64_OpARM64TSTW(v)
383 case OpARM64TSTWconst:
384 return rewriteValueARM64_OpARM64TSTWconst(v)
385 case OpARM64TSTconst:
386 return rewriteValueARM64_OpARM64TSTconst(v)
387 case OpARM64TSTshiftLL:
388 return rewriteValueARM64_OpARM64TSTshiftLL(v)
389 case OpARM64TSTshiftRA:
390 return rewriteValueARM64_OpARM64TSTshiftRA(v)
391 case OpARM64TSTshiftRL:
392 return rewriteValueARM64_OpARM64TSTshiftRL(v)
393 case OpARM64TSTshiftRO:
394 return rewriteValueARM64_OpARM64TSTshiftRO(v)
395 case OpARM64UBFIZ:
396 return rewriteValueARM64_OpARM64UBFIZ(v)
397 case OpARM64UBFX:
398 return rewriteValueARM64_OpARM64UBFX(v)
399 case OpARM64UDIV:
400 return rewriteValueARM64_OpARM64UDIV(v)
401 case OpARM64UDIVW:
402 return rewriteValueARM64_OpARM64UDIVW(v)
403 case OpARM64UMOD:
404 return rewriteValueARM64_OpARM64UMOD(v)
405 case OpARM64UMODW:
406 return rewriteValueARM64_OpARM64UMODW(v)
407 case OpARM64XOR:
408 return rewriteValueARM64_OpARM64XOR(v)
409 case OpARM64XORconst:
410 return rewriteValueARM64_OpARM64XORconst(v)
411 case OpARM64XORshiftLL:
412 return rewriteValueARM64_OpARM64XORshiftLL(v)
413 case OpARM64XORshiftRA:
414 return rewriteValueARM64_OpARM64XORshiftRA(v)
415 case OpARM64XORshiftRL:
416 return rewriteValueARM64_OpARM64XORshiftRL(v)
417 case OpARM64XORshiftRO:
418 return rewriteValueARM64_OpARM64XORshiftRO(v)
419 case OpAbs:
420 v.Op = OpARM64FABSD
421 return true
422 case OpAdd16:
423 v.Op = OpARM64ADD
424 return true
425 case OpAdd32:
426 v.Op = OpARM64ADD
427 return true
428 case OpAdd32F:
429 v.Op = OpARM64FADDS
430 return true
431 case OpAdd64:
432 v.Op = OpARM64ADD
433 return true
434 case OpAdd64F:
435 v.Op = OpARM64FADDD
436 return true
437 case OpAdd8:
438 v.Op = OpARM64ADD
439 return true
440 case OpAddPtr:
441 v.Op = OpARM64ADD
442 return true
443 case OpAddr:
444 return rewriteValueARM64_OpAddr(v)
445 case OpAnd16:
446 v.Op = OpARM64AND
447 return true
448 case OpAnd32:
449 v.Op = OpARM64AND
450 return true
451 case OpAnd64:
452 v.Op = OpARM64AND
453 return true
454 case OpAnd8:
455 v.Op = OpARM64AND
456 return true
457 case OpAndB:
458 v.Op = OpARM64AND
459 return true
460 case OpAtomicAdd32:
461 v.Op = OpARM64LoweredAtomicAdd32
462 return true
463 case OpAtomicAdd32Variant:
464 v.Op = OpARM64LoweredAtomicAdd32Variant
465 return true
466 case OpAtomicAdd64:
467 v.Op = OpARM64LoweredAtomicAdd64
468 return true
469 case OpAtomicAdd64Variant:
470 v.Op = OpARM64LoweredAtomicAdd64Variant
471 return true
472 case OpAtomicAnd32:
473 return rewriteValueARM64_OpAtomicAnd32(v)
474 case OpAtomicAnd32Variant:
475 return rewriteValueARM64_OpAtomicAnd32Variant(v)
476 case OpAtomicAnd8:
477 return rewriteValueARM64_OpAtomicAnd8(v)
478 case OpAtomicAnd8Variant:
479 return rewriteValueARM64_OpAtomicAnd8Variant(v)
480 case OpAtomicCompareAndSwap32:
481 v.Op = OpARM64LoweredAtomicCas32
482 return true
483 case OpAtomicCompareAndSwap32Variant:
484 v.Op = OpARM64LoweredAtomicCas32Variant
485 return true
486 case OpAtomicCompareAndSwap64:
487 v.Op = OpARM64LoweredAtomicCas64
488 return true
489 case OpAtomicCompareAndSwap64Variant:
490 v.Op = OpARM64LoweredAtomicCas64Variant
491 return true
492 case OpAtomicExchange32:
493 v.Op = OpARM64LoweredAtomicExchange32
494 return true
495 case OpAtomicExchange32Variant:
496 v.Op = OpARM64LoweredAtomicExchange32Variant
497 return true
498 case OpAtomicExchange64:
499 v.Op = OpARM64LoweredAtomicExchange64
500 return true
501 case OpAtomicExchange64Variant:
502 v.Op = OpARM64LoweredAtomicExchange64Variant
503 return true
504 case OpAtomicLoad32:
505 v.Op = OpARM64LDARW
506 return true
507 case OpAtomicLoad64:
508 v.Op = OpARM64LDAR
509 return true
510 case OpAtomicLoad8:
511 v.Op = OpARM64LDARB
512 return true
513 case OpAtomicLoadPtr:
514 v.Op = OpARM64LDAR
515 return true
516 case OpAtomicOr32:
517 return rewriteValueARM64_OpAtomicOr32(v)
518 case OpAtomicOr32Variant:
519 return rewriteValueARM64_OpAtomicOr32Variant(v)
520 case OpAtomicOr8:
521 return rewriteValueARM64_OpAtomicOr8(v)
522 case OpAtomicOr8Variant:
523 return rewriteValueARM64_OpAtomicOr8Variant(v)
524 case OpAtomicStore32:
525 v.Op = OpARM64STLRW
526 return true
527 case OpAtomicStore64:
528 v.Op = OpARM64STLR
529 return true
530 case OpAtomicStore8:
531 v.Op = OpARM64STLRB
532 return true
533 case OpAtomicStorePtrNoWB:
534 v.Op = OpARM64STLR
535 return true
536 case OpAvg64u:
537 return rewriteValueARM64_OpAvg64u(v)
538 case OpBitLen32:
539 return rewriteValueARM64_OpBitLen32(v)
540 case OpBitLen64:
541 return rewriteValueARM64_OpBitLen64(v)
542 case OpBitRev16:
543 return rewriteValueARM64_OpBitRev16(v)
544 case OpBitRev32:
545 v.Op = OpARM64RBITW
546 return true
547 case OpBitRev64:
548 v.Op = OpARM64RBIT
549 return true
550 case OpBitRev8:
551 return rewriteValueARM64_OpBitRev8(v)
552 case OpBswap16:
553 v.Op = OpARM64REV16W
554 return true
555 case OpBswap32:
556 v.Op = OpARM64REVW
557 return true
558 case OpBswap64:
559 v.Op = OpARM64REV
560 return true
561 case OpCeil:
562 v.Op = OpARM64FRINTPD
563 return true
564 case OpClosureCall:
565 v.Op = OpARM64CALLclosure
566 return true
567 case OpCom16:
568 v.Op = OpARM64MVN
569 return true
570 case OpCom32:
571 v.Op = OpARM64MVN
572 return true
573 case OpCom64:
574 v.Op = OpARM64MVN
575 return true
576 case OpCom8:
577 v.Op = OpARM64MVN
578 return true
579 case OpCondSelect:
580 return rewriteValueARM64_OpCondSelect(v)
581 case OpConst16:
582 return rewriteValueARM64_OpConst16(v)
583 case OpConst32:
584 return rewriteValueARM64_OpConst32(v)
585 case OpConst32F:
586 return rewriteValueARM64_OpConst32F(v)
587 case OpConst64:
588 return rewriteValueARM64_OpConst64(v)
589 case OpConst64F:
590 return rewriteValueARM64_OpConst64F(v)
591 case OpConst8:
592 return rewriteValueARM64_OpConst8(v)
593 case OpConstBool:
594 return rewriteValueARM64_OpConstBool(v)
595 case OpConstNil:
596 return rewriteValueARM64_OpConstNil(v)
597 case OpCtz16:
598 return rewriteValueARM64_OpCtz16(v)
599 case OpCtz16NonZero:
600 v.Op = OpCtz32
601 return true
602 case OpCtz32:
603 return rewriteValueARM64_OpCtz32(v)
604 case OpCtz32NonZero:
605 v.Op = OpCtz32
606 return true
607 case OpCtz64:
608 return rewriteValueARM64_OpCtz64(v)
609 case OpCtz64NonZero:
610 v.Op = OpCtz64
611 return true
612 case OpCtz8:
613 return rewriteValueARM64_OpCtz8(v)
614 case OpCtz8NonZero:
615 v.Op = OpCtz32
616 return true
617 case OpCvt32Fto32:
618 v.Op = OpARM64FCVTZSSW
619 return true
620 case OpCvt32Fto32U:
621 v.Op = OpARM64FCVTZUSW
622 return true
623 case OpCvt32Fto64:
624 v.Op = OpARM64FCVTZSS
625 return true
626 case OpCvt32Fto64F:
627 v.Op = OpARM64FCVTSD
628 return true
629 case OpCvt32Fto64U:
630 v.Op = OpARM64FCVTZUS
631 return true
632 case OpCvt32Uto32F:
633 v.Op = OpARM64UCVTFWS
634 return true
635 case OpCvt32Uto64F:
636 v.Op = OpARM64UCVTFWD
637 return true
638 case OpCvt32to32F:
639 v.Op = OpARM64SCVTFWS
640 return true
641 case OpCvt32to64F:
642 v.Op = OpARM64SCVTFWD
643 return true
644 case OpCvt64Fto32:
645 v.Op = OpARM64FCVTZSDW
646 return true
647 case OpCvt64Fto32F:
648 v.Op = OpARM64FCVTDS
649 return true
650 case OpCvt64Fto32U:
651 v.Op = OpARM64FCVTZUDW
652 return true
653 case OpCvt64Fto64:
654 v.Op = OpARM64FCVTZSD
655 return true
656 case OpCvt64Fto64U:
657 v.Op = OpARM64FCVTZUD
658 return true
659 case OpCvt64Uto32F:
660 v.Op = OpARM64UCVTFS
661 return true
662 case OpCvt64Uto64F:
663 v.Op = OpARM64UCVTFD
664 return true
665 case OpCvt64to32F:
666 v.Op = OpARM64SCVTFS
667 return true
668 case OpCvt64to64F:
669 v.Op = OpARM64SCVTFD
670 return true
671 case OpCvtBoolToUint8:
672 v.Op = OpCopy
673 return true
674 case OpDiv16:
675 return rewriteValueARM64_OpDiv16(v)
676 case OpDiv16u:
677 return rewriteValueARM64_OpDiv16u(v)
678 case OpDiv32:
679 return rewriteValueARM64_OpDiv32(v)
680 case OpDiv32F:
681 v.Op = OpARM64FDIVS
682 return true
683 case OpDiv32u:
684 v.Op = OpARM64UDIVW
685 return true
686 case OpDiv64:
687 return rewriteValueARM64_OpDiv64(v)
688 case OpDiv64F:
689 v.Op = OpARM64FDIVD
690 return true
691 case OpDiv64u:
692 v.Op = OpARM64UDIV
693 return true
694 case OpDiv8:
695 return rewriteValueARM64_OpDiv8(v)
696 case OpDiv8u:
697 return rewriteValueARM64_OpDiv8u(v)
698 case OpEq16:
699 return rewriteValueARM64_OpEq16(v)
700 case OpEq32:
701 return rewriteValueARM64_OpEq32(v)
702 case OpEq32F:
703 return rewriteValueARM64_OpEq32F(v)
704 case OpEq64:
705 return rewriteValueARM64_OpEq64(v)
706 case OpEq64F:
707 return rewriteValueARM64_OpEq64F(v)
708 case OpEq8:
709 return rewriteValueARM64_OpEq8(v)
710 case OpEqB:
711 return rewriteValueARM64_OpEqB(v)
712 case OpEqPtr:
713 return rewriteValueARM64_OpEqPtr(v)
714 case OpFMA:
715 return rewriteValueARM64_OpFMA(v)
716 case OpFloor:
717 v.Op = OpARM64FRINTMD
718 return true
719 case OpGetCallerPC:
720 v.Op = OpARM64LoweredGetCallerPC
721 return true
722 case OpGetCallerSP:
723 v.Op = OpARM64LoweredGetCallerSP
724 return true
725 case OpGetClosurePtr:
726 v.Op = OpARM64LoweredGetClosurePtr
727 return true
728 case OpHmul32:
729 return rewriteValueARM64_OpHmul32(v)
730 case OpHmul32u:
731 return rewriteValueARM64_OpHmul32u(v)
732 case OpHmul64:
733 v.Op = OpARM64MULH
734 return true
735 case OpHmul64u:
736 v.Op = OpARM64UMULH
737 return true
738 case OpInterCall:
739 v.Op = OpARM64CALLinter
740 return true
741 case OpIsInBounds:
742 return rewriteValueARM64_OpIsInBounds(v)
743 case OpIsNonNil:
744 return rewriteValueARM64_OpIsNonNil(v)
745 case OpIsSliceInBounds:
746 return rewriteValueARM64_OpIsSliceInBounds(v)
747 case OpLeq16:
748 return rewriteValueARM64_OpLeq16(v)
749 case OpLeq16U:
750 return rewriteValueARM64_OpLeq16U(v)
751 case OpLeq32:
752 return rewriteValueARM64_OpLeq32(v)
753 case OpLeq32F:
754 return rewriteValueARM64_OpLeq32F(v)
755 case OpLeq32U:
756 return rewriteValueARM64_OpLeq32U(v)
757 case OpLeq64:
758 return rewriteValueARM64_OpLeq64(v)
759 case OpLeq64F:
760 return rewriteValueARM64_OpLeq64F(v)
761 case OpLeq64U:
762 return rewriteValueARM64_OpLeq64U(v)
763 case OpLeq8:
764 return rewriteValueARM64_OpLeq8(v)
765 case OpLeq8U:
766 return rewriteValueARM64_OpLeq8U(v)
767 case OpLess16:
768 return rewriteValueARM64_OpLess16(v)
769 case OpLess16U:
770 return rewriteValueARM64_OpLess16U(v)
771 case OpLess32:
772 return rewriteValueARM64_OpLess32(v)
773 case OpLess32F:
774 return rewriteValueARM64_OpLess32F(v)
775 case OpLess32U:
776 return rewriteValueARM64_OpLess32U(v)
777 case OpLess64:
778 return rewriteValueARM64_OpLess64(v)
779 case OpLess64F:
780 return rewriteValueARM64_OpLess64F(v)
781 case OpLess64U:
782 return rewriteValueARM64_OpLess64U(v)
783 case OpLess8:
784 return rewriteValueARM64_OpLess8(v)
785 case OpLess8U:
786 return rewriteValueARM64_OpLess8U(v)
787 case OpLoad:
788 return rewriteValueARM64_OpLoad(v)
789 case OpLocalAddr:
790 return rewriteValueARM64_OpLocalAddr(v)
791 case OpLsh16x16:
792 return rewriteValueARM64_OpLsh16x16(v)
793 case OpLsh16x32:
794 return rewriteValueARM64_OpLsh16x32(v)
795 case OpLsh16x64:
796 return rewriteValueARM64_OpLsh16x64(v)
797 case OpLsh16x8:
798 return rewriteValueARM64_OpLsh16x8(v)
799 case OpLsh32x16:
800 return rewriteValueARM64_OpLsh32x16(v)
801 case OpLsh32x32:
802 return rewriteValueARM64_OpLsh32x32(v)
803 case OpLsh32x64:
804 return rewriteValueARM64_OpLsh32x64(v)
805 case OpLsh32x8:
806 return rewriteValueARM64_OpLsh32x8(v)
807 case OpLsh64x16:
808 return rewriteValueARM64_OpLsh64x16(v)
809 case OpLsh64x32:
810 return rewriteValueARM64_OpLsh64x32(v)
811 case OpLsh64x64:
812 return rewriteValueARM64_OpLsh64x64(v)
813 case OpLsh64x8:
814 return rewriteValueARM64_OpLsh64x8(v)
815 case OpLsh8x16:
816 return rewriteValueARM64_OpLsh8x16(v)
817 case OpLsh8x32:
818 return rewriteValueARM64_OpLsh8x32(v)
819 case OpLsh8x64:
820 return rewriteValueARM64_OpLsh8x64(v)
821 case OpLsh8x8:
822 return rewriteValueARM64_OpLsh8x8(v)
823 case OpMax32F:
824 v.Op = OpARM64FMAXS
825 return true
826 case OpMax64F:
827 v.Op = OpARM64FMAXD
828 return true
829 case OpMin32F:
830 v.Op = OpARM64FMINS
831 return true
832 case OpMin64F:
833 v.Op = OpARM64FMIND
834 return true
835 case OpMod16:
836 return rewriteValueARM64_OpMod16(v)
837 case OpMod16u:
838 return rewriteValueARM64_OpMod16u(v)
839 case OpMod32:
840 return rewriteValueARM64_OpMod32(v)
841 case OpMod32u:
842 v.Op = OpARM64UMODW
843 return true
844 case OpMod64:
845 return rewriteValueARM64_OpMod64(v)
846 case OpMod64u:
847 v.Op = OpARM64UMOD
848 return true
849 case OpMod8:
850 return rewriteValueARM64_OpMod8(v)
851 case OpMod8u:
852 return rewriteValueARM64_OpMod8u(v)
853 case OpMove:
854 return rewriteValueARM64_OpMove(v)
855 case OpMul16:
856 v.Op = OpARM64MULW
857 return true
858 case OpMul32:
859 v.Op = OpARM64MULW
860 return true
861 case OpMul32F:
862 v.Op = OpARM64FMULS
863 return true
864 case OpMul64:
865 v.Op = OpARM64MUL
866 return true
867 case OpMul64F:
868 v.Op = OpARM64FMULD
869 return true
870 case OpMul8:
871 v.Op = OpARM64MULW
872 return true
873 case OpNeg16:
874 v.Op = OpARM64NEG
875 return true
876 case OpNeg32:
877 v.Op = OpARM64NEG
878 return true
879 case OpNeg32F:
880 v.Op = OpARM64FNEGS
881 return true
882 case OpNeg64:
883 v.Op = OpARM64NEG
884 return true
885 case OpNeg64F:
886 v.Op = OpARM64FNEGD
887 return true
888 case OpNeg8:
889 v.Op = OpARM64NEG
890 return true
891 case OpNeq16:
892 return rewriteValueARM64_OpNeq16(v)
893 case OpNeq32:
894 return rewriteValueARM64_OpNeq32(v)
895 case OpNeq32F:
896 return rewriteValueARM64_OpNeq32F(v)
897 case OpNeq64:
898 return rewriteValueARM64_OpNeq64(v)
899 case OpNeq64F:
900 return rewriteValueARM64_OpNeq64F(v)
901 case OpNeq8:
902 return rewriteValueARM64_OpNeq8(v)
903 case OpNeqB:
904 v.Op = OpARM64XOR
905 return true
906 case OpNeqPtr:
907 return rewriteValueARM64_OpNeqPtr(v)
908 case OpNilCheck:
909 v.Op = OpARM64LoweredNilCheck
910 return true
911 case OpNot:
912 return rewriteValueARM64_OpNot(v)
913 case OpOffPtr:
914 return rewriteValueARM64_OpOffPtr(v)
915 case OpOr16:
916 v.Op = OpARM64OR
917 return true
918 case OpOr32:
919 v.Op = OpARM64OR
920 return true
921 case OpOr64:
922 v.Op = OpARM64OR
923 return true
924 case OpOr8:
925 v.Op = OpARM64OR
926 return true
927 case OpOrB:
928 v.Op = OpARM64OR
929 return true
930 case OpPanicBounds:
931 return rewriteValueARM64_OpPanicBounds(v)
932 case OpPopCount16:
933 return rewriteValueARM64_OpPopCount16(v)
934 case OpPopCount32:
935 return rewriteValueARM64_OpPopCount32(v)
936 case OpPopCount64:
937 return rewriteValueARM64_OpPopCount64(v)
938 case OpPrefetchCache:
939 return rewriteValueARM64_OpPrefetchCache(v)
940 case OpPrefetchCacheStreamed:
941 return rewriteValueARM64_OpPrefetchCacheStreamed(v)
942 case OpPubBarrier:
943 return rewriteValueARM64_OpPubBarrier(v)
944 case OpRotateLeft16:
945 return rewriteValueARM64_OpRotateLeft16(v)
946 case OpRotateLeft32:
947 return rewriteValueARM64_OpRotateLeft32(v)
948 case OpRotateLeft64:
949 return rewriteValueARM64_OpRotateLeft64(v)
950 case OpRotateLeft8:
951 return rewriteValueARM64_OpRotateLeft8(v)
952 case OpRound:
953 v.Op = OpARM64FRINTAD
954 return true
955 case OpRound32F:
956 v.Op = OpARM64LoweredRound32F
957 return true
958 case OpRound64F:
959 v.Op = OpARM64LoweredRound64F
960 return true
961 case OpRoundToEven:
962 v.Op = OpARM64FRINTND
963 return true
964 case OpRsh16Ux16:
965 return rewriteValueARM64_OpRsh16Ux16(v)
966 case OpRsh16Ux32:
967 return rewriteValueARM64_OpRsh16Ux32(v)
968 case OpRsh16Ux64:
969 return rewriteValueARM64_OpRsh16Ux64(v)
970 case OpRsh16Ux8:
971 return rewriteValueARM64_OpRsh16Ux8(v)
972 case OpRsh16x16:
973 return rewriteValueARM64_OpRsh16x16(v)
974 case OpRsh16x32:
975 return rewriteValueARM64_OpRsh16x32(v)
976 case OpRsh16x64:
977 return rewriteValueARM64_OpRsh16x64(v)
978 case OpRsh16x8:
979 return rewriteValueARM64_OpRsh16x8(v)
980 case OpRsh32Ux16:
981 return rewriteValueARM64_OpRsh32Ux16(v)
982 case OpRsh32Ux32:
983 return rewriteValueARM64_OpRsh32Ux32(v)
984 case OpRsh32Ux64:
985 return rewriteValueARM64_OpRsh32Ux64(v)
986 case OpRsh32Ux8:
987 return rewriteValueARM64_OpRsh32Ux8(v)
988 case OpRsh32x16:
989 return rewriteValueARM64_OpRsh32x16(v)
990 case OpRsh32x32:
991 return rewriteValueARM64_OpRsh32x32(v)
992 case OpRsh32x64:
993 return rewriteValueARM64_OpRsh32x64(v)
994 case OpRsh32x8:
995 return rewriteValueARM64_OpRsh32x8(v)
996 case OpRsh64Ux16:
997 return rewriteValueARM64_OpRsh64Ux16(v)
998 case OpRsh64Ux32:
999 return rewriteValueARM64_OpRsh64Ux32(v)
1000 case OpRsh64Ux64:
1001 return rewriteValueARM64_OpRsh64Ux64(v)
1002 case OpRsh64Ux8:
1003 return rewriteValueARM64_OpRsh64Ux8(v)
1004 case OpRsh64x16:
1005 return rewriteValueARM64_OpRsh64x16(v)
1006 case OpRsh64x32:
1007 return rewriteValueARM64_OpRsh64x32(v)
1008 case OpRsh64x64:
1009 return rewriteValueARM64_OpRsh64x64(v)
1010 case OpRsh64x8:
1011 return rewriteValueARM64_OpRsh64x8(v)
1012 case OpRsh8Ux16:
1013 return rewriteValueARM64_OpRsh8Ux16(v)
1014 case OpRsh8Ux32:
1015 return rewriteValueARM64_OpRsh8Ux32(v)
1016 case OpRsh8Ux64:
1017 return rewriteValueARM64_OpRsh8Ux64(v)
1018 case OpRsh8Ux8:
1019 return rewriteValueARM64_OpRsh8Ux8(v)
1020 case OpRsh8x16:
1021 return rewriteValueARM64_OpRsh8x16(v)
1022 case OpRsh8x32:
1023 return rewriteValueARM64_OpRsh8x32(v)
1024 case OpRsh8x64:
1025 return rewriteValueARM64_OpRsh8x64(v)
1026 case OpRsh8x8:
1027 return rewriteValueARM64_OpRsh8x8(v)
1028 case OpSelect0:
1029 return rewriteValueARM64_OpSelect0(v)
1030 case OpSelect1:
1031 return rewriteValueARM64_OpSelect1(v)
1032 case OpSelectN:
1033 return rewriteValueARM64_OpSelectN(v)
1034 case OpSignExt16to32:
1035 v.Op = OpARM64MOVHreg
1036 return true
1037 case OpSignExt16to64:
1038 v.Op = OpARM64MOVHreg
1039 return true
1040 case OpSignExt32to64:
1041 v.Op = OpARM64MOVWreg
1042 return true
1043 case OpSignExt8to16:
1044 v.Op = OpARM64MOVBreg
1045 return true
1046 case OpSignExt8to32:
1047 v.Op = OpARM64MOVBreg
1048 return true
1049 case OpSignExt8to64:
1050 v.Op = OpARM64MOVBreg
1051 return true
1052 case OpSlicemask:
1053 return rewriteValueARM64_OpSlicemask(v)
1054 case OpSqrt:
1055 v.Op = OpARM64FSQRTD
1056 return true
1057 case OpSqrt32:
1058 v.Op = OpARM64FSQRTS
1059 return true
1060 case OpStaticCall:
1061 v.Op = OpARM64CALLstatic
1062 return true
1063 case OpStore:
1064 return rewriteValueARM64_OpStore(v)
1065 case OpSub16:
1066 v.Op = OpARM64SUB
1067 return true
1068 case OpSub32:
1069 v.Op = OpARM64SUB
1070 return true
1071 case OpSub32F:
1072 v.Op = OpARM64FSUBS
1073 return true
1074 case OpSub64:
1075 v.Op = OpARM64SUB
1076 return true
1077 case OpSub64F:
1078 v.Op = OpARM64FSUBD
1079 return true
1080 case OpSub8:
1081 v.Op = OpARM64SUB
1082 return true
1083 case OpSubPtr:
1084 v.Op = OpARM64SUB
1085 return true
1086 case OpTailCall:
1087 v.Op = OpARM64CALLtail
1088 return true
1089 case OpTrunc:
1090 v.Op = OpARM64FRINTZD
1091 return true
1092 case OpTrunc16to8:
1093 v.Op = OpCopy
1094 return true
1095 case OpTrunc32to16:
1096 v.Op = OpCopy
1097 return true
1098 case OpTrunc32to8:
1099 v.Op = OpCopy
1100 return true
1101 case OpTrunc64to16:
1102 v.Op = OpCopy
1103 return true
1104 case OpTrunc64to32:
1105 v.Op = OpCopy
1106 return true
1107 case OpTrunc64to8:
1108 v.Op = OpCopy
1109 return true
1110 case OpWB:
1111 v.Op = OpARM64LoweredWB
1112 return true
1113 case OpXor16:
1114 v.Op = OpARM64XOR
1115 return true
1116 case OpXor32:
1117 v.Op = OpARM64XOR
1118 return true
1119 case OpXor64:
1120 v.Op = OpARM64XOR
1121 return true
1122 case OpXor8:
1123 v.Op = OpARM64XOR
1124 return true
1125 case OpZero:
1126 return rewriteValueARM64_OpZero(v)
1127 case OpZeroExt16to32:
1128 v.Op = OpARM64MOVHUreg
1129 return true
1130 case OpZeroExt16to64:
1131 v.Op = OpARM64MOVHUreg
1132 return true
1133 case OpZeroExt32to64:
1134 v.Op = OpARM64MOVWUreg
1135 return true
1136 case OpZeroExt8to16:
1137 v.Op = OpARM64MOVBUreg
1138 return true
1139 case OpZeroExt8to32:
1140 v.Op = OpARM64MOVBUreg
1141 return true
1142 case OpZeroExt8to64:
1143 v.Op = OpARM64MOVBUreg
1144 return true
1145 }
1146 return false
1147 }
1148 func rewriteValueARM64_OpARM64ADCSflags(v *Value) bool {
1149 v_2 := v.Args[2]
1150 v_1 := v.Args[1]
1151 v_0 := v.Args[0]
1152 b := v.Block
1153 typ := &b.Func.Config.Types
1154
1155
1156 for {
1157 x := v_0
1158 y := v_1
1159 if v_2.Op != OpSelect1 || v_2.Type != types.TypeFlags {
1160 break
1161 }
1162 v_2_0 := v_2.Args[0]
1163 if v_2_0.Op != OpARM64ADDSconstflags || auxIntToInt64(v_2_0.AuxInt) != -1 {
1164 break
1165 }
1166 v_2_0_0 := v_2_0.Args[0]
1167 if v_2_0_0.Op != OpARM64ADCzerocarry || v_2_0_0.Type != typ.UInt64 {
1168 break
1169 }
1170 c := v_2_0_0.Args[0]
1171 v.reset(OpARM64ADCSflags)
1172 v.AddArg3(x, y, c)
1173 return true
1174 }
1175
1176
1177 for {
1178 x := v_0
1179 y := v_1
1180 if v_2.Op != OpSelect1 || v_2.Type != types.TypeFlags {
1181 break
1182 }
1183 v_2_0 := v_2.Args[0]
1184 if v_2_0.Op != OpARM64ADDSconstflags || auxIntToInt64(v_2_0.AuxInt) != -1 {
1185 break
1186 }
1187 v_2_0_0 := v_2_0.Args[0]
1188 if v_2_0_0.Op != OpARM64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
1189 break
1190 }
1191 v.reset(OpARM64ADDSflags)
1192 v.AddArg2(x, y)
1193 return true
1194 }
1195 return false
1196 }
1197 func rewriteValueARM64_OpARM64ADD(v *Value) bool {
1198 v_1 := v.Args[1]
1199 v_0 := v.Args[0]
1200
1201
1202
1203 for {
1204 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1205 x := v_0
1206 if v_1.Op != OpARM64MOVDconst {
1207 continue
1208 }
1209 t := v_1.Type
1210 c := auxIntToInt64(v_1.AuxInt)
1211 if !(!t.IsPtr()) {
1212 continue
1213 }
1214 v.reset(OpARM64ADDconst)
1215 v.AuxInt = int64ToAuxInt(c)
1216 v.AddArg(x)
1217 return true
1218 }
1219 break
1220 }
1221
1222
1223
1224 for {
1225 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1226 a := v_0
1227 l := v_1
1228 if l.Op != OpARM64MUL {
1229 continue
1230 }
1231 y := l.Args[1]
1232 x := l.Args[0]
1233 if !(l.Uses == 1 && clobber(l)) {
1234 continue
1235 }
1236 v.reset(OpARM64MADD)
1237 v.AddArg3(a, x, y)
1238 return true
1239 }
1240 break
1241 }
1242
1243
1244
1245 for {
1246 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1247 a := v_0
1248 l := v_1
1249 if l.Op != OpARM64MNEG {
1250 continue
1251 }
1252 y := l.Args[1]
1253 x := l.Args[0]
1254 if !(l.Uses == 1 && clobber(l)) {
1255 continue
1256 }
1257 v.reset(OpARM64MSUB)
1258 v.AddArg3(a, x, y)
1259 return true
1260 }
1261 break
1262 }
1263
1264
1265
1266 for {
1267 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1268 a := v_0
1269 l := v_1
1270 if l.Op != OpARM64MULW {
1271 continue
1272 }
1273 y := l.Args[1]
1274 x := l.Args[0]
1275 if !(v.Type.Size() <= 4 && l.Uses == 1 && clobber(l)) {
1276 continue
1277 }
1278 v.reset(OpARM64MADDW)
1279 v.AddArg3(a, x, y)
1280 return true
1281 }
1282 break
1283 }
1284
1285
1286
1287 for {
1288 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1289 a := v_0
1290 l := v_1
1291 if l.Op != OpARM64MNEGW {
1292 continue
1293 }
1294 y := l.Args[1]
1295 x := l.Args[0]
1296 if !(v.Type.Size() <= 4 && l.Uses == 1 && clobber(l)) {
1297 continue
1298 }
1299 v.reset(OpARM64MSUBW)
1300 v.AddArg3(a, x, y)
1301 return true
1302 }
1303 break
1304 }
1305
1306
1307 for {
1308 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1309 x := v_0
1310 if v_1.Op != OpARM64NEG {
1311 continue
1312 }
1313 y := v_1.Args[0]
1314 v.reset(OpARM64SUB)
1315 v.AddArg2(x, y)
1316 return true
1317 }
1318 break
1319 }
1320
1321
1322
1323 for {
1324 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1325 x0 := v_0
1326 x1 := v_1
1327 if x1.Op != OpARM64SLLconst {
1328 continue
1329 }
1330 c := auxIntToInt64(x1.AuxInt)
1331 y := x1.Args[0]
1332 if !(clobberIfDead(x1)) {
1333 continue
1334 }
1335 v.reset(OpARM64ADDshiftLL)
1336 v.AuxInt = int64ToAuxInt(c)
1337 v.AddArg2(x0, y)
1338 return true
1339 }
1340 break
1341 }
1342
1343
1344
1345 for {
1346 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1347 x0 := v_0
1348 x1 := v_1
1349 if x1.Op != OpARM64SRLconst {
1350 continue
1351 }
1352 c := auxIntToInt64(x1.AuxInt)
1353 y := x1.Args[0]
1354 if !(clobberIfDead(x1)) {
1355 continue
1356 }
1357 v.reset(OpARM64ADDshiftRL)
1358 v.AuxInt = int64ToAuxInt(c)
1359 v.AddArg2(x0, y)
1360 return true
1361 }
1362 break
1363 }
1364
1365
1366
1367 for {
1368 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1369 x0 := v_0
1370 x1 := v_1
1371 if x1.Op != OpARM64SRAconst {
1372 continue
1373 }
1374 c := auxIntToInt64(x1.AuxInt)
1375 y := x1.Args[0]
1376 if !(clobberIfDead(x1)) {
1377 continue
1378 }
1379 v.reset(OpARM64ADDshiftRA)
1380 v.AuxInt = int64ToAuxInt(c)
1381 v.AddArg2(x0, y)
1382 return true
1383 }
1384 break
1385 }
1386 return false
1387 }
1388 func rewriteValueARM64_OpARM64ADDSflags(v *Value) bool {
1389 v_1 := v.Args[1]
1390 v_0 := v.Args[0]
1391
1392
1393 for {
1394 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1395 x := v_0
1396 if v_1.Op != OpARM64MOVDconst {
1397 continue
1398 }
1399 c := auxIntToInt64(v_1.AuxInt)
1400 v.reset(OpARM64ADDSconstflags)
1401 v.AuxInt = int64ToAuxInt(c)
1402 v.AddArg(x)
1403 return true
1404 }
1405 break
1406 }
1407 return false
1408 }
1409 func rewriteValueARM64_OpARM64ADDconst(v *Value) bool {
1410 v_0 := v.Args[0]
1411
1412
1413
1414 for {
1415 off1 := auxIntToInt64(v.AuxInt)
1416 if v_0.Op != OpARM64MOVDaddr {
1417 break
1418 }
1419 off2 := auxIntToInt32(v_0.AuxInt)
1420 sym := auxToSym(v_0.Aux)
1421 ptr := v_0.Args[0]
1422 if !(is32Bit(off1 + int64(off2))) {
1423 break
1424 }
1425 v.reset(OpARM64MOVDaddr)
1426 v.AuxInt = int32ToAuxInt(int32(off1) + off2)
1427 v.Aux = symToAux(sym)
1428 v.AddArg(ptr)
1429 return true
1430 }
1431
1432
1433
1434 for {
1435 c := auxIntToInt64(v.AuxInt)
1436 y := v_0
1437 if !(c < 0) {
1438 break
1439 }
1440 v.reset(OpARM64SUBconst)
1441 v.AuxInt = int64ToAuxInt(-c)
1442 v.AddArg(y)
1443 return true
1444 }
1445
1446
1447 for {
1448 if auxIntToInt64(v.AuxInt) != 0 {
1449 break
1450 }
1451 x := v_0
1452 v.copyOf(x)
1453 return true
1454 }
1455
1456
1457 for {
1458 c := auxIntToInt64(v.AuxInt)
1459 if v_0.Op != OpARM64MOVDconst {
1460 break
1461 }
1462 d := auxIntToInt64(v_0.AuxInt)
1463 v.reset(OpARM64MOVDconst)
1464 v.AuxInt = int64ToAuxInt(c + d)
1465 return true
1466 }
1467
1468
1469 for {
1470 c := auxIntToInt64(v.AuxInt)
1471 if v_0.Op != OpARM64ADDconst {
1472 break
1473 }
1474 d := auxIntToInt64(v_0.AuxInt)
1475 x := v_0.Args[0]
1476 v.reset(OpARM64ADDconst)
1477 v.AuxInt = int64ToAuxInt(c + d)
1478 v.AddArg(x)
1479 return true
1480 }
1481
1482
1483 for {
1484 c := auxIntToInt64(v.AuxInt)
1485 if v_0.Op != OpARM64SUBconst {
1486 break
1487 }
1488 d := auxIntToInt64(v_0.AuxInt)
1489 x := v_0.Args[0]
1490 v.reset(OpARM64ADDconst)
1491 v.AuxInt = int64ToAuxInt(c - d)
1492 v.AddArg(x)
1493 return true
1494 }
1495 return false
1496 }
1497 func rewriteValueARM64_OpARM64ADDshiftLL(v *Value) bool {
1498 v_1 := v.Args[1]
1499 v_0 := v.Args[0]
1500 b := v.Block
1501 typ := &b.Func.Config.Types
1502
1503
1504 for {
1505 d := auxIntToInt64(v.AuxInt)
1506 if v_0.Op != OpARM64MOVDconst {
1507 break
1508 }
1509 c := auxIntToInt64(v_0.AuxInt)
1510 x := v_1
1511 v.reset(OpARM64ADDconst)
1512 v.AuxInt = int64ToAuxInt(c)
1513 v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
1514 v0.AuxInt = int64ToAuxInt(d)
1515 v0.AddArg(x)
1516 v.AddArg(v0)
1517 return true
1518 }
1519
1520
1521 for {
1522 d := auxIntToInt64(v.AuxInt)
1523 x := v_0
1524 if v_1.Op != OpARM64MOVDconst {
1525 break
1526 }
1527 c := auxIntToInt64(v_1.AuxInt)
1528 v.reset(OpARM64ADDconst)
1529 v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
1530 v.AddArg(x)
1531 return true
1532 }
1533
1534
1535 for {
1536 if v.Type != typ.UInt16 || auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64UBFX || v_0.Type != typ.UInt16 || auxIntToArm64BitField(v_0.AuxInt) != armBFAuxInt(8, 8) {
1537 break
1538 }
1539 x := v_0.Args[0]
1540 if x != v_1 {
1541 break
1542 }
1543 v.reset(OpARM64REV16W)
1544 v.AddArg(x)
1545 return true
1546 }
1547
1548
1549
1550 for {
1551 if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64UBFX || auxIntToArm64BitField(v_0.AuxInt) != armBFAuxInt(8, 24) {
1552 break
1553 }
1554 v_0_0 := v_0.Args[0]
1555 if v_0_0.Op != OpARM64ANDconst {
1556 break
1557 }
1558 c1 := auxIntToInt64(v_0_0.AuxInt)
1559 x := v_0_0.Args[0]
1560 if v_1.Op != OpARM64ANDconst {
1561 break
1562 }
1563 c2 := auxIntToInt64(v_1.AuxInt)
1564 if x != v_1.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
1565 break
1566 }
1567 v.reset(OpARM64REV16W)
1568 v.AddArg(x)
1569 return true
1570 }
1571
1572
1573
1574 for {
1575 if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
1576 break
1577 }
1578 v_0_0 := v_0.Args[0]
1579 if v_0_0.Op != OpARM64ANDconst {
1580 break
1581 }
1582 c1 := auxIntToInt64(v_0_0.AuxInt)
1583 x := v_0_0.Args[0]
1584 if v_1.Op != OpARM64ANDconst {
1585 break
1586 }
1587 c2 := auxIntToInt64(v_1.AuxInt)
1588 if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
1589 break
1590 }
1591 v.reset(OpARM64REV16)
1592 v.AddArg(x)
1593 return true
1594 }
1595
1596
1597
1598 for {
1599 if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
1600 break
1601 }
1602 v_0_0 := v_0.Args[0]
1603 if v_0_0.Op != OpARM64ANDconst {
1604 break
1605 }
1606 c1 := auxIntToInt64(v_0_0.AuxInt)
1607 x := v_0_0.Args[0]
1608 if v_1.Op != OpARM64ANDconst {
1609 break
1610 }
1611 c2 := auxIntToInt64(v_1.AuxInt)
1612 if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
1613 break
1614 }
1615 v.reset(OpARM64REV16)
1616 v0 := b.NewValue0(v.Pos, OpARM64ANDconst, x.Type)
1617 v0.AuxInt = int64ToAuxInt(0xffffffff)
1618 v0.AddArg(x)
1619 v.AddArg(v0)
1620 return true
1621 }
1622
1623
1624 for {
1625 c := auxIntToInt64(v.AuxInt)
1626 if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 64-c {
1627 break
1628 }
1629 x := v_0.Args[0]
1630 x2 := v_1
1631 v.reset(OpARM64EXTRconst)
1632 v.AuxInt = int64ToAuxInt(64 - c)
1633 v.AddArg2(x2, x)
1634 return true
1635 }
1636
1637
1638
1639 for {
1640 t := v.Type
1641 c := auxIntToInt64(v.AuxInt)
1642 if v_0.Op != OpARM64UBFX {
1643 break
1644 }
1645 bfc := auxIntToArm64BitField(v_0.AuxInt)
1646 x := v_0.Args[0]
1647 x2 := v_1
1648 if !(c < 32 && t.Size() == 4 && bfc == armBFAuxInt(32-c, c)) {
1649 break
1650 }
1651 v.reset(OpARM64EXTRWconst)
1652 v.AuxInt = int64ToAuxInt(32 - c)
1653 v.AddArg2(x2, x)
1654 return true
1655 }
1656 return false
1657 }
1658 func rewriteValueARM64_OpARM64ADDshiftRA(v *Value) bool {
1659 v_1 := v.Args[1]
1660 v_0 := v.Args[0]
1661 b := v.Block
1662
1663
1664 for {
1665 d := auxIntToInt64(v.AuxInt)
1666 if v_0.Op != OpARM64MOVDconst {
1667 break
1668 }
1669 c := auxIntToInt64(v_0.AuxInt)
1670 x := v_1
1671 v.reset(OpARM64ADDconst)
1672 v.AuxInt = int64ToAuxInt(c)
1673 v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
1674 v0.AuxInt = int64ToAuxInt(d)
1675 v0.AddArg(x)
1676 v.AddArg(v0)
1677 return true
1678 }
1679
1680
1681 for {
1682 d := auxIntToInt64(v.AuxInt)
1683 x := v_0
1684 if v_1.Op != OpARM64MOVDconst {
1685 break
1686 }
1687 c := auxIntToInt64(v_1.AuxInt)
1688 v.reset(OpARM64ADDconst)
1689 v.AuxInt = int64ToAuxInt(c >> uint64(d))
1690 v.AddArg(x)
1691 return true
1692 }
1693 return false
1694 }
1695 func rewriteValueARM64_OpARM64ADDshiftRL(v *Value) bool {
1696 v_1 := v.Args[1]
1697 v_0 := v.Args[0]
1698 b := v.Block
1699
1700
1701 for {
1702 d := auxIntToInt64(v.AuxInt)
1703 if v_0.Op != OpARM64MOVDconst {
1704 break
1705 }
1706 c := auxIntToInt64(v_0.AuxInt)
1707 x := v_1
1708 v.reset(OpARM64ADDconst)
1709 v.AuxInt = int64ToAuxInt(c)
1710 v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
1711 v0.AuxInt = int64ToAuxInt(d)
1712 v0.AddArg(x)
1713 v.AddArg(v0)
1714 return true
1715 }
1716
1717
1718 for {
1719 d := auxIntToInt64(v.AuxInt)
1720 x := v_0
1721 if v_1.Op != OpARM64MOVDconst {
1722 break
1723 }
1724 c := auxIntToInt64(v_1.AuxInt)
1725 v.reset(OpARM64ADDconst)
1726 v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
1727 v.AddArg(x)
1728 return true
1729 }
1730 return false
1731 }
1732 func rewriteValueARM64_OpARM64AND(v *Value) bool {
1733 v_1 := v.Args[1]
1734 v_0 := v.Args[0]
1735
1736
1737 for {
1738 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1739 x := v_0
1740 if v_1.Op != OpARM64MOVDconst {
1741 continue
1742 }
1743 c := auxIntToInt64(v_1.AuxInt)
1744 v.reset(OpARM64ANDconst)
1745 v.AuxInt = int64ToAuxInt(c)
1746 v.AddArg(x)
1747 return true
1748 }
1749 break
1750 }
1751
1752
1753 for {
1754 x := v_0
1755 if x != v_1 {
1756 break
1757 }
1758 v.copyOf(x)
1759 return true
1760 }
1761
1762
1763 for {
1764 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1765 x := v_0
1766 if v_1.Op != OpARM64MVN {
1767 continue
1768 }
1769 y := v_1.Args[0]
1770 v.reset(OpARM64BIC)
1771 v.AddArg2(x, y)
1772 return true
1773 }
1774 break
1775 }
1776
1777
1778
1779 for {
1780 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1781 x0 := v_0
1782 x1 := v_1
1783 if x1.Op != OpARM64SLLconst {
1784 continue
1785 }
1786 c := auxIntToInt64(x1.AuxInt)
1787 y := x1.Args[0]
1788 if !(clobberIfDead(x1)) {
1789 continue
1790 }
1791 v.reset(OpARM64ANDshiftLL)
1792 v.AuxInt = int64ToAuxInt(c)
1793 v.AddArg2(x0, y)
1794 return true
1795 }
1796 break
1797 }
1798
1799
1800
1801 for {
1802 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1803 x0 := v_0
1804 x1 := v_1
1805 if x1.Op != OpARM64SRLconst {
1806 continue
1807 }
1808 c := auxIntToInt64(x1.AuxInt)
1809 y := x1.Args[0]
1810 if !(clobberIfDead(x1)) {
1811 continue
1812 }
1813 v.reset(OpARM64ANDshiftRL)
1814 v.AuxInt = int64ToAuxInt(c)
1815 v.AddArg2(x0, y)
1816 return true
1817 }
1818 break
1819 }
1820
1821
1822
1823 for {
1824 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1825 x0 := v_0
1826 x1 := v_1
1827 if x1.Op != OpARM64SRAconst {
1828 continue
1829 }
1830 c := auxIntToInt64(x1.AuxInt)
1831 y := x1.Args[0]
1832 if !(clobberIfDead(x1)) {
1833 continue
1834 }
1835 v.reset(OpARM64ANDshiftRA)
1836 v.AuxInt = int64ToAuxInt(c)
1837 v.AddArg2(x0, y)
1838 return true
1839 }
1840 break
1841 }
1842
1843
1844
1845 for {
1846 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1847 x0 := v_0
1848 x1 := v_1
1849 if x1.Op != OpARM64RORconst {
1850 continue
1851 }
1852 c := auxIntToInt64(x1.AuxInt)
1853 y := x1.Args[0]
1854 if !(clobberIfDead(x1)) {
1855 continue
1856 }
1857 v.reset(OpARM64ANDshiftRO)
1858 v.AuxInt = int64ToAuxInt(c)
1859 v.AddArg2(x0, y)
1860 return true
1861 }
1862 break
1863 }
1864 return false
1865 }
1866 func rewriteValueARM64_OpARM64ANDconst(v *Value) bool {
1867 v_0 := v.Args[0]
1868
1869
1870 for {
1871 if auxIntToInt64(v.AuxInt) != 0 {
1872 break
1873 }
1874 v.reset(OpARM64MOVDconst)
1875 v.AuxInt = int64ToAuxInt(0)
1876 return true
1877 }
1878
1879
1880 for {
1881 if auxIntToInt64(v.AuxInt) != -1 {
1882 break
1883 }
1884 x := v_0
1885 v.copyOf(x)
1886 return true
1887 }
1888
1889
1890 for {
1891 c := auxIntToInt64(v.AuxInt)
1892 if v_0.Op != OpARM64MOVDconst {
1893 break
1894 }
1895 d := auxIntToInt64(v_0.AuxInt)
1896 v.reset(OpARM64MOVDconst)
1897 v.AuxInt = int64ToAuxInt(c & d)
1898 return true
1899 }
1900
1901
1902 for {
1903 c := auxIntToInt64(v.AuxInt)
1904 if v_0.Op != OpARM64ANDconst {
1905 break
1906 }
1907 d := auxIntToInt64(v_0.AuxInt)
1908 x := v_0.Args[0]
1909 v.reset(OpARM64ANDconst)
1910 v.AuxInt = int64ToAuxInt(c & d)
1911 v.AddArg(x)
1912 return true
1913 }
1914
1915
1916 for {
1917 c := auxIntToInt64(v.AuxInt)
1918 if v_0.Op != OpARM64MOVWUreg {
1919 break
1920 }
1921 x := v_0.Args[0]
1922 v.reset(OpARM64ANDconst)
1923 v.AuxInt = int64ToAuxInt(c & (1<<32 - 1))
1924 v.AddArg(x)
1925 return true
1926 }
1927
1928
1929 for {
1930 c := auxIntToInt64(v.AuxInt)
1931 if v_0.Op != OpARM64MOVHUreg {
1932 break
1933 }
1934 x := v_0.Args[0]
1935 v.reset(OpARM64ANDconst)
1936 v.AuxInt = int64ToAuxInt(c & (1<<16 - 1))
1937 v.AddArg(x)
1938 return true
1939 }
1940
1941
1942 for {
1943 c := auxIntToInt64(v.AuxInt)
1944 if v_0.Op != OpARM64MOVBUreg {
1945 break
1946 }
1947 x := v_0.Args[0]
1948 v.reset(OpARM64ANDconst)
1949 v.AuxInt = int64ToAuxInt(c & (1<<8 - 1))
1950 v.AddArg(x)
1951 return true
1952 }
1953
1954
1955
1956 for {
1957 ac := auxIntToInt64(v.AuxInt)
1958 if v_0.Op != OpARM64SLLconst {
1959 break
1960 }
1961 sc := auxIntToInt64(v_0.AuxInt)
1962 x := v_0.Args[0]
1963 if !(isARM64BFMask(sc, ac, sc)) {
1964 break
1965 }
1966 v.reset(OpARM64UBFIZ)
1967 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc, arm64BFWidth(ac, sc)))
1968 v.AddArg(x)
1969 return true
1970 }
1971
1972
1973
1974 for {
1975 ac := auxIntToInt64(v.AuxInt)
1976 if v_0.Op != OpARM64SRLconst {
1977 break
1978 }
1979 sc := auxIntToInt64(v_0.AuxInt)
1980 x := v_0.Args[0]
1981 if !(isARM64BFMask(sc, ac, 0)) {
1982 break
1983 }
1984 v.reset(OpARM64UBFX)
1985 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc, arm64BFWidth(ac, 0)))
1986 v.AddArg(x)
1987 return true
1988 }
1989
1990
1991
1992 for {
1993 c := auxIntToInt64(v.AuxInt)
1994 if v_0.Op != OpARM64UBFX {
1995 break
1996 }
1997 bfc := auxIntToArm64BitField(v_0.AuxInt)
1998 x := v_0.Args[0]
1999 if !(isARM64BFMask(0, c, 0)) {
2000 break
2001 }
2002 v.reset(OpARM64UBFX)
2003 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.getARM64BFlsb(), min(bfc.getARM64BFwidth(), arm64BFWidth(c, 0))))
2004 v.AddArg(x)
2005 return true
2006 }
2007 return false
2008 }
2009 func rewriteValueARM64_OpARM64ANDshiftLL(v *Value) bool {
2010 v_1 := v.Args[1]
2011 v_0 := v.Args[0]
2012 b := v.Block
2013
2014
2015 for {
2016 d := auxIntToInt64(v.AuxInt)
2017 if v_0.Op != OpARM64MOVDconst {
2018 break
2019 }
2020 c := auxIntToInt64(v_0.AuxInt)
2021 x := v_1
2022 v.reset(OpARM64ANDconst)
2023 v.AuxInt = int64ToAuxInt(c)
2024 v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
2025 v0.AuxInt = int64ToAuxInt(d)
2026 v0.AddArg(x)
2027 v.AddArg(v0)
2028 return true
2029 }
2030
2031
2032 for {
2033 d := auxIntToInt64(v.AuxInt)
2034 x := v_0
2035 if v_1.Op != OpARM64MOVDconst {
2036 break
2037 }
2038 c := auxIntToInt64(v_1.AuxInt)
2039 v.reset(OpARM64ANDconst)
2040 v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
2041 v.AddArg(x)
2042 return true
2043 }
2044
2045
2046 for {
2047 c := auxIntToInt64(v.AuxInt)
2048 y := v_0
2049 if y.Op != OpARM64SLLconst || auxIntToInt64(y.AuxInt) != c {
2050 break
2051 }
2052 x := y.Args[0]
2053 if x != v_1 {
2054 break
2055 }
2056 v.copyOf(y)
2057 return true
2058 }
2059 return false
2060 }
2061 func rewriteValueARM64_OpARM64ANDshiftRA(v *Value) bool {
2062 v_1 := v.Args[1]
2063 v_0 := v.Args[0]
2064 b := v.Block
2065
2066
2067 for {
2068 d := auxIntToInt64(v.AuxInt)
2069 if v_0.Op != OpARM64MOVDconst {
2070 break
2071 }
2072 c := auxIntToInt64(v_0.AuxInt)
2073 x := v_1
2074 v.reset(OpARM64ANDconst)
2075 v.AuxInt = int64ToAuxInt(c)
2076 v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
2077 v0.AuxInt = int64ToAuxInt(d)
2078 v0.AddArg(x)
2079 v.AddArg(v0)
2080 return true
2081 }
2082
2083
2084 for {
2085 d := auxIntToInt64(v.AuxInt)
2086 x := v_0
2087 if v_1.Op != OpARM64MOVDconst {
2088 break
2089 }
2090 c := auxIntToInt64(v_1.AuxInt)
2091 v.reset(OpARM64ANDconst)
2092 v.AuxInt = int64ToAuxInt(c >> uint64(d))
2093 v.AddArg(x)
2094 return true
2095 }
2096
2097
2098 for {
2099 c := auxIntToInt64(v.AuxInt)
2100 y := v_0
2101 if y.Op != OpARM64SRAconst || auxIntToInt64(y.AuxInt) != c {
2102 break
2103 }
2104 x := y.Args[0]
2105 if x != v_1 {
2106 break
2107 }
2108 v.copyOf(y)
2109 return true
2110 }
2111 return false
2112 }
2113 func rewriteValueARM64_OpARM64ANDshiftRL(v *Value) bool {
2114 v_1 := v.Args[1]
2115 v_0 := v.Args[0]
2116 b := v.Block
2117
2118
2119 for {
2120 d := auxIntToInt64(v.AuxInt)
2121 if v_0.Op != OpARM64MOVDconst {
2122 break
2123 }
2124 c := auxIntToInt64(v_0.AuxInt)
2125 x := v_1
2126 v.reset(OpARM64ANDconst)
2127 v.AuxInt = int64ToAuxInt(c)
2128 v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
2129 v0.AuxInt = int64ToAuxInt(d)
2130 v0.AddArg(x)
2131 v.AddArg(v0)
2132 return true
2133 }
2134
2135
2136 for {
2137 d := auxIntToInt64(v.AuxInt)
2138 x := v_0
2139 if v_1.Op != OpARM64MOVDconst {
2140 break
2141 }
2142 c := auxIntToInt64(v_1.AuxInt)
2143 v.reset(OpARM64ANDconst)
2144 v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
2145 v.AddArg(x)
2146 return true
2147 }
2148
2149
2150 for {
2151 c := auxIntToInt64(v.AuxInt)
2152 y := v_0
2153 if y.Op != OpARM64SRLconst || auxIntToInt64(y.AuxInt) != c {
2154 break
2155 }
2156 x := y.Args[0]
2157 if x != v_1 {
2158 break
2159 }
2160 v.copyOf(y)
2161 return true
2162 }
2163 return false
2164 }
2165 func rewriteValueARM64_OpARM64ANDshiftRO(v *Value) bool {
2166 v_1 := v.Args[1]
2167 v_0 := v.Args[0]
2168 b := v.Block
2169
2170
2171 for {
2172 d := auxIntToInt64(v.AuxInt)
2173 if v_0.Op != OpARM64MOVDconst {
2174 break
2175 }
2176 c := auxIntToInt64(v_0.AuxInt)
2177 x := v_1
2178 v.reset(OpARM64ANDconst)
2179 v.AuxInt = int64ToAuxInt(c)
2180 v0 := b.NewValue0(v.Pos, OpARM64RORconst, x.Type)
2181 v0.AuxInt = int64ToAuxInt(d)
2182 v0.AddArg(x)
2183 v.AddArg(v0)
2184 return true
2185 }
2186
2187
2188 for {
2189 d := auxIntToInt64(v.AuxInt)
2190 x := v_0
2191 if v_1.Op != OpARM64MOVDconst {
2192 break
2193 }
2194 c := auxIntToInt64(v_1.AuxInt)
2195 v.reset(OpARM64ANDconst)
2196 v.AuxInt = int64ToAuxInt(rotateRight64(c, d))
2197 v.AddArg(x)
2198 return true
2199 }
2200
2201
2202 for {
2203 c := auxIntToInt64(v.AuxInt)
2204 y := v_0
2205 if y.Op != OpARM64RORconst || auxIntToInt64(y.AuxInt) != c {
2206 break
2207 }
2208 x := y.Args[0]
2209 if x != v_1 {
2210 break
2211 }
2212 v.copyOf(y)
2213 return true
2214 }
2215 return false
2216 }
2217 func rewriteValueARM64_OpARM64BIC(v *Value) bool {
2218 v_1 := v.Args[1]
2219 v_0 := v.Args[0]
2220
2221
2222 for {
2223 x := v_0
2224 if v_1.Op != OpARM64MOVDconst {
2225 break
2226 }
2227 c := auxIntToInt64(v_1.AuxInt)
2228 v.reset(OpARM64ANDconst)
2229 v.AuxInt = int64ToAuxInt(^c)
2230 v.AddArg(x)
2231 return true
2232 }
2233
2234
2235 for {
2236 x := v_0
2237 if x != v_1 {
2238 break
2239 }
2240 v.reset(OpARM64MOVDconst)
2241 v.AuxInt = int64ToAuxInt(0)
2242 return true
2243 }
2244
2245
2246
2247 for {
2248 x0 := v_0
2249 x1 := v_1
2250 if x1.Op != OpARM64SLLconst {
2251 break
2252 }
2253 c := auxIntToInt64(x1.AuxInt)
2254 y := x1.Args[0]
2255 if !(clobberIfDead(x1)) {
2256 break
2257 }
2258 v.reset(OpARM64BICshiftLL)
2259 v.AuxInt = int64ToAuxInt(c)
2260 v.AddArg2(x0, y)
2261 return true
2262 }
2263
2264
2265
2266 for {
2267 x0 := v_0
2268 x1 := v_1
2269 if x1.Op != OpARM64SRLconst {
2270 break
2271 }
2272 c := auxIntToInt64(x1.AuxInt)
2273 y := x1.Args[0]
2274 if !(clobberIfDead(x1)) {
2275 break
2276 }
2277 v.reset(OpARM64BICshiftRL)
2278 v.AuxInt = int64ToAuxInt(c)
2279 v.AddArg2(x0, y)
2280 return true
2281 }
2282
2283
2284
2285 for {
2286 x0 := v_0
2287 x1 := v_1
2288 if x1.Op != OpARM64SRAconst {
2289 break
2290 }
2291 c := auxIntToInt64(x1.AuxInt)
2292 y := x1.Args[0]
2293 if !(clobberIfDead(x1)) {
2294 break
2295 }
2296 v.reset(OpARM64BICshiftRA)
2297 v.AuxInt = int64ToAuxInt(c)
2298 v.AddArg2(x0, y)
2299 return true
2300 }
2301
2302
2303
2304 for {
2305 x0 := v_0
2306 x1 := v_1
2307 if x1.Op != OpARM64RORconst {
2308 break
2309 }
2310 c := auxIntToInt64(x1.AuxInt)
2311 y := x1.Args[0]
2312 if !(clobberIfDead(x1)) {
2313 break
2314 }
2315 v.reset(OpARM64BICshiftRO)
2316 v.AuxInt = int64ToAuxInt(c)
2317 v.AddArg2(x0, y)
2318 return true
2319 }
2320 return false
2321 }
2322 func rewriteValueARM64_OpARM64BICshiftLL(v *Value) bool {
2323 v_1 := v.Args[1]
2324 v_0 := v.Args[0]
2325
2326
2327 for {
2328 d := auxIntToInt64(v.AuxInt)
2329 x := v_0
2330 if v_1.Op != OpARM64MOVDconst {
2331 break
2332 }
2333 c := auxIntToInt64(v_1.AuxInt)
2334 v.reset(OpARM64ANDconst)
2335 v.AuxInt = int64ToAuxInt(^int64(uint64(c) << uint64(d)))
2336 v.AddArg(x)
2337 return true
2338 }
2339
2340
2341 for {
2342 c := auxIntToInt64(v.AuxInt)
2343 if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
2344 break
2345 }
2346 x := v_0.Args[0]
2347 if x != v_1 {
2348 break
2349 }
2350 v.reset(OpARM64MOVDconst)
2351 v.AuxInt = int64ToAuxInt(0)
2352 return true
2353 }
2354 return false
2355 }
2356 func rewriteValueARM64_OpARM64BICshiftRA(v *Value) bool {
2357 v_1 := v.Args[1]
2358 v_0 := v.Args[0]
2359
2360
2361 for {
2362 d := auxIntToInt64(v.AuxInt)
2363 x := v_0
2364 if v_1.Op != OpARM64MOVDconst {
2365 break
2366 }
2367 c := auxIntToInt64(v_1.AuxInt)
2368 v.reset(OpARM64ANDconst)
2369 v.AuxInt = int64ToAuxInt(^(c >> uint64(d)))
2370 v.AddArg(x)
2371 return true
2372 }
2373
2374
2375 for {
2376 c := auxIntToInt64(v.AuxInt)
2377 if v_0.Op != OpARM64SRAconst || auxIntToInt64(v_0.AuxInt) != c {
2378 break
2379 }
2380 x := v_0.Args[0]
2381 if x != v_1 {
2382 break
2383 }
2384 v.reset(OpARM64MOVDconst)
2385 v.AuxInt = int64ToAuxInt(0)
2386 return true
2387 }
2388 return false
2389 }
2390 func rewriteValueARM64_OpARM64BICshiftRL(v *Value) bool {
2391 v_1 := v.Args[1]
2392 v_0 := v.Args[0]
2393
2394
2395 for {
2396 d := auxIntToInt64(v.AuxInt)
2397 x := v_0
2398 if v_1.Op != OpARM64MOVDconst {
2399 break
2400 }
2401 c := auxIntToInt64(v_1.AuxInt)
2402 v.reset(OpARM64ANDconst)
2403 v.AuxInt = int64ToAuxInt(^int64(uint64(c) >> uint64(d)))
2404 v.AddArg(x)
2405 return true
2406 }
2407
2408
2409 for {
2410 c := auxIntToInt64(v.AuxInt)
2411 if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
2412 break
2413 }
2414 x := v_0.Args[0]
2415 if x != v_1 {
2416 break
2417 }
2418 v.reset(OpARM64MOVDconst)
2419 v.AuxInt = int64ToAuxInt(0)
2420 return true
2421 }
2422 return false
2423 }
2424 func rewriteValueARM64_OpARM64BICshiftRO(v *Value) bool {
2425 v_1 := v.Args[1]
2426 v_0 := v.Args[0]
2427
2428
2429 for {
2430 d := auxIntToInt64(v.AuxInt)
2431 x := v_0
2432 if v_1.Op != OpARM64MOVDconst {
2433 break
2434 }
2435 c := auxIntToInt64(v_1.AuxInt)
2436 v.reset(OpARM64ANDconst)
2437 v.AuxInt = int64ToAuxInt(^rotateRight64(c, d))
2438 v.AddArg(x)
2439 return true
2440 }
2441
2442
2443 for {
2444 c := auxIntToInt64(v.AuxInt)
2445 if v_0.Op != OpARM64RORconst || auxIntToInt64(v_0.AuxInt) != c {
2446 break
2447 }
2448 x := v_0.Args[0]
2449 if x != v_1 {
2450 break
2451 }
2452 v.reset(OpARM64MOVDconst)
2453 v.AuxInt = int64ToAuxInt(0)
2454 return true
2455 }
2456 return false
2457 }
2458 func rewriteValueARM64_OpARM64CMN(v *Value) bool {
2459 v_1 := v.Args[1]
2460 v_0 := v.Args[0]
2461
2462
2463 for {
2464 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2465 x := v_0
2466 if v_1.Op != OpARM64MOVDconst {
2467 continue
2468 }
2469 c := auxIntToInt64(v_1.AuxInt)
2470 v.reset(OpARM64CMNconst)
2471 v.AuxInt = int64ToAuxInt(c)
2472 v.AddArg(x)
2473 return true
2474 }
2475 break
2476 }
2477
2478
2479
2480 for {
2481 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2482 x0 := v_0
2483 x1 := v_1
2484 if x1.Op != OpARM64SLLconst {
2485 continue
2486 }
2487 c := auxIntToInt64(x1.AuxInt)
2488 y := x1.Args[0]
2489 if !(clobberIfDead(x1)) {
2490 continue
2491 }
2492 v.reset(OpARM64CMNshiftLL)
2493 v.AuxInt = int64ToAuxInt(c)
2494 v.AddArg2(x0, y)
2495 return true
2496 }
2497 break
2498 }
2499
2500
2501
2502 for {
2503 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2504 x0 := v_0
2505 x1 := v_1
2506 if x1.Op != OpARM64SRLconst {
2507 continue
2508 }
2509 c := auxIntToInt64(x1.AuxInt)
2510 y := x1.Args[0]
2511 if !(clobberIfDead(x1)) {
2512 continue
2513 }
2514 v.reset(OpARM64CMNshiftRL)
2515 v.AuxInt = int64ToAuxInt(c)
2516 v.AddArg2(x0, y)
2517 return true
2518 }
2519 break
2520 }
2521
2522
2523
2524 for {
2525 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2526 x0 := v_0
2527 x1 := v_1
2528 if x1.Op != OpARM64SRAconst {
2529 continue
2530 }
2531 c := auxIntToInt64(x1.AuxInt)
2532 y := x1.Args[0]
2533 if !(clobberIfDead(x1)) {
2534 continue
2535 }
2536 v.reset(OpARM64CMNshiftRA)
2537 v.AuxInt = int64ToAuxInt(c)
2538 v.AddArg2(x0, y)
2539 return true
2540 }
2541 break
2542 }
2543 return false
2544 }
2545 func rewriteValueARM64_OpARM64CMNW(v *Value) bool {
2546 v_1 := v.Args[1]
2547 v_0 := v.Args[0]
2548
2549
2550 for {
2551 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2552 x := v_0
2553 if v_1.Op != OpARM64MOVDconst {
2554 continue
2555 }
2556 c := auxIntToInt64(v_1.AuxInt)
2557 v.reset(OpARM64CMNWconst)
2558 v.AuxInt = int32ToAuxInt(int32(c))
2559 v.AddArg(x)
2560 return true
2561 }
2562 break
2563 }
2564 return false
2565 }
2566 func rewriteValueARM64_OpARM64CMNWconst(v *Value) bool {
2567 v_0 := v.Args[0]
2568
2569
2570
2571 for {
2572 c := auxIntToInt32(v.AuxInt)
2573 y := v_0
2574 if !(c < 0 && c != -1<<31) {
2575 break
2576 }
2577 v.reset(OpARM64CMPWconst)
2578 v.AuxInt = int32ToAuxInt(-c)
2579 v.AddArg(y)
2580 return true
2581 }
2582
2583
2584 for {
2585 y := auxIntToInt32(v.AuxInt)
2586 if v_0.Op != OpARM64MOVDconst {
2587 break
2588 }
2589 x := auxIntToInt64(v_0.AuxInt)
2590 v.reset(OpARM64FlagConstant)
2591 v.AuxInt = flagConstantToAuxInt(addFlags32(int32(x), y))
2592 return true
2593 }
2594 return false
2595 }
2596 func rewriteValueARM64_OpARM64CMNconst(v *Value) bool {
2597 v_0 := v.Args[0]
2598
2599
2600
2601 for {
2602 c := auxIntToInt64(v.AuxInt)
2603 y := v_0
2604 if !(c < 0 && c != -1<<63) {
2605 break
2606 }
2607 v.reset(OpARM64CMPconst)
2608 v.AuxInt = int64ToAuxInt(-c)
2609 v.AddArg(y)
2610 return true
2611 }
2612
2613
2614 for {
2615 y := auxIntToInt64(v.AuxInt)
2616 if v_0.Op != OpARM64MOVDconst {
2617 break
2618 }
2619 x := auxIntToInt64(v_0.AuxInt)
2620 v.reset(OpARM64FlagConstant)
2621 v.AuxInt = flagConstantToAuxInt(addFlags64(x, y))
2622 return true
2623 }
2624 return false
2625 }
2626 func rewriteValueARM64_OpARM64CMNshiftLL(v *Value) bool {
2627 v_1 := v.Args[1]
2628 v_0 := v.Args[0]
2629 b := v.Block
2630
2631
2632 for {
2633 d := auxIntToInt64(v.AuxInt)
2634 if v_0.Op != OpARM64MOVDconst {
2635 break
2636 }
2637 c := auxIntToInt64(v_0.AuxInt)
2638 x := v_1
2639 v.reset(OpARM64CMNconst)
2640 v.AuxInt = int64ToAuxInt(c)
2641 v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
2642 v0.AuxInt = int64ToAuxInt(d)
2643 v0.AddArg(x)
2644 v.AddArg(v0)
2645 return true
2646 }
2647
2648
2649 for {
2650 d := auxIntToInt64(v.AuxInt)
2651 x := v_0
2652 if v_1.Op != OpARM64MOVDconst {
2653 break
2654 }
2655 c := auxIntToInt64(v_1.AuxInt)
2656 v.reset(OpARM64CMNconst)
2657 v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
2658 v.AddArg(x)
2659 return true
2660 }
2661 return false
2662 }
2663 func rewriteValueARM64_OpARM64CMNshiftRA(v *Value) bool {
2664 v_1 := v.Args[1]
2665 v_0 := v.Args[0]
2666 b := v.Block
2667
2668
2669 for {
2670 d := auxIntToInt64(v.AuxInt)
2671 if v_0.Op != OpARM64MOVDconst {
2672 break
2673 }
2674 c := auxIntToInt64(v_0.AuxInt)
2675 x := v_1
2676 v.reset(OpARM64CMNconst)
2677 v.AuxInt = int64ToAuxInt(c)
2678 v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
2679 v0.AuxInt = int64ToAuxInt(d)
2680 v0.AddArg(x)
2681 v.AddArg(v0)
2682 return true
2683 }
2684
2685
2686 for {
2687 d := auxIntToInt64(v.AuxInt)
2688 x := v_0
2689 if v_1.Op != OpARM64MOVDconst {
2690 break
2691 }
2692 c := auxIntToInt64(v_1.AuxInt)
2693 v.reset(OpARM64CMNconst)
2694 v.AuxInt = int64ToAuxInt(c >> uint64(d))
2695 v.AddArg(x)
2696 return true
2697 }
2698 return false
2699 }
2700 func rewriteValueARM64_OpARM64CMNshiftRL(v *Value) bool {
2701 v_1 := v.Args[1]
2702 v_0 := v.Args[0]
2703 b := v.Block
2704
2705
2706 for {
2707 d := auxIntToInt64(v.AuxInt)
2708 if v_0.Op != OpARM64MOVDconst {
2709 break
2710 }
2711 c := auxIntToInt64(v_0.AuxInt)
2712 x := v_1
2713 v.reset(OpARM64CMNconst)
2714 v.AuxInt = int64ToAuxInt(c)
2715 v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
2716 v0.AuxInt = int64ToAuxInt(d)
2717 v0.AddArg(x)
2718 v.AddArg(v0)
2719 return true
2720 }
2721
2722
2723 for {
2724 d := auxIntToInt64(v.AuxInt)
2725 x := v_0
2726 if v_1.Op != OpARM64MOVDconst {
2727 break
2728 }
2729 c := auxIntToInt64(v_1.AuxInt)
2730 v.reset(OpARM64CMNconst)
2731 v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
2732 v.AddArg(x)
2733 return true
2734 }
2735 return false
2736 }
2737 func rewriteValueARM64_OpARM64CMP(v *Value) bool {
2738 v_1 := v.Args[1]
2739 v_0 := v.Args[0]
2740 b := v.Block
2741
2742
2743 for {
2744 x := v_0
2745 if v_1.Op != OpARM64MOVDconst {
2746 break
2747 }
2748 c := auxIntToInt64(v_1.AuxInt)
2749 v.reset(OpARM64CMPconst)
2750 v.AuxInt = int64ToAuxInt(c)
2751 v.AddArg(x)
2752 return true
2753 }
2754
2755
2756 for {
2757 if v_0.Op != OpARM64MOVDconst {
2758 break
2759 }
2760 c := auxIntToInt64(v_0.AuxInt)
2761 x := v_1
2762 v.reset(OpARM64InvertFlags)
2763 v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
2764 v0.AuxInt = int64ToAuxInt(c)
2765 v0.AddArg(x)
2766 v.AddArg(v0)
2767 return true
2768 }
2769
2770
2771
2772 for {
2773 x := v_0
2774 y := v_1
2775 if !(canonLessThan(x, y)) {
2776 break
2777 }
2778 v.reset(OpARM64InvertFlags)
2779 v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
2780 v0.AddArg2(y, x)
2781 v.AddArg(v0)
2782 return true
2783 }
2784
2785
2786
2787 for {
2788 x0 := v_0
2789 x1 := v_1
2790 if x1.Op != OpARM64SLLconst {
2791 break
2792 }
2793 c := auxIntToInt64(x1.AuxInt)
2794 y := x1.Args[0]
2795 if !(clobberIfDead(x1)) {
2796 break
2797 }
2798 v.reset(OpARM64CMPshiftLL)
2799 v.AuxInt = int64ToAuxInt(c)
2800 v.AddArg2(x0, y)
2801 return true
2802 }
2803
2804
2805
2806 for {
2807 x0 := v_0
2808 if x0.Op != OpARM64SLLconst {
2809 break
2810 }
2811 c := auxIntToInt64(x0.AuxInt)
2812 y := x0.Args[0]
2813 x1 := v_1
2814 if !(clobberIfDead(x0)) {
2815 break
2816 }
2817 v.reset(OpARM64InvertFlags)
2818 v0 := b.NewValue0(v.Pos, OpARM64CMPshiftLL, types.TypeFlags)
2819 v0.AuxInt = int64ToAuxInt(c)
2820 v0.AddArg2(x1, y)
2821 v.AddArg(v0)
2822 return true
2823 }
2824
2825
2826
2827 for {
2828 x0 := v_0
2829 x1 := v_1
2830 if x1.Op != OpARM64SRLconst {
2831 break
2832 }
2833 c := auxIntToInt64(x1.AuxInt)
2834 y := x1.Args[0]
2835 if !(clobberIfDead(x1)) {
2836 break
2837 }
2838 v.reset(OpARM64CMPshiftRL)
2839 v.AuxInt = int64ToAuxInt(c)
2840 v.AddArg2(x0, y)
2841 return true
2842 }
2843
2844
2845
2846 for {
2847 x0 := v_0
2848 if x0.Op != OpARM64SRLconst {
2849 break
2850 }
2851 c := auxIntToInt64(x0.AuxInt)
2852 y := x0.Args[0]
2853 x1 := v_1
2854 if !(clobberIfDead(x0)) {
2855 break
2856 }
2857 v.reset(OpARM64InvertFlags)
2858 v0 := b.NewValue0(v.Pos, OpARM64CMPshiftRL, types.TypeFlags)
2859 v0.AuxInt = int64ToAuxInt(c)
2860 v0.AddArg2(x1, y)
2861 v.AddArg(v0)
2862 return true
2863 }
2864
2865
2866
2867 for {
2868 x0 := v_0
2869 x1 := v_1
2870 if x1.Op != OpARM64SRAconst {
2871 break
2872 }
2873 c := auxIntToInt64(x1.AuxInt)
2874 y := x1.Args[0]
2875 if !(clobberIfDead(x1)) {
2876 break
2877 }
2878 v.reset(OpARM64CMPshiftRA)
2879 v.AuxInt = int64ToAuxInt(c)
2880 v.AddArg2(x0, y)
2881 return true
2882 }
2883
2884
2885
2886 for {
2887 x0 := v_0
2888 if x0.Op != OpARM64SRAconst {
2889 break
2890 }
2891 c := auxIntToInt64(x0.AuxInt)
2892 y := x0.Args[0]
2893 x1 := v_1
2894 if !(clobberIfDead(x0)) {
2895 break
2896 }
2897 v.reset(OpARM64InvertFlags)
2898 v0 := b.NewValue0(v.Pos, OpARM64CMPshiftRA, types.TypeFlags)
2899 v0.AuxInt = int64ToAuxInt(c)
2900 v0.AddArg2(x1, y)
2901 v.AddArg(v0)
2902 return true
2903 }
2904 return false
2905 }
2906 func rewriteValueARM64_OpARM64CMPW(v *Value) bool {
2907 v_1 := v.Args[1]
2908 v_0 := v.Args[0]
2909 b := v.Block
2910
2911
2912 for {
2913 x := v_0
2914 if v_1.Op != OpARM64MOVDconst {
2915 break
2916 }
2917 c := auxIntToInt64(v_1.AuxInt)
2918 v.reset(OpARM64CMPWconst)
2919 v.AuxInt = int32ToAuxInt(int32(c))
2920 v.AddArg(x)
2921 return true
2922 }
2923
2924
2925 for {
2926 if v_0.Op != OpARM64MOVDconst {
2927 break
2928 }
2929 c := auxIntToInt64(v_0.AuxInt)
2930 x := v_1
2931 v.reset(OpARM64InvertFlags)
2932 v0 := b.NewValue0(v.Pos, OpARM64CMPWconst, types.TypeFlags)
2933 v0.AuxInt = int32ToAuxInt(int32(c))
2934 v0.AddArg(x)
2935 v.AddArg(v0)
2936 return true
2937 }
2938
2939
2940
2941 for {
2942 x := v_0
2943 y := v_1
2944 if !(canonLessThan(x, y)) {
2945 break
2946 }
2947 v.reset(OpARM64InvertFlags)
2948 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
2949 v0.AddArg2(y, x)
2950 v.AddArg(v0)
2951 return true
2952 }
2953 return false
2954 }
2955 func rewriteValueARM64_OpARM64CMPWconst(v *Value) bool {
2956 v_0 := v.Args[0]
2957
2958
2959
2960 for {
2961 c := auxIntToInt32(v.AuxInt)
2962 y := v_0
2963 if !(c < 0 && c != -1<<31) {
2964 break
2965 }
2966 v.reset(OpARM64CMNWconst)
2967 v.AuxInt = int32ToAuxInt(-c)
2968 v.AddArg(y)
2969 return true
2970 }
2971
2972
2973 for {
2974 y := auxIntToInt32(v.AuxInt)
2975 if v_0.Op != OpARM64MOVDconst {
2976 break
2977 }
2978 x := auxIntToInt64(v_0.AuxInt)
2979 v.reset(OpARM64FlagConstant)
2980 v.AuxInt = flagConstantToAuxInt(subFlags32(int32(x), y))
2981 return true
2982 }
2983
2984
2985
2986 for {
2987 c := auxIntToInt32(v.AuxInt)
2988 if v_0.Op != OpARM64MOVBUreg || !(0xff < c) {
2989 break
2990 }
2991 v.reset(OpARM64FlagConstant)
2992 v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
2993 return true
2994 }
2995
2996
2997
2998 for {
2999 c := auxIntToInt32(v.AuxInt)
3000 if v_0.Op != OpARM64MOVHUreg || !(0xffff < c) {
3001 break
3002 }
3003 v.reset(OpARM64FlagConstant)
3004 v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
3005 return true
3006 }
3007 return false
3008 }
3009 func rewriteValueARM64_OpARM64CMPconst(v *Value) bool {
3010 v_0 := v.Args[0]
3011
3012
3013
3014 for {
3015 c := auxIntToInt64(v.AuxInt)
3016 y := v_0
3017 if !(c < 0 && c != -1<<63) {
3018 break
3019 }
3020 v.reset(OpARM64CMNconst)
3021 v.AuxInt = int64ToAuxInt(-c)
3022 v.AddArg(y)
3023 return true
3024 }
3025
3026
3027 for {
3028 y := auxIntToInt64(v.AuxInt)
3029 if v_0.Op != OpARM64MOVDconst {
3030 break
3031 }
3032 x := auxIntToInt64(v_0.AuxInt)
3033 v.reset(OpARM64FlagConstant)
3034 v.AuxInt = flagConstantToAuxInt(subFlags64(x, y))
3035 return true
3036 }
3037
3038
3039
3040 for {
3041 c := auxIntToInt64(v.AuxInt)
3042 if v_0.Op != OpARM64MOVBUreg || !(0xff < c) {
3043 break
3044 }
3045 v.reset(OpARM64FlagConstant)
3046 v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
3047 return true
3048 }
3049
3050
3051
3052 for {
3053 c := auxIntToInt64(v.AuxInt)
3054 if v_0.Op != OpARM64MOVHUreg || !(0xffff < c) {
3055 break
3056 }
3057 v.reset(OpARM64FlagConstant)
3058 v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
3059 return true
3060 }
3061
3062
3063
3064 for {
3065 c := auxIntToInt64(v.AuxInt)
3066 if v_0.Op != OpARM64MOVWUreg || !(0xffffffff < c) {
3067 break
3068 }
3069 v.reset(OpARM64FlagConstant)
3070 v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
3071 return true
3072 }
3073
3074
3075
3076 for {
3077 n := auxIntToInt64(v.AuxInt)
3078 if v_0.Op != OpARM64ANDconst {
3079 break
3080 }
3081 m := auxIntToInt64(v_0.AuxInt)
3082 if !(0 <= m && m < n) {
3083 break
3084 }
3085 v.reset(OpARM64FlagConstant)
3086 v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
3087 return true
3088 }
3089
3090
3091
3092 for {
3093 n := auxIntToInt64(v.AuxInt)
3094 if v_0.Op != OpARM64SRLconst {
3095 break
3096 }
3097 c := auxIntToInt64(v_0.AuxInt)
3098 if !(0 <= n && 0 < c && c <= 63 && (1<<uint64(64-c)) <= uint64(n)) {
3099 break
3100 }
3101 v.reset(OpARM64FlagConstant)
3102 v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
3103 return true
3104 }
3105 return false
3106 }
3107 func rewriteValueARM64_OpARM64CMPshiftLL(v *Value) bool {
3108 v_1 := v.Args[1]
3109 v_0 := v.Args[0]
3110 b := v.Block
3111
3112
3113 for {
3114 d := auxIntToInt64(v.AuxInt)
3115 if v_0.Op != OpARM64MOVDconst {
3116 break
3117 }
3118 c := auxIntToInt64(v_0.AuxInt)
3119 x := v_1
3120 v.reset(OpARM64InvertFlags)
3121 v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
3122 v0.AuxInt = int64ToAuxInt(c)
3123 v1 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
3124 v1.AuxInt = int64ToAuxInt(d)
3125 v1.AddArg(x)
3126 v0.AddArg(v1)
3127 v.AddArg(v0)
3128 return true
3129 }
3130
3131
3132 for {
3133 d := auxIntToInt64(v.AuxInt)
3134 x := v_0
3135 if v_1.Op != OpARM64MOVDconst {
3136 break
3137 }
3138 c := auxIntToInt64(v_1.AuxInt)
3139 v.reset(OpARM64CMPconst)
3140 v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
3141 v.AddArg(x)
3142 return true
3143 }
3144 return false
3145 }
3146 func rewriteValueARM64_OpARM64CMPshiftRA(v *Value) bool {
3147 v_1 := v.Args[1]
3148 v_0 := v.Args[0]
3149 b := v.Block
3150
3151
3152 for {
3153 d := auxIntToInt64(v.AuxInt)
3154 if v_0.Op != OpARM64MOVDconst {
3155 break
3156 }
3157 c := auxIntToInt64(v_0.AuxInt)
3158 x := v_1
3159 v.reset(OpARM64InvertFlags)
3160 v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
3161 v0.AuxInt = int64ToAuxInt(c)
3162 v1 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
3163 v1.AuxInt = int64ToAuxInt(d)
3164 v1.AddArg(x)
3165 v0.AddArg(v1)
3166 v.AddArg(v0)
3167 return true
3168 }
3169
3170
3171 for {
3172 d := auxIntToInt64(v.AuxInt)
3173 x := v_0
3174 if v_1.Op != OpARM64MOVDconst {
3175 break
3176 }
3177 c := auxIntToInt64(v_1.AuxInt)
3178 v.reset(OpARM64CMPconst)
3179 v.AuxInt = int64ToAuxInt(c >> uint64(d))
3180 v.AddArg(x)
3181 return true
3182 }
3183 return false
3184 }
3185 func rewriteValueARM64_OpARM64CMPshiftRL(v *Value) bool {
3186 v_1 := v.Args[1]
3187 v_0 := v.Args[0]
3188 b := v.Block
3189
3190
3191 for {
3192 d := auxIntToInt64(v.AuxInt)
3193 if v_0.Op != OpARM64MOVDconst {
3194 break
3195 }
3196 c := auxIntToInt64(v_0.AuxInt)
3197 x := v_1
3198 v.reset(OpARM64InvertFlags)
3199 v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
3200 v0.AuxInt = int64ToAuxInt(c)
3201 v1 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
3202 v1.AuxInt = int64ToAuxInt(d)
3203 v1.AddArg(x)
3204 v0.AddArg(v1)
3205 v.AddArg(v0)
3206 return true
3207 }
3208
3209
3210 for {
3211 d := auxIntToInt64(v.AuxInt)
3212 x := v_0
3213 if v_1.Op != OpARM64MOVDconst {
3214 break
3215 }
3216 c := auxIntToInt64(v_1.AuxInt)
3217 v.reset(OpARM64CMPconst)
3218 v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
3219 v.AddArg(x)
3220 return true
3221 }
3222 return false
3223 }
3224 func rewriteValueARM64_OpARM64CSEL(v *Value) bool {
3225 v_2 := v.Args[2]
3226 v_1 := v.Args[1]
3227 v_0 := v.Args[0]
3228
3229
3230 for {
3231 cc := auxIntToOp(v.AuxInt)
3232 if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != -1 || v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
3233 break
3234 }
3235 flag := v_2
3236 v.reset(OpARM64CSETM)
3237 v.AuxInt = opToAuxInt(cc)
3238 v.AddArg(flag)
3239 return true
3240 }
3241
3242
3243 for {
3244 cc := auxIntToOp(v.AuxInt)
3245 if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0 || v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
3246 break
3247 }
3248 flag := v_2
3249 v.reset(OpARM64CSETM)
3250 v.AuxInt = opToAuxInt(arm64Negate(cc))
3251 v.AddArg(flag)
3252 return true
3253 }
3254
3255
3256 for {
3257 cc := auxIntToOp(v.AuxInt)
3258 x := v_0
3259 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
3260 break
3261 }
3262 flag := v_2
3263 v.reset(OpARM64CSEL0)
3264 v.AuxInt = opToAuxInt(cc)
3265 v.AddArg2(x, flag)
3266 return true
3267 }
3268
3269
3270 for {
3271 cc := auxIntToOp(v.AuxInt)
3272 if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0 {
3273 break
3274 }
3275 y := v_1
3276 flag := v_2
3277 v.reset(OpARM64CSEL0)
3278 v.AuxInt = opToAuxInt(arm64Negate(cc))
3279 v.AddArg2(y, flag)
3280 return true
3281 }
3282
3283
3284 for {
3285 cc := auxIntToOp(v.AuxInt)
3286 x := v_0
3287 if v_1.Op != OpARM64ADDconst || auxIntToInt64(v_1.AuxInt) != 1 {
3288 break
3289 }
3290 a := v_1.Args[0]
3291 flag := v_2
3292 v.reset(OpARM64CSINC)
3293 v.AuxInt = opToAuxInt(cc)
3294 v.AddArg3(x, a, flag)
3295 return true
3296 }
3297
3298
3299 for {
3300 cc := auxIntToOp(v.AuxInt)
3301 if v_0.Op != OpARM64ADDconst || auxIntToInt64(v_0.AuxInt) != 1 {
3302 break
3303 }
3304 a := v_0.Args[0]
3305 x := v_1
3306 flag := v_2
3307 v.reset(OpARM64CSINC)
3308 v.AuxInt = opToAuxInt(arm64Negate(cc))
3309 v.AddArg3(x, a, flag)
3310 return true
3311 }
3312
3313
3314 for {
3315 cc := auxIntToOp(v.AuxInt)
3316 x := v_0
3317 if v_1.Op != OpARM64MVN {
3318 break
3319 }
3320 a := v_1.Args[0]
3321 flag := v_2
3322 v.reset(OpARM64CSINV)
3323 v.AuxInt = opToAuxInt(cc)
3324 v.AddArg3(x, a, flag)
3325 return true
3326 }
3327
3328
3329 for {
3330 cc := auxIntToOp(v.AuxInt)
3331 if v_0.Op != OpARM64MVN {
3332 break
3333 }
3334 a := v_0.Args[0]
3335 x := v_1
3336 flag := v_2
3337 v.reset(OpARM64CSINV)
3338 v.AuxInt = opToAuxInt(arm64Negate(cc))
3339 v.AddArg3(x, a, flag)
3340 return true
3341 }
3342
3343
3344 for {
3345 cc := auxIntToOp(v.AuxInt)
3346 x := v_0
3347 if v_1.Op != OpARM64NEG {
3348 break
3349 }
3350 a := v_1.Args[0]
3351 flag := v_2
3352 v.reset(OpARM64CSNEG)
3353 v.AuxInt = opToAuxInt(cc)
3354 v.AddArg3(x, a, flag)
3355 return true
3356 }
3357
3358
3359 for {
3360 cc := auxIntToOp(v.AuxInt)
3361 if v_0.Op != OpARM64NEG {
3362 break
3363 }
3364 a := v_0.Args[0]
3365 x := v_1
3366 flag := v_2
3367 v.reset(OpARM64CSNEG)
3368 v.AuxInt = opToAuxInt(arm64Negate(cc))
3369 v.AddArg3(x, a, flag)
3370 return true
3371 }
3372
3373
3374 for {
3375 cc := auxIntToOp(v.AuxInt)
3376 x := v_0
3377 y := v_1
3378 if v_2.Op != OpARM64InvertFlags {
3379 break
3380 }
3381 cmp := v_2.Args[0]
3382 v.reset(OpARM64CSEL)
3383 v.AuxInt = opToAuxInt(arm64Invert(cc))
3384 v.AddArg3(x, y, cmp)
3385 return true
3386 }
3387
3388
3389
3390 for {
3391 cc := auxIntToOp(v.AuxInt)
3392 x := v_0
3393 flag := v_2
3394 if !(ccARM64Eval(cc, flag) > 0) {
3395 break
3396 }
3397 v.copyOf(x)
3398 return true
3399 }
3400
3401
3402
3403 for {
3404 cc := auxIntToOp(v.AuxInt)
3405 y := v_1
3406 flag := v_2
3407 if !(ccARM64Eval(cc, flag) < 0) {
3408 break
3409 }
3410 v.copyOf(y)
3411 return true
3412 }
3413
3414
3415
3416 for {
3417 cc := auxIntToOp(v.AuxInt)
3418 x := v_0
3419 y := v_1
3420 if v_2.Op != OpARM64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
3421 break
3422 }
3423 boolval := v_2.Args[0]
3424 if !(cc == OpARM64NotEqual && flagArg(boolval) != nil) {
3425 break
3426 }
3427 v.reset(OpARM64CSEL)
3428 v.AuxInt = opToAuxInt(boolval.Op)
3429 v.AddArg3(x, y, flagArg(boolval))
3430 return true
3431 }
3432
3433
3434
3435 for {
3436 cc := auxIntToOp(v.AuxInt)
3437 x := v_0
3438 y := v_1
3439 if v_2.Op != OpARM64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
3440 break
3441 }
3442 boolval := v_2.Args[0]
3443 if !(cc == OpARM64Equal && flagArg(boolval) != nil) {
3444 break
3445 }
3446 v.reset(OpARM64CSEL)
3447 v.AuxInt = opToAuxInt(arm64Negate(boolval.Op))
3448 v.AddArg3(x, y, flagArg(boolval))
3449 return true
3450 }
3451 return false
3452 }
3453 func rewriteValueARM64_OpARM64CSEL0(v *Value) bool {
3454 v_1 := v.Args[1]
3455 v_0 := v.Args[0]
3456
3457
3458 for {
3459 cc := auxIntToOp(v.AuxInt)
3460 x := v_0
3461 if v_1.Op != OpARM64InvertFlags {
3462 break
3463 }
3464 cmp := v_1.Args[0]
3465 v.reset(OpARM64CSEL0)
3466 v.AuxInt = opToAuxInt(arm64Invert(cc))
3467 v.AddArg2(x, cmp)
3468 return true
3469 }
3470
3471
3472
3473 for {
3474 cc := auxIntToOp(v.AuxInt)
3475 x := v_0
3476 flag := v_1
3477 if !(ccARM64Eval(cc, flag) > 0) {
3478 break
3479 }
3480 v.copyOf(x)
3481 return true
3482 }
3483
3484
3485
3486 for {
3487 cc := auxIntToOp(v.AuxInt)
3488 flag := v_1
3489 if !(ccARM64Eval(cc, flag) < 0) {
3490 break
3491 }
3492 v.reset(OpARM64MOVDconst)
3493 v.AuxInt = int64ToAuxInt(0)
3494 return true
3495 }
3496
3497
3498
3499 for {
3500 cc := auxIntToOp(v.AuxInt)
3501 x := v_0
3502 if v_1.Op != OpARM64CMPWconst || auxIntToInt32(v_1.AuxInt) != 0 {
3503 break
3504 }
3505 boolval := v_1.Args[0]
3506 if !(cc == OpARM64NotEqual && flagArg(boolval) != nil) {
3507 break
3508 }
3509 v.reset(OpARM64CSEL0)
3510 v.AuxInt = opToAuxInt(boolval.Op)
3511 v.AddArg2(x, flagArg(boolval))
3512 return true
3513 }
3514
3515
3516
3517 for {
3518 cc := auxIntToOp(v.AuxInt)
3519 x := v_0
3520 if v_1.Op != OpARM64CMPWconst || auxIntToInt32(v_1.AuxInt) != 0 {
3521 break
3522 }
3523 boolval := v_1.Args[0]
3524 if !(cc == OpARM64Equal && flagArg(boolval) != nil) {
3525 break
3526 }
3527 v.reset(OpARM64CSEL0)
3528 v.AuxInt = opToAuxInt(arm64Negate(boolval.Op))
3529 v.AddArg2(x, flagArg(boolval))
3530 return true
3531 }
3532 return false
3533 }
3534 func rewriteValueARM64_OpARM64CSETM(v *Value) bool {
3535 v_0 := v.Args[0]
3536
3537
3538 for {
3539 cc := auxIntToOp(v.AuxInt)
3540 if v_0.Op != OpARM64InvertFlags {
3541 break
3542 }
3543 cmp := v_0.Args[0]
3544 v.reset(OpARM64CSETM)
3545 v.AuxInt = opToAuxInt(arm64Invert(cc))
3546 v.AddArg(cmp)
3547 return true
3548 }
3549
3550
3551
3552 for {
3553 cc := auxIntToOp(v.AuxInt)
3554 flag := v_0
3555 if !(ccARM64Eval(cc, flag) > 0) {
3556 break
3557 }
3558 v.reset(OpARM64MOVDconst)
3559 v.AuxInt = int64ToAuxInt(-1)
3560 return true
3561 }
3562
3563
3564
3565 for {
3566 cc := auxIntToOp(v.AuxInt)
3567 flag := v_0
3568 if !(ccARM64Eval(cc, flag) < 0) {
3569 break
3570 }
3571 v.reset(OpARM64MOVDconst)
3572 v.AuxInt = int64ToAuxInt(0)
3573 return true
3574 }
3575 return false
3576 }
3577 func rewriteValueARM64_OpARM64CSINC(v *Value) bool {
3578 v_2 := v.Args[2]
3579 v_1 := v.Args[1]
3580 v_0 := v.Args[0]
3581
3582
3583 for {
3584 cc := auxIntToOp(v.AuxInt)
3585 x := v_0
3586 y := v_1
3587 if v_2.Op != OpARM64InvertFlags {
3588 break
3589 }
3590 cmp := v_2.Args[0]
3591 v.reset(OpARM64CSINC)
3592 v.AuxInt = opToAuxInt(arm64Invert(cc))
3593 v.AddArg3(x, y, cmp)
3594 return true
3595 }
3596
3597
3598
3599 for {
3600 cc := auxIntToOp(v.AuxInt)
3601 x := v_0
3602 flag := v_2
3603 if !(ccARM64Eval(cc, flag) > 0) {
3604 break
3605 }
3606 v.copyOf(x)
3607 return true
3608 }
3609
3610
3611
3612 for {
3613 cc := auxIntToOp(v.AuxInt)
3614 y := v_1
3615 flag := v_2
3616 if !(ccARM64Eval(cc, flag) < 0) {
3617 break
3618 }
3619 v.reset(OpARM64ADDconst)
3620 v.AuxInt = int64ToAuxInt(1)
3621 v.AddArg(y)
3622 return true
3623 }
3624 return false
3625 }
3626 func rewriteValueARM64_OpARM64CSINV(v *Value) bool {
3627 v_2 := v.Args[2]
3628 v_1 := v.Args[1]
3629 v_0 := v.Args[0]
3630
3631
3632 for {
3633 cc := auxIntToOp(v.AuxInt)
3634 x := v_0
3635 y := v_1
3636 if v_2.Op != OpARM64InvertFlags {
3637 break
3638 }
3639 cmp := v_2.Args[0]
3640 v.reset(OpARM64CSINV)
3641 v.AuxInt = opToAuxInt(arm64Invert(cc))
3642 v.AddArg3(x, y, cmp)
3643 return true
3644 }
3645
3646
3647
3648 for {
3649 cc := auxIntToOp(v.AuxInt)
3650 x := v_0
3651 flag := v_2
3652 if !(ccARM64Eval(cc, flag) > 0) {
3653 break
3654 }
3655 v.copyOf(x)
3656 return true
3657 }
3658
3659
3660
3661 for {
3662 cc := auxIntToOp(v.AuxInt)
3663 y := v_1
3664 flag := v_2
3665 if !(ccARM64Eval(cc, flag) < 0) {
3666 break
3667 }
3668 v.reset(OpNot)
3669 v.AddArg(y)
3670 return true
3671 }
3672 return false
3673 }
3674 func rewriteValueARM64_OpARM64CSNEG(v *Value) bool {
3675 v_2 := v.Args[2]
3676 v_1 := v.Args[1]
3677 v_0 := v.Args[0]
3678
3679
3680 for {
3681 cc := auxIntToOp(v.AuxInt)
3682 x := v_0
3683 y := v_1
3684 if v_2.Op != OpARM64InvertFlags {
3685 break
3686 }
3687 cmp := v_2.Args[0]
3688 v.reset(OpARM64CSNEG)
3689 v.AuxInt = opToAuxInt(arm64Invert(cc))
3690 v.AddArg3(x, y, cmp)
3691 return true
3692 }
3693
3694
3695
3696 for {
3697 cc := auxIntToOp(v.AuxInt)
3698 x := v_0
3699 flag := v_2
3700 if !(ccARM64Eval(cc, flag) > 0) {
3701 break
3702 }
3703 v.copyOf(x)
3704 return true
3705 }
3706
3707
3708
3709 for {
3710 cc := auxIntToOp(v.AuxInt)
3711 y := v_1
3712 flag := v_2
3713 if !(ccARM64Eval(cc, flag) < 0) {
3714 break
3715 }
3716 v.reset(OpARM64NEG)
3717 v.AddArg(y)
3718 return true
3719 }
3720 return false
3721 }
3722 func rewriteValueARM64_OpARM64DIV(v *Value) bool {
3723 v_1 := v.Args[1]
3724 v_0 := v.Args[0]
3725
3726
3727
3728 for {
3729 if v_0.Op != OpARM64MOVDconst {
3730 break
3731 }
3732 c := auxIntToInt64(v_0.AuxInt)
3733 if v_1.Op != OpARM64MOVDconst {
3734 break
3735 }
3736 d := auxIntToInt64(v_1.AuxInt)
3737 if !(d != 0) {
3738 break
3739 }
3740 v.reset(OpARM64MOVDconst)
3741 v.AuxInt = int64ToAuxInt(c / d)
3742 return true
3743 }
3744 return false
3745 }
3746 func rewriteValueARM64_OpARM64DIVW(v *Value) bool {
3747 v_1 := v.Args[1]
3748 v_0 := v.Args[0]
3749
3750
3751
3752 for {
3753 if v_0.Op != OpARM64MOVDconst {
3754 break
3755 }
3756 c := auxIntToInt64(v_0.AuxInt)
3757 if v_1.Op != OpARM64MOVDconst {
3758 break
3759 }
3760 d := auxIntToInt64(v_1.AuxInt)
3761 if !(d != 0) {
3762 break
3763 }
3764 v.reset(OpARM64MOVDconst)
3765 v.AuxInt = int64ToAuxInt(int64(uint32(int32(c) / int32(d))))
3766 return true
3767 }
3768 return false
3769 }
3770 func rewriteValueARM64_OpARM64EON(v *Value) bool {
3771 v_1 := v.Args[1]
3772 v_0 := v.Args[0]
3773
3774
3775 for {
3776 x := v_0
3777 if v_1.Op != OpARM64MOVDconst {
3778 break
3779 }
3780 c := auxIntToInt64(v_1.AuxInt)
3781 v.reset(OpARM64XORconst)
3782 v.AuxInt = int64ToAuxInt(^c)
3783 v.AddArg(x)
3784 return true
3785 }
3786
3787
3788 for {
3789 x := v_0
3790 if x != v_1 {
3791 break
3792 }
3793 v.reset(OpARM64MOVDconst)
3794 v.AuxInt = int64ToAuxInt(-1)
3795 return true
3796 }
3797
3798
3799
3800 for {
3801 x0 := v_0
3802 x1 := v_1
3803 if x1.Op != OpARM64SLLconst {
3804 break
3805 }
3806 c := auxIntToInt64(x1.AuxInt)
3807 y := x1.Args[0]
3808 if !(clobberIfDead(x1)) {
3809 break
3810 }
3811 v.reset(OpARM64EONshiftLL)
3812 v.AuxInt = int64ToAuxInt(c)
3813 v.AddArg2(x0, y)
3814 return true
3815 }
3816
3817
3818
3819 for {
3820 x0 := v_0
3821 x1 := v_1
3822 if x1.Op != OpARM64SRLconst {
3823 break
3824 }
3825 c := auxIntToInt64(x1.AuxInt)
3826 y := x1.Args[0]
3827 if !(clobberIfDead(x1)) {
3828 break
3829 }
3830 v.reset(OpARM64EONshiftRL)
3831 v.AuxInt = int64ToAuxInt(c)
3832 v.AddArg2(x0, y)
3833 return true
3834 }
3835
3836
3837
3838 for {
3839 x0 := v_0
3840 x1 := v_1
3841 if x1.Op != OpARM64SRAconst {
3842 break
3843 }
3844 c := auxIntToInt64(x1.AuxInt)
3845 y := x1.Args[0]
3846 if !(clobberIfDead(x1)) {
3847 break
3848 }
3849 v.reset(OpARM64EONshiftRA)
3850 v.AuxInt = int64ToAuxInt(c)
3851 v.AddArg2(x0, y)
3852 return true
3853 }
3854
3855
3856
3857 for {
3858 x0 := v_0
3859 x1 := v_1
3860 if x1.Op != OpARM64RORconst {
3861 break
3862 }
3863 c := auxIntToInt64(x1.AuxInt)
3864 y := x1.Args[0]
3865 if !(clobberIfDead(x1)) {
3866 break
3867 }
3868 v.reset(OpARM64EONshiftRO)
3869 v.AuxInt = int64ToAuxInt(c)
3870 v.AddArg2(x0, y)
3871 return true
3872 }
3873 return false
3874 }
3875 func rewriteValueARM64_OpARM64EONshiftLL(v *Value) bool {
3876 v_1 := v.Args[1]
3877 v_0 := v.Args[0]
3878
3879
3880 for {
3881 d := auxIntToInt64(v.AuxInt)
3882 x := v_0
3883 if v_1.Op != OpARM64MOVDconst {
3884 break
3885 }
3886 c := auxIntToInt64(v_1.AuxInt)
3887 v.reset(OpARM64XORconst)
3888 v.AuxInt = int64ToAuxInt(^int64(uint64(c) << uint64(d)))
3889 v.AddArg(x)
3890 return true
3891 }
3892
3893
3894 for {
3895 c := auxIntToInt64(v.AuxInt)
3896 if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
3897 break
3898 }
3899 x := v_0.Args[0]
3900 if x != v_1 {
3901 break
3902 }
3903 v.reset(OpARM64MOVDconst)
3904 v.AuxInt = int64ToAuxInt(-1)
3905 return true
3906 }
3907 return false
3908 }
3909 func rewriteValueARM64_OpARM64EONshiftRA(v *Value) bool {
3910 v_1 := v.Args[1]
3911 v_0 := v.Args[0]
3912
3913
3914 for {
3915 d := auxIntToInt64(v.AuxInt)
3916 x := v_0
3917 if v_1.Op != OpARM64MOVDconst {
3918 break
3919 }
3920 c := auxIntToInt64(v_1.AuxInt)
3921 v.reset(OpARM64XORconst)
3922 v.AuxInt = int64ToAuxInt(^(c >> uint64(d)))
3923 v.AddArg(x)
3924 return true
3925 }
3926
3927
3928 for {
3929 c := auxIntToInt64(v.AuxInt)
3930 if v_0.Op != OpARM64SRAconst || auxIntToInt64(v_0.AuxInt) != c {
3931 break
3932 }
3933 x := v_0.Args[0]
3934 if x != v_1 {
3935 break
3936 }
3937 v.reset(OpARM64MOVDconst)
3938 v.AuxInt = int64ToAuxInt(-1)
3939 return true
3940 }
3941 return false
3942 }
3943 func rewriteValueARM64_OpARM64EONshiftRL(v *Value) bool {
3944 v_1 := v.Args[1]
3945 v_0 := v.Args[0]
3946
3947
3948 for {
3949 d := auxIntToInt64(v.AuxInt)
3950 x := v_0
3951 if v_1.Op != OpARM64MOVDconst {
3952 break
3953 }
3954 c := auxIntToInt64(v_1.AuxInt)
3955 v.reset(OpARM64XORconst)
3956 v.AuxInt = int64ToAuxInt(^int64(uint64(c) >> uint64(d)))
3957 v.AddArg(x)
3958 return true
3959 }
3960
3961
3962 for {
3963 c := auxIntToInt64(v.AuxInt)
3964 if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
3965 break
3966 }
3967 x := v_0.Args[0]
3968 if x != v_1 {
3969 break
3970 }
3971 v.reset(OpARM64MOVDconst)
3972 v.AuxInt = int64ToAuxInt(-1)
3973 return true
3974 }
3975 return false
3976 }
3977 func rewriteValueARM64_OpARM64EONshiftRO(v *Value) bool {
3978 v_1 := v.Args[1]
3979 v_0 := v.Args[0]
3980
3981
3982 for {
3983 d := auxIntToInt64(v.AuxInt)
3984 x := v_0
3985 if v_1.Op != OpARM64MOVDconst {
3986 break
3987 }
3988 c := auxIntToInt64(v_1.AuxInt)
3989 v.reset(OpARM64XORconst)
3990 v.AuxInt = int64ToAuxInt(^rotateRight64(c, d))
3991 v.AddArg(x)
3992 return true
3993 }
3994
3995
3996 for {
3997 c := auxIntToInt64(v.AuxInt)
3998 if v_0.Op != OpARM64RORconst || auxIntToInt64(v_0.AuxInt) != c {
3999 break
4000 }
4001 x := v_0.Args[0]
4002 if x != v_1 {
4003 break
4004 }
4005 v.reset(OpARM64MOVDconst)
4006 v.AuxInt = int64ToAuxInt(-1)
4007 return true
4008 }
4009 return false
4010 }
4011 func rewriteValueARM64_OpARM64Equal(v *Value) bool {
4012 v_0 := v.Args[0]
4013 b := v.Block
4014
4015
4016
4017 for {
4018 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
4019 break
4020 }
4021 z := v_0.Args[0]
4022 if z.Op != OpARM64AND {
4023 break
4024 }
4025 y := z.Args[1]
4026 x := z.Args[0]
4027 if !(z.Uses == 1) {
4028 break
4029 }
4030 v.reset(OpARM64Equal)
4031 v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
4032 v0.AddArg2(x, y)
4033 v.AddArg(v0)
4034 return true
4035 }
4036
4037
4038
4039 for {
4040 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
4041 break
4042 }
4043 x := v_0.Args[0]
4044 if x.Op != OpARM64ANDconst {
4045 break
4046 }
4047 c := auxIntToInt64(x.AuxInt)
4048 y := x.Args[0]
4049 if !(x.Uses == 1) {
4050 break
4051 }
4052 v.reset(OpARM64Equal)
4053 v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
4054 v0.AuxInt = int32ToAuxInt(int32(c))
4055 v0.AddArg(y)
4056 v.AddArg(v0)
4057 return true
4058 }
4059
4060
4061
4062 for {
4063 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
4064 break
4065 }
4066 z := v_0.Args[0]
4067 if z.Op != OpARM64AND {
4068 break
4069 }
4070 y := z.Args[1]
4071 x := z.Args[0]
4072 if !(z.Uses == 1) {
4073 break
4074 }
4075 v.reset(OpARM64Equal)
4076 v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
4077 v0.AddArg2(x, y)
4078 v.AddArg(v0)
4079 return true
4080 }
4081
4082
4083
4084 for {
4085 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
4086 break
4087 }
4088 x := v_0.Args[0]
4089 if x.Op != OpARM64ANDconst {
4090 break
4091 }
4092 c := auxIntToInt64(x.AuxInt)
4093 y := x.Args[0]
4094 if !(x.Uses == 1) {
4095 break
4096 }
4097 v.reset(OpARM64Equal)
4098 v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
4099 v0.AuxInt = int64ToAuxInt(c)
4100 v0.AddArg(y)
4101 v.AddArg(v0)
4102 return true
4103 }
4104
4105
4106
4107 for {
4108 if v_0.Op != OpARM64CMP {
4109 break
4110 }
4111 _ = v_0.Args[1]
4112 x := v_0.Args[0]
4113 z := v_0.Args[1]
4114 if z.Op != OpARM64NEG {
4115 break
4116 }
4117 y := z.Args[0]
4118 if !(z.Uses == 1) {
4119 break
4120 }
4121 v.reset(OpARM64Equal)
4122 v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
4123 v0.AddArg2(x, y)
4124 v.AddArg(v0)
4125 return true
4126 }
4127
4128
4129
4130 for {
4131 if v_0.Op != OpARM64CMPW {
4132 break
4133 }
4134 _ = v_0.Args[1]
4135 x := v_0.Args[0]
4136 z := v_0.Args[1]
4137 if z.Op != OpARM64NEG {
4138 break
4139 }
4140 y := z.Args[0]
4141 if !(z.Uses == 1) {
4142 break
4143 }
4144 v.reset(OpARM64Equal)
4145 v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
4146 v0.AddArg2(x, y)
4147 v.AddArg(v0)
4148 return true
4149 }
4150
4151
4152
4153 for {
4154 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
4155 break
4156 }
4157 x := v_0.Args[0]
4158 if x.Op != OpARM64ADDconst {
4159 break
4160 }
4161 c := auxIntToInt64(x.AuxInt)
4162 y := x.Args[0]
4163 if !(x.Uses == 1) {
4164 break
4165 }
4166 v.reset(OpARM64Equal)
4167 v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
4168 v0.AuxInt = int64ToAuxInt(c)
4169 v0.AddArg(y)
4170 v.AddArg(v0)
4171 return true
4172 }
4173
4174
4175
4176 for {
4177 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
4178 break
4179 }
4180 x := v_0.Args[0]
4181 if x.Op != OpARM64ADDconst {
4182 break
4183 }
4184 c := auxIntToInt64(x.AuxInt)
4185 y := x.Args[0]
4186 if !(x.Uses == 1) {
4187 break
4188 }
4189 v.reset(OpARM64Equal)
4190 v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
4191 v0.AuxInt = int32ToAuxInt(int32(c))
4192 v0.AddArg(y)
4193 v.AddArg(v0)
4194 return true
4195 }
4196
4197
4198
4199 for {
4200 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
4201 break
4202 }
4203 z := v_0.Args[0]
4204 if z.Op != OpARM64ADD {
4205 break
4206 }
4207 y := z.Args[1]
4208 x := z.Args[0]
4209 if !(z.Uses == 1) {
4210 break
4211 }
4212 v.reset(OpARM64Equal)
4213 v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
4214 v0.AddArg2(x, y)
4215 v.AddArg(v0)
4216 return true
4217 }
4218
4219
4220
4221 for {
4222 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
4223 break
4224 }
4225 z := v_0.Args[0]
4226 if z.Op != OpARM64ADD {
4227 break
4228 }
4229 y := z.Args[1]
4230 x := z.Args[0]
4231 if !(z.Uses == 1) {
4232 break
4233 }
4234 v.reset(OpARM64Equal)
4235 v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
4236 v0.AddArg2(x, y)
4237 v.AddArg(v0)
4238 return true
4239 }
4240
4241
4242
4243 for {
4244 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
4245 break
4246 }
4247 z := v_0.Args[0]
4248 if z.Op != OpARM64MADD {
4249 break
4250 }
4251 y := z.Args[2]
4252 a := z.Args[0]
4253 x := z.Args[1]
4254 if !(z.Uses == 1) {
4255 break
4256 }
4257 v.reset(OpARM64Equal)
4258 v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
4259 v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
4260 v1.AddArg2(x, y)
4261 v0.AddArg2(a, v1)
4262 v.AddArg(v0)
4263 return true
4264 }
4265
4266
4267
4268 for {
4269 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
4270 break
4271 }
4272 z := v_0.Args[0]
4273 if z.Op != OpARM64MSUB {
4274 break
4275 }
4276 y := z.Args[2]
4277 a := z.Args[0]
4278 x := z.Args[1]
4279 if !(z.Uses == 1) {
4280 break
4281 }
4282 v.reset(OpARM64Equal)
4283 v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
4284 v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
4285 v1.AddArg2(x, y)
4286 v0.AddArg2(a, v1)
4287 v.AddArg(v0)
4288 return true
4289 }
4290
4291
4292
4293 for {
4294 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
4295 break
4296 }
4297 z := v_0.Args[0]
4298 if z.Op != OpARM64MADDW {
4299 break
4300 }
4301 y := z.Args[2]
4302 a := z.Args[0]
4303 x := z.Args[1]
4304 if !(z.Uses == 1) {
4305 break
4306 }
4307 v.reset(OpARM64Equal)
4308 v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
4309 v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
4310 v1.AddArg2(x, y)
4311 v0.AddArg2(a, v1)
4312 v.AddArg(v0)
4313 return true
4314 }
4315
4316
4317
4318 for {
4319 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
4320 break
4321 }
4322 z := v_0.Args[0]
4323 if z.Op != OpARM64MSUBW {
4324 break
4325 }
4326 y := z.Args[2]
4327 a := z.Args[0]
4328 x := z.Args[1]
4329 if !(z.Uses == 1) {
4330 break
4331 }
4332 v.reset(OpARM64Equal)
4333 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
4334 v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
4335 v1.AddArg2(x, y)
4336 v0.AddArg2(a, v1)
4337 v.AddArg(v0)
4338 return true
4339 }
4340
4341
4342 for {
4343 if v_0.Op != OpARM64FlagConstant {
4344 break
4345 }
4346 fc := auxIntToFlagConstant(v_0.AuxInt)
4347 v.reset(OpARM64MOVDconst)
4348 v.AuxInt = int64ToAuxInt(b2i(fc.eq()))
4349 return true
4350 }
4351
4352
4353 for {
4354 if v_0.Op != OpARM64InvertFlags {
4355 break
4356 }
4357 x := v_0.Args[0]
4358 v.reset(OpARM64Equal)
4359 v.AddArg(x)
4360 return true
4361 }
4362 return false
4363 }
4364 func rewriteValueARM64_OpARM64FADDD(v *Value) bool {
4365 v_1 := v.Args[1]
4366 v_0 := v.Args[0]
4367
4368
4369
4370 for {
4371 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4372 a := v_0
4373 if v_1.Op != OpARM64FMULD {
4374 continue
4375 }
4376 y := v_1.Args[1]
4377 x := v_1.Args[0]
4378 if !(a.Block.Func.useFMA(v)) {
4379 continue
4380 }
4381 v.reset(OpARM64FMADDD)
4382 v.AddArg3(a, x, y)
4383 return true
4384 }
4385 break
4386 }
4387
4388
4389
4390 for {
4391 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4392 a := v_0
4393 if v_1.Op != OpARM64FNMULD {
4394 continue
4395 }
4396 y := v_1.Args[1]
4397 x := v_1.Args[0]
4398 if !(a.Block.Func.useFMA(v)) {
4399 continue
4400 }
4401 v.reset(OpARM64FMSUBD)
4402 v.AddArg3(a, x, y)
4403 return true
4404 }
4405 break
4406 }
4407 return false
4408 }
4409 func rewriteValueARM64_OpARM64FADDS(v *Value) bool {
4410 v_1 := v.Args[1]
4411 v_0 := v.Args[0]
4412
4413
4414
4415 for {
4416 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4417 a := v_0
4418 if v_1.Op != OpARM64FMULS {
4419 continue
4420 }
4421 y := v_1.Args[1]
4422 x := v_1.Args[0]
4423 if !(a.Block.Func.useFMA(v)) {
4424 continue
4425 }
4426 v.reset(OpARM64FMADDS)
4427 v.AddArg3(a, x, y)
4428 return true
4429 }
4430 break
4431 }
4432
4433
4434
4435 for {
4436 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4437 a := v_0
4438 if v_1.Op != OpARM64FNMULS {
4439 continue
4440 }
4441 y := v_1.Args[1]
4442 x := v_1.Args[0]
4443 if !(a.Block.Func.useFMA(v)) {
4444 continue
4445 }
4446 v.reset(OpARM64FMSUBS)
4447 v.AddArg3(a, x, y)
4448 return true
4449 }
4450 break
4451 }
4452 return false
4453 }
4454 func rewriteValueARM64_OpARM64FCMPD(v *Value) bool {
4455 v_1 := v.Args[1]
4456 v_0 := v.Args[0]
4457 b := v.Block
4458
4459
4460 for {
4461 x := v_0
4462 if v_1.Op != OpARM64FMOVDconst || auxIntToFloat64(v_1.AuxInt) != 0 {
4463 break
4464 }
4465 v.reset(OpARM64FCMPD0)
4466 v.AddArg(x)
4467 return true
4468 }
4469
4470
4471 for {
4472 if v_0.Op != OpARM64FMOVDconst || auxIntToFloat64(v_0.AuxInt) != 0 {
4473 break
4474 }
4475 x := v_1
4476 v.reset(OpARM64InvertFlags)
4477 v0 := b.NewValue0(v.Pos, OpARM64FCMPD0, types.TypeFlags)
4478 v0.AddArg(x)
4479 v.AddArg(v0)
4480 return true
4481 }
4482 return false
4483 }
4484 func rewriteValueARM64_OpARM64FCMPS(v *Value) bool {
4485 v_1 := v.Args[1]
4486 v_0 := v.Args[0]
4487 b := v.Block
4488
4489
4490 for {
4491 x := v_0
4492 if v_1.Op != OpARM64FMOVSconst || auxIntToFloat64(v_1.AuxInt) != 0 {
4493 break
4494 }
4495 v.reset(OpARM64FCMPS0)
4496 v.AddArg(x)
4497 return true
4498 }
4499
4500
4501 for {
4502 if v_0.Op != OpARM64FMOVSconst || auxIntToFloat64(v_0.AuxInt) != 0 {
4503 break
4504 }
4505 x := v_1
4506 v.reset(OpARM64InvertFlags)
4507 v0 := b.NewValue0(v.Pos, OpARM64FCMPS0, types.TypeFlags)
4508 v0.AddArg(x)
4509 v.AddArg(v0)
4510 return true
4511 }
4512 return false
4513 }
4514 func rewriteValueARM64_OpARM64FMOVDfpgp(v *Value) bool {
4515 v_0 := v.Args[0]
4516 b := v.Block
4517
4518
4519 for {
4520 t := v.Type
4521 if v_0.Op != OpArg {
4522 break
4523 }
4524 off := auxIntToInt32(v_0.AuxInt)
4525 sym := auxToSym(v_0.Aux)
4526 b = b.Func.Entry
4527 v0 := b.NewValue0(v.Pos, OpArg, t)
4528 v.copyOf(v0)
4529 v0.AuxInt = int32ToAuxInt(off)
4530 v0.Aux = symToAux(sym)
4531 return true
4532 }
4533 return false
4534 }
4535 func rewriteValueARM64_OpARM64FMOVDgpfp(v *Value) bool {
4536 v_0 := v.Args[0]
4537 b := v.Block
4538
4539
4540 for {
4541 t := v.Type
4542 if v_0.Op != OpArg {
4543 break
4544 }
4545 off := auxIntToInt32(v_0.AuxInt)
4546 sym := auxToSym(v_0.Aux)
4547 b = b.Func.Entry
4548 v0 := b.NewValue0(v.Pos, OpArg, t)
4549 v.copyOf(v0)
4550 v0.AuxInt = int32ToAuxInt(off)
4551 v0.Aux = symToAux(sym)
4552 return true
4553 }
4554 return false
4555 }
4556 func rewriteValueARM64_OpARM64FMOVDload(v *Value) bool {
4557 v_1 := v.Args[1]
4558 v_0 := v.Args[0]
4559 b := v.Block
4560 config := b.Func.Config
4561
4562
4563 for {
4564 off := auxIntToInt32(v.AuxInt)
4565 sym := auxToSym(v.Aux)
4566 ptr := v_0
4567 if v_1.Op != OpARM64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
4568 break
4569 }
4570 val := v_1.Args[1]
4571 if ptr != v_1.Args[0] {
4572 break
4573 }
4574 v.reset(OpARM64FMOVDgpfp)
4575 v.AddArg(val)
4576 return true
4577 }
4578
4579
4580
4581 for {
4582 off1 := auxIntToInt32(v.AuxInt)
4583 sym := auxToSym(v.Aux)
4584 if v_0.Op != OpARM64ADDconst {
4585 break
4586 }
4587 off2 := auxIntToInt64(v_0.AuxInt)
4588 ptr := v_0.Args[0]
4589 mem := v_1
4590 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
4591 break
4592 }
4593 v.reset(OpARM64FMOVDload)
4594 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
4595 v.Aux = symToAux(sym)
4596 v.AddArg2(ptr, mem)
4597 return true
4598 }
4599
4600
4601
4602 for {
4603 off := auxIntToInt32(v.AuxInt)
4604 sym := auxToSym(v.Aux)
4605 if v_0.Op != OpARM64ADD {
4606 break
4607 }
4608 idx := v_0.Args[1]
4609 ptr := v_0.Args[0]
4610 mem := v_1
4611 if !(off == 0 && sym == nil) {
4612 break
4613 }
4614 v.reset(OpARM64FMOVDloadidx)
4615 v.AddArg3(ptr, idx, mem)
4616 return true
4617 }
4618
4619
4620
4621 for {
4622 off := auxIntToInt32(v.AuxInt)
4623 sym := auxToSym(v.Aux)
4624 if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 3 {
4625 break
4626 }
4627 idx := v_0.Args[1]
4628 ptr := v_0.Args[0]
4629 mem := v_1
4630 if !(off == 0 && sym == nil) {
4631 break
4632 }
4633 v.reset(OpARM64FMOVDloadidx8)
4634 v.AddArg3(ptr, idx, mem)
4635 return true
4636 }
4637
4638
4639
4640 for {
4641 off1 := auxIntToInt32(v.AuxInt)
4642 sym1 := auxToSym(v.Aux)
4643 if v_0.Op != OpARM64MOVDaddr {
4644 break
4645 }
4646 off2 := auxIntToInt32(v_0.AuxInt)
4647 sym2 := auxToSym(v_0.Aux)
4648 ptr := v_0.Args[0]
4649 mem := v_1
4650 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
4651 break
4652 }
4653 v.reset(OpARM64FMOVDload)
4654 v.AuxInt = int32ToAuxInt(off1 + off2)
4655 v.Aux = symToAux(mergeSym(sym1, sym2))
4656 v.AddArg2(ptr, mem)
4657 return true
4658 }
4659 return false
4660 }
4661 func rewriteValueARM64_OpARM64FMOVDloadidx(v *Value) bool {
4662 v_2 := v.Args[2]
4663 v_1 := v.Args[1]
4664 v_0 := v.Args[0]
4665
4666
4667
4668 for {
4669 ptr := v_0
4670 if v_1.Op != OpARM64MOVDconst {
4671 break
4672 }
4673 c := auxIntToInt64(v_1.AuxInt)
4674 mem := v_2
4675 if !(is32Bit(c)) {
4676 break
4677 }
4678 v.reset(OpARM64FMOVDload)
4679 v.AuxInt = int32ToAuxInt(int32(c))
4680 v.AddArg2(ptr, mem)
4681 return true
4682 }
4683
4684
4685
4686 for {
4687 if v_0.Op != OpARM64MOVDconst {
4688 break
4689 }
4690 c := auxIntToInt64(v_0.AuxInt)
4691 ptr := v_1
4692 mem := v_2
4693 if !(is32Bit(c)) {
4694 break
4695 }
4696 v.reset(OpARM64FMOVDload)
4697 v.AuxInt = int32ToAuxInt(int32(c))
4698 v.AddArg2(ptr, mem)
4699 return true
4700 }
4701
4702
4703 for {
4704 ptr := v_0
4705 if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 3 {
4706 break
4707 }
4708 idx := v_1.Args[0]
4709 mem := v_2
4710 v.reset(OpARM64FMOVDloadidx8)
4711 v.AddArg3(ptr, idx, mem)
4712 return true
4713 }
4714
4715
4716 for {
4717 if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 3 {
4718 break
4719 }
4720 idx := v_0.Args[0]
4721 ptr := v_1
4722 mem := v_2
4723 v.reset(OpARM64FMOVDloadidx8)
4724 v.AddArg3(ptr, idx, mem)
4725 return true
4726 }
4727 return false
4728 }
4729 func rewriteValueARM64_OpARM64FMOVDloadidx8(v *Value) bool {
4730 v_2 := v.Args[2]
4731 v_1 := v.Args[1]
4732 v_0 := v.Args[0]
4733
4734
4735
4736 for {
4737 ptr := v_0
4738 if v_1.Op != OpARM64MOVDconst {
4739 break
4740 }
4741 c := auxIntToInt64(v_1.AuxInt)
4742 mem := v_2
4743 if !(is32Bit(c << 3)) {
4744 break
4745 }
4746 v.reset(OpARM64FMOVDload)
4747 v.AuxInt = int32ToAuxInt(int32(c) << 3)
4748 v.AddArg2(ptr, mem)
4749 return true
4750 }
4751 return false
4752 }
4753 func rewriteValueARM64_OpARM64FMOVDstore(v *Value) bool {
4754 v_2 := v.Args[2]
4755 v_1 := v.Args[1]
4756 v_0 := v.Args[0]
4757 b := v.Block
4758 config := b.Func.Config
4759
4760
4761 for {
4762 off := auxIntToInt32(v.AuxInt)
4763 sym := auxToSym(v.Aux)
4764 ptr := v_0
4765 if v_1.Op != OpARM64FMOVDgpfp {
4766 break
4767 }
4768 val := v_1.Args[0]
4769 mem := v_2
4770 v.reset(OpARM64MOVDstore)
4771 v.AuxInt = int32ToAuxInt(off)
4772 v.Aux = symToAux(sym)
4773 v.AddArg3(ptr, val, mem)
4774 return true
4775 }
4776
4777
4778
4779 for {
4780 off1 := auxIntToInt32(v.AuxInt)
4781 sym := auxToSym(v.Aux)
4782 if v_0.Op != OpARM64ADDconst {
4783 break
4784 }
4785 off2 := auxIntToInt64(v_0.AuxInt)
4786 ptr := v_0.Args[0]
4787 val := v_1
4788 mem := v_2
4789 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
4790 break
4791 }
4792 v.reset(OpARM64FMOVDstore)
4793 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
4794 v.Aux = symToAux(sym)
4795 v.AddArg3(ptr, val, mem)
4796 return true
4797 }
4798
4799
4800
4801 for {
4802 off := auxIntToInt32(v.AuxInt)
4803 sym := auxToSym(v.Aux)
4804 if v_0.Op != OpARM64ADD {
4805 break
4806 }
4807 idx := v_0.Args[1]
4808 ptr := v_0.Args[0]
4809 val := v_1
4810 mem := v_2
4811 if !(off == 0 && sym == nil) {
4812 break
4813 }
4814 v.reset(OpARM64FMOVDstoreidx)
4815 v.AddArg4(ptr, idx, val, mem)
4816 return true
4817 }
4818
4819
4820
4821 for {
4822 off := auxIntToInt32(v.AuxInt)
4823 sym := auxToSym(v.Aux)
4824 if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 3 {
4825 break
4826 }
4827 idx := v_0.Args[1]
4828 ptr := v_0.Args[0]
4829 val := v_1
4830 mem := v_2
4831 if !(off == 0 && sym == nil) {
4832 break
4833 }
4834 v.reset(OpARM64FMOVDstoreidx8)
4835 v.AddArg4(ptr, idx, val, mem)
4836 return true
4837 }
4838
4839
4840
4841 for {
4842 off1 := auxIntToInt32(v.AuxInt)
4843 sym1 := auxToSym(v.Aux)
4844 if v_0.Op != OpARM64MOVDaddr {
4845 break
4846 }
4847 off2 := auxIntToInt32(v_0.AuxInt)
4848 sym2 := auxToSym(v_0.Aux)
4849 ptr := v_0.Args[0]
4850 val := v_1
4851 mem := v_2
4852 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
4853 break
4854 }
4855 v.reset(OpARM64FMOVDstore)
4856 v.AuxInt = int32ToAuxInt(off1 + off2)
4857 v.Aux = symToAux(mergeSym(sym1, sym2))
4858 v.AddArg3(ptr, val, mem)
4859 return true
4860 }
4861 return false
4862 }
4863 func rewriteValueARM64_OpARM64FMOVDstoreidx(v *Value) bool {
4864 v_3 := v.Args[3]
4865 v_2 := v.Args[2]
4866 v_1 := v.Args[1]
4867 v_0 := v.Args[0]
4868
4869
4870
4871 for {
4872 ptr := v_0
4873 if v_1.Op != OpARM64MOVDconst {
4874 break
4875 }
4876 c := auxIntToInt64(v_1.AuxInt)
4877 val := v_2
4878 mem := v_3
4879 if !(is32Bit(c)) {
4880 break
4881 }
4882 v.reset(OpARM64FMOVDstore)
4883 v.AuxInt = int32ToAuxInt(int32(c))
4884 v.AddArg3(ptr, val, mem)
4885 return true
4886 }
4887
4888
4889
4890 for {
4891 if v_0.Op != OpARM64MOVDconst {
4892 break
4893 }
4894 c := auxIntToInt64(v_0.AuxInt)
4895 idx := v_1
4896 val := v_2
4897 mem := v_3
4898 if !(is32Bit(c)) {
4899 break
4900 }
4901 v.reset(OpARM64FMOVDstore)
4902 v.AuxInt = int32ToAuxInt(int32(c))
4903 v.AddArg3(idx, val, mem)
4904 return true
4905 }
4906
4907
4908 for {
4909 ptr := v_0
4910 if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 3 {
4911 break
4912 }
4913 idx := v_1.Args[0]
4914 val := v_2
4915 mem := v_3
4916 v.reset(OpARM64FMOVDstoreidx8)
4917 v.AddArg4(ptr, idx, val, mem)
4918 return true
4919 }
4920
4921
4922 for {
4923 if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 3 {
4924 break
4925 }
4926 idx := v_0.Args[0]
4927 ptr := v_1
4928 val := v_2
4929 mem := v_3
4930 v.reset(OpARM64FMOVDstoreidx8)
4931 v.AddArg4(ptr, idx, val, mem)
4932 return true
4933 }
4934 return false
4935 }
4936 func rewriteValueARM64_OpARM64FMOVDstoreidx8(v *Value) bool {
4937 v_3 := v.Args[3]
4938 v_2 := v.Args[2]
4939 v_1 := v.Args[1]
4940 v_0 := v.Args[0]
4941
4942
4943
4944 for {
4945 ptr := v_0
4946 if v_1.Op != OpARM64MOVDconst {
4947 break
4948 }
4949 c := auxIntToInt64(v_1.AuxInt)
4950 val := v_2
4951 mem := v_3
4952 if !(is32Bit(c << 3)) {
4953 break
4954 }
4955 v.reset(OpARM64FMOVDstore)
4956 v.AuxInt = int32ToAuxInt(int32(c) << 3)
4957 v.AddArg3(ptr, val, mem)
4958 return true
4959 }
4960 return false
4961 }
4962 func rewriteValueARM64_OpARM64FMOVSload(v *Value) bool {
4963 v_1 := v.Args[1]
4964 v_0 := v.Args[0]
4965 b := v.Block
4966 config := b.Func.Config
4967
4968
4969 for {
4970 off := auxIntToInt32(v.AuxInt)
4971 sym := auxToSym(v.Aux)
4972 ptr := v_0
4973 if v_1.Op != OpARM64MOVWstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
4974 break
4975 }
4976 val := v_1.Args[1]
4977 if ptr != v_1.Args[0] {
4978 break
4979 }
4980 v.reset(OpARM64FMOVSgpfp)
4981 v.AddArg(val)
4982 return true
4983 }
4984
4985
4986
4987 for {
4988 off1 := auxIntToInt32(v.AuxInt)
4989 sym := auxToSym(v.Aux)
4990 if v_0.Op != OpARM64ADDconst {
4991 break
4992 }
4993 off2 := auxIntToInt64(v_0.AuxInt)
4994 ptr := v_0.Args[0]
4995 mem := v_1
4996 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
4997 break
4998 }
4999 v.reset(OpARM64FMOVSload)
5000 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
5001 v.Aux = symToAux(sym)
5002 v.AddArg2(ptr, mem)
5003 return true
5004 }
5005
5006
5007
5008 for {
5009 off := auxIntToInt32(v.AuxInt)
5010 sym := auxToSym(v.Aux)
5011 if v_0.Op != OpARM64ADD {
5012 break
5013 }
5014 idx := v_0.Args[1]
5015 ptr := v_0.Args[0]
5016 mem := v_1
5017 if !(off == 0 && sym == nil) {
5018 break
5019 }
5020 v.reset(OpARM64FMOVSloadidx)
5021 v.AddArg3(ptr, idx, mem)
5022 return true
5023 }
5024
5025
5026
5027 for {
5028 off := auxIntToInt32(v.AuxInt)
5029 sym := auxToSym(v.Aux)
5030 if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
5031 break
5032 }
5033 idx := v_0.Args[1]
5034 ptr := v_0.Args[0]
5035 mem := v_1
5036 if !(off == 0 && sym == nil) {
5037 break
5038 }
5039 v.reset(OpARM64FMOVSloadidx4)
5040 v.AddArg3(ptr, idx, mem)
5041 return true
5042 }
5043
5044
5045
5046 for {
5047 off1 := auxIntToInt32(v.AuxInt)
5048 sym1 := auxToSym(v.Aux)
5049 if v_0.Op != OpARM64MOVDaddr {
5050 break
5051 }
5052 off2 := auxIntToInt32(v_0.AuxInt)
5053 sym2 := auxToSym(v_0.Aux)
5054 ptr := v_0.Args[0]
5055 mem := v_1
5056 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
5057 break
5058 }
5059 v.reset(OpARM64FMOVSload)
5060 v.AuxInt = int32ToAuxInt(off1 + off2)
5061 v.Aux = symToAux(mergeSym(sym1, sym2))
5062 v.AddArg2(ptr, mem)
5063 return true
5064 }
5065 return false
5066 }
5067 func rewriteValueARM64_OpARM64FMOVSloadidx(v *Value) bool {
5068 v_2 := v.Args[2]
5069 v_1 := v.Args[1]
5070 v_0 := v.Args[0]
5071
5072
5073
5074 for {
5075 ptr := v_0
5076 if v_1.Op != OpARM64MOVDconst {
5077 break
5078 }
5079 c := auxIntToInt64(v_1.AuxInt)
5080 mem := v_2
5081 if !(is32Bit(c)) {
5082 break
5083 }
5084 v.reset(OpARM64FMOVSload)
5085 v.AuxInt = int32ToAuxInt(int32(c))
5086 v.AddArg2(ptr, mem)
5087 return true
5088 }
5089
5090
5091
5092 for {
5093 if v_0.Op != OpARM64MOVDconst {
5094 break
5095 }
5096 c := auxIntToInt64(v_0.AuxInt)
5097 ptr := v_1
5098 mem := v_2
5099 if !(is32Bit(c)) {
5100 break
5101 }
5102 v.reset(OpARM64FMOVSload)
5103 v.AuxInt = int32ToAuxInt(int32(c))
5104 v.AddArg2(ptr, mem)
5105 return true
5106 }
5107
5108
5109 for {
5110 ptr := v_0
5111 if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
5112 break
5113 }
5114 idx := v_1.Args[0]
5115 mem := v_2
5116 v.reset(OpARM64FMOVSloadidx4)
5117 v.AddArg3(ptr, idx, mem)
5118 return true
5119 }
5120
5121
5122 for {
5123 if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
5124 break
5125 }
5126 idx := v_0.Args[0]
5127 ptr := v_1
5128 mem := v_2
5129 v.reset(OpARM64FMOVSloadidx4)
5130 v.AddArg3(ptr, idx, mem)
5131 return true
5132 }
5133 return false
5134 }
5135 func rewriteValueARM64_OpARM64FMOVSloadidx4(v *Value) bool {
5136 v_2 := v.Args[2]
5137 v_1 := v.Args[1]
5138 v_0 := v.Args[0]
5139
5140
5141
5142 for {
5143 ptr := v_0
5144 if v_1.Op != OpARM64MOVDconst {
5145 break
5146 }
5147 c := auxIntToInt64(v_1.AuxInt)
5148 mem := v_2
5149 if !(is32Bit(c << 2)) {
5150 break
5151 }
5152 v.reset(OpARM64FMOVSload)
5153 v.AuxInt = int32ToAuxInt(int32(c) << 2)
5154 v.AddArg2(ptr, mem)
5155 return true
5156 }
5157 return false
5158 }
5159 func rewriteValueARM64_OpARM64FMOVSstore(v *Value) bool {
5160 v_2 := v.Args[2]
5161 v_1 := v.Args[1]
5162 v_0 := v.Args[0]
5163 b := v.Block
5164 config := b.Func.Config
5165
5166
5167 for {
5168 off := auxIntToInt32(v.AuxInt)
5169 sym := auxToSym(v.Aux)
5170 ptr := v_0
5171 if v_1.Op != OpARM64FMOVSgpfp {
5172 break
5173 }
5174 val := v_1.Args[0]
5175 mem := v_2
5176 v.reset(OpARM64MOVWstore)
5177 v.AuxInt = int32ToAuxInt(off)
5178 v.Aux = symToAux(sym)
5179 v.AddArg3(ptr, val, mem)
5180 return true
5181 }
5182
5183
5184
5185 for {
5186 off1 := auxIntToInt32(v.AuxInt)
5187 sym := auxToSym(v.Aux)
5188 if v_0.Op != OpARM64ADDconst {
5189 break
5190 }
5191 off2 := auxIntToInt64(v_0.AuxInt)
5192 ptr := v_0.Args[0]
5193 val := v_1
5194 mem := v_2
5195 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
5196 break
5197 }
5198 v.reset(OpARM64FMOVSstore)
5199 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
5200 v.Aux = symToAux(sym)
5201 v.AddArg3(ptr, val, mem)
5202 return true
5203 }
5204
5205
5206
5207 for {
5208 off := auxIntToInt32(v.AuxInt)
5209 sym := auxToSym(v.Aux)
5210 if v_0.Op != OpARM64ADD {
5211 break
5212 }
5213 idx := v_0.Args[1]
5214 ptr := v_0.Args[0]
5215 val := v_1
5216 mem := v_2
5217 if !(off == 0 && sym == nil) {
5218 break
5219 }
5220 v.reset(OpARM64FMOVSstoreidx)
5221 v.AddArg4(ptr, idx, val, mem)
5222 return true
5223 }
5224
5225
5226
5227 for {
5228 off := auxIntToInt32(v.AuxInt)
5229 sym := auxToSym(v.Aux)
5230 if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
5231 break
5232 }
5233 idx := v_0.Args[1]
5234 ptr := v_0.Args[0]
5235 val := v_1
5236 mem := v_2
5237 if !(off == 0 && sym == nil) {
5238 break
5239 }
5240 v.reset(OpARM64FMOVSstoreidx4)
5241 v.AddArg4(ptr, idx, val, mem)
5242 return true
5243 }
5244
5245
5246
5247 for {
5248 off1 := auxIntToInt32(v.AuxInt)
5249 sym1 := auxToSym(v.Aux)
5250 if v_0.Op != OpARM64MOVDaddr {
5251 break
5252 }
5253 off2 := auxIntToInt32(v_0.AuxInt)
5254 sym2 := auxToSym(v_0.Aux)
5255 ptr := v_0.Args[0]
5256 val := v_1
5257 mem := v_2
5258 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
5259 break
5260 }
5261 v.reset(OpARM64FMOVSstore)
5262 v.AuxInt = int32ToAuxInt(off1 + off2)
5263 v.Aux = symToAux(mergeSym(sym1, sym2))
5264 v.AddArg3(ptr, val, mem)
5265 return true
5266 }
5267 return false
5268 }
5269 func rewriteValueARM64_OpARM64FMOVSstoreidx(v *Value) bool {
5270 v_3 := v.Args[3]
5271 v_2 := v.Args[2]
5272 v_1 := v.Args[1]
5273 v_0 := v.Args[0]
5274
5275
5276
5277 for {
5278 ptr := v_0
5279 if v_1.Op != OpARM64MOVDconst {
5280 break
5281 }
5282 c := auxIntToInt64(v_1.AuxInt)
5283 val := v_2
5284 mem := v_3
5285 if !(is32Bit(c)) {
5286 break
5287 }
5288 v.reset(OpARM64FMOVSstore)
5289 v.AuxInt = int32ToAuxInt(int32(c))
5290 v.AddArg3(ptr, val, mem)
5291 return true
5292 }
5293
5294
5295
5296 for {
5297 if v_0.Op != OpARM64MOVDconst {
5298 break
5299 }
5300 c := auxIntToInt64(v_0.AuxInt)
5301 idx := v_1
5302 val := v_2
5303 mem := v_3
5304 if !(is32Bit(c)) {
5305 break
5306 }
5307 v.reset(OpARM64FMOVSstore)
5308 v.AuxInt = int32ToAuxInt(int32(c))
5309 v.AddArg3(idx, val, mem)
5310 return true
5311 }
5312
5313
5314 for {
5315 ptr := v_0
5316 if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
5317 break
5318 }
5319 idx := v_1.Args[0]
5320 val := v_2
5321 mem := v_3
5322 v.reset(OpARM64FMOVSstoreidx4)
5323 v.AddArg4(ptr, idx, val, mem)
5324 return true
5325 }
5326
5327
5328 for {
5329 if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
5330 break
5331 }
5332 idx := v_0.Args[0]
5333 ptr := v_1
5334 val := v_2
5335 mem := v_3
5336 v.reset(OpARM64FMOVSstoreidx4)
5337 v.AddArg4(ptr, idx, val, mem)
5338 return true
5339 }
5340 return false
5341 }
5342 func rewriteValueARM64_OpARM64FMOVSstoreidx4(v *Value) bool {
5343 v_3 := v.Args[3]
5344 v_2 := v.Args[2]
5345 v_1 := v.Args[1]
5346 v_0 := v.Args[0]
5347
5348
5349
5350 for {
5351 ptr := v_0
5352 if v_1.Op != OpARM64MOVDconst {
5353 break
5354 }
5355 c := auxIntToInt64(v_1.AuxInt)
5356 val := v_2
5357 mem := v_3
5358 if !(is32Bit(c << 2)) {
5359 break
5360 }
5361 v.reset(OpARM64FMOVSstore)
5362 v.AuxInt = int32ToAuxInt(int32(c) << 2)
5363 v.AddArg3(ptr, val, mem)
5364 return true
5365 }
5366 return false
5367 }
5368 func rewriteValueARM64_OpARM64FMULD(v *Value) bool {
5369 v_1 := v.Args[1]
5370 v_0 := v.Args[0]
5371
5372
5373 for {
5374 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5375 if v_0.Op != OpARM64FNEGD {
5376 continue
5377 }
5378 x := v_0.Args[0]
5379 y := v_1
5380 v.reset(OpARM64FNMULD)
5381 v.AddArg2(x, y)
5382 return true
5383 }
5384 break
5385 }
5386 return false
5387 }
5388 func rewriteValueARM64_OpARM64FMULS(v *Value) bool {
5389 v_1 := v.Args[1]
5390 v_0 := v.Args[0]
5391
5392
5393 for {
5394 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5395 if v_0.Op != OpARM64FNEGS {
5396 continue
5397 }
5398 x := v_0.Args[0]
5399 y := v_1
5400 v.reset(OpARM64FNMULS)
5401 v.AddArg2(x, y)
5402 return true
5403 }
5404 break
5405 }
5406 return false
5407 }
5408 func rewriteValueARM64_OpARM64FNEGD(v *Value) bool {
5409 v_0 := v.Args[0]
5410
5411
5412 for {
5413 if v_0.Op != OpARM64FMULD {
5414 break
5415 }
5416 y := v_0.Args[1]
5417 x := v_0.Args[0]
5418 v.reset(OpARM64FNMULD)
5419 v.AddArg2(x, y)
5420 return true
5421 }
5422
5423
5424 for {
5425 if v_0.Op != OpARM64FNMULD {
5426 break
5427 }
5428 y := v_0.Args[1]
5429 x := v_0.Args[0]
5430 v.reset(OpARM64FMULD)
5431 v.AddArg2(x, y)
5432 return true
5433 }
5434 return false
5435 }
5436 func rewriteValueARM64_OpARM64FNEGS(v *Value) bool {
5437 v_0 := v.Args[0]
5438
5439
5440 for {
5441 if v_0.Op != OpARM64FMULS {
5442 break
5443 }
5444 y := v_0.Args[1]
5445 x := v_0.Args[0]
5446 v.reset(OpARM64FNMULS)
5447 v.AddArg2(x, y)
5448 return true
5449 }
5450
5451
5452 for {
5453 if v_0.Op != OpARM64FNMULS {
5454 break
5455 }
5456 y := v_0.Args[1]
5457 x := v_0.Args[0]
5458 v.reset(OpARM64FMULS)
5459 v.AddArg2(x, y)
5460 return true
5461 }
5462 return false
5463 }
5464 func rewriteValueARM64_OpARM64FNMULD(v *Value) bool {
5465 v_1 := v.Args[1]
5466 v_0 := v.Args[0]
5467
5468
5469 for {
5470 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5471 if v_0.Op != OpARM64FNEGD {
5472 continue
5473 }
5474 x := v_0.Args[0]
5475 y := v_1
5476 v.reset(OpARM64FMULD)
5477 v.AddArg2(x, y)
5478 return true
5479 }
5480 break
5481 }
5482 return false
5483 }
5484 func rewriteValueARM64_OpARM64FNMULS(v *Value) bool {
5485 v_1 := v.Args[1]
5486 v_0 := v.Args[0]
5487
5488
5489 for {
5490 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5491 if v_0.Op != OpARM64FNEGS {
5492 continue
5493 }
5494 x := v_0.Args[0]
5495 y := v_1
5496 v.reset(OpARM64FMULS)
5497 v.AddArg2(x, y)
5498 return true
5499 }
5500 break
5501 }
5502 return false
5503 }
5504 func rewriteValueARM64_OpARM64FSUBD(v *Value) bool {
5505 v_1 := v.Args[1]
5506 v_0 := v.Args[0]
5507
5508
5509
5510 for {
5511 a := v_0
5512 if v_1.Op != OpARM64FMULD {
5513 break
5514 }
5515 y := v_1.Args[1]
5516 x := v_1.Args[0]
5517 if !(a.Block.Func.useFMA(v)) {
5518 break
5519 }
5520 v.reset(OpARM64FMSUBD)
5521 v.AddArg3(a, x, y)
5522 return true
5523 }
5524
5525
5526
5527 for {
5528 if v_0.Op != OpARM64FMULD {
5529 break
5530 }
5531 y := v_0.Args[1]
5532 x := v_0.Args[0]
5533 a := v_1
5534 if !(a.Block.Func.useFMA(v)) {
5535 break
5536 }
5537 v.reset(OpARM64FNMSUBD)
5538 v.AddArg3(a, x, y)
5539 return true
5540 }
5541
5542
5543
5544 for {
5545 a := v_0
5546 if v_1.Op != OpARM64FNMULD {
5547 break
5548 }
5549 y := v_1.Args[1]
5550 x := v_1.Args[0]
5551 if !(a.Block.Func.useFMA(v)) {
5552 break
5553 }
5554 v.reset(OpARM64FMADDD)
5555 v.AddArg3(a, x, y)
5556 return true
5557 }
5558
5559
5560
5561 for {
5562 if v_0.Op != OpARM64FNMULD {
5563 break
5564 }
5565 y := v_0.Args[1]
5566 x := v_0.Args[0]
5567 a := v_1
5568 if !(a.Block.Func.useFMA(v)) {
5569 break
5570 }
5571 v.reset(OpARM64FNMADDD)
5572 v.AddArg3(a, x, y)
5573 return true
5574 }
5575 return false
5576 }
5577 func rewriteValueARM64_OpARM64FSUBS(v *Value) bool {
5578 v_1 := v.Args[1]
5579 v_0 := v.Args[0]
5580
5581
5582
5583 for {
5584 a := v_0
5585 if v_1.Op != OpARM64FMULS {
5586 break
5587 }
5588 y := v_1.Args[1]
5589 x := v_1.Args[0]
5590 if !(a.Block.Func.useFMA(v)) {
5591 break
5592 }
5593 v.reset(OpARM64FMSUBS)
5594 v.AddArg3(a, x, y)
5595 return true
5596 }
5597
5598
5599
5600 for {
5601 if v_0.Op != OpARM64FMULS {
5602 break
5603 }
5604 y := v_0.Args[1]
5605 x := v_0.Args[0]
5606 a := v_1
5607 if !(a.Block.Func.useFMA(v)) {
5608 break
5609 }
5610 v.reset(OpARM64FNMSUBS)
5611 v.AddArg3(a, x, y)
5612 return true
5613 }
5614
5615
5616
5617 for {
5618 a := v_0
5619 if v_1.Op != OpARM64FNMULS {
5620 break
5621 }
5622 y := v_1.Args[1]
5623 x := v_1.Args[0]
5624 if !(a.Block.Func.useFMA(v)) {
5625 break
5626 }
5627 v.reset(OpARM64FMADDS)
5628 v.AddArg3(a, x, y)
5629 return true
5630 }
5631
5632
5633
5634 for {
5635 if v_0.Op != OpARM64FNMULS {
5636 break
5637 }
5638 y := v_0.Args[1]
5639 x := v_0.Args[0]
5640 a := v_1
5641 if !(a.Block.Func.useFMA(v)) {
5642 break
5643 }
5644 v.reset(OpARM64FNMADDS)
5645 v.AddArg3(a, x, y)
5646 return true
5647 }
5648 return false
5649 }
5650 func rewriteValueARM64_OpARM64GreaterEqual(v *Value) bool {
5651 v_0 := v.Args[0]
5652 b := v.Block
5653
5654
5655
5656 for {
5657 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
5658 break
5659 }
5660 z := v_0.Args[0]
5661 if z.Op != OpARM64AND {
5662 break
5663 }
5664 y := z.Args[1]
5665 x := z.Args[0]
5666 if !(z.Uses == 1) {
5667 break
5668 }
5669 v.reset(OpARM64GreaterEqual)
5670 v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
5671 v0.AddArg2(x, y)
5672 v.AddArg(v0)
5673 return true
5674 }
5675
5676
5677
5678 for {
5679 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
5680 break
5681 }
5682 x := v_0.Args[0]
5683 if x.Op != OpARM64ANDconst {
5684 break
5685 }
5686 c := auxIntToInt64(x.AuxInt)
5687 y := x.Args[0]
5688 if !(x.Uses == 1) {
5689 break
5690 }
5691 v.reset(OpARM64GreaterEqual)
5692 v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
5693 v0.AuxInt = int32ToAuxInt(int32(c))
5694 v0.AddArg(y)
5695 v.AddArg(v0)
5696 return true
5697 }
5698
5699
5700
5701 for {
5702 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
5703 break
5704 }
5705 z := v_0.Args[0]
5706 if z.Op != OpARM64AND {
5707 break
5708 }
5709 y := z.Args[1]
5710 x := z.Args[0]
5711 if !(z.Uses == 1) {
5712 break
5713 }
5714 v.reset(OpARM64GreaterEqual)
5715 v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
5716 v0.AddArg2(x, y)
5717 v.AddArg(v0)
5718 return true
5719 }
5720
5721
5722
5723 for {
5724 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
5725 break
5726 }
5727 x := v_0.Args[0]
5728 if x.Op != OpARM64ANDconst {
5729 break
5730 }
5731 c := auxIntToInt64(x.AuxInt)
5732 y := x.Args[0]
5733 if !(x.Uses == 1) {
5734 break
5735 }
5736 v.reset(OpARM64GreaterEqual)
5737 v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
5738 v0.AuxInt = int64ToAuxInt(c)
5739 v0.AddArg(y)
5740 v.AddArg(v0)
5741 return true
5742 }
5743
5744
5745
5746 for {
5747 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
5748 break
5749 }
5750 x := v_0.Args[0]
5751 if x.Op != OpARM64ADDconst {
5752 break
5753 }
5754 c := auxIntToInt64(x.AuxInt)
5755 y := x.Args[0]
5756 if !(x.Uses == 1) {
5757 break
5758 }
5759 v.reset(OpARM64GreaterEqualNoov)
5760 v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
5761 v0.AuxInt = int64ToAuxInt(c)
5762 v0.AddArg(y)
5763 v.AddArg(v0)
5764 return true
5765 }
5766
5767
5768
5769 for {
5770 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
5771 break
5772 }
5773 x := v_0.Args[0]
5774 if x.Op != OpARM64ADDconst {
5775 break
5776 }
5777 c := auxIntToInt64(x.AuxInt)
5778 y := x.Args[0]
5779 if !(x.Uses == 1) {
5780 break
5781 }
5782 v.reset(OpARM64GreaterEqualNoov)
5783 v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
5784 v0.AuxInt = int32ToAuxInt(int32(c))
5785 v0.AddArg(y)
5786 v.AddArg(v0)
5787 return true
5788 }
5789
5790
5791
5792 for {
5793 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
5794 break
5795 }
5796 z := v_0.Args[0]
5797 if z.Op != OpARM64ADD {
5798 break
5799 }
5800 y := z.Args[1]
5801 x := z.Args[0]
5802 if !(z.Uses == 1) {
5803 break
5804 }
5805 v.reset(OpARM64GreaterEqualNoov)
5806 v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
5807 v0.AddArg2(x, y)
5808 v.AddArg(v0)
5809 return true
5810 }
5811
5812
5813
5814 for {
5815 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
5816 break
5817 }
5818 z := v_0.Args[0]
5819 if z.Op != OpARM64ADD {
5820 break
5821 }
5822 y := z.Args[1]
5823 x := z.Args[0]
5824 if !(z.Uses == 1) {
5825 break
5826 }
5827 v.reset(OpARM64GreaterEqualNoov)
5828 v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
5829 v0.AddArg2(x, y)
5830 v.AddArg(v0)
5831 return true
5832 }
5833
5834
5835
5836 for {
5837 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
5838 break
5839 }
5840 z := v_0.Args[0]
5841 if z.Op != OpARM64MADD {
5842 break
5843 }
5844 y := z.Args[2]
5845 a := z.Args[0]
5846 x := z.Args[1]
5847 if !(z.Uses == 1) {
5848 break
5849 }
5850 v.reset(OpARM64GreaterEqualNoov)
5851 v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
5852 v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
5853 v1.AddArg2(x, y)
5854 v0.AddArg2(a, v1)
5855 v.AddArg(v0)
5856 return true
5857 }
5858
5859
5860
5861 for {
5862 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
5863 break
5864 }
5865 z := v_0.Args[0]
5866 if z.Op != OpARM64MSUB {
5867 break
5868 }
5869 y := z.Args[2]
5870 a := z.Args[0]
5871 x := z.Args[1]
5872 if !(z.Uses == 1) {
5873 break
5874 }
5875 v.reset(OpARM64GreaterEqualNoov)
5876 v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
5877 v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
5878 v1.AddArg2(x, y)
5879 v0.AddArg2(a, v1)
5880 v.AddArg(v0)
5881 return true
5882 }
5883
5884
5885
5886 for {
5887 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
5888 break
5889 }
5890 z := v_0.Args[0]
5891 if z.Op != OpARM64MADDW {
5892 break
5893 }
5894 y := z.Args[2]
5895 a := z.Args[0]
5896 x := z.Args[1]
5897 if !(z.Uses == 1) {
5898 break
5899 }
5900 v.reset(OpARM64GreaterEqualNoov)
5901 v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
5902 v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
5903 v1.AddArg2(x, y)
5904 v0.AddArg2(a, v1)
5905 v.AddArg(v0)
5906 return true
5907 }
5908
5909
5910
5911 for {
5912 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
5913 break
5914 }
5915 z := v_0.Args[0]
5916 if z.Op != OpARM64MSUBW {
5917 break
5918 }
5919 y := z.Args[2]
5920 a := z.Args[0]
5921 x := z.Args[1]
5922 if !(z.Uses == 1) {
5923 break
5924 }
5925 v.reset(OpARM64GreaterEqualNoov)
5926 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
5927 v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
5928 v1.AddArg2(x, y)
5929 v0.AddArg2(a, v1)
5930 v.AddArg(v0)
5931 return true
5932 }
5933
5934
5935 for {
5936 if v_0.Op != OpARM64FlagConstant {
5937 break
5938 }
5939 fc := auxIntToFlagConstant(v_0.AuxInt)
5940 v.reset(OpARM64MOVDconst)
5941 v.AuxInt = int64ToAuxInt(b2i(fc.ge()))
5942 return true
5943 }
5944
5945
5946 for {
5947 if v_0.Op != OpARM64InvertFlags {
5948 break
5949 }
5950 x := v_0.Args[0]
5951 v.reset(OpARM64LessEqual)
5952 v.AddArg(x)
5953 return true
5954 }
5955 return false
5956 }
5957 func rewriteValueARM64_OpARM64GreaterEqualF(v *Value) bool {
5958 v_0 := v.Args[0]
5959
5960
5961 for {
5962 if v_0.Op != OpARM64InvertFlags {
5963 break
5964 }
5965 x := v_0.Args[0]
5966 v.reset(OpARM64LessEqualF)
5967 v.AddArg(x)
5968 return true
5969 }
5970 return false
5971 }
5972 func rewriteValueARM64_OpARM64GreaterEqualNoov(v *Value) bool {
5973 v_0 := v.Args[0]
5974 b := v.Block
5975 typ := &b.Func.Config.Types
5976
5977
5978 for {
5979 if v_0.Op != OpARM64InvertFlags {
5980 break
5981 }
5982 x := v_0.Args[0]
5983 v.reset(OpARM64CSINC)
5984 v.AuxInt = opToAuxInt(OpARM64NotEqual)
5985 v0 := b.NewValue0(v.Pos, OpARM64LessThanNoov, typ.Bool)
5986 v0.AddArg(x)
5987 v1 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
5988 v1.AuxInt = int64ToAuxInt(0)
5989 v.AddArg3(v0, v1, x)
5990 return true
5991 }
5992 return false
5993 }
5994 func rewriteValueARM64_OpARM64GreaterEqualU(v *Value) bool {
5995 v_0 := v.Args[0]
5996
5997
5998 for {
5999 if v_0.Op != OpARM64FlagConstant {
6000 break
6001 }
6002 fc := auxIntToFlagConstant(v_0.AuxInt)
6003 v.reset(OpARM64MOVDconst)
6004 v.AuxInt = int64ToAuxInt(b2i(fc.uge()))
6005 return true
6006 }
6007
6008
6009 for {
6010 if v_0.Op != OpARM64InvertFlags {
6011 break
6012 }
6013 x := v_0.Args[0]
6014 v.reset(OpARM64LessEqualU)
6015 v.AddArg(x)
6016 return true
6017 }
6018 return false
6019 }
6020 func rewriteValueARM64_OpARM64GreaterThan(v *Value) bool {
6021 v_0 := v.Args[0]
6022 b := v.Block
6023
6024
6025
6026 for {
6027 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
6028 break
6029 }
6030 z := v_0.Args[0]
6031 if z.Op != OpARM64AND {
6032 break
6033 }
6034 y := z.Args[1]
6035 x := z.Args[0]
6036 if !(z.Uses == 1) {
6037 break
6038 }
6039 v.reset(OpARM64GreaterThan)
6040 v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
6041 v0.AddArg2(x, y)
6042 v.AddArg(v0)
6043 return true
6044 }
6045
6046
6047
6048 for {
6049 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
6050 break
6051 }
6052 x := v_0.Args[0]
6053 if x.Op != OpARM64ANDconst {
6054 break
6055 }
6056 c := auxIntToInt64(x.AuxInt)
6057 y := x.Args[0]
6058 if !(x.Uses == 1) {
6059 break
6060 }
6061 v.reset(OpARM64GreaterThan)
6062 v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
6063 v0.AuxInt = int32ToAuxInt(int32(c))
6064 v0.AddArg(y)
6065 v.AddArg(v0)
6066 return true
6067 }
6068
6069
6070
6071 for {
6072 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
6073 break
6074 }
6075 z := v_0.Args[0]
6076 if z.Op != OpARM64AND {
6077 break
6078 }
6079 y := z.Args[1]
6080 x := z.Args[0]
6081 if !(z.Uses == 1) {
6082 break
6083 }
6084 v.reset(OpARM64GreaterThan)
6085 v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
6086 v0.AddArg2(x, y)
6087 v.AddArg(v0)
6088 return true
6089 }
6090
6091
6092
6093 for {
6094 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
6095 break
6096 }
6097 x := v_0.Args[0]
6098 if x.Op != OpARM64ANDconst {
6099 break
6100 }
6101 c := auxIntToInt64(x.AuxInt)
6102 y := x.Args[0]
6103 if !(x.Uses == 1) {
6104 break
6105 }
6106 v.reset(OpARM64GreaterThan)
6107 v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
6108 v0.AuxInt = int64ToAuxInt(c)
6109 v0.AddArg(y)
6110 v.AddArg(v0)
6111 return true
6112 }
6113
6114
6115 for {
6116 if v_0.Op != OpARM64FlagConstant {
6117 break
6118 }
6119 fc := auxIntToFlagConstant(v_0.AuxInt)
6120 v.reset(OpARM64MOVDconst)
6121 v.AuxInt = int64ToAuxInt(b2i(fc.gt()))
6122 return true
6123 }
6124
6125
6126 for {
6127 if v_0.Op != OpARM64InvertFlags {
6128 break
6129 }
6130 x := v_0.Args[0]
6131 v.reset(OpARM64LessThan)
6132 v.AddArg(x)
6133 return true
6134 }
6135 return false
6136 }
6137 func rewriteValueARM64_OpARM64GreaterThanF(v *Value) bool {
6138 v_0 := v.Args[0]
6139
6140
6141 for {
6142 if v_0.Op != OpARM64InvertFlags {
6143 break
6144 }
6145 x := v_0.Args[0]
6146 v.reset(OpARM64LessThanF)
6147 v.AddArg(x)
6148 return true
6149 }
6150 return false
6151 }
6152 func rewriteValueARM64_OpARM64GreaterThanU(v *Value) bool {
6153 v_0 := v.Args[0]
6154
6155
6156 for {
6157 if v_0.Op != OpARM64FlagConstant {
6158 break
6159 }
6160 fc := auxIntToFlagConstant(v_0.AuxInt)
6161 v.reset(OpARM64MOVDconst)
6162 v.AuxInt = int64ToAuxInt(b2i(fc.ugt()))
6163 return true
6164 }
6165
6166
6167 for {
6168 if v_0.Op != OpARM64InvertFlags {
6169 break
6170 }
6171 x := v_0.Args[0]
6172 v.reset(OpARM64LessThanU)
6173 v.AddArg(x)
6174 return true
6175 }
6176 return false
6177 }
6178 func rewriteValueARM64_OpARM64LDP(v *Value) bool {
6179 v_1 := v.Args[1]
6180 v_0 := v.Args[0]
6181 b := v.Block
6182 config := b.Func.Config
6183
6184
6185
6186 for {
6187 off1 := auxIntToInt32(v.AuxInt)
6188 sym := auxToSym(v.Aux)
6189 if v_0.Op != OpARM64ADDconst {
6190 break
6191 }
6192 off2 := auxIntToInt64(v_0.AuxInt)
6193 ptr := v_0.Args[0]
6194 mem := v_1
6195 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
6196 break
6197 }
6198 v.reset(OpARM64LDP)
6199 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
6200 v.Aux = symToAux(sym)
6201 v.AddArg2(ptr, mem)
6202 return true
6203 }
6204
6205
6206
6207 for {
6208 off1 := auxIntToInt32(v.AuxInt)
6209 sym1 := auxToSym(v.Aux)
6210 if v_0.Op != OpARM64MOVDaddr {
6211 break
6212 }
6213 off2 := auxIntToInt32(v_0.AuxInt)
6214 sym2 := auxToSym(v_0.Aux)
6215 ptr := v_0.Args[0]
6216 mem := v_1
6217 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
6218 break
6219 }
6220 v.reset(OpARM64LDP)
6221 v.AuxInt = int32ToAuxInt(off1 + off2)
6222 v.Aux = symToAux(mergeSym(sym1, sym2))
6223 v.AddArg2(ptr, mem)
6224 return true
6225 }
6226 return false
6227 }
6228 func rewriteValueARM64_OpARM64LessEqual(v *Value) bool {
6229 v_0 := v.Args[0]
6230 b := v.Block
6231
6232
6233
6234 for {
6235 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
6236 break
6237 }
6238 z := v_0.Args[0]
6239 if z.Op != OpARM64AND {
6240 break
6241 }
6242 y := z.Args[1]
6243 x := z.Args[0]
6244 if !(z.Uses == 1) {
6245 break
6246 }
6247 v.reset(OpARM64LessEqual)
6248 v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
6249 v0.AddArg2(x, y)
6250 v.AddArg(v0)
6251 return true
6252 }
6253
6254
6255
6256 for {
6257 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
6258 break
6259 }
6260 x := v_0.Args[0]
6261 if x.Op != OpARM64ANDconst {
6262 break
6263 }
6264 c := auxIntToInt64(x.AuxInt)
6265 y := x.Args[0]
6266 if !(x.Uses == 1) {
6267 break
6268 }
6269 v.reset(OpARM64LessEqual)
6270 v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
6271 v0.AuxInt = int32ToAuxInt(int32(c))
6272 v0.AddArg(y)
6273 v.AddArg(v0)
6274 return true
6275 }
6276
6277
6278
6279 for {
6280 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
6281 break
6282 }
6283 z := v_0.Args[0]
6284 if z.Op != OpARM64AND {
6285 break
6286 }
6287 y := z.Args[1]
6288 x := z.Args[0]
6289 if !(z.Uses == 1) {
6290 break
6291 }
6292 v.reset(OpARM64LessEqual)
6293 v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
6294 v0.AddArg2(x, y)
6295 v.AddArg(v0)
6296 return true
6297 }
6298
6299
6300
6301 for {
6302 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
6303 break
6304 }
6305 x := v_0.Args[0]
6306 if x.Op != OpARM64ANDconst {
6307 break
6308 }
6309 c := auxIntToInt64(x.AuxInt)
6310 y := x.Args[0]
6311 if !(x.Uses == 1) {
6312 break
6313 }
6314 v.reset(OpARM64LessEqual)
6315 v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
6316 v0.AuxInt = int64ToAuxInt(c)
6317 v0.AddArg(y)
6318 v.AddArg(v0)
6319 return true
6320 }
6321
6322
6323 for {
6324 if v_0.Op != OpARM64FlagConstant {
6325 break
6326 }
6327 fc := auxIntToFlagConstant(v_0.AuxInt)
6328 v.reset(OpARM64MOVDconst)
6329 v.AuxInt = int64ToAuxInt(b2i(fc.le()))
6330 return true
6331 }
6332
6333
6334 for {
6335 if v_0.Op != OpARM64InvertFlags {
6336 break
6337 }
6338 x := v_0.Args[0]
6339 v.reset(OpARM64GreaterEqual)
6340 v.AddArg(x)
6341 return true
6342 }
6343 return false
6344 }
6345 func rewriteValueARM64_OpARM64LessEqualF(v *Value) bool {
6346 v_0 := v.Args[0]
6347
6348
6349 for {
6350 if v_0.Op != OpARM64InvertFlags {
6351 break
6352 }
6353 x := v_0.Args[0]
6354 v.reset(OpARM64GreaterEqualF)
6355 v.AddArg(x)
6356 return true
6357 }
6358 return false
6359 }
6360 func rewriteValueARM64_OpARM64LessEqualU(v *Value) bool {
6361 v_0 := v.Args[0]
6362
6363
6364 for {
6365 if v_0.Op != OpARM64FlagConstant {
6366 break
6367 }
6368 fc := auxIntToFlagConstant(v_0.AuxInt)
6369 v.reset(OpARM64MOVDconst)
6370 v.AuxInt = int64ToAuxInt(b2i(fc.ule()))
6371 return true
6372 }
6373
6374
6375 for {
6376 if v_0.Op != OpARM64InvertFlags {
6377 break
6378 }
6379 x := v_0.Args[0]
6380 v.reset(OpARM64GreaterEqualU)
6381 v.AddArg(x)
6382 return true
6383 }
6384 return false
6385 }
6386 func rewriteValueARM64_OpARM64LessThan(v *Value) bool {
6387 v_0 := v.Args[0]
6388 b := v.Block
6389
6390
6391
6392 for {
6393 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
6394 break
6395 }
6396 z := v_0.Args[0]
6397 if z.Op != OpARM64AND {
6398 break
6399 }
6400 y := z.Args[1]
6401 x := z.Args[0]
6402 if !(z.Uses == 1) {
6403 break
6404 }
6405 v.reset(OpARM64LessThan)
6406 v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
6407 v0.AddArg2(x, y)
6408 v.AddArg(v0)
6409 return true
6410 }
6411
6412
6413
6414 for {
6415 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
6416 break
6417 }
6418 x := v_0.Args[0]
6419 if x.Op != OpARM64ANDconst {
6420 break
6421 }
6422 c := auxIntToInt64(x.AuxInt)
6423 y := x.Args[0]
6424 if !(x.Uses == 1) {
6425 break
6426 }
6427 v.reset(OpARM64LessThan)
6428 v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
6429 v0.AuxInt = int32ToAuxInt(int32(c))
6430 v0.AddArg(y)
6431 v.AddArg(v0)
6432 return true
6433 }
6434
6435
6436
6437 for {
6438 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
6439 break
6440 }
6441 z := v_0.Args[0]
6442 if z.Op != OpARM64AND {
6443 break
6444 }
6445 y := z.Args[1]
6446 x := z.Args[0]
6447 if !(z.Uses == 1) {
6448 break
6449 }
6450 v.reset(OpARM64LessThan)
6451 v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
6452 v0.AddArg2(x, y)
6453 v.AddArg(v0)
6454 return true
6455 }
6456
6457
6458
6459 for {
6460 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
6461 break
6462 }
6463 x := v_0.Args[0]
6464 if x.Op != OpARM64ANDconst {
6465 break
6466 }
6467 c := auxIntToInt64(x.AuxInt)
6468 y := x.Args[0]
6469 if !(x.Uses == 1) {
6470 break
6471 }
6472 v.reset(OpARM64LessThan)
6473 v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
6474 v0.AuxInt = int64ToAuxInt(c)
6475 v0.AddArg(y)
6476 v.AddArg(v0)
6477 return true
6478 }
6479
6480
6481
6482 for {
6483 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
6484 break
6485 }
6486 x := v_0.Args[0]
6487 if x.Op != OpARM64ADDconst {
6488 break
6489 }
6490 c := auxIntToInt64(x.AuxInt)
6491 y := x.Args[0]
6492 if !(x.Uses == 1) {
6493 break
6494 }
6495 v.reset(OpARM64LessThanNoov)
6496 v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
6497 v0.AuxInt = int64ToAuxInt(c)
6498 v0.AddArg(y)
6499 v.AddArg(v0)
6500 return true
6501 }
6502
6503
6504
6505 for {
6506 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
6507 break
6508 }
6509 x := v_0.Args[0]
6510 if x.Op != OpARM64ADDconst {
6511 break
6512 }
6513 c := auxIntToInt64(x.AuxInt)
6514 y := x.Args[0]
6515 if !(x.Uses == 1) {
6516 break
6517 }
6518 v.reset(OpARM64LessThanNoov)
6519 v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
6520 v0.AuxInt = int32ToAuxInt(int32(c))
6521 v0.AddArg(y)
6522 v.AddArg(v0)
6523 return true
6524 }
6525
6526
6527
6528 for {
6529 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
6530 break
6531 }
6532 z := v_0.Args[0]
6533 if z.Op != OpARM64ADD {
6534 break
6535 }
6536 y := z.Args[1]
6537 x := z.Args[0]
6538 if !(z.Uses == 1) {
6539 break
6540 }
6541 v.reset(OpARM64LessThanNoov)
6542 v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
6543 v0.AddArg2(x, y)
6544 v.AddArg(v0)
6545 return true
6546 }
6547
6548
6549
6550 for {
6551 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
6552 break
6553 }
6554 z := v_0.Args[0]
6555 if z.Op != OpARM64ADD {
6556 break
6557 }
6558 y := z.Args[1]
6559 x := z.Args[0]
6560 if !(z.Uses == 1) {
6561 break
6562 }
6563 v.reset(OpARM64LessThanNoov)
6564 v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
6565 v0.AddArg2(x, y)
6566 v.AddArg(v0)
6567 return true
6568 }
6569
6570
6571
6572 for {
6573 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
6574 break
6575 }
6576 z := v_0.Args[0]
6577 if z.Op != OpARM64MADD {
6578 break
6579 }
6580 y := z.Args[2]
6581 a := z.Args[0]
6582 x := z.Args[1]
6583 if !(z.Uses == 1) {
6584 break
6585 }
6586 v.reset(OpARM64LessThanNoov)
6587 v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
6588 v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
6589 v1.AddArg2(x, y)
6590 v0.AddArg2(a, v1)
6591 v.AddArg(v0)
6592 return true
6593 }
6594
6595
6596
6597 for {
6598 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
6599 break
6600 }
6601 z := v_0.Args[0]
6602 if z.Op != OpARM64MSUB {
6603 break
6604 }
6605 y := z.Args[2]
6606 a := z.Args[0]
6607 x := z.Args[1]
6608 if !(z.Uses == 1) {
6609 break
6610 }
6611 v.reset(OpARM64LessThanNoov)
6612 v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
6613 v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
6614 v1.AddArg2(x, y)
6615 v0.AddArg2(a, v1)
6616 v.AddArg(v0)
6617 return true
6618 }
6619
6620
6621
6622 for {
6623 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
6624 break
6625 }
6626 z := v_0.Args[0]
6627 if z.Op != OpARM64MADDW {
6628 break
6629 }
6630 y := z.Args[2]
6631 a := z.Args[0]
6632 x := z.Args[1]
6633 if !(z.Uses == 1) {
6634 break
6635 }
6636 v.reset(OpARM64LessThanNoov)
6637 v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
6638 v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
6639 v1.AddArg2(x, y)
6640 v0.AddArg2(a, v1)
6641 v.AddArg(v0)
6642 return true
6643 }
6644
6645
6646
6647 for {
6648 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
6649 break
6650 }
6651 z := v_0.Args[0]
6652 if z.Op != OpARM64MSUBW {
6653 break
6654 }
6655 y := z.Args[2]
6656 a := z.Args[0]
6657 x := z.Args[1]
6658 if !(z.Uses == 1) {
6659 break
6660 }
6661 v.reset(OpARM64LessThanNoov)
6662 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
6663 v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
6664 v1.AddArg2(x, y)
6665 v0.AddArg2(a, v1)
6666 v.AddArg(v0)
6667 return true
6668 }
6669
6670
6671 for {
6672 if v_0.Op != OpARM64FlagConstant {
6673 break
6674 }
6675 fc := auxIntToFlagConstant(v_0.AuxInt)
6676 v.reset(OpARM64MOVDconst)
6677 v.AuxInt = int64ToAuxInt(b2i(fc.lt()))
6678 return true
6679 }
6680
6681
6682 for {
6683 if v_0.Op != OpARM64InvertFlags {
6684 break
6685 }
6686 x := v_0.Args[0]
6687 v.reset(OpARM64GreaterThan)
6688 v.AddArg(x)
6689 return true
6690 }
6691 return false
6692 }
6693 func rewriteValueARM64_OpARM64LessThanF(v *Value) bool {
6694 v_0 := v.Args[0]
6695
6696
6697 for {
6698 if v_0.Op != OpARM64InvertFlags {
6699 break
6700 }
6701 x := v_0.Args[0]
6702 v.reset(OpARM64GreaterThanF)
6703 v.AddArg(x)
6704 return true
6705 }
6706 return false
6707 }
6708 func rewriteValueARM64_OpARM64LessThanNoov(v *Value) bool {
6709 v_0 := v.Args[0]
6710 b := v.Block
6711 typ := &b.Func.Config.Types
6712
6713
6714 for {
6715 if v_0.Op != OpARM64InvertFlags {
6716 break
6717 }
6718 x := v_0.Args[0]
6719 v.reset(OpARM64CSEL0)
6720 v.AuxInt = opToAuxInt(OpARM64NotEqual)
6721 v0 := b.NewValue0(v.Pos, OpARM64GreaterEqualNoov, typ.Bool)
6722 v0.AddArg(x)
6723 v.AddArg2(v0, x)
6724 return true
6725 }
6726 return false
6727 }
6728 func rewriteValueARM64_OpARM64LessThanU(v *Value) bool {
6729 v_0 := v.Args[0]
6730
6731
6732 for {
6733 if v_0.Op != OpARM64FlagConstant {
6734 break
6735 }
6736 fc := auxIntToFlagConstant(v_0.AuxInt)
6737 v.reset(OpARM64MOVDconst)
6738 v.AuxInt = int64ToAuxInt(b2i(fc.ult()))
6739 return true
6740 }
6741
6742
6743 for {
6744 if v_0.Op != OpARM64InvertFlags {
6745 break
6746 }
6747 x := v_0.Args[0]
6748 v.reset(OpARM64GreaterThanU)
6749 v.AddArg(x)
6750 return true
6751 }
6752 return false
6753 }
6754 func rewriteValueARM64_OpARM64MADD(v *Value) bool {
6755 v_2 := v.Args[2]
6756 v_1 := v.Args[1]
6757 v_0 := v.Args[0]
6758 b := v.Block
6759
6760
6761 for {
6762 a := v_0
6763 x := v_1
6764 if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != -1 {
6765 break
6766 }
6767 v.reset(OpARM64SUB)
6768 v.AddArg2(a, x)
6769 return true
6770 }
6771
6772
6773 for {
6774 a := v_0
6775 if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
6776 break
6777 }
6778 v.copyOf(a)
6779 return true
6780 }
6781
6782
6783 for {
6784 a := v_0
6785 x := v_1
6786 if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 1 {
6787 break
6788 }
6789 v.reset(OpARM64ADD)
6790 v.AddArg2(a, x)
6791 return true
6792 }
6793
6794
6795
6796 for {
6797 a := v_0
6798 x := v_1
6799 if v_2.Op != OpARM64MOVDconst {
6800 break
6801 }
6802 c := auxIntToInt64(v_2.AuxInt)
6803 if !(isPowerOfTwo64(c)) {
6804 break
6805 }
6806 v.reset(OpARM64ADDshiftLL)
6807 v.AuxInt = int64ToAuxInt(log64(c))
6808 v.AddArg2(a, x)
6809 return true
6810 }
6811
6812
6813
6814 for {
6815 a := v_0
6816 x := v_1
6817 if v_2.Op != OpARM64MOVDconst {
6818 break
6819 }
6820 c := auxIntToInt64(v_2.AuxInt)
6821 if !(isPowerOfTwo64(c-1) && c >= 3) {
6822 break
6823 }
6824 v.reset(OpARM64ADD)
6825 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
6826 v0.AuxInt = int64ToAuxInt(log64(c - 1))
6827 v0.AddArg2(x, x)
6828 v.AddArg2(a, v0)
6829 return true
6830 }
6831
6832
6833
6834 for {
6835 a := v_0
6836 x := v_1
6837 if v_2.Op != OpARM64MOVDconst {
6838 break
6839 }
6840 c := auxIntToInt64(v_2.AuxInt)
6841 if !(isPowerOfTwo64(c+1) && c >= 7) {
6842 break
6843 }
6844 v.reset(OpARM64SUB)
6845 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
6846 v0.AuxInt = int64ToAuxInt(log64(c + 1))
6847 v0.AddArg2(x, x)
6848 v.AddArg2(a, v0)
6849 return true
6850 }
6851
6852
6853
6854 for {
6855 a := v_0
6856 x := v_1
6857 if v_2.Op != OpARM64MOVDconst {
6858 break
6859 }
6860 c := auxIntToInt64(v_2.AuxInt)
6861 if !(c%3 == 0 && isPowerOfTwo64(c/3)) {
6862 break
6863 }
6864 v.reset(OpARM64SUBshiftLL)
6865 v.AuxInt = int64ToAuxInt(log64(c / 3))
6866 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
6867 v0.AuxInt = int64ToAuxInt(2)
6868 v0.AddArg2(x, x)
6869 v.AddArg2(a, v0)
6870 return true
6871 }
6872
6873
6874
6875 for {
6876 a := v_0
6877 x := v_1
6878 if v_2.Op != OpARM64MOVDconst {
6879 break
6880 }
6881 c := auxIntToInt64(v_2.AuxInt)
6882 if !(c%5 == 0 && isPowerOfTwo64(c/5)) {
6883 break
6884 }
6885 v.reset(OpARM64ADDshiftLL)
6886 v.AuxInt = int64ToAuxInt(log64(c / 5))
6887 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
6888 v0.AuxInt = int64ToAuxInt(2)
6889 v0.AddArg2(x, x)
6890 v.AddArg2(a, v0)
6891 return true
6892 }
6893
6894
6895
6896 for {
6897 a := v_0
6898 x := v_1
6899 if v_2.Op != OpARM64MOVDconst {
6900 break
6901 }
6902 c := auxIntToInt64(v_2.AuxInt)
6903 if !(c%7 == 0 && isPowerOfTwo64(c/7)) {
6904 break
6905 }
6906 v.reset(OpARM64SUBshiftLL)
6907 v.AuxInt = int64ToAuxInt(log64(c / 7))
6908 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
6909 v0.AuxInt = int64ToAuxInt(3)
6910 v0.AddArg2(x, x)
6911 v.AddArg2(a, v0)
6912 return true
6913 }
6914
6915
6916
6917 for {
6918 a := v_0
6919 x := v_1
6920 if v_2.Op != OpARM64MOVDconst {
6921 break
6922 }
6923 c := auxIntToInt64(v_2.AuxInt)
6924 if !(c%9 == 0 && isPowerOfTwo64(c/9)) {
6925 break
6926 }
6927 v.reset(OpARM64ADDshiftLL)
6928 v.AuxInt = int64ToAuxInt(log64(c / 9))
6929 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
6930 v0.AuxInt = int64ToAuxInt(3)
6931 v0.AddArg2(x, x)
6932 v.AddArg2(a, v0)
6933 return true
6934 }
6935
6936
6937 for {
6938 a := v_0
6939 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
6940 break
6941 }
6942 x := v_2
6943 v.reset(OpARM64SUB)
6944 v.AddArg2(a, x)
6945 return true
6946 }
6947
6948
6949 for {
6950 a := v_0
6951 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
6952 break
6953 }
6954 v.copyOf(a)
6955 return true
6956 }
6957
6958
6959 for {
6960 a := v_0
6961 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
6962 break
6963 }
6964 x := v_2
6965 v.reset(OpARM64ADD)
6966 v.AddArg2(a, x)
6967 return true
6968 }
6969
6970
6971
6972 for {
6973 a := v_0
6974 if v_1.Op != OpARM64MOVDconst {
6975 break
6976 }
6977 c := auxIntToInt64(v_1.AuxInt)
6978 x := v_2
6979 if !(isPowerOfTwo64(c)) {
6980 break
6981 }
6982 v.reset(OpARM64ADDshiftLL)
6983 v.AuxInt = int64ToAuxInt(log64(c))
6984 v.AddArg2(a, x)
6985 return true
6986 }
6987
6988
6989
6990 for {
6991 a := v_0
6992 if v_1.Op != OpARM64MOVDconst {
6993 break
6994 }
6995 c := auxIntToInt64(v_1.AuxInt)
6996 x := v_2
6997 if !(isPowerOfTwo64(c-1) && c >= 3) {
6998 break
6999 }
7000 v.reset(OpARM64ADD)
7001 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
7002 v0.AuxInt = int64ToAuxInt(log64(c - 1))
7003 v0.AddArg2(x, x)
7004 v.AddArg2(a, v0)
7005 return true
7006 }
7007
7008
7009
7010 for {
7011 a := v_0
7012 if v_1.Op != OpARM64MOVDconst {
7013 break
7014 }
7015 c := auxIntToInt64(v_1.AuxInt)
7016 x := v_2
7017 if !(isPowerOfTwo64(c+1) && c >= 7) {
7018 break
7019 }
7020 v.reset(OpARM64SUB)
7021 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
7022 v0.AuxInt = int64ToAuxInt(log64(c + 1))
7023 v0.AddArg2(x, x)
7024 v.AddArg2(a, v0)
7025 return true
7026 }
7027
7028
7029
7030 for {
7031 a := v_0
7032 if v_1.Op != OpARM64MOVDconst {
7033 break
7034 }
7035 c := auxIntToInt64(v_1.AuxInt)
7036 x := v_2
7037 if !(c%3 == 0 && isPowerOfTwo64(c/3)) {
7038 break
7039 }
7040 v.reset(OpARM64SUBshiftLL)
7041 v.AuxInt = int64ToAuxInt(log64(c / 3))
7042 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
7043 v0.AuxInt = int64ToAuxInt(2)
7044 v0.AddArg2(x, x)
7045 v.AddArg2(a, v0)
7046 return true
7047 }
7048
7049
7050
7051 for {
7052 a := v_0
7053 if v_1.Op != OpARM64MOVDconst {
7054 break
7055 }
7056 c := auxIntToInt64(v_1.AuxInt)
7057 x := v_2
7058 if !(c%5 == 0 && isPowerOfTwo64(c/5)) {
7059 break
7060 }
7061 v.reset(OpARM64ADDshiftLL)
7062 v.AuxInt = int64ToAuxInt(log64(c / 5))
7063 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
7064 v0.AuxInt = int64ToAuxInt(2)
7065 v0.AddArg2(x, x)
7066 v.AddArg2(a, v0)
7067 return true
7068 }
7069
7070
7071
7072 for {
7073 a := v_0
7074 if v_1.Op != OpARM64MOVDconst {
7075 break
7076 }
7077 c := auxIntToInt64(v_1.AuxInt)
7078 x := v_2
7079 if !(c%7 == 0 && isPowerOfTwo64(c/7)) {
7080 break
7081 }
7082 v.reset(OpARM64SUBshiftLL)
7083 v.AuxInt = int64ToAuxInt(log64(c / 7))
7084 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
7085 v0.AuxInt = int64ToAuxInt(3)
7086 v0.AddArg2(x, x)
7087 v.AddArg2(a, v0)
7088 return true
7089 }
7090
7091
7092
7093 for {
7094 a := v_0
7095 if v_1.Op != OpARM64MOVDconst {
7096 break
7097 }
7098 c := auxIntToInt64(v_1.AuxInt)
7099 x := v_2
7100 if !(c%9 == 0 && isPowerOfTwo64(c/9)) {
7101 break
7102 }
7103 v.reset(OpARM64ADDshiftLL)
7104 v.AuxInt = int64ToAuxInt(log64(c / 9))
7105 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
7106 v0.AuxInt = int64ToAuxInt(3)
7107 v0.AddArg2(x, x)
7108 v.AddArg2(a, v0)
7109 return true
7110 }
7111
7112
7113 for {
7114 if v_0.Op != OpARM64MOVDconst {
7115 break
7116 }
7117 c := auxIntToInt64(v_0.AuxInt)
7118 x := v_1
7119 y := v_2
7120 v.reset(OpARM64ADDconst)
7121 v.AuxInt = int64ToAuxInt(c)
7122 v0 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
7123 v0.AddArg2(x, y)
7124 v.AddArg(v0)
7125 return true
7126 }
7127
7128
7129 for {
7130 a := v_0
7131 if v_1.Op != OpARM64MOVDconst {
7132 break
7133 }
7134 c := auxIntToInt64(v_1.AuxInt)
7135 if v_2.Op != OpARM64MOVDconst {
7136 break
7137 }
7138 d := auxIntToInt64(v_2.AuxInt)
7139 v.reset(OpARM64ADDconst)
7140 v.AuxInt = int64ToAuxInt(c * d)
7141 v.AddArg(a)
7142 return true
7143 }
7144 return false
7145 }
7146 func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
7147 v_2 := v.Args[2]
7148 v_1 := v.Args[1]
7149 v_0 := v.Args[0]
7150 b := v.Block
7151
7152
7153
7154 for {
7155 a := v_0
7156 x := v_1
7157 if v_2.Op != OpARM64MOVDconst {
7158 break
7159 }
7160 c := auxIntToInt64(v_2.AuxInt)
7161 if !(int32(c) == -1) {
7162 break
7163 }
7164 v.reset(OpARM64MOVWUreg)
7165 v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
7166 v0.AddArg2(a, x)
7167 v.AddArg(v0)
7168 return true
7169 }
7170
7171
7172
7173 for {
7174 a := v_0
7175 if v_2.Op != OpARM64MOVDconst {
7176 break
7177 }
7178 c := auxIntToInt64(v_2.AuxInt)
7179 if !(int32(c) == 0) {
7180 break
7181 }
7182 v.reset(OpARM64MOVWUreg)
7183 v.AddArg(a)
7184 return true
7185 }
7186
7187
7188
7189 for {
7190 a := v_0
7191 x := v_1
7192 if v_2.Op != OpARM64MOVDconst {
7193 break
7194 }
7195 c := auxIntToInt64(v_2.AuxInt)
7196 if !(int32(c) == 1) {
7197 break
7198 }
7199 v.reset(OpARM64MOVWUreg)
7200 v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
7201 v0.AddArg2(a, x)
7202 v.AddArg(v0)
7203 return true
7204 }
7205
7206
7207
7208 for {
7209 a := v_0
7210 x := v_1
7211 if v_2.Op != OpARM64MOVDconst {
7212 break
7213 }
7214 c := auxIntToInt64(v_2.AuxInt)
7215 if !(isPowerOfTwo64(c)) {
7216 break
7217 }
7218 v.reset(OpARM64MOVWUreg)
7219 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
7220 v0.AuxInt = int64ToAuxInt(log64(c))
7221 v0.AddArg2(a, x)
7222 v.AddArg(v0)
7223 return true
7224 }
7225
7226
7227
7228 for {
7229 a := v_0
7230 x := v_1
7231 if v_2.Op != OpARM64MOVDconst {
7232 break
7233 }
7234 c := auxIntToInt64(v_2.AuxInt)
7235 if !(isPowerOfTwo64(c-1) && int32(c) >= 3) {
7236 break
7237 }
7238 v.reset(OpARM64MOVWUreg)
7239 v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
7240 v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
7241 v1.AuxInt = int64ToAuxInt(log64(c - 1))
7242 v1.AddArg2(x, x)
7243 v0.AddArg2(a, v1)
7244 v.AddArg(v0)
7245 return true
7246 }
7247
7248
7249
7250 for {
7251 a := v_0
7252 x := v_1
7253 if v_2.Op != OpARM64MOVDconst {
7254 break
7255 }
7256 c := auxIntToInt64(v_2.AuxInt)
7257 if !(isPowerOfTwo64(c+1) && int32(c) >= 7) {
7258 break
7259 }
7260 v.reset(OpARM64MOVWUreg)
7261 v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
7262 v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
7263 v1.AuxInt = int64ToAuxInt(log64(c + 1))
7264 v1.AddArg2(x, x)
7265 v0.AddArg2(a, v1)
7266 v.AddArg(v0)
7267 return true
7268 }
7269
7270
7271
7272 for {
7273 a := v_0
7274 x := v_1
7275 if v_2.Op != OpARM64MOVDconst {
7276 break
7277 }
7278 c := auxIntToInt64(v_2.AuxInt)
7279 if !(c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c)) {
7280 break
7281 }
7282 v.reset(OpARM64MOVWUreg)
7283 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
7284 v0.AuxInt = int64ToAuxInt(log64(c / 3))
7285 v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
7286 v1.AuxInt = int64ToAuxInt(2)
7287 v1.AddArg2(x, x)
7288 v0.AddArg2(a, v1)
7289 v.AddArg(v0)
7290 return true
7291 }
7292
7293
7294
7295 for {
7296 a := v_0
7297 x := v_1
7298 if v_2.Op != OpARM64MOVDconst {
7299 break
7300 }
7301 c := auxIntToInt64(v_2.AuxInt)
7302 if !(c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c)) {
7303 break
7304 }
7305 v.reset(OpARM64MOVWUreg)
7306 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
7307 v0.AuxInt = int64ToAuxInt(log64(c / 5))
7308 v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
7309 v1.AuxInt = int64ToAuxInt(2)
7310 v1.AddArg2(x, x)
7311 v0.AddArg2(a, v1)
7312 v.AddArg(v0)
7313 return true
7314 }
7315
7316
7317
7318 for {
7319 a := v_0
7320 x := v_1
7321 if v_2.Op != OpARM64MOVDconst {
7322 break
7323 }
7324 c := auxIntToInt64(v_2.AuxInt)
7325 if !(c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c)) {
7326 break
7327 }
7328 v.reset(OpARM64MOVWUreg)
7329 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
7330 v0.AuxInt = int64ToAuxInt(log64(c / 7))
7331 v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
7332 v1.AuxInt = int64ToAuxInt(3)
7333 v1.AddArg2(x, x)
7334 v0.AddArg2(a, v1)
7335 v.AddArg(v0)
7336 return true
7337 }
7338
7339
7340
7341 for {
7342 a := v_0
7343 x := v_1
7344 if v_2.Op != OpARM64MOVDconst {
7345 break
7346 }
7347 c := auxIntToInt64(v_2.AuxInt)
7348 if !(c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c)) {
7349 break
7350 }
7351 v.reset(OpARM64MOVWUreg)
7352 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
7353 v0.AuxInt = int64ToAuxInt(log64(c / 9))
7354 v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
7355 v1.AuxInt = int64ToAuxInt(3)
7356 v1.AddArg2(x, x)
7357 v0.AddArg2(a, v1)
7358 v.AddArg(v0)
7359 return true
7360 }
7361
7362
7363
7364 for {
7365 a := v_0
7366 if v_1.Op != OpARM64MOVDconst {
7367 break
7368 }
7369 c := auxIntToInt64(v_1.AuxInt)
7370 x := v_2
7371 if !(int32(c) == -1) {
7372 break
7373 }
7374 v.reset(OpARM64MOVWUreg)
7375 v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
7376 v0.AddArg2(a, x)
7377 v.AddArg(v0)
7378 return true
7379 }
7380
7381
7382
7383 for {
7384 a := v_0
7385 if v_1.Op != OpARM64MOVDconst {
7386 break
7387 }
7388 c := auxIntToInt64(v_1.AuxInt)
7389 if !(int32(c) == 0) {
7390 break
7391 }
7392 v.reset(OpARM64MOVWUreg)
7393 v.AddArg(a)
7394 return true
7395 }
7396
7397
7398
7399 for {
7400 a := v_0
7401 if v_1.Op != OpARM64MOVDconst {
7402 break
7403 }
7404 c := auxIntToInt64(v_1.AuxInt)
7405 x := v_2
7406 if !(int32(c) == 1) {
7407 break
7408 }
7409 v.reset(OpARM64MOVWUreg)
7410 v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
7411 v0.AddArg2(a, x)
7412 v.AddArg(v0)
7413 return true
7414 }
7415
7416
7417
7418 for {
7419 a := v_0
7420 if v_1.Op != OpARM64MOVDconst {
7421 break
7422 }
7423 c := auxIntToInt64(v_1.AuxInt)
7424 x := v_2
7425 if !(isPowerOfTwo64(c)) {
7426 break
7427 }
7428 v.reset(OpARM64MOVWUreg)
7429 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
7430 v0.AuxInt = int64ToAuxInt(log64(c))
7431 v0.AddArg2(a, x)
7432 v.AddArg(v0)
7433 return true
7434 }
7435
7436
7437
7438 for {
7439 a := v_0
7440 if v_1.Op != OpARM64MOVDconst {
7441 break
7442 }
7443 c := auxIntToInt64(v_1.AuxInt)
7444 x := v_2
7445 if !(isPowerOfTwo64(c-1) && int32(c) >= 3) {
7446 break
7447 }
7448 v.reset(OpARM64MOVWUreg)
7449 v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
7450 v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
7451 v1.AuxInt = int64ToAuxInt(log64(c - 1))
7452 v1.AddArg2(x, x)
7453 v0.AddArg2(a, v1)
7454 v.AddArg(v0)
7455 return true
7456 }
7457
7458
7459
7460 for {
7461 a := v_0
7462 if v_1.Op != OpARM64MOVDconst {
7463 break
7464 }
7465 c := auxIntToInt64(v_1.AuxInt)
7466 x := v_2
7467 if !(isPowerOfTwo64(c+1) && int32(c) >= 7) {
7468 break
7469 }
7470 v.reset(OpARM64MOVWUreg)
7471 v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
7472 v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
7473 v1.AuxInt = int64ToAuxInt(log64(c + 1))
7474 v1.AddArg2(x, x)
7475 v0.AddArg2(a, v1)
7476 v.AddArg(v0)
7477 return true
7478 }
7479
7480
7481
7482 for {
7483 a := v_0
7484 if v_1.Op != OpARM64MOVDconst {
7485 break
7486 }
7487 c := auxIntToInt64(v_1.AuxInt)
7488 x := v_2
7489 if !(c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c)) {
7490 break
7491 }
7492 v.reset(OpARM64MOVWUreg)
7493 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
7494 v0.AuxInt = int64ToAuxInt(log64(c / 3))
7495 v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
7496 v1.AuxInt = int64ToAuxInt(2)
7497 v1.AddArg2(x, x)
7498 v0.AddArg2(a, v1)
7499 v.AddArg(v0)
7500 return true
7501 }
7502
7503
7504
7505 for {
7506 a := v_0
7507 if v_1.Op != OpARM64MOVDconst {
7508 break
7509 }
7510 c := auxIntToInt64(v_1.AuxInt)
7511 x := v_2
7512 if !(c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c)) {
7513 break
7514 }
7515 v.reset(OpARM64MOVWUreg)
7516 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
7517 v0.AuxInt = int64ToAuxInt(log64(c / 5))
7518 v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
7519 v1.AuxInt = int64ToAuxInt(2)
7520 v1.AddArg2(x, x)
7521 v0.AddArg2(a, v1)
7522 v.AddArg(v0)
7523 return true
7524 }
7525
7526
7527
7528 for {
7529 a := v_0
7530 if v_1.Op != OpARM64MOVDconst {
7531 break
7532 }
7533 c := auxIntToInt64(v_1.AuxInt)
7534 x := v_2
7535 if !(c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c)) {
7536 break
7537 }
7538 v.reset(OpARM64MOVWUreg)
7539 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
7540 v0.AuxInt = int64ToAuxInt(log64(c / 7))
7541 v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
7542 v1.AuxInt = int64ToAuxInt(3)
7543 v1.AddArg2(x, x)
7544 v0.AddArg2(a, v1)
7545 v.AddArg(v0)
7546 return true
7547 }
7548
7549
7550
7551 for {
7552 a := v_0
7553 if v_1.Op != OpARM64MOVDconst {
7554 break
7555 }
7556 c := auxIntToInt64(v_1.AuxInt)
7557 x := v_2
7558 if !(c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c)) {
7559 break
7560 }
7561 v.reset(OpARM64MOVWUreg)
7562 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
7563 v0.AuxInt = int64ToAuxInt(log64(c / 9))
7564 v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
7565 v1.AuxInt = int64ToAuxInt(3)
7566 v1.AddArg2(x, x)
7567 v0.AddArg2(a, v1)
7568 v.AddArg(v0)
7569 return true
7570 }
7571
7572
7573 for {
7574 if v_0.Op != OpARM64MOVDconst {
7575 break
7576 }
7577 c := auxIntToInt64(v_0.AuxInt)
7578 x := v_1
7579 y := v_2
7580 v.reset(OpARM64MOVWUreg)
7581 v0 := b.NewValue0(v.Pos, OpARM64ADDconst, x.Type)
7582 v0.AuxInt = int64ToAuxInt(c)
7583 v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
7584 v1.AddArg2(x, y)
7585 v0.AddArg(v1)
7586 v.AddArg(v0)
7587 return true
7588 }
7589
7590
7591 for {
7592 a := v_0
7593 if v_1.Op != OpARM64MOVDconst {
7594 break
7595 }
7596 c := auxIntToInt64(v_1.AuxInt)
7597 if v_2.Op != OpARM64MOVDconst {
7598 break
7599 }
7600 d := auxIntToInt64(v_2.AuxInt)
7601 v.reset(OpARM64MOVWUreg)
7602 v0 := b.NewValue0(v.Pos, OpARM64ADDconst, a.Type)
7603 v0.AuxInt = int64ToAuxInt(c * d)
7604 v0.AddArg(a)
7605 v.AddArg(v0)
7606 return true
7607 }
7608 return false
7609 }
7610 func rewriteValueARM64_OpARM64MNEG(v *Value) bool {
7611 v_1 := v.Args[1]
7612 v_0 := v.Args[0]
7613 b := v.Block
7614
7615
7616 for {
7617 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7618 x := v_0
7619 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
7620 continue
7621 }
7622 v.copyOf(x)
7623 return true
7624 }
7625 break
7626 }
7627
7628
7629 for {
7630 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7631 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
7632 continue
7633 }
7634 v.reset(OpARM64MOVDconst)
7635 v.AuxInt = int64ToAuxInt(0)
7636 return true
7637 }
7638 break
7639 }
7640
7641
7642 for {
7643 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7644 x := v_0
7645 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
7646 continue
7647 }
7648 v.reset(OpARM64NEG)
7649 v.AddArg(x)
7650 return true
7651 }
7652 break
7653 }
7654
7655
7656
7657 for {
7658 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7659 x := v_0
7660 if v_1.Op != OpARM64MOVDconst {
7661 continue
7662 }
7663 c := auxIntToInt64(v_1.AuxInt)
7664 if !(isPowerOfTwo64(c)) {
7665 continue
7666 }
7667 v.reset(OpARM64NEG)
7668 v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
7669 v0.AuxInt = int64ToAuxInt(log64(c))
7670 v0.AddArg(x)
7671 v.AddArg(v0)
7672 return true
7673 }
7674 break
7675 }
7676
7677
7678
7679 for {
7680 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7681 x := v_0
7682 if v_1.Op != OpARM64MOVDconst {
7683 continue
7684 }
7685 c := auxIntToInt64(v_1.AuxInt)
7686 if !(isPowerOfTwo64(c-1) && c >= 3) {
7687 continue
7688 }
7689 v.reset(OpARM64NEG)
7690 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
7691 v0.AuxInt = int64ToAuxInt(log64(c - 1))
7692 v0.AddArg2(x, x)
7693 v.AddArg(v0)
7694 return true
7695 }
7696 break
7697 }
7698
7699
7700
7701 for {
7702 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7703 x := v_0
7704 if v_1.Op != OpARM64MOVDconst {
7705 continue
7706 }
7707 c := auxIntToInt64(v_1.AuxInt)
7708 if !(isPowerOfTwo64(c+1) && c >= 7) {
7709 continue
7710 }
7711 v.reset(OpARM64NEG)
7712 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
7713 v0.AuxInt = int64ToAuxInt(log64(c + 1))
7714 v1 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
7715 v1.AddArg(x)
7716 v0.AddArg2(v1, x)
7717 v.AddArg(v0)
7718 return true
7719 }
7720 break
7721 }
7722
7723
7724
7725 for {
7726 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7727 x := v_0
7728 if v_1.Op != OpARM64MOVDconst {
7729 continue
7730 }
7731 c := auxIntToInt64(v_1.AuxInt)
7732 if !(c%3 == 0 && isPowerOfTwo64(c/3)) {
7733 continue
7734 }
7735 v.reset(OpARM64SLLconst)
7736 v.Type = x.Type
7737 v.AuxInt = int64ToAuxInt(log64(c / 3))
7738 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
7739 v0.AuxInt = int64ToAuxInt(2)
7740 v0.AddArg2(x, x)
7741 v.AddArg(v0)
7742 return true
7743 }
7744 break
7745 }
7746
7747
7748
7749 for {
7750 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7751 x := v_0
7752 if v_1.Op != OpARM64MOVDconst {
7753 continue
7754 }
7755 c := auxIntToInt64(v_1.AuxInt)
7756 if !(c%5 == 0 && isPowerOfTwo64(c/5)) {
7757 continue
7758 }
7759 v.reset(OpARM64NEG)
7760 v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
7761 v0.AuxInt = int64ToAuxInt(log64(c / 5))
7762 v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
7763 v1.AuxInt = int64ToAuxInt(2)
7764 v1.AddArg2(x, x)
7765 v0.AddArg(v1)
7766 v.AddArg(v0)
7767 return true
7768 }
7769 break
7770 }
7771
7772
7773
7774 for {
7775 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7776 x := v_0
7777 if v_1.Op != OpARM64MOVDconst {
7778 continue
7779 }
7780 c := auxIntToInt64(v_1.AuxInt)
7781 if !(c%7 == 0 && isPowerOfTwo64(c/7)) {
7782 continue
7783 }
7784 v.reset(OpARM64SLLconst)
7785 v.Type = x.Type
7786 v.AuxInt = int64ToAuxInt(log64(c / 7))
7787 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
7788 v0.AuxInt = int64ToAuxInt(3)
7789 v0.AddArg2(x, x)
7790 v.AddArg(v0)
7791 return true
7792 }
7793 break
7794 }
7795
7796
7797
7798 for {
7799 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7800 x := v_0
7801 if v_1.Op != OpARM64MOVDconst {
7802 continue
7803 }
7804 c := auxIntToInt64(v_1.AuxInt)
7805 if !(c%9 == 0 && isPowerOfTwo64(c/9)) {
7806 continue
7807 }
7808 v.reset(OpARM64NEG)
7809 v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
7810 v0.AuxInt = int64ToAuxInt(log64(c / 9))
7811 v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
7812 v1.AuxInt = int64ToAuxInt(3)
7813 v1.AddArg2(x, x)
7814 v0.AddArg(v1)
7815 v.AddArg(v0)
7816 return true
7817 }
7818 break
7819 }
7820
7821
7822 for {
7823 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7824 if v_0.Op != OpARM64MOVDconst {
7825 continue
7826 }
7827 c := auxIntToInt64(v_0.AuxInt)
7828 if v_1.Op != OpARM64MOVDconst {
7829 continue
7830 }
7831 d := auxIntToInt64(v_1.AuxInt)
7832 v.reset(OpARM64MOVDconst)
7833 v.AuxInt = int64ToAuxInt(-c * d)
7834 return true
7835 }
7836 break
7837 }
7838 return false
7839 }
7840 func rewriteValueARM64_OpARM64MNEGW(v *Value) bool {
7841 v_1 := v.Args[1]
7842 v_0 := v.Args[0]
7843 b := v.Block
7844
7845
7846
7847 for {
7848 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7849 x := v_0
7850 if v_1.Op != OpARM64MOVDconst {
7851 continue
7852 }
7853 c := auxIntToInt64(v_1.AuxInt)
7854 if !(int32(c) == -1) {
7855 continue
7856 }
7857 v.reset(OpARM64MOVWUreg)
7858 v.AddArg(x)
7859 return true
7860 }
7861 break
7862 }
7863
7864
7865
7866 for {
7867 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7868 if v_1.Op != OpARM64MOVDconst {
7869 continue
7870 }
7871 c := auxIntToInt64(v_1.AuxInt)
7872 if !(int32(c) == 0) {
7873 continue
7874 }
7875 v.reset(OpARM64MOVDconst)
7876 v.AuxInt = int64ToAuxInt(0)
7877 return true
7878 }
7879 break
7880 }
7881
7882
7883
7884 for {
7885 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7886 x := v_0
7887 if v_1.Op != OpARM64MOVDconst {
7888 continue
7889 }
7890 c := auxIntToInt64(v_1.AuxInt)
7891 if !(int32(c) == 1) {
7892 continue
7893 }
7894 v.reset(OpARM64MOVWUreg)
7895 v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
7896 v0.AddArg(x)
7897 v.AddArg(v0)
7898 return true
7899 }
7900 break
7901 }
7902
7903
7904
7905 for {
7906 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7907 x := v_0
7908 if v_1.Op != OpARM64MOVDconst {
7909 continue
7910 }
7911 c := auxIntToInt64(v_1.AuxInt)
7912 if !(isPowerOfTwo64(c)) {
7913 continue
7914 }
7915 v.reset(OpARM64NEG)
7916 v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
7917 v0.AuxInt = int64ToAuxInt(log64(c))
7918 v0.AddArg(x)
7919 v.AddArg(v0)
7920 return true
7921 }
7922 break
7923 }
7924
7925
7926
7927 for {
7928 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7929 x := v_0
7930 if v_1.Op != OpARM64MOVDconst {
7931 continue
7932 }
7933 c := auxIntToInt64(v_1.AuxInt)
7934 if !(isPowerOfTwo64(c-1) && int32(c) >= 3) {
7935 continue
7936 }
7937 v.reset(OpARM64MOVWUreg)
7938 v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
7939 v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
7940 v1.AuxInt = int64ToAuxInt(log64(c - 1))
7941 v1.AddArg2(x, x)
7942 v0.AddArg(v1)
7943 v.AddArg(v0)
7944 return true
7945 }
7946 break
7947 }
7948
7949
7950
7951 for {
7952 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7953 x := v_0
7954 if v_1.Op != OpARM64MOVDconst {
7955 continue
7956 }
7957 c := auxIntToInt64(v_1.AuxInt)
7958 if !(isPowerOfTwo64(c+1) && int32(c) >= 7) {
7959 continue
7960 }
7961 v.reset(OpARM64MOVWUreg)
7962 v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
7963 v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
7964 v1.AuxInt = int64ToAuxInt(log64(c + 1))
7965 v2 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
7966 v2.AddArg(x)
7967 v1.AddArg2(v2, x)
7968 v0.AddArg(v1)
7969 v.AddArg(v0)
7970 return true
7971 }
7972 break
7973 }
7974
7975
7976
7977 for {
7978 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7979 x := v_0
7980 if v_1.Op != OpARM64MOVDconst {
7981 continue
7982 }
7983 c := auxIntToInt64(v_1.AuxInt)
7984 if !(c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c)) {
7985 continue
7986 }
7987 v.reset(OpARM64MOVWUreg)
7988 v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
7989 v0.AuxInt = int64ToAuxInt(log64(c / 3))
7990 v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
7991 v1.AuxInt = int64ToAuxInt(2)
7992 v1.AddArg2(x, x)
7993 v0.AddArg(v1)
7994 v.AddArg(v0)
7995 return true
7996 }
7997 break
7998 }
7999
8000
8001
8002 for {
8003 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8004 x := v_0
8005 if v_1.Op != OpARM64MOVDconst {
8006 continue
8007 }
8008 c := auxIntToInt64(v_1.AuxInt)
8009 if !(c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c)) {
8010 continue
8011 }
8012 v.reset(OpARM64MOVWUreg)
8013 v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
8014 v1 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
8015 v1.AuxInt = int64ToAuxInt(log64(c / 5))
8016 v2 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
8017 v2.AuxInt = int64ToAuxInt(2)
8018 v2.AddArg2(x, x)
8019 v1.AddArg(v2)
8020 v0.AddArg(v1)
8021 v.AddArg(v0)
8022 return true
8023 }
8024 break
8025 }
8026
8027
8028
8029 for {
8030 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8031 x := v_0
8032 if v_1.Op != OpARM64MOVDconst {
8033 continue
8034 }
8035 c := auxIntToInt64(v_1.AuxInt)
8036 if !(c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c)) {
8037 continue
8038 }
8039 v.reset(OpARM64MOVWUreg)
8040 v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
8041 v0.AuxInt = int64ToAuxInt(log64(c / 7))
8042 v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
8043 v1.AuxInt = int64ToAuxInt(3)
8044 v1.AddArg2(x, x)
8045 v0.AddArg(v1)
8046 v.AddArg(v0)
8047 return true
8048 }
8049 break
8050 }
8051
8052
8053
8054 for {
8055 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8056 x := v_0
8057 if v_1.Op != OpARM64MOVDconst {
8058 continue
8059 }
8060 c := auxIntToInt64(v_1.AuxInt)
8061 if !(c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c)) {
8062 continue
8063 }
8064 v.reset(OpARM64MOVWUreg)
8065 v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
8066 v1 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
8067 v1.AuxInt = int64ToAuxInt(log64(c / 9))
8068 v2 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
8069 v2.AuxInt = int64ToAuxInt(3)
8070 v2.AddArg2(x, x)
8071 v1.AddArg(v2)
8072 v0.AddArg(v1)
8073 v.AddArg(v0)
8074 return true
8075 }
8076 break
8077 }
8078
8079
8080 for {
8081 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8082 if v_0.Op != OpARM64MOVDconst {
8083 continue
8084 }
8085 c := auxIntToInt64(v_0.AuxInt)
8086 if v_1.Op != OpARM64MOVDconst {
8087 continue
8088 }
8089 d := auxIntToInt64(v_1.AuxInt)
8090 v.reset(OpARM64MOVDconst)
8091 v.AuxInt = int64ToAuxInt(int64(uint32(-c * d)))
8092 return true
8093 }
8094 break
8095 }
8096 return false
8097 }
8098 func rewriteValueARM64_OpARM64MOD(v *Value) bool {
8099 v_1 := v.Args[1]
8100 v_0 := v.Args[0]
8101
8102
8103
8104 for {
8105 if v_0.Op != OpARM64MOVDconst {
8106 break
8107 }
8108 c := auxIntToInt64(v_0.AuxInt)
8109 if v_1.Op != OpARM64MOVDconst {
8110 break
8111 }
8112 d := auxIntToInt64(v_1.AuxInt)
8113 if !(d != 0) {
8114 break
8115 }
8116 v.reset(OpARM64MOVDconst)
8117 v.AuxInt = int64ToAuxInt(c % d)
8118 return true
8119 }
8120 return false
8121 }
8122 func rewriteValueARM64_OpARM64MODW(v *Value) bool {
8123 v_1 := v.Args[1]
8124 v_0 := v.Args[0]
8125
8126
8127
8128 for {
8129 if v_0.Op != OpARM64MOVDconst {
8130 break
8131 }
8132 c := auxIntToInt64(v_0.AuxInt)
8133 if v_1.Op != OpARM64MOVDconst {
8134 break
8135 }
8136 d := auxIntToInt64(v_1.AuxInt)
8137 if !(d != 0) {
8138 break
8139 }
8140 v.reset(OpARM64MOVDconst)
8141 v.AuxInt = int64ToAuxInt(int64(uint32(int32(c) % int32(d))))
8142 return true
8143 }
8144 return false
8145 }
8146 func rewriteValueARM64_OpARM64MOVBUload(v *Value) bool {
8147 v_1 := v.Args[1]
8148 v_0 := v.Args[0]
8149 b := v.Block
8150 config := b.Func.Config
8151
8152
8153
8154 for {
8155 off1 := auxIntToInt32(v.AuxInt)
8156 sym := auxToSym(v.Aux)
8157 if v_0.Op != OpARM64ADDconst {
8158 break
8159 }
8160 off2 := auxIntToInt64(v_0.AuxInt)
8161 ptr := v_0.Args[0]
8162 mem := v_1
8163 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
8164 break
8165 }
8166 v.reset(OpARM64MOVBUload)
8167 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8168 v.Aux = symToAux(sym)
8169 v.AddArg2(ptr, mem)
8170 return true
8171 }
8172
8173
8174
8175 for {
8176 off := auxIntToInt32(v.AuxInt)
8177 sym := auxToSym(v.Aux)
8178 if v_0.Op != OpARM64ADD {
8179 break
8180 }
8181 idx := v_0.Args[1]
8182 ptr := v_0.Args[0]
8183 mem := v_1
8184 if !(off == 0 && sym == nil) {
8185 break
8186 }
8187 v.reset(OpARM64MOVBUloadidx)
8188 v.AddArg3(ptr, idx, mem)
8189 return true
8190 }
8191
8192
8193
8194 for {
8195 off1 := auxIntToInt32(v.AuxInt)
8196 sym1 := auxToSym(v.Aux)
8197 if v_0.Op != OpARM64MOVDaddr {
8198 break
8199 }
8200 off2 := auxIntToInt32(v_0.AuxInt)
8201 sym2 := auxToSym(v_0.Aux)
8202 ptr := v_0.Args[0]
8203 mem := v_1
8204 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
8205 break
8206 }
8207 v.reset(OpARM64MOVBUload)
8208 v.AuxInt = int32ToAuxInt(off1 + off2)
8209 v.Aux = symToAux(mergeSym(sym1, sym2))
8210 v.AddArg2(ptr, mem)
8211 return true
8212 }
8213
8214
8215
8216 for {
8217 off := auxIntToInt32(v.AuxInt)
8218 sym := auxToSym(v.Aux)
8219 ptr := v_0
8220 if v_1.Op != OpARM64MOVBstorezero {
8221 break
8222 }
8223 off2 := auxIntToInt32(v_1.AuxInt)
8224 sym2 := auxToSym(v_1.Aux)
8225 ptr2 := v_1.Args[0]
8226 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
8227 break
8228 }
8229 v.reset(OpARM64MOVDconst)
8230 v.AuxInt = int64ToAuxInt(0)
8231 return true
8232 }
8233
8234
8235
8236 for {
8237 off := auxIntToInt32(v.AuxInt)
8238 sym := auxToSym(v.Aux)
8239 if v_0.Op != OpSB || !(symIsRO(sym)) {
8240 break
8241 }
8242 v.reset(OpARM64MOVDconst)
8243 v.AuxInt = int64ToAuxInt(int64(read8(sym, int64(off))))
8244 return true
8245 }
8246 return false
8247 }
8248 func rewriteValueARM64_OpARM64MOVBUloadidx(v *Value) bool {
8249 v_2 := v.Args[2]
8250 v_1 := v.Args[1]
8251 v_0 := v.Args[0]
8252
8253
8254
8255 for {
8256 ptr := v_0
8257 if v_1.Op != OpARM64MOVDconst {
8258 break
8259 }
8260 c := auxIntToInt64(v_1.AuxInt)
8261 mem := v_2
8262 if !(is32Bit(c)) {
8263 break
8264 }
8265 v.reset(OpARM64MOVBUload)
8266 v.AuxInt = int32ToAuxInt(int32(c))
8267 v.AddArg2(ptr, mem)
8268 return true
8269 }
8270
8271
8272
8273 for {
8274 if v_0.Op != OpARM64MOVDconst {
8275 break
8276 }
8277 c := auxIntToInt64(v_0.AuxInt)
8278 ptr := v_1
8279 mem := v_2
8280 if !(is32Bit(c)) {
8281 break
8282 }
8283 v.reset(OpARM64MOVBUload)
8284 v.AuxInt = int32ToAuxInt(int32(c))
8285 v.AddArg2(ptr, mem)
8286 return true
8287 }
8288
8289
8290
8291 for {
8292 ptr := v_0
8293 idx := v_1
8294 if v_2.Op != OpARM64MOVBstorezeroidx {
8295 break
8296 }
8297 idx2 := v_2.Args[1]
8298 ptr2 := v_2.Args[0]
8299 if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2) || isSamePtr(ptr, idx2) && isSamePtr(idx, ptr2)) {
8300 break
8301 }
8302 v.reset(OpARM64MOVDconst)
8303 v.AuxInt = int64ToAuxInt(0)
8304 return true
8305 }
8306 return false
8307 }
8308 func rewriteValueARM64_OpARM64MOVBUreg(v *Value) bool {
8309 v_0 := v.Args[0]
8310
8311
8312 for {
8313 if v_0.Op != OpARM64ANDconst {
8314 break
8315 }
8316 c := auxIntToInt64(v_0.AuxInt)
8317 x := v_0.Args[0]
8318 v.reset(OpARM64ANDconst)
8319 v.AuxInt = int64ToAuxInt(c & (1<<8 - 1))
8320 v.AddArg(x)
8321 return true
8322 }
8323
8324
8325 for {
8326 if v_0.Op != OpARM64MOVDconst {
8327 break
8328 }
8329 c := auxIntToInt64(v_0.AuxInt)
8330 v.reset(OpARM64MOVDconst)
8331 v.AuxInt = int64ToAuxInt(int64(uint8(c)))
8332 return true
8333 }
8334
8335
8336
8337 for {
8338 x := v_0
8339 if !(v.Type.Size() <= 1) {
8340 break
8341 }
8342 v.copyOf(x)
8343 return true
8344 }
8345
8346
8347
8348 for {
8349 if v_0.Op != OpARM64SLLconst {
8350 break
8351 }
8352 lc := auxIntToInt64(v_0.AuxInt)
8353 if !(lc >= 8) {
8354 break
8355 }
8356 v.reset(OpARM64MOVDconst)
8357 v.AuxInt = int64ToAuxInt(0)
8358 return true
8359 }
8360
8361
8362
8363 for {
8364 if v_0.Op != OpARM64SLLconst {
8365 break
8366 }
8367 lc := auxIntToInt64(v_0.AuxInt)
8368 x := v_0.Args[0]
8369 if !(lc < 8) {
8370 break
8371 }
8372 v.reset(OpARM64UBFIZ)
8373 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 8-lc))
8374 v.AddArg(x)
8375 return true
8376 }
8377
8378
8379
8380 for {
8381 if v_0.Op != OpARM64SRLconst {
8382 break
8383 }
8384 rc := auxIntToInt64(v_0.AuxInt)
8385 x := v_0.Args[0]
8386 if !(rc < 8) {
8387 break
8388 }
8389 v.reset(OpARM64UBFX)
8390 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 8))
8391 v.AddArg(x)
8392 return true
8393 }
8394
8395
8396
8397 for {
8398 if v_0.Op != OpARM64UBFX {
8399 break
8400 }
8401 bfc := auxIntToArm64BitField(v_0.AuxInt)
8402 x := v_0.Args[0]
8403 if !(bfc.getARM64BFwidth() <= 8) {
8404 break
8405 }
8406 v.reset(OpARM64UBFX)
8407 v.AuxInt = arm64BitFieldToAuxInt(bfc)
8408 v.AddArg(x)
8409 return true
8410 }
8411 return false
8412 }
8413 func rewriteValueARM64_OpARM64MOVBload(v *Value) bool {
8414 v_1 := v.Args[1]
8415 v_0 := v.Args[0]
8416 b := v.Block
8417 config := b.Func.Config
8418
8419
8420
8421 for {
8422 off1 := auxIntToInt32(v.AuxInt)
8423 sym := auxToSym(v.Aux)
8424 if v_0.Op != OpARM64ADDconst {
8425 break
8426 }
8427 off2 := auxIntToInt64(v_0.AuxInt)
8428 ptr := v_0.Args[0]
8429 mem := v_1
8430 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
8431 break
8432 }
8433 v.reset(OpARM64MOVBload)
8434 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8435 v.Aux = symToAux(sym)
8436 v.AddArg2(ptr, mem)
8437 return true
8438 }
8439
8440
8441
8442 for {
8443 off := auxIntToInt32(v.AuxInt)
8444 sym := auxToSym(v.Aux)
8445 if v_0.Op != OpARM64ADD {
8446 break
8447 }
8448 idx := v_0.Args[1]
8449 ptr := v_0.Args[0]
8450 mem := v_1
8451 if !(off == 0 && sym == nil) {
8452 break
8453 }
8454 v.reset(OpARM64MOVBloadidx)
8455 v.AddArg3(ptr, idx, mem)
8456 return true
8457 }
8458
8459
8460
8461 for {
8462 off1 := auxIntToInt32(v.AuxInt)
8463 sym1 := auxToSym(v.Aux)
8464 if v_0.Op != OpARM64MOVDaddr {
8465 break
8466 }
8467 off2 := auxIntToInt32(v_0.AuxInt)
8468 sym2 := auxToSym(v_0.Aux)
8469 ptr := v_0.Args[0]
8470 mem := v_1
8471 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
8472 break
8473 }
8474 v.reset(OpARM64MOVBload)
8475 v.AuxInt = int32ToAuxInt(off1 + off2)
8476 v.Aux = symToAux(mergeSym(sym1, sym2))
8477 v.AddArg2(ptr, mem)
8478 return true
8479 }
8480
8481
8482
8483 for {
8484 off := auxIntToInt32(v.AuxInt)
8485 sym := auxToSym(v.Aux)
8486 ptr := v_0
8487 if v_1.Op != OpARM64MOVBstorezero {
8488 break
8489 }
8490 off2 := auxIntToInt32(v_1.AuxInt)
8491 sym2 := auxToSym(v_1.Aux)
8492 ptr2 := v_1.Args[0]
8493 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
8494 break
8495 }
8496 v.reset(OpARM64MOVDconst)
8497 v.AuxInt = int64ToAuxInt(0)
8498 return true
8499 }
8500 return false
8501 }
8502 func rewriteValueARM64_OpARM64MOVBloadidx(v *Value) bool {
8503 v_2 := v.Args[2]
8504 v_1 := v.Args[1]
8505 v_0 := v.Args[0]
8506
8507
8508
8509 for {
8510 ptr := v_0
8511 if v_1.Op != OpARM64MOVDconst {
8512 break
8513 }
8514 c := auxIntToInt64(v_1.AuxInt)
8515 mem := v_2
8516 if !(is32Bit(c)) {
8517 break
8518 }
8519 v.reset(OpARM64MOVBload)
8520 v.AuxInt = int32ToAuxInt(int32(c))
8521 v.AddArg2(ptr, mem)
8522 return true
8523 }
8524
8525
8526
8527 for {
8528 if v_0.Op != OpARM64MOVDconst {
8529 break
8530 }
8531 c := auxIntToInt64(v_0.AuxInt)
8532 ptr := v_1
8533 mem := v_2
8534 if !(is32Bit(c)) {
8535 break
8536 }
8537 v.reset(OpARM64MOVBload)
8538 v.AuxInt = int32ToAuxInt(int32(c))
8539 v.AddArg2(ptr, mem)
8540 return true
8541 }
8542
8543
8544
8545 for {
8546 ptr := v_0
8547 idx := v_1
8548 if v_2.Op != OpARM64MOVBstorezeroidx {
8549 break
8550 }
8551 idx2 := v_2.Args[1]
8552 ptr2 := v_2.Args[0]
8553 if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2) || isSamePtr(ptr, idx2) && isSamePtr(idx, ptr2)) {
8554 break
8555 }
8556 v.reset(OpARM64MOVDconst)
8557 v.AuxInt = int64ToAuxInt(0)
8558 return true
8559 }
8560 return false
8561 }
8562 func rewriteValueARM64_OpARM64MOVBreg(v *Value) bool {
8563 v_0 := v.Args[0]
8564
8565
8566 for {
8567 if v_0.Op != OpARM64MOVDconst {
8568 break
8569 }
8570 c := auxIntToInt64(v_0.AuxInt)
8571 v.reset(OpARM64MOVDconst)
8572 v.AuxInt = int64ToAuxInt(int64(int8(c)))
8573 return true
8574 }
8575
8576
8577
8578 for {
8579 x := v_0
8580 if !(v.Type.Size() <= 1) {
8581 break
8582 }
8583 v.copyOf(x)
8584 return true
8585 }
8586
8587
8588
8589 for {
8590 t := v.Type
8591 if v_0.Op != OpARM64ANDconst {
8592 break
8593 }
8594 c := auxIntToInt64(v_0.AuxInt)
8595 x := v_0.Args[0]
8596 if !(uint64(c)&uint64(0xffffffffffffff80) == 0) {
8597 break
8598 }
8599 v.reset(OpARM64ANDconst)
8600 v.Type = t
8601 v.AuxInt = int64ToAuxInt(c)
8602 v.AddArg(x)
8603 return true
8604 }
8605
8606
8607
8608 for {
8609 if v_0.Op != OpARM64SLLconst {
8610 break
8611 }
8612 lc := auxIntToInt64(v_0.AuxInt)
8613 x := v_0.Args[0]
8614 if !(lc < 8) {
8615 break
8616 }
8617 v.reset(OpARM64SBFIZ)
8618 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 8-lc))
8619 v.AddArg(x)
8620 return true
8621 }
8622
8623
8624
8625 for {
8626 if v_0.Op != OpARM64SBFX {
8627 break
8628 }
8629 bfc := auxIntToArm64BitField(v_0.AuxInt)
8630 x := v_0.Args[0]
8631 if !(bfc.getARM64BFwidth() <= 8) {
8632 break
8633 }
8634 v.reset(OpARM64SBFX)
8635 v.AuxInt = arm64BitFieldToAuxInt(bfc)
8636 v.AddArg(x)
8637 return true
8638 }
8639 return false
8640 }
8641 func rewriteValueARM64_OpARM64MOVBstore(v *Value) bool {
8642 v_2 := v.Args[2]
8643 v_1 := v.Args[1]
8644 v_0 := v.Args[0]
8645 b := v.Block
8646 config := b.Func.Config
8647
8648
8649
8650 for {
8651 off1 := auxIntToInt32(v.AuxInt)
8652 sym := auxToSym(v.Aux)
8653 if v_0.Op != OpARM64ADDconst {
8654 break
8655 }
8656 off2 := auxIntToInt64(v_0.AuxInt)
8657 ptr := v_0.Args[0]
8658 val := v_1
8659 mem := v_2
8660 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
8661 break
8662 }
8663 v.reset(OpARM64MOVBstore)
8664 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8665 v.Aux = symToAux(sym)
8666 v.AddArg3(ptr, val, mem)
8667 return true
8668 }
8669
8670
8671
8672 for {
8673 off := auxIntToInt32(v.AuxInt)
8674 sym := auxToSym(v.Aux)
8675 if v_0.Op != OpARM64ADD {
8676 break
8677 }
8678 idx := v_0.Args[1]
8679 ptr := v_0.Args[0]
8680 val := v_1
8681 mem := v_2
8682 if !(off == 0 && sym == nil) {
8683 break
8684 }
8685 v.reset(OpARM64MOVBstoreidx)
8686 v.AddArg4(ptr, idx, val, mem)
8687 return true
8688 }
8689
8690
8691
8692 for {
8693 off1 := auxIntToInt32(v.AuxInt)
8694 sym1 := auxToSym(v.Aux)
8695 if v_0.Op != OpARM64MOVDaddr {
8696 break
8697 }
8698 off2 := auxIntToInt32(v_0.AuxInt)
8699 sym2 := auxToSym(v_0.Aux)
8700 ptr := v_0.Args[0]
8701 val := v_1
8702 mem := v_2
8703 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
8704 break
8705 }
8706 v.reset(OpARM64MOVBstore)
8707 v.AuxInt = int32ToAuxInt(off1 + off2)
8708 v.Aux = symToAux(mergeSym(sym1, sym2))
8709 v.AddArg3(ptr, val, mem)
8710 return true
8711 }
8712
8713
8714 for {
8715 off := auxIntToInt32(v.AuxInt)
8716 sym := auxToSym(v.Aux)
8717 ptr := v_0
8718 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
8719 break
8720 }
8721 mem := v_2
8722 v.reset(OpARM64MOVBstorezero)
8723 v.AuxInt = int32ToAuxInt(off)
8724 v.Aux = symToAux(sym)
8725 v.AddArg2(ptr, mem)
8726 return true
8727 }
8728
8729
8730 for {
8731 off := auxIntToInt32(v.AuxInt)
8732 sym := auxToSym(v.Aux)
8733 ptr := v_0
8734 if v_1.Op != OpARM64MOVBreg {
8735 break
8736 }
8737 x := v_1.Args[0]
8738 mem := v_2
8739 v.reset(OpARM64MOVBstore)
8740 v.AuxInt = int32ToAuxInt(off)
8741 v.Aux = symToAux(sym)
8742 v.AddArg3(ptr, x, mem)
8743 return true
8744 }
8745
8746
8747 for {
8748 off := auxIntToInt32(v.AuxInt)
8749 sym := auxToSym(v.Aux)
8750 ptr := v_0
8751 if v_1.Op != OpARM64MOVBUreg {
8752 break
8753 }
8754 x := v_1.Args[0]
8755 mem := v_2
8756 v.reset(OpARM64MOVBstore)
8757 v.AuxInt = int32ToAuxInt(off)
8758 v.Aux = symToAux(sym)
8759 v.AddArg3(ptr, x, mem)
8760 return true
8761 }
8762
8763
8764 for {
8765 off := auxIntToInt32(v.AuxInt)
8766 sym := auxToSym(v.Aux)
8767 ptr := v_0
8768 if v_1.Op != OpARM64MOVHreg {
8769 break
8770 }
8771 x := v_1.Args[0]
8772 mem := v_2
8773 v.reset(OpARM64MOVBstore)
8774 v.AuxInt = int32ToAuxInt(off)
8775 v.Aux = symToAux(sym)
8776 v.AddArg3(ptr, x, mem)
8777 return true
8778 }
8779
8780
8781 for {
8782 off := auxIntToInt32(v.AuxInt)
8783 sym := auxToSym(v.Aux)
8784 ptr := v_0
8785 if v_1.Op != OpARM64MOVHUreg {
8786 break
8787 }
8788 x := v_1.Args[0]
8789 mem := v_2
8790 v.reset(OpARM64MOVBstore)
8791 v.AuxInt = int32ToAuxInt(off)
8792 v.Aux = symToAux(sym)
8793 v.AddArg3(ptr, x, mem)
8794 return true
8795 }
8796
8797
8798 for {
8799 off := auxIntToInt32(v.AuxInt)
8800 sym := auxToSym(v.Aux)
8801 ptr := v_0
8802 if v_1.Op != OpARM64MOVWreg {
8803 break
8804 }
8805 x := v_1.Args[0]
8806 mem := v_2
8807 v.reset(OpARM64MOVBstore)
8808 v.AuxInt = int32ToAuxInt(off)
8809 v.Aux = symToAux(sym)
8810 v.AddArg3(ptr, x, mem)
8811 return true
8812 }
8813
8814
8815 for {
8816 off := auxIntToInt32(v.AuxInt)
8817 sym := auxToSym(v.Aux)
8818 ptr := v_0
8819 if v_1.Op != OpARM64MOVWUreg {
8820 break
8821 }
8822 x := v_1.Args[0]
8823 mem := v_2
8824 v.reset(OpARM64MOVBstore)
8825 v.AuxInt = int32ToAuxInt(off)
8826 v.Aux = symToAux(sym)
8827 v.AddArg3(ptr, x, mem)
8828 return true
8829 }
8830 return false
8831 }
8832 func rewriteValueARM64_OpARM64MOVBstoreidx(v *Value) bool {
8833 v_3 := v.Args[3]
8834 v_2 := v.Args[2]
8835 v_1 := v.Args[1]
8836 v_0 := v.Args[0]
8837
8838
8839
8840 for {
8841 ptr := v_0
8842 if v_1.Op != OpARM64MOVDconst {
8843 break
8844 }
8845 c := auxIntToInt64(v_1.AuxInt)
8846 val := v_2
8847 mem := v_3
8848 if !(is32Bit(c)) {
8849 break
8850 }
8851 v.reset(OpARM64MOVBstore)
8852 v.AuxInt = int32ToAuxInt(int32(c))
8853 v.AddArg3(ptr, val, mem)
8854 return true
8855 }
8856
8857
8858
8859 for {
8860 if v_0.Op != OpARM64MOVDconst {
8861 break
8862 }
8863 c := auxIntToInt64(v_0.AuxInt)
8864 idx := v_1
8865 val := v_2
8866 mem := v_3
8867 if !(is32Bit(c)) {
8868 break
8869 }
8870 v.reset(OpARM64MOVBstore)
8871 v.AuxInt = int32ToAuxInt(int32(c))
8872 v.AddArg3(idx, val, mem)
8873 return true
8874 }
8875
8876
8877 for {
8878 ptr := v_0
8879 idx := v_1
8880 if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
8881 break
8882 }
8883 mem := v_3
8884 v.reset(OpARM64MOVBstorezeroidx)
8885 v.AddArg3(ptr, idx, mem)
8886 return true
8887 }
8888
8889
8890 for {
8891 ptr := v_0
8892 idx := v_1
8893 if v_2.Op != OpARM64MOVBreg {
8894 break
8895 }
8896 x := v_2.Args[0]
8897 mem := v_3
8898 v.reset(OpARM64MOVBstoreidx)
8899 v.AddArg4(ptr, idx, x, mem)
8900 return true
8901 }
8902
8903
8904 for {
8905 ptr := v_0
8906 idx := v_1
8907 if v_2.Op != OpARM64MOVBUreg {
8908 break
8909 }
8910 x := v_2.Args[0]
8911 mem := v_3
8912 v.reset(OpARM64MOVBstoreidx)
8913 v.AddArg4(ptr, idx, x, mem)
8914 return true
8915 }
8916
8917
8918 for {
8919 ptr := v_0
8920 idx := v_1
8921 if v_2.Op != OpARM64MOVHreg {
8922 break
8923 }
8924 x := v_2.Args[0]
8925 mem := v_3
8926 v.reset(OpARM64MOVBstoreidx)
8927 v.AddArg4(ptr, idx, x, mem)
8928 return true
8929 }
8930
8931
8932 for {
8933 ptr := v_0
8934 idx := v_1
8935 if v_2.Op != OpARM64MOVHUreg {
8936 break
8937 }
8938 x := v_2.Args[0]
8939 mem := v_3
8940 v.reset(OpARM64MOVBstoreidx)
8941 v.AddArg4(ptr, idx, x, mem)
8942 return true
8943 }
8944
8945
8946 for {
8947 ptr := v_0
8948 idx := v_1
8949 if v_2.Op != OpARM64MOVWreg {
8950 break
8951 }
8952 x := v_2.Args[0]
8953 mem := v_3
8954 v.reset(OpARM64MOVBstoreidx)
8955 v.AddArg4(ptr, idx, x, mem)
8956 return true
8957 }
8958
8959
8960 for {
8961 ptr := v_0
8962 idx := v_1
8963 if v_2.Op != OpARM64MOVWUreg {
8964 break
8965 }
8966 x := v_2.Args[0]
8967 mem := v_3
8968 v.reset(OpARM64MOVBstoreidx)
8969 v.AddArg4(ptr, idx, x, mem)
8970 return true
8971 }
8972 return false
8973 }
8974 func rewriteValueARM64_OpARM64MOVBstorezero(v *Value) bool {
8975 v_1 := v.Args[1]
8976 v_0 := v.Args[0]
8977 b := v.Block
8978 config := b.Func.Config
8979
8980
8981
8982 for {
8983 off1 := auxIntToInt32(v.AuxInt)
8984 sym := auxToSym(v.Aux)
8985 if v_0.Op != OpARM64ADDconst {
8986 break
8987 }
8988 off2 := auxIntToInt64(v_0.AuxInt)
8989 ptr := v_0.Args[0]
8990 mem := v_1
8991 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
8992 break
8993 }
8994 v.reset(OpARM64MOVBstorezero)
8995 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8996 v.Aux = symToAux(sym)
8997 v.AddArg2(ptr, mem)
8998 return true
8999 }
9000
9001
9002
9003 for {
9004 off1 := auxIntToInt32(v.AuxInt)
9005 sym1 := auxToSym(v.Aux)
9006 if v_0.Op != OpARM64MOVDaddr {
9007 break
9008 }
9009 off2 := auxIntToInt32(v_0.AuxInt)
9010 sym2 := auxToSym(v_0.Aux)
9011 ptr := v_0.Args[0]
9012 mem := v_1
9013 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
9014 break
9015 }
9016 v.reset(OpARM64MOVBstorezero)
9017 v.AuxInt = int32ToAuxInt(off1 + off2)
9018 v.Aux = symToAux(mergeSym(sym1, sym2))
9019 v.AddArg2(ptr, mem)
9020 return true
9021 }
9022
9023
9024
9025 for {
9026 off := auxIntToInt32(v.AuxInt)
9027 sym := auxToSym(v.Aux)
9028 if v_0.Op != OpARM64ADD {
9029 break
9030 }
9031 idx := v_0.Args[1]
9032 ptr := v_0.Args[0]
9033 mem := v_1
9034 if !(off == 0 && sym == nil) {
9035 break
9036 }
9037 v.reset(OpARM64MOVBstorezeroidx)
9038 v.AddArg3(ptr, idx, mem)
9039 return true
9040 }
9041 return false
9042 }
9043 func rewriteValueARM64_OpARM64MOVBstorezeroidx(v *Value) bool {
9044 v_2 := v.Args[2]
9045 v_1 := v.Args[1]
9046 v_0 := v.Args[0]
9047
9048
9049
9050 for {
9051 ptr := v_0
9052 if v_1.Op != OpARM64MOVDconst {
9053 break
9054 }
9055 c := auxIntToInt64(v_1.AuxInt)
9056 mem := v_2
9057 if !(is32Bit(c)) {
9058 break
9059 }
9060 v.reset(OpARM64MOVBstorezero)
9061 v.AuxInt = int32ToAuxInt(int32(c))
9062 v.AddArg2(ptr, mem)
9063 return true
9064 }
9065
9066
9067
9068 for {
9069 if v_0.Op != OpARM64MOVDconst {
9070 break
9071 }
9072 c := auxIntToInt64(v_0.AuxInt)
9073 idx := v_1
9074 mem := v_2
9075 if !(is32Bit(c)) {
9076 break
9077 }
9078 v.reset(OpARM64MOVBstorezero)
9079 v.AuxInt = int32ToAuxInt(int32(c))
9080 v.AddArg2(idx, mem)
9081 return true
9082 }
9083 return false
9084 }
9085 func rewriteValueARM64_OpARM64MOVDload(v *Value) bool {
9086 v_1 := v.Args[1]
9087 v_0 := v.Args[0]
9088 b := v.Block
9089 config := b.Func.Config
9090
9091
9092 for {
9093 off := auxIntToInt32(v.AuxInt)
9094 sym := auxToSym(v.Aux)
9095 ptr := v_0
9096 if v_1.Op != OpARM64FMOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
9097 break
9098 }
9099 val := v_1.Args[1]
9100 if ptr != v_1.Args[0] {
9101 break
9102 }
9103 v.reset(OpARM64FMOVDfpgp)
9104 v.AddArg(val)
9105 return true
9106 }
9107
9108
9109
9110 for {
9111 off1 := auxIntToInt32(v.AuxInt)
9112 sym := auxToSym(v.Aux)
9113 if v_0.Op != OpARM64ADDconst {
9114 break
9115 }
9116 off2 := auxIntToInt64(v_0.AuxInt)
9117 ptr := v_0.Args[0]
9118 mem := v_1
9119 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
9120 break
9121 }
9122 v.reset(OpARM64MOVDload)
9123 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
9124 v.Aux = symToAux(sym)
9125 v.AddArg2(ptr, mem)
9126 return true
9127 }
9128
9129
9130
9131 for {
9132 off := auxIntToInt32(v.AuxInt)
9133 sym := auxToSym(v.Aux)
9134 if v_0.Op != OpARM64ADD {
9135 break
9136 }
9137 idx := v_0.Args[1]
9138 ptr := v_0.Args[0]
9139 mem := v_1
9140 if !(off == 0 && sym == nil) {
9141 break
9142 }
9143 v.reset(OpARM64MOVDloadidx)
9144 v.AddArg3(ptr, idx, mem)
9145 return true
9146 }
9147
9148
9149
9150 for {
9151 off := auxIntToInt32(v.AuxInt)
9152 sym := auxToSym(v.Aux)
9153 if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 3 {
9154 break
9155 }
9156 idx := v_0.Args[1]
9157 ptr := v_0.Args[0]
9158 mem := v_1
9159 if !(off == 0 && sym == nil) {
9160 break
9161 }
9162 v.reset(OpARM64MOVDloadidx8)
9163 v.AddArg3(ptr, idx, mem)
9164 return true
9165 }
9166
9167
9168
9169 for {
9170 off1 := auxIntToInt32(v.AuxInt)
9171 sym1 := auxToSym(v.Aux)
9172 if v_0.Op != OpARM64MOVDaddr {
9173 break
9174 }
9175 off2 := auxIntToInt32(v_0.AuxInt)
9176 sym2 := auxToSym(v_0.Aux)
9177 ptr := v_0.Args[0]
9178 mem := v_1
9179 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
9180 break
9181 }
9182 v.reset(OpARM64MOVDload)
9183 v.AuxInt = int32ToAuxInt(off1 + off2)
9184 v.Aux = symToAux(mergeSym(sym1, sym2))
9185 v.AddArg2(ptr, mem)
9186 return true
9187 }
9188
9189
9190
9191 for {
9192 off := auxIntToInt32(v.AuxInt)
9193 sym := auxToSym(v.Aux)
9194 ptr := v_0
9195 if v_1.Op != OpARM64MOVDstorezero {
9196 break
9197 }
9198 off2 := auxIntToInt32(v_1.AuxInt)
9199 sym2 := auxToSym(v_1.Aux)
9200 ptr2 := v_1.Args[0]
9201 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
9202 break
9203 }
9204 v.reset(OpARM64MOVDconst)
9205 v.AuxInt = int64ToAuxInt(0)
9206 return true
9207 }
9208
9209
9210
9211 for {
9212 off := auxIntToInt32(v.AuxInt)
9213 sym := auxToSym(v.Aux)
9214 if v_0.Op != OpSB || !(symIsRO(sym)) {
9215 break
9216 }
9217 v.reset(OpARM64MOVDconst)
9218 v.AuxInt = int64ToAuxInt(int64(read64(sym, int64(off), config.ctxt.Arch.ByteOrder)))
9219 return true
9220 }
9221 return false
9222 }
9223 func rewriteValueARM64_OpARM64MOVDloadidx(v *Value) bool {
9224 v_2 := v.Args[2]
9225 v_1 := v.Args[1]
9226 v_0 := v.Args[0]
9227
9228
9229
9230 for {
9231 ptr := v_0
9232 if v_1.Op != OpARM64MOVDconst {
9233 break
9234 }
9235 c := auxIntToInt64(v_1.AuxInt)
9236 mem := v_2
9237 if !(is32Bit(c)) {
9238 break
9239 }
9240 v.reset(OpARM64MOVDload)
9241 v.AuxInt = int32ToAuxInt(int32(c))
9242 v.AddArg2(ptr, mem)
9243 return true
9244 }
9245
9246
9247
9248 for {
9249 if v_0.Op != OpARM64MOVDconst {
9250 break
9251 }
9252 c := auxIntToInt64(v_0.AuxInt)
9253 ptr := v_1
9254 mem := v_2
9255 if !(is32Bit(c)) {
9256 break
9257 }
9258 v.reset(OpARM64MOVDload)
9259 v.AuxInt = int32ToAuxInt(int32(c))
9260 v.AddArg2(ptr, mem)
9261 return true
9262 }
9263
9264
9265 for {
9266 ptr := v_0
9267 if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 3 {
9268 break
9269 }
9270 idx := v_1.Args[0]
9271 mem := v_2
9272 v.reset(OpARM64MOVDloadidx8)
9273 v.AddArg3(ptr, idx, mem)
9274 return true
9275 }
9276
9277
9278 for {
9279 if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 3 {
9280 break
9281 }
9282 idx := v_0.Args[0]
9283 ptr := v_1
9284 mem := v_2
9285 v.reset(OpARM64MOVDloadidx8)
9286 v.AddArg3(ptr, idx, mem)
9287 return true
9288 }
9289
9290
9291
9292 for {
9293 ptr := v_0
9294 idx := v_1
9295 if v_2.Op != OpARM64MOVDstorezeroidx {
9296 break
9297 }
9298 idx2 := v_2.Args[1]
9299 ptr2 := v_2.Args[0]
9300 if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2) || isSamePtr(ptr, idx2) && isSamePtr(idx, ptr2)) {
9301 break
9302 }
9303 v.reset(OpARM64MOVDconst)
9304 v.AuxInt = int64ToAuxInt(0)
9305 return true
9306 }
9307 return false
9308 }
9309 func rewriteValueARM64_OpARM64MOVDloadidx8(v *Value) bool {
9310 v_2 := v.Args[2]
9311 v_1 := v.Args[1]
9312 v_0 := v.Args[0]
9313
9314
9315
9316 for {
9317 ptr := v_0
9318 if v_1.Op != OpARM64MOVDconst {
9319 break
9320 }
9321 c := auxIntToInt64(v_1.AuxInt)
9322 mem := v_2
9323 if !(is32Bit(c << 3)) {
9324 break
9325 }
9326 v.reset(OpARM64MOVDload)
9327 v.AuxInt = int32ToAuxInt(int32(c) << 3)
9328 v.AddArg2(ptr, mem)
9329 return true
9330 }
9331
9332
9333
9334 for {
9335 ptr := v_0
9336 idx := v_1
9337 if v_2.Op != OpARM64MOVDstorezeroidx8 {
9338 break
9339 }
9340 idx2 := v_2.Args[1]
9341 ptr2 := v_2.Args[0]
9342 if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2)) {
9343 break
9344 }
9345 v.reset(OpARM64MOVDconst)
9346 v.AuxInt = int64ToAuxInt(0)
9347 return true
9348 }
9349 return false
9350 }
9351 func rewriteValueARM64_OpARM64MOVDnop(v *Value) bool {
9352 v_0 := v.Args[0]
9353
9354
9355 for {
9356 if v_0.Op != OpARM64MOVDconst {
9357 break
9358 }
9359 c := auxIntToInt64(v_0.AuxInt)
9360 v.reset(OpARM64MOVDconst)
9361 v.AuxInt = int64ToAuxInt(c)
9362 return true
9363 }
9364 return false
9365 }
9366 func rewriteValueARM64_OpARM64MOVDreg(v *Value) bool {
9367 v_0 := v.Args[0]
9368
9369
9370
9371 for {
9372 x := v_0
9373 if !(x.Uses == 1) {
9374 break
9375 }
9376 v.reset(OpARM64MOVDnop)
9377 v.AddArg(x)
9378 return true
9379 }
9380
9381
9382 for {
9383 if v_0.Op != OpARM64MOVDconst {
9384 break
9385 }
9386 c := auxIntToInt64(v_0.AuxInt)
9387 v.reset(OpARM64MOVDconst)
9388 v.AuxInt = int64ToAuxInt(c)
9389 return true
9390 }
9391 return false
9392 }
9393 func rewriteValueARM64_OpARM64MOVDstore(v *Value) bool {
9394 v_2 := v.Args[2]
9395 v_1 := v.Args[1]
9396 v_0 := v.Args[0]
9397 b := v.Block
9398 config := b.Func.Config
9399
9400
9401 for {
9402 off := auxIntToInt32(v.AuxInt)
9403 sym := auxToSym(v.Aux)
9404 ptr := v_0
9405 if v_1.Op != OpARM64FMOVDfpgp {
9406 break
9407 }
9408 val := v_1.Args[0]
9409 mem := v_2
9410 v.reset(OpARM64FMOVDstore)
9411 v.AuxInt = int32ToAuxInt(off)
9412 v.Aux = symToAux(sym)
9413 v.AddArg3(ptr, val, mem)
9414 return true
9415 }
9416
9417
9418
9419 for {
9420 off1 := auxIntToInt32(v.AuxInt)
9421 sym := auxToSym(v.Aux)
9422 if v_0.Op != OpARM64ADDconst {
9423 break
9424 }
9425 off2 := auxIntToInt64(v_0.AuxInt)
9426 ptr := v_0.Args[0]
9427 val := v_1
9428 mem := v_2
9429 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
9430 break
9431 }
9432 v.reset(OpARM64MOVDstore)
9433 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
9434 v.Aux = symToAux(sym)
9435 v.AddArg3(ptr, val, mem)
9436 return true
9437 }
9438
9439
9440
9441 for {
9442 off := auxIntToInt32(v.AuxInt)
9443 sym := auxToSym(v.Aux)
9444 if v_0.Op != OpARM64ADD {
9445 break
9446 }
9447 idx := v_0.Args[1]
9448 ptr := v_0.Args[0]
9449 val := v_1
9450 mem := v_2
9451 if !(off == 0 && sym == nil) {
9452 break
9453 }
9454 v.reset(OpARM64MOVDstoreidx)
9455 v.AddArg4(ptr, idx, val, mem)
9456 return true
9457 }
9458
9459
9460
9461 for {
9462 off := auxIntToInt32(v.AuxInt)
9463 sym := auxToSym(v.Aux)
9464 if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 3 {
9465 break
9466 }
9467 idx := v_0.Args[1]
9468 ptr := v_0.Args[0]
9469 val := v_1
9470 mem := v_2
9471 if !(off == 0 && sym == nil) {
9472 break
9473 }
9474 v.reset(OpARM64MOVDstoreidx8)
9475 v.AddArg4(ptr, idx, val, mem)
9476 return true
9477 }
9478
9479
9480
9481 for {
9482 off1 := auxIntToInt32(v.AuxInt)
9483 sym1 := auxToSym(v.Aux)
9484 if v_0.Op != OpARM64MOVDaddr {
9485 break
9486 }
9487 off2 := auxIntToInt32(v_0.AuxInt)
9488 sym2 := auxToSym(v_0.Aux)
9489 ptr := v_0.Args[0]
9490 val := v_1
9491 mem := v_2
9492 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
9493 break
9494 }
9495 v.reset(OpARM64MOVDstore)
9496 v.AuxInt = int32ToAuxInt(off1 + off2)
9497 v.Aux = symToAux(mergeSym(sym1, sym2))
9498 v.AddArg3(ptr, val, mem)
9499 return true
9500 }
9501
9502
9503 for {
9504 off := auxIntToInt32(v.AuxInt)
9505 sym := auxToSym(v.Aux)
9506 ptr := v_0
9507 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
9508 break
9509 }
9510 mem := v_2
9511 v.reset(OpARM64MOVDstorezero)
9512 v.AuxInt = int32ToAuxInt(off)
9513 v.Aux = symToAux(sym)
9514 v.AddArg2(ptr, mem)
9515 return true
9516 }
9517 return false
9518 }
9519 func rewriteValueARM64_OpARM64MOVDstoreidx(v *Value) bool {
9520 v_3 := v.Args[3]
9521 v_2 := v.Args[2]
9522 v_1 := v.Args[1]
9523 v_0 := v.Args[0]
9524
9525
9526
9527 for {
9528 ptr := v_0
9529 if v_1.Op != OpARM64MOVDconst {
9530 break
9531 }
9532 c := auxIntToInt64(v_1.AuxInt)
9533 val := v_2
9534 mem := v_3
9535 if !(is32Bit(c)) {
9536 break
9537 }
9538 v.reset(OpARM64MOVDstore)
9539 v.AuxInt = int32ToAuxInt(int32(c))
9540 v.AddArg3(ptr, val, mem)
9541 return true
9542 }
9543
9544
9545
9546 for {
9547 if v_0.Op != OpARM64MOVDconst {
9548 break
9549 }
9550 c := auxIntToInt64(v_0.AuxInt)
9551 idx := v_1
9552 val := v_2
9553 mem := v_3
9554 if !(is32Bit(c)) {
9555 break
9556 }
9557 v.reset(OpARM64MOVDstore)
9558 v.AuxInt = int32ToAuxInt(int32(c))
9559 v.AddArg3(idx, val, mem)
9560 return true
9561 }
9562
9563
9564 for {
9565 ptr := v_0
9566 if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 3 {
9567 break
9568 }
9569 idx := v_1.Args[0]
9570 val := v_2
9571 mem := v_3
9572 v.reset(OpARM64MOVDstoreidx8)
9573 v.AddArg4(ptr, idx, val, mem)
9574 return true
9575 }
9576
9577
9578 for {
9579 if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 3 {
9580 break
9581 }
9582 idx := v_0.Args[0]
9583 ptr := v_1
9584 val := v_2
9585 mem := v_3
9586 v.reset(OpARM64MOVDstoreidx8)
9587 v.AddArg4(ptr, idx, val, mem)
9588 return true
9589 }
9590
9591
9592 for {
9593 ptr := v_0
9594 idx := v_1
9595 if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
9596 break
9597 }
9598 mem := v_3
9599 v.reset(OpARM64MOVDstorezeroidx)
9600 v.AddArg3(ptr, idx, mem)
9601 return true
9602 }
9603 return false
9604 }
9605 func rewriteValueARM64_OpARM64MOVDstoreidx8(v *Value) bool {
9606 v_3 := v.Args[3]
9607 v_2 := v.Args[2]
9608 v_1 := v.Args[1]
9609 v_0 := v.Args[0]
9610
9611
9612
9613 for {
9614 ptr := v_0
9615 if v_1.Op != OpARM64MOVDconst {
9616 break
9617 }
9618 c := auxIntToInt64(v_1.AuxInt)
9619 val := v_2
9620 mem := v_3
9621 if !(is32Bit(c << 3)) {
9622 break
9623 }
9624 v.reset(OpARM64MOVDstore)
9625 v.AuxInt = int32ToAuxInt(int32(c) << 3)
9626 v.AddArg3(ptr, val, mem)
9627 return true
9628 }
9629
9630
9631 for {
9632 ptr := v_0
9633 idx := v_1
9634 if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
9635 break
9636 }
9637 mem := v_3
9638 v.reset(OpARM64MOVDstorezeroidx8)
9639 v.AddArg3(ptr, idx, mem)
9640 return true
9641 }
9642 return false
9643 }
9644 func rewriteValueARM64_OpARM64MOVDstorezero(v *Value) bool {
9645 v_1 := v.Args[1]
9646 v_0 := v.Args[0]
9647 b := v.Block
9648 config := b.Func.Config
9649
9650
9651
9652 for {
9653 i := auxIntToInt32(v.AuxInt)
9654 s := auxToSym(v.Aux)
9655 ptr := v_0
9656 x := v_1
9657 if x.Op != OpARM64MOVDstorezero || auxIntToInt32(x.AuxInt) != i+8 || auxToSym(x.Aux) != s {
9658 break
9659 }
9660 mem := x.Args[1]
9661 if ptr != x.Args[0] || !(x.Uses == 1 && setPos(v, x.Pos) && clobber(x)) {
9662 break
9663 }
9664 v.reset(OpARM64MOVQstorezero)
9665 v.AuxInt = int32ToAuxInt(i)
9666 v.Aux = symToAux(s)
9667 v.AddArg2(ptr, mem)
9668 return true
9669 }
9670
9671
9672
9673 for {
9674 i := auxIntToInt32(v.AuxInt)
9675 s := auxToSym(v.Aux)
9676 ptr := v_0
9677 x := v_1
9678 if x.Op != OpARM64MOVDstorezero || auxIntToInt32(x.AuxInt) != i-8 || auxToSym(x.Aux) != s {
9679 break
9680 }
9681 mem := x.Args[1]
9682 if ptr != x.Args[0] || !(x.Uses == 1 && setPos(v, x.Pos) && clobber(x)) {
9683 break
9684 }
9685 v.reset(OpARM64MOVQstorezero)
9686 v.AuxInt = int32ToAuxInt(i - 8)
9687 v.Aux = symToAux(s)
9688 v.AddArg2(ptr, mem)
9689 return true
9690 }
9691
9692
9693
9694 for {
9695 off1 := auxIntToInt32(v.AuxInt)
9696 sym := auxToSym(v.Aux)
9697 if v_0.Op != OpARM64ADDconst {
9698 break
9699 }
9700 off2 := auxIntToInt64(v_0.AuxInt)
9701 ptr := v_0.Args[0]
9702 mem := v_1
9703 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
9704 break
9705 }
9706 v.reset(OpARM64MOVDstorezero)
9707 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
9708 v.Aux = symToAux(sym)
9709 v.AddArg2(ptr, mem)
9710 return true
9711 }
9712
9713
9714
9715 for {
9716 off1 := auxIntToInt32(v.AuxInt)
9717 sym1 := auxToSym(v.Aux)
9718 if v_0.Op != OpARM64MOVDaddr {
9719 break
9720 }
9721 off2 := auxIntToInt32(v_0.AuxInt)
9722 sym2 := auxToSym(v_0.Aux)
9723 ptr := v_0.Args[0]
9724 mem := v_1
9725 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
9726 break
9727 }
9728 v.reset(OpARM64MOVDstorezero)
9729 v.AuxInt = int32ToAuxInt(off1 + off2)
9730 v.Aux = symToAux(mergeSym(sym1, sym2))
9731 v.AddArg2(ptr, mem)
9732 return true
9733 }
9734
9735
9736
9737 for {
9738 off := auxIntToInt32(v.AuxInt)
9739 sym := auxToSym(v.Aux)
9740 if v_0.Op != OpARM64ADD {
9741 break
9742 }
9743 idx := v_0.Args[1]
9744 ptr := v_0.Args[0]
9745 mem := v_1
9746 if !(off == 0 && sym == nil) {
9747 break
9748 }
9749 v.reset(OpARM64MOVDstorezeroidx)
9750 v.AddArg3(ptr, idx, mem)
9751 return true
9752 }
9753
9754
9755
9756 for {
9757 off := auxIntToInt32(v.AuxInt)
9758 sym := auxToSym(v.Aux)
9759 if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 3 {
9760 break
9761 }
9762 idx := v_0.Args[1]
9763 ptr := v_0.Args[0]
9764 mem := v_1
9765 if !(off == 0 && sym == nil) {
9766 break
9767 }
9768 v.reset(OpARM64MOVDstorezeroidx8)
9769 v.AddArg3(ptr, idx, mem)
9770 return true
9771 }
9772 return false
9773 }
9774 func rewriteValueARM64_OpARM64MOVDstorezeroidx(v *Value) bool {
9775 v_2 := v.Args[2]
9776 v_1 := v.Args[1]
9777 v_0 := v.Args[0]
9778
9779
9780
9781 for {
9782 ptr := v_0
9783 if v_1.Op != OpARM64MOVDconst {
9784 break
9785 }
9786 c := auxIntToInt64(v_1.AuxInt)
9787 mem := v_2
9788 if !(is32Bit(c)) {
9789 break
9790 }
9791 v.reset(OpARM64MOVDstorezero)
9792 v.AuxInt = int32ToAuxInt(int32(c))
9793 v.AddArg2(ptr, mem)
9794 return true
9795 }
9796
9797
9798
9799 for {
9800 if v_0.Op != OpARM64MOVDconst {
9801 break
9802 }
9803 c := auxIntToInt64(v_0.AuxInt)
9804 idx := v_1
9805 mem := v_2
9806 if !(is32Bit(c)) {
9807 break
9808 }
9809 v.reset(OpARM64MOVDstorezero)
9810 v.AuxInt = int32ToAuxInt(int32(c))
9811 v.AddArg2(idx, mem)
9812 return true
9813 }
9814
9815
9816 for {
9817 ptr := v_0
9818 if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 3 {
9819 break
9820 }
9821 idx := v_1.Args[0]
9822 mem := v_2
9823 v.reset(OpARM64MOVDstorezeroidx8)
9824 v.AddArg3(ptr, idx, mem)
9825 return true
9826 }
9827
9828
9829 for {
9830 if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 3 {
9831 break
9832 }
9833 idx := v_0.Args[0]
9834 ptr := v_1
9835 mem := v_2
9836 v.reset(OpARM64MOVDstorezeroidx8)
9837 v.AddArg3(ptr, idx, mem)
9838 return true
9839 }
9840 return false
9841 }
9842 func rewriteValueARM64_OpARM64MOVDstorezeroidx8(v *Value) bool {
9843 v_2 := v.Args[2]
9844 v_1 := v.Args[1]
9845 v_0 := v.Args[0]
9846
9847
9848
9849 for {
9850 ptr := v_0
9851 if v_1.Op != OpARM64MOVDconst {
9852 break
9853 }
9854 c := auxIntToInt64(v_1.AuxInt)
9855 mem := v_2
9856 if !(is32Bit(c << 3)) {
9857 break
9858 }
9859 v.reset(OpARM64MOVDstorezero)
9860 v.AuxInt = int32ToAuxInt(int32(c << 3))
9861 v.AddArg2(ptr, mem)
9862 return true
9863 }
9864 return false
9865 }
9866 func rewriteValueARM64_OpARM64MOVHUload(v *Value) bool {
9867 v_1 := v.Args[1]
9868 v_0 := v.Args[0]
9869 b := v.Block
9870 config := b.Func.Config
9871
9872
9873
9874 for {
9875 off1 := auxIntToInt32(v.AuxInt)
9876 sym := auxToSym(v.Aux)
9877 if v_0.Op != OpARM64ADDconst {
9878 break
9879 }
9880 off2 := auxIntToInt64(v_0.AuxInt)
9881 ptr := v_0.Args[0]
9882 mem := v_1
9883 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
9884 break
9885 }
9886 v.reset(OpARM64MOVHUload)
9887 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
9888 v.Aux = symToAux(sym)
9889 v.AddArg2(ptr, mem)
9890 return true
9891 }
9892
9893
9894
9895 for {
9896 off := auxIntToInt32(v.AuxInt)
9897 sym := auxToSym(v.Aux)
9898 if v_0.Op != OpARM64ADD {
9899 break
9900 }
9901 idx := v_0.Args[1]
9902 ptr := v_0.Args[0]
9903 mem := v_1
9904 if !(off == 0 && sym == nil) {
9905 break
9906 }
9907 v.reset(OpARM64MOVHUloadidx)
9908 v.AddArg3(ptr, idx, mem)
9909 return true
9910 }
9911
9912
9913
9914 for {
9915 off := auxIntToInt32(v.AuxInt)
9916 sym := auxToSym(v.Aux)
9917 if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 1 {
9918 break
9919 }
9920 idx := v_0.Args[1]
9921 ptr := v_0.Args[0]
9922 mem := v_1
9923 if !(off == 0 && sym == nil) {
9924 break
9925 }
9926 v.reset(OpARM64MOVHUloadidx2)
9927 v.AddArg3(ptr, idx, mem)
9928 return true
9929 }
9930
9931
9932
9933 for {
9934 off1 := auxIntToInt32(v.AuxInt)
9935 sym1 := auxToSym(v.Aux)
9936 if v_0.Op != OpARM64MOVDaddr {
9937 break
9938 }
9939 off2 := auxIntToInt32(v_0.AuxInt)
9940 sym2 := auxToSym(v_0.Aux)
9941 ptr := v_0.Args[0]
9942 mem := v_1
9943 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
9944 break
9945 }
9946 v.reset(OpARM64MOVHUload)
9947 v.AuxInt = int32ToAuxInt(off1 + off2)
9948 v.Aux = symToAux(mergeSym(sym1, sym2))
9949 v.AddArg2(ptr, mem)
9950 return true
9951 }
9952
9953
9954
9955 for {
9956 off := auxIntToInt32(v.AuxInt)
9957 sym := auxToSym(v.Aux)
9958 ptr := v_0
9959 if v_1.Op != OpARM64MOVHstorezero {
9960 break
9961 }
9962 off2 := auxIntToInt32(v_1.AuxInt)
9963 sym2 := auxToSym(v_1.Aux)
9964 ptr2 := v_1.Args[0]
9965 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
9966 break
9967 }
9968 v.reset(OpARM64MOVDconst)
9969 v.AuxInt = int64ToAuxInt(0)
9970 return true
9971 }
9972
9973
9974
9975 for {
9976 off := auxIntToInt32(v.AuxInt)
9977 sym := auxToSym(v.Aux)
9978 if v_0.Op != OpSB || !(symIsRO(sym)) {
9979 break
9980 }
9981 v.reset(OpARM64MOVDconst)
9982 v.AuxInt = int64ToAuxInt(int64(read16(sym, int64(off), config.ctxt.Arch.ByteOrder)))
9983 return true
9984 }
9985 return false
9986 }
9987 func rewriteValueARM64_OpARM64MOVHUloadidx(v *Value) bool {
9988 v_2 := v.Args[2]
9989 v_1 := v.Args[1]
9990 v_0 := v.Args[0]
9991
9992
9993
9994 for {
9995 ptr := v_0
9996 if v_1.Op != OpARM64MOVDconst {
9997 break
9998 }
9999 c := auxIntToInt64(v_1.AuxInt)
10000 mem := v_2
10001 if !(is32Bit(c)) {
10002 break
10003 }
10004 v.reset(OpARM64MOVHUload)
10005 v.AuxInt = int32ToAuxInt(int32(c))
10006 v.AddArg2(ptr, mem)
10007 return true
10008 }
10009
10010
10011
10012 for {
10013 if v_0.Op != OpARM64MOVDconst {
10014 break
10015 }
10016 c := auxIntToInt64(v_0.AuxInt)
10017 ptr := v_1
10018 mem := v_2
10019 if !(is32Bit(c)) {
10020 break
10021 }
10022 v.reset(OpARM64MOVHUload)
10023 v.AuxInt = int32ToAuxInt(int32(c))
10024 v.AddArg2(ptr, mem)
10025 return true
10026 }
10027
10028
10029 for {
10030 ptr := v_0
10031 if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 1 {
10032 break
10033 }
10034 idx := v_1.Args[0]
10035 mem := v_2
10036 v.reset(OpARM64MOVHUloadidx2)
10037 v.AddArg3(ptr, idx, mem)
10038 return true
10039 }
10040
10041
10042 for {
10043 ptr := v_0
10044 if v_1.Op != OpARM64ADD {
10045 break
10046 }
10047 idx := v_1.Args[1]
10048 if idx != v_1.Args[0] {
10049 break
10050 }
10051 mem := v_2
10052 v.reset(OpARM64MOVHUloadidx2)
10053 v.AddArg3(ptr, idx, mem)
10054 return true
10055 }
10056
10057
10058 for {
10059 if v_0.Op != OpARM64ADD {
10060 break
10061 }
10062 idx := v_0.Args[1]
10063 if idx != v_0.Args[0] {
10064 break
10065 }
10066 ptr := v_1
10067 mem := v_2
10068 v.reset(OpARM64MOVHUloadidx2)
10069 v.AddArg3(ptr, idx, mem)
10070 return true
10071 }
10072
10073
10074
10075 for {
10076 ptr := v_0
10077 idx := v_1
10078 if v_2.Op != OpARM64MOVHstorezeroidx {
10079 break
10080 }
10081 idx2 := v_2.Args[1]
10082 ptr2 := v_2.Args[0]
10083 if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2) || isSamePtr(ptr, idx2) && isSamePtr(idx, ptr2)) {
10084 break
10085 }
10086 v.reset(OpARM64MOVDconst)
10087 v.AuxInt = int64ToAuxInt(0)
10088 return true
10089 }
10090 return false
10091 }
10092 func rewriteValueARM64_OpARM64MOVHUloadidx2(v *Value) bool {
10093 v_2 := v.Args[2]
10094 v_1 := v.Args[1]
10095 v_0 := v.Args[0]
10096
10097
10098
10099 for {
10100 ptr := v_0
10101 if v_1.Op != OpARM64MOVDconst {
10102 break
10103 }
10104 c := auxIntToInt64(v_1.AuxInt)
10105 mem := v_2
10106 if !(is32Bit(c << 1)) {
10107 break
10108 }
10109 v.reset(OpARM64MOVHUload)
10110 v.AuxInt = int32ToAuxInt(int32(c) << 1)
10111 v.AddArg2(ptr, mem)
10112 return true
10113 }
10114
10115
10116
10117 for {
10118 ptr := v_0
10119 idx := v_1
10120 if v_2.Op != OpARM64MOVHstorezeroidx2 {
10121 break
10122 }
10123 idx2 := v_2.Args[1]
10124 ptr2 := v_2.Args[0]
10125 if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2)) {
10126 break
10127 }
10128 v.reset(OpARM64MOVDconst)
10129 v.AuxInt = int64ToAuxInt(0)
10130 return true
10131 }
10132 return false
10133 }
10134 func rewriteValueARM64_OpARM64MOVHUreg(v *Value) bool {
10135 v_0 := v.Args[0]
10136
10137
10138 for {
10139 if v_0.Op != OpARM64ANDconst {
10140 break
10141 }
10142 c := auxIntToInt64(v_0.AuxInt)
10143 x := v_0.Args[0]
10144 v.reset(OpARM64ANDconst)
10145 v.AuxInt = int64ToAuxInt(c & (1<<16 - 1))
10146 v.AddArg(x)
10147 return true
10148 }
10149
10150
10151 for {
10152 if v_0.Op != OpARM64MOVDconst {
10153 break
10154 }
10155 c := auxIntToInt64(v_0.AuxInt)
10156 v.reset(OpARM64MOVDconst)
10157 v.AuxInt = int64ToAuxInt(int64(uint16(c)))
10158 return true
10159 }
10160
10161
10162
10163 for {
10164 x := v_0
10165 if !(v.Type.Size() <= 2) {
10166 break
10167 }
10168 v.copyOf(x)
10169 return true
10170 }
10171
10172
10173
10174 for {
10175 if v_0.Op != OpARM64SLLconst {
10176 break
10177 }
10178 lc := auxIntToInt64(v_0.AuxInt)
10179 if !(lc >= 16) {
10180 break
10181 }
10182 v.reset(OpARM64MOVDconst)
10183 v.AuxInt = int64ToAuxInt(0)
10184 return true
10185 }
10186
10187
10188
10189 for {
10190 if v_0.Op != OpARM64SLLconst {
10191 break
10192 }
10193 lc := auxIntToInt64(v_0.AuxInt)
10194 x := v_0.Args[0]
10195 if !(lc < 16) {
10196 break
10197 }
10198 v.reset(OpARM64UBFIZ)
10199 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 16-lc))
10200 v.AddArg(x)
10201 return true
10202 }
10203
10204
10205
10206 for {
10207 if v_0.Op != OpARM64SRLconst {
10208 break
10209 }
10210 rc := auxIntToInt64(v_0.AuxInt)
10211 x := v_0.Args[0]
10212 if !(rc < 16) {
10213 break
10214 }
10215 v.reset(OpARM64UBFX)
10216 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 16))
10217 v.AddArg(x)
10218 return true
10219 }
10220
10221
10222
10223 for {
10224 if v_0.Op != OpARM64UBFX {
10225 break
10226 }
10227 bfc := auxIntToArm64BitField(v_0.AuxInt)
10228 x := v_0.Args[0]
10229 if !(bfc.getARM64BFwidth() <= 16) {
10230 break
10231 }
10232 v.reset(OpARM64UBFX)
10233 v.AuxInt = arm64BitFieldToAuxInt(bfc)
10234 v.AddArg(x)
10235 return true
10236 }
10237 return false
10238 }
10239 func rewriteValueARM64_OpARM64MOVHload(v *Value) bool {
10240 v_1 := v.Args[1]
10241 v_0 := v.Args[0]
10242 b := v.Block
10243 config := b.Func.Config
10244
10245
10246
10247 for {
10248 off1 := auxIntToInt32(v.AuxInt)
10249 sym := auxToSym(v.Aux)
10250 if v_0.Op != OpARM64ADDconst {
10251 break
10252 }
10253 off2 := auxIntToInt64(v_0.AuxInt)
10254 ptr := v_0.Args[0]
10255 mem := v_1
10256 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
10257 break
10258 }
10259 v.reset(OpARM64MOVHload)
10260 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
10261 v.Aux = symToAux(sym)
10262 v.AddArg2(ptr, mem)
10263 return true
10264 }
10265
10266
10267
10268 for {
10269 off := auxIntToInt32(v.AuxInt)
10270 sym := auxToSym(v.Aux)
10271 if v_0.Op != OpARM64ADD {
10272 break
10273 }
10274 idx := v_0.Args[1]
10275 ptr := v_0.Args[0]
10276 mem := v_1
10277 if !(off == 0 && sym == nil) {
10278 break
10279 }
10280 v.reset(OpARM64MOVHloadidx)
10281 v.AddArg3(ptr, idx, mem)
10282 return true
10283 }
10284
10285
10286
10287 for {
10288 off := auxIntToInt32(v.AuxInt)
10289 sym := auxToSym(v.Aux)
10290 if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 1 {
10291 break
10292 }
10293 idx := v_0.Args[1]
10294 ptr := v_0.Args[0]
10295 mem := v_1
10296 if !(off == 0 && sym == nil) {
10297 break
10298 }
10299 v.reset(OpARM64MOVHloadidx2)
10300 v.AddArg3(ptr, idx, mem)
10301 return true
10302 }
10303
10304
10305
10306 for {
10307 off1 := auxIntToInt32(v.AuxInt)
10308 sym1 := auxToSym(v.Aux)
10309 if v_0.Op != OpARM64MOVDaddr {
10310 break
10311 }
10312 off2 := auxIntToInt32(v_0.AuxInt)
10313 sym2 := auxToSym(v_0.Aux)
10314 ptr := v_0.Args[0]
10315 mem := v_1
10316 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
10317 break
10318 }
10319 v.reset(OpARM64MOVHload)
10320 v.AuxInt = int32ToAuxInt(off1 + off2)
10321 v.Aux = symToAux(mergeSym(sym1, sym2))
10322 v.AddArg2(ptr, mem)
10323 return true
10324 }
10325
10326
10327
10328 for {
10329 off := auxIntToInt32(v.AuxInt)
10330 sym := auxToSym(v.Aux)
10331 ptr := v_0
10332 if v_1.Op != OpARM64MOVHstorezero {
10333 break
10334 }
10335 off2 := auxIntToInt32(v_1.AuxInt)
10336 sym2 := auxToSym(v_1.Aux)
10337 ptr2 := v_1.Args[0]
10338 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
10339 break
10340 }
10341 v.reset(OpARM64MOVDconst)
10342 v.AuxInt = int64ToAuxInt(0)
10343 return true
10344 }
10345 return false
10346 }
10347 func rewriteValueARM64_OpARM64MOVHloadidx(v *Value) bool {
10348 v_2 := v.Args[2]
10349 v_1 := v.Args[1]
10350 v_0 := v.Args[0]
10351
10352
10353
10354 for {
10355 ptr := v_0
10356 if v_1.Op != OpARM64MOVDconst {
10357 break
10358 }
10359 c := auxIntToInt64(v_1.AuxInt)
10360 mem := v_2
10361 if !(is32Bit(c)) {
10362 break
10363 }
10364 v.reset(OpARM64MOVHload)
10365 v.AuxInt = int32ToAuxInt(int32(c))
10366 v.AddArg2(ptr, mem)
10367 return true
10368 }
10369
10370
10371
10372 for {
10373 if v_0.Op != OpARM64MOVDconst {
10374 break
10375 }
10376 c := auxIntToInt64(v_0.AuxInt)
10377 ptr := v_1
10378 mem := v_2
10379 if !(is32Bit(c)) {
10380 break
10381 }
10382 v.reset(OpARM64MOVHload)
10383 v.AuxInt = int32ToAuxInt(int32(c))
10384 v.AddArg2(ptr, mem)
10385 return true
10386 }
10387
10388
10389 for {
10390 ptr := v_0
10391 if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 1 {
10392 break
10393 }
10394 idx := v_1.Args[0]
10395 mem := v_2
10396 v.reset(OpARM64MOVHloadidx2)
10397 v.AddArg3(ptr, idx, mem)
10398 return true
10399 }
10400
10401
10402 for {
10403 ptr := v_0
10404 if v_1.Op != OpARM64ADD {
10405 break
10406 }
10407 idx := v_1.Args[1]
10408 if idx != v_1.Args[0] {
10409 break
10410 }
10411 mem := v_2
10412 v.reset(OpARM64MOVHloadidx2)
10413 v.AddArg3(ptr, idx, mem)
10414 return true
10415 }
10416
10417
10418 for {
10419 if v_0.Op != OpARM64ADD {
10420 break
10421 }
10422 idx := v_0.Args[1]
10423 if idx != v_0.Args[0] {
10424 break
10425 }
10426 ptr := v_1
10427 mem := v_2
10428 v.reset(OpARM64MOVHloadidx2)
10429 v.AddArg3(ptr, idx, mem)
10430 return true
10431 }
10432
10433
10434
10435 for {
10436 ptr := v_0
10437 idx := v_1
10438 if v_2.Op != OpARM64MOVHstorezeroidx {
10439 break
10440 }
10441 idx2 := v_2.Args[1]
10442 ptr2 := v_2.Args[0]
10443 if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2) || isSamePtr(ptr, idx2) && isSamePtr(idx, ptr2)) {
10444 break
10445 }
10446 v.reset(OpARM64MOVDconst)
10447 v.AuxInt = int64ToAuxInt(0)
10448 return true
10449 }
10450 return false
10451 }
10452 func rewriteValueARM64_OpARM64MOVHloadidx2(v *Value) bool {
10453 v_2 := v.Args[2]
10454 v_1 := v.Args[1]
10455 v_0 := v.Args[0]
10456
10457
10458
10459 for {
10460 ptr := v_0
10461 if v_1.Op != OpARM64MOVDconst {
10462 break
10463 }
10464 c := auxIntToInt64(v_1.AuxInt)
10465 mem := v_2
10466 if !(is32Bit(c << 1)) {
10467 break
10468 }
10469 v.reset(OpARM64MOVHload)
10470 v.AuxInt = int32ToAuxInt(int32(c) << 1)
10471 v.AddArg2(ptr, mem)
10472 return true
10473 }
10474
10475
10476
10477 for {
10478 ptr := v_0
10479 idx := v_1
10480 if v_2.Op != OpARM64MOVHstorezeroidx2 {
10481 break
10482 }
10483 idx2 := v_2.Args[1]
10484 ptr2 := v_2.Args[0]
10485 if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2)) {
10486 break
10487 }
10488 v.reset(OpARM64MOVDconst)
10489 v.AuxInt = int64ToAuxInt(0)
10490 return true
10491 }
10492 return false
10493 }
10494 func rewriteValueARM64_OpARM64MOVHreg(v *Value) bool {
10495 v_0 := v.Args[0]
10496
10497
10498 for {
10499 if v_0.Op != OpARM64MOVDconst {
10500 break
10501 }
10502 c := auxIntToInt64(v_0.AuxInt)
10503 v.reset(OpARM64MOVDconst)
10504 v.AuxInt = int64ToAuxInt(int64(int16(c)))
10505 return true
10506 }
10507
10508
10509
10510 for {
10511 x := v_0
10512 if !(v.Type.Size() <= 2) {
10513 break
10514 }
10515 v.copyOf(x)
10516 return true
10517 }
10518
10519
10520
10521 for {
10522 t := v.Type
10523 if v_0.Op != OpARM64ANDconst {
10524 break
10525 }
10526 c := auxIntToInt64(v_0.AuxInt)
10527 x := v_0.Args[0]
10528 if !(uint64(c)&uint64(0xffffffffffff8000) == 0) {
10529 break
10530 }
10531 v.reset(OpARM64ANDconst)
10532 v.Type = t
10533 v.AuxInt = int64ToAuxInt(c)
10534 v.AddArg(x)
10535 return true
10536 }
10537
10538
10539
10540 for {
10541 if v_0.Op != OpARM64SLLconst {
10542 break
10543 }
10544 lc := auxIntToInt64(v_0.AuxInt)
10545 x := v_0.Args[0]
10546 if !(lc < 16) {
10547 break
10548 }
10549 v.reset(OpARM64SBFIZ)
10550 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 16-lc))
10551 v.AddArg(x)
10552 return true
10553 }
10554
10555
10556
10557 for {
10558 if v_0.Op != OpARM64SBFX {
10559 break
10560 }
10561 bfc := auxIntToArm64BitField(v_0.AuxInt)
10562 x := v_0.Args[0]
10563 if !(bfc.getARM64BFwidth() <= 16) {
10564 break
10565 }
10566 v.reset(OpARM64SBFX)
10567 v.AuxInt = arm64BitFieldToAuxInt(bfc)
10568 v.AddArg(x)
10569 return true
10570 }
10571 return false
10572 }
10573 func rewriteValueARM64_OpARM64MOVHstore(v *Value) bool {
10574 v_2 := v.Args[2]
10575 v_1 := v.Args[1]
10576 v_0 := v.Args[0]
10577 b := v.Block
10578 config := b.Func.Config
10579
10580
10581
10582 for {
10583 off1 := auxIntToInt32(v.AuxInt)
10584 sym := auxToSym(v.Aux)
10585 if v_0.Op != OpARM64ADDconst {
10586 break
10587 }
10588 off2 := auxIntToInt64(v_0.AuxInt)
10589 ptr := v_0.Args[0]
10590 val := v_1
10591 mem := v_2
10592 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
10593 break
10594 }
10595 v.reset(OpARM64MOVHstore)
10596 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
10597 v.Aux = symToAux(sym)
10598 v.AddArg3(ptr, val, mem)
10599 return true
10600 }
10601
10602
10603
10604 for {
10605 off := auxIntToInt32(v.AuxInt)
10606 sym := auxToSym(v.Aux)
10607 if v_0.Op != OpARM64ADD {
10608 break
10609 }
10610 idx := v_0.Args[1]
10611 ptr := v_0.Args[0]
10612 val := v_1
10613 mem := v_2
10614 if !(off == 0 && sym == nil) {
10615 break
10616 }
10617 v.reset(OpARM64MOVHstoreidx)
10618 v.AddArg4(ptr, idx, val, mem)
10619 return true
10620 }
10621
10622
10623
10624 for {
10625 off := auxIntToInt32(v.AuxInt)
10626 sym := auxToSym(v.Aux)
10627 if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 1 {
10628 break
10629 }
10630 idx := v_0.Args[1]
10631 ptr := v_0.Args[0]
10632 val := v_1
10633 mem := v_2
10634 if !(off == 0 && sym == nil) {
10635 break
10636 }
10637 v.reset(OpARM64MOVHstoreidx2)
10638 v.AddArg4(ptr, idx, val, mem)
10639 return true
10640 }
10641
10642
10643
10644 for {
10645 off1 := auxIntToInt32(v.AuxInt)
10646 sym1 := auxToSym(v.Aux)
10647 if v_0.Op != OpARM64MOVDaddr {
10648 break
10649 }
10650 off2 := auxIntToInt32(v_0.AuxInt)
10651 sym2 := auxToSym(v_0.Aux)
10652 ptr := v_0.Args[0]
10653 val := v_1
10654 mem := v_2
10655 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
10656 break
10657 }
10658 v.reset(OpARM64MOVHstore)
10659 v.AuxInt = int32ToAuxInt(off1 + off2)
10660 v.Aux = symToAux(mergeSym(sym1, sym2))
10661 v.AddArg3(ptr, val, mem)
10662 return true
10663 }
10664
10665
10666 for {
10667 off := auxIntToInt32(v.AuxInt)
10668 sym := auxToSym(v.Aux)
10669 ptr := v_0
10670 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
10671 break
10672 }
10673 mem := v_2
10674 v.reset(OpARM64MOVHstorezero)
10675 v.AuxInt = int32ToAuxInt(off)
10676 v.Aux = symToAux(sym)
10677 v.AddArg2(ptr, mem)
10678 return true
10679 }
10680
10681
10682 for {
10683 off := auxIntToInt32(v.AuxInt)
10684 sym := auxToSym(v.Aux)
10685 ptr := v_0
10686 if v_1.Op != OpARM64MOVHreg {
10687 break
10688 }
10689 x := v_1.Args[0]
10690 mem := v_2
10691 v.reset(OpARM64MOVHstore)
10692 v.AuxInt = int32ToAuxInt(off)
10693 v.Aux = symToAux(sym)
10694 v.AddArg3(ptr, x, mem)
10695 return true
10696 }
10697
10698
10699 for {
10700 off := auxIntToInt32(v.AuxInt)
10701 sym := auxToSym(v.Aux)
10702 ptr := v_0
10703 if v_1.Op != OpARM64MOVHUreg {
10704 break
10705 }
10706 x := v_1.Args[0]
10707 mem := v_2
10708 v.reset(OpARM64MOVHstore)
10709 v.AuxInt = int32ToAuxInt(off)
10710 v.Aux = symToAux(sym)
10711 v.AddArg3(ptr, x, mem)
10712 return true
10713 }
10714
10715
10716 for {
10717 off := auxIntToInt32(v.AuxInt)
10718 sym := auxToSym(v.Aux)
10719 ptr := v_0
10720 if v_1.Op != OpARM64MOVWreg {
10721 break
10722 }
10723 x := v_1.Args[0]
10724 mem := v_2
10725 v.reset(OpARM64MOVHstore)
10726 v.AuxInt = int32ToAuxInt(off)
10727 v.Aux = symToAux(sym)
10728 v.AddArg3(ptr, x, mem)
10729 return true
10730 }
10731
10732
10733 for {
10734 off := auxIntToInt32(v.AuxInt)
10735 sym := auxToSym(v.Aux)
10736 ptr := v_0
10737 if v_1.Op != OpARM64MOVWUreg {
10738 break
10739 }
10740 x := v_1.Args[0]
10741 mem := v_2
10742 v.reset(OpARM64MOVHstore)
10743 v.AuxInt = int32ToAuxInt(off)
10744 v.Aux = symToAux(sym)
10745 v.AddArg3(ptr, x, mem)
10746 return true
10747 }
10748 return false
10749 }
10750 func rewriteValueARM64_OpARM64MOVHstoreidx(v *Value) bool {
10751 v_3 := v.Args[3]
10752 v_2 := v.Args[2]
10753 v_1 := v.Args[1]
10754 v_0 := v.Args[0]
10755
10756
10757
10758 for {
10759 ptr := v_0
10760 if v_1.Op != OpARM64MOVDconst {
10761 break
10762 }
10763 c := auxIntToInt64(v_1.AuxInt)
10764 val := v_2
10765 mem := v_3
10766 if !(is32Bit(c)) {
10767 break
10768 }
10769 v.reset(OpARM64MOVHstore)
10770 v.AuxInt = int32ToAuxInt(int32(c))
10771 v.AddArg3(ptr, val, mem)
10772 return true
10773 }
10774
10775
10776
10777 for {
10778 if v_0.Op != OpARM64MOVDconst {
10779 break
10780 }
10781 c := auxIntToInt64(v_0.AuxInt)
10782 idx := v_1
10783 val := v_2
10784 mem := v_3
10785 if !(is32Bit(c)) {
10786 break
10787 }
10788 v.reset(OpARM64MOVHstore)
10789 v.AuxInt = int32ToAuxInt(int32(c))
10790 v.AddArg3(idx, val, mem)
10791 return true
10792 }
10793
10794
10795 for {
10796 ptr := v_0
10797 if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 1 {
10798 break
10799 }
10800 idx := v_1.Args[0]
10801 val := v_2
10802 mem := v_3
10803 v.reset(OpARM64MOVHstoreidx2)
10804 v.AddArg4(ptr, idx, val, mem)
10805 return true
10806 }
10807
10808
10809 for {
10810 ptr := v_0
10811 if v_1.Op != OpARM64ADD {
10812 break
10813 }
10814 idx := v_1.Args[1]
10815 if idx != v_1.Args[0] {
10816 break
10817 }
10818 val := v_2
10819 mem := v_3
10820 v.reset(OpARM64MOVHstoreidx2)
10821 v.AddArg4(ptr, idx, val, mem)
10822 return true
10823 }
10824
10825
10826 for {
10827 if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 1 {
10828 break
10829 }
10830 idx := v_0.Args[0]
10831 ptr := v_1
10832 val := v_2
10833 mem := v_3
10834 v.reset(OpARM64MOVHstoreidx2)
10835 v.AddArg4(ptr, idx, val, mem)
10836 return true
10837 }
10838
10839
10840 for {
10841 if v_0.Op != OpARM64ADD {
10842 break
10843 }
10844 idx := v_0.Args[1]
10845 if idx != v_0.Args[0] {
10846 break
10847 }
10848 ptr := v_1
10849 val := v_2
10850 mem := v_3
10851 v.reset(OpARM64MOVHstoreidx2)
10852 v.AddArg4(ptr, idx, val, mem)
10853 return true
10854 }
10855
10856
10857 for {
10858 ptr := v_0
10859 idx := v_1
10860 if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
10861 break
10862 }
10863 mem := v_3
10864 v.reset(OpARM64MOVHstorezeroidx)
10865 v.AddArg3(ptr, idx, mem)
10866 return true
10867 }
10868
10869
10870 for {
10871 ptr := v_0
10872 idx := v_1
10873 if v_2.Op != OpARM64MOVHreg {
10874 break
10875 }
10876 x := v_2.Args[0]
10877 mem := v_3
10878 v.reset(OpARM64MOVHstoreidx)
10879 v.AddArg4(ptr, idx, x, mem)
10880 return true
10881 }
10882
10883
10884 for {
10885 ptr := v_0
10886 idx := v_1
10887 if v_2.Op != OpARM64MOVHUreg {
10888 break
10889 }
10890 x := v_2.Args[0]
10891 mem := v_3
10892 v.reset(OpARM64MOVHstoreidx)
10893 v.AddArg4(ptr, idx, x, mem)
10894 return true
10895 }
10896
10897
10898 for {
10899 ptr := v_0
10900 idx := v_1
10901 if v_2.Op != OpARM64MOVWreg {
10902 break
10903 }
10904 x := v_2.Args[0]
10905 mem := v_3
10906 v.reset(OpARM64MOVHstoreidx)
10907 v.AddArg4(ptr, idx, x, mem)
10908 return true
10909 }
10910
10911
10912 for {
10913 ptr := v_0
10914 idx := v_1
10915 if v_2.Op != OpARM64MOVWUreg {
10916 break
10917 }
10918 x := v_2.Args[0]
10919 mem := v_3
10920 v.reset(OpARM64MOVHstoreidx)
10921 v.AddArg4(ptr, idx, x, mem)
10922 return true
10923 }
10924 return false
10925 }
10926 func rewriteValueARM64_OpARM64MOVHstoreidx2(v *Value) bool {
10927 v_3 := v.Args[3]
10928 v_2 := v.Args[2]
10929 v_1 := v.Args[1]
10930 v_0 := v.Args[0]
10931
10932
10933
10934 for {
10935 ptr := v_0
10936 if v_1.Op != OpARM64MOVDconst {
10937 break
10938 }
10939 c := auxIntToInt64(v_1.AuxInt)
10940 val := v_2
10941 mem := v_3
10942 if !(is32Bit(c << 1)) {
10943 break
10944 }
10945 v.reset(OpARM64MOVHstore)
10946 v.AuxInt = int32ToAuxInt(int32(c) << 1)
10947 v.AddArg3(ptr, val, mem)
10948 return true
10949 }
10950
10951
10952 for {
10953 ptr := v_0
10954 idx := v_1
10955 if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
10956 break
10957 }
10958 mem := v_3
10959 v.reset(OpARM64MOVHstorezeroidx2)
10960 v.AddArg3(ptr, idx, mem)
10961 return true
10962 }
10963
10964
10965 for {
10966 ptr := v_0
10967 idx := v_1
10968 if v_2.Op != OpARM64MOVHreg {
10969 break
10970 }
10971 x := v_2.Args[0]
10972 mem := v_3
10973 v.reset(OpARM64MOVHstoreidx2)
10974 v.AddArg4(ptr, idx, x, mem)
10975 return true
10976 }
10977
10978
10979 for {
10980 ptr := v_0
10981 idx := v_1
10982 if v_2.Op != OpARM64MOVHUreg {
10983 break
10984 }
10985 x := v_2.Args[0]
10986 mem := v_3
10987 v.reset(OpARM64MOVHstoreidx2)
10988 v.AddArg4(ptr, idx, x, mem)
10989 return true
10990 }
10991
10992
10993 for {
10994 ptr := v_0
10995 idx := v_1
10996 if v_2.Op != OpARM64MOVWreg {
10997 break
10998 }
10999 x := v_2.Args[0]
11000 mem := v_3
11001 v.reset(OpARM64MOVHstoreidx2)
11002 v.AddArg4(ptr, idx, x, mem)
11003 return true
11004 }
11005
11006
11007 for {
11008 ptr := v_0
11009 idx := v_1
11010 if v_2.Op != OpARM64MOVWUreg {
11011 break
11012 }
11013 x := v_2.Args[0]
11014 mem := v_3
11015 v.reset(OpARM64MOVHstoreidx2)
11016 v.AddArg4(ptr, idx, x, mem)
11017 return true
11018 }
11019 return false
11020 }
11021 func rewriteValueARM64_OpARM64MOVHstorezero(v *Value) bool {
11022 v_1 := v.Args[1]
11023 v_0 := v.Args[0]
11024 b := v.Block
11025 config := b.Func.Config
11026
11027
11028
11029 for {
11030 off1 := auxIntToInt32(v.AuxInt)
11031 sym := auxToSym(v.Aux)
11032 if v_0.Op != OpARM64ADDconst {
11033 break
11034 }
11035 off2 := auxIntToInt64(v_0.AuxInt)
11036 ptr := v_0.Args[0]
11037 mem := v_1
11038 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
11039 break
11040 }
11041 v.reset(OpARM64MOVHstorezero)
11042 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
11043 v.Aux = symToAux(sym)
11044 v.AddArg2(ptr, mem)
11045 return true
11046 }
11047
11048
11049
11050 for {
11051 off1 := auxIntToInt32(v.AuxInt)
11052 sym1 := auxToSym(v.Aux)
11053 if v_0.Op != OpARM64MOVDaddr {
11054 break
11055 }
11056 off2 := auxIntToInt32(v_0.AuxInt)
11057 sym2 := auxToSym(v_0.Aux)
11058 ptr := v_0.Args[0]
11059 mem := v_1
11060 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
11061 break
11062 }
11063 v.reset(OpARM64MOVHstorezero)
11064 v.AuxInt = int32ToAuxInt(off1 + off2)
11065 v.Aux = symToAux(mergeSym(sym1, sym2))
11066 v.AddArg2(ptr, mem)
11067 return true
11068 }
11069
11070
11071
11072 for {
11073 off := auxIntToInt32(v.AuxInt)
11074 sym := auxToSym(v.Aux)
11075 if v_0.Op != OpARM64ADD {
11076 break
11077 }
11078 idx := v_0.Args[1]
11079 ptr := v_0.Args[0]
11080 mem := v_1
11081 if !(off == 0 && sym == nil) {
11082 break
11083 }
11084 v.reset(OpARM64MOVHstorezeroidx)
11085 v.AddArg3(ptr, idx, mem)
11086 return true
11087 }
11088
11089
11090
11091 for {
11092 off := auxIntToInt32(v.AuxInt)
11093 sym := auxToSym(v.Aux)
11094 if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 1 {
11095 break
11096 }
11097 idx := v_0.Args[1]
11098 ptr := v_0.Args[0]
11099 mem := v_1
11100 if !(off == 0 && sym == nil) {
11101 break
11102 }
11103 v.reset(OpARM64MOVHstorezeroidx2)
11104 v.AddArg3(ptr, idx, mem)
11105 return true
11106 }
11107 return false
11108 }
11109 func rewriteValueARM64_OpARM64MOVHstorezeroidx(v *Value) bool {
11110 v_2 := v.Args[2]
11111 v_1 := v.Args[1]
11112 v_0 := v.Args[0]
11113
11114
11115
11116 for {
11117 ptr := v_0
11118 if v_1.Op != OpARM64MOVDconst {
11119 break
11120 }
11121 c := auxIntToInt64(v_1.AuxInt)
11122 mem := v_2
11123 if !(is32Bit(c)) {
11124 break
11125 }
11126 v.reset(OpARM64MOVHstorezero)
11127 v.AuxInt = int32ToAuxInt(int32(c))
11128 v.AddArg2(ptr, mem)
11129 return true
11130 }
11131
11132
11133
11134 for {
11135 if v_0.Op != OpARM64MOVDconst {
11136 break
11137 }
11138 c := auxIntToInt64(v_0.AuxInt)
11139 idx := v_1
11140 mem := v_2
11141 if !(is32Bit(c)) {
11142 break
11143 }
11144 v.reset(OpARM64MOVHstorezero)
11145 v.AuxInt = int32ToAuxInt(int32(c))
11146 v.AddArg2(idx, mem)
11147 return true
11148 }
11149
11150
11151 for {
11152 ptr := v_0
11153 if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 1 {
11154 break
11155 }
11156 idx := v_1.Args[0]
11157 mem := v_2
11158 v.reset(OpARM64MOVHstorezeroidx2)
11159 v.AddArg3(ptr, idx, mem)
11160 return true
11161 }
11162
11163
11164 for {
11165 ptr := v_0
11166 if v_1.Op != OpARM64ADD {
11167 break
11168 }
11169 idx := v_1.Args[1]
11170 if idx != v_1.Args[0] {
11171 break
11172 }
11173 mem := v_2
11174 v.reset(OpARM64MOVHstorezeroidx2)
11175 v.AddArg3(ptr, idx, mem)
11176 return true
11177 }
11178
11179
11180 for {
11181 if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 1 {
11182 break
11183 }
11184 idx := v_0.Args[0]
11185 ptr := v_1
11186 mem := v_2
11187 v.reset(OpARM64MOVHstorezeroidx2)
11188 v.AddArg3(ptr, idx, mem)
11189 return true
11190 }
11191
11192
11193 for {
11194 if v_0.Op != OpARM64ADD {
11195 break
11196 }
11197 idx := v_0.Args[1]
11198 if idx != v_0.Args[0] {
11199 break
11200 }
11201 ptr := v_1
11202 mem := v_2
11203 v.reset(OpARM64MOVHstorezeroidx2)
11204 v.AddArg3(ptr, idx, mem)
11205 return true
11206 }
11207 return false
11208 }
11209 func rewriteValueARM64_OpARM64MOVHstorezeroidx2(v *Value) bool {
11210 v_2 := v.Args[2]
11211 v_1 := v.Args[1]
11212 v_0 := v.Args[0]
11213
11214
11215
11216 for {
11217 ptr := v_0
11218 if v_1.Op != OpARM64MOVDconst {
11219 break
11220 }
11221 c := auxIntToInt64(v_1.AuxInt)
11222 mem := v_2
11223 if !(is32Bit(c << 1)) {
11224 break
11225 }
11226 v.reset(OpARM64MOVHstorezero)
11227 v.AuxInt = int32ToAuxInt(int32(c << 1))
11228 v.AddArg2(ptr, mem)
11229 return true
11230 }
11231 return false
11232 }
11233 func rewriteValueARM64_OpARM64MOVQstorezero(v *Value) bool {
11234 v_1 := v.Args[1]
11235 v_0 := v.Args[0]
11236 b := v.Block
11237 config := b.Func.Config
11238
11239
11240
11241 for {
11242 off1 := auxIntToInt32(v.AuxInt)
11243 sym := auxToSym(v.Aux)
11244 if v_0.Op != OpARM64ADDconst {
11245 break
11246 }
11247 off2 := auxIntToInt64(v_0.AuxInt)
11248 ptr := v_0.Args[0]
11249 mem := v_1
11250 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
11251 break
11252 }
11253 v.reset(OpARM64MOVQstorezero)
11254 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
11255 v.Aux = symToAux(sym)
11256 v.AddArg2(ptr, mem)
11257 return true
11258 }
11259
11260
11261
11262 for {
11263 off1 := auxIntToInt32(v.AuxInt)
11264 sym1 := auxToSym(v.Aux)
11265 if v_0.Op != OpARM64MOVDaddr {
11266 break
11267 }
11268 off2 := auxIntToInt32(v_0.AuxInt)
11269 sym2 := auxToSym(v_0.Aux)
11270 ptr := v_0.Args[0]
11271 mem := v_1
11272 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
11273 break
11274 }
11275 v.reset(OpARM64MOVQstorezero)
11276 v.AuxInt = int32ToAuxInt(off1 + off2)
11277 v.Aux = symToAux(mergeSym(sym1, sym2))
11278 v.AddArg2(ptr, mem)
11279 return true
11280 }
11281 return false
11282 }
11283 func rewriteValueARM64_OpARM64MOVWUload(v *Value) bool {
11284 v_1 := v.Args[1]
11285 v_0 := v.Args[0]
11286 b := v.Block
11287 config := b.Func.Config
11288
11289
11290 for {
11291 off := auxIntToInt32(v.AuxInt)
11292 sym := auxToSym(v.Aux)
11293 ptr := v_0
11294 if v_1.Op != OpARM64FMOVSstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
11295 break
11296 }
11297 val := v_1.Args[1]
11298 if ptr != v_1.Args[0] {
11299 break
11300 }
11301 v.reset(OpARM64FMOVSfpgp)
11302 v.AddArg(val)
11303 return true
11304 }
11305
11306
11307
11308 for {
11309 off1 := auxIntToInt32(v.AuxInt)
11310 sym := auxToSym(v.Aux)
11311 if v_0.Op != OpARM64ADDconst {
11312 break
11313 }
11314 off2 := auxIntToInt64(v_0.AuxInt)
11315 ptr := v_0.Args[0]
11316 mem := v_1
11317 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
11318 break
11319 }
11320 v.reset(OpARM64MOVWUload)
11321 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
11322 v.Aux = symToAux(sym)
11323 v.AddArg2(ptr, mem)
11324 return true
11325 }
11326
11327
11328
11329 for {
11330 off := auxIntToInt32(v.AuxInt)
11331 sym := auxToSym(v.Aux)
11332 if v_0.Op != OpARM64ADD {
11333 break
11334 }
11335 idx := v_0.Args[1]
11336 ptr := v_0.Args[0]
11337 mem := v_1
11338 if !(off == 0 && sym == nil) {
11339 break
11340 }
11341 v.reset(OpARM64MOVWUloadidx)
11342 v.AddArg3(ptr, idx, mem)
11343 return true
11344 }
11345
11346
11347
11348 for {
11349 off := auxIntToInt32(v.AuxInt)
11350 sym := auxToSym(v.Aux)
11351 if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
11352 break
11353 }
11354 idx := v_0.Args[1]
11355 ptr := v_0.Args[0]
11356 mem := v_1
11357 if !(off == 0 && sym == nil) {
11358 break
11359 }
11360 v.reset(OpARM64MOVWUloadidx4)
11361 v.AddArg3(ptr, idx, mem)
11362 return true
11363 }
11364
11365
11366
11367 for {
11368 off1 := auxIntToInt32(v.AuxInt)
11369 sym1 := auxToSym(v.Aux)
11370 if v_0.Op != OpARM64MOVDaddr {
11371 break
11372 }
11373 off2 := auxIntToInt32(v_0.AuxInt)
11374 sym2 := auxToSym(v_0.Aux)
11375 ptr := v_0.Args[0]
11376 mem := v_1
11377 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
11378 break
11379 }
11380 v.reset(OpARM64MOVWUload)
11381 v.AuxInt = int32ToAuxInt(off1 + off2)
11382 v.Aux = symToAux(mergeSym(sym1, sym2))
11383 v.AddArg2(ptr, mem)
11384 return true
11385 }
11386
11387
11388
11389 for {
11390 off := auxIntToInt32(v.AuxInt)
11391 sym := auxToSym(v.Aux)
11392 ptr := v_0
11393 if v_1.Op != OpARM64MOVWstorezero {
11394 break
11395 }
11396 off2 := auxIntToInt32(v_1.AuxInt)
11397 sym2 := auxToSym(v_1.Aux)
11398 ptr2 := v_1.Args[0]
11399 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
11400 break
11401 }
11402 v.reset(OpARM64MOVDconst)
11403 v.AuxInt = int64ToAuxInt(0)
11404 return true
11405 }
11406
11407
11408
11409 for {
11410 off := auxIntToInt32(v.AuxInt)
11411 sym := auxToSym(v.Aux)
11412 if v_0.Op != OpSB || !(symIsRO(sym)) {
11413 break
11414 }
11415 v.reset(OpARM64MOVDconst)
11416 v.AuxInt = int64ToAuxInt(int64(read32(sym, int64(off), config.ctxt.Arch.ByteOrder)))
11417 return true
11418 }
11419 return false
11420 }
11421 func rewriteValueARM64_OpARM64MOVWUloadidx(v *Value) bool {
11422 v_2 := v.Args[2]
11423 v_1 := v.Args[1]
11424 v_0 := v.Args[0]
11425
11426
11427
11428 for {
11429 ptr := v_0
11430 if v_1.Op != OpARM64MOVDconst {
11431 break
11432 }
11433 c := auxIntToInt64(v_1.AuxInt)
11434 mem := v_2
11435 if !(is32Bit(c)) {
11436 break
11437 }
11438 v.reset(OpARM64MOVWUload)
11439 v.AuxInt = int32ToAuxInt(int32(c))
11440 v.AddArg2(ptr, mem)
11441 return true
11442 }
11443
11444
11445
11446 for {
11447 if v_0.Op != OpARM64MOVDconst {
11448 break
11449 }
11450 c := auxIntToInt64(v_0.AuxInt)
11451 ptr := v_1
11452 mem := v_2
11453 if !(is32Bit(c)) {
11454 break
11455 }
11456 v.reset(OpARM64MOVWUload)
11457 v.AuxInt = int32ToAuxInt(int32(c))
11458 v.AddArg2(ptr, mem)
11459 return true
11460 }
11461
11462
11463 for {
11464 ptr := v_0
11465 if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
11466 break
11467 }
11468 idx := v_1.Args[0]
11469 mem := v_2
11470 v.reset(OpARM64MOVWUloadidx4)
11471 v.AddArg3(ptr, idx, mem)
11472 return true
11473 }
11474
11475
11476 for {
11477 if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
11478 break
11479 }
11480 idx := v_0.Args[0]
11481 ptr := v_1
11482 mem := v_2
11483 v.reset(OpARM64MOVWUloadidx4)
11484 v.AddArg3(ptr, idx, mem)
11485 return true
11486 }
11487
11488
11489
11490 for {
11491 ptr := v_0
11492 idx := v_1
11493 if v_2.Op != OpARM64MOVWstorezeroidx {
11494 break
11495 }
11496 idx2 := v_2.Args[1]
11497 ptr2 := v_2.Args[0]
11498 if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2) || isSamePtr(ptr, idx2) && isSamePtr(idx, ptr2)) {
11499 break
11500 }
11501 v.reset(OpARM64MOVDconst)
11502 v.AuxInt = int64ToAuxInt(0)
11503 return true
11504 }
11505 return false
11506 }
11507 func rewriteValueARM64_OpARM64MOVWUloadidx4(v *Value) bool {
11508 v_2 := v.Args[2]
11509 v_1 := v.Args[1]
11510 v_0 := v.Args[0]
11511
11512
11513
11514 for {
11515 ptr := v_0
11516 if v_1.Op != OpARM64MOVDconst {
11517 break
11518 }
11519 c := auxIntToInt64(v_1.AuxInt)
11520 mem := v_2
11521 if !(is32Bit(c << 2)) {
11522 break
11523 }
11524 v.reset(OpARM64MOVWUload)
11525 v.AuxInt = int32ToAuxInt(int32(c) << 2)
11526 v.AddArg2(ptr, mem)
11527 return true
11528 }
11529
11530
11531
11532 for {
11533 ptr := v_0
11534 idx := v_1
11535 if v_2.Op != OpARM64MOVWstorezeroidx4 {
11536 break
11537 }
11538 idx2 := v_2.Args[1]
11539 ptr2 := v_2.Args[0]
11540 if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2)) {
11541 break
11542 }
11543 v.reset(OpARM64MOVDconst)
11544 v.AuxInt = int64ToAuxInt(0)
11545 return true
11546 }
11547 return false
11548 }
11549 func rewriteValueARM64_OpARM64MOVWUreg(v *Value) bool {
11550 v_0 := v.Args[0]
11551
11552
11553 for {
11554 if v_0.Op != OpARM64ANDconst {
11555 break
11556 }
11557 c := auxIntToInt64(v_0.AuxInt)
11558 x := v_0.Args[0]
11559 v.reset(OpARM64ANDconst)
11560 v.AuxInt = int64ToAuxInt(c & (1<<32 - 1))
11561 v.AddArg(x)
11562 return true
11563 }
11564
11565
11566 for {
11567 if v_0.Op != OpARM64MOVDconst {
11568 break
11569 }
11570 c := auxIntToInt64(v_0.AuxInt)
11571 v.reset(OpARM64MOVDconst)
11572 v.AuxInt = int64ToAuxInt(int64(uint32(c)))
11573 return true
11574 }
11575
11576
11577
11578 for {
11579 x := v_0
11580 if !(v.Type.Size() <= 4) {
11581 break
11582 }
11583 v.copyOf(x)
11584 return true
11585 }
11586
11587
11588
11589 for {
11590 if v_0.Op != OpARM64SLLconst {
11591 break
11592 }
11593 lc := auxIntToInt64(v_0.AuxInt)
11594 if !(lc >= 32) {
11595 break
11596 }
11597 v.reset(OpARM64MOVDconst)
11598 v.AuxInt = int64ToAuxInt(0)
11599 return true
11600 }
11601
11602
11603
11604 for {
11605 if v_0.Op != OpARM64SLLconst {
11606 break
11607 }
11608 lc := auxIntToInt64(v_0.AuxInt)
11609 x := v_0.Args[0]
11610 if !(lc < 32) {
11611 break
11612 }
11613 v.reset(OpARM64UBFIZ)
11614 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 32-lc))
11615 v.AddArg(x)
11616 return true
11617 }
11618
11619
11620
11621 for {
11622 if v_0.Op != OpARM64SRLconst {
11623 break
11624 }
11625 rc := auxIntToInt64(v_0.AuxInt)
11626 x := v_0.Args[0]
11627 if !(rc < 32) {
11628 break
11629 }
11630 v.reset(OpARM64UBFX)
11631 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 32))
11632 v.AddArg(x)
11633 return true
11634 }
11635
11636
11637
11638 for {
11639 if v_0.Op != OpARM64UBFX {
11640 break
11641 }
11642 bfc := auxIntToArm64BitField(v_0.AuxInt)
11643 x := v_0.Args[0]
11644 if !(bfc.getARM64BFwidth() <= 32) {
11645 break
11646 }
11647 v.reset(OpARM64UBFX)
11648 v.AuxInt = arm64BitFieldToAuxInt(bfc)
11649 v.AddArg(x)
11650 return true
11651 }
11652 return false
11653 }
11654 func rewriteValueARM64_OpARM64MOVWload(v *Value) bool {
11655 v_1 := v.Args[1]
11656 v_0 := v.Args[0]
11657 b := v.Block
11658 config := b.Func.Config
11659
11660
11661
11662 for {
11663 off1 := auxIntToInt32(v.AuxInt)
11664 sym := auxToSym(v.Aux)
11665 if v_0.Op != OpARM64ADDconst {
11666 break
11667 }
11668 off2 := auxIntToInt64(v_0.AuxInt)
11669 ptr := v_0.Args[0]
11670 mem := v_1
11671 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
11672 break
11673 }
11674 v.reset(OpARM64MOVWload)
11675 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
11676 v.Aux = symToAux(sym)
11677 v.AddArg2(ptr, mem)
11678 return true
11679 }
11680
11681
11682
11683 for {
11684 off := auxIntToInt32(v.AuxInt)
11685 sym := auxToSym(v.Aux)
11686 if v_0.Op != OpARM64ADD {
11687 break
11688 }
11689 idx := v_0.Args[1]
11690 ptr := v_0.Args[0]
11691 mem := v_1
11692 if !(off == 0 && sym == nil) {
11693 break
11694 }
11695 v.reset(OpARM64MOVWloadidx)
11696 v.AddArg3(ptr, idx, mem)
11697 return true
11698 }
11699
11700
11701
11702 for {
11703 off := auxIntToInt32(v.AuxInt)
11704 sym := auxToSym(v.Aux)
11705 if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
11706 break
11707 }
11708 idx := v_0.Args[1]
11709 ptr := v_0.Args[0]
11710 mem := v_1
11711 if !(off == 0 && sym == nil) {
11712 break
11713 }
11714 v.reset(OpARM64MOVWloadidx4)
11715 v.AddArg3(ptr, idx, mem)
11716 return true
11717 }
11718
11719
11720
11721 for {
11722 off1 := auxIntToInt32(v.AuxInt)
11723 sym1 := auxToSym(v.Aux)
11724 if v_0.Op != OpARM64MOVDaddr {
11725 break
11726 }
11727 off2 := auxIntToInt32(v_0.AuxInt)
11728 sym2 := auxToSym(v_0.Aux)
11729 ptr := v_0.Args[0]
11730 mem := v_1
11731 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
11732 break
11733 }
11734 v.reset(OpARM64MOVWload)
11735 v.AuxInt = int32ToAuxInt(off1 + off2)
11736 v.Aux = symToAux(mergeSym(sym1, sym2))
11737 v.AddArg2(ptr, mem)
11738 return true
11739 }
11740
11741
11742
11743 for {
11744 off := auxIntToInt32(v.AuxInt)
11745 sym := auxToSym(v.Aux)
11746 ptr := v_0
11747 if v_1.Op != OpARM64MOVWstorezero {
11748 break
11749 }
11750 off2 := auxIntToInt32(v_1.AuxInt)
11751 sym2 := auxToSym(v_1.Aux)
11752 ptr2 := v_1.Args[0]
11753 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
11754 break
11755 }
11756 v.reset(OpARM64MOVDconst)
11757 v.AuxInt = int64ToAuxInt(0)
11758 return true
11759 }
11760 return false
11761 }
11762 func rewriteValueARM64_OpARM64MOVWloadidx(v *Value) bool {
11763 v_2 := v.Args[2]
11764 v_1 := v.Args[1]
11765 v_0 := v.Args[0]
11766
11767
11768
11769 for {
11770 ptr := v_0
11771 if v_1.Op != OpARM64MOVDconst {
11772 break
11773 }
11774 c := auxIntToInt64(v_1.AuxInt)
11775 mem := v_2
11776 if !(is32Bit(c)) {
11777 break
11778 }
11779 v.reset(OpARM64MOVWload)
11780 v.AuxInt = int32ToAuxInt(int32(c))
11781 v.AddArg2(ptr, mem)
11782 return true
11783 }
11784
11785
11786
11787 for {
11788 if v_0.Op != OpARM64MOVDconst {
11789 break
11790 }
11791 c := auxIntToInt64(v_0.AuxInt)
11792 ptr := v_1
11793 mem := v_2
11794 if !(is32Bit(c)) {
11795 break
11796 }
11797 v.reset(OpARM64MOVWload)
11798 v.AuxInt = int32ToAuxInt(int32(c))
11799 v.AddArg2(ptr, mem)
11800 return true
11801 }
11802
11803
11804 for {
11805 ptr := v_0
11806 if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
11807 break
11808 }
11809 idx := v_1.Args[0]
11810 mem := v_2
11811 v.reset(OpARM64MOVWloadidx4)
11812 v.AddArg3(ptr, idx, mem)
11813 return true
11814 }
11815
11816
11817 for {
11818 if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
11819 break
11820 }
11821 idx := v_0.Args[0]
11822 ptr := v_1
11823 mem := v_2
11824 v.reset(OpARM64MOVWloadidx4)
11825 v.AddArg3(ptr, idx, mem)
11826 return true
11827 }
11828
11829
11830
11831 for {
11832 ptr := v_0
11833 idx := v_1
11834 if v_2.Op != OpARM64MOVWstorezeroidx {
11835 break
11836 }
11837 idx2 := v_2.Args[1]
11838 ptr2 := v_2.Args[0]
11839 if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2) || isSamePtr(ptr, idx2) && isSamePtr(idx, ptr2)) {
11840 break
11841 }
11842 v.reset(OpARM64MOVDconst)
11843 v.AuxInt = int64ToAuxInt(0)
11844 return true
11845 }
11846 return false
11847 }
11848 func rewriteValueARM64_OpARM64MOVWloadidx4(v *Value) bool {
11849 v_2 := v.Args[2]
11850 v_1 := v.Args[1]
11851 v_0 := v.Args[0]
11852
11853
11854
11855 for {
11856 ptr := v_0
11857 if v_1.Op != OpARM64MOVDconst {
11858 break
11859 }
11860 c := auxIntToInt64(v_1.AuxInt)
11861 mem := v_2
11862 if !(is32Bit(c << 2)) {
11863 break
11864 }
11865 v.reset(OpARM64MOVWload)
11866 v.AuxInt = int32ToAuxInt(int32(c) << 2)
11867 v.AddArg2(ptr, mem)
11868 return true
11869 }
11870
11871
11872
11873 for {
11874 ptr := v_0
11875 idx := v_1
11876 if v_2.Op != OpARM64MOVWstorezeroidx4 {
11877 break
11878 }
11879 idx2 := v_2.Args[1]
11880 ptr2 := v_2.Args[0]
11881 if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2)) {
11882 break
11883 }
11884 v.reset(OpARM64MOVDconst)
11885 v.AuxInt = int64ToAuxInt(0)
11886 return true
11887 }
11888 return false
11889 }
11890 func rewriteValueARM64_OpARM64MOVWreg(v *Value) bool {
11891 v_0 := v.Args[0]
11892
11893
11894 for {
11895 if v_0.Op != OpARM64MOVDconst {
11896 break
11897 }
11898 c := auxIntToInt64(v_0.AuxInt)
11899 v.reset(OpARM64MOVDconst)
11900 v.AuxInt = int64ToAuxInt(int64(int32(c)))
11901 return true
11902 }
11903
11904
11905
11906 for {
11907 x := v_0
11908 if !(v.Type.Size() <= 4) {
11909 break
11910 }
11911 v.copyOf(x)
11912 return true
11913 }
11914
11915
11916
11917 for {
11918 t := v.Type
11919 if v_0.Op != OpARM64ANDconst {
11920 break
11921 }
11922 c := auxIntToInt64(v_0.AuxInt)
11923 x := v_0.Args[0]
11924 if !(uint64(c)&uint64(0xffffffff80000000) == 0) {
11925 break
11926 }
11927 v.reset(OpARM64ANDconst)
11928 v.Type = t
11929 v.AuxInt = int64ToAuxInt(c)
11930 v.AddArg(x)
11931 return true
11932 }
11933
11934
11935
11936 for {
11937 if v_0.Op != OpARM64SLLconst {
11938 break
11939 }
11940 lc := auxIntToInt64(v_0.AuxInt)
11941 x := v_0.Args[0]
11942 if !(lc < 32) {
11943 break
11944 }
11945 v.reset(OpARM64SBFIZ)
11946 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 32-lc))
11947 v.AddArg(x)
11948 return true
11949 }
11950
11951
11952
11953 for {
11954 if v_0.Op != OpARM64SBFX {
11955 break
11956 }
11957 bfc := auxIntToArm64BitField(v_0.AuxInt)
11958 x := v_0.Args[0]
11959 if !(bfc.getARM64BFwidth() <= 32) {
11960 break
11961 }
11962 v.reset(OpARM64SBFX)
11963 v.AuxInt = arm64BitFieldToAuxInt(bfc)
11964 v.AddArg(x)
11965 return true
11966 }
11967 return false
11968 }
11969 func rewriteValueARM64_OpARM64MOVWstore(v *Value) bool {
11970 v_2 := v.Args[2]
11971 v_1 := v.Args[1]
11972 v_0 := v.Args[0]
11973 b := v.Block
11974 config := b.Func.Config
11975
11976
11977 for {
11978 off := auxIntToInt32(v.AuxInt)
11979 sym := auxToSym(v.Aux)
11980 ptr := v_0
11981 if v_1.Op != OpARM64FMOVSfpgp {
11982 break
11983 }
11984 val := v_1.Args[0]
11985 mem := v_2
11986 v.reset(OpARM64FMOVSstore)
11987 v.AuxInt = int32ToAuxInt(off)
11988 v.Aux = symToAux(sym)
11989 v.AddArg3(ptr, val, mem)
11990 return true
11991 }
11992
11993
11994
11995 for {
11996 off1 := auxIntToInt32(v.AuxInt)
11997 sym := auxToSym(v.Aux)
11998 if v_0.Op != OpARM64ADDconst {
11999 break
12000 }
12001 off2 := auxIntToInt64(v_0.AuxInt)
12002 ptr := v_0.Args[0]
12003 val := v_1
12004 mem := v_2
12005 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
12006 break
12007 }
12008 v.reset(OpARM64MOVWstore)
12009 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
12010 v.Aux = symToAux(sym)
12011 v.AddArg3(ptr, val, mem)
12012 return true
12013 }
12014
12015
12016
12017 for {
12018 off := auxIntToInt32(v.AuxInt)
12019 sym := auxToSym(v.Aux)
12020 if v_0.Op != OpARM64ADD {
12021 break
12022 }
12023 idx := v_0.Args[1]
12024 ptr := v_0.Args[0]
12025 val := v_1
12026 mem := v_2
12027 if !(off == 0 && sym == nil) {
12028 break
12029 }
12030 v.reset(OpARM64MOVWstoreidx)
12031 v.AddArg4(ptr, idx, val, mem)
12032 return true
12033 }
12034
12035
12036
12037 for {
12038 off := auxIntToInt32(v.AuxInt)
12039 sym := auxToSym(v.Aux)
12040 if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
12041 break
12042 }
12043 idx := v_0.Args[1]
12044 ptr := v_0.Args[0]
12045 val := v_1
12046 mem := v_2
12047 if !(off == 0 && sym == nil) {
12048 break
12049 }
12050 v.reset(OpARM64MOVWstoreidx4)
12051 v.AddArg4(ptr, idx, val, mem)
12052 return true
12053 }
12054
12055
12056
12057 for {
12058 off1 := auxIntToInt32(v.AuxInt)
12059 sym1 := auxToSym(v.Aux)
12060 if v_0.Op != OpARM64MOVDaddr {
12061 break
12062 }
12063 off2 := auxIntToInt32(v_0.AuxInt)
12064 sym2 := auxToSym(v_0.Aux)
12065 ptr := v_0.Args[0]
12066 val := v_1
12067 mem := v_2
12068 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
12069 break
12070 }
12071 v.reset(OpARM64MOVWstore)
12072 v.AuxInt = int32ToAuxInt(off1 + off2)
12073 v.Aux = symToAux(mergeSym(sym1, sym2))
12074 v.AddArg3(ptr, val, mem)
12075 return true
12076 }
12077
12078
12079 for {
12080 off := auxIntToInt32(v.AuxInt)
12081 sym := auxToSym(v.Aux)
12082 ptr := v_0
12083 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
12084 break
12085 }
12086 mem := v_2
12087 v.reset(OpARM64MOVWstorezero)
12088 v.AuxInt = int32ToAuxInt(off)
12089 v.Aux = symToAux(sym)
12090 v.AddArg2(ptr, mem)
12091 return true
12092 }
12093
12094
12095 for {
12096 off := auxIntToInt32(v.AuxInt)
12097 sym := auxToSym(v.Aux)
12098 ptr := v_0
12099 if v_1.Op != OpARM64MOVWreg {
12100 break
12101 }
12102 x := v_1.Args[0]
12103 mem := v_2
12104 v.reset(OpARM64MOVWstore)
12105 v.AuxInt = int32ToAuxInt(off)
12106 v.Aux = symToAux(sym)
12107 v.AddArg3(ptr, x, mem)
12108 return true
12109 }
12110
12111
12112 for {
12113 off := auxIntToInt32(v.AuxInt)
12114 sym := auxToSym(v.Aux)
12115 ptr := v_0
12116 if v_1.Op != OpARM64MOVWUreg {
12117 break
12118 }
12119 x := v_1.Args[0]
12120 mem := v_2
12121 v.reset(OpARM64MOVWstore)
12122 v.AuxInt = int32ToAuxInt(off)
12123 v.Aux = symToAux(sym)
12124 v.AddArg3(ptr, x, mem)
12125 return true
12126 }
12127 return false
12128 }
12129 func rewriteValueARM64_OpARM64MOVWstoreidx(v *Value) bool {
12130 v_3 := v.Args[3]
12131 v_2 := v.Args[2]
12132 v_1 := v.Args[1]
12133 v_0 := v.Args[0]
12134
12135
12136
12137 for {
12138 ptr := v_0
12139 if v_1.Op != OpARM64MOVDconst {
12140 break
12141 }
12142 c := auxIntToInt64(v_1.AuxInt)
12143 val := v_2
12144 mem := v_3
12145 if !(is32Bit(c)) {
12146 break
12147 }
12148 v.reset(OpARM64MOVWstore)
12149 v.AuxInt = int32ToAuxInt(int32(c))
12150 v.AddArg3(ptr, val, mem)
12151 return true
12152 }
12153
12154
12155
12156 for {
12157 if v_0.Op != OpARM64MOVDconst {
12158 break
12159 }
12160 c := auxIntToInt64(v_0.AuxInt)
12161 idx := v_1
12162 val := v_2
12163 mem := v_3
12164 if !(is32Bit(c)) {
12165 break
12166 }
12167 v.reset(OpARM64MOVWstore)
12168 v.AuxInt = int32ToAuxInt(int32(c))
12169 v.AddArg3(idx, val, mem)
12170 return true
12171 }
12172
12173
12174 for {
12175 ptr := v_0
12176 if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
12177 break
12178 }
12179 idx := v_1.Args[0]
12180 val := v_2
12181 mem := v_3
12182 v.reset(OpARM64MOVWstoreidx4)
12183 v.AddArg4(ptr, idx, val, mem)
12184 return true
12185 }
12186
12187
12188 for {
12189 if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
12190 break
12191 }
12192 idx := v_0.Args[0]
12193 ptr := v_1
12194 val := v_2
12195 mem := v_3
12196 v.reset(OpARM64MOVWstoreidx4)
12197 v.AddArg4(ptr, idx, val, mem)
12198 return true
12199 }
12200
12201
12202 for {
12203 ptr := v_0
12204 idx := v_1
12205 if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
12206 break
12207 }
12208 mem := v_3
12209 v.reset(OpARM64MOVWstorezeroidx)
12210 v.AddArg3(ptr, idx, mem)
12211 return true
12212 }
12213
12214
12215 for {
12216 ptr := v_0
12217 idx := v_1
12218 if v_2.Op != OpARM64MOVWreg {
12219 break
12220 }
12221 x := v_2.Args[0]
12222 mem := v_3
12223 v.reset(OpARM64MOVWstoreidx)
12224 v.AddArg4(ptr, idx, x, mem)
12225 return true
12226 }
12227
12228
12229 for {
12230 ptr := v_0
12231 idx := v_1
12232 if v_2.Op != OpARM64MOVWUreg {
12233 break
12234 }
12235 x := v_2.Args[0]
12236 mem := v_3
12237 v.reset(OpARM64MOVWstoreidx)
12238 v.AddArg4(ptr, idx, x, mem)
12239 return true
12240 }
12241 return false
12242 }
12243 func rewriteValueARM64_OpARM64MOVWstoreidx4(v *Value) bool {
12244 v_3 := v.Args[3]
12245 v_2 := v.Args[2]
12246 v_1 := v.Args[1]
12247 v_0 := v.Args[0]
12248
12249
12250
12251 for {
12252 ptr := v_0
12253 if v_1.Op != OpARM64MOVDconst {
12254 break
12255 }
12256 c := auxIntToInt64(v_1.AuxInt)
12257 val := v_2
12258 mem := v_3
12259 if !(is32Bit(c << 2)) {
12260 break
12261 }
12262 v.reset(OpARM64MOVWstore)
12263 v.AuxInt = int32ToAuxInt(int32(c) << 2)
12264 v.AddArg3(ptr, val, mem)
12265 return true
12266 }
12267
12268
12269 for {
12270 ptr := v_0
12271 idx := v_1
12272 if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
12273 break
12274 }
12275 mem := v_3
12276 v.reset(OpARM64MOVWstorezeroidx4)
12277 v.AddArg3(ptr, idx, mem)
12278 return true
12279 }
12280
12281
12282 for {
12283 ptr := v_0
12284 idx := v_1
12285 if v_2.Op != OpARM64MOVWreg {
12286 break
12287 }
12288 x := v_2.Args[0]
12289 mem := v_3
12290 v.reset(OpARM64MOVWstoreidx4)
12291 v.AddArg4(ptr, idx, x, mem)
12292 return true
12293 }
12294
12295
12296 for {
12297 ptr := v_0
12298 idx := v_1
12299 if v_2.Op != OpARM64MOVWUreg {
12300 break
12301 }
12302 x := v_2.Args[0]
12303 mem := v_3
12304 v.reset(OpARM64MOVWstoreidx4)
12305 v.AddArg4(ptr, idx, x, mem)
12306 return true
12307 }
12308 return false
12309 }
12310 func rewriteValueARM64_OpARM64MOVWstorezero(v *Value) bool {
12311 v_1 := v.Args[1]
12312 v_0 := v.Args[0]
12313 b := v.Block
12314 config := b.Func.Config
12315
12316
12317
12318 for {
12319 off1 := auxIntToInt32(v.AuxInt)
12320 sym := auxToSym(v.Aux)
12321 if v_0.Op != OpARM64ADDconst {
12322 break
12323 }
12324 off2 := auxIntToInt64(v_0.AuxInt)
12325 ptr := v_0.Args[0]
12326 mem := v_1
12327 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
12328 break
12329 }
12330 v.reset(OpARM64MOVWstorezero)
12331 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
12332 v.Aux = symToAux(sym)
12333 v.AddArg2(ptr, mem)
12334 return true
12335 }
12336
12337
12338
12339 for {
12340 off1 := auxIntToInt32(v.AuxInt)
12341 sym1 := auxToSym(v.Aux)
12342 if v_0.Op != OpARM64MOVDaddr {
12343 break
12344 }
12345 off2 := auxIntToInt32(v_0.AuxInt)
12346 sym2 := auxToSym(v_0.Aux)
12347 ptr := v_0.Args[0]
12348 mem := v_1
12349 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
12350 break
12351 }
12352 v.reset(OpARM64MOVWstorezero)
12353 v.AuxInt = int32ToAuxInt(off1 + off2)
12354 v.Aux = symToAux(mergeSym(sym1, sym2))
12355 v.AddArg2(ptr, mem)
12356 return true
12357 }
12358
12359
12360
12361 for {
12362 off := auxIntToInt32(v.AuxInt)
12363 sym := auxToSym(v.Aux)
12364 if v_0.Op != OpARM64ADD {
12365 break
12366 }
12367 idx := v_0.Args[1]
12368 ptr := v_0.Args[0]
12369 mem := v_1
12370 if !(off == 0 && sym == nil) {
12371 break
12372 }
12373 v.reset(OpARM64MOVWstorezeroidx)
12374 v.AddArg3(ptr, idx, mem)
12375 return true
12376 }
12377
12378
12379
12380 for {
12381 off := auxIntToInt32(v.AuxInt)
12382 sym := auxToSym(v.Aux)
12383 if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
12384 break
12385 }
12386 idx := v_0.Args[1]
12387 ptr := v_0.Args[0]
12388 mem := v_1
12389 if !(off == 0 && sym == nil) {
12390 break
12391 }
12392 v.reset(OpARM64MOVWstorezeroidx4)
12393 v.AddArg3(ptr, idx, mem)
12394 return true
12395 }
12396 return false
12397 }
12398 func rewriteValueARM64_OpARM64MOVWstorezeroidx(v *Value) bool {
12399 v_2 := v.Args[2]
12400 v_1 := v.Args[1]
12401 v_0 := v.Args[0]
12402
12403
12404
12405 for {
12406 ptr := v_0
12407 if v_1.Op != OpARM64MOVDconst {
12408 break
12409 }
12410 c := auxIntToInt64(v_1.AuxInt)
12411 mem := v_2
12412 if !(is32Bit(c)) {
12413 break
12414 }
12415 v.reset(OpARM64MOVWstorezero)
12416 v.AuxInt = int32ToAuxInt(int32(c))
12417 v.AddArg2(ptr, mem)
12418 return true
12419 }
12420
12421
12422
12423 for {
12424 if v_0.Op != OpARM64MOVDconst {
12425 break
12426 }
12427 c := auxIntToInt64(v_0.AuxInt)
12428 idx := v_1
12429 mem := v_2
12430 if !(is32Bit(c)) {
12431 break
12432 }
12433 v.reset(OpARM64MOVWstorezero)
12434 v.AuxInt = int32ToAuxInt(int32(c))
12435 v.AddArg2(idx, mem)
12436 return true
12437 }
12438
12439
12440 for {
12441 ptr := v_0
12442 if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
12443 break
12444 }
12445 idx := v_1.Args[0]
12446 mem := v_2
12447 v.reset(OpARM64MOVWstorezeroidx4)
12448 v.AddArg3(ptr, idx, mem)
12449 return true
12450 }
12451
12452
12453 for {
12454 if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
12455 break
12456 }
12457 idx := v_0.Args[0]
12458 ptr := v_1
12459 mem := v_2
12460 v.reset(OpARM64MOVWstorezeroidx4)
12461 v.AddArg3(ptr, idx, mem)
12462 return true
12463 }
12464 return false
12465 }
12466 func rewriteValueARM64_OpARM64MOVWstorezeroidx4(v *Value) bool {
12467 v_2 := v.Args[2]
12468 v_1 := v.Args[1]
12469 v_0 := v.Args[0]
12470
12471
12472
12473 for {
12474 ptr := v_0
12475 if v_1.Op != OpARM64MOVDconst {
12476 break
12477 }
12478 c := auxIntToInt64(v_1.AuxInt)
12479 mem := v_2
12480 if !(is32Bit(c << 2)) {
12481 break
12482 }
12483 v.reset(OpARM64MOVWstorezero)
12484 v.AuxInt = int32ToAuxInt(int32(c << 2))
12485 v.AddArg2(ptr, mem)
12486 return true
12487 }
12488 return false
12489 }
12490 func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
12491 v_2 := v.Args[2]
12492 v_1 := v.Args[1]
12493 v_0 := v.Args[0]
12494 b := v.Block
12495
12496
12497 for {
12498 a := v_0
12499 x := v_1
12500 if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != -1 {
12501 break
12502 }
12503 v.reset(OpARM64ADD)
12504 v.AddArg2(a, x)
12505 return true
12506 }
12507
12508
12509 for {
12510 a := v_0
12511 if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
12512 break
12513 }
12514 v.copyOf(a)
12515 return true
12516 }
12517
12518
12519 for {
12520 a := v_0
12521 x := v_1
12522 if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 1 {
12523 break
12524 }
12525 v.reset(OpARM64SUB)
12526 v.AddArg2(a, x)
12527 return true
12528 }
12529
12530
12531
12532 for {
12533 a := v_0
12534 x := v_1
12535 if v_2.Op != OpARM64MOVDconst {
12536 break
12537 }
12538 c := auxIntToInt64(v_2.AuxInt)
12539 if !(isPowerOfTwo64(c)) {
12540 break
12541 }
12542 v.reset(OpARM64SUBshiftLL)
12543 v.AuxInt = int64ToAuxInt(log64(c))
12544 v.AddArg2(a, x)
12545 return true
12546 }
12547
12548
12549
12550 for {
12551 a := v_0
12552 x := v_1
12553 if v_2.Op != OpARM64MOVDconst {
12554 break
12555 }
12556 c := auxIntToInt64(v_2.AuxInt)
12557 if !(isPowerOfTwo64(c-1) && c >= 3) {
12558 break
12559 }
12560 v.reset(OpARM64SUB)
12561 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
12562 v0.AuxInt = int64ToAuxInt(log64(c - 1))
12563 v0.AddArg2(x, x)
12564 v.AddArg2(a, v0)
12565 return true
12566 }
12567
12568
12569
12570 for {
12571 a := v_0
12572 x := v_1
12573 if v_2.Op != OpARM64MOVDconst {
12574 break
12575 }
12576 c := auxIntToInt64(v_2.AuxInt)
12577 if !(isPowerOfTwo64(c+1) && c >= 7) {
12578 break
12579 }
12580 v.reset(OpARM64ADD)
12581 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
12582 v0.AuxInt = int64ToAuxInt(log64(c + 1))
12583 v0.AddArg2(x, x)
12584 v.AddArg2(a, v0)
12585 return true
12586 }
12587
12588
12589
12590 for {
12591 a := v_0
12592 x := v_1
12593 if v_2.Op != OpARM64MOVDconst {
12594 break
12595 }
12596 c := auxIntToInt64(v_2.AuxInt)
12597 if !(c%3 == 0 && isPowerOfTwo64(c/3)) {
12598 break
12599 }
12600 v.reset(OpARM64ADDshiftLL)
12601 v.AuxInt = int64ToAuxInt(log64(c / 3))
12602 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
12603 v0.AuxInt = int64ToAuxInt(2)
12604 v0.AddArg2(x, x)
12605 v.AddArg2(a, v0)
12606 return true
12607 }
12608
12609
12610
12611 for {
12612 a := v_0
12613 x := v_1
12614 if v_2.Op != OpARM64MOVDconst {
12615 break
12616 }
12617 c := auxIntToInt64(v_2.AuxInt)
12618 if !(c%5 == 0 && isPowerOfTwo64(c/5)) {
12619 break
12620 }
12621 v.reset(OpARM64SUBshiftLL)
12622 v.AuxInt = int64ToAuxInt(log64(c / 5))
12623 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
12624 v0.AuxInt = int64ToAuxInt(2)
12625 v0.AddArg2(x, x)
12626 v.AddArg2(a, v0)
12627 return true
12628 }
12629
12630
12631
12632 for {
12633 a := v_0
12634 x := v_1
12635 if v_2.Op != OpARM64MOVDconst {
12636 break
12637 }
12638 c := auxIntToInt64(v_2.AuxInt)
12639 if !(c%7 == 0 && isPowerOfTwo64(c/7)) {
12640 break
12641 }
12642 v.reset(OpARM64ADDshiftLL)
12643 v.AuxInt = int64ToAuxInt(log64(c / 7))
12644 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
12645 v0.AuxInt = int64ToAuxInt(3)
12646 v0.AddArg2(x, x)
12647 v.AddArg2(a, v0)
12648 return true
12649 }
12650
12651
12652
12653 for {
12654 a := v_0
12655 x := v_1
12656 if v_2.Op != OpARM64MOVDconst {
12657 break
12658 }
12659 c := auxIntToInt64(v_2.AuxInt)
12660 if !(c%9 == 0 && isPowerOfTwo64(c/9)) {
12661 break
12662 }
12663 v.reset(OpARM64SUBshiftLL)
12664 v.AuxInt = int64ToAuxInt(log64(c / 9))
12665 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
12666 v0.AuxInt = int64ToAuxInt(3)
12667 v0.AddArg2(x, x)
12668 v.AddArg2(a, v0)
12669 return true
12670 }
12671
12672
12673 for {
12674 a := v_0
12675 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
12676 break
12677 }
12678 x := v_2
12679 v.reset(OpARM64ADD)
12680 v.AddArg2(a, x)
12681 return true
12682 }
12683
12684
12685 for {
12686 a := v_0
12687 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
12688 break
12689 }
12690 v.copyOf(a)
12691 return true
12692 }
12693
12694
12695 for {
12696 a := v_0
12697 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
12698 break
12699 }
12700 x := v_2
12701 v.reset(OpARM64SUB)
12702 v.AddArg2(a, x)
12703 return true
12704 }
12705
12706
12707
12708 for {
12709 a := v_0
12710 if v_1.Op != OpARM64MOVDconst {
12711 break
12712 }
12713 c := auxIntToInt64(v_1.AuxInt)
12714 x := v_2
12715 if !(isPowerOfTwo64(c)) {
12716 break
12717 }
12718 v.reset(OpARM64SUBshiftLL)
12719 v.AuxInt = int64ToAuxInt(log64(c))
12720 v.AddArg2(a, x)
12721 return true
12722 }
12723
12724
12725
12726 for {
12727 a := v_0
12728 if v_1.Op != OpARM64MOVDconst {
12729 break
12730 }
12731 c := auxIntToInt64(v_1.AuxInt)
12732 x := v_2
12733 if !(isPowerOfTwo64(c-1) && c >= 3) {
12734 break
12735 }
12736 v.reset(OpARM64SUB)
12737 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
12738 v0.AuxInt = int64ToAuxInt(log64(c - 1))
12739 v0.AddArg2(x, x)
12740 v.AddArg2(a, v0)
12741 return true
12742 }
12743
12744
12745
12746 for {
12747 a := v_0
12748 if v_1.Op != OpARM64MOVDconst {
12749 break
12750 }
12751 c := auxIntToInt64(v_1.AuxInt)
12752 x := v_2
12753 if !(isPowerOfTwo64(c+1) && c >= 7) {
12754 break
12755 }
12756 v.reset(OpARM64ADD)
12757 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
12758 v0.AuxInt = int64ToAuxInt(log64(c + 1))
12759 v0.AddArg2(x, x)
12760 v.AddArg2(a, v0)
12761 return true
12762 }
12763
12764
12765
12766 for {
12767 a := v_0
12768 if v_1.Op != OpARM64MOVDconst {
12769 break
12770 }
12771 c := auxIntToInt64(v_1.AuxInt)
12772 x := v_2
12773 if !(c%3 == 0 && isPowerOfTwo64(c/3)) {
12774 break
12775 }
12776 v.reset(OpARM64ADDshiftLL)
12777 v.AuxInt = int64ToAuxInt(log64(c / 3))
12778 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
12779 v0.AuxInt = int64ToAuxInt(2)
12780 v0.AddArg2(x, x)
12781 v.AddArg2(a, v0)
12782 return true
12783 }
12784
12785
12786
12787 for {
12788 a := v_0
12789 if v_1.Op != OpARM64MOVDconst {
12790 break
12791 }
12792 c := auxIntToInt64(v_1.AuxInt)
12793 x := v_2
12794 if !(c%5 == 0 && isPowerOfTwo64(c/5)) {
12795 break
12796 }
12797 v.reset(OpARM64SUBshiftLL)
12798 v.AuxInt = int64ToAuxInt(log64(c / 5))
12799 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
12800 v0.AuxInt = int64ToAuxInt(2)
12801 v0.AddArg2(x, x)
12802 v.AddArg2(a, v0)
12803 return true
12804 }
12805
12806
12807
12808 for {
12809 a := v_0
12810 if v_1.Op != OpARM64MOVDconst {
12811 break
12812 }
12813 c := auxIntToInt64(v_1.AuxInt)
12814 x := v_2
12815 if !(c%7 == 0 && isPowerOfTwo64(c/7)) {
12816 break
12817 }
12818 v.reset(OpARM64ADDshiftLL)
12819 v.AuxInt = int64ToAuxInt(log64(c / 7))
12820 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
12821 v0.AuxInt = int64ToAuxInt(3)
12822 v0.AddArg2(x, x)
12823 v.AddArg2(a, v0)
12824 return true
12825 }
12826
12827
12828
12829 for {
12830 a := v_0
12831 if v_1.Op != OpARM64MOVDconst {
12832 break
12833 }
12834 c := auxIntToInt64(v_1.AuxInt)
12835 x := v_2
12836 if !(c%9 == 0 && isPowerOfTwo64(c/9)) {
12837 break
12838 }
12839 v.reset(OpARM64SUBshiftLL)
12840 v.AuxInt = int64ToAuxInt(log64(c / 9))
12841 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
12842 v0.AuxInt = int64ToAuxInt(3)
12843 v0.AddArg2(x, x)
12844 v.AddArg2(a, v0)
12845 return true
12846 }
12847
12848
12849 for {
12850 if v_0.Op != OpARM64MOVDconst {
12851 break
12852 }
12853 c := auxIntToInt64(v_0.AuxInt)
12854 x := v_1
12855 y := v_2
12856 v.reset(OpARM64ADDconst)
12857 v.AuxInt = int64ToAuxInt(c)
12858 v0 := b.NewValue0(v.Pos, OpARM64MNEG, x.Type)
12859 v0.AddArg2(x, y)
12860 v.AddArg(v0)
12861 return true
12862 }
12863
12864
12865 for {
12866 a := v_0
12867 if v_1.Op != OpARM64MOVDconst {
12868 break
12869 }
12870 c := auxIntToInt64(v_1.AuxInt)
12871 if v_2.Op != OpARM64MOVDconst {
12872 break
12873 }
12874 d := auxIntToInt64(v_2.AuxInt)
12875 v.reset(OpARM64SUBconst)
12876 v.AuxInt = int64ToAuxInt(c * d)
12877 v.AddArg(a)
12878 return true
12879 }
12880 return false
12881 }
12882 func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
12883 v_2 := v.Args[2]
12884 v_1 := v.Args[1]
12885 v_0 := v.Args[0]
12886 b := v.Block
12887
12888
12889
12890 for {
12891 a := v_0
12892 x := v_1
12893 if v_2.Op != OpARM64MOVDconst {
12894 break
12895 }
12896 c := auxIntToInt64(v_2.AuxInt)
12897 if !(int32(c) == -1) {
12898 break
12899 }
12900 v.reset(OpARM64MOVWUreg)
12901 v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
12902 v0.AddArg2(a, x)
12903 v.AddArg(v0)
12904 return true
12905 }
12906
12907
12908
12909 for {
12910 a := v_0
12911 if v_2.Op != OpARM64MOVDconst {
12912 break
12913 }
12914 c := auxIntToInt64(v_2.AuxInt)
12915 if !(int32(c) == 0) {
12916 break
12917 }
12918 v.reset(OpARM64MOVWUreg)
12919 v.AddArg(a)
12920 return true
12921 }
12922
12923
12924
12925 for {
12926 a := v_0
12927 x := v_1
12928 if v_2.Op != OpARM64MOVDconst {
12929 break
12930 }
12931 c := auxIntToInt64(v_2.AuxInt)
12932 if !(int32(c) == 1) {
12933 break
12934 }
12935 v.reset(OpARM64MOVWUreg)
12936 v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
12937 v0.AddArg2(a, x)
12938 v.AddArg(v0)
12939 return true
12940 }
12941
12942
12943
12944 for {
12945 a := v_0
12946 x := v_1
12947 if v_2.Op != OpARM64MOVDconst {
12948 break
12949 }
12950 c := auxIntToInt64(v_2.AuxInt)
12951 if !(isPowerOfTwo64(c)) {
12952 break
12953 }
12954 v.reset(OpARM64MOVWUreg)
12955 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
12956 v0.AuxInt = int64ToAuxInt(log64(c))
12957 v0.AddArg2(a, x)
12958 v.AddArg(v0)
12959 return true
12960 }
12961
12962
12963
12964 for {
12965 a := v_0
12966 x := v_1
12967 if v_2.Op != OpARM64MOVDconst {
12968 break
12969 }
12970 c := auxIntToInt64(v_2.AuxInt)
12971 if !(isPowerOfTwo64(c-1) && int32(c) >= 3) {
12972 break
12973 }
12974 v.reset(OpARM64MOVWUreg)
12975 v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
12976 v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
12977 v1.AuxInt = int64ToAuxInt(log64(c - 1))
12978 v1.AddArg2(x, x)
12979 v0.AddArg2(a, v1)
12980 v.AddArg(v0)
12981 return true
12982 }
12983
12984
12985
12986 for {
12987 a := v_0
12988 x := v_1
12989 if v_2.Op != OpARM64MOVDconst {
12990 break
12991 }
12992 c := auxIntToInt64(v_2.AuxInt)
12993 if !(isPowerOfTwo64(c+1) && int32(c) >= 7) {
12994 break
12995 }
12996 v.reset(OpARM64MOVWUreg)
12997 v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
12998 v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
12999 v1.AuxInt = int64ToAuxInt(log64(c + 1))
13000 v1.AddArg2(x, x)
13001 v0.AddArg2(a, v1)
13002 v.AddArg(v0)
13003 return true
13004 }
13005
13006
13007
13008 for {
13009 a := v_0
13010 x := v_1
13011 if v_2.Op != OpARM64MOVDconst {
13012 break
13013 }
13014 c := auxIntToInt64(v_2.AuxInt)
13015 if !(c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c)) {
13016 break
13017 }
13018 v.reset(OpARM64MOVWUreg)
13019 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
13020 v0.AuxInt = int64ToAuxInt(log64(c / 3))
13021 v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
13022 v1.AuxInt = int64ToAuxInt(2)
13023 v1.AddArg2(x, x)
13024 v0.AddArg2(a, v1)
13025 v.AddArg(v0)
13026 return true
13027 }
13028
13029
13030
13031 for {
13032 a := v_0
13033 x := v_1
13034 if v_2.Op != OpARM64MOVDconst {
13035 break
13036 }
13037 c := auxIntToInt64(v_2.AuxInt)
13038 if !(c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c)) {
13039 break
13040 }
13041 v.reset(OpARM64MOVWUreg)
13042 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
13043 v0.AuxInt = int64ToAuxInt(log64(c / 5))
13044 v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
13045 v1.AuxInt = int64ToAuxInt(2)
13046 v1.AddArg2(x, x)
13047 v0.AddArg2(a, v1)
13048 v.AddArg(v0)
13049 return true
13050 }
13051
13052
13053
13054 for {
13055 a := v_0
13056 x := v_1
13057 if v_2.Op != OpARM64MOVDconst {
13058 break
13059 }
13060 c := auxIntToInt64(v_2.AuxInt)
13061 if !(c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c)) {
13062 break
13063 }
13064 v.reset(OpARM64MOVWUreg)
13065 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
13066 v0.AuxInt = int64ToAuxInt(log64(c / 7))
13067 v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
13068 v1.AuxInt = int64ToAuxInt(3)
13069 v1.AddArg2(x, x)
13070 v0.AddArg2(a, v1)
13071 v.AddArg(v0)
13072 return true
13073 }
13074
13075
13076
13077 for {
13078 a := v_0
13079 x := v_1
13080 if v_2.Op != OpARM64MOVDconst {
13081 break
13082 }
13083 c := auxIntToInt64(v_2.AuxInt)
13084 if !(c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c)) {
13085 break
13086 }
13087 v.reset(OpARM64MOVWUreg)
13088 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
13089 v0.AuxInt = int64ToAuxInt(log64(c / 9))
13090 v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
13091 v1.AuxInt = int64ToAuxInt(3)
13092 v1.AddArg2(x, x)
13093 v0.AddArg2(a, v1)
13094 v.AddArg(v0)
13095 return true
13096 }
13097
13098
13099
13100 for {
13101 a := v_0
13102 if v_1.Op != OpARM64MOVDconst {
13103 break
13104 }
13105 c := auxIntToInt64(v_1.AuxInt)
13106 x := v_2
13107 if !(int32(c) == -1) {
13108 break
13109 }
13110 v.reset(OpARM64MOVWUreg)
13111 v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
13112 v0.AddArg2(a, x)
13113 v.AddArg(v0)
13114 return true
13115 }
13116
13117
13118
13119 for {
13120 a := v_0
13121 if v_1.Op != OpARM64MOVDconst {
13122 break
13123 }
13124 c := auxIntToInt64(v_1.AuxInt)
13125 if !(int32(c) == 0) {
13126 break
13127 }
13128 v.reset(OpARM64MOVWUreg)
13129 v.AddArg(a)
13130 return true
13131 }
13132
13133
13134
13135 for {
13136 a := v_0
13137 if v_1.Op != OpARM64MOVDconst {
13138 break
13139 }
13140 c := auxIntToInt64(v_1.AuxInt)
13141 x := v_2
13142 if !(int32(c) == 1) {
13143 break
13144 }
13145 v.reset(OpARM64MOVWUreg)
13146 v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
13147 v0.AddArg2(a, x)
13148 v.AddArg(v0)
13149 return true
13150 }
13151
13152
13153
13154 for {
13155 a := v_0
13156 if v_1.Op != OpARM64MOVDconst {
13157 break
13158 }
13159 c := auxIntToInt64(v_1.AuxInt)
13160 x := v_2
13161 if !(isPowerOfTwo64(c)) {
13162 break
13163 }
13164 v.reset(OpARM64MOVWUreg)
13165 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
13166 v0.AuxInt = int64ToAuxInt(log64(c))
13167 v0.AddArg2(a, x)
13168 v.AddArg(v0)
13169 return true
13170 }
13171
13172
13173
13174 for {
13175 a := v_0
13176 if v_1.Op != OpARM64MOVDconst {
13177 break
13178 }
13179 c := auxIntToInt64(v_1.AuxInt)
13180 x := v_2
13181 if !(isPowerOfTwo64(c-1) && int32(c) >= 3) {
13182 break
13183 }
13184 v.reset(OpARM64MOVWUreg)
13185 v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
13186 v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
13187 v1.AuxInt = int64ToAuxInt(log64(c - 1))
13188 v1.AddArg2(x, x)
13189 v0.AddArg2(a, v1)
13190 v.AddArg(v0)
13191 return true
13192 }
13193
13194
13195
13196 for {
13197 a := v_0
13198 if v_1.Op != OpARM64MOVDconst {
13199 break
13200 }
13201 c := auxIntToInt64(v_1.AuxInt)
13202 x := v_2
13203 if !(isPowerOfTwo64(c+1) && int32(c) >= 7) {
13204 break
13205 }
13206 v.reset(OpARM64MOVWUreg)
13207 v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
13208 v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
13209 v1.AuxInt = int64ToAuxInt(log64(c + 1))
13210 v1.AddArg2(x, x)
13211 v0.AddArg2(a, v1)
13212 v.AddArg(v0)
13213 return true
13214 }
13215
13216
13217
13218 for {
13219 a := v_0
13220 if v_1.Op != OpARM64MOVDconst {
13221 break
13222 }
13223 c := auxIntToInt64(v_1.AuxInt)
13224 x := v_2
13225 if !(c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c)) {
13226 break
13227 }
13228 v.reset(OpARM64MOVWUreg)
13229 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
13230 v0.AuxInt = int64ToAuxInt(log64(c / 3))
13231 v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
13232 v1.AuxInt = int64ToAuxInt(2)
13233 v1.AddArg2(x, x)
13234 v0.AddArg2(a, v1)
13235 v.AddArg(v0)
13236 return true
13237 }
13238
13239
13240
13241 for {
13242 a := v_0
13243 if v_1.Op != OpARM64MOVDconst {
13244 break
13245 }
13246 c := auxIntToInt64(v_1.AuxInt)
13247 x := v_2
13248 if !(c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c)) {
13249 break
13250 }
13251 v.reset(OpARM64MOVWUreg)
13252 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
13253 v0.AuxInt = int64ToAuxInt(log64(c / 5))
13254 v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
13255 v1.AuxInt = int64ToAuxInt(2)
13256 v1.AddArg2(x, x)
13257 v0.AddArg2(a, v1)
13258 v.AddArg(v0)
13259 return true
13260 }
13261
13262
13263
13264 for {
13265 a := v_0
13266 if v_1.Op != OpARM64MOVDconst {
13267 break
13268 }
13269 c := auxIntToInt64(v_1.AuxInt)
13270 x := v_2
13271 if !(c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c)) {
13272 break
13273 }
13274 v.reset(OpARM64MOVWUreg)
13275 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
13276 v0.AuxInt = int64ToAuxInt(log64(c / 7))
13277 v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
13278 v1.AuxInt = int64ToAuxInt(3)
13279 v1.AddArg2(x, x)
13280 v0.AddArg2(a, v1)
13281 v.AddArg(v0)
13282 return true
13283 }
13284
13285
13286
13287 for {
13288 a := v_0
13289 if v_1.Op != OpARM64MOVDconst {
13290 break
13291 }
13292 c := auxIntToInt64(v_1.AuxInt)
13293 x := v_2
13294 if !(c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c)) {
13295 break
13296 }
13297 v.reset(OpARM64MOVWUreg)
13298 v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
13299 v0.AuxInt = int64ToAuxInt(log64(c / 9))
13300 v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
13301 v1.AuxInt = int64ToAuxInt(3)
13302 v1.AddArg2(x, x)
13303 v0.AddArg2(a, v1)
13304 v.AddArg(v0)
13305 return true
13306 }
13307
13308
13309 for {
13310 if v_0.Op != OpARM64MOVDconst {
13311 break
13312 }
13313 c := auxIntToInt64(v_0.AuxInt)
13314 x := v_1
13315 y := v_2
13316 v.reset(OpARM64MOVWUreg)
13317 v0 := b.NewValue0(v.Pos, OpARM64ADDconst, x.Type)
13318 v0.AuxInt = int64ToAuxInt(c)
13319 v1 := b.NewValue0(v.Pos, OpARM64MNEGW, x.Type)
13320 v1.AddArg2(x, y)
13321 v0.AddArg(v1)
13322 v.AddArg(v0)
13323 return true
13324 }
13325
13326
13327 for {
13328 a := v_0
13329 if v_1.Op != OpARM64MOVDconst {
13330 break
13331 }
13332 c := auxIntToInt64(v_1.AuxInt)
13333 if v_2.Op != OpARM64MOVDconst {
13334 break
13335 }
13336 d := auxIntToInt64(v_2.AuxInt)
13337 v.reset(OpARM64MOVWUreg)
13338 v0 := b.NewValue0(v.Pos, OpARM64SUBconst, a.Type)
13339 v0.AuxInt = int64ToAuxInt(c * d)
13340 v0.AddArg(a)
13341 v.AddArg(v0)
13342 return true
13343 }
13344 return false
13345 }
13346 func rewriteValueARM64_OpARM64MUL(v *Value) bool {
13347 v_1 := v.Args[1]
13348 v_0 := v.Args[0]
13349 b := v.Block
13350
13351
13352 for {
13353 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13354 if v_0.Op != OpARM64NEG {
13355 continue
13356 }
13357 x := v_0.Args[0]
13358 y := v_1
13359 v.reset(OpARM64MNEG)
13360 v.AddArg2(x, y)
13361 return true
13362 }
13363 break
13364 }
13365
13366
13367 for {
13368 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13369 x := v_0
13370 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
13371 continue
13372 }
13373 v.reset(OpARM64NEG)
13374 v.AddArg(x)
13375 return true
13376 }
13377 break
13378 }
13379
13380
13381 for {
13382 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13383 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
13384 continue
13385 }
13386 v.reset(OpARM64MOVDconst)
13387 v.AuxInt = int64ToAuxInt(0)
13388 return true
13389 }
13390 break
13391 }
13392
13393
13394 for {
13395 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13396 x := v_0
13397 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
13398 continue
13399 }
13400 v.copyOf(x)
13401 return true
13402 }
13403 break
13404 }
13405
13406
13407
13408 for {
13409 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13410 x := v_0
13411 if v_1.Op != OpARM64MOVDconst {
13412 continue
13413 }
13414 c := auxIntToInt64(v_1.AuxInt)
13415 if !(isPowerOfTwo64(c)) {
13416 continue
13417 }
13418 v.reset(OpARM64SLLconst)
13419 v.AuxInt = int64ToAuxInt(log64(c))
13420 v.AddArg(x)
13421 return true
13422 }
13423 break
13424 }
13425
13426
13427
13428 for {
13429 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13430 x := v_0
13431 if v_1.Op != OpARM64MOVDconst {
13432 continue
13433 }
13434 c := auxIntToInt64(v_1.AuxInt)
13435 if !(isPowerOfTwo64(c-1) && c >= 3) {
13436 continue
13437 }
13438 v.reset(OpARM64ADDshiftLL)
13439 v.AuxInt = int64ToAuxInt(log64(c - 1))
13440 v.AddArg2(x, x)
13441 return true
13442 }
13443 break
13444 }
13445
13446
13447
13448 for {
13449 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13450 x := v_0
13451 if v_1.Op != OpARM64MOVDconst {
13452 continue
13453 }
13454 c := auxIntToInt64(v_1.AuxInt)
13455 if !(isPowerOfTwo64(c+1) && c >= 7) {
13456 continue
13457 }
13458 v.reset(OpARM64ADDshiftLL)
13459 v.AuxInt = int64ToAuxInt(log64(c + 1))
13460 v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
13461 v0.AddArg(x)
13462 v.AddArg2(v0, x)
13463 return true
13464 }
13465 break
13466 }
13467
13468
13469
13470 for {
13471 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13472 x := v_0
13473 if v_1.Op != OpARM64MOVDconst {
13474 continue
13475 }
13476 c := auxIntToInt64(v_1.AuxInt)
13477 if !(c%3 == 0 && isPowerOfTwo64(c/3)) {
13478 continue
13479 }
13480 v.reset(OpARM64SLLconst)
13481 v.AuxInt = int64ToAuxInt(log64(c / 3))
13482 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
13483 v0.AuxInt = int64ToAuxInt(1)
13484 v0.AddArg2(x, x)
13485 v.AddArg(v0)
13486 return true
13487 }
13488 break
13489 }
13490
13491
13492
13493 for {
13494 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13495 x := v_0
13496 if v_1.Op != OpARM64MOVDconst {
13497 continue
13498 }
13499 c := auxIntToInt64(v_1.AuxInt)
13500 if !(c%5 == 0 && isPowerOfTwo64(c/5)) {
13501 continue
13502 }
13503 v.reset(OpARM64SLLconst)
13504 v.AuxInt = int64ToAuxInt(log64(c / 5))
13505 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
13506 v0.AuxInt = int64ToAuxInt(2)
13507 v0.AddArg2(x, x)
13508 v.AddArg(v0)
13509 return true
13510 }
13511 break
13512 }
13513
13514
13515
13516 for {
13517 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13518 x := v_0
13519 if v_1.Op != OpARM64MOVDconst {
13520 continue
13521 }
13522 c := auxIntToInt64(v_1.AuxInt)
13523 if !(c%7 == 0 && isPowerOfTwo64(c/7)) {
13524 continue
13525 }
13526 v.reset(OpARM64SLLconst)
13527 v.AuxInt = int64ToAuxInt(log64(c / 7))
13528 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
13529 v0.AuxInt = int64ToAuxInt(3)
13530 v1 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
13531 v1.AddArg(x)
13532 v0.AddArg2(v1, x)
13533 v.AddArg(v0)
13534 return true
13535 }
13536 break
13537 }
13538
13539
13540
13541 for {
13542 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13543 x := v_0
13544 if v_1.Op != OpARM64MOVDconst {
13545 continue
13546 }
13547 c := auxIntToInt64(v_1.AuxInt)
13548 if !(c%9 == 0 && isPowerOfTwo64(c/9)) {
13549 continue
13550 }
13551 v.reset(OpARM64SLLconst)
13552 v.AuxInt = int64ToAuxInt(log64(c / 9))
13553 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
13554 v0.AuxInt = int64ToAuxInt(3)
13555 v0.AddArg2(x, x)
13556 v.AddArg(v0)
13557 return true
13558 }
13559 break
13560 }
13561
13562
13563 for {
13564 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13565 if v_0.Op != OpARM64MOVDconst {
13566 continue
13567 }
13568 c := auxIntToInt64(v_0.AuxInt)
13569 if v_1.Op != OpARM64MOVDconst {
13570 continue
13571 }
13572 d := auxIntToInt64(v_1.AuxInt)
13573 v.reset(OpARM64MOVDconst)
13574 v.AuxInt = int64ToAuxInt(c * d)
13575 return true
13576 }
13577 break
13578 }
13579 return false
13580 }
13581 func rewriteValueARM64_OpARM64MULW(v *Value) bool {
13582 v_1 := v.Args[1]
13583 v_0 := v.Args[0]
13584 b := v.Block
13585
13586
13587 for {
13588 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13589 if v_0.Op != OpARM64NEG {
13590 continue
13591 }
13592 x := v_0.Args[0]
13593 y := v_1
13594 v.reset(OpARM64MNEGW)
13595 v.AddArg2(x, y)
13596 return true
13597 }
13598 break
13599 }
13600
13601
13602
13603 for {
13604 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13605 x := v_0
13606 if v_1.Op != OpARM64MOVDconst {
13607 continue
13608 }
13609 c := auxIntToInt64(v_1.AuxInt)
13610 if !(int32(c) == -1) {
13611 continue
13612 }
13613 v.reset(OpARM64MOVWUreg)
13614 v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
13615 v0.AddArg(x)
13616 v.AddArg(v0)
13617 return true
13618 }
13619 break
13620 }
13621
13622
13623
13624 for {
13625 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13626 if v_1.Op != OpARM64MOVDconst {
13627 continue
13628 }
13629 c := auxIntToInt64(v_1.AuxInt)
13630 if !(int32(c) == 0) {
13631 continue
13632 }
13633 v.reset(OpARM64MOVDconst)
13634 v.AuxInt = int64ToAuxInt(0)
13635 return true
13636 }
13637 break
13638 }
13639
13640
13641
13642 for {
13643 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13644 x := v_0
13645 if v_1.Op != OpARM64MOVDconst {
13646 continue
13647 }
13648 c := auxIntToInt64(v_1.AuxInt)
13649 if !(int32(c) == 1) {
13650 continue
13651 }
13652 v.reset(OpARM64MOVWUreg)
13653 v.AddArg(x)
13654 return true
13655 }
13656 break
13657 }
13658
13659
13660
13661 for {
13662 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13663 x := v_0
13664 if v_1.Op != OpARM64MOVDconst {
13665 continue
13666 }
13667 c := auxIntToInt64(v_1.AuxInt)
13668 if !(isPowerOfTwo64(c)) {
13669 continue
13670 }
13671 v.reset(OpARM64MOVWUreg)
13672 v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
13673 v0.AuxInt = int64ToAuxInt(log64(c))
13674 v0.AddArg(x)
13675 v.AddArg(v0)
13676 return true
13677 }
13678 break
13679 }
13680
13681
13682
13683 for {
13684 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13685 x := v_0
13686 if v_1.Op != OpARM64MOVDconst {
13687 continue
13688 }
13689 c := auxIntToInt64(v_1.AuxInt)
13690 if !(isPowerOfTwo64(c-1) && int32(c) >= 3) {
13691 continue
13692 }
13693 v.reset(OpARM64MOVWUreg)
13694 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
13695 v0.AuxInt = int64ToAuxInt(log64(c - 1))
13696 v0.AddArg2(x, x)
13697 v.AddArg(v0)
13698 return true
13699 }
13700 break
13701 }
13702
13703
13704
13705 for {
13706 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13707 x := v_0
13708 if v_1.Op != OpARM64MOVDconst {
13709 continue
13710 }
13711 c := auxIntToInt64(v_1.AuxInt)
13712 if !(isPowerOfTwo64(c+1) && int32(c) >= 7) {
13713 continue
13714 }
13715 v.reset(OpARM64MOVWUreg)
13716 v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
13717 v0.AuxInt = int64ToAuxInt(log64(c + 1))
13718 v1 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
13719 v1.AddArg(x)
13720 v0.AddArg2(v1, x)
13721 v.AddArg(v0)
13722 return true
13723 }
13724 break
13725 }
13726
13727
13728
13729 for {
13730 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13731 x := v_0
13732 if v_1.Op != OpARM64MOVDconst {
13733 continue
13734 }
13735 c := auxIntToInt64(v_1.AuxInt)
13736 if !(c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c)) {
13737 continue
13738 }
13739 v.reset(OpARM64MOVWUreg)
13740 v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
13741 v0.AuxInt = int64ToAuxInt(log64(c / 3))
13742 v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
13743 v1.AuxInt = int64ToAuxInt(1)
13744 v1.AddArg2(x, x)
13745 v0.AddArg(v1)
13746 v.AddArg(v0)
13747 return true
13748 }
13749 break
13750 }
13751
13752
13753
13754 for {
13755 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13756 x := v_0
13757 if v_1.Op != OpARM64MOVDconst {
13758 continue
13759 }
13760 c := auxIntToInt64(v_1.AuxInt)
13761 if !(c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c)) {
13762 continue
13763 }
13764 v.reset(OpARM64MOVWUreg)
13765 v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
13766 v0.AuxInt = int64ToAuxInt(log64(c / 5))
13767 v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
13768 v1.AuxInt = int64ToAuxInt(2)
13769 v1.AddArg2(x, x)
13770 v0.AddArg(v1)
13771 v.AddArg(v0)
13772 return true
13773 }
13774 break
13775 }
13776
13777
13778
13779 for {
13780 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13781 x := v_0
13782 if v_1.Op != OpARM64MOVDconst {
13783 continue
13784 }
13785 c := auxIntToInt64(v_1.AuxInt)
13786 if !(c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c)) {
13787 continue
13788 }
13789 v.reset(OpARM64MOVWUreg)
13790 v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
13791 v0.AuxInt = int64ToAuxInt(log64(c / 7))
13792 v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
13793 v1.AuxInt = int64ToAuxInt(3)
13794 v2 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
13795 v2.AddArg(x)
13796 v1.AddArg2(v2, x)
13797 v0.AddArg(v1)
13798 v.AddArg(v0)
13799 return true
13800 }
13801 break
13802 }
13803
13804
13805
13806 for {
13807 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13808 x := v_0
13809 if v_1.Op != OpARM64MOVDconst {
13810 continue
13811 }
13812 c := auxIntToInt64(v_1.AuxInt)
13813 if !(c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c)) {
13814 continue
13815 }
13816 v.reset(OpARM64MOVWUreg)
13817 v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
13818 v0.AuxInt = int64ToAuxInt(log64(c / 9))
13819 v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
13820 v1.AuxInt = int64ToAuxInt(3)
13821 v1.AddArg2(x, x)
13822 v0.AddArg(v1)
13823 v.AddArg(v0)
13824 return true
13825 }
13826 break
13827 }
13828
13829
13830 for {
13831 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13832 if v_0.Op != OpARM64MOVDconst {
13833 continue
13834 }
13835 c := auxIntToInt64(v_0.AuxInt)
13836 if v_1.Op != OpARM64MOVDconst {
13837 continue
13838 }
13839 d := auxIntToInt64(v_1.AuxInt)
13840 v.reset(OpARM64MOVDconst)
13841 v.AuxInt = int64ToAuxInt(int64(uint32(c * d)))
13842 return true
13843 }
13844 break
13845 }
13846 return false
13847 }
13848 func rewriteValueARM64_OpARM64MVN(v *Value) bool {
13849 v_0 := v.Args[0]
13850
13851
13852 for {
13853 if v_0.Op != OpARM64XOR {
13854 break
13855 }
13856 y := v_0.Args[1]
13857 x := v_0.Args[0]
13858 v.reset(OpARM64EON)
13859 v.AddArg2(x, y)
13860 return true
13861 }
13862
13863
13864 for {
13865 if v_0.Op != OpARM64MOVDconst {
13866 break
13867 }
13868 c := auxIntToInt64(v_0.AuxInt)
13869 v.reset(OpARM64MOVDconst)
13870 v.AuxInt = int64ToAuxInt(^c)
13871 return true
13872 }
13873
13874
13875
13876 for {
13877 x := v_0
13878 if x.Op != OpARM64SLLconst {
13879 break
13880 }
13881 c := auxIntToInt64(x.AuxInt)
13882 y := x.Args[0]
13883 if !(clobberIfDead(x)) {
13884 break
13885 }
13886 v.reset(OpARM64MVNshiftLL)
13887 v.AuxInt = int64ToAuxInt(c)
13888 v.AddArg(y)
13889 return true
13890 }
13891
13892
13893
13894 for {
13895 x := v_0
13896 if x.Op != OpARM64SRLconst {
13897 break
13898 }
13899 c := auxIntToInt64(x.AuxInt)
13900 y := x.Args[0]
13901 if !(clobberIfDead(x)) {
13902 break
13903 }
13904 v.reset(OpARM64MVNshiftRL)
13905 v.AuxInt = int64ToAuxInt(c)
13906 v.AddArg(y)
13907 return true
13908 }
13909
13910
13911
13912 for {
13913 x := v_0
13914 if x.Op != OpARM64SRAconst {
13915 break
13916 }
13917 c := auxIntToInt64(x.AuxInt)
13918 y := x.Args[0]
13919 if !(clobberIfDead(x)) {
13920 break
13921 }
13922 v.reset(OpARM64MVNshiftRA)
13923 v.AuxInt = int64ToAuxInt(c)
13924 v.AddArg(y)
13925 return true
13926 }
13927
13928
13929
13930 for {
13931 x := v_0
13932 if x.Op != OpARM64RORconst {
13933 break
13934 }
13935 c := auxIntToInt64(x.AuxInt)
13936 y := x.Args[0]
13937 if !(clobberIfDead(x)) {
13938 break
13939 }
13940 v.reset(OpARM64MVNshiftRO)
13941 v.AuxInt = int64ToAuxInt(c)
13942 v.AddArg(y)
13943 return true
13944 }
13945 return false
13946 }
13947 func rewriteValueARM64_OpARM64MVNshiftLL(v *Value) bool {
13948 v_0 := v.Args[0]
13949
13950
13951 for {
13952 d := auxIntToInt64(v.AuxInt)
13953 if v_0.Op != OpARM64MOVDconst {
13954 break
13955 }
13956 c := auxIntToInt64(v_0.AuxInt)
13957 v.reset(OpARM64MOVDconst)
13958 v.AuxInt = int64ToAuxInt(^int64(uint64(c) << uint64(d)))
13959 return true
13960 }
13961 return false
13962 }
13963 func rewriteValueARM64_OpARM64MVNshiftRA(v *Value) bool {
13964 v_0 := v.Args[0]
13965
13966
13967 for {
13968 d := auxIntToInt64(v.AuxInt)
13969 if v_0.Op != OpARM64MOVDconst {
13970 break
13971 }
13972 c := auxIntToInt64(v_0.AuxInt)
13973 v.reset(OpARM64MOVDconst)
13974 v.AuxInt = int64ToAuxInt(^(c >> uint64(d)))
13975 return true
13976 }
13977 return false
13978 }
13979 func rewriteValueARM64_OpARM64MVNshiftRL(v *Value) bool {
13980 v_0 := v.Args[0]
13981
13982
13983 for {
13984 d := auxIntToInt64(v.AuxInt)
13985 if v_0.Op != OpARM64MOVDconst {
13986 break
13987 }
13988 c := auxIntToInt64(v_0.AuxInt)
13989 v.reset(OpARM64MOVDconst)
13990 v.AuxInt = int64ToAuxInt(^int64(uint64(c) >> uint64(d)))
13991 return true
13992 }
13993 return false
13994 }
13995 func rewriteValueARM64_OpARM64MVNshiftRO(v *Value) bool {
13996 v_0 := v.Args[0]
13997
13998
13999 for {
14000 d := auxIntToInt64(v.AuxInt)
14001 if v_0.Op != OpARM64MOVDconst {
14002 break
14003 }
14004 c := auxIntToInt64(v_0.AuxInt)
14005 v.reset(OpARM64MOVDconst)
14006 v.AuxInt = int64ToAuxInt(^rotateRight64(c, d))
14007 return true
14008 }
14009 return false
14010 }
14011 func rewriteValueARM64_OpARM64NEG(v *Value) bool {
14012 v_0 := v.Args[0]
14013
14014
14015 for {
14016 if v_0.Op != OpARM64MUL {
14017 break
14018 }
14019 y := v_0.Args[1]
14020 x := v_0.Args[0]
14021 v.reset(OpARM64MNEG)
14022 v.AddArg2(x, y)
14023 return true
14024 }
14025
14026
14027
14028 for {
14029 if v_0.Op != OpARM64MULW {
14030 break
14031 }
14032 y := v_0.Args[1]
14033 x := v_0.Args[0]
14034 if !(v.Type.Size() <= 4) {
14035 break
14036 }
14037 v.reset(OpARM64MNEGW)
14038 v.AddArg2(x, y)
14039 return true
14040 }
14041
14042
14043 for {
14044 if v_0.Op != OpARM64NEG {
14045 break
14046 }
14047 x := v_0.Args[0]
14048 v.copyOf(x)
14049 return true
14050 }
14051
14052
14053 for {
14054 if v_0.Op != OpARM64MOVDconst {
14055 break
14056 }
14057 c := auxIntToInt64(v_0.AuxInt)
14058 v.reset(OpARM64MOVDconst)
14059 v.AuxInt = int64ToAuxInt(-c)
14060 return true
14061 }
14062
14063
14064
14065 for {
14066 x := v_0
14067 if x.Op != OpARM64SLLconst {
14068 break
14069 }
14070 c := auxIntToInt64(x.AuxInt)
14071 y := x.Args[0]
14072 if !(clobberIfDead(x)) {
14073 break
14074 }
14075 v.reset(OpARM64NEGshiftLL)
14076 v.AuxInt = int64ToAuxInt(c)
14077 v.AddArg(y)
14078 return true
14079 }
14080
14081
14082
14083 for {
14084 x := v_0
14085 if x.Op != OpARM64SRLconst {
14086 break
14087 }
14088 c := auxIntToInt64(x.AuxInt)
14089 y := x.Args[0]
14090 if !(clobberIfDead(x)) {
14091 break
14092 }
14093 v.reset(OpARM64NEGshiftRL)
14094 v.AuxInt = int64ToAuxInt(c)
14095 v.AddArg(y)
14096 return true
14097 }
14098
14099
14100
14101 for {
14102 x := v_0
14103 if x.Op != OpARM64SRAconst {
14104 break
14105 }
14106 c := auxIntToInt64(x.AuxInt)
14107 y := x.Args[0]
14108 if !(clobberIfDead(x)) {
14109 break
14110 }
14111 v.reset(OpARM64NEGshiftRA)
14112 v.AuxInt = int64ToAuxInt(c)
14113 v.AddArg(y)
14114 return true
14115 }
14116 return false
14117 }
14118 func rewriteValueARM64_OpARM64NEGshiftLL(v *Value) bool {
14119 v_0 := v.Args[0]
14120
14121
14122 for {
14123 d := auxIntToInt64(v.AuxInt)
14124 if v_0.Op != OpARM64MOVDconst {
14125 break
14126 }
14127 c := auxIntToInt64(v_0.AuxInt)
14128 v.reset(OpARM64MOVDconst)
14129 v.AuxInt = int64ToAuxInt(-int64(uint64(c) << uint64(d)))
14130 return true
14131 }
14132 return false
14133 }
14134 func rewriteValueARM64_OpARM64NEGshiftRA(v *Value) bool {
14135 v_0 := v.Args[0]
14136
14137
14138 for {
14139 d := auxIntToInt64(v.AuxInt)
14140 if v_0.Op != OpARM64MOVDconst {
14141 break
14142 }
14143 c := auxIntToInt64(v_0.AuxInt)
14144 v.reset(OpARM64MOVDconst)
14145 v.AuxInt = int64ToAuxInt(-(c >> uint64(d)))
14146 return true
14147 }
14148 return false
14149 }
14150 func rewriteValueARM64_OpARM64NEGshiftRL(v *Value) bool {
14151 v_0 := v.Args[0]
14152
14153
14154 for {
14155 d := auxIntToInt64(v.AuxInt)
14156 if v_0.Op != OpARM64MOVDconst {
14157 break
14158 }
14159 c := auxIntToInt64(v_0.AuxInt)
14160 v.reset(OpARM64MOVDconst)
14161 v.AuxInt = int64ToAuxInt(-int64(uint64(c) >> uint64(d)))
14162 return true
14163 }
14164 return false
14165 }
14166 func rewriteValueARM64_OpARM64NotEqual(v *Value) bool {
14167 v_0 := v.Args[0]
14168 b := v.Block
14169
14170
14171
14172 for {
14173 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
14174 break
14175 }
14176 z := v_0.Args[0]
14177 if z.Op != OpARM64AND {
14178 break
14179 }
14180 y := z.Args[1]
14181 x := z.Args[0]
14182 if !(z.Uses == 1) {
14183 break
14184 }
14185 v.reset(OpARM64NotEqual)
14186 v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
14187 v0.AddArg2(x, y)
14188 v.AddArg(v0)
14189 return true
14190 }
14191
14192
14193
14194 for {
14195 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
14196 break
14197 }
14198 x := v_0.Args[0]
14199 if x.Op != OpARM64ANDconst {
14200 break
14201 }
14202 c := auxIntToInt64(x.AuxInt)
14203 y := x.Args[0]
14204 if !(x.Uses == 1) {
14205 break
14206 }
14207 v.reset(OpARM64NotEqual)
14208 v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
14209 v0.AuxInt = int32ToAuxInt(int32(c))
14210 v0.AddArg(y)
14211 v.AddArg(v0)
14212 return true
14213 }
14214
14215
14216
14217 for {
14218 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
14219 break
14220 }
14221 z := v_0.Args[0]
14222 if z.Op != OpARM64AND {
14223 break
14224 }
14225 y := z.Args[1]
14226 x := z.Args[0]
14227 if !(z.Uses == 1) {
14228 break
14229 }
14230 v.reset(OpARM64NotEqual)
14231 v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
14232 v0.AddArg2(x, y)
14233 v.AddArg(v0)
14234 return true
14235 }
14236
14237
14238
14239 for {
14240 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
14241 break
14242 }
14243 x := v_0.Args[0]
14244 if x.Op != OpARM64ANDconst {
14245 break
14246 }
14247 c := auxIntToInt64(x.AuxInt)
14248 y := x.Args[0]
14249 if !(x.Uses == 1) {
14250 break
14251 }
14252 v.reset(OpARM64NotEqual)
14253 v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
14254 v0.AuxInt = int64ToAuxInt(c)
14255 v0.AddArg(y)
14256 v.AddArg(v0)
14257 return true
14258 }
14259
14260
14261
14262 for {
14263 if v_0.Op != OpARM64CMP {
14264 break
14265 }
14266 _ = v_0.Args[1]
14267 x := v_0.Args[0]
14268 z := v_0.Args[1]
14269 if z.Op != OpARM64NEG {
14270 break
14271 }
14272 y := z.Args[0]
14273 if !(z.Uses == 1) {
14274 break
14275 }
14276 v.reset(OpARM64NotEqual)
14277 v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
14278 v0.AddArg2(x, y)
14279 v.AddArg(v0)
14280 return true
14281 }
14282
14283
14284
14285 for {
14286 if v_0.Op != OpARM64CMPW {
14287 break
14288 }
14289 _ = v_0.Args[1]
14290 x := v_0.Args[0]
14291 z := v_0.Args[1]
14292 if z.Op != OpARM64NEG {
14293 break
14294 }
14295 y := z.Args[0]
14296 if !(z.Uses == 1) {
14297 break
14298 }
14299 v.reset(OpARM64NotEqual)
14300 v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
14301 v0.AddArg2(x, y)
14302 v.AddArg(v0)
14303 return true
14304 }
14305
14306
14307
14308 for {
14309 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
14310 break
14311 }
14312 x := v_0.Args[0]
14313 if x.Op != OpARM64ADDconst {
14314 break
14315 }
14316 c := auxIntToInt64(x.AuxInt)
14317 y := x.Args[0]
14318 if !(x.Uses == 1) {
14319 break
14320 }
14321 v.reset(OpARM64NotEqual)
14322 v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
14323 v0.AuxInt = int64ToAuxInt(c)
14324 v0.AddArg(y)
14325 v.AddArg(v0)
14326 return true
14327 }
14328
14329
14330
14331 for {
14332 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
14333 break
14334 }
14335 x := v_0.Args[0]
14336 if x.Op != OpARM64ADDconst {
14337 break
14338 }
14339 c := auxIntToInt64(x.AuxInt)
14340 y := x.Args[0]
14341 if !(x.Uses == 1) {
14342 break
14343 }
14344 v.reset(OpARM64NotEqual)
14345 v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
14346 v0.AuxInt = int32ToAuxInt(int32(c))
14347 v0.AddArg(y)
14348 v.AddArg(v0)
14349 return true
14350 }
14351
14352
14353
14354 for {
14355 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
14356 break
14357 }
14358 z := v_0.Args[0]
14359 if z.Op != OpARM64ADD {
14360 break
14361 }
14362 y := z.Args[1]
14363 x := z.Args[0]
14364 if !(z.Uses == 1) {
14365 break
14366 }
14367 v.reset(OpARM64NotEqual)
14368 v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
14369 v0.AddArg2(x, y)
14370 v.AddArg(v0)
14371 return true
14372 }
14373
14374
14375
14376 for {
14377 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
14378 break
14379 }
14380 z := v_0.Args[0]
14381 if z.Op != OpARM64ADD {
14382 break
14383 }
14384 y := z.Args[1]
14385 x := z.Args[0]
14386 if !(z.Uses == 1) {
14387 break
14388 }
14389 v.reset(OpARM64NotEqual)
14390 v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
14391 v0.AddArg2(x, y)
14392 v.AddArg(v0)
14393 return true
14394 }
14395
14396
14397
14398 for {
14399 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
14400 break
14401 }
14402 z := v_0.Args[0]
14403 if z.Op != OpARM64MADD {
14404 break
14405 }
14406 y := z.Args[2]
14407 a := z.Args[0]
14408 x := z.Args[1]
14409 if !(z.Uses == 1) {
14410 break
14411 }
14412 v.reset(OpARM64NotEqual)
14413 v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
14414 v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
14415 v1.AddArg2(x, y)
14416 v0.AddArg2(a, v1)
14417 v.AddArg(v0)
14418 return true
14419 }
14420
14421
14422
14423 for {
14424 if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
14425 break
14426 }
14427 z := v_0.Args[0]
14428 if z.Op != OpARM64MSUB {
14429 break
14430 }
14431 y := z.Args[2]
14432 a := z.Args[0]
14433 x := z.Args[1]
14434 if !(z.Uses == 1) {
14435 break
14436 }
14437 v.reset(OpARM64NotEqual)
14438 v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
14439 v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
14440 v1.AddArg2(x, y)
14441 v0.AddArg2(a, v1)
14442 v.AddArg(v0)
14443 return true
14444 }
14445
14446
14447
14448 for {
14449 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
14450 break
14451 }
14452 z := v_0.Args[0]
14453 if z.Op != OpARM64MADDW {
14454 break
14455 }
14456 y := z.Args[2]
14457 a := z.Args[0]
14458 x := z.Args[1]
14459 if !(z.Uses == 1) {
14460 break
14461 }
14462 v.reset(OpARM64NotEqual)
14463 v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
14464 v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
14465 v1.AddArg2(x, y)
14466 v0.AddArg2(a, v1)
14467 v.AddArg(v0)
14468 return true
14469 }
14470
14471
14472
14473 for {
14474 if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
14475 break
14476 }
14477 z := v_0.Args[0]
14478 if z.Op != OpARM64MSUBW {
14479 break
14480 }
14481 y := z.Args[2]
14482 a := z.Args[0]
14483 x := z.Args[1]
14484 if !(z.Uses == 1) {
14485 break
14486 }
14487 v.reset(OpARM64NotEqual)
14488 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
14489 v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
14490 v1.AddArg2(x, y)
14491 v0.AddArg2(a, v1)
14492 v.AddArg(v0)
14493 return true
14494 }
14495
14496
14497 for {
14498 if v_0.Op != OpARM64FlagConstant {
14499 break
14500 }
14501 fc := auxIntToFlagConstant(v_0.AuxInt)
14502 v.reset(OpARM64MOVDconst)
14503 v.AuxInt = int64ToAuxInt(b2i(fc.ne()))
14504 return true
14505 }
14506
14507
14508 for {
14509 if v_0.Op != OpARM64InvertFlags {
14510 break
14511 }
14512 x := v_0.Args[0]
14513 v.reset(OpARM64NotEqual)
14514 v.AddArg(x)
14515 return true
14516 }
14517 return false
14518 }
14519 func rewriteValueARM64_OpARM64OR(v *Value) bool {
14520 v_1 := v.Args[1]
14521 v_0 := v.Args[0]
14522
14523
14524 for {
14525 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
14526 x := v_0
14527 if v_1.Op != OpARM64MOVDconst {
14528 continue
14529 }
14530 c := auxIntToInt64(v_1.AuxInt)
14531 v.reset(OpARM64ORconst)
14532 v.AuxInt = int64ToAuxInt(c)
14533 v.AddArg(x)
14534 return true
14535 }
14536 break
14537 }
14538
14539
14540 for {
14541 x := v_0
14542 if x != v_1 {
14543 break
14544 }
14545 v.copyOf(x)
14546 return true
14547 }
14548
14549
14550 for {
14551 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
14552 x := v_0
14553 if v_1.Op != OpARM64MVN {
14554 continue
14555 }
14556 y := v_1.Args[0]
14557 v.reset(OpARM64ORN)
14558 v.AddArg2(x, y)
14559 return true
14560 }
14561 break
14562 }
14563
14564
14565
14566 for {
14567 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
14568 x0 := v_0
14569 x1 := v_1
14570 if x1.Op != OpARM64SLLconst {
14571 continue
14572 }
14573 c := auxIntToInt64(x1.AuxInt)
14574 y := x1.Args[0]
14575 if !(clobberIfDead(x1)) {
14576 continue
14577 }
14578 v.reset(OpARM64ORshiftLL)
14579 v.AuxInt = int64ToAuxInt(c)
14580 v.AddArg2(x0, y)
14581 return true
14582 }
14583 break
14584 }
14585
14586
14587
14588 for {
14589 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
14590 x0 := v_0
14591 x1 := v_1
14592 if x1.Op != OpARM64SRLconst {
14593 continue
14594 }
14595 c := auxIntToInt64(x1.AuxInt)
14596 y := x1.Args[0]
14597 if !(clobberIfDead(x1)) {
14598 continue
14599 }
14600 v.reset(OpARM64ORshiftRL)
14601 v.AuxInt = int64ToAuxInt(c)
14602 v.AddArg2(x0, y)
14603 return true
14604 }
14605 break
14606 }
14607
14608
14609
14610 for {
14611 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
14612 x0 := v_0
14613 x1 := v_1
14614 if x1.Op != OpARM64SRAconst {
14615 continue
14616 }
14617 c := auxIntToInt64(x1.AuxInt)
14618 y := x1.Args[0]
14619 if !(clobberIfDead(x1)) {
14620 continue
14621 }
14622 v.reset(OpARM64ORshiftRA)
14623 v.AuxInt = int64ToAuxInt(c)
14624 v.AddArg2(x0, y)
14625 return true
14626 }
14627 break
14628 }
14629
14630
14631
14632 for {
14633 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
14634 x0 := v_0
14635 x1 := v_1
14636 if x1.Op != OpARM64RORconst {
14637 continue
14638 }
14639 c := auxIntToInt64(x1.AuxInt)
14640 y := x1.Args[0]
14641 if !(clobberIfDead(x1)) {
14642 continue
14643 }
14644 v.reset(OpARM64ORshiftRO)
14645 v.AuxInt = int64ToAuxInt(c)
14646 v.AddArg2(x0, y)
14647 return true
14648 }
14649 break
14650 }
14651
14652
14653
14654 for {
14655 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
14656 if v_0.Op != OpARM64UBFIZ {
14657 continue
14658 }
14659 bfc := auxIntToArm64BitField(v_0.AuxInt)
14660 x := v_0.Args[0]
14661 if v_1.Op != OpARM64ANDconst {
14662 continue
14663 }
14664 ac := auxIntToInt64(v_1.AuxInt)
14665 y := v_1.Args[0]
14666 if !(ac == ^((1<<uint(bfc.getARM64BFwidth()) - 1) << uint(bfc.getARM64BFlsb()))) {
14667 continue
14668 }
14669 v.reset(OpARM64BFI)
14670 v.AuxInt = arm64BitFieldToAuxInt(bfc)
14671 v.AddArg2(y, x)
14672 return true
14673 }
14674 break
14675 }
14676
14677
14678
14679 for {
14680 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
14681 if v_0.Op != OpARM64UBFX {
14682 continue
14683 }
14684 bfc := auxIntToArm64BitField(v_0.AuxInt)
14685 x := v_0.Args[0]
14686 if v_1.Op != OpARM64ANDconst {
14687 continue
14688 }
14689 ac := auxIntToInt64(v_1.AuxInt)
14690 y := v_1.Args[0]
14691 if !(ac == ^(1<<uint(bfc.getARM64BFwidth()) - 1)) {
14692 continue
14693 }
14694 v.reset(OpARM64BFXIL)
14695 v.AuxInt = arm64BitFieldToAuxInt(bfc)
14696 v.AddArg2(y, x)
14697 return true
14698 }
14699 break
14700 }
14701 return false
14702 }
14703 func rewriteValueARM64_OpARM64ORN(v *Value) bool {
14704 v_1 := v.Args[1]
14705 v_0 := v.Args[0]
14706
14707
14708 for {
14709 x := v_0
14710 if v_1.Op != OpARM64MOVDconst {
14711 break
14712 }
14713 c := auxIntToInt64(v_1.AuxInt)
14714 v.reset(OpARM64ORconst)
14715 v.AuxInt = int64ToAuxInt(^c)
14716 v.AddArg(x)
14717 return true
14718 }
14719
14720
14721 for {
14722 x := v_0
14723 if x != v_1 {
14724 break
14725 }
14726 v.reset(OpARM64MOVDconst)
14727 v.AuxInt = int64ToAuxInt(-1)
14728 return true
14729 }
14730
14731
14732
14733 for {
14734 x0 := v_0
14735 x1 := v_1
14736 if x1.Op != OpARM64SLLconst {
14737 break
14738 }
14739 c := auxIntToInt64(x1.AuxInt)
14740 y := x1.Args[0]
14741 if !(clobberIfDead(x1)) {
14742 break
14743 }
14744 v.reset(OpARM64ORNshiftLL)
14745 v.AuxInt = int64ToAuxInt(c)
14746 v.AddArg2(x0, y)
14747 return true
14748 }
14749
14750
14751
14752 for {
14753 x0 := v_0
14754 x1 := v_1
14755 if x1.Op != OpARM64SRLconst {
14756 break
14757 }
14758 c := auxIntToInt64(x1.AuxInt)
14759 y := x1.Args[0]
14760 if !(clobberIfDead(x1)) {
14761 break
14762 }
14763 v.reset(OpARM64ORNshiftRL)
14764 v.AuxInt = int64ToAuxInt(c)
14765 v.AddArg2(x0, y)
14766 return true
14767 }
14768
14769
14770
14771 for {
14772 x0 := v_0
14773 x1 := v_1
14774 if x1.Op != OpARM64SRAconst {
14775 break
14776 }
14777 c := auxIntToInt64(x1.AuxInt)
14778 y := x1.Args[0]
14779 if !(clobberIfDead(x1)) {
14780 break
14781 }
14782 v.reset(OpARM64ORNshiftRA)
14783 v.AuxInt = int64ToAuxInt(c)
14784 v.AddArg2(x0, y)
14785 return true
14786 }
14787
14788
14789
14790 for {
14791 x0 := v_0
14792 x1 := v_1
14793 if x1.Op != OpARM64RORconst {
14794 break
14795 }
14796 c := auxIntToInt64(x1.AuxInt)
14797 y := x1.Args[0]
14798 if !(clobberIfDead(x1)) {
14799 break
14800 }
14801 v.reset(OpARM64ORNshiftRO)
14802 v.AuxInt = int64ToAuxInt(c)
14803 v.AddArg2(x0, y)
14804 return true
14805 }
14806 return false
14807 }
14808 func rewriteValueARM64_OpARM64ORNshiftLL(v *Value) bool {
14809 v_1 := v.Args[1]
14810 v_0 := v.Args[0]
14811
14812
14813 for {
14814 d := auxIntToInt64(v.AuxInt)
14815 x := v_0
14816 if v_1.Op != OpARM64MOVDconst {
14817 break
14818 }
14819 c := auxIntToInt64(v_1.AuxInt)
14820 v.reset(OpARM64ORconst)
14821 v.AuxInt = int64ToAuxInt(^int64(uint64(c) << uint64(d)))
14822 v.AddArg(x)
14823 return true
14824 }
14825
14826
14827 for {
14828 c := auxIntToInt64(v.AuxInt)
14829 if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
14830 break
14831 }
14832 x := v_0.Args[0]
14833 if x != v_1 {
14834 break
14835 }
14836 v.reset(OpARM64MOVDconst)
14837 v.AuxInt = int64ToAuxInt(-1)
14838 return true
14839 }
14840 return false
14841 }
14842 func rewriteValueARM64_OpARM64ORNshiftRA(v *Value) bool {
14843 v_1 := v.Args[1]
14844 v_0 := v.Args[0]
14845
14846
14847 for {
14848 d := auxIntToInt64(v.AuxInt)
14849 x := v_0
14850 if v_1.Op != OpARM64MOVDconst {
14851 break
14852 }
14853 c := auxIntToInt64(v_1.AuxInt)
14854 v.reset(OpARM64ORconst)
14855 v.AuxInt = int64ToAuxInt(^(c >> uint64(d)))
14856 v.AddArg(x)
14857 return true
14858 }
14859
14860
14861 for {
14862 c := auxIntToInt64(v.AuxInt)
14863 if v_0.Op != OpARM64SRAconst || auxIntToInt64(v_0.AuxInt) != c {
14864 break
14865 }
14866 x := v_0.Args[0]
14867 if x != v_1 {
14868 break
14869 }
14870 v.reset(OpARM64MOVDconst)
14871 v.AuxInt = int64ToAuxInt(-1)
14872 return true
14873 }
14874 return false
14875 }
14876 func rewriteValueARM64_OpARM64ORNshiftRL(v *Value) bool {
14877 v_1 := v.Args[1]
14878 v_0 := v.Args[0]
14879
14880
14881 for {
14882 d := auxIntToInt64(v.AuxInt)
14883 x := v_0
14884 if v_1.Op != OpARM64MOVDconst {
14885 break
14886 }
14887 c := auxIntToInt64(v_1.AuxInt)
14888 v.reset(OpARM64ORconst)
14889 v.AuxInt = int64ToAuxInt(^int64(uint64(c) >> uint64(d)))
14890 v.AddArg(x)
14891 return true
14892 }
14893
14894
14895 for {
14896 c := auxIntToInt64(v.AuxInt)
14897 if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
14898 break
14899 }
14900 x := v_0.Args[0]
14901 if x != v_1 {
14902 break
14903 }
14904 v.reset(OpARM64MOVDconst)
14905 v.AuxInt = int64ToAuxInt(-1)
14906 return true
14907 }
14908 return false
14909 }
14910 func rewriteValueARM64_OpARM64ORNshiftRO(v *Value) bool {
14911 v_1 := v.Args[1]
14912 v_0 := v.Args[0]
14913
14914
14915 for {
14916 d := auxIntToInt64(v.AuxInt)
14917 x := v_0
14918 if v_1.Op != OpARM64MOVDconst {
14919 break
14920 }
14921 c := auxIntToInt64(v_1.AuxInt)
14922 v.reset(OpARM64ORconst)
14923 v.AuxInt = int64ToAuxInt(^rotateRight64(c, d))
14924 v.AddArg(x)
14925 return true
14926 }
14927
14928
14929 for {
14930 c := auxIntToInt64(v.AuxInt)
14931 if v_0.Op != OpARM64RORconst || auxIntToInt64(v_0.AuxInt) != c {
14932 break
14933 }
14934 x := v_0.Args[0]
14935 if x != v_1 {
14936 break
14937 }
14938 v.reset(OpARM64MOVDconst)
14939 v.AuxInt = int64ToAuxInt(-1)
14940 return true
14941 }
14942 return false
14943 }
14944 func rewriteValueARM64_OpARM64ORconst(v *Value) bool {
14945 v_0 := v.Args[0]
14946
14947
14948 for {
14949 if auxIntToInt64(v.AuxInt) != 0 {
14950 break
14951 }
14952 x := v_0
14953 v.copyOf(x)
14954 return true
14955 }
14956
14957
14958 for {
14959 if auxIntToInt64(v.AuxInt) != -1 {
14960 break
14961 }
14962 v.reset(OpARM64MOVDconst)
14963 v.AuxInt = int64ToAuxInt(-1)
14964 return true
14965 }
14966
14967
14968 for {
14969 c := auxIntToInt64(v.AuxInt)
14970 if v_0.Op != OpARM64MOVDconst {
14971 break
14972 }
14973 d := auxIntToInt64(v_0.AuxInt)
14974 v.reset(OpARM64MOVDconst)
14975 v.AuxInt = int64ToAuxInt(c | d)
14976 return true
14977 }
14978
14979
14980 for {
14981 c := auxIntToInt64(v.AuxInt)
14982 if v_0.Op != OpARM64ORconst {
14983 break
14984 }
14985 d := auxIntToInt64(v_0.AuxInt)
14986 x := v_0.Args[0]
14987 v.reset(OpARM64ORconst)
14988 v.AuxInt = int64ToAuxInt(c | d)
14989 v.AddArg(x)
14990 return true
14991 }
14992
14993
14994
14995 for {
14996 c1 := auxIntToInt64(v.AuxInt)
14997 if v_0.Op != OpARM64ANDconst {
14998 break
14999 }
15000 c2 := auxIntToInt64(v_0.AuxInt)
15001 x := v_0.Args[0]
15002 if !(c2|c1 == ^0) {
15003 break
15004 }
15005 v.reset(OpARM64ORconst)
15006 v.AuxInt = int64ToAuxInt(c1)
15007 v.AddArg(x)
15008 return true
15009 }
15010 return false
15011 }
15012 func rewriteValueARM64_OpARM64ORshiftLL(v *Value) bool {
15013 v_1 := v.Args[1]
15014 v_0 := v.Args[0]
15015 b := v.Block
15016 typ := &b.Func.Config.Types
15017
15018
15019 for {
15020 d := auxIntToInt64(v.AuxInt)
15021 if v_0.Op != OpARM64MOVDconst {
15022 break
15023 }
15024 c := auxIntToInt64(v_0.AuxInt)
15025 x := v_1
15026 v.reset(OpARM64ORconst)
15027 v.AuxInt = int64ToAuxInt(c)
15028 v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
15029 v0.AuxInt = int64ToAuxInt(d)
15030 v0.AddArg(x)
15031 v.AddArg(v0)
15032 return true
15033 }
15034
15035
15036 for {
15037 d := auxIntToInt64(v.AuxInt)
15038 x := v_0
15039 if v_1.Op != OpARM64MOVDconst {
15040 break
15041 }
15042 c := auxIntToInt64(v_1.AuxInt)
15043 v.reset(OpARM64ORconst)
15044 v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
15045 v.AddArg(x)
15046 return true
15047 }
15048
15049
15050 for {
15051 c := auxIntToInt64(v.AuxInt)
15052 y := v_0
15053 if y.Op != OpARM64SLLconst || auxIntToInt64(y.AuxInt) != c {
15054 break
15055 }
15056 x := y.Args[0]
15057 if x != v_1 {
15058 break
15059 }
15060 v.copyOf(y)
15061 return true
15062 }
15063
15064
15065 for {
15066 if v.Type != typ.UInt16 || auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64UBFX || v_0.Type != typ.UInt16 || auxIntToArm64BitField(v_0.AuxInt) != armBFAuxInt(8, 8) {
15067 break
15068 }
15069 x := v_0.Args[0]
15070 if x != v_1 {
15071 break
15072 }
15073 v.reset(OpARM64REV16W)
15074 v.AddArg(x)
15075 return true
15076 }
15077
15078
15079
15080 for {
15081 if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64UBFX || auxIntToArm64BitField(v_0.AuxInt) != armBFAuxInt(8, 24) {
15082 break
15083 }
15084 v_0_0 := v_0.Args[0]
15085 if v_0_0.Op != OpARM64ANDconst {
15086 break
15087 }
15088 c1 := auxIntToInt64(v_0_0.AuxInt)
15089 x := v_0_0.Args[0]
15090 if v_1.Op != OpARM64ANDconst {
15091 break
15092 }
15093 c2 := auxIntToInt64(v_1.AuxInt)
15094 if x != v_1.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
15095 break
15096 }
15097 v.reset(OpARM64REV16W)
15098 v.AddArg(x)
15099 return true
15100 }
15101
15102
15103
15104 for {
15105 if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
15106 break
15107 }
15108 v_0_0 := v_0.Args[0]
15109 if v_0_0.Op != OpARM64ANDconst {
15110 break
15111 }
15112 c1 := auxIntToInt64(v_0_0.AuxInt)
15113 x := v_0_0.Args[0]
15114 if v_1.Op != OpARM64ANDconst {
15115 break
15116 }
15117 c2 := auxIntToInt64(v_1.AuxInt)
15118 if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
15119 break
15120 }
15121 v.reset(OpARM64REV16)
15122 v.AddArg(x)
15123 return true
15124 }
15125
15126
15127
15128 for {
15129 if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
15130 break
15131 }
15132 v_0_0 := v_0.Args[0]
15133 if v_0_0.Op != OpARM64ANDconst {
15134 break
15135 }
15136 c1 := auxIntToInt64(v_0_0.AuxInt)
15137 x := v_0_0.Args[0]
15138 if v_1.Op != OpARM64ANDconst {
15139 break
15140 }
15141 c2 := auxIntToInt64(v_1.AuxInt)
15142 if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
15143 break
15144 }
15145 v.reset(OpARM64REV16)
15146 v0 := b.NewValue0(v.Pos, OpARM64ANDconst, x.Type)
15147 v0.AuxInt = int64ToAuxInt(0xffffffff)
15148 v0.AddArg(x)
15149 v.AddArg(v0)
15150 return true
15151 }
15152
15153
15154 for {
15155 c := auxIntToInt64(v.AuxInt)
15156 if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 64-c {
15157 break
15158 }
15159 x := v_0.Args[0]
15160 x2 := v_1
15161 v.reset(OpARM64EXTRconst)
15162 v.AuxInt = int64ToAuxInt(64 - c)
15163 v.AddArg2(x2, x)
15164 return true
15165 }
15166
15167
15168
15169 for {
15170 t := v.Type
15171 c := auxIntToInt64(v.AuxInt)
15172 if v_0.Op != OpARM64UBFX {
15173 break
15174 }
15175 bfc := auxIntToArm64BitField(v_0.AuxInt)
15176 x := v_0.Args[0]
15177 x2 := v_1
15178 if !(c < 32 && t.Size() == 4 && bfc == armBFAuxInt(32-c, c)) {
15179 break
15180 }
15181 v.reset(OpARM64EXTRWconst)
15182 v.AuxInt = int64ToAuxInt(32 - c)
15183 v.AddArg2(x2, x)
15184 return true
15185 }
15186
15187
15188
15189 for {
15190 sc := auxIntToInt64(v.AuxInt)
15191 if v_0.Op != OpARM64UBFX {
15192 break
15193 }
15194 bfc := auxIntToArm64BitField(v_0.AuxInt)
15195 x := v_0.Args[0]
15196 if v_1.Op != OpARM64SRLconst || auxIntToInt64(v_1.AuxInt) != sc {
15197 break
15198 }
15199 y := v_1.Args[0]
15200 if !(sc == bfc.getARM64BFwidth()) {
15201 break
15202 }
15203 v.reset(OpARM64BFXIL)
15204 v.AuxInt = arm64BitFieldToAuxInt(bfc)
15205 v.AddArg2(y, x)
15206 return true
15207 }
15208 return false
15209 }
15210 func rewriteValueARM64_OpARM64ORshiftRA(v *Value) bool {
15211 v_1 := v.Args[1]
15212 v_0 := v.Args[0]
15213 b := v.Block
15214
15215
15216 for {
15217 d := auxIntToInt64(v.AuxInt)
15218 if v_0.Op != OpARM64MOVDconst {
15219 break
15220 }
15221 c := auxIntToInt64(v_0.AuxInt)
15222 x := v_1
15223 v.reset(OpARM64ORconst)
15224 v.AuxInt = int64ToAuxInt(c)
15225 v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
15226 v0.AuxInt = int64ToAuxInt(d)
15227 v0.AddArg(x)
15228 v.AddArg(v0)
15229 return true
15230 }
15231
15232
15233 for {
15234 d := auxIntToInt64(v.AuxInt)
15235 x := v_0
15236 if v_1.Op != OpARM64MOVDconst {
15237 break
15238 }
15239 c := auxIntToInt64(v_1.AuxInt)
15240 v.reset(OpARM64ORconst)
15241 v.AuxInt = int64ToAuxInt(c >> uint64(d))
15242 v.AddArg(x)
15243 return true
15244 }
15245
15246
15247 for {
15248 c := auxIntToInt64(v.AuxInt)
15249 y := v_0
15250 if y.Op != OpARM64SRAconst || auxIntToInt64(y.AuxInt) != c {
15251 break
15252 }
15253 x := y.Args[0]
15254 if x != v_1 {
15255 break
15256 }
15257 v.copyOf(y)
15258 return true
15259 }
15260 return false
15261 }
15262 func rewriteValueARM64_OpARM64ORshiftRL(v *Value) bool {
15263 v_1 := v.Args[1]
15264 v_0 := v.Args[0]
15265 b := v.Block
15266
15267
15268 for {
15269 d := auxIntToInt64(v.AuxInt)
15270 if v_0.Op != OpARM64MOVDconst {
15271 break
15272 }
15273 c := auxIntToInt64(v_0.AuxInt)
15274 x := v_1
15275 v.reset(OpARM64ORconst)
15276 v.AuxInt = int64ToAuxInt(c)
15277 v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
15278 v0.AuxInt = int64ToAuxInt(d)
15279 v0.AddArg(x)
15280 v.AddArg(v0)
15281 return true
15282 }
15283
15284
15285 for {
15286 d := auxIntToInt64(v.AuxInt)
15287 x := v_0
15288 if v_1.Op != OpARM64MOVDconst {
15289 break
15290 }
15291 c := auxIntToInt64(v_1.AuxInt)
15292 v.reset(OpARM64ORconst)
15293 v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
15294 v.AddArg(x)
15295 return true
15296 }
15297
15298
15299 for {
15300 c := auxIntToInt64(v.AuxInt)
15301 y := v_0
15302 if y.Op != OpARM64SRLconst || auxIntToInt64(y.AuxInt) != c {
15303 break
15304 }
15305 x := y.Args[0]
15306 if x != v_1 {
15307 break
15308 }
15309 v.copyOf(y)
15310 return true
15311 }
15312
15313
15314
15315 for {
15316 rc := auxIntToInt64(v.AuxInt)
15317 if v_0.Op != OpARM64ANDconst {
15318 break
15319 }
15320 ac := auxIntToInt64(v_0.AuxInt)
15321 x := v_0.Args[0]
15322 if v_1.Op != OpARM64SLLconst {
15323 break
15324 }
15325 lc := auxIntToInt64(v_1.AuxInt)
15326 y := v_1.Args[0]
15327 if !(lc > rc && ac == ^((1<<uint(64-lc)-1)<<uint64(lc-rc))) {
15328 break
15329 }
15330 v.reset(OpARM64BFI)
15331 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc-rc, 64-lc))
15332 v.AddArg2(x, y)
15333 return true
15334 }
15335
15336
15337
15338 for {
15339 rc := auxIntToInt64(v.AuxInt)
15340 if v_0.Op != OpARM64ANDconst {
15341 break
15342 }
15343 ac := auxIntToInt64(v_0.AuxInt)
15344 y := v_0.Args[0]
15345 if v_1.Op != OpARM64SLLconst {
15346 break
15347 }
15348 lc := auxIntToInt64(v_1.AuxInt)
15349 x := v_1.Args[0]
15350 if !(lc < rc && ac == ^(1<<uint(64-rc)-1)) {
15351 break
15352 }
15353 v.reset(OpARM64BFXIL)
15354 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc-lc, 64-rc))
15355 v.AddArg2(y, x)
15356 return true
15357 }
15358 return false
15359 }
15360 func rewriteValueARM64_OpARM64ORshiftRO(v *Value) bool {
15361 v_1 := v.Args[1]
15362 v_0 := v.Args[0]
15363 b := v.Block
15364
15365
15366 for {
15367 d := auxIntToInt64(v.AuxInt)
15368 if v_0.Op != OpARM64MOVDconst {
15369 break
15370 }
15371 c := auxIntToInt64(v_0.AuxInt)
15372 x := v_1
15373 v.reset(OpARM64ORconst)
15374 v.AuxInt = int64ToAuxInt(c)
15375 v0 := b.NewValue0(v.Pos, OpARM64RORconst, x.Type)
15376 v0.AuxInt = int64ToAuxInt(d)
15377 v0.AddArg(x)
15378 v.AddArg(v0)
15379 return true
15380 }
15381
15382
15383 for {
15384 d := auxIntToInt64(v.AuxInt)
15385 x := v_0
15386 if v_1.Op != OpARM64MOVDconst {
15387 break
15388 }
15389 c := auxIntToInt64(v_1.AuxInt)
15390 v.reset(OpARM64ORconst)
15391 v.AuxInt = int64ToAuxInt(rotateRight64(c, d))
15392 v.AddArg(x)
15393 return true
15394 }
15395
15396
15397 for {
15398 c := auxIntToInt64(v.AuxInt)
15399 y := v_0
15400 if y.Op != OpARM64RORconst || auxIntToInt64(y.AuxInt) != c {
15401 break
15402 }
15403 x := y.Args[0]
15404 if x != v_1 {
15405 break
15406 }
15407 v.copyOf(y)
15408 return true
15409 }
15410 return false
15411 }
15412 func rewriteValueARM64_OpARM64REV(v *Value) bool {
15413 v_0 := v.Args[0]
15414
15415
15416 for {
15417 if v_0.Op != OpARM64REV {
15418 break
15419 }
15420 p := v_0.Args[0]
15421 v.copyOf(p)
15422 return true
15423 }
15424 return false
15425 }
15426 func rewriteValueARM64_OpARM64REVW(v *Value) bool {
15427 v_0 := v.Args[0]
15428
15429
15430 for {
15431 if v_0.Op != OpARM64REVW {
15432 break
15433 }
15434 p := v_0.Args[0]
15435 v.copyOf(p)
15436 return true
15437 }
15438 return false
15439 }
15440 func rewriteValueARM64_OpARM64ROR(v *Value) bool {
15441 v_1 := v.Args[1]
15442 v_0 := v.Args[0]
15443
15444
15445 for {
15446 x := v_0
15447 if v_1.Op != OpARM64MOVDconst {
15448 break
15449 }
15450 c := auxIntToInt64(v_1.AuxInt)
15451 v.reset(OpARM64RORconst)
15452 v.AuxInt = int64ToAuxInt(c & 63)
15453 v.AddArg(x)
15454 return true
15455 }
15456 return false
15457 }
15458 func rewriteValueARM64_OpARM64RORW(v *Value) bool {
15459 v_1 := v.Args[1]
15460 v_0 := v.Args[0]
15461
15462
15463 for {
15464 x := v_0
15465 if v_1.Op != OpARM64MOVDconst {
15466 break
15467 }
15468 c := auxIntToInt64(v_1.AuxInt)
15469 v.reset(OpARM64RORWconst)
15470 v.AuxInt = int64ToAuxInt(c & 31)
15471 v.AddArg(x)
15472 return true
15473 }
15474 return false
15475 }
15476 func rewriteValueARM64_OpARM64SBCSflags(v *Value) bool {
15477 v_2 := v.Args[2]
15478 v_1 := v.Args[1]
15479 v_0 := v.Args[0]
15480 b := v.Block
15481 typ := &b.Func.Config.Types
15482
15483
15484 for {
15485 x := v_0
15486 y := v_1
15487 if v_2.Op != OpSelect1 || v_2.Type != types.TypeFlags {
15488 break
15489 }
15490 v_2_0 := v_2.Args[0]
15491 if v_2_0.Op != OpARM64NEGSflags {
15492 break
15493 }
15494 v_2_0_0 := v_2_0.Args[0]
15495 if v_2_0_0.Op != OpARM64NEG || v_2_0_0.Type != typ.UInt64 {
15496 break
15497 }
15498 v_2_0_0_0 := v_2_0_0.Args[0]
15499 if v_2_0_0_0.Op != OpARM64NGCzerocarry || v_2_0_0_0.Type != typ.UInt64 {
15500 break
15501 }
15502 bo := v_2_0_0_0.Args[0]
15503 v.reset(OpARM64SBCSflags)
15504 v.AddArg3(x, y, bo)
15505 return true
15506 }
15507
15508
15509 for {
15510 x := v_0
15511 y := v_1
15512 if v_2.Op != OpSelect1 || v_2.Type != types.TypeFlags {
15513 break
15514 }
15515 v_2_0 := v_2.Args[0]
15516 if v_2_0.Op != OpARM64NEGSflags {
15517 break
15518 }
15519 v_2_0_0 := v_2_0.Args[0]
15520 if v_2_0_0.Op != OpARM64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
15521 break
15522 }
15523 v.reset(OpARM64SUBSflags)
15524 v.AddArg2(x, y)
15525 return true
15526 }
15527 return false
15528 }
15529 func rewriteValueARM64_OpARM64SLL(v *Value) bool {
15530 v_1 := v.Args[1]
15531 v_0 := v.Args[0]
15532
15533
15534 for {
15535 x := v_0
15536 if v_1.Op != OpARM64MOVDconst {
15537 break
15538 }
15539 c := auxIntToInt64(v_1.AuxInt)
15540 v.reset(OpARM64SLLconst)
15541 v.AuxInt = int64ToAuxInt(c & 63)
15542 v.AddArg(x)
15543 return true
15544 }
15545
15546
15547 for {
15548 x := v_0
15549 if v_1.Op != OpARM64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
15550 break
15551 }
15552 y := v_1.Args[0]
15553 v.reset(OpARM64SLL)
15554 v.AddArg2(x, y)
15555 return true
15556 }
15557 return false
15558 }
15559 func rewriteValueARM64_OpARM64SLLconst(v *Value) bool {
15560 v_0 := v.Args[0]
15561
15562
15563 for {
15564 c := auxIntToInt64(v.AuxInt)
15565 if v_0.Op != OpARM64MOVDconst {
15566 break
15567 }
15568 d := auxIntToInt64(v_0.AuxInt)
15569 v.reset(OpARM64MOVDconst)
15570 v.AuxInt = int64ToAuxInt(d << uint64(c))
15571 return true
15572 }
15573
15574
15575
15576 for {
15577 c := auxIntToInt64(v.AuxInt)
15578 if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
15579 break
15580 }
15581 x := v_0.Args[0]
15582 if !(0 < c && c < 64) {
15583 break
15584 }
15585 v.reset(OpARM64ANDconst)
15586 v.AuxInt = int64ToAuxInt(^(1<<uint(c) - 1))
15587 v.AddArg(x)
15588 return true
15589 }
15590
15591
15592 for {
15593 lc := auxIntToInt64(v.AuxInt)
15594 if v_0.Op != OpARM64MOVWreg {
15595 break
15596 }
15597 x := v_0.Args[0]
15598 v.reset(OpARM64SBFIZ)
15599 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(32, 64-lc)))
15600 v.AddArg(x)
15601 return true
15602 }
15603
15604
15605 for {
15606 lc := auxIntToInt64(v.AuxInt)
15607 if v_0.Op != OpARM64MOVHreg {
15608 break
15609 }
15610 x := v_0.Args[0]
15611 v.reset(OpARM64SBFIZ)
15612 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(16, 64-lc)))
15613 v.AddArg(x)
15614 return true
15615 }
15616
15617
15618 for {
15619 lc := auxIntToInt64(v.AuxInt)
15620 if v_0.Op != OpARM64MOVBreg {
15621 break
15622 }
15623 x := v_0.Args[0]
15624 v.reset(OpARM64SBFIZ)
15625 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(8, 64-lc)))
15626 v.AddArg(x)
15627 return true
15628 }
15629
15630
15631 for {
15632 lc := auxIntToInt64(v.AuxInt)
15633 if v_0.Op != OpARM64MOVWUreg {
15634 break
15635 }
15636 x := v_0.Args[0]
15637 v.reset(OpARM64UBFIZ)
15638 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(32, 64-lc)))
15639 v.AddArg(x)
15640 return true
15641 }
15642
15643
15644 for {
15645 lc := auxIntToInt64(v.AuxInt)
15646 if v_0.Op != OpARM64MOVHUreg {
15647 break
15648 }
15649 x := v_0.Args[0]
15650 v.reset(OpARM64UBFIZ)
15651 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(16, 64-lc)))
15652 v.AddArg(x)
15653 return true
15654 }
15655
15656
15657 for {
15658 lc := auxIntToInt64(v.AuxInt)
15659 if v_0.Op != OpARM64MOVBUreg {
15660 break
15661 }
15662 x := v_0.Args[0]
15663 v.reset(OpARM64UBFIZ)
15664 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(8, 64-lc)))
15665 v.AddArg(x)
15666 return true
15667 }
15668
15669
15670
15671 for {
15672 sc := auxIntToInt64(v.AuxInt)
15673 if v_0.Op != OpARM64ANDconst {
15674 break
15675 }
15676 ac := auxIntToInt64(v_0.AuxInt)
15677 x := v_0.Args[0]
15678 if !(isARM64BFMask(sc, ac, 0)) {
15679 break
15680 }
15681 v.reset(OpARM64UBFIZ)
15682 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc, arm64BFWidth(ac, 0)))
15683 v.AddArg(x)
15684 return true
15685 }
15686
15687
15688
15689 for {
15690 sc := auxIntToInt64(v.AuxInt)
15691 if v_0.Op != OpARM64UBFIZ {
15692 break
15693 }
15694 bfc := auxIntToArm64BitField(v_0.AuxInt)
15695 x := v_0.Args[0]
15696 if !(sc+bfc.getARM64BFwidth()+bfc.getARM64BFlsb() < 64) {
15697 break
15698 }
15699 v.reset(OpARM64UBFIZ)
15700 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.getARM64BFlsb()+sc, bfc.getARM64BFwidth()))
15701 v.AddArg(x)
15702 return true
15703 }
15704 return false
15705 }
15706 func rewriteValueARM64_OpARM64SRA(v *Value) bool {
15707 v_1 := v.Args[1]
15708 v_0 := v.Args[0]
15709
15710
15711 for {
15712 x := v_0
15713 if v_1.Op != OpARM64MOVDconst {
15714 break
15715 }
15716 c := auxIntToInt64(v_1.AuxInt)
15717 v.reset(OpARM64SRAconst)
15718 v.AuxInt = int64ToAuxInt(c & 63)
15719 v.AddArg(x)
15720 return true
15721 }
15722
15723
15724 for {
15725 x := v_0
15726 if v_1.Op != OpARM64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
15727 break
15728 }
15729 y := v_1.Args[0]
15730 v.reset(OpARM64SRA)
15731 v.AddArg2(x, y)
15732 return true
15733 }
15734 return false
15735 }
15736 func rewriteValueARM64_OpARM64SRAconst(v *Value) bool {
15737 v_0 := v.Args[0]
15738
15739
15740 for {
15741 c := auxIntToInt64(v.AuxInt)
15742 if v_0.Op != OpARM64MOVDconst {
15743 break
15744 }
15745 d := auxIntToInt64(v_0.AuxInt)
15746 v.reset(OpARM64MOVDconst)
15747 v.AuxInt = int64ToAuxInt(d >> uint64(c))
15748 return true
15749 }
15750
15751
15752
15753 for {
15754 rc := auxIntToInt64(v.AuxInt)
15755 if v_0.Op != OpARM64SLLconst {
15756 break
15757 }
15758 lc := auxIntToInt64(v_0.AuxInt)
15759 x := v_0.Args[0]
15760 if !(lc > rc) {
15761 break
15762 }
15763 v.reset(OpARM64SBFIZ)
15764 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc-rc, 64-lc))
15765 v.AddArg(x)
15766 return true
15767 }
15768
15769
15770
15771 for {
15772 rc := auxIntToInt64(v.AuxInt)
15773 if v_0.Op != OpARM64SLLconst {
15774 break
15775 }
15776 lc := auxIntToInt64(v_0.AuxInt)
15777 x := v_0.Args[0]
15778 if !(lc <= rc) {
15779 break
15780 }
15781 v.reset(OpARM64SBFX)
15782 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc-lc, 64-rc))
15783 v.AddArg(x)
15784 return true
15785 }
15786
15787
15788
15789 for {
15790 rc := auxIntToInt64(v.AuxInt)
15791 if v_0.Op != OpARM64MOVWreg {
15792 break
15793 }
15794 x := v_0.Args[0]
15795 if !(rc < 32) {
15796 break
15797 }
15798 v.reset(OpARM64SBFX)
15799 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 32-rc))
15800 v.AddArg(x)
15801 return true
15802 }
15803
15804
15805
15806 for {
15807 rc := auxIntToInt64(v.AuxInt)
15808 if v_0.Op != OpARM64MOVHreg {
15809 break
15810 }
15811 x := v_0.Args[0]
15812 if !(rc < 16) {
15813 break
15814 }
15815 v.reset(OpARM64SBFX)
15816 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 16-rc))
15817 v.AddArg(x)
15818 return true
15819 }
15820
15821
15822
15823 for {
15824 rc := auxIntToInt64(v.AuxInt)
15825 if v_0.Op != OpARM64MOVBreg {
15826 break
15827 }
15828 x := v_0.Args[0]
15829 if !(rc < 8) {
15830 break
15831 }
15832 v.reset(OpARM64SBFX)
15833 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 8-rc))
15834 v.AddArg(x)
15835 return true
15836 }
15837
15838
15839
15840 for {
15841 sc := auxIntToInt64(v.AuxInt)
15842 if v_0.Op != OpARM64SBFIZ {
15843 break
15844 }
15845 bfc := auxIntToArm64BitField(v_0.AuxInt)
15846 x := v_0.Args[0]
15847 if !(sc < bfc.getARM64BFlsb()) {
15848 break
15849 }
15850 v.reset(OpARM64SBFIZ)
15851 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.getARM64BFlsb()-sc, bfc.getARM64BFwidth()))
15852 v.AddArg(x)
15853 return true
15854 }
15855
15856
15857
15858 for {
15859 sc := auxIntToInt64(v.AuxInt)
15860 if v_0.Op != OpARM64SBFIZ {
15861 break
15862 }
15863 bfc := auxIntToArm64BitField(v_0.AuxInt)
15864 x := v_0.Args[0]
15865 if !(sc >= bfc.getARM64BFlsb() && sc < bfc.getARM64BFlsb()+bfc.getARM64BFwidth()) {
15866 break
15867 }
15868 v.reset(OpARM64SBFX)
15869 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc-bfc.getARM64BFlsb(), bfc.getARM64BFlsb()+bfc.getARM64BFwidth()-sc))
15870 v.AddArg(x)
15871 return true
15872 }
15873 return false
15874 }
15875 func rewriteValueARM64_OpARM64SRL(v *Value) bool {
15876 v_1 := v.Args[1]
15877 v_0 := v.Args[0]
15878
15879
15880 for {
15881 x := v_0
15882 if v_1.Op != OpARM64MOVDconst {
15883 break
15884 }
15885 c := auxIntToInt64(v_1.AuxInt)
15886 v.reset(OpARM64SRLconst)
15887 v.AuxInt = int64ToAuxInt(c & 63)
15888 v.AddArg(x)
15889 return true
15890 }
15891
15892
15893 for {
15894 x := v_0
15895 if v_1.Op != OpARM64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
15896 break
15897 }
15898 y := v_1.Args[0]
15899 v.reset(OpARM64SRL)
15900 v.AddArg2(x, y)
15901 return true
15902 }
15903 return false
15904 }
15905 func rewriteValueARM64_OpARM64SRLconst(v *Value) bool {
15906 v_0 := v.Args[0]
15907
15908
15909 for {
15910 c := auxIntToInt64(v.AuxInt)
15911 if v_0.Op != OpARM64MOVDconst {
15912 break
15913 }
15914 d := auxIntToInt64(v_0.AuxInt)
15915 v.reset(OpARM64MOVDconst)
15916 v.AuxInt = int64ToAuxInt(int64(uint64(d) >> uint64(c)))
15917 return true
15918 }
15919
15920
15921
15922 for {
15923 c := auxIntToInt64(v.AuxInt)
15924 if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
15925 break
15926 }
15927 x := v_0.Args[0]
15928 if !(0 < c && c < 64) {
15929 break
15930 }
15931 v.reset(OpARM64ANDconst)
15932 v.AuxInt = int64ToAuxInt(1<<uint(64-c) - 1)
15933 v.AddArg(x)
15934 return true
15935 }
15936
15937
15938
15939 for {
15940 rc := auxIntToInt64(v.AuxInt)
15941 if v_0.Op != OpARM64MOVWUreg {
15942 break
15943 }
15944 if !(rc >= 32) {
15945 break
15946 }
15947 v.reset(OpARM64MOVDconst)
15948 v.AuxInt = int64ToAuxInt(0)
15949 return true
15950 }
15951
15952
15953
15954 for {
15955 rc := auxIntToInt64(v.AuxInt)
15956 if v_0.Op != OpARM64MOVHUreg {
15957 break
15958 }
15959 if !(rc >= 16) {
15960 break
15961 }
15962 v.reset(OpARM64MOVDconst)
15963 v.AuxInt = int64ToAuxInt(0)
15964 return true
15965 }
15966
15967
15968
15969 for {
15970 rc := auxIntToInt64(v.AuxInt)
15971 if v_0.Op != OpARM64MOVBUreg {
15972 break
15973 }
15974 if !(rc >= 8) {
15975 break
15976 }
15977 v.reset(OpARM64MOVDconst)
15978 v.AuxInt = int64ToAuxInt(0)
15979 return true
15980 }
15981
15982
15983
15984 for {
15985 rc := auxIntToInt64(v.AuxInt)
15986 if v_0.Op != OpARM64SLLconst {
15987 break
15988 }
15989 lc := auxIntToInt64(v_0.AuxInt)
15990 x := v_0.Args[0]
15991 if !(lc > rc) {
15992 break
15993 }
15994 v.reset(OpARM64UBFIZ)
15995 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc-rc, 64-lc))
15996 v.AddArg(x)
15997 return true
15998 }
15999
16000
16001
16002 for {
16003 rc := auxIntToInt64(v.AuxInt)
16004 if v_0.Op != OpARM64SLLconst {
16005 break
16006 }
16007 lc := auxIntToInt64(v_0.AuxInt)
16008 x := v_0.Args[0]
16009 if !(lc < rc) {
16010 break
16011 }
16012 v.reset(OpARM64UBFX)
16013 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc-lc, 64-rc))
16014 v.AddArg(x)
16015 return true
16016 }
16017
16018
16019
16020 for {
16021 rc := auxIntToInt64(v.AuxInt)
16022 if v_0.Op != OpARM64MOVWUreg {
16023 break
16024 }
16025 x := v_0.Args[0]
16026 if !(rc < 32) {
16027 break
16028 }
16029 v.reset(OpARM64UBFX)
16030 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 32-rc))
16031 v.AddArg(x)
16032 return true
16033 }
16034
16035
16036
16037 for {
16038 rc := auxIntToInt64(v.AuxInt)
16039 if v_0.Op != OpARM64MOVHUreg {
16040 break
16041 }
16042 x := v_0.Args[0]
16043 if !(rc < 16) {
16044 break
16045 }
16046 v.reset(OpARM64UBFX)
16047 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 16-rc))
16048 v.AddArg(x)
16049 return true
16050 }
16051
16052
16053
16054 for {
16055 rc := auxIntToInt64(v.AuxInt)
16056 if v_0.Op != OpARM64MOVBUreg {
16057 break
16058 }
16059 x := v_0.Args[0]
16060 if !(rc < 8) {
16061 break
16062 }
16063 v.reset(OpARM64UBFX)
16064 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 8-rc))
16065 v.AddArg(x)
16066 return true
16067 }
16068
16069
16070
16071 for {
16072 sc := auxIntToInt64(v.AuxInt)
16073 if v_0.Op != OpARM64ANDconst {
16074 break
16075 }
16076 ac := auxIntToInt64(v_0.AuxInt)
16077 x := v_0.Args[0]
16078 if !(isARM64BFMask(sc, ac, sc)) {
16079 break
16080 }
16081 v.reset(OpARM64UBFX)
16082 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc, arm64BFWidth(ac, sc)))
16083 v.AddArg(x)
16084 return true
16085 }
16086
16087
16088
16089 for {
16090 sc := auxIntToInt64(v.AuxInt)
16091 if v_0.Op != OpARM64UBFX {
16092 break
16093 }
16094 bfc := auxIntToArm64BitField(v_0.AuxInt)
16095 x := v_0.Args[0]
16096 if !(sc < bfc.getARM64BFwidth()) {
16097 break
16098 }
16099 v.reset(OpARM64UBFX)
16100 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.getARM64BFlsb()+sc, bfc.getARM64BFwidth()-sc))
16101 v.AddArg(x)
16102 return true
16103 }
16104
16105
16106
16107 for {
16108 sc := auxIntToInt64(v.AuxInt)
16109 if v_0.Op != OpARM64UBFIZ {
16110 break
16111 }
16112 bfc := auxIntToArm64BitField(v_0.AuxInt)
16113 x := v_0.Args[0]
16114 if !(sc == bfc.getARM64BFlsb()) {
16115 break
16116 }
16117 v.reset(OpARM64ANDconst)
16118 v.AuxInt = int64ToAuxInt(1<<uint(bfc.getARM64BFwidth()) - 1)
16119 v.AddArg(x)
16120 return true
16121 }
16122
16123
16124
16125 for {
16126 sc := auxIntToInt64(v.AuxInt)
16127 if v_0.Op != OpARM64UBFIZ {
16128 break
16129 }
16130 bfc := auxIntToArm64BitField(v_0.AuxInt)
16131 x := v_0.Args[0]
16132 if !(sc < bfc.getARM64BFlsb()) {
16133 break
16134 }
16135 v.reset(OpARM64UBFIZ)
16136 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.getARM64BFlsb()-sc, bfc.getARM64BFwidth()))
16137 v.AddArg(x)
16138 return true
16139 }
16140
16141
16142
16143 for {
16144 sc := auxIntToInt64(v.AuxInt)
16145 if v_0.Op != OpARM64UBFIZ {
16146 break
16147 }
16148 bfc := auxIntToArm64BitField(v_0.AuxInt)
16149 x := v_0.Args[0]
16150 if !(sc > bfc.getARM64BFlsb() && sc < bfc.getARM64BFlsb()+bfc.getARM64BFwidth()) {
16151 break
16152 }
16153 v.reset(OpARM64UBFX)
16154 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc-bfc.getARM64BFlsb(), bfc.getARM64BFlsb()+bfc.getARM64BFwidth()-sc))
16155 v.AddArg(x)
16156 return true
16157 }
16158 return false
16159 }
16160 func rewriteValueARM64_OpARM64STP(v *Value) bool {
16161 v_3 := v.Args[3]
16162 v_2 := v.Args[2]
16163 v_1 := v.Args[1]
16164 v_0 := v.Args[0]
16165 b := v.Block
16166 config := b.Func.Config
16167
16168
16169
16170 for {
16171 off1 := auxIntToInt32(v.AuxInt)
16172 sym := auxToSym(v.Aux)
16173 if v_0.Op != OpARM64ADDconst {
16174 break
16175 }
16176 off2 := auxIntToInt64(v_0.AuxInt)
16177 ptr := v_0.Args[0]
16178 val1 := v_1
16179 val2 := v_2
16180 mem := v_3
16181 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
16182 break
16183 }
16184 v.reset(OpARM64STP)
16185 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
16186 v.Aux = symToAux(sym)
16187 v.AddArg4(ptr, val1, val2, mem)
16188 return true
16189 }
16190
16191
16192
16193 for {
16194 off1 := auxIntToInt32(v.AuxInt)
16195 sym1 := auxToSym(v.Aux)
16196 if v_0.Op != OpARM64MOVDaddr {
16197 break
16198 }
16199 off2 := auxIntToInt32(v_0.AuxInt)
16200 sym2 := auxToSym(v_0.Aux)
16201 ptr := v_0.Args[0]
16202 val1 := v_1
16203 val2 := v_2
16204 mem := v_3
16205 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
16206 break
16207 }
16208 v.reset(OpARM64STP)
16209 v.AuxInt = int32ToAuxInt(off1 + off2)
16210 v.Aux = symToAux(mergeSym(sym1, sym2))
16211 v.AddArg4(ptr, val1, val2, mem)
16212 return true
16213 }
16214
16215
16216 for {
16217 off := auxIntToInt32(v.AuxInt)
16218 sym := auxToSym(v.Aux)
16219 ptr := v_0
16220 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 || v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
16221 break
16222 }
16223 mem := v_3
16224 v.reset(OpARM64MOVQstorezero)
16225 v.AuxInt = int32ToAuxInt(off)
16226 v.Aux = symToAux(sym)
16227 v.AddArg2(ptr, mem)
16228 return true
16229 }
16230 return false
16231 }
16232 func rewriteValueARM64_OpARM64SUB(v *Value) bool {
16233 v_1 := v.Args[1]
16234 v_0 := v.Args[0]
16235 b := v.Block
16236
16237
16238 for {
16239 x := v_0
16240 if v_1.Op != OpARM64MOVDconst {
16241 break
16242 }
16243 c := auxIntToInt64(v_1.AuxInt)
16244 v.reset(OpARM64SUBconst)
16245 v.AuxInt = int64ToAuxInt(c)
16246 v.AddArg(x)
16247 return true
16248 }
16249
16250
16251
16252 for {
16253 a := v_0
16254 l := v_1
16255 if l.Op != OpARM64MUL {
16256 break
16257 }
16258 y := l.Args[1]
16259 x := l.Args[0]
16260 if !(l.Uses == 1 && clobber(l)) {
16261 break
16262 }
16263 v.reset(OpARM64MSUB)
16264 v.AddArg3(a, x, y)
16265 return true
16266 }
16267
16268
16269
16270 for {
16271 a := v_0
16272 l := v_1
16273 if l.Op != OpARM64MNEG {
16274 break
16275 }
16276 y := l.Args[1]
16277 x := l.Args[0]
16278 if !(l.Uses == 1 && clobber(l)) {
16279 break
16280 }
16281 v.reset(OpARM64MADD)
16282 v.AddArg3(a, x, y)
16283 return true
16284 }
16285
16286
16287
16288 for {
16289 a := v_0
16290 l := v_1
16291 if l.Op != OpARM64MULW {
16292 break
16293 }
16294 y := l.Args[1]
16295 x := l.Args[0]
16296 if !(v.Type.Size() <= 4 && l.Uses == 1 && clobber(l)) {
16297 break
16298 }
16299 v.reset(OpARM64MSUBW)
16300 v.AddArg3(a, x, y)
16301 return true
16302 }
16303
16304
16305
16306 for {
16307 a := v_0
16308 l := v_1
16309 if l.Op != OpARM64MNEGW {
16310 break
16311 }
16312 y := l.Args[1]
16313 x := l.Args[0]
16314 if !(v.Type.Size() <= 4 && l.Uses == 1 && clobber(l)) {
16315 break
16316 }
16317 v.reset(OpARM64MADDW)
16318 v.AddArg3(a, x, y)
16319 return true
16320 }
16321
16322
16323 for {
16324 x := v_0
16325 if x != v_1 {
16326 break
16327 }
16328 v.reset(OpARM64MOVDconst)
16329 v.AuxInt = int64ToAuxInt(0)
16330 return true
16331 }
16332
16333
16334 for {
16335 x := v_0
16336 if v_1.Op != OpARM64SUB {
16337 break
16338 }
16339 z := v_1.Args[1]
16340 y := v_1.Args[0]
16341 v.reset(OpARM64SUB)
16342 v0 := b.NewValue0(v.Pos, OpARM64ADD, v.Type)
16343 v0.AddArg2(x, z)
16344 v.AddArg2(v0, y)
16345 return true
16346 }
16347
16348
16349 for {
16350 if v_0.Op != OpARM64SUB {
16351 break
16352 }
16353 y := v_0.Args[1]
16354 x := v_0.Args[0]
16355 z := v_1
16356 v.reset(OpARM64SUB)
16357 v0 := b.NewValue0(v.Pos, OpARM64ADD, y.Type)
16358 v0.AddArg2(y, z)
16359 v.AddArg2(x, v0)
16360 return true
16361 }
16362
16363
16364
16365 for {
16366 x0 := v_0
16367 x1 := v_1
16368 if x1.Op != OpARM64SLLconst {
16369 break
16370 }
16371 c := auxIntToInt64(x1.AuxInt)
16372 y := x1.Args[0]
16373 if !(clobberIfDead(x1)) {
16374 break
16375 }
16376 v.reset(OpARM64SUBshiftLL)
16377 v.AuxInt = int64ToAuxInt(c)
16378 v.AddArg2(x0, y)
16379 return true
16380 }
16381
16382
16383
16384 for {
16385 x0 := v_0
16386 x1 := v_1
16387 if x1.Op != OpARM64SRLconst {
16388 break
16389 }
16390 c := auxIntToInt64(x1.AuxInt)
16391 y := x1.Args[0]
16392 if !(clobberIfDead(x1)) {
16393 break
16394 }
16395 v.reset(OpARM64SUBshiftRL)
16396 v.AuxInt = int64ToAuxInt(c)
16397 v.AddArg2(x0, y)
16398 return true
16399 }
16400
16401
16402
16403 for {
16404 x0 := v_0
16405 x1 := v_1
16406 if x1.Op != OpARM64SRAconst {
16407 break
16408 }
16409 c := auxIntToInt64(x1.AuxInt)
16410 y := x1.Args[0]
16411 if !(clobberIfDead(x1)) {
16412 break
16413 }
16414 v.reset(OpARM64SUBshiftRA)
16415 v.AuxInt = int64ToAuxInt(c)
16416 v.AddArg2(x0, y)
16417 return true
16418 }
16419 return false
16420 }
16421 func rewriteValueARM64_OpARM64SUBconst(v *Value) bool {
16422 v_0 := v.Args[0]
16423
16424
16425 for {
16426 if auxIntToInt64(v.AuxInt) != 0 {
16427 break
16428 }
16429 x := v_0
16430 v.copyOf(x)
16431 return true
16432 }
16433
16434
16435 for {
16436 c := auxIntToInt64(v.AuxInt)
16437 if v_0.Op != OpARM64MOVDconst {
16438 break
16439 }
16440 d := auxIntToInt64(v_0.AuxInt)
16441 v.reset(OpARM64MOVDconst)
16442 v.AuxInt = int64ToAuxInt(d - c)
16443 return true
16444 }
16445
16446
16447 for {
16448 c := auxIntToInt64(v.AuxInt)
16449 if v_0.Op != OpARM64SUBconst {
16450 break
16451 }
16452 d := auxIntToInt64(v_0.AuxInt)
16453 x := v_0.Args[0]
16454 v.reset(OpARM64ADDconst)
16455 v.AuxInt = int64ToAuxInt(-c - d)
16456 v.AddArg(x)
16457 return true
16458 }
16459
16460
16461 for {
16462 c := auxIntToInt64(v.AuxInt)
16463 if v_0.Op != OpARM64ADDconst {
16464 break
16465 }
16466 d := auxIntToInt64(v_0.AuxInt)
16467 x := v_0.Args[0]
16468 v.reset(OpARM64ADDconst)
16469 v.AuxInt = int64ToAuxInt(-c + d)
16470 v.AddArg(x)
16471 return true
16472 }
16473 return false
16474 }
16475 func rewriteValueARM64_OpARM64SUBshiftLL(v *Value) bool {
16476 v_1 := v.Args[1]
16477 v_0 := v.Args[0]
16478
16479
16480 for {
16481 d := auxIntToInt64(v.AuxInt)
16482 x := v_0
16483 if v_1.Op != OpARM64MOVDconst {
16484 break
16485 }
16486 c := auxIntToInt64(v_1.AuxInt)
16487 v.reset(OpARM64SUBconst)
16488 v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
16489 v.AddArg(x)
16490 return true
16491 }
16492
16493
16494 for {
16495 c := auxIntToInt64(v.AuxInt)
16496 if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
16497 break
16498 }
16499 x := v_0.Args[0]
16500 if x != v_1 {
16501 break
16502 }
16503 v.reset(OpARM64MOVDconst)
16504 v.AuxInt = int64ToAuxInt(0)
16505 return true
16506 }
16507 return false
16508 }
16509 func rewriteValueARM64_OpARM64SUBshiftRA(v *Value) bool {
16510 v_1 := v.Args[1]
16511 v_0 := v.Args[0]
16512
16513
16514 for {
16515 d := auxIntToInt64(v.AuxInt)
16516 x := v_0
16517 if v_1.Op != OpARM64MOVDconst {
16518 break
16519 }
16520 c := auxIntToInt64(v_1.AuxInt)
16521 v.reset(OpARM64SUBconst)
16522 v.AuxInt = int64ToAuxInt(c >> uint64(d))
16523 v.AddArg(x)
16524 return true
16525 }
16526
16527
16528 for {
16529 c := auxIntToInt64(v.AuxInt)
16530 if v_0.Op != OpARM64SRAconst || auxIntToInt64(v_0.AuxInt) != c {
16531 break
16532 }
16533 x := v_0.Args[0]
16534 if x != v_1 {
16535 break
16536 }
16537 v.reset(OpARM64MOVDconst)
16538 v.AuxInt = int64ToAuxInt(0)
16539 return true
16540 }
16541 return false
16542 }
16543 func rewriteValueARM64_OpARM64SUBshiftRL(v *Value) bool {
16544 v_1 := v.Args[1]
16545 v_0 := v.Args[0]
16546
16547
16548 for {
16549 d := auxIntToInt64(v.AuxInt)
16550 x := v_0
16551 if v_1.Op != OpARM64MOVDconst {
16552 break
16553 }
16554 c := auxIntToInt64(v_1.AuxInt)
16555 v.reset(OpARM64SUBconst)
16556 v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
16557 v.AddArg(x)
16558 return true
16559 }
16560
16561
16562 for {
16563 c := auxIntToInt64(v.AuxInt)
16564 if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
16565 break
16566 }
16567 x := v_0.Args[0]
16568 if x != v_1 {
16569 break
16570 }
16571 v.reset(OpARM64MOVDconst)
16572 v.AuxInt = int64ToAuxInt(0)
16573 return true
16574 }
16575 return false
16576 }
16577 func rewriteValueARM64_OpARM64TST(v *Value) bool {
16578 v_1 := v.Args[1]
16579 v_0 := v.Args[0]
16580
16581
16582 for {
16583 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16584 x := v_0
16585 if v_1.Op != OpARM64MOVDconst {
16586 continue
16587 }
16588 c := auxIntToInt64(v_1.AuxInt)
16589 v.reset(OpARM64TSTconst)
16590 v.AuxInt = int64ToAuxInt(c)
16591 v.AddArg(x)
16592 return true
16593 }
16594 break
16595 }
16596
16597
16598
16599 for {
16600 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16601 x0 := v_0
16602 x1 := v_1
16603 if x1.Op != OpARM64SLLconst {
16604 continue
16605 }
16606 c := auxIntToInt64(x1.AuxInt)
16607 y := x1.Args[0]
16608 if !(clobberIfDead(x1)) {
16609 continue
16610 }
16611 v.reset(OpARM64TSTshiftLL)
16612 v.AuxInt = int64ToAuxInt(c)
16613 v.AddArg2(x0, y)
16614 return true
16615 }
16616 break
16617 }
16618
16619
16620
16621 for {
16622 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16623 x0 := v_0
16624 x1 := v_1
16625 if x1.Op != OpARM64SRLconst {
16626 continue
16627 }
16628 c := auxIntToInt64(x1.AuxInt)
16629 y := x1.Args[0]
16630 if !(clobberIfDead(x1)) {
16631 continue
16632 }
16633 v.reset(OpARM64TSTshiftRL)
16634 v.AuxInt = int64ToAuxInt(c)
16635 v.AddArg2(x0, y)
16636 return true
16637 }
16638 break
16639 }
16640
16641
16642
16643 for {
16644 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16645 x0 := v_0
16646 x1 := v_1
16647 if x1.Op != OpARM64SRAconst {
16648 continue
16649 }
16650 c := auxIntToInt64(x1.AuxInt)
16651 y := x1.Args[0]
16652 if !(clobberIfDead(x1)) {
16653 continue
16654 }
16655 v.reset(OpARM64TSTshiftRA)
16656 v.AuxInt = int64ToAuxInt(c)
16657 v.AddArg2(x0, y)
16658 return true
16659 }
16660 break
16661 }
16662
16663
16664
16665 for {
16666 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16667 x0 := v_0
16668 x1 := v_1
16669 if x1.Op != OpARM64RORconst {
16670 continue
16671 }
16672 c := auxIntToInt64(x1.AuxInt)
16673 y := x1.Args[0]
16674 if !(clobberIfDead(x1)) {
16675 continue
16676 }
16677 v.reset(OpARM64TSTshiftRO)
16678 v.AuxInt = int64ToAuxInt(c)
16679 v.AddArg2(x0, y)
16680 return true
16681 }
16682 break
16683 }
16684 return false
16685 }
16686 func rewriteValueARM64_OpARM64TSTW(v *Value) bool {
16687 v_1 := v.Args[1]
16688 v_0 := v.Args[0]
16689
16690
16691 for {
16692 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16693 x := v_0
16694 if v_1.Op != OpARM64MOVDconst {
16695 continue
16696 }
16697 c := auxIntToInt64(v_1.AuxInt)
16698 v.reset(OpARM64TSTWconst)
16699 v.AuxInt = int32ToAuxInt(int32(c))
16700 v.AddArg(x)
16701 return true
16702 }
16703 break
16704 }
16705 return false
16706 }
16707 func rewriteValueARM64_OpARM64TSTWconst(v *Value) bool {
16708 v_0 := v.Args[0]
16709
16710
16711 for {
16712 y := auxIntToInt32(v.AuxInt)
16713 if v_0.Op != OpARM64MOVDconst {
16714 break
16715 }
16716 x := auxIntToInt64(v_0.AuxInt)
16717 v.reset(OpARM64FlagConstant)
16718 v.AuxInt = flagConstantToAuxInt(logicFlags32(int32(x) & y))
16719 return true
16720 }
16721 return false
16722 }
16723 func rewriteValueARM64_OpARM64TSTconst(v *Value) bool {
16724 v_0 := v.Args[0]
16725
16726
16727 for {
16728 y := auxIntToInt64(v.AuxInt)
16729 if v_0.Op != OpARM64MOVDconst {
16730 break
16731 }
16732 x := auxIntToInt64(v_0.AuxInt)
16733 v.reset(OpARM64FlagConstant)
16734 v.AuxInt = flagConstantToAuxInt(logicFlags64(x & y))
16735 return true
16736 }
16737 return false
16738 }
16739 func rewriteValueARM64_OpARM64TSTshiftLL(v *Value) bool {
16740 v_1 := v.Args[1]
16741 v_0 := v.Args[0]
16742 b := v.Block
16743
16744
16745 for {
16746 d := auxIntToInt64(v.AuxInt)
16747 if v_0.Op != OpARM64MOVDconst {
16748 break
16749 }
16750 c := auxIntToInt64(v_0.AuxInt)
16751 x := v_1
16752 v.reset(OpARM64TSTconst)
16753 v.AuxInt = int64ToAuxInt(c)
16754 v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
16755 v0.AuxInt = int64ToAuxInt(d)
16756 v0.AddArg(x)
16757 v.AddArg(v0)
16758 return true
16759 }
16760
16761
16762 for {
16763 d := auxIntToInt64(v.AuxInt)
16764 x := v_0
16765 if v_1.Op != OpARM64MOVDconst {
16766 break
16767 }
16768 c := auxIntToInt64(v_1.AuxInt)
16769 v.reset(OpARM64TSTconst)
16770 v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
16771 v.AddArg(x)
16772 return true
16773 }
16774 return false
16775 }
16776 func rewriteValueARM64_OpARM64TSTshiftRA(v *Value) bool {
16777 v_1 := v.Args[1]
16778 v_0 := v.Args[0]
16779 b := v.Block
16780
16781
16782 for {
16783 d := auxIntToInt64(v.AuxInt)
16784 if v_0.Op != OpARM64MOVDconst {
16785 break
16786 }
16787 c := auxIntToInt64(v_0.AuxInt)
16788 x := v_1
16789 v.reset(OpARM64TSTconst)
16790 v.AuxInt = int64ToAuxInt(c)
16791 v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
16792 v0.AuxInt = int64ToAuxInt(d)
16793 v0.AddArg(x)
16794 v.AddArg(v0)
16795 return true
16796 }
16797
16798
16799 for {
16800 d := auxIntToInt64(v.AuxInt)
16801 x := v_0
16802 if v_1.Op != OpARM64MOVDconst {
16803 break
16804 }
16805 c := auxIntToInt64(v_1.AuxInt)
16806 v.reset(OpARM64TSTconst)
16807 v.AuxInt = int64ToAuxInt(c >> uint64(d))
16808 v.AddArg(x)
16809 return true
16810 }
16811 return false
16812 }
16813 func rewriteValueARM64_OpARM64TSTshiftRL(v *Value) bool {
16814 v_1 := v.Args[1]
16815 v_0 := v.Args[0]
16816 b := v.Block
16817
16818
16819 for {
16820 d := auxIntToInt64(v.AuxInt)
16821 if v_0.Op != OpARM64MOVDconst {
16822 break
16823 }
16824 c := auxIntToInt64(v_0.AuxInt)
16825 x := v_1
16826 v.reset(OpARM64TSTconst)
16827 v.AuxInt = int64ToAuxInt(c)
16828 v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
16829 v0.AuxInt = int64ToAuxInt(d)
16830 v0.AddArg(x)
16831 v.AddArg(v0)
16832 return true
16833 }
16834
16835
16836 for {
16837 d := auxIntToInt64(v.AuxInt)
16838 x := v_0
16839 if v_1.Op != OpARM64MOVDconst {
16840 break
16841 }
16842 c := auxIntToInt64(v_1.AuxInt)
16843 v.reset(OpARM64TSTconst)
16844 v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
16845 v.AddArg(x)
16846 return true
16847 }
16848 return false
16849 }
16850 func rewriteValueARM64_OpARM64TSTshiftRO(v *Value) bool {
16851 v_1 := v.Args[1]
16852 v_0 := v.Args[0]
16853 b := v.Block
16854
16855
16856 for {
16857 d := auxIntToInt64(v.AuxInt)
16858 if v_0.Op != OpARM64MOVDconst {
16859 break
16860 }
16861 c := auxIntToInt64(v_0.AuxInt)
16862 x := v_1
16863 v.reset(OpARM64TSTconst)
16864 v.AuxInt = int64ToAuxInt(c)
16865 v0 := b.NewValue0(v.Pos, OpARM64RORconst, x.Type)
16866 v0.AuxInt = int64ToAuxInt(d)
16867 v0.AddArg(x)
16868 v.AddArg(v0)
16869 return true
16870 }
16871
16872
16873 for {
16874 d := auxIntToInt64(v.AuxInt)
16875 x := v_0
16876 if v_1.Op != OpARM64MOVDconst {
16877 break
16878 }
16879 c := auxIntToInt64(v_1.AuxInt)
16880 v.reset(OpARM64TSTconst)
16881 v.AuxInt = int64ToAuxInt(rotateRight64(c, d))
16882 v.AddArg(x)
16883 return true
16884 }
16885 return false
16886 }
16887 func rewriteValueARM64_OpARM64UBFIZ(v *Value) bool {
16888 v_0 := v.Args[0]
16889
16890
16891
16892 for {
16893 bfc := auxIntToArm64BitField(v.AuxInt)
16894 if v_0.Op != OpARM64SLLconst {
16895 break
16896 }
16897 sc := auxIntToInt64(v_0.AuxInt)
16898 x := v_0.Args[0]
16899 if !(sc < bfc.getARM64BFwidth()) {
16900 break
16901 }
16902 v.reset(OpARM64UBFIZ)
16903 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.getARM64BFlsb()+sc, bfc.getARM64BFwidth()-sc))
16904 v.AddArg(x)
16905 return true
16906 }
16907 return false
16908 }
16909 func rewriteValueARM64_OpARM64UBFX(v *Value) bool {
16910 v_0 := v.Args[0]
16911
16912
16913
16914 for {
16915 bfc := auxIntToArm64BitField(v.AuxInt)
16916 if v_0.Op != OpARM64ANDconst {
16917 break
16918 }
16919 c := auxIntToInt64(v_0.AuxInt)
16920 x := v_0.Args[0]
16921 if !(isARM64BFMask(0, c, 0) && bfc.getARM64BFlsb()+bfc.getARM64BFwidth() <= arm64BFWidth(c, 0)) {
16922 break
16923 }
16924 v.reset(OpARM64UBFX)
16925 v.AuxInt = arm64BitFieldToAuxInt(bfc)
16926 v.AddArg(x)
16927 return true
16928 }
16929
16930
16931
16932 for {
16933 bfc := auxIntToArm64BitField(v.AuxInt)
16934 if v_0.Op != OpARM64SRLconst {
16935 break
16936 }
16937 sc := auxIntToInt64(v_0.AuxInt)
16938 x := v_0.Args[0]
16939 if !(sc+bfc.getARM64BFwidth()+bfc.getARM64BFlsb() < 64) {
16940 break
16941 }
16942 v.reset(OpARM64UBFX)
16943 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.getARM64BFlsb()+sc, bfc.getARM64BFwidth()))
16944 v.AddArg(x)
16945 return true
16946 }
16947
16948
16949
16950 for {
16951 bfc := auxIntToArm64BitField(v.AuxInt)
16952 if v_0.Op != OpARM64SLLconst {
16953 break
16954 }
16955 sc := auxIntToInt64(v_0.AuxInt)
16956 x := v_0.Args[0]
16957 if !(sc == bfc.getARM64BFlsb()) {
16958 break
16959 }
16960 v.reset(OpARM64ANDconst)
16961 v.AuxInt = int64ToAuxInt(1<<uint(bfc.getARM64BFwidth()) - 1)
16962 v.AddArg(x)
16963 return true
16964 }
16965
16966
16967
16968 for {
16969 bfc := auxIntToArm64BitField(v.AuxInt)
16970 if v_0.Op != OpARM64SLLconst {
16971 break
16972 }
16973 sc := auxIntToInt64(v_0.AuxInt)
16974 x := v_0.Args[0]
16975 if !(sc < bfc.getARM64BFlsb()) {
16976 break
16977 }
16978 v.reset(OpARM64UBFX)
16979 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.getARM64BFlsb()-sc, bfc.getARM64BFwidth()))
16980 v.AddArg(x)
16981 return true
16982 }
16983
16984
16985
16986 for {
16987 bfc := auxIntToArm64BitField(v.AuxInt)
16988 if v_0.Op != OpARM64SLLconst {
16989 break
16990 }
16991 sc := auxIntToInt64(v_0.AuxInt)
16992 x := v_0.Args[0]
16993 if !(sc > bfc.getARM64BFlsb() && sc < bfc.getARM64BFlsb()+bfc.getARM64BFwidth()) {
16994 break
16995 }
16996 v.reset(OpARM64UBFIZ)
16997 v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc-bfc.getARM64BFlsb(), bfc.getARM64BFlsb()+bfc.getARM64BFwidth()-sc))
16998 v.AddArg(x)
16999 return true
17000 }
17001 return false
17002 }
17003 func rewriteValueARM64_OpARM64UDIV(v *Value) bool {
17004 v_1 := v.Args[1]
17005 v_0 := v.Args[0]
17006
17007
17008 for {
17009 x := v_0
17010 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
17011 break
17012 }
17013 v.copyOf(x)
17014 return true
17015 }
17016
17017
17018
17019 for {
17020 x := v_0
17021 if v_1.Op != OpARM64MOVDconst {
17022 break
17023 }
17024 c := auxIntToInt64(v_1.AuxInt)
17025 if !(isPowerOfTwo64(c)) {
17026 break
17027 }
17028 v.reset(OpARM64SRLconst)
17029 v.AuxInt = int64ToAuxInt(log64(c))
17030 v.AddArg(x)
17031 return true
17032 }
17033
17034
17035
17036 for {
17037 if v_0.Op != OpARM64MOVDconst {
17038 break
17039 }
17040 c := auxIntToInt64(v_0.AuxInt)
17041 if v_1.Op != OpARM64MOVDconst {
17042 break
17043 }
17044 d := auxIntToInt64(v_1.AuxInt)
17045 if !(d != 0) {
17046 break
17047 }
17048 v.reset(OpARM64MOVDconst)
17049 v.AuxInt = int64ToAuxInt(int64(uint64(c) / uint64(d)))
17050 return true
17051 }
17052 return false
17053 }
17054 func rewriteValueARM64_OpARM64UDIVW(v *Value) bool {
17055 v_1 := v.Args[1]
17056 v_0 := v.Args[0]
17057 b := v.Block
17058
17059
17060
17061 for {
17062 x := v_0
17063 if v_1.Op != OpARM64MOVDconst {
17064 break
17065 }
17066 c := auxIntToInt64(v_1.AuxInt)
17067 if !(uint32(c) == 1) {
17068 break
17069 }
17070 v.reset(OpARM64MOVWUreg)
17071 v.AddArg(x)
17072 return true
17073 }
17074
17075
17076
17077 for {
17078 x := v_0
17079 if v_1.Op != OpARM64MOVDconst {
17080 break
17081 }
17082 c := auxIntToInt64(v_1.AuxInt)
17083 if !(isPowerOfTwo64(c) && is32Bit(c)) {
17084 break
17085 }
17086 v.reset(OpARM64SRLconst)
17087 v.AuxInt = int64ToAuxInt(log64(c))
17088 v0 := b.NewValue0(v.Pos, OpARM64MOVWUreg, v.Type)
17089 v0.AddArg(x)
17090 v.AddArg(v0)
17091 return true
17092 }
17093
17094
17095
17096 for {
17097 if v_0.Op != OpARM64MOVDconst {
17098 break
17099 }
17100 c := auxIntToInt64(v_0.AuxInt)
17101 if v_1.Op != OpARM64MOVDconst {
17102 break
17103 }
17104 d := auxIntToInt64(v_1.AuxInt)
17105 if !(d != 0) {
17106 break
17107 }
17108 v.reset(OpARM64MOVDconst)
17109 v.AuxInt = int64ToAuxInt(int64(uint32(c) / uint32(d)))
17110 return true
17111 }
17112 return false
17113 }
17114 func rewriteValueARM64_OpARM64UMOD(v *Value) bool {
17115 v_1 := v.Args[1]
17116 v_0 := v.Args[0]
17117 b := v.Block
17118 typ := &b.Func.Config.Types
17119
17120
17121 for {
17122 if v.Type != typ.UInt64 {
17123 break
17124 }
17125 x := v_0
17126 y := v_1
17127 v.reset(OpARM64MSUB)
17128 v.Type = typ.UInt64
17129 v0 := b.NewValue0(v.Pos, OpARM64UDIV, typ.UInt64)
17130 v0.AddArg2(x, y)
17131 v.AddArg3(x, y, v0)
17132 return true
17133 }
17134
17135
17136 for {
17137 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
17138 break
17139 }
17140 v.reset(OpARM64MOVDconst)
17141 v.AuxInt = int64ToAuxInt(0)
17142 return true
17143 }
17144
17145
17146
17147 for {
17148 x := v_0
17149 if v_1.Op != OpARM64MOVDconst {
17150 break
17151 }
17152 c := auxIntToInt64(v_1.AuxInt)
17153 if !(isPowerOfTwo64(c)) {
17154 break
17155 }
17156 v.reset(OpARM64ANDconst)
17157 v.AuxInt = int64ToAuxInt(c - 1)
17158 v.AddArg(x)
17159 return true
17160 }
17161
17162
17163
17164 for {
17165 if v_0.Op != OpARM64MOVDconst {
17166 break
17167 }
17168 c := auxIntToInt64(v_0.AuxInt)
17169 if v_1.Op != OpARM64MOVDconst {
17170 break
17171 }
17172 d := auxIntToInt64(v_1.AuxInt)
17173 if !(d != 0) {
17174 break
17175 }
17176 v.reset(OpARM64MOVDconst)
17177 v.AuxInt = int64ToAuxInt(int64(uint64(c) % uint64(d)))
17178 return true
17179 }
17180 return false
17181 }
17182 func rewriteValueARM64_OpARM64UMODW(v *Value) bool {
17183 v_1 := v.Args[1]
17184 v_0 := v.Args[0]
17185 b := v.Block
17186 typ := &b.Func.Config.Types
17187
17188
17189 for {
17190 if v.Type != typ.UInt32 {
17191 break
17192 }
17193 x := v_0
17194 y := v_1
17195 v.reset(OpARM64MSUBW)
17196 v.Type = typ.UInt32
17197 v0 := b.NewValue0(v.Pos, OpARM64UDIVW, typ.UInt32)
17198 v0.AddArg2(x, y)
17199 v.AddArg3(x, y, v0)
17200 return true
17201 }
17202
17203
17204
17205 for {
17206 if v_1.Op != OpARM64MOVDconst {
17207 break
17208 }
17209 c := auxIntToInt64(v_1.AuxInt)
17210 if !(uint32(c) == 1) {
17211 break
17212 }
17213 v.reset(OpARM64MOVDconst)
17214 v.AuxInt = int64ToAuxInt(0)
17215 return true
17216 }
17217
17218
17219
17220 for {
17221 x := v_0
17222 if v_1.Op != OpARM64MOVDconst {
17223 break
17224 }
17225 c := auxIntToInt64(v_1.AuxInt)
17226 if !(isPowerOfTwo64(c) && is32Bit(c)) {
17227 break
17228 }
17229 v.reset(OpARM64ANDconst)
17230 v.AuxInt = int64ToAuxInt(c - 1)
17231 v.AddArg(x)
17232 return true
17233 }
17234
17235
17236
17237 for {
17238 if v_0.Op != OpARM64MOVDconst {
17239 break
17240 }
17241 c := auxIntToInt64(v_0.AuxInt)
17242 if v_1.Op != OpARM64MOVDconst {
17243 break
17244 }
17245 d := auxIntToInt64(v_1.AuxInt)
17246 if !(d != 0) {
17247 break
17248 }
17249 v.reset(OpARM64MOVDconst)
17250 v.AuxInt = int64ToAuxInt(int64(uint32(c) % uint32(d)))
17251 return true
17252 }
17253 return false
17254 }
17255 func rewriteValueARM64_OpARM64XOR(v *Value) bool {
17256 v_1 := v.Args[1]
17257 v_0 := v.Args[0]
17258
17259
17260 for {
17261 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17262 x := v_0
17263 if v_1.Op != OpARM64MOVDconst {
17264 continue
17265 }
17266 c := auxIntToInt64(v_1.AuxInt)
17267 v.reset(OpARM64XORconst)
17268 v.AuxInt = int64ToAuxInt(c)
17269 v.AddArg(x)
17270 return true
17271 }
17272 break
17273 }
17274
17275
17276 for {
17277 x := v_0
17278 if x != v_1 {
17279 break
17280 }
17281 v.reset(OpARM64MOVDconst)
17282 v.AuxInt = int64ToAuxInt(0)
17283 return true
17284 }
17285
17286
17287 for {
17288 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17289 x := v_0
17290 if v_1.Op != OpARM64MVN {
17291 continue
17292 }
17293 y := v_1.Args[0]
17294 v.reset(OpARM64EON)
17295 v.AddArg2(x, y)
17296 return true
17297 }
17298 break
17299 }
17300
17301
17302
17303 for {
17304 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17305 x0 := v_0
17306 x1 := v_1
17307 if x1.Op != OpARM64SLLconst {
17308 continue
17309 }
17310 c := auxIntToInt64(x1.AuxInt)
17311 y := x1.Args[0]
17312 if !(clobberIfDead(x1)) {
17313 continue
17314 }
17315 v.reset(OpARM64XORshiftLL)
17316 v.AuxInt = int64ToAuxInt(c)
17317 v.AddArg2(x0, y)
17318 return true
17319 }
17320 break
17321 }
17322
17323
17324
17325 for {
17326 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17327 x0 := v_0
17328 x1 := v_1
17329 if x1.Op != OpARM64SRLconst {
17330 continue
17331 }
17332 c := auxIntToInt64(x1.AuxInt)
17333 y := x1.Args[0]
17334 if !(clobberIfDead(x1)) {
17335 continue
17336 }
17337 v.reset(OpARM64XORshiftRL)
17338 v.AuxInt = int64ToAuxInt(c)
17339 v.AddArg2(x0, y)
17340 return true
17341 }
17342 break
17343 }
17344
17345
17346
17347 for {
17348 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17349 x0 := v_0
17350 x1 := v_1
17351 if x1.Op != OpARM64SRAconst {
17352 continue
17353 }
17354 c := auxIntToInt64(x1.AuxInt)
17355 y := x1.Args[0]
17356 if !(clobberIfDead(x1)) {
17357 continue
17358 }
17359 v.reset(OpARM64XORshiftRA)
17360 v.AuxInt = int64ToAuxInt(c)
17361 v.AddArg2(x0, y)
17362 return true
17363 }
17364 break
17365 }
17366
17367
17368
17369 for {
17370 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17371 x0 := v_0
17372 x1 := v_1
17373 if x1.Op != OpARM64RORconst {
17374 continue
17375 }
17376 c := auxIntToInt64(x1.AuxInt)
17377 y := x1.Args[0]
17378 if !(clobberIfDead(x1)) {
17379 continue
17380 }
17381 v.reset(OpARM64XORshiftRO)
17382 v.AuxInt = int64ToAuxInt(c)
17383 v.AddArg2(x0, y)
17384 return true
17385 }
17386 break
17387 }
17388 return false
17389 }
17390 func rewriteValueARM64_OpARM64XORconst(v *Value) bool {
17391 v_0 := v.Args[0]
17392
17393
17394 for {
17395 if auxIntToInt64(v.AuxInt) != 0 {
17396 break
17397 }
17398 x := v_0
17399 v.copyOf(x)
17400 return true
17401 }
17402
17403
17404 for {
17405 if auxIntToInt64(v.AuxInt) != -1 {
17406 break
17407 }
17408 x := v_0
17409 v.reset(OpARM64MVN)
17410 v.AddArg(x)
17411 return true
17412 }
17413
17414
17415 for {
17416 c := auxIntToInt64(v.AuxInt)
17417 if v_0.Op != OpARM64MOVDconst {
17418 break
17419 }
17420 d := auxIntToInt64(v_0.AuxInt)
17421 v.reset(OpARM64MOVDconst)
17422 v.AuxInt = int64ToAuxInt(c ^ d)
17423 return true
17424 }
17425
17426
17427 for {
17428 c := auxIntToInt64(v.AuxInt)
17429 if v_0.Op != OpARM64XORconst {
17430 break
17431 }
17432 d := auxIntToInt64(v_0.AuxInt)
17433 x := v_0.Args[0]
17434 v.reset(OpARM64XORconst)
17435 v.AuxInt = int64ToAuxInt(c ^ d)
17436 v.AddArg(x)
17437 return true
17438 }
17439 return false
17440 }
17441 func rewriteValueARM64_OpARM64XORshiftLL(v *Value) bool {
17442 v_1 := v.Args[1]
17443 v_0 := v.Args[0]
17444 b := v.Block
17445 typ := &b.Func.Config.Types
17446
17447
17448 for {
17449 d := auxIntToInt64(v.AuxInt)
17450 if v_0.Op != OpARM64MOVDconst {
17451 break
17452 }
17453 c := auxIntToInt64(v_0.AuxInt)
17454 x := v_1
17455 v.reset(OpARM64XORconst)
17456 v.AuxInt = int64ToAuxInt(c)
17457 v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
17458 v0.AuxInt = int64ToAuxInt(d)
17459 v0.AddArg(x)
17460 v.AddArg(v0)
17461 return true
17462 }
17463
17464
17465 for {
17466 d := auxIntToInt64(v.AuxInt)
17467 x := v_0
17468 if v_1.Op != OpARM64MOVDconst {
17469 break
17470 }
17471 c := auxIntToInt64(v_1.AuxInt)
17472 v.reset(OpARM64XORconst)
17473 v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
17474 v.AddArg(x)
17475 return true
17476 }
17477
17478
17479 for {
17480 c := auxIntToInt64(v.AuxInt)
17481 if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
17482 break
17483 }
17484 x := v_0.Args[0]
17485 if x != v_1 {
17486 break
17487 }
17488 v.reset(OpARM64MOVDconst)
17489 v.AuxInt = int64ToAuxInt(0)
17490 return true
17491 }
17492
17493
17494 for {
17495 if v.Type != typ.UInt16 || auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64UBFX || v_0.Type != typ.UInt16 || auxIntToArm64BitField(v_0.AuxInt) != armBFAuxInt(8, 8) {
17496 break
17497 }
17498 x := v_0.Args[0]
17499 if x != v_1 {
17500 break
17501 }
17502 v.reset(OpARM64REV16W)
17503 v.AddArg(x)
17504 return true
17505 }
17506
17507
17508
17509 for {
17510 if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64UBFX || auxIntToArm64BitField(v_0.AuxInt) != armBFAuxInt(8, 24) {
17511 break
17512 }
17513 v_0_0 := v_0.Args[0]
17514 if v_0_0.Op != OpARM64ANDconst {
17515 break
17516 }
17517 c1 := auxIntToInt64(v_0_0.AuxInt)
17518 x := v_0_0.Args[0]
17519 if v_1.Op != OpARM64ANDconst {
17520 break
17521 }
17522 c2 := auxIntToInt64(v_1.AuxInt)
17523 if x != v_1.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
17524 break
17525 }
17526 v.reset(OpARM64REV16W)
17527 v.AddArg(x)
17528 return true
17529 }
17530
17531
17532
17533 for {
17534 if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
17535 break
17536 }
17537 v_0_0 := v_0.Args[0]
17538 if v_0_0.Op != OpARM64ANDconst {
17539 break
17540 }
17541 c1 := auxIntToInt64(v_0_0.AuxInt)
17542 x := v_0_0.Args[0]
17543 if v_1.Op != OpARM64ANDconst {
17544 break
17545 }
17546 c2 := auxIntToInt64(v_1.AuxInt)
17547 if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
17548 break
17549 }
17550 v.reset(OpARM64REV16)
17551 v.AddArg(x)
17552 return true
17553 }
17554
17555
17556
17557 for {
17558 if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
17559 break
17560 }
17561 v_0_0 := v_0.Args[0]
17562 if v_0_0.Op != OpARM64ANDconst {
17563 break
17564 }
17565 c1 := auxIntToInt64(v_0_0.AuxInt)
17566 x := v_0_0.Args[0]
17567 if v_1.Op != OpARM64ANDconst {
17568 break
17569 }
17570 c2 := auxIntToInt64(v_1.AuxInt)
17571 if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
17572 break
17573 }
17574 v.reset(OpARM64REV16)
17575 v0 := b.NewValue0(v.Pos, OpARM64ANDconst, x.Type)
17576 v0.AuxInt = int64ToAuxInt(0xffffffff)
17577 v0.AddArg(x)
17578 v.AddArg(v0)
17579 return true
17580 }
17581
17582
17583 for {
17584 c := auxIntToInt64(v.AuxInt)
17585 if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 64-c {
17586 break
17587 }
17588 x := v_0.Args[0]
17589 x2 := v_1
17590 v.reset(OpARM64EXTRconst)
17591 v.AuxInt = int64ToAuxInt(64 - c)
17592 v.AddArg2(x2, x)
17593 return true
17594 }
17595
17596
17597
17598 for {
17599 t := v.Type
17600 c := auxIntToInt64(v.AuxInt)
17601 if v_0.Op != OpARM64UBFX {
17602 break
17603 }
17604 bfc := auxIntToArm64BitField(v_0.AuxInt)
17605 x := v_0.Args[0]
17606 x2 := v_1
17607 if !(c < 32 && t.Size() == 4 && bfc == armBFAuxInt(32-c, c)) {
17608 break
17609 }
17610 v.reset(OpARM64EXTRWconst)
17611 v.AuxInt = int64ToAuxInt(32 - c)
17612 v.AddArg2(x2, x)
17613 return true
17614 }
17615 return false
17616 }
17617 func rewriteValueARM64_OpARM64XORshiftRA(v *Value) bool {
17618 v_1 := v.Args[1]
17619 v_0 := v.Args[0]
17620 b := v.Block
17621
17622
17623 for {
17624 d := auxIntToInt64(v.AuxInt)
17625 if v_0.Op != OpARM64MOVDconst {
17626 break
17627 }
17628 c := auxIntToInt64(v_0.AuxInt)
17629 x := v_1
17630 v.reset(OpARM64XORconst)
17631 v.AuxInt = int64ToAuxInt(c)
17632 v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
17633 v0.AuxInt = int64ToAuxInt(d)
17634 v0.AddArg(x)
17635 v.AddArg(v0)
17636 return true
17637 }
17638
17639
17640 for {
17641 d := auxIntToInt64(v.AuxInt)
17642 x := v_0
17643 if v_1.Op != OpARM64MOVDconst {
17644 break
17645 }
17646 c := auxIntToInt64(v_1.AuxInt)
17647 v.reset(OpARM64XORconst)
17648 v.AuxInt = int64ToAuxInt(c >> uint64(d))
17649 v.AddArg(x)
17650 return true
17651 }
17652
17653
17654 for {
17655 c := auxIntToInt64(v.AuxInt)
17656 if v_0.Op != OpARM64SRAconst || auxIntToInt64(v_0.AuxInt) != c {
17657 break
17658 }
17659 x := v_0.Args[0]
17660 if x != v_1 {
17661 break
17662 }
17663 v.reset(OpARM64MOVDconst)
17664 v.AuxInt = int64ToAuxInt(0)
17665 return true
17666 }
17667 return false
17668 }
17669 func rewriteValueARM64_OpARM64XORshiftRL(v *Value) bool {
17670 v_1 := v.Args[1]
17671 v_0 := v.Args[0]
17672 b := v.Block
17673
17674
17675 for {
17676 d := auxIntToInt64(v.AuxInt)
17677 if v_0.Op != OpARM64MOVDconst {
17678 break
17679 }
17680 c := auxIntToInt64(v_0.AuxInt)
17681 x := v_1
17682 v.reset(OpARM64XORconst)
17683 v.AuxInt = int64ToAuxInt(c)
17684 v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
17685 v0.AuxInt = int64ToAuxInt(d)
17686 v0.AddArg(x)
17687 v.AddArg(v0)
17688 return true
17689 }
17690
17691
17692 for {
17693 d := auxIntToInt64(v.AuxInt)
17694 x := v_0
17695 if v_1.Op != OpARM64MOVDconst {
17696 break
17697 }
17698 c := auxIntToInt64(v_1.AuxInt)
17699 v.reset(OpARM64XORconst)
17700 v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
17701 v.AddArg(x)
17702 return true
17703 }
17704
17705
17706 for {
17707 c := auxIntToInt64(v.AuxInt)
17708 if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
17709 break
17710 }
17711 x := v_0.Args[0]
17712 if x != v_1 {
17713 break
17714 }
17715 v.reset(OpARM64MOVDconst)
17716 v.AuxInt = int64ToAuxInt(0)
17717 return true
17718 }
17719 return false
17720 }
17721 func rewriteValueARM64_OpARM64XORshiftRO(v *Value) bool {
17722 v_1 := v.Args[1]
17723 v_0 := v.Args[0]
17724 b := v.Block
17725
17726
17727 for {
17728 d := auxIntToInt64(v.AuxInt)
17729 if v_0.Op != OpARM64MOVDconst {
17730 break
17731 }
17732 c := auxIntToInt64(v_0.AuxInt)
17733 x := v_1
17734 v.reset(OpARM64XORconst)
17735 v.AuxInt = int64ToAuxInt(c)
17736 v0 := b.NewValue0(v.Pos, OpARM64RORconst, x.Type)
17737 v0.AuxInt = int64ToAuxInt(d)
17738 v0.AddArg(x)
17739 v.AddArg(v0)
17740 return true
17741 }
17742
17743
17744 for {
17745 d := auxIntToInt64(v.AuxInt)
17746 x := v_0
17747 if v_1.Op != OpARM64MOVDconst {
17748 break
17749 }
17750 c := auxIntToInt64(v_1.AuxInt)
17751 v.reset(OpARM64XORconst)
17752 v.AuxInt = int64ToAuxInt(rotateRight64(c, d))
17753 v.AddArg(x)
17754 return true
17755 }
17756
17757
17758 for {
17759 c := auxIntToInt64(v.AuxInt)
17760 if v_0.Op != OpARM64RORconst || auxIntToInt64(v_0.AuxInt) != c {
17761 break
17762 }
17763 x := v_0.Args[0]
17764 if x != v_1 {
17765 break
17766 }
17767 v.reset(OpARM64MOVDconst)
17768 v.AuxInt = int64ToAuxInt(0)
17769 return true
17770 }
17771 return false
17772 }
17773 func rewriteValueARM64_OpAddr(v *Value) bool {
17774 v_0 := v.Args[0]
17775
17776
17777 for {
17778 sym := auxToSym(v.Aux)
17779 base := v_0
17780 v.reset(OpARM64MOVDaddr)
17781 v.Aux = symToAux(sym)
17782 v.AddArg(base)
17783 return true
17784 }
17785 }
17786 func rewriteValueARM64_OpAtomicAnd32(v *Value) bool {
17787 v_2 := v.Args[2]
17788 v_1 := v.Args[1]
17789 v_0 := v.Args[0]
17790 b := v.Block
17791 typ := &b.Func.Config.Types
17792
17793
17794 for {
17795 ptr := v_0
17796 val := v_1
17797 mem := v_2
17798 v.reset(OpSelect1)
17799 v0 := b.NewValue0(v.Pos, OpARM64LoweredAtomicAnd32, types.NewTuple(typ.UInt32, types.TypeMem))
17800 v0.AddArg3(ptr, val, mem)
17801 v.AddArg(v0)
17802 return true
17803 }
17804 }
17805 func rewriteValueARM64_OpAtomicAnd32Variant(v *Value) bool {
17806 v_2 := v.Args[2]
17807 v_1 := v.Args[1]
17808 v_0 := v.Args[0]
17809 b := v.Block
17810 typ := &b.Func.Config.Types
17811
17812
17813 for {
17814 ptr := v_0
17815 val := v_1
17816 mem := v_2
17817 v.reset(OpSelect1)
17818 v0 := b.NewValue0(v.Pos, OpARM64LoweredAtomicAnd32Variant, types.NewTuple(typ.UInt32, types.TypeMem))
17819 v0.AddArg3(ptr, val, mem)
17820 v.AddArg(v0)
17821 return true
17822 }
17823 }
17824 func rewriteValueARM64_OpAtomicAnd8(v *Value) bool {
17825 v_2 := v.Args[2]
17826 v_1 := v.Args[1]
17827 v_0 := v.Args[0]
17828 b := v.Block
17829 typ := &b.Func.Config.Types
17830
17831
17832 for {
17833 ptr := v_0
17834 val := v_1
17835 mem := v_2
17836 v.reset(OpSelect1)
17837 v0 := b.NewValue0(v.Pos, OpARM64LoweredAtomicAnd8, types.NewTuple(typ.UInt8, types.TypeMem))
17838 v0.AddArg3(ptr, val, mem)
17839 v.AddArg(v0)
17840 return true
17841 }
17842 }
17843 func rewriteValueARM64_OpAtomicAnd8Variant(v *Value) bool {
17844 v_2 := v.Args[2]
17845 v_1 := v.Args[1]
17846 v_0 := v.Args[0]
17847 b := v.Block
17848 typ := &b.Func.Config.Types
17849
17850
17851 for {
17852 ptr := v_0
17853 val := v_1
17854 mem := v_2
17855 v.reset(OpSelect1)
17856 v0 := b.NewValue0(v.Pos, OpARM64LoweredAtomicAnd8Variant, types.NewTuple(typ.UInt8, types.TypeMem))
17857 v0.AddArg3(ptr, val, mem)
17858 v.AddArg(v0)
17859 return true
17860 }
17861 }
17862 func rewriteValueARM64_OpAtomicOr32(v *Value) bool {
17863 v_2 := v.Args[2]
17864 v_1 := v.Args[1]
17865 v_0 := v.Args[0]
17866 b := v.Block
17867 typ := &b.Func.Config.Types
17868
17869
17870 for {
17871 ptr := v_0
17872 val := v_1
17873 mem := v_2
17874 v.reset(OpSelect1)
17875 v0 := b.NewValue0(v.Pos, OpARM64LoweredAtomicOr32, types.NewTuple(typ.UInt32, types.TypeMem))
17876 v0.AddArg3(ptr, val, mem)
17877 v.AddArg(v0)
17878 return true
17879 }
17880 }
17881 func rewriteValueARM64_OpAtomicOr32Variant(v *Value) bool {
17882 v_2 := v.Args[2]
17883 v_1 := v.Args[1]
17884 v_0 := v.Args[0]
17885 b := v.Block
17886 typ := &b.Func.Config.Types
17887
17888
17889 for {
17890 ptr := v_0
17891 val := v_1
17892 mem := v_2
17893 v.reset(OpSelect1)
17894 v0 := b.NewValue0(v.Pos, OpARM64LoweredAtomicOr32Variant, types.NewTuple(typ.UInt32, types.TypeMem))
17895 v0.AddArg3(ptr, val, mem)
17896 v.AddArg(v0)
17897 return true
17898 }
17899 }
17900 func rewriteValueARM64_OpAtomicOr8(v *Value) bool {
17901 v_2 := v.Args[2]
17902 v_1 := v.Args[1]
17903 v_0 := v.Args[0]
17904 b := v.Block
17905 typ := &b.Func.Config.Types
17906
17907
17908 for {
17909 ptr := v_0
17910 val := v_1
17911 mem := v_2
17912 v.reset(OpSelect1)
17913 v0 := b.NewValue0(v.Pos, OpARM64LoweredAtomicOr8, types.NewTuple(typ.UInt8, types.TypeMem))
17914 v0.AddArg3(ptr, val, mem)
17915 v.AddArg(v0)
17916 return true
17917 }
17918 }
17919 func rewriteValueARM64_OpAtomicOr8Variant(v *Value) bool {
17920 v_2 := v.Args[2]
17921 v_1 := v.Args[1]
17922 v_0 := v.Args[0]
17923 b := v.Block
17924 typ := &b.Func.Config.Types
17925
17926
17927 for {
17928 ptr := v_0
17929 val := v_1
17930 mem := v_2
17931 v.reset(OpSelect1)
17932 v0 := b.NewValue0(v.Pos, OpARM64LoweredAtomicOr8Variant, types.NewTuple(typ.UInt8, types.TypeMem))
17933 v0.AddArg3(ptr, val, mem)
17934 v.AddArg(v0)
17935 return true
17936 }
17937 }
17938 func rewriteValueARM64_OpAvg64u(v *Value) bool {
17939 v_1 := v.Args[1]
17940 v_0 := v.Args[0]
17941 b := v.Block
17942
17943
17944 for {
17945 t := v.Type
17946 x := v_0
17947 y := v_1
17948 v.reset(OpARM64ADD)
17949 v0 := b.NewValue0(v.Pos, OpARM64SRLconst, t)
17950 v0.AuxInt = int64ToAuxInt(1)
17951 v1 := b.NewValue0(v.Pos, OpARM64SUB, t)
17952 v1.AddArg2(x, y)
17953 v0.AddArg(v1)
17954 v.AddArg2(v0, y)
17955 return true
17956 }
17957 }
17958 func rewriteValueARM64_OpBitLen32(v *Value) bool {
17959 v_0 := v.Args[0]
17960 b := v.Block
17961 typ := &b.Func.Config.Types
17962
17963
17964 for {
17965 x := v_0
17966 v.reset(OpARM64SUB)
17967 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
17968 v0.AuxInt = int64ToAuxInt(32)
17969 v1 := b.NewValue0(v.Pos, OpARM64CLZW, typ.Int)
17970 v1.AddArg(x)
17971 v.AddArg2(v0, v1)
17972 return true
17973 }
17974 }
17975 func rewriteValueARM64_OpBitLen64(v *Value) bool {
17976 v_0 := v.Args[0]
17977 b := v.Block
17978 typ := &b.Func.Config.Types
17979
17980
17981 for {
17982 x := v_0
17983 v.reset(OpARM64SUB)
17984 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
17985 v0.AuxInt = int64ToAuxInt(64)
17986 v1 := b.NewValue0(v.Pos, OpARM64CLZ, typ.Int)
17987 v1.AddArg(x)
17988 v.AddArg2(v0, v1)
17989 return true
17990 }
17991 }
17992 func rewriteValueARM64_OpBitRev16(v *Value) bool {
17993 v_0 := v.Args[0]
17994 b := v.Block
17995 typ := &b.Func.Config.Types
17996
17997
17998 for {
17999 x := v_0
18000 v.reset(OpARM64SRLconst)
18001 v.AuxInt = int64ToAuxInt(48)
18002 v0 := b.NewValue0(v.Pos, OpARM64RBIT, typ.UInt64)
18003 v0.AddArg(x)
18004 v.AddArg(v0)
18005 return true
18006 }
18007 }
18008 func rewriteValueARM64_OpBitRev8(v *Value) bool {
18009 v_0 := v.Args[0]
18010 b := v.Block
18011 typ := &b.Func.Config.Types
18012
18013
18014 for {
18015 x := v_0
18016 v.reset(OpARM64SRLconst)
18017 v.AuxInt = int64ToAuxInt(56)
18018 v0 := b.NewValue0(v.Pos, OpARM64RBIT, typ.UInt64)
18019 v0.AddArg(x)
18020 v.AddArg(v0)
18021 return true
18022 }
18023 }
18024 func rewriteValueARM64_OpCondSelect(v *Value) bool {
18025 v_2 := v.Args[2]
18026 v_1 := v.Args[1]
18027 v_0 := v.Args[0]
18028 b := v.Block
18029
18030
18031
18032 for {
18033 x := v_0
18034 y := v_1
18035 boolval := v_2
18036 if !(flagArg(boolval) != nil) {
18037 break
18038 }
18039 v.reset(OpARM64CSEL)
18040 v.AuxInt = opToAuxInt(boolval.Op)
18041 v.AddArg3(x, y, flagArg(boolval))
18042 return true
18043 }
18044
18045
18046
18047 for {
18048 x := v_0
18049 y := v_1
18050 boolval := v_2
18051 if !(flagArg(boolval) == nil) {
18052 break
18053 }
18054 v.reset(OpARM64CSEL)
18055 v.AuxInt = opToAuxInt(OpARM64NotEqual)
18056 v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
18057 v0.AuxInt = int32ToAuxInt(1)
18058 v0.AddArg(boolval)
18059 v.AddArg3(x, y, v0)
18060 return true
18061 }
18062 return false
18063 }
18064 func rewriteValueARM64_OpConst16(v *Value) bool {
18065
18066
18067 for {
18068 val := auxIntToInt16(v.AuxInt)
18069 v.reset(OpARM64MOVDconst)
18070 v.AuxInt = int64ToAuxInt(int64(val))
18071 return true
18072 }
18073 }
18074 func rewriteValueARM64_OpConst32(v *Value) bool {
18075
18076
18077 for {
18078 val := auxIntToInt32(v.AuxInt)
18079 v.reset(OpARM64MOVDconst)
18080 v.AuxInt = int64ToAuxInt(int64(val))
18081 return true
18082 }
18083 }
18084 func rewriteValueARM64_OpConst32F(v *Value) bool {
18085
18086
18087 for {
18088 val := auxIntToFloat32(v.AuxInt)
18089 v.reset(OpARM64FMOVSconst)
18090 v.AuxInt = float64ToAuxInt(float64(val))
18091 return true
18092 }
18093 }
18094 func rewriteValueARM64_OpConst64(v *Value) bool {
18095
18096
18097 for {
18098 val := auxIntToInt64(v.AuxInt)
18099 v.reset(OpARM64MOVDconst)
18100 v.AuxInt = int64ToAuxInt(int64(val))
18101 return true
18102 }
18103 }
18104 func rewriteValueARM64_OpConst64F(v *Value) bool {
18105
18106
18107 for {
18108 val := auxIntToFloat64(v.AuxInt)
18109 v.reset(OpARM64FMOVDconst)
18110 v.AuxInt = float64ToAuxInt(float64(val))
18111 return true
18112 }
18113 }
18114 func rewriteValueARM64_OpConst8(v *Value) bool {
18115
18116
18117 for {
18118 val := auxIntToInt8(v.AuxInt)
18119 v.reset(OpARM64MOVDconst)
18120 v.AuxInt = int64ToAuxInt(int64(val))
18121 return true
18122 }
18123 }
18124 func rewriteValueARM64_OpConstBool(v *Value) bool {
18125
18126
18127 for {
18128 t := auxIntToBool(v.AuxInt)
18129 v.reset(OpARM64MOVDconst)
18130 v.AuxInt = int64ToAuxInt(b2i(t))
18131 return true
18132 }
18133 }
18134 func rewriteValueARM64_OpConstNil(v *Value) bool {
18135
18136
18137 for {
18138 v.reset(OpARM64MOVDconst)
18139 v.AuxInt = int64ToAuxInt(0)
18140 return true
18141 }
18142 }
18143 func rewriteValueARM64_OpCtz16(v *Value) bool {
18144 v_0 := v.Args[0]
18145 b := v.Block
18146 typ := &b.Func.Config.Types
18147
18148
18149 for {
18150 t := v.Type
18151 x := v_0
18152 v.reset(OpARM64CLZW)
18153 v.Type = t
18154 v0 := b.NewValue0(v.Pos, OpARM64RBITW, typ.UInt32)
18155 v1 := b.NewValue0(v.Pos, OpARM64ORconst, typ.UInt32)
18156 v1.AuxInt = int64ToAuxInt(0x10000)
18157 v1.AddArg(x)
18158 v0.AddArg(v1)
18159 v.AddArg(v0)
18160 return true
18161 }
18162 }
18163 func rewriteValueARM64_OpCtz32(v *Value) bool {
18164 v_0 := v.Args[0]
18165 b := v.Block
18166
18167
18168 for {
18169 t := v.Type
18170 x := v_0
18171 v.reset(OpARM64CLZW)
18172 v0 := b.NewValue0(v.Pos, OpARM64RBITW, t)
18173 v0.AddArg(x)
18174 v.AddArg(v0)
18175 return true
18176 }
18177 }
18178 func rewriteValueARM64_OpCtz64(v *Value) bool {
18179 v_0 := v.Args[0]
18180 b := v.Block
18181
18182
18183 for {
18184 t := v.Type
18185 x := v_0
18186 v.reset(OpARM64CLZ)
18187 v0 := b.NewValue0(v.Pos, OpARM64RBIT, t)
18188 v0.AddArg(x)
18189 v.AddArg(v0)
18190 return true
18191 }
18192 }
18193 func rewriteValueARM64_OpCtz8(v *Value) bool {
18194 v_0 := v.Args[0]
18195 b := v.Block
18196 typ := &b.Func.Config.Types
18197
18198
18199 for {
18200 t := v.Type
18201 x := v_0
18202 v.reset(OpARM64CLZW)
18203 v.Type = t
18204 v0 := b.NewValue0(v.Pos, OpARM64RBITW, typ.UInt32)
18205 v1 := b.NewValue0(v.Pos, OpARM64ORconst, typ.UInt32)
18206 v1.AuxInt = int64ToAuxInt(0x100)
18207 v1.AddArg(x)
18208 v0.AddArg(v1)
18209 v.AddArg(v0)
18210 return true
18211 }
18212 }
18213 func rewriteValueARM64_OpDiv16(v *Value) bool {
18214 v_1 := v.Args[1]
18215 v_0 := v.Args[0]
18216 b := v.Block
18217 typ := &b.Func.Config.Types
18218
18219
18220 for {
18221 if auxIntToBool(v.AuxInt) != false {
18222 break
18223 }
18224 x := v_0
18225 y := v_1
18226 v.reset(OpARM64DIVW)
18227 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
18228 v0.AddArg(x)
18229 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
18230 v1.AddArg(y)
18231 v.AddArg2(v0, v1)
18232 return true
18233 }
18234 return false
18235 }
18236 func rewriteValueARM64_OpDiv16u(v *Value) bool {
18237 v_1 := v.Args[1]
18238 v_0 := v.Args[0]
18239 b := v.Block
18240 typ := &b.Func.Config.Types
18241
18242
18243 for {
18244 x := v_0
18245 y := v_1
18246 v.reset(OpARM64UDIVW)
18247 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
18248 v0.AddArg(x)
18249 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
18250 v1.AddArg(y)
18251 v.AddArg2(v0, v1)
18252 return true
18253 }
18254 }
18255 func rewriteValueARM64_OpDiv32(v *Value) bool {
18256 v_1 := v.Args[1]
18257 v_0 := v.Args[0]
18258
18259
18260 for {
18261 if auxIntToBool(v.AuxInt) != false {
18262 break
18263 }
18264 x := v_0
18265 y := v_1
18266 v.reset(OpARM64DIVW)
18267 v.AddArg2(x, y)
18268 return true
18269 }
18270 return false
18271 }
18272 func rewriteValueARM64_OpDiv64(v *Value) bool {
18273 v_1 := v.Args[1]
18274 v_0 := v.Args[0]
18275
18276
18277 for {
18278 if auxIntToBool(v.AuxInt) != false {
18279 break
18280 }
18281 x := v_0
18282 y := v_1
18283 v.reset(OpARM64DIV)
18284 v.AddArg2(x, y)
18285 return true
18286 }
18287 return false
18288 }
18289 func rewriteValueARM64_OpDiv8(v *Value) bool {
18290 v_1 := v.Args[1]
18291 v_0 := v.Args[0]
18292 b := v.Block
18293 typ := &b.Func.Config.Types
18294
18295
18296 for {
18297 x := v_0
18298 y := v_1
18299 v.reset(OpARM64DIVW)
18300 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
18301 v0.AddArg(x)
18302 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
18303 v1.AddArg(y)
18304 v.AddArg2(v0, v1)
18305 return true
18306 }
18307 }
18308 func rewriteValueARM64_OpDiv8u(v *Value) bool {
18309 v_1 := v.Args[1]
18310 v_0 := v.Args[0]
18311 b := v.Block
18312 typ := &b.Func.Config.Types
18313
18314
18315 for {
18316 x := v_0
18317 y := v_1
18318 v.reset(OpARM64UDIVW)
18319 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
18320 v0.AddArg(x)
18321 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
18322 v1.AddArg(y)
18323 v.AddArg2(v0, v1)
18324 return true
18325 }
18326 }
18327 func rewriteValueARM64_OpEq16(v *Value) bool {
18328 v_1 := v.Args[1]
18329 v_0 := v.Args[0]
18330 b := v.Block
18331 typ := &b.Func.Config.Types
18332
18333
18334 for {
18335 x := v_0
18336 y := v_1
18337 v.reset(OpARM64Equal)
18338 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
18339 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
18340 v1.AddArg(x)
18341 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
18342 v2.AddArg(y)
18343 v0.AddArg2(v1, v2)
18344 v.AddArg(v0)
18345 return true
18346 }
18347 }
18348 func rewriteValueARM64_OpEq32(v *Value) bool {
18349 v_1 := v.Args[1]
18350 v_0 := v.Args[0]
18351 b := v.Block
18352
18353
18354 for {
18355 x := v_0
18356 y := v_1
18357 v.reset(OpARM64Equal)
18358 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
18359 v0.AddArg2(x, y)
18360 v.AddArg(v0)
18361 return true
18362 }
18363 }
18364 func rewriteValueARM64_OpEq32F(v *Value) bool {
18365 v_1 := v.Args[1]
18366 v_0 := v.Args[0]
18367 b := v.Block
18368
18369
18370 for {
18371 x := v_0
18372 y := v_1
18373 v.reset(OpARM64Equal)
18374 v0 := b.NewValue0(v.Pos, OpARM64FCMPS, types.TypeFlags)
18375 v0.AddArg2(x, y)
18376 v.AddArg(v0)
18377 return true
18378 }
18379 }
18380 func rewriteValueARM64_OpEq64(v *Value) bool {
18381 v_1 := v.Args[1]
18382 v_0 := v.Args[0]
18383 b := v.Block
18384
18385
18386 for {
18387 x := v_0
18388 y := v_1
18389 v.reset(OpARM64Equal)
18390 v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
18391 v0.AddArg2(x, y)
18392 v.AddArg(v0)
18393 return true
18394 }
18395 }
18396 func rewriteValueARM64_OpEq64F(v *Value) bool {
18397 v_1 := v.Args[1]
18398 v_0 := v.Args[0]
18399 b := v.Block
18400
18401
18402 for {
18403 x := v_0
18404 y := v_1
18405 v.reset(OpARM64Equal)
18406 v0 := b.NewValue0(v.Pos, OpARM64FCMPD, types.TypeFlags)
18407 v0.AddArg2(x, y)
18408 v.AddArg(v0)
18409 return true
18410 }
18411 }
18412 func rewriteValueARM64_OpEq8(v *Value) bool {
18413 v_1 := v.Args[1]
18414 v_0 := v.Args[0]
18415 b := v.Block
18416 typ := &b.Func.Config.Types
18417
18418
18419 for {
18420 x := v_0
18421 y := v_1
18422 v.reset(OpARM64Equal)
18423 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
18424 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
18425 v1.AddArg(x)
18426 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
18427 v2.AddArg(y)
18428 v0.AddArg2(v1, v2)
18429 v.AddArg(v0)
18430 return true
18431 }
18432 }
18433 func rewriteValueARM64_OpEqB(v *Value) bool {
18434 v_1 := v.Args[1]
18435 v_0 := v.Args[0]
18436 b := v.Block
18437 typ := &b.Func.Config.Types
18438
18439
18440 for {
18441 x := v_0
18442 y := v_1
18443 v.reset(OpARM64XOR)
18444 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
18445 v0.AuxInt = int64ToAuxInt(1)
18446 v1 := b.NewValue0(v.Pos, OpARM64XOR, typ.Bool)
18447 v1.AddArg2(x, y)
18448 v.AddArg2(v0, v1)
18449 return true
18450 }
18451 }
18452 func rewriteValueARM64_OpEqPtr(v *Value) bool {
18453 v_1 := v.Args[1]
18454 v_0 := v.Args[0]
18455 b := v.Block
18456
18457
18458 for {
18459 x := v_0
18460 y := v_1
18461 v.reset(OpARM64Equal)
18462 v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
18463 v0.AddArg2(x, y)
18464 v.AddArg(v0)
18465 return true
18466 }
18467 }
18468 func rewriteValueARM64_OpFMA(v *Value) bool {
18469 v_2 := v.Args[2]
18470 v_1 := v.Args[1]
18471 v_0 := v.Args[0]
18472
18473
18474 for {
18475 x := v_0
18476 y := v_1
18477 z := v_2
18478 v.reset(OpARM64FMADDD)
18479 v.AddArg3(z, x, y)
18480 return true
18481 }
18482 }
18483 func rewriteValueARM64_OpHmul32(v *Value) bool {
18484 v_1 := v.Args[1]
18485 v_0 := v.Args[0]
18486 b := v.Block
18487 typ := &b.Func.Config.Types
18488
18489
18490 for {
18491 x := v_0
18492 y := v_1
18493 v.reset(OpARM64SRAconst)
18494 v.AuxInt = int64ToAuxInt(32)
18495 v0 := b.NewValue0(v.Pos, OpARM64MULL, typ.Int64)
18496 v0.AddArg2(x, y)
18497 v.AddArg(v0)
18498 return true
18499 }
18500 }
18501 func rewriteValueARM64_OpHmul32u(v *Value) bool {
18502 v_1 := v.Args[1]
18503 v_0 := v.Args[0]
18504 b := v.Block
18505 typ := &b.Func.Config.Types
18506
18507
18508 for {
18509 x := v_0
18510 y := v_1
18511 v.reset(OpARM64SRAconst)
18512 v.AuxInt = int64ToAuxInt(32)
18513 v0 := b.NewValue0(v.Pos, OpARM64UMULL, typ.UInt64)
18514 v0.AddArg2(x, y)
18515 v.AddArg(v0)
18516 return true
18517 }
18518 }
18519 func rewriteValueARM64_OpIsInBounds(v *Value) bool {
18520 v_1 := v.Args[1]
18521 v_0 := v.Args[0]
18522 b := v.Block
18523
18524
18525 for {
18526 idx := v_0
18527 len := v_1
18528 v.reset(OpARM64LessThanU)
18529 v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
18530 v0.AddArg2(idx, len)
18531 v.AddArg(v0)
18532 return true
18533 }
18534 }
18535 func rewriteValueARM64_OpIsNonNil(v *Value) bool {
18536 v_0 := v.Args[0]
18537 b := v.Block
18538
18539
18540 for {
18541 ptr := v_0
18542 v.reset(OpARM64NotEqual)
18543 v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
18544 v0.AuxInt = int64ToAuxInt(0)
18545 v0.AddArg(ptr)
18546 v.AddArg(v0)
18547 return true
18548 }
18549 }
18550 func rewriteValueARM64_OpIsSliceInBounds(v *Value) bool {
18551 v_1 := v.Args[1]
18552 v_0 := v.Args[0]
18553 b := v.Block
18554
18555
18556 for {
18557 idx := v_0
18558 len := v_1
18559 v.reset(OpARM64LessEqualU)
18560 v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
18561 v0.AddArg2(idx, len)
18562 v.AddArg(v0)
18563 return true
18564 }
18565 }
18566 func rewriteValueARM64_OpLeq16(v *Value) bool {
18567 v_1 := v.Args[1]
18568 v_0 := v.Args[0]
18569 b := v.Block
18570 typ := &b.Func.Config.Types
18571
18572
18573 for {
18574 x := v_0
18575 y := v_1
18576 v.reset(OpARM64LessEqual)
18577 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
18578 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
18579 v1.AddArg(x)
18580 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
18581 v2.AddArg(y)
18582 v0.AddArg2(v1, v2)
18583 v.AddArg(v0)
18584 return true
18585 }
18586 }
18587 func rewriteValueARM64_OpLeq16U(v *Value) bool {
18588 v_1 := v.Args[1]
18589 v_0 := v.Args[0]
18590 b := v.Block
18591 typ := &b.Func.Config.Types
18592
18593
18594 for {
18595 x := v_0
18596 zero := v_1
18597 if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
18598 break
18599 }
18600 v.reset(OpEq16)
18601 v.AddArg2(x, zero)
18602 return true
18603 }
18604
18605
18606 for {
18607 if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 {
18608 break
18609 }
18610 x := v_1
18611 v.reset(OpNeq16)
18612 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
18613 v0.AuxInt = int64ToAuxInt(0)
18614 v.AddArg2(v0, x)
18615 return true
18616 }
18617
18618
18619 for {
18620 x := v_0
18621 y := v_1
18622 v.reset(OpARM64LessEqualU)
18623 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
18624 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
18625 v1.AddArg(x)
18626 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
18627 v2.AddArg(y)
18628 v0.AddArg2(v1, v2)
18629 v.AddArg(v0)
18630 return true
18631 }
18632 }
18633 func rewriteValueARM64_OpLeq32(v *Value) bool {
18634 v_1 := v.Args[1]
18635 v_0 := v.Args[0]
18636 b := v.Block
18637
18638
18639 for {
18640 x := v_0
18641 y := v_1
18642 v.reset(OpARM64LessEqual)
18643 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
18644 v0.AddArg2(x, y)
18645 v.AddArg(v0)
18646 return true
18647 }
18648 }
18649 func rewriteValueARM64_OpLeq32F(v *Value) bool {
18650 v_1 := v.Args[1]
18651 v_0 := v.Args[0]
18652 b := v.Block
18653
18654
18655 for {
18656 x := v_0
18657 y := v_1
18658 v.reset(OpARM64LessEqualF)
18659 v0 := b.NewValue0(v.Pos, OpARM64FCMPS, types.TypeFlags)
18660 v0.AddArg2(x, y)
18661 v.AddArg(v0)
18662 return true
18663 }
18664 }
18665 func rewriteValueARM64_OpLeq32U(v *Value) bool {
18666 v_1 := v.Args[1]
18667 v_0 := v.Args[0]
18668 b := v.Block
18669 typ := &b.Func.Config.Types
18670
18671
18672 for {
18673 x := v_0
18674 zero := v_1
18675 if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
18676 break
18677 }
18678 v.reset(OpEq32)
18679 v.AddArg2(x, zero)
18680 return true
18681 }
18682
18683
18684 for {
18685 if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 {
18686 break
18687 }
18688 x := v_1
18689 v.reset(OpNeq32)
18690 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
18691 v0.AuxInt = int64ToAuxInt(0)
18692 v.AddArg2(v0, x)
18693 return true
18694 }
18695
18696
18697 for {
18698 x := v_0
18699 y := v_1
18700 v.reset(OpARM64LessEqualU)
18701 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
18702 v0.AddArg2(x, y)
18703 v.AddArg(v0)
18704 return true
18705 }
18706 }
18707 func rewriteValueARM64_OpLeq64(v *Value) bool {
18708 v_1 := v.Args[1]
18709 v_0 := v.Args[0]
18710 b := v.Block
18711
18712
18713 for {
18714 x := v_0
18715 y := v_1
18716 v.reset(OpARM64LessEqual)
18717 v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
18718 v0.AddArg2(x, y)
18719 v.AddArg(v0)
18720 return true
18721 }
18722 }
18723 func rewriteValueARM64_OpLeq64F(v *Value) bool {
18724 v_1 := v.Args[1]
18725 v_0 := v.Args[0]
18726 b := v.Block
18727
18728
18729 for {
18730 x := v_0
18731 y := v_1
18732 v.reset(OpARM64LessEqualF)
18733 v0 := b.NewValue0(v.Pos, OpARM64FCMPD, types.TypeFlags)
18734 v0.AddArg2(x, y)
18735 v.AddArg(v0)
18736 return true
18737 }
18738 }
18739 func rewriteValueARM64_OpLeq64U(v *Value) bool {
18740 v_1 := v.Args[1]
18741 v_0 := v.Args[0]
18742 b := v.Block
18743 typ := &b.Func.Config.Types
18744
18745
18746 for {
18747 x := v_0
18748 zero := v_1
18749 if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
18750 break
18751 }
18752 v.reset(OpEq64)
18753 v.AddArg2(x, zero)
18754 return true
18755 }
18756
18757
18758 for {
18759 if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 {
18760 break
18761 }
18762 x := v_1
18763 v.reset(OpNeq64)
18764 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
18765 v0.AuxInt = int64ToAuxInt(0)
18766 v.AddArg2(v0, x)
18767 return true
18768 }
18769
18770
18771 for {
18772 x := v_0
18773 y := v_1
18774 v.reset(OpARM64LessEqualU)
18775 v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
18776 v0.AddArg2(x, y)
18777 v.AddArg(v0)
18778 return true
18779 }
18780 }
18781 func rewriteValueARM64_OpLeq8(v *Value) bool {
18782 v_1 := v.Args[1]
18783 v_0 := v.Args[0]
18784 b := v.Block
18785 typ := &b.Func.Config.Types
18786
18787
18788 for {
18789 x := v_0
18790 y := v_1
18791 v.reset(OpARM64LessEqual)
18792 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
18793 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
18794 v1.AddArg(x)
18795 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
18796 v2.AddArg(y)
18797 v0.AddArg2(v1, v2)
18798 v.AddArg(v0)
18799 return true
18800 }
18801 }
18802 func rewriteValueARM64_OpLeq8U(v *Value) bool {
18803 v_1 := v.Args[1]
18804 v_0 := v.Args[0]
18805 b := v.Block
18806 typ := &b.Func.Config.Types
18807
18808
18809 for {
18810 x := v_0
18811 zero := v_1
18812 if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
18813 break
18814 }
18815 v.reset(OpEq8)
18816 v.AddArg2(x, zero)
18817 return true
18818 }
18819
18820
18821 for {
18822 if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 {
18823 break
18824 }
18825 x := v_1
18826 v.reset(OpNeq8)
18827 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
18828 v0.AuxInt = int64ToAuxInt(0)
18829 v.AddArg2(v0, x)
18830 return true
18831 }
18832
18833
18834 for {
18835 x := v_0
18836 y := v_1
18837 v.reset(OpARM64LessEqualU)
18838 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
18839 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
18840 v1.AddArg(x)
18841 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
18842 v2.AddArg(y)
18843 v0.AddArg2(v1, v2)
18844 v.AddArg(v0)
18845 return true
18846 }
18847 }
18848 func rewriteValueARM64_OpLess16(v *Value) bool {
18849 v_1 := v.Args[1]
18850 v_0 := v.Args[0]
18851 b := v.Block
18852 typ := &b.Func.Config.Types
18853
18854
18855 for {
18856 x := v_0
18857 y := v_1
18858 v.reset(OpARM64LessThan)
18859 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
18860 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
18861 v1.AddArg(x)
18862 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
18863 v2.AddArg(y)
18864 v0.AddArg2(v1, v2)
18865 v.AddArg(v0)
18866 return true
18867 }
18868 }
18869 func rewriteValueARM64_OpLess16U(v *Value) bool {
18870 v_1 := v.Args[1]
18871 v_0 := v.Args[0]
18872 b := v.Block
18873 typ := &b.Func.Config.Types
18874
18875
18876 for {
18877 zero := v_0
18878 if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
18879 break
18880 }
18881 x := v_1
18882 v.reset(OpNeq16)
18883 v.AddArg2(zero, x)
18884 return true
18885 }
18886
18887
18888 for {
18889 x := v_0
18890 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
18891 break
18892 }
18893 v.reset(OpEq16)
18894 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
18895 v0.AuxInt = int64ToAuxInt(0)
18896 v.AddArg2(x, v0)
18897 return true
18898 }
18899
18900
18901 for {
18902 x := v_0
18903 y := v_1
18904 v.reset(OpARM64LessThanU)
18905 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
18906 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
18907 v1.AddArg(x)
18908 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
18909 v2.AddArg(y)
18910 v0.AddArg2(v1, v2)
18911 v.AddArg(v0)
18912 return true
18913 }
18914 }
18915 func rewriteValueARM64_OpLess32(v *Value) bool {
18916 v_1 := v.Args[1]
18917 v_0 := v.Args[0]
18918 b := v.Block
18919
18920
18921 for {
18922 x := v_0
18923 y := v_1
18924 v.reset(OpARM64LessThan)
18925 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
18926 v0.AddArg2(x, y)
18927 v.AddArg(v0)
18928 return true
18929 }
18930 }
18931 func rewriteValueARM64_OpLess32F(v *Value) bool {
18932 v_1 := v.Args[1]
18933 v_0 := v.Args[0]
18934 b := v.Block
18935
18936
18937 for {
18938 x := v_0
18939 y := v_1
18940 v.reset(OpARM64LessThanF)
18941 v0 := b.NewValue0(v.Pos, OpARM64FCMPS, types.TypeFlags)
18942 v0.AddArg2(x, y)
18943 v.AddArg(v0)
18944 return true
18945 }
18946 }
18947 func rewriteValueARM64_OpLess32U(v *Value) bool {
18948 v_1 := v.Args[1]
18949 v_0 := v.Args[0]
18950 b := v.Block
18951 typ := &b.Func.Config.Types
18952
18953
18954 for {
18955 zero := v_0
18956 if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
18957 break
18958 }
18959 x := v_1
18960 v.reset(OpNeq32)
18961 v.AddArg2(zero, x)
18962 return true
18963 }
18964
18965
18966 for {
18967 x := v_0
18968 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
18969 break
18970 }
18971 v.reset(OpEq32)
18972 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
18973 v0.AuxInt = int64ToAuxInt(0)
18974 v.AddArg2(x, v0)
18975 return true
18976 }
18977
18978
18979 for {
18980 x := v_0
18981 y := v_1
18982 v.reset(OpARM64LessThanU)
18983 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
18984 v0.AddArg2(x, y)
18985 v.AddArg(v0)
18986 return true
18987 }
18988 }
18989 func rewriteValueARM64_OpLess64(v *Value) bool {
18990 v_1 := v.Args[1]
18991 v_0 := v.Args[0]
18992 b := v.Block
18993
18994
18995 for {
18996 x := v_0
18997 y := v_1
18998 v.reset(OpARM64LessThan)
18999 v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
19000 v0.AddArg2(x, y)
19001 v.AddArg(v0)
19002 return true
19003 }
19004 }
19005 func rewriteValueARM64_OpLess64F(v *Value) bool {
19006 v_1 := v.Args[1]
19007 v_0 := v.Args[0]
19008 b := v.Block
19009
19010
19011 for {
19012 x := v_0
19013 y := v_1
19014 v.reset(OpARM64LessThanF)
19015 v0 := b.NewValue0(v.Pos, OpARM64FCMPD, types.TypeFlags)
19016 v0.AddArg2(x, y)
19017 v.AddArg(v0)
19018 return true
19019 }
19020 }
19021 func rewriteValueARM64_OpLess64U(v *Value) bool {
19022 v_1 := v.Args[1]
19023 v_0 := v.Args[0]
19024 b := v.Block
19025 typ := &b.Func.Config.Types
19026
19027
19028 for {
19029 zero := v_0
19030 if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
19031 break
19032 }
19033 x := v_1
19034 v.reset(OpNeq64)
19035 v.AddArg2(zero, x)
19036 return true
19037 }
19038
19039
19040 for {
19041 x := v_0
19042 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
19043 break
19044 }
19045 v.reset(OpEq64)
19046 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
19047 v0.AuxInt = int64ToAuxInt(0)
19048 v.AddArg2(x, v0)
19049 return true
19050 }
19051
19052
19053 for {
19054 x := v_0
19055 y := v_1
19056 v.reset(OpARM64LessThanU)
19057 v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
19058 v0.AddArg2(x, y)
19059 v.AddArg(v0)
19060 return true
19061 }
19062 }
19063 func rewriteValueARM64_OpLess8(v *Value) bool {
19064 v_1 := v.Args[1]
19065 v_0 := v.Args[0]
19066 b := v.Block
19067 typ := &b.Func.Config.Types
19068
19069
19070 for {
19071 x := v_0
19072 y := v_1
19073 v.reset(OpARM64LessThan)
19074 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
19075 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
19076 v1.AddArg(x)
19077 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
19078 v2.AddArg(y)
19079 v0.AddArg2(v1, v2)
19080 v.AddArg(v0)
19081 return true
19082 }
19083 }
19084 func rewriteValueARM64_OpLess8U(v *Value) bool {
19085 v_1 := v.Args[1]
19086 v_0 := v.Args[0]
19087 b := v.Block
19088 typ := &b.Func.Config.Types
19089
19090
19091 for {
19092 zero := v_0
19093 if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
19094 break
19095 }
19096 x := v_1
19097 v.reset(OpNeq8)
19098 v.AddArg2(zero, x)
19099 return true
19100 }
19101
19102
19103 for {
19104 x := v_0
19105 if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
19106 break
19107 }
19108 v.reset(OpEq8)
19109 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
19110 v0.AuxInt = int64ToAuxInt(0)
19111 v.AddArg2(x, v0)
19112 return true
19113 }
19114
19115
19116 for {
19117 x := v_0
19118 y := v_1
19119 v.reset(OpARM64LessThanU)
19120 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
19121 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
19122 v1.AddArg(x)
19123 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
19124 v2.AddArg(y)
19125 v0.AddArg2(v1, v2)
19126 v.AddArg(v0)
19127 return true
19128 }
19129 }
19130 func rewriteValueARM64_OpLoad(v *Value) bool {
19131 v_1 := v.Args[1]
19132 v_0 := v.Args[0]
19133
19134
19135
19136 for {
19137 t := v.Type
19138 ptr := v_0
19139 mem := v_1
19140 if !(t.IsBoolean()) {
19141 break
19142 }
19143 v.reset(OpARM64MOVBUload)
19144 v.AddArg2(ptr, mem)
19145 return true
19146 }
19147
19148
19149
19150 for {
19151 t := v.Type
19152 ptr := v_0
19153 mem := v_1
19154 if !(is8BitInt(t) && t.IsSigned()) {
19155 break
19156 }
19157 v.reset(OpARM64MOVBload)
19158 v.AddArg2(ptr, mem)
19159 return true
19160 }
19161
19162
19163
19164 for {
19165 t := v.Type
19166 ptr := v_0
19167 mem := v_1
19168 if !(is8BitInt(t) && !t.IsSigned()) {
19169 break
19170 }
19171 v.reset(OpARM64MOVBUload)
19172 v.AddArg2(ptr, mem)
19173 return true
19174 }
19175
19176
19177
19178 for {
19179 t := v.Type
19180 ptr := v_0
19181 mem := v_1
19182 if !(is16BitInt(t) && t.IsSigned()) {
19183 break
19184 }
19185 v.reset(OpARM64MOVHload)
19186 v.AddArg2(ptr, mem)
19187 return true
19188 }
19189
19190
19191
19192 for {
19193 t := v.Type
19194 ptr := v_0
19195 mem := v_1
19196 if !(is16BitInt(t) && !t.IsSigned()) {
19197 break
19198 }
19199 v.reset(OpARM64MOVHUload)
19200 v.AddArg2(ptr, mem)
19201 return true
19202 }
19203
19204
19205
19206 for {
19207 t := v.Type
19208 ptr := v_0
19209 mem := v_1
19210 if !(is32BitInt(t) && t.IsSigned()) {
19211 break
19212 }
19213 v.reset(OpARM64MOVWload)
19214 v.AddArg2(ptr, mem)
19215 return true
19216 }
19217
19218
19219
19220 for {
19221 t := v.Type
19222 ptr := v_0
19223 mem := v_1
19224 if !(is32BitInt(t) && !t.IsSigned()) {
19225 break
19226 }
19227 v.reset(OpARM64MOVWUload)
19228 v.AddArg2(ptr, mem)
19229 return true
19230 }
19231
19232
19233
19234 for {
19235 t := v.Type
19236 ptr := v_0
19237 mem := v_1
19238 if !(is64BitInt(t) || isPtr(t)) {
19239 break
19240 }
19241 v.reset(OpARM64MOVDload)
19242 v.AddArg2(ptr, mem)
19243 return true
19244 }
19245
19246
19247
19248 for {
19249 t := v.Type
19250 ptr := v_0
19251 mem := v_1
19252 if !(is32BitFloat(t)) {
19253 break
19254 }
19255 v.reset(OpARM64FMOVSload)
19256 v.AddArg2(ptr, mem)
19257 return true
19258 }
19259
19260
19261
19262 for {
19263 t := v.Type
19264 ptr := v_0
19265 mem := v_1
19266 if !(is64BitFloat(t)) {
19267 break
19268 }
19269 v.reset(OpARM64FMOVDload)
19270 v.AddArg2(ptr, mem)
19271 return true
19272 }
19273 return false
19274 }
19275 func rewriteValueARM64_OpLocalAddr(v *Value) bool {
19276 v_1 := v.Args[1]
19277 v_0 := v.Args[0]
19278 b := v.Block
19279 typ := &b.Func.Config.Types
19280
19281
19282
19283 for {
19284 t := v.Type
19285 sym := auxToSym(v.Aux)
19286 base := v_0
19287 mem := v_1
19288 if !(t.Elem().HasPointers()) {
19289 break
19290 }
19291 v.reset(OpARM64MOVDaddr)
19292 v.Aux = symToAux(sym)
19293 v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
19294 v0.AddArg2(base, mem)
19295 v.AddArg(v0)
19296 return true
19297 }
19298
19299
19300
19301 for {
19302 t := v.Type
19303 sym := auxToSym(v.Aux)
19304 base := v_0
19305 if !(!t.Elem().HasPointers()) {
19306 break
19307 }
19308 v.reset(OpARM64MOVDaddr)
19309 v.Aux = symToAux(sym)
19310 v.AddArg(base)
19311 return true
19312 }
19313 return false
19314 }
19315 func rewriteValueARM64_OpLsh16x16(v *Value) bool {
19316 v_1 := v.Args[1]
19317 v_0 := v.Args[0]
19318 b := v.Block
19319 typ := &b.Func.Config.Types
19320
19321
19322
19323 for {
19324 t := v.Type
19325 x := v_0
19326 y := v_1
19327 if !(shiftIsBounded(v)) {
19328 break
19329 }
19330 v.reset(OpARM64SLL)
19331 v.Type = t
19332 v.AddArg2(x, y)
19333 return true
19334 }
19335
19336
19337
19338 for {
19339 t := v.Type
19340 x := v_0
19341 y := v_1
19342 if !(!shiftIsBounded(v)) {
19343 break
19344 }
19345 v.reset(OpARM64CSEL)
19346 v.AuxInt = opToAuxInt(OpARM64LessThanU)
19347 v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
19348 v0.AddArg2(x, y)
19349 v1 := b.NewValue0(v.Pos, OpConst64, t)
19350 v1.AuxInt = int64ToAuxInt(0)
19351 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
19352 v2.AuxInt = int64ToAuxInt(64)
19353 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
19354 v3.AddArg(y)
19355 v2.AddArg(v3)
19356 v.AddArg3(v0, v1, v2)
19357 return true
19358 }
19359 return false
19360 }
19361 func rewriteValueARM64_OpLsh16x32(v *Value) bool {
19362 v_1 := v.Args[1]
19363 v_0 := v.Args[0]
19364 b := v.Block
19365 typ := &b.Func.Config.Types
19366
19367
19368
19369 for {
19370 t := v.Type
19371 x := v_0
19372 y := v_1
19373 if !(shiftIsBounded(v)) {
19374 break
19375 }
19376 v.reset(OpARM64SLL)
19377 v.Type = t
19378 v.AddArg2(x, y)
19379 return true
19380 }
19381
19382
19383
19384 for {
19385 t := v.Type
19386 x := v_0
19387 y := v_1
19388 if !(!shiftIsBounded(v)) {
19389 break
19390 }
19391 v.reset(OpARM64CSEL)
19392 v.AuxInt = opToAuxInt(OpARM64LessThanU)
19393 v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
19394 v0.AddArg2(x, y)
19395 v1 := b.NewValue0(v.Pos, OpConst64, t)
19396 v1.AuxInt = int64ToAuxInt(0)
19397 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
19398 v2.AuxInt = int64ToAuxInt(64)
19399 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
19400 v3.AddArg(y)
19401 v2.AddArg(v3)
19402 v.AddArg3(v0, v1, v2)
19403 return true
19404 }
19405 return false
19406 }
19407 func rewriteValueARM64_OpLsh16x64(v *Value) bool {
19408 v_1 := v.Args[1]
19409 v_0 := v.Args[0]
19410 b := v.Block
19411
19412
19413
19414 for {
19415 t := v.Type
19416 x := v_0
19417 y := v_1
19418 if !(shiftIsBounded(v)) {
19419 break
19420 }
19421 v.reset(OpARM64SLL)
19422 v.Type = t
19423 v.AddArg2(x, y)
19424 return true
19425 }
19426
19427
19428
19429 for {
19430 t := v.Type
19431 x := v_0
19432 y := v_1
19433 if !(!shiftIsBounded(v)) {
19434 break
19435 }
19436 v.reset(OpARM64CSEL)
19437 v.AuxInt = opToAuxInt(OpARM64LessThanU)
19438 v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
19439 v0.AddArg2(x, y)
19440 v1 := b.NewValue0(v.Pos, OpConst64, t)
19441 v1.AuxInt = int64ToAuxInt(0)
19442 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
19443 v2.AuxInt = int64ToAuxInt(64)
19444 v2.AddArg(y)
19445 v.AddArg3(v0, v1, v2)
19446 return true
19447 }
19448 return false
19449 }
19450 func rewriteValueARM64_OpLsh16x8(v *Value) bool {
19451 v_1 := v.Args[1]
19452 v_0 := v.Args[0]
19453 b := v.Block
19454 typ := &b.Func.Config.Types
19455
19456
19457
19458 for {
19459 t := v.Type
19460 x := v_0
19461 y := v_1
19462 if !(shiftIsBounded(v)) {
19463 break
19464 }
19465 v.reset(OpARM64SLL)
19466 v.Type = t
19467 v.AddArg2(x, y)
19468 return true
19469 }
19470
19471
19472
19473 for {
19474 t := v.Type
19475 x := v_0
19476 y := v_1
19477 if !(!shiftIsBounded(v)) {
19478 break
19479 }
19480 v.reset(OpARM64CSEL)
19481 v.AuxInt = opToAuxInt(OpARM64LessThanU)
19482 v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
19483 v0.AddArg2(x, y)
19484 v1 := b.NewValue0(v.Pos, OpConst64, t)
19485 v1.AuxInt = int64ToAuxInt(0)
19486 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
19487 v2.AuxInt = int64ToAuxInt(64)
19488 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
19489 v3.AddArg(y)
19490 v2.AddArg(v3)
19491 v.AddArg3(v0, v1, v2)
19492 return true
19493 }
19494 return false
19495 }
19496 func rewriteValueARM64_OpLsh32x16(v *Value) bool {
19497 v_1 := v.Args[1]
19498 v_0 := v.Args[0]
19499 b := v.Block
19500 typ := &b.Func.Config.Types
19501
19502
19503
19504 for {
19505 t := v.Type
19506 x := v_0
19507 y := v_1
19508 if !(shiftIsBounded(v)) {
19509 break
19510 }
19511 v.reset(OpARM64SLL)
19512 v.Type = t
19513 v.AddArg2(x, y)
19514 return true
19515 }
19516
19517
19518
19519 for {
19520 t := v.Type
19521 x := v_0
19522 y := v_1
19523 if !(!shiftIsBounded(v)) {
19524 break
19525 }
19526 v.reset(OpARM64CSEL)
19527 v.AuxInt = opToAuxInt(OpARM64LessThanU)
19528 v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
19529 v0.AddArg2(x, y)
19530 v1 := b.NewValue0(v.Pos, OpConst64, t)
19531 v1.AuxInt = int64ToAuxInt(0)
19532 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
19533 v2.AuxInt = int64ToAuxInt(64)
19534 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
19535 v3.AddArg(y)
19536 v2.AddArg(v3)
19537 v.AddArg3(v0, v1, v2)
19538 return true
19539 }
19540 return false
19541 }
19542 func rewriteValueARM64_OpLsh32x32(v *Value) bool {
19543 v_1 := v.Args[1]
19544 v_0 := v.Args[0]
19545 b := v.Block
19546 typ := &b.Func.Config.Types
19547
19548
19549
19550 for {
19551 t := v.Type
19552 x := v_0
19553 y := v_1
19554 if !(shiftIsBounded(v)) {
19555 break
19556 }
19557 v.reset(OpARM64SLL)
19558 v.Type = t
19559 v.AddArg2(x, y)
19560 return true
19561 }
19562
19563
19564
19565 for {
19566 t := v.Type
19567 x := v_0
19568 y := v_1
19569 if !(!shiftIsBounded(v)) {
19570 break
19571 }
19572 v.reset(OpARM64CSEL)
19573 v.AuxInt = opToAuxInt(OpARM64LessThanU)
19574 v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
19575 v0.AddArg2(x, y)
19576 v1 := b.NewValue0(v.Pos, OpConst64, t)
19577 v1.AuxInt = int64ToAuxInt(0)
19578 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
19579 v2.AuxInt = int64ToAuxInt(64)
19580 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
19581 v3.AddArg(y)
19582 v2.AddArg(v3)
19583 v.AddArg3(v0, v1, v2)
19584 return true
19585 }
19586 return false
19587 }
19588 func rewriteValueARM64_OpLsh32x64(v *Value) bool {
19589 v_1 := v.Args[1]
19590 v_0 := v.Args[0]
19591 b := v.Block
19592
19593
19594
19595 for {
19596 t := v.Type
19597 x := v_0
19598 y := v_1
19599 if !(shiftIsBounded(v)) {
19600 break
19601 }
19602 v.reset(OpARM64SLL)
19603 v.Type = t
19604 v.AddArg2(x, y)
19605 return true
19606 }
19607
19608
19609
19610 for {
19611 t := v.Type
19612 x := v_0
19613 y := v_1
19614 if !(!shiftIsBounded(v)) {
19615 break
19616 }
19617 v.reset(OpARM64CSEL)
19618 v.AuxInt = opToAuxInt(OpARM64LessThanU)
19619 v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
19620 v0.AddArg2(x, y)
19621 v1 := b.NewValue0(v.Pos, OpConst64, t)
19622 v1.AuxInt = int64ToAuxInt(0)
19623 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
19624 v2.AuxInt = int64ToAuxInt(64)
19625 v2.AddArg(y)
19626 v.AddArg3(v0, v1, v2)
19627 return true
19628 }
19629 return false
19630 }
19631 func rewriteValueARM64_OpLsh32x8(v *Value) bool {
19632 v_1 := v.Args[1]
19633 v_0 := v.Args[0]
19634 b := v.Block
19635 typ := &b.Func.Config.Types
19636
19637
19638
19639 for {
19640 t := v.Type
19641 x := v_0
19642 y := v_1
19643 if !(shiftIsBounded(v)) {
19644 break
19645 }
19646 v.reset(OpARM64SLL)
19647 v.Type = t
19648 v.AddArg2(x, y)
19649 return true
19650 }
19651
19652
19653
19654 for {
19655 t := v.Type
19656 x := v_0
19657 y := v_1
19658 if !(!shiftIsBounded(v)) {
19659 break
19660 }
19661 v.reset(OpARM64CSEL)
19662 v.AuxInt = opToAuxInt(OpARM64LessThanU)
19663 v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
19664 v0.AddArg2(x, y)
19665 v1 := b.NewValue0(v.Pos, OpConst64, t)
19666 v1.AuxInt = int64ToAuxInt(0)
19667 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
19668 v2.AuxInt = int64ToAuxInt(64)
19669 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
19670 v3.AddArg(y)
19671 v2.AddArg(v3)
19672 v.AddArg3(v0, v1, v2)
19673 return true
19674 }
19675 return false
19676 }
19677 func rewriteValueARM64_OpLsh64x16(v *Value) bool {
19678 v_1 := v.Args[1]
19679 v_0 := v.Args[0]
19680 b := v.Block
19681 typ := &b.Func.Config.Types
19682
19683
19684
19685 for {
19686 t := v.Type
19687 x := v_0
19688 y := v_1
19689 if !(shiftIsBounded(v)) {
19690 break
19691 }
19692 v.reset(OpARM64SLL)
19693 v.Type = t
19694 v.AddArg2(x, y)
19695 return true
19696 }
19697
19698
19699
19700 for {
19701 t := v.Type
19702 x := v_0
19703 y := v_1
19704 if !(!shiftIsBounded(v)) {
19705 break
19706 }
19707 v.reset(OpARM64CSEL)
19708 v.AuxInt = opToAuxInt(OpARM64LessThanU)
19709 v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
19710 v0.AddArg2(x, y)
19711 v1 := b.NewValue0(v.Pos, OpConst64, t)
19712 v1.AuxInt = int64ToAuxInt(0)
19713 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
19714 v2.AuxInt = int64ToAuxInt(64)
19715 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
19716 v3.AddArg(y)
19717 v2.AddArg(v3)
19718 v.AddArg3(v0, v1, v2)
19719 return true
19720 }
19721 return false
19722 }
19723 func rewriteValueARM64_OpLsh64x32(v *Value) bool {
19724 v_1 := v.Args[1]
19725 v_0 := v.Args[0]
19726 b := v.Block
19727 typ := &b.Func.Config.Types
19728
19729
19730
19731 for {
19732 t := v.Type
19733 x := v_0
19734 y := v_1
19735 if !(shiftIsBounded(v)) {
19736 break
19737 }
19738 v.reset(OpARM64SLL)
19739 v.Type = t
19740 v.AddArg2(x, y)
19741 return true
19742 }
19743
19744
19745
19746 for {
19747 t := v.Type
19748 x := v_0
19749 y := v_1
19750 if !(!shiftIsBounded(v)) {
19751 break
19752 }
19753 v.reset(OpARM64CSEL)
19754 v.AuxInt = opToAuxInt(OpARM64LessThanU)
19755 v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
19756 v0.AddArg2(x, y)
19757 v1 := b.NewValue0(v.Pos, OpConst64, t)
19758 v1.AuxInt = int64ToAuxInt(0)
19759 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
19760 v2.AuxInt = int64ToAuxInt(64)
19761 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
19762 v3.AddArg(y)
19763 v2.AddArg(v3)
19764 v.AddArg3(v0, v1, v2)
19765 return true
19766 }
19767 return false
19768 }
19769 func rewriteValueARM64_OpLsh64x64(v *Value) bool {
19770 v_1 := v.Args[1]
19771 v_0 := v.Args[0]
19772 b := v.Block
19773
19774
19775
19776 for {
19777 t := v.Type
19778 x := v_0
19779 y := v_1
19780 if !(shiftIsBounded(v)) {
19781 break
19782 }
19783 v.reset(OpARM64SLL)
19784 v.Type = t
19785 v.AddArg2(x, y)
19786 return true
19787 }
19788
19789
19790
19791 for {
19792 t := v.Type
19793 x := v_0
19794 y := v_1
19795 if !(!shiftIsBounded(v)) {
19796 break
19797 }
19798 v.reset(OpARM64CSEL)
19799 v.AuxInt = opToAuxInt(OpARM64LessThanU)
19800 v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
19801 v0.AddArg2(x, y)
19802 v1 := b.NewValue0(v.Pos, OpConst64, t)
19803 v1.AuxInt = int64ToAuxInt(0)
19804 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
19805 v2.AuxInt = int64ToAuxInt(64)
19806 v2.AddArg(y)
19807 v.AddArg3(v0, v1, v2)
19808 return true
19809 }
19810 return false
19811 }
19812 func rewriteValueARM64_OpLsh64x8(v *Value) bool {
19813 v_1 := v.Args[1]
19814 v_0 := v.Args[0]
19815 b := v.Block
19816 typ := &b.Func.Config.Types
19817
19818
19819
19820 for {
19821 t := v.Type
19822 x := v_0
19823 y := v_1
19824 if !(shiftIsBounded(v)) {
19825 break
19826 }
19827 v.reset(OpARM64SLL)
19828 v.Type = t
19829 v.AddArg2(x, y)
19830 return true
19831 }
19832
19833
19834
19835 for {
19836 t := v.Type
19837 x := v_0
19838 y := v_1
19839 if !(!shiftIsBounded(v)) {
19840 break
19841 }
19842 v.reset(OpARM64CSEL)
19843 v.AuxInt = opToAuxInt(OpARM64LessThanU)
19844 v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
19845 v0.AddArg2(x, y)
19846 v1 := b.NewValue0(v.Pos, OpConst64, t)
19847 v1.AuxInt = int64ToAuxInt(0)
19848 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
19849 v2.AuxInt = int64ToAuxInt(64)
19850 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
19851 v3.AddArg(y)
19852 v2.AddArg(v3)
19853 v.AddArg3(v0, v1, v2)
19854 return true
19855 }
19856 return false
19857 }
19858 func rewriteValueARM64_OpLsh8x16(v *Value) bool {
19859 v_1 := v.Args[1]
19860 v_0 := v.Args[0]
19861 b := v.Block
19862 typ := &b.Func.Config.Types
19863
19864
19865
19866 for {
19867 t := v.Type
19868 x := v_0
19869 y := v_1
19870 if !(shiftIsBounded(v)) {
19871 break
19872 }
19873 v.reset(OpARM64SLL)
19874 v.Type = t
19875 v.AddArg2(x, y)
19876 return true
19877 }
19878
19879
19880
19881 for {
19882 t := v.Type
19883 x := v_0
19884 y := v_1
19885 if !(!shiftIsBounded(v)) {
19886 break
19887 }
19888 v.reset(OpARM64CSEL)
19889 v.AuxInt = opToAuxInt(OpARM64LessThanU)
19890 v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
19891 v0.AddArg2(x, y)
19892 v1 := b.NewValue0(v.Pos, OpConst64, t)
19893 v1.AuxInt = int64ToAuxInt(0)
19894 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
19895 v2.AuxInt = int64ToAuxInt(64)
19896 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
19897 v3.AddArg(y)
19898 v2.AddArg(v3)
19899 v.AddArg3(v0, v1, v2)
19900 return true
19901 }
19902 return false
19903 }
19904 func rewriteValueARM64_OpLsh8x32(v *Value) bool {
19905 v_1 := v.Args[1]
19906 v_0 := v.Args[0]
19907 b := v.Block
19908 typ := &b.Func.Config.Types
19909
19910
19911
19912 for {
19913 t := v.Type
19914 x := v_0
19915 y := v_1
19916 if !(shiftIsBounded(v)) {
19917 break
19918 }
19919 v.reset(OpARM64SLL)
19920 v.Type = t
19921 v.AddArg2(x, y)
19922 return true
19923 }
19924
19925
19926
19927 for {
19928 t := v.Type
19929 x := v_0
19930 y := v_1
19931 if !(!shiftIsBounded(v)) {
19932 break
19933 }
19934 v.reset(OpARM64CSEL)
19935 v.AuxInt = opToAuxInt(OpARM64LessThanU)
19936 v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
19937 v0.AddArg2(x, y)
19938 v1 := b.NewValue0(v.Pos, OpConst64, t)
19939 v1.AuxInt = int64ToAuxInt(0)
19940 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
19941 v2.AuxInt = int64ToAuxInt(64)
19942 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
19943 v3.AddArg(y)
19944 v2.AddArg(v3)
19945 v.AddArg3(v0, v1, v2)
19946 return true
19947 }
19948 return false
19949 }
19950 func rewriteValueARM64_OpLsh8x64(v *Value) bool {
19951 v_1 := v.Args[1]
19952 v_0 := v.Args[0]
19953 b := v.Block
19954
19955
19956
19957 for {
19958 t := v.Type
19959 x := v_0
19960 y := v_1
19961 if !(shiftIsBounded(v)) {
19962 break
19963 }
19964 v.reset(OpARM64SLL)
19965 v.Type = t
19966 v.AddArg2(x, y)
19967 return true
19968 }
19969
19970
19971
19972 for {
19973 t := v.Type
19974 x := v_0
19975 y := v_1
19976 if !(!shiftIsBounded(v)) {
19977 break
19978 }
19979 v.reset(OpARM64CSEL)
19980 v.AuxInt = opToAuxInt(OpARM64LessThanU)
19981 v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
19982 v0.AddArg2(x, y)
19983 v1 := b.NewValue0(v.Pos, OpConst64, t)
19984 v1.AuxInt = int64ToAuxInt(0)
19985 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
19986 v2.AuxInt = int64ToAuxInt(64)
19987 v2.AddArg(y)
19988 v.AddArg3(v0, v1, v2)
19989 return true
19990 }
19991 return false
19992 }
19993 func rewriteValueARM64_OpLsh8x8(v *Value) bool {
19994 v_1 := v.Args[1]
19995 v_0 := v.Args[0]
19996 b := v.Block
19997 typ := &b.Func.Config.Types
19998
19999
20000
20001 for {
20002 t := v.Type
20003 x := v_0
20004 y := v_1
20005 if !(shiftIsBounded(v)) {
20006 break
20007 }
20008 v.reset(OpARM64SLL)
20009 v.Type = t
20010 v.AddArg2(x, y)
20011 return true
20012 }
20013
20014
20015
20016 for {
20017 t := v.Type
20018 x := v_0
20019 y := v_1
20020 if !(!shiftIsBounded(v)) {
20021 break
20022 }
20023 v.reset(OpARM64CSEL)
20024 v.AuxInt = opToAuxInt(OpARM64LessThanU)
20025 v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
20026 v0.AddArg2(x, y)
20027 v1 := b.NewValue0(v.Pos, OpConst64, t)
20028 v1.AuxInt = int64ToAuxInt(0)
20029 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
20030 v2.AuxInt = int64ToAuxInt(64)
20031 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
20032 v3.AddArg(y)
20033 v2.AddArg(v3)
20034 v.AddArg3(v0, v1, v2)
20035 return true
20036 }
20037 return false
20038 }
20039 func rewriteValueARM64_OpMod16(v *Value) bool {
20040 v_1 := v.Args[1]
20041 v_0 := v.Args[0]
20042 b := v.Block
20043 typ := &b.Func.Config.Types
20044
20045
20046 for {
20047 x := v_0
20048 y := v_1
20049 v.reset(OpARM64MODW)
20050 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
20051 v0.AddArg(x)
20052 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
20053 v1.AddArg(y)
20054 v.AddArg2(v0, v1)
20055 return true
20056 }
20057 }
20058 func rewriteValueARM64_OpMod16u(v *Value) bool {
20059 v_1 := v.Args[1]
20060 v_0 := v.Args[0]
20061 b := v.Block
20062 typ := &b.Func.Config.Types
20063
20064
20065 for {
20066 x := v_0
20067 y := v_1
20068 v.reset(OpARM64UMODW)
20069 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
20070 v0.AddArg(x)
20071 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
20072 v1.AddArg(y)
20073 v.AddArg2(v0, v1)
20074 return true
20075 }
20076 }
20077 func rewriteValueARM64_OpMod32(v *Value) bool {
20078 v_1 := v.Args[1]
20079 v_0 := v.Args[0]
20080
20081
20082 for {
20083 x := v_0
20084 y := v_1
20085 v.reset(OpARM64MODW)
20086 v.AddArg2(x, y)
20087 return true
20088 }
20089 }
20090 func rewriteValueARM64_OpMod64(v *Value) bool {
20091 v_1 := v.Args[1]
20092 v_0 := v.Args[0]
20093
20094
20095 for {
20096 x := v_0
20097 y := v_1
20098 v.reset(OpARM64MOD)
20099 v.AddArg2(x, y)
20100 return true
20101 }
20102 }
20103 func rewriteValueARM64_OpMod8(v *Value) bool {
20104 v_1 := v.Args[1]
20105 v_0 := v.Args[0]
20106 b := v.Block
20107 typ := &b.Func.Config.Types
20108
20109
20110 for {
20111 x := v_0
20112 y := v_1
20113 v.reset(OpARM64MODW)
20114 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
20115 v0.AddArg(x)
20116 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
20117 v1.AddArg(y)
20118 v.AddArg2(v0, v1)
20119 return true
20120 }
20121 }
20122 func rewriteValueARM64_OpMod8u(v *Value) bool {
20123 v_1 := v.Args[1]
20124 v_0 := v.Args[0]
20125 b := v.Block
20126 typ := &b.Func.Config.Types
20127
20128
20129 for {
20130 x := v_0
20131 y := v_1
20132 v.reset(OpARM64UMODW)
20133 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
20134 v0.AddArg(x)
20135 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
20136 v1.AddArg(y)
20137 v.AddArg2(v0, v1)
20138 return true
20139 }
20140 }
20141 func rewriteValueARM64_OpMove(v *Value) bool {
20142 v_2 := v.Args[2]
20143 v_1 := v.Args[1]
20144 v_0 := v.Args[0]
20145 b := v.Block
20146 config := b.Func.Config
20147 typ := &b.Func.Config.Types
20148
20149
20150 for {
20151 if auxIntToInt64(v.AuxInt) != 0 {
20152 break
20153 }
20154 mem := v_2
20155 v.copyOf(mem)
20156 return true
20157 }
20158
20159
20160 for {
20161 if auxIntToInt64(v.AuxInt) != 1 {
20162 break
20163 }
20164 dst := v_0
20165 src := v_1
20166 mem := v_2
20167 v.reset(OpARM64MOVBstore)
20168 v0 := b.NewValue0(v.Pos, OpARM64MOVBUload, typ.UInt8)
20169 v0.AddArg2(src, mem)
20170 v.AddArg3(dst, v0, mem)
20171 return true
20172 }
20173
20174
20175 for {
20176 if auxIntToInt64(v.AuxInt) != 2 {
20177 break
20178 }
20179 dst := v_0
20180 src := v_1
20181 mem := v_2
20182 v.reset(OpARM64MOVHstore)
20183 v0 := b.NewValue0(v.Pos, OpARM64MOVHUload, typ.UInt16)
20184 v0.AddArg2(src, mem)
20185 v.AddArg3(dst, v0, mem)
20186 return true
20187 }
20188
20189
20190 for {
20191 if auxIntToInt64(v.AuxInt) != 3 {
20192 break
20193 }
20194 dst := v_0
20195 src := v_1
20196 mem := v_2
20197 v.reset(OpARM64MOVBstore)
20198 v.AuxInt = int32ToAuxInt(2)
20199 v0 := b.NewValue0(v.Pos, OpARM64MOVBUload, typ.UInt8)
20200 v0.AuxInt = int32ToAuxInt(2)
20201 v0.AddArg2(src, mem)
20202 v1 := b.NewValue0(v.Pos, OpARM64MOVHstore, types.TypeMem)
20203 v2 := b.NewValue0(v.Pos, OpARM64MOVHUload, typ.UInt16)
20204 v2.AddArg2(src, mem)
20205 v1.AddArg3(dst, v2, mem)
20206 v.AddArg3(dst, v0, v1)
20207 return true
20208 }
20209
20210
20211 for {
20212 if auxIntToInt64(v.AuxInt) != 4 {
20213 break
20214 }
20215 dst := v_0
20216 src := v_1
20217 mem := v_2
20218 v.reset(OpARM64MOVWstore)
20219 v0 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
20220 v0.AddArg2(src, mem)
20221 v.AddArg3(dst, v0, mem)
20222 return true
20223 }
20224
20225
20226 for {
20227 if auxIntToInt64(v.AuxInt) != 5 {
20228 break
20229 }
20230 dst := v_0
20231 src := v_1
20232 mem := v_2
20233 v.reset(OpARM64MOVBstore)
20234 v.AuxInt = int32ToAuxInt(4)
20235 v0 := b.NewValue0(v.Pos, OpARM64MOVBUload, typ.UInt8)
20236 v0.AuxInt = int32ToAuxInt(4)
20237 v0.AddArg2(src, mem)
20238 v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
20239 v2 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
20240 v2.AddArg2(src, mem)
20241 v1.AddArg3(dst, v2, mem)
20242 v.AddArg3(dst, v0, v1)
20243 return true
20244 }
20245
20246
20247 for {
20248 if auxIntToInt64(v.AuxInt) != 6 {
20249 break
20250 }
20251 dst := v_0
20252 src := v_1
20253 mem := v_2
20254 v.reset(OpARM64MOVHstore)
20255 v.AuxInt = int32ToAuxInt(4)
20256 v0 := b.NewValue0(v.Pos, OpARM64MOVHUload, typ.UInt16)
20257 v0.AuxInt = int32ToAuxInt(4)
20258 v0.AddArg2(src, mem)
20259 v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
20260 v2 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
20261 v2.AddArg2(src, mem)
20262 v1.AddArg3(dst, v2, mem)
20263 v.AddArg3(dst, v0, v1)
20264 return true
20265 }
20266
20267
20268 for {
20269 if auxIntToInt64(v.AuxInt) != 7 {
20270 break
20271 }
20272 dst := v_0
20273 src := v_1
20274 mem := v_2
20275 v.reset(OpARM64MOVWstore)
20276 v.AuxInt = int32ToAuxInt(3)
20277 v0 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
20278 v0.AuxInt = int32ToAuxInt(3)
20279 v0.AddArg2(src, mem)
20280 v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
20281 v2 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
20282 v2.AddArg2(src, mem)
20283 v1.AddArg3(dst, v2, mem)
20284 v.AddArg3(dst, v0, v1)
20285 return true
20286 }
20287
20288
20289 for {
20290 if auxIntToInt64(v.AuxInt) != 8 {
20291 break
20292 }
20293 dst := v_0
20294 src := v_1
20295 mem := v_2
20296 v.reset(OpARM64MOVDstore)
20297 v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
20298 v0.AddArg2(src, mem)
20299 v.AddArg3(dst, v0, mem)
20300 return true
20301 }
20302
20303
20304 for {
20305 if auxIntToInt64(v.AuxInt) != 9 {
20306 break
20307 }
20308 dst := v_0
20309 src := v_1
20310 mem := v_2
20311 v.reset(OpARM64MOVBstore)
20312 v.AuxInt = int32ToAuxInt(8)
20313 v0 := b.NewValue0(v.Pos, OpARM64MOVBUload, typ.UInt8)
20314 v0.AuxInt = int32ToAuxInt(8)
20315 v0.AddArg2(src, mem)
20316 v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
20317 v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
20318 v2.AddArg2(src, mem)
20319 v1.AddArg3(dst, v2, mem)
20320 v.AddArg3(dst, v0, v1)
20321 return true
20322 }
20323
20324
20325 for {
20326 if auxIntToInt64(v.AuxInt) != 10 {
20327 break
20328 }
20329 dst := v_0
20330 src := v_1
20331 mem := v_2
20332 v.reset(OpARM64MOVHstore)
20333 v.AuxInt = int32ToAuxInt(8)
20334 v0 := b.NewValue0(v.Pos, OpARM64MOVHUload, typ.UInt16)
20335 v0.AuxInt = int32ToAuxInt(8)
20336 v0.AddArg2(src, mem)
20337 v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
20338 v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
20339 v2.AddArg2(src, mem)
20340 v1.AddArg3(dst, v2, mem)
20341 v.AddArg3(dst, v0, v1)
20342 return true
20343 }
20344
20345
20346 for {
20347 if auxIntToInt64(v.AuxInt) != 11 {
20348 break
20349 }
20350 dst := v_0
20351 src := v_1
20352 mem := v_2
20353 v.reset(OpARM64MOVDstore)
20354 v.AuxInt = int32ToAuxInt(3)
20355 v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
20356 v0.AuxInt = int32ToAuxInt(3)
20357 v0.AddArg2(src, mem)
20358 v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
20359 v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
20360 v2.AddArg2(src, mem)
20361 v1.AddArg3(dst, v2, mem)
20362 v.AddArg3(dst, v0, v1)
20363 return true
20364 }
20365
20366
20367 for {
20368 if auxIntToInt64(v.AuxInt) != 12 {
20369 break
20370 }
20371 dst := v_0
20372 src := v_1
20373 mem := v_2
20374 v.reset(OpARM64MOVWstore)
20375 v.AuxInt = int32ToAuxInt(8)
20376 v0 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
20377 v0.AuxInt = int32ToAuxInt(8)
20378 v0.AddArg2(src, mem)
20379 v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
20380 v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
20381 v2.AddArg2(src, mem)
20382 v1.AddArg3(dst, v2, mem)
20383 v.AddArg3(dst, v0, v1)
20384 return true
20385 }
20386
20387
20388 for {
20389 if auxIntToInt64(v.AuxInt) != 13 {
20390 break
20391 }
20392 dst := v_0
20393 src := v_1
20394 mem := v_2
20395 v.reset(OpARM64MOVDstore)
20396 v.AuxInt = int32ToAuxInt(5)
20397 v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
20398 v0.AuxInt = int32ToAuxInt(5)
20399 v0.AddArg2(src, mem)
20400 v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
20401 v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
20402 v2.AddArg2(src, mem)
20403 v1.AddArg3(dst, v2, mem)
20404 v.AddArg3(dst, v0, v1)
20405 return true
20406 }
20407
20408
20409 for {
20410 if auxIntToInt64(v.AuxInt) != 14 {
20411 break
20412 }
20413 dst := v_0
20414 src := v_1
20415 mem := v_2
20416 v.reset(OpARM64MOVDstore)
20417 v.AuxInt = int32ToAuxInt(6)
20418 v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
20419 v0.AuxInt = int32ToAuxInt(6)
20420 v0.AddArg2(src, mem)
20421 v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
20422 v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
20423 v2.AddArg2(src, mem)
20424 v1.AddArg3(dst, v2, mem)
20425 v.AddArg3(dst, v0, v1)
20426 return true
20427 }
20428
20429
20430 for {
20431 if auxIntToInt64(v.AuxInt) != 15 {
20432 break
20433 }
20434 dst := v_0
20435 src := v_1
20436 mem := v_2
20437 v.reset(OpARM64MOVDstore)
20438 v.AuxInt = int32ToAuxInt(7)
20439 v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
20440 v0.AuxInt = int32ToAuxInt(7)
20441 v0.AddArg2(src, mem)
20442 v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
20443 v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
20444 v2.AddArg2(src, mem)
20445 v1.AddArg3(dst, v2, mem)
20446 v.AddArg3(dst, v0, v1)
20447 return true
20448 }
20449
20450
20451 for {
20452 if auxIntToInt64(v.AuxInt) != 16 {
20453 break
20454 }
20455 dst := v_0
20456 src := v_1
20457 mem := v_2
20458 v.reset(OpARM64STP)
20459 v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
20460 v1 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
20461 v1.AddArg2(src, mem)
20462 v0.AddArg(v1)
20463 v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
20464 v2.AddArg(v1)
20465 v.AddArg4(dst, v0, v2, mem)
20466 return true
20467 }
20468
20469
20470 for {
20471 if auxIntToInt64(v.AuxInt) != 32 {
20472 break
20473 }
20474 dst := v_0
20475 src := v_1
20476 mem := v_2
20477 v.reset(OpARM64STP)
20478 v.AuxInt = int32ToAuxInt(16)
20479 v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
20480 v1 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
20481 v1.AuxInt = int32ToAuxInt(16)
20482 v1.AddArg2(src, mem)
20483 v0.AddArg(v1)
20484 v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
20485 v2.AddArg(v1)
20486 v3 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
20487 v4 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
20488 v5 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
20489 v5.AddArg2(src, mem)
20490 v4.AddArg(v5)
20491 v6 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
20492 v6.AddArg(v5)
20493 v3.AddArg4(dst, v4, v6, mem)
20494 v.AddArg4(dst, v0, v2, v3)
20495 return true
20496 }
20497
20498
20499 for {
20500 if auxIntToInt64(v.AuxInt) != 48 {
20501 break
20502 }
20503 dst := v_0
20504 src := v_1
20505 mem := v_2
20506 v.reset(OpARM64STP)
20507 v.AuxInt = int32ToAuxInt(32)
20508 v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
20509 v1 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
20510 v1.AuxInt = int32ToAuxInt(32)
20511 v1.AddArg2(src, mem)
20512 v0.AddArg(v1)
20513 v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
20514 v2.AddArg(v1)
20515 v3 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
20516 v3.AuxInt = int32ToAuxInt(16)
20517 v4 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
20518 v5 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
20519 v5.AuxInt = int32ToAuxInt(16)
20520 v5.AddArg2(src, mem)
20521 v4.AddArg(v5)
20522 v6 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
20523 v6.AddArg(v5)
20524 v7 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
20525 v8 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
20526 v9 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
20527 v9.AddArg2(src, mem)
20528 v8.AddArg(v9)
20529 v10 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
20530 v10.AddArg(v9)
20531 v7.AddArg4(dst, v8, v10, mem)
20532 v3.AddArg4(dst, v4, v6, v7)
20533 v.AddArg4(dst, v0, v2, v3)
20534 return true
20535 }
20536
20537
20538 for {
20539 if auxIntToInt64(v.AuxInt) != 64 {
20540 break
20541 }
20542 dst := v_0
20543 src := v_1
20544 mem := v_2
20545 v.reset(OpARM64STP)
20546 v.AuxInt = int32ToAuxInt(48)
20547 v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
20548 v1 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
20549 v1.AuxInt = int32ToAuxInt(48)
20550 v1.AddArg2(src, mem)
20551 v0.AddArg(v1)
20552 v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
20553 v2.AddArg(v1)
20554 v3 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
20555 v3.AuxInt = int32ToAuxInt(32)
20556 v4 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
20557 v5 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
20558 v5.AuxInt = int32ToAuxInt(32)
20559 v5.AddArg2(src, mem)
20560 v4.AddArg(v5)
20561 v6 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
20562 v6.AddArg(v5)
20563 v7 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
20564 v7.AuxInt = int32ToAuxInt(16)
20565 v8 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
20566 v9 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
20567 v9.AuxInt = int32ToAuxInt(16)
20568 v9.AddArg2(src, mem)
20569 v8.AddArg(v9)
20570 v10 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
20571 v10.AddArg(v9)
20572 v11 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
20573 v12 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
20574 v13 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
20575 v13.AddArg2(src, mem)
20576 v12.AddArg(v13)
20577 v14 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
20578 v14.AddArg(v13)
20579 v11.AddArg4(dst, v12, v14, mem)
20580 v7.AddArg4(dst, v8, v10, v11)
20581 v3.AddArg4(dst, v4, v6, v7)
20582 v.AddArg4(dst, v0, v2, v3)
20583 return true
20584 }
20585
20586
20587
20588 for {
20589 s := auxIntToInt64(v.AuxInt)
20590 dst := v_0
20591 src := v_1
20592 mem := v_2
20593 if !(s%16 != 0 && s%16 <= 8 && s > 16) {
20594 break
20595 }
20596 v.reset(OpMove)
20597 v.AuxInt = int64ToAuxInt(8)
20598 v0 := b.NewValue0(v.Pos, OpOffPtr, dst.Type)
20599 v0.AuxInt = int64ToAuxInt(s - 8)
20600 v0.AddArg(dst)
20601 v1 := b.NewValue0(v.Pos, OpOffPtr, src.Type)
20602 v1.AuxInt = int64ToAuxInt(s - 8)
20603 v1.AddArg(src)
20604 v2 := b.NewValue0(v.Pos, OpMove, types.TypeMem)
20605 v2.AuxInt = int64ToAuxInt(s - s%16)
20606 v2.AddArg3(dst, src, mem)
20607 v.AddArg3(v0, v1, v2)
20608 return true
20609 }
20610
20611
20612
20613 for {
20614 s := auxIntToInt64(v.AuxInt)
20615 dst := v_0
20616 src := v_1
20617 mem := v_2
20618 if !(s%16 != 0 && s%16 > 8 && s > 16) {
20619 break
20620 }
20621 v.reset(OpMove)
20622 v.AuxInt = int64ToAuxInt(16)
20623 v0 := b.NewValue0(v.Pos, OpOffPtr, dst.Type)
20624 v0.AuxInt = int64ToAuxInt(s - 16)
20625 v0.AddArg(dst)
20626 v1 := b.NewValue0(v.Pos, OpOffPtr, src.Type)
20627 v1.AuxInt = int64ToAuxInt(s - 16)
20628 v1.AddArg(src)
20629 v2 := b.NewValue0(v.Pos, OpMove, types.TypeMem)
20630 v2.AuxInt = int64ToAuxInt(s - s%16)
20631 v2.AddArg3(dst, src, mem)
20632 v.AddArg3(v0, v1, v2)
20633 return true
20634 }
20635
20636
20637
20638 for {
20639 s := auxIntToInt64(v.AuxInt)
20640 dst := v_0
20641 src := v_1
20642 mem := v_2
20643 if !(s > 64 && s <= 16*64 && s%16 == 0 && !config.noDuffDevice && logLargeCopy(v, s)) {
20644 break
20645 }
20646 v.reset(OpARM64DUFFCOPY)
20647 v.AuxInt = int64ToAuxInt(8 * (64 - s/16))
20648 v.AddArg3(dst, src, mem)
20649 return true
20650 }
20651
20652
20653
20654 for {
20655 s := auxIntToInt64(v.AuxInt)
20656 dst := v_0
20657 src := v_1
20658 mem := v_2
20659 if !(s%16 == 0 && (s > 16*64 || config.noDuffDevice) && logLargeCopy(v, s)) {
20660 break
20661 }
20662 v.reset(OpARM64LoweredMove)
20663 v0 := b.NewValue0(v.Pos, OpARM64ADDconst, src.Type)
20664 v0.AuxInt = int64ToAuxInt(s - 16)
20665 v0.AddArg(src)
20666 v.AddArg4(dst, src, v0, mem)
20667 return true
20668 }
20669 return false
20670 }
20671 func rewriteValueARM64_OpNeq16(v *Value) bool {
20672 v_1 := v.Args[1]
20673 v_0 := v.Args[0]
20674 b := v.Block
20675 typ := &b.Func.Config.Types
20676
20677
20678 for {
20679 x := v_0
20680 y := v_1
20681 v.reset(OpARM64NotEqual)
20682 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
20683 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
20684 v1.AddArg(x)
20685 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
20686 v2.AddArg(y)
20687 v0.AddArg2(v1, v2)
20688 v.AddArg(v0)
20689 return true
20690 }
20691 }
20692 func rewriteValueARM64_OpNeq32(v *Value) bool {
20693 v_1 := v.Args[1]
20694 v_0 := v.Args[0]
20695 b := v.Block
20696
20697
20698 for {
20699 x := v_0
20700 y := v_1
20701 v.reset(OpARM64NotEqual)
20702 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
20703 v0.AddArg2(x, y)
20704 v.AddArg(v0)
20705 return true
20706 }
20707 }
20708 func rewriteValueARM64_OpNeq32F(v *Value) bool {
20709 v_1 := v.Args[1]
20710 v_0 := v.Args[0]
20711 b := v.Block
20712
20713
20714 for {
20715 x := v_0
20716 y := v_1
20717 v.reset(OpARM64NotEqual)
20718 v0 := b.NewValue0(v.Pos, OpARM64FCMPS, types.TypeFlags)
20719 v0.AddArg2(x, y)
20720 v.AddArg(v0)
20721 return true
20722 }
20723 }
20724 func rewriteValueARM64_OpNeq64(v *Value) bool {
20725 v_1 := v.Args[1]
20726 v_0 := v.Args[0]
20727 b := v.Block
20728
20729
20730 for {
20731 x := v_0
20732 y := v_1
20733 v.reset(OpARM64NotEqual)
20734 v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
20735 v0.AddArg2(x, y)
20736 v.AddArg(v0)
20737 return true
20738 }
20739 }
20740 func rewriteValueARM64_OpNeq64F(v *Value) bool {
20741 v_1 := v.Args[1]
20742 v_0 := v.Args[0]
20743 b := v.Block
20744
20745
20746 for {
20747 x := v_0
20748 y := v_1
20749 v.reset(OpARM64NotEqual)
20750 v0 := b.NewValue0(v.Pos, OpARM64FCMPD, types.TypeFlags)
20751 v0.AddArg2(x, y)
20752 v.AddArg(v0)
20753 return true
20754 }
20755 }
20756 func rewriteValueARM64_OpNeq8(v *Value) bool {
20757 v_1 := v.Args[1]
20758 v_0 := v.Args[0]
20759 b := v.Block
20760 typ := &b.Func.Config.Types
20761
20762
20763 for {
20764 x := v_0
20765 y := v_1
20766 v.reset(OpARM64NotEqual)
20767 v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
20768 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
20769 v1.AddArg(x)
20770 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
20771 v2.AddArg(y)
20772 v0.AddArg2(v1, v2)
20773 v.AddArg(v0)
20774 return true
20775 }
20776 }
20777 func rewriteValueARM64_OpNeqPtr(v *Value) bool {
20778 v_1 := v.Args[1]
20779 v_0 := v.Args[0]
20780 b := v.Block
20781
20782
20783 for {
20784 x := v_0
20785 y := v_1
20786 v.reset(OpARM64NotEqual)
20787 v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
20788 v0.AddArg2(x, y)
20789 v.AddArg(v0)
20790 return true
20791 }
20792 }
20793 func rewriteValueARM64_OpNot(v *Value) bool {
20794 v_0 := v.Args[0]
20795 b := v.Block
20796 typ := &b.Func.Config.Types
20797
20798
20799 for {
20800 x := v_0
20801 v.reset(OpARM64XOR)
20802 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
20803 v0.AuxInt = int64ToAuxInt(1)
20804 v.AddArg2(v0, x)
20805 return true
20806 }
20807 }
20808 func rewriteValueARM64_OpOffPtr(v *Value) bool {
20809 v_0 := v.Args[0]
20810
20811
20812
20813 for {
20814 off := auxIntToInt64(v.AuxInt)
20815 ptr := v_0
20816 if ptr.Op != OpSP || !(is32Bit(off)) {
20817 break
20818 }
20819 v.reset(OpARM64MOVDaddr)
20820 v.AuxInt = int32ToAuxInt(int32(off))
20821 v.AddArg(ptr)
20822 return true
20823 }
20824
20825
20826 for {
20827 off := auxIntToInt64(v.AuxInt)
20828 ptr := v_0
20829 v.reset(OpARM64ADDconst)
20830 v.AuxInt = int64ToAuxInt(off)
20831 v.AddArg(ptr)
20832 return true
20833 }
20834 }
20835 func rewriteValueARM64_OpPanicBounds(v *Value) bool {
20836 v_2 := v.Args[2]
20837 v_1 := v.Args[1]
20838 v_0 := v.Args[0]
20839
20840
20841
20842 for {
20843 kind := auxIntToInt64(v.AuxInt)
20844 x := v_0
20845 y := v_1
20846 mem := v_2
20847 if !(boundsABI(kind) == 0) {
20848 break
20849 }
20850 v.reset(OpARM64LoweredPanicBoundsA)
20851 v.AuxInt = int64ToAuxInt(kind)
20852 v.AddArg3(x, y, mem)
20853 return true
20854 }
20855
20856
20857
20858 for {
20859 kind := auxIntToInt64(v.AuxInt)
20860 x := v_0
20861 y := v_1
20862 mem := v_2
20863 if !(boundsABI(kind) == 1) {
20864 break
20865 }
20866 v.reset(OpARM64LoweredPanicBoundsB)
20867 v.AuxInt = int64ToAuxInt(kind)
20868 v.AddArg3(x, y, mem)
20869 return true
20870 }
20871
20872
20873
20874 for {
20875 kind := auxIntToInt64(v.AuxInt)
20876 x := v_0
20877 y := v_1
20878 mem := v_2
20879 if !(boundsABI(kind) == 2) {
20880 break
20881 }
20882 v.reset(OpARM64LoweredPanicBoundsC)
20883 v.AuxInt = int64ToAuxInt(kind)
20884 v.AddArg3(x, y, mem)
20885 return true
20886 }
20887 return false
20888 }
20889 func rewriteValueARM64_OpPopCount16(v *Value) bool {
20890 v_0 := v.Args[0]
20891 b := v.Block
20892 typ := &b.Func.Config.Types
20893
20894
20895 for {
20896 t := v.Type
20897 x := v_0
20898 v.reset(OpARM64FMOVDfpgp)
20899 v.Type = t
20900 v0 := b.NewValue0(v.Pos, OpARM64VUADDLV, typ.Float64)
20901 v1 := b.NewValue0(v.Pos, OpARM64VCNT, typ.Float64)
20902 v2 := b.NewValue0(v.Pos, OpARM64FMOVDgpfp, typ.Float64)
20903 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
20904 v3.AddArg(x)
20905 v2.AddArg(v3)
20906 v1.AddArg(v2)
20907 v0.AddArg(v1)
20908 v.AddArg(v0)
20909 return true
20910 }
20911 }
20912 func rewriteValueARM64_OpPopCount32(v *Value) bool {
20913 v_0 := v.Args[0]
20914 b := v.Block
20915 typ := &b.Func.Config.Types
20916
20917
20918 for {
20919 t := v.Type
20920 x := v_0
20921 v.reset(OpARM64FMOVDfpgp)
20922 v.Type = t
20923 v0 := b.NewValue0(v.Pos, OpARM64VUADDLV, typ.Float64)
20924 v1 := b.NewValue0(v.Pos, OpARM64VCNT, typ.Float64)
20925 v2 := b.NewValue0(v.Pos, OpARM64FMOVDgpfp, typ.Float64)
20926 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
20927 v3.AddArg(x)
20928 v2.AddArg(v3)
20929 v1.AddArg(v2)
20930 v0.AddArg(v1)
20931 v.AddArg(v0)
20932 return true
20933 }
20934 }
20935 func rewriteValueARM64_OpPopCount64(v *Value) bool {
20936 v_0 := v.Args[0]
20937 b := v.Block
20938 typ := &b.Func.Config.Types
20939
20940
20941 for {
20942 t := v.Type
20943 x := v_0
20944 v.reset(OpARM64FMOVDfpgp)
20945 v.Type = t
20946 v0 := b.NewValue0(v.Pos, OpARM64VUADDLV, typ.Float64)
20947 v1 := b.NewValue0(v.Pos, OpARM64VCNT, typ.Float64)
20948 v2 := b.NewValue0(v.Pos, OpARM64FMOVDgpfp, typ.Float64)
20949 v2.AddArg(x)
20950 v1.AddArg(v2)
20951 v0.AddArg(v1)
20952 v.AddArg(v0)
20953 return true
20954 }
20955 }
20956 func rewriteValueARM64_OpPrefetchCache(v *Value) bool {
20957 v_1 := v.Args[1]
20958 v_0 := v.Args[0]
20959
20960
20961 for {
20962 addr := v_0
20963 mem := v_1
20964 v.reset(OpARM64PRFM)
20965 v.AuxInt = int64ToAuxInt(0)
20966 v.AddArg2(addr, mem)
20967 return true
20968 }
20969 }
20970 func rewriteValueARM64_OpPrefetchCacheStreamed(v *Value) bool {
20971 v_1 := v.Args[1]
20972 v_0 := v.Args[0]
20973
20974
20975 for {
20976 addr := v_0
20977 mem := v_1
20978 v.reset(OpARM64PRFM)
20979 v.AuxInt = int64ToAuxInt(1)
20980 v.AddArg2(addr, mem)
20981 return true
20982 }
20983 }
20984 func rewriteValueARM64_OpPubBarrier(v *Value) bool {
20985 v_0 := v.Args[0]
20986
20987
20988 for {
20989 mem := v_0
20990 v.reset(OpARM64DMB)
20991 v.AuxInt = int64ToAuxInt(0xe)
20992 v.AddArg(mem)
20993 return true
20994 }
20995 }
20996 func rewriteValueARM64_OpRotateLeft16(v *Value) bool {
20997 v_1 := v.Args[1]
20998 v_0 := v.Args[0]
20999 b := v.Block
21000 typ := &b.Func.Config.Types
21001
21002
21003 for {
21004 t := v.Type
21005 x := v_0
21006 if v_1.Op != OpARM64MOVDconst {
21007 break
21008 }
21009 c := auxIntToInt64(v_1.AuxInt)
21010 v.reset(OpOr16)
21011 v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
21012 v1 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
21013 v1.AuxInt = int64ToAuxInt(c & 15)
21014 v0.AddArg2(x, v1)
21015 v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
21016 v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
21017 v3.AuxInt = int64ToAuxInt(-c & 15)
21018 v2.AddArg2(x, v3)
21019 v.AddArg2(v0, v2)
21020 return true
21021 }
21022
21023
21024 for {
21025 t := v.Type
21026 x := v_0
21027 y := v_1
21028 v.reset(OpARM64RORW)
21029 v.Type = t
21030 v0 := b.NewValue0(v.Pos, OpARM64ORshiftLL, typ.UInt32)
21031 v0.AuxInt = int64ToAuxInt(16)
21032 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
21033 v1.AddArg(x)
21034 v0.AddArg2(v1, v1)
21035 v2 := b.NewValue0(v.Pos, OpARM64NEG, typ.Int64)
21036 v2.AddArg(y)
21037 v.AddArg2(v0, v2)
21038 return true
21039 }
21040 }
21041 func rewriteValueARM64_OpRotateLeft32(v *Value) bool {
21042 v_1 := v.Args[1]
21043 v_0 := v.Args[0]
21044 b := v.Block
21045
21046
21047 for {
21048 x := v_0
21049 y := v_1
21050 v.reset(OpARM64RORW)
21051 v0 := b.NewValue0(v.Pos, OpARM64NEG, y.Type)
21052 v0.AddArg(y)
21053 v.AddArg2(x, v0)
21054 return true
21055 }
21056 }
21057 func rewriteValueARM64_OpRotateLeft64(v *Value) bool {
21058 v_1 := v.Args[1]
21059 v_0 := v.Args[0]
21060 b := v.Block
21061
21062
21063 for {
21064 x := v_0
21065 y := v_1
21066 v.reset(OpARM64ROR)
21067 v0 := b.NewValue0(v.Pos, OpARM64NEG, y.Type)
21068 v0.AddArg(y)
21069 v.AddArg2(x, v0)
21070 return true
21071 }
21072 }
21073 func rewriteValueARM64_OpRotateLeft8(v *Value) bool {
21074 v_1 := v.Args[1]
21075 v_0 := v.Args[0]
21076 b := v.Block
21077 typ := &b.Func.Config.Types
21078
21079
21080 for {
21081 t := v.Type
21082 x := v_0
21083 if v_1.Op != OpARM64MOVDconst {
21084 break
21085 }
21086 c := auxIntToInt64(v_1.AuxInt)
21087 v.reset(OpOr8)
21088 v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
21089 v1 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
21090 v1.AuxInt = int64ToAuxInt(c & 7)
21091 v0.AddArg2(x, v1)
21092 v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
21093 v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
21094 v3.AuxInt = int64ToAuxInt(-c & 7)
21095 v2.AddArg2(x, v3)
21096 v.AddArg2(v0, v2)
21097 return true
21098 }
21099
21100
21101 for {
21102 t := v.Type
21103 x := v_0
21104 y := v_1
21105 v.reset(OpARM64OR)
21106 v.Type = t
21107 v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
21108 v1 := b.NewValue0(v.Pos, OpARM64ANDconst, typ.Int64)
21109 v1.AuxInt = int64ToAuxInt(7)
21110 v1.AddArg(y)
21111 v0.AddArg2(x, v1)
21112 v2 := b.NewValue0(v.Pos, OpARM64SRL, t)
21113 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
21114 v3.AddArg(x)
21115 v4 := b.NewValue0(v.Pos, OpARM64ANDconst, typ.Int64)
21116 v4.AuxInt = int64ToAuxInt(7)
21117 v5 := b.NewValue0(v.Pos, OpARM64NEG, typ.Int64)
21118 v5.AddArg(y)
21119 v4.AddArg(v5)
21120 v2.AddArg2(v3, v4)
21121 v.AddArg2(v0, v2)
21122 return true
21123 }
21124 }
21125 func rewriteValueARM64_OpRsh16Ux16(v *Value) bool {
21126 v_1 := v.Args[1]
21127 v_0 := v.Args[0]
21128 b := v.Block
21129 typ := &b.Func.Config.Types
21130
21131
21132
21133 for {
21134 t := v.Type
21135 x := v_0
21136 y := v_1
21137 if !(shiftIsBounded(v)) {
21138 break
21139 }
21140 v.reset(OpARM64SRL)
21141 v.Type = t
21142 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
21143 v0.AddArg(x)
21144 v.AddArg2(v0, y)
21145 return true
21146 }
21147
21148
21149
21150 for {
21151 t := v.Type
21152 x := v_0
21153 y := v_1
21154 if !(!shiftIsBounded(v)) {
21155 break
21156 }
21157 v.reset(OpARM64CSEL)
21158 v.AuxInt = opToAuxInt(OpARM64LessThanU)
21159 v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
21160 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
21161 v1.AddArg(x)
21162 v0.AddArg2(v1, y)
21163 v2 := b.NewValue0(v.Pos, OpConst64, t)
21164 v2.AuxInt = int64ToAuxInt(0)
21165 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
21166 v3.AuxInt = int64ToAuxInt(64)
21167 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
21168 v4.AddArg(y)
21169 v3.AddArg(v4)
21170 v.AddArg3(v0, v2, v3)
21171 return true
21172 }
21173 return false
21174 }
21175 func rewriteValueARM64_OpRsh16Ux32(v *Value) bool {
21176 v_1 := v.Args[1]
21177 v_0 := v.Args[0]
21178 b := v.Block
21179 typ := &b.Func.Config.Types
21180
21181
21182
21183 for {
21184 t := v.Type
21185 x := v_0
21186 y := v_1
21187 if !(shiftIsBounded(v)) {
21188 break
21189 }
21190 v.reset(OpARM64SRL)
21191 v.Type = t
21192 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
21193 v0.AddArg(x)
21194 v.AddArg2(v0, y)
21195 return true
21196 }
21197
21198
21199
21200 for {
21201 t := v.Type
21202 x := v_0
21203 y := v_1
21204 if !(!shiftIsBounded(v)) {
21205 break
21206 }
21207 v.reset(OpARM64CSEL)
21208 v.AuxInt = opToAuxInt(OpARM64LessThanU)
21209 v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
21210 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
21211 v1.AddArg(x)
21212 v0.AddArg2(v1, y)
21213 v2 := b.NewValue0(v.Pos, OpConst64, t)
21214 v2.AuxInt = int64ToAuxInt(0)
21215 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
21216 v3.AuxInt = int64ToAuxInt(64)
21217 v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
21218 v4.AddArg(y)
21219 v3.AddArg(v4)
21220 v.AddArg3(v0, v2, v3)
21221 return true
21222 }
21223 return false
21224 }
21225 func rewriteValueARM64_OpRsh16Ux64(v *Value) bool {
21226 v_1 := v.Args[1]
21227 v_0 := v.Args[0]
21228 b := v.Block
21229 typ := &b.Func.Config.Types
21230
21231
21232
21233 for {
21234 t := v.Type
21235 x := v_0
21236 y := v_1
21237 if !(shiftIsBounded(v)) {
21238 break
21239 }
21240 v.reset(OpARM64SRL)
21241 v.Type = t
21242 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
21243 v0.AddArg(x)
21244 v.AddArg2(v0, y)
21245 return true
21246 }
21247
21248
21249
21250 for {
21251 t := v.Type
21252 x := v_0
21253 y := v_1
21254 if !(!shiftIsBounded(v)) {
21255 break
21256 }
21257 v.reset(OpARM64CSEL)
21258 v.AuxInt = opToAuxInt(OpARM64LessThanU)
21259 v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
21260 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
21261 v1.AddArg(x)
21262 v0.AddArg2(v1, y)
21263 v2 := b.NewValue0(v.Pos, OpConst64, t)
21264 v2.AuxInt = int64ToAuxInt(0)
21265 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
21266 v3.AuxInt = int64ToAuxInt(64)
21267 v3.AddArg(y)
21268 v.AddArg3(v0, v2, v3)
21269 return true
21270 }
21271 return false
21272 }
21273 func rewriteValueARM64_OpRsh16Ux8(v *Value) bool {
21274 v_1 := v.Args[1]
21275 v_0 := v.Args[0]
21276 b := v.Block
21277 typ := &b.Func.Config.Types
21278
21279
21280
21281 for {
21282 t := v.Type
21283 x := v_0
21284 y := v_1
21285 if !(shiftIsBounded(v)) {
21286 break
21287 }
21288 v.reset(OpARM64SRL)
21289 v.Type = t
21290 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
21291 v0.AddArg(x)
21292 v.AddArg2(v0, y)
21293 return true
21294 }
21295
21296
21297
21298 for {
21299 t := v.Type
21300 x := v_0
21301 y := v_1
21302 if !(!shiftIsBounded(v)) {
21303 break
21304 }
21305 v.reset(OpARM64CSEL)
21306 v.AuxInt = opToAuxInt(OpARM64LessThanU)
21307 v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
21308 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
21309 v1.AddArg(x)
21310 v0.AddArg2(v1, y)
21311 v2 := b.NewValue0(v.Pos, OpConst64, t)
21312 v2.AuxInt = int64ToAuxInt(0)
21313 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
21314 v3.AuxInt = int64ToAuxInt(64)
21315 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
21316 v4.AddArg(y)
21317 v3.AddArg(v4)
21318 v.AddArg3(v0, v2, v3)
21319 return true
21320 }
21321 return false
21322 }
21323 func rewriteValueARM64_OpRsh16x16(v *Value) bool {
21324 v_1 := v.Args[1]
21325 v_0 := v.Args[0]
21326 b := v.Block
21327 typ := &b.Func.Config.Types
21328
21329
21330
21331 for {
21332 t := v.Type
21333 x := v_0
21334 y := v_1
21335 if !(shiftIsBounded(v)) {
21336 break
21337 }
21338 v.reset(OpARM64SRA)
21339 v.Type = t
21340 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
21341 v0.AddArg(x)
21342 v.AddArg2(v0, y)
21343 return true
21344 }
21345
21346
21347
21348 for {
21349 x := v_0
21350 y := v_1
21351 if !(!shiftIsBounded(v)) {
21352 break
21353 }
21354 v.reset(OpARM64SRA)
21355 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
21356 v0.AddArg(x)
21357 v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
21358 v1.AuxInt = opToAuxInt(OpARM64LessThanU)
21359 v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
21360 v2.AuxInt = int64ToAuxInt(63)
21361 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
21362 v3.AuxInt = int64ToAuxInt(64)
21363 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
21364 v4.AddArg(y)
21365 v3.AddArg(v4)
21366 v1.AddArg3(y, v2, v3)
21367 v.AddArg2(v0, v1)
21368 return true
21369 }
21370 return false
21371 }
21372 func rewriteValueARM64_OpRsh16x32(v *Value) bool {
21373 v_1 := v.Args[1]
21374 v_0 := v.Args[0]
21375 b := v.Block
21376 typ := &b.Func.Config.Types
21377
21378
21379
21380 for {
21381 t := v.Type
21382 x := v_0
21383 y := v_1
21384 if !(shiftIsBounded(v)) {
21385 break
21386 }
21387 v.reset(OpARM64SRA)
21388 v.Type = t
21389 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
21390 v0.AddArg(x)
21391 v.AddArg2(v0, y)
21392 return true
21393 }
21394
21395
21396
21397 for {
21398 x := v_0
21399 y := v_1
21400 if !(!shiftIsBounded(v)) {
21401 break
21402 }
21403 v.reset(OpARM64SRA)
21404 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
21405 v0.AddArg(x)
21406 v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
21407 v1.AuxInt = opToAuxInt(OpARM64LessThanU)
21408 v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
21409 v2.AuxInt = int64ToAuxInt(63)
21410 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
21411 v3.AuxInt = int64ToAuxInt(64)
21412 v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
21413 v4.AddArg(y)
21414 v3.AddArg(v4)
21415 v1.AddArg3(y, v2, v3)
21416 v.AddArg2(v0, v1)
21417 return true
21418 }
21419 return false
21420 }
21421 func rewriteValueARM64_OpRsh16x64(v *Value) bool {
21422 v_1 := v.Args[1]
21423 v_0 := v.Args[0]
21424 b := v.Block
21425 typ := &b.Func.Config.Types
21426
21427
21428
21429 for {
21430 t := v.Type
21431 x := v_0
21432 y := v_1
21433 if !(shiftIsBounded(v)) {
21434 break
21435 }
21436 v.reset(OpARM64SRA)
21437 v.Type = t
21438 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
21439 v0.AddArg(x)
21440 v.AddArg2(v0, y)
21441 return true
21442 }
21443
21444
21445
21446 for {
21447 x := v_0
21448 y := v_1
21449 if !(!shiftIsBounded(v)) {
21450 break
21451 }
21452 v.reset(OpARM64SRA)
21453 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
21454 v0.AddArg(x)
21455 v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
21456 v1.AuxInt = opToAuxInt(OpARM64LessThanU)
21457 v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
21458 v2.AuxInt = int64ToAuxInt(63)
21459 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
21460 v3.AuxInt = int64ToAuxInt(64)
21461 v3.AddArg(y)
21462 v1.AddArg3(y, v2, v3)
21463 v.AddArg2(v0, v1)
21464 return true
21465 }
21466 return false
21467 }
21468 func rewriteValueARM64_OpRsh16x8(v *Value) bool {
21469 v_1 := v.Args[1]
21470 v_0 := v.Args[0]
21471 b := v.Block
21472 typ := &b.Func.Config.Types
21473
21474
21475
21476 for {
21477 t := v.Type
21478 x := v_0
21479 y := v_1
21480 if !(shiftIsBounded(v)) {
21481 break
21482 }
21483 v.reset(OpARM64SRA)
21484 v.Type = t
21485 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
21486 v0.AddArg(x)
21487 v.AddArg2(v0, y)
21488 return true
21489 }
21490
21491
21492
21493 for {
21494 x := v_0
21495 y := v_1
21496 if !(!shiftIsBounded(v)) {
21497 break
21498 }
21499 v.reset(OpARM64SRA)
21500 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
21501 v0.AddArg(x)
21502 v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
21503 v1.AuxInt = opToAuxInt(OpARM64LessThanU)
21504 v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
21505 v2.AuxInt = int64ToAuxInt(63)
21506 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
21507 v3.AuxInt = int64ToAuxInt(64)
21508 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
21509 v4.AddArg(y)
21510 v3.AddArg(v4)
21511 v1.AddArg3(y, v2, v3)
21512 v.AddArg2(v0, v1)
21513 return true
21514 }
21515 return false
21516 }
21517 func rewriteValueARM64_OpRsh32Ux16(v *Value) bool {
21518 v_1 := v.Args[1]
21519 v_0 := v.Args[0]
21520 b := v.Block
21521 typ := &b.Func.Config.Types
21522
21523
21524
21525 for {
21526 t := v.Type
21527 x := v_0
21528 y := v_1
21529 if !(shiftIsBounded(v)) {
21530 break
21531 }
21532 v.reset(OpARM64SRL)
21533 v.Type = t
21534 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
21535 v0.AddArg(x)
21536 v.AddArg2(v0, y)
21537 return true
21538 }
21539
21540
21541
21542 for {
21543 t := v.Type
21544 x := v_0
21545 y := v_1
21546 if !(!shiftIsBounded(v)) {
21547 break
21548 }
21549 v.reset(OpARM64CSEL)
21550 v.AuxInt = opToAuxInt(OpARM64LessThanU)
21551 v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
21552 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
21553 v1.AddArg(x)
21554 v0.AddArg2(v1, y)
21555 v2 := b.NewValue0(v.Pos, OpConst64, t)
21556 v2.AuxInt = int64ToAuxInt(0)
21557 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
21558 v3.AuxInt = int64ToAuxInt(64)
21559 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
21560 v4.AddArg(y)
21561 v3.AddArg(v4)
21562 v.AddArg3(v0, v2, v3)
21563 return true
21564 }
21565 return false
21566 }
21567 func rewriteValueARM64_OpRsh32Ux32(v *Value) bool {
21568 v_1 := v.Args[1]
21569 v_0 := v.Args[0]
21570 b := v.Block
21571 typ := &b.Func.Config.Types
21572
21573
21574
21575 for {
21576 t := v.Type
21577 x := v_0
21578 y := v_1
21579 if !(shiftIsBounded(v)) {
21580 break
21581 }
21582 v.reset(OpARM64SRL)
21583 v.Type = t
21584 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
21585 v0.AddArg(x)
21586 v.AddArg2(v0, y)
21587 return true
21588 }
21589
21590
21591
21592 for {
21593 t := v.Type
21594 x := v_0
21595 y := v_1
21596 if !(!shiftIsBounded(v)) {
21597 break
21598 }
21599 v.reset(OpARM64CSEL)
21600 v.AuxInt = opToAuxInt(OpARM64LessThanU)
21601 v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
21602 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
21603 v1.AddArg(x)
21604 v0.AddArg2(v1, y)
21605 v2 := b.NewValue0(v.Pos, OpConst64, t)
21606 v2.AuxInt = int64ToAuxInt(0)
21607 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
21608 v3.AuxInt = int64ToAuxInt(64)
21609 v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
21610 v4.AddArg(y)
21611 v3.AddArg(v4)
21612 v.AddArg3(v0, v2, v3)
21613 return true
21614 }
21615 return false
21616 }
21617 func rewriteValueARM64_OpRsh32Ux64(v *Value) bool {
21618 v_1 := v.Args[1]
21619 v_0 := v.Args[0]
21620 b := v.Block
21621 typ := &b.Func.Config.Types
21622
21623
21624
21625 for {
21626 t := v.Type
21627 x := v_0
21628 y := v_1
21629 if !(shiftIsBounded(v)) {
21630 break
21631 }
21632 v.reset(OpARM64SRL)
21633 v.Type = t
21634 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
21635 v0.AddArg(x)
21636 v.AddArg2(v0, y)
21637 return true
21638 }
21639
21640
21641
21642 for {
21643 t := v.Type
21644 x := v_0
21645 y := v_1
21646 if !(!shiftIsBounded(v)) {
21647 break
21648 }
21649 v.reset(OpARM64CSEL)
21650 v.AuxInt = opToAuxInt(OpARM64LessThanU)
21651 v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
21652 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
21653 v1.AddArg(x)
21654 v0.AddArg2(v1, y)
21655 v2 := b.NewValue0(v.Pos, OpConst64, t)
21656 v2.AuxInt = int64ToAuxInt(0)
21657 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
21658 v3.AuxInt = int64ToAuxInt(64)
21659 v3.AddArg(y)
21660 v.AddArg3(v0, v2, v3)
21661 return true
21662 }
21663 return false
21664 }
21665 func rewriteValueARM64_OpRsh32Ux8(v *Value) bool {
21666 v_1 := v.Args[1]
21667 v_0 := v.Args[0]
21668 b := v.Block
21669 typ := &b.Func.Config.Types
21670
21671
21672
21673 for {
21674 t := v.Type
21675 x := v_0
21676 y := v_1
21677 if !(shiftIsBounded(v)) {
21678 break
21679 }
21680 v.reset(OpARM64SRL)
21681 v.Type = t
21682 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
21683 v0.AddArg(x)
21684 v.AddArg2(v0, y)
21685 return true
21686 }
21687
21688
21689
21690 for {
21691 t := v.Type
21692 x := v_0
21693 y := v_1
21694 if !(!shiftIsBounded(v)) {
21695 break
21696 }
21697 v.reset(OpARM64CSEL)
21698 v.AuxInt = opToAuxInt(OpARM64LessThanU)
21699 v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
21700 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
21701 v1.AddArg(x)
21702 v0.AddArg2(v1, y)
21703 v2 := b.NewValue0(v.Pos, OpConst64, t)
21704 v2.AuxInt = int64ToAuxInt(0)
21705 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
21706 v3.AuxInt = int64ToAuxInt(64)
21707 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
21708 v4.AddArg(y)
21709 v3.AddArg(v4)
21710 v.AddArg3(v0, v2, v3)
21711 return true
21712 }
21713 return false
21714 }
21715 func rewriteValueARM64_OpRsh32x16(v *Value) bool {
21716 v_1 := v.Args[1]
21717 v_0 := v.Args[0]
21718 b := v.Block
21719 typ := &b.Func.Config.Types
21720
21721
21722
21723 for {
21724 t := v.Type
21725 x := v_0
21726 y := v_1
21727 if !(shiftIsBounded(v)) {
21728 break
21729 }
21730 v.reset(OpARM64SRA)
21731 v.Type = t
21732 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
21733 v0.AddArg(x)
21734 v.AddArg2(v0, y)
21735 return true
21736 }
21737
21738
21739
21740 for {
21741 x := v_0
21742 y := v_1
21743 if !(!shiftIsBounded(v)) {
21744 break
21745 }
21746 v.reset(OpARM64SRA)
21747 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
21748 v0.AddArg(x)
21749 v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
21750 v1.AuxInt = opToAuxInt(OpARM64LessThanU)
21751 v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
21752 v2.AuxInt = int64ToAuxInt(63)
21753 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
21754 v3.AuxInt = int64ToAuxInt(64)
21755 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
21756 v4.AddArg(y)
21757 v3.AddArg(v4)
21758 v1.AddArg3(y, v2, v3)
21759 v.AddArg2(v0, v1)
21760 return true
21761 }
21762 return false
21763 }
21764 func rewriteValueARM64_OpRsh32x32(v *Value) bool {
21765 v_1 := v.Args[1]
21766 v_0 := v.Args[0]
21767 b := v.Block
21768 typ := &b.Func.Config.Types
21769
21770
21771
21772 for {
21773 t := v.Type
21774 x := v_0
21775 y := v_1
21776 if !(shiftIsBounded(v)) {
21777 break
21778 }
21779 v.reset(OpARM64SRA)
21780 v.Type = t
21781 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
21782 v0.AddArg(x)
21783 v.AddArg2(v0, y)
21784 return true
21785 }
21786
21787
21788
21789 for {
21790 x := v_0
21791 y := v_1
21792 if !(!shiftIsBounded(v)) {
21793 break
21794 }
21795 v.reset(OpARM64SRA)
21796 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
21797 v0.AddArg(x)
21798 v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
21799 v1.AuxInt = opToAuxInt(OpARM64LessThanU)
21800 v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
21801 v2.AuxInt = int64ToAuxInt(63)
21802 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
21803 v3.AuxInt = int64ToAuxInt(64)
21804 v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
21805 v4.AddArg(y)
21806 v3.AddArg(v4)
21807 v1.AddArg3(y, v2, v3)
21808 v.AddArg2(v0, v1)
21809 return true
21810 }
21811 return false
21812 }
21813 func rewriteValueARM64_OpRsh32x64(v *Value) bool {
21814 v_1 := v.Args[1]
21815 v_0 := v.Args[0]
21816 b := v.Block
21817 typ := &b.Func.Config.Types
21818
21819
21820
21821 for {
21822 t := v.Type
21823 x := v_0
21824 y := v_1
21825 if !(shiftIsBounded(v)) {
21826 break
21827 }
21828 v.reset(OpARM64SRA)
21829 v.Type = t
21830 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
21831 v0.AddArg(x)
21832 v.AddArg2(v0, y)
21833 return true
21834 }
21835
21836
21837
21838 for {
21839 x := v_0
21840 y := v_1
21841 if !(!shiftIsBounded(v)) {
21842 break
21843 }
21844 v.reset(OpARM64SRA)
21845 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
21846 v0.AddArg(x)
21847 v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
21848 v1.AuxInt = opToAuxInt(OpARM64LessThanU)
21849 v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
21850 v2.AuxInt = int64ToAuxInt(63)
21851 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
21852 v3.AuxInt = int64ToAuxInt(64)
21853 v3.AddArg(y)
21854 v1.AddArg3(y, v2, v3)
21855 v.AddArg2(v0, v1)
21856 return true
21857 }
21858 return false
21859 }
21860 func rewriteValueARM64_OpRsh32x8(v *Value) bool {
21861 v_1 := v.Args[1]
21862 v_0 := v.Args[0]
21863 b := v.Block
21864 typ := &b.Func.Config.Types
21865
21866
21867
21868 for {
21869 t := v.Type
21870 x := v_0
21871 y := v_1
21872 if !(shiftIsBounded(v)) {
21873 break
21874 }
21875 v.reset(OpARM64SRA)
21876 v.Type = t
21877 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
21878 v0.AddArg(x)
21879 v.AddArg2(v0, y)
21880 return true
21881 }
21882
21883
21884
21885 for {
21886 x := v_0
21887 y := v_1
21888 if !(!shiftIsBounded(v)) {
21889 break
21890 }
21891 v.reset(OpARM64SRA)
21892 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
21893 v0.AddArg(x)
21894 v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
21895 v1.AuxInt = opToAuxInt(OpARM64LessThanU)
21896 v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
21897 v2.AuxInt = int64ToAuxInt(63)
21898 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
21899 v3.AuxInt = int64ToAuxInt(64)
21900 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
21901 v4.AddArg(y)
21902 v3.AddArg(v4)
21903 v1.AddArg3(y, v2, v3)
21904 v.AddArg2(v0, v1)
21905 return true
21906 }
21907 return false
21908 }
21909 func rewriteValueARM64_OpRsh64Ux16(v *Value) bool {
21910 v_1 := v.Args[1]
21911 v_0 := v.Args[0]
21912 b := v.Block
21913 typ := &b.Func.Config.Types
21914
21915
21916
21917 for {
21918 t := v.Type
21919 x := v_0
21920 y := v_1
21921 if !(shiftIsBounded(v)) {
21922 break
21923 }
21924 v.reset(OpARM64SRL)
21925 v.Type = t
21926 v.AddArg2(x, y)
21927 return true
21928 }
21929
21930
21931
21932 for {
21933 t := v.Type
21934 x := v_0
21935 y := v_1
21936 if !(!shiftIsBounded(v)) {
21937 break
21938 }
21939 v.reset(OpARM64CSEL)
21940 v.AuxInt = opToAuxInt(OpARM64LessThanU)
21941 v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
21942 v0.AddArg2(x, y)
21943 v1 := b.NewValue0(v.Pos, OpConst64, t)
21944 v1.AuxInt = int64ToAuxInt(0)
21945 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
21946 v2.AuxInt = int64ToAuxInt(64)
21947 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
21948 v3.AddArg(y)
21949 v2.AddArg(v3)
21950 v.AddArg3(v0, v1, v2)
21951 return true
21952 }
21953 return false
21954 }
21955 func rewriteValueARM64_OpRsh64Ux32(v *Value) bool {
21956 v_1 := v.Args[1]
21957 v_0 := v.Args[0]
21958 b := v.Block
21959 typ := &b.Func.Config.Types
21960
21961
21962
21963 for {
21964 t := v.Type
21965 x := v_0
21966 y := v_1
21967 if !(shiftIsBounded(v)) {
21968 break
21969 }
21970 v.reset(OpARM64SRL)
21971 v.Type = t
21972 v.AddArg2(x, y)
21973 return true
21974 }
21975
21976
21977
21978 for {
21979 t := v.Type
21980 x := v_0
21981 y := v_1
21982 if !(!shiftIsBounded(v)) {
21983 break
21984 }
21985 v.reset(OpARM64CSEL)
21986 v.AuxInt = opToAuxInt(OpARM64LessThanU)
21987 v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
21988 v0.AddArg2(x, y)
21989 v1 := b.NewValue0(v.Pos, OpConst64, t)
21990 v1.AuxInt = int64ToAuxInt(0)
21991 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
21992 v2.AuxInt = int64ToAuxInt(64)
21993 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
21994 v3.AddArg(y)
21995 v2.AddArg(v3)
21996 v.AddArg3(v0, v1, v2)
21997 return true
21998 }
21999 return false
22000 }
22001 func rewriteValueARM64_OpRsh64Ux64(v *Value) bool {
22002 v_1 := v.Args[1]
22003 v_0 := v.Args[0]
22004 b := v.Block
22005
22006
22007
22008 for {
22009 t := v.Type
22010 x := v_0
22011 y := v_1
22012 if !(shiftIsBounded(v)) {
22013 break
22014 }
22015 v.reset(OpARM64SRL)
22016 v.Type = t
22017 v.AddArg2(x, y)
22018 return true
22019 }
22020
22021
22022
22023 for {
22024 t := v.Type
22025 x := v_0
22026 y := v_1
22027 if !(!shiftIsBounded(v)) {
22028 break
22029 }
22030 v.reset(OpARM64CSEL)
22031 v.AuxInt = opToAuxInt(OpARM64LessThanU)
22032 v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
22033 v0.AddArg2(x, y)
22034 v1 := b.NewValue0(v.Pos, OpConst64, t)
22035 v1.AuxInt = int64ToAuxInt(0)
22036 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
22037 v2.AuxInt = int64ToAuxInt(64)
22038 v2.AddArg(y)
22039 v.AddArg3(v0, v1, v2)
22040 return true
22041 }
22042 return false
22043 }
22044 func rewriteValueARM64_OpRsh64Ux8(v *Value) bool {
22045 v_1 := v.Args[1]
22046 v_0 := v.Args[0]
22047 b := v.Block
22048 typ := &b.Func.Config.Types
22049
22050
22051
22052 for {
22053 t := v.Type
22054 x := v_0
22055 y := v_1
22056 if !(shiftIsBounded(v)) {
22057 break
22058 }
22059 v.reset(OpARM64SRL)
22060 v.Type = t
22061 v.AddArg2(x, y)
22062 return true
22063 }
22064
22065
22066
22067 for {
22068 t := v.Type
22069 x := v_0
22070 y := v_1
22071 if !(!shiftIsBounded(v)) {
22072 break
22073 }
22074 v.reset(OpARM64CSEL)
22075 v.AuxInt = opToAuxInt(OpARM64LessThanU)
22076 v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
22077 v0.AddArg2(x, y)
22078 v1 := b.NewValue0(v.Pos, OpConst64, t)
22079 v1.AuxInt = int64ToAuxInt(0)
22080 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
22081 v2.AuxInt = int64ToAuxInt(64)
22082 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
22083 v3.AddArg(y)
22084 v2.AddArg(v3)
22085 v.AddArg3(v0, v1, v2)
22086 return true
22087 }
22088 return false
22089 }
22090 func rewriteValueARM64_OpRsh64x16(v *Value) bool {
22091 v_1 := v.Args[1]
22092 v_0 := v.Args[0]
22093 b := v.Block
22094 typ := &b.Func.Config.Types
22095
22096
22097
22098 for {
22099 t := v.Type
22100 x := v_0
22101 y := v_1
22102 if !(shiftIsBounded(v)) {
22103 break
22104 }
22105 v.reset(OpARM64SRA)
22106 v.Type = t
22107 v.AddArg2(x, y)
22108 return true
22109 }
22110
22111
22112
22113 for {
22114 x := v_0
22115 y := v_1
22116 if !(!shiftIsBounded(v)) {
22117 break
22118 }
22119 v.reset(OpARM64SRA)
22120 v0 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
22121 v0.AuxInt = opToAuxInt(OpARM64LessThanU)
22122 v1 := b.NewValue0(v.Pos, OpConst64, y.Type)
22123 v1.AuxInt = int64ToAuxInt(63)
22124 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
22125 v2.AuxInt = int64ToAuxInt(64)
22126 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
22127 v3.AddArg(y)
22128 v2.AddArg(v3)
22129 v0.AddArg3(y, v1, v2)
22130 v.AddArg2(x, v0)
22131 return true
22132 }
22133 return false
22134 }
22135 func rewriteValueARM64_OpRsh64x32(v *Value) bool {
22136 v_1 := v.Args[1]
22137 v_0 := v.Args[0]
22138 b := v.Block
22139 typ := &b.Func.Config.Types
22140
22141
22142
22143 for {
22144 t := v.Type
22145 x := v_0
22146 y := v_1
22147 if !(shiftIsBounded(v)) {
22148 break
22149 }
22150 v.reset(OpARM64SRA)
22151 v.Type = t
22152 v.AddArg2(x, y)
22153 return true
22154 }
22155
22156
22157
22158 for {
22159 x := v_0
22160 y := v_1
22161 if !(!shiftIsBounded(v)) {
22162 break
22163 }
22164 v.reset(OpARM64SRA)
22165 v0 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
22166 v0.AuxInt = opToAuxInt(OpARM64LessThanU)
22167 v1 := b.NewValue0(v.Pos, OpConst64, y.Type)
22168 v1.AuxInt = int64ToAuxInt(63)
22169 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
22170 v2.AuxInt = int64ToAuxInt(64)
22171 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
22172 v3.AddArg(y)
22173 v2.AddArg(v3)
22174 v0.AddArg3(y, v1, v2)
22175 v.AddArg2(x, v0)
22176 return true
22177 }
22178 return false
22179 }
22180 func rewriteValueARM64_OpRsh64x64(v *Value) bool {
22181 v_1 := v.Args[1]
22182 v_0 := v.Args[0]
22183 b := v.Block
22184
22185
22186
22187 for {
22188 t := v.Type
22189 x := v_0
22190 y := v_1
22191 if !(shiftIsBounded(v)) {
22192 break
22193 }
22194 v.reset(OpARM64SRA)
22195 v.Type = t
22196 v.AddArg2(x, y)
22197 return true
22198 }
22199
22200
22201
22202 for {
22203 x := v_0
22204 y := v_1
22205 if !(!shiftIsBounded(v)) {
22206 break
22207 }
22208 v.reset(OpARM64SRA)
22209 v0 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
22210 v0.AuxInt = opToAuxInt(OpARM64LessThanU)
22211 v1 := b.NewValue0(v.Pos, OpConst64, y.Type)
22212 v1.AuxInt = int64ToAuxInt(63)
22213 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
22214 v2.AuxInt = int64ToAuxInt(64)
22215 v2.AddArg(y)
22216 v0.AddArg3(y, v1, v2)
22217 v.AddArg2(x, v0)
22218 return true
22219 }
22220 return false
22221 }
22222 func rewriteValueARM64_OpRsh64x8(v *Value) bool {
22223 v_1 := v.Args[1]
22224 v_0 := v.Args[0]
22225 b := v.Block
22226 typ := &b.Func.Config.Types
22227
22228
22229
22230 for {
22231 t := v.Type
22232 x := v_0
22233 y := v_1
22234 if !(shiftIsBounded(v)) {
22235 break
22236 }
22237 v.reset(OpARM64SRA)
22238 v.Type = t
22239 v.AddArg2(x, y)
22240 return true
22241 }
22242
22243
22244
22245 for {
22246 x := v_0
22247 y := v_1
22248 if !(!shiftIsBounded(v)) {
22249 break
22250 }
22251 v.reset(OpARM64SRA)
22252 v0 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
22253 v0.AuxInt = opToAuxInt(OpARM64LessThanU)
22254 v1 := b.NewValue0(v.Pos, OpConst64, y.Type)
22255 v1.AuxInt = int64ToAuxInt(63)
22256 v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
22257 v2.AuxInt = int64ToAuxInt(64)
22258 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
22259 v3.AddArg(y)
22260 v2.AddArg(v3)
22261 v0.AddArg3(y, v1, v2)
22262 v.AddArg2(x, v0)
22263 return true
22264 }
22265 return false
22266 }
22267 func rewriteValueARM64_OpRsh8Ux16(v *Value) bool {
22268 v_1 := v.Args[1]
22269 v_0 := v.Args[0]
22270 b := v.Block
22271 typ := &b.Func.Config.Types
22272
22273
22274
22275 for {
22276 t := v.Type
22277 x := v_0
22278 y := v_1
22279 if !(shiftIsBounded(v)) {
22280 break
22281 }
22282 v.reset(OpARM64SRL)
22283 v.Type = t
22284 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
22285 v0.AddArg(x)
22286 v.AddArg2(v0, y)
22287 return true
22288 }
22289
22290
22291
22292 for {
22293 t := v.Type
22294 x := v_0
22295 y := v_1
22296 if !(!shiftIsBounded(v)) {
22297 break
22298 }
22299 v.reset(OpARM64CSEL)
22300 v.AuxInt = opToAuxInt(OpARM64LessThanU)
22301 v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
22302 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
22303 v1.AddArg(x)
22304 v0.AddArg2(v1, y)
22305 v2 := b.NewValue0(v.Pos, OpConst64, t)
22306 v2.AuxInt = int64ToAuxInt(0)
22307 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
22308 v3.AuxInt = int64ToAuxInt(64)
22309 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
22310 v4.AddArg(y)
22311 v3.AddArg(v4)
22312 v.AddArg3(v0, v2, v3)
22313 return true
22314 }
22315 return false
22316 }
22317 func rewriteValueARM64_OpRsh8Ux32(v *Value) bool {
22318 v_1 := v.Args[1]
22319 v_0 := v.Args[0]
22320 b := v.Block
22321 typ := &b.Func.Config.Types
22322
22323
22324
22325 for {
22326 t := v.Type
22327 x := v_0
22328 y := v_1
22329 if !(shiftIsBounded(v)) {
22330 break
22331 }
22332 v.reset(OpARM64SRL)
22333 v.Type = t
22334 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
22335 v0.AddArg(x)
22336 v.AddArg2(v0, y)
22337 return true
22338 }
22339
22340
22341
22342 for {
22343 t := v.Type
22344 x := v_0
22345 y := v_1
22346 if !(!shiftIsBounded(v)) {
22347 break
22348 }
22349 v.reset(OpARM64CSEL)
22350 v.AuxInt = opToAuxInt(OpARM64LessThanU)
22351 v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
22352 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
22353 v1.AddArg(x)
22354 v0.AddArg2(v1, y)
22355 v2 := b.NewValue0(v.Pos, OpConst64, t)
22356 v2.AuxInt = int64ToAuxInt(0)
22357 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
22358 v3.AuxInt = int64ToAuxInt(64)
22359 v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
22360 v4.AddArg(y)
22361 v3.AddArg(v4)
22362 v.AddArg3(v0, v2, v3)
22363 return true
22364 }
22365 return false
22366 }
22367 func rewriteValueARM64_OpRsh8Ux64(v *Value) bool {
22368 v_1 := v.Args[1]
22369 v_0 := v.Args[0]
22370 b := v.Block
22371 typ := &b.Func.Config.Types
22372
22373
22374
22375 for {
22376 t := v.Type
22377 x := v_0
22378 y := v_1
22379 if !(shiftIsBounded(v)) {
22380 break
22381 }
22382 v.reset(OpARM64SRL)
22383 v.Type = t
22384 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
22385 v0.AddArg(x)
22386 v.AddArg2(v0, y)
22387 return true
22388 }
22389
22390
22391
22392 for {
22393 t := v.Type
22394 x := v_0
22395 y := v_1
22396 if !(!shiftIsBounded(v)) {
22397 break
22398 }
22399 v.reset(OpARM64CSEL)
22400 v.AuxInt = opToAuxInt(OpARM64LessThanU)
22401 v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
22402 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
22403 v1.AddArg(x)
22404 v0.AddArg2(v1, y)
22405 v2 := b.NewValue0(v.Pos, OpConst64, t)
22406 v2.AuxInt = int64ToAuxInt(0)
22407 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
22408 v3.AuxInt = int64ToAuxInt(64)
22409 v3.AddArg(y)
22410 v.AddArg3(v0, v2, v3)
22411 return true
22412 }
22413 return false
22414 }
22415 func rewriteValueARM64_OpRsh8Ux8(v *Value) bool {
22416 v_1 := v.Args[1]
22417 v_0 := v.Args[0]
22418 b := v.Block
22419 typ := &b.Func.Config.Types
22420
22421
22422
22423 for {
22424 t := v.Type
22425 x := v_0
22426 y := v_1
22427 if !(shiftIsBounded(v)) {
22428 break
22429 }
22430 v.reset(OpARM64SRL)
22431 v.Type = t
22432 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
22433 v0.AddArg(x)
22434 v.AddArg2(v0, y)
22435 return true
22436 }
22437
22438
22439
22440 for {
22441 t := v.Type
22442 x := v_0
22443 y := v_1
22444 if !(!shiftIsBounded(v)) {
22445 break
22446 }
22447 v.reset(OpARM64CSEL)
22448 v.AuxInt = opToAuxInt(OpARM64LessThanU)
22449 v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
22450 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
22451 v1.AddArg(x)
22452 v0.AddArg2(v1, y)
22453 v2 := b.NewValue0(v.Pos, OpConst64, t)
22454 v2.AuxInt = int64ToAuxInt(0)
22455 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
22456 v3.AuxInt = int64ToAuxInt(64)
22457 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
22458 v4.AddArg(y)
22459 v3.AddArg(v4)
22460 v.AddArg3(v0, v2, v3)
22461 return true
22462 }
22463 return false
22464 }
22465 func rewriteValueARM64_OpRsh8x16(v *Value) bool {
22466 v_1 := v.Args[1]
22467 v_0 := v.Args[0]
22468 b := v.Block
22469 typ := &b.Func.Config.Types
22470
22471
22472
22473 for {
22474 t := v.Type
22475 x := v_0
22476 y := v_1
22477 if !(shiftIsBounded(v)) {
22478 break
22479 }
22480 v.reset(OpARM64SRA)
22481 v.Type = t
22482 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
22483 v0.AddArg(x)
22484 v.AddArg2(v0, y)
22485 return true
22486 }
22487
22488
22489
22490 for {
22491 x := v_0
22492 y := v_1
22493 if !(!shiftIsBounded(v)) {
22494 break
22495 }
22496 v.reset(OpARM64SRA)
22497 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
22498 v0.AddArg(x)
22499 v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
22500 v1.AuxInt = opToAuxInt(OpARM64LessThanU)
22501 v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
22502 v2.AuxInt = int64ToAuxInt(63)
22503 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
22504 v3.AuxInt = int64ToAuxInt(64)
22505 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
22506 v4.AddArg(y)
22507 v3.AddArg(v4)
22508 v1.AddArg3(y, v2, v3)
22509 v.AddArg2(v0, v1)
22510 return true
22511 }
22512 return false
22513 }
22514 func rewriteValueARM64_OpRsh8x32(v *Value) bool {
22515 v_1 := v.Args[1]
22516 v_0 := v.Args[0]
22517 b := v.Block
22518 typ := &b.Func.Config.Types
22519
22520
22521
22522 for {
22523 t := v.Type
22524 x := v_0
22525 y := v_1
22526 if !(shiftIsBounded(v)) {
22527 break
22528 }
22529 v.reset(OpARM64SRA)
22530 v.Type = t
22531 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
22532 v0.AddArg(x)
22533 v.AddArg2(v0, y)
22534 return true
22535 }
22536
22537
22538
22539 for {
22540 x := v_0
22541 y := v_1
22542 if !(!shiftIsBounded(v)) {
22543 break
22544 }
22545 v.reset(OpARM64SRA)
22546 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
22547 v0.AddArg(x)
22548 v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
22549 v1.AuxInt = opToAuxInt(OpARM64LessThanU)
22550 v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
22551 v2.AuxInt = int64ToAuxInt(63)
22552 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
22553 v3.AuxInt = int64ToAuxInt(64)
22554 v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
22555 v4.AddArg(y)
22556 v3.AddArg(v4)
22557 v1.AddArg3(y, v2, v3)
22558 v.AddArg2(v0, v1)
22559 return true
22560 }
22561 return false
22562 }
22563 func rewriteValueARM64_OpRsh8x64(v *Value) bool {
22564 v_1 := v.Args[1]
22565 v_0 := v.Args[0]
22566 b := v.Block
22567 typ := &b.Func.Config.Types
22568
22569
22570
22571 for {
22572 t := v.Type
22573 x := v_0
22574 y := v_1
22575 if !(shiftIsBounded(v)) {
22576 break
22577 }
22578 v.reset(OpARM64SRA)
22579 v.Type = t
22580 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
22581 v0.AddArg(x)
22582 v.AddArg2(v0, y)
22583 return true
22584 }
22585
22586
22587
22588 for {
22589 x := v_0
22590 y := v_1
22591 if !(!shiftIsBounded(v)) {
22592 break
22593 }
22594 v.reset(OpARM64SRA)
22595 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
22596 v0.AddArg(x)
22597 v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
22598 v1.AuxInt = opToAuxInt(OpARM64LessThanU)
22599 v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
22600 v2.AuxInt = int64ToAuxInt(63)
22601 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
22602 v3.AuxInt = int64ToAuxInt(64)
22603 v3.AddArg(y)
22604 v1.AddArg3(y, v2, v3)
22605 v.AddArg2(v0, v1)
22606 return true
22607 }
22608 return false
22609 }
22610 func rewriteValueARM64_OpRsh8x8(v *Value) bool {
22611 v_1 := v.Args[1]
22612 v_0 := v.Args[0]
22613 b := v.Block
22614 typ := &b.Func.Config.Types
22615
22616
22617
22618 for {
22619 t := v.Type
22620 x := v_0
22621 y := v_1
22622 if !(shiftIsBounded(v)) {
22623 break
22624 }
22625 v.reset(OpARM64SRA)
22626 v.Type = t
22627 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
22628 v0.AddArg(x)
22629 v.AddArg2(v0, y)
22630 return true
22631 }
22632
22633
22634
22635 for {
22636 x := v_0
22637 y := v_1
22638 if !(!shiftIsBounded(v)) {
22639 break
22640 }
22641 v.reset(OpARM64SRA)
22642 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
22643 v0.AddArg(x)
22644 v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
22645 v1.AuxInt = opToAuxInt(OpARM64LessThanU)
22646 v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
22647 v2.AuxInt = int64ToAuxInt(63)
22648 v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
22649 v3.AuxInt = int64ToAuxInt(64)
22650 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
22651 v4.AddArg(y)
22652 v3.AddArg(v4)
22653 v1.AddArg3(y, v2, v3)
22654 v.AddArg2(v0, v1)
22655 return true
22656 }
22657 return false
22658 }
22659 func rewriteValueARM64_OpSelect0(v *Value) bool {
22660 v_0 := v.Args[0]
22661 b := v.Block
22662 typ := &b.Func.Config.Types
22663
22664
22665 for {
22666 if v_0.Op != OpMul64uhilo {
22667 break
22668 }
22669 y := v_0.Args[1]
22670 x := v_0.Args[0]
22671 v.reset(OpARM64UMULH)
22672 v.AddArg2(x, y)
22673 return true
22674 }
22675
22676
22677 for {
22678 if v_0.Op != OpAdd64carry {
22679 break
22680 }
22681 c := v_0.Args[2]
22682 x := v_0.Args[0]
22683 y := v_0.Args[1]
22684 v.reset(OpSelect0)
22685 v.Type = typ.UInt64
22686 v0 := b.NewValue0(v.Pos, OpARM64ADCSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
22687 v1 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
22688 v2 := b.NewValue0(v.Pos, OpARM64ADDSconstflags, types.NewTuple(typ.UInt64, types.TypeFlags))
22689 v2.AuxInt = int64ToAuxInt(-1)
22690 v2.AddArg(c)
22691 v1.AddArg(v2)
22692 v0.AddArg3(x, y, v1)
22693 v.AddArg(v0)
22694 return true
22695 }
22696
22697
22698 for {
22699 if v_0.Op != OpSub64borrow {
22700 break
22701 }
22702 bo := v_0.Args[2]
22703 x := v_0.Args[0]
22704 y := v_0.Args[1]
22705 v.reset(OpSelect0)
22706 v.Type = typ.UInt64
22707 v0 := b.NewValue0(v.Pos, OpARM64SBCSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
22708 v1 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
22709 v2 := b.NewValue0(v.Pos, OpARM64NEGSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
22710 v2.AddArg(bo)
22711 v1.AddArg(v2)
22712 v0.AddArg3(x, y, v1)
22713 v.AddArg(v0)
22714 return true
22715 }
22716
22717
22718 for {
22719 if v_0.Op != OpMul64uover {
22720 break
22721 }
22722 y := v_0.Args[1]
22723 x := v_0.Args[0]
22724 v.reset(OpARM64MUL)
22725 v.AddArg2(x, y)
22726 return true
22727 }
22728 return false
22729 }
22730 func rewriteValueARM64_OpSelect1(v *Value) bool {
22731 v_0 := v.Args[0]
22732 b := v.Block
22733 typ := &b.Func.Config.Types
22734
22735
22736 for {
22737 if v_0.Op != OpMul64uhilo {
22738 break
22739 }
22740 y := v_0.Args[1]
22741 x := v_0.Args[0]
22742 v.reset(OpARM64MUL)
22743 v.AddArg2(x, y)
22744 return true
22745 }
22746
22747
22748 for {
22749 if v_0.Op != OpAdd64carry {
22750 break
22751 }
22752 c := v_0.Args[2]
22753 x := v_0.Args[0]
22754 y := v_0.Args[1]
22755 v.reset(OpARM64ADCzerocarry)
22756 v.Type = typ.UInt64
22757 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
22758 v1 := b.NewValue0(v.Pos, OpARM64ADCSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
22759 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
22760 v3 := b.NewValue0(v.Pos, OpARM64ADDSconstflags, types.NewTuple(typ.UInt64, types.TypeFlags))
22761 v3.AuxInt = int64ToAuxInt(-1)
22762 v3.AddArg(c)
22763 v2.AddArg(v3)
22764 v1.AddArg3(x, y, v2)
22765 v0.AddArg(v1)
22766 v.AddArg(v0)
22767 return true
22768 }
22769
22770
22771 for {
22772 if v_0.Op != OpSub64borrow {
22773 break
22774 }
22775 bo := v_0.Args[2]
22776 x := v_0.Args[0]
22777 y := v_0.Args[1]
22778 v.reset(OpARM64NEG)
22779 v.Type = typ.UInt64
22780 v0 := b.NewValue0(v.Pos, OpARM64NGCzerocarry, typ.UInt64)
22781 v1 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
22782 v2 := b.NewValue0(v.Pos, OpARM64SBCSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
22783 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
22784 v4 := b.NewValue0(v.Pos, OpARM64NEGSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
22785 v4.AddArg(bo)
22786 v3.AddArg(v4)
22787 v2.AddArg3(x, y, v3)
22788 v1.AddArg(v2)
22789 v0.AddArg(v1)
22790 v.AddArg(v0)
22791 return true
22792 }
22793
22794
22795 for {
22796 if v_0.Op != OpMul64uover {
22797 break
22798 }
22799 y := v_0.Args[1]
22800 x := v_0.Args[0]
22801 v.reset(OpARM64NotEqual)
22802 v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
22803 v0.AuxInt = int64ToAuxInt(0)
22804 v1 := b.NewValue0(v.Pos, OpARM64UMULH, typ.UInt64)
22805 v1.AddArg2(x, y)
22806 v0.AddArg(v1)
22807 v.AddArg(v0)
22808 return true
22809 }
22810 return false
22811 }
22812 func rewriteValueARM64_OpSelectN(v *Value) bool {
22813 v_0 := v.Args[0]
22814 b := v.Block
22815 config := b.Func.Config
22816
22817
22818
22819 for {
22820 if auxIntToInt64(v.AuxInt) != 0 {
22821 break
22822 }
22823 call := v_0
22824 if call.Op != OpARM64CALLstatic || len(call.Args) != 1 {
22825 break
22826 }
22827 sym := auxToCall(call.Aux)
22828 s1 := call.Args[0]
22829 if s1.Op != OpARM64MOVDstore {
22830 break
22831 }
22832 _ = s1.Args[2]
22833 s1_1 := s1.Args[1]
22834 if s1_1.Op != OpARM64MOVDconst {
22835 break
22836 }
22837 sz := auxIntToInt64(s1_1.AuxInt)
22838 s2 := s1.Args[2]
22839 if s2.Op != OpARM64MOVDstore {
22840 break
22841 }
22842 _ = s2.Args[2]
22843 src := s2.Args[1]
22844 s3 := s2.Args[2]
22845 if s3.Op != OpARM64MOVDstore {
22846 break
22847 }
22848 mem := s3.Args[2]
22849 dst := s3.Args[1]
22850 if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(s1, s2, s3, call)) {
22851 break
22852 }
22853 v.reset(OpMove)
22854 v.AuxInt = int64ToAuxInt(sz)
22855 v.AddArg3(dst, src, mem)
22856 return true
22857 }
22858
22859
22860
22861 for {
22862 if auxIntToInt64(v.AuxInt) != 0 {
22863 break
22864 }
22865 call := v_0
22866 if call.Op != OpARM64CALLstatic || len(call.Args) != 4 {
22867 break
22868 }
22869 sym := auxToCall(call.Aux)
22870 mem := call.Args[3]
22871 dst := call.Args[0]
22872 src := call.Args[1]
22873 call_2 := call.Args[2]
22874 if call_2.Op != OpARM64MOVDconst {
22875 break
22876 }
22877 sz := auxIntToInt64(call_2.AuxInt)
22878 if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)) {
22879 break
22880 }
22881 v.reset(OpMove)
22882 v.AuxInt = int64ToAuxInt(sz)
22883 v.AddArg3(dst, src, mem)
22884 return true
22885 }
22886 return false
22887 }
22888 func rewriteValueARM64_OpSlicemask(v *Value) bool {
22889 v_0 := v.Args[0]
22890 b := v.Block
22891
22892
22893 for {
22894 t := v.Type
22895 x := v_0
22896 v.reset(OpARM64SRAconst)
22897 v.AuxInt = int64ToAuxInt(63)
22898 v0 := b.NewValue0(v.Pos, OpARM64NEG, t)
22899 v0.AddArg(x)
22900 v.AddArg(v0)
22901 return true
22902 }
22903 }
22904 func rewriteValueARM64_OpStore(v *Value) bool {
22905 v_2 := v.Args[2]
22906 v_1 := v.Args[1]
22907 v_0 := v.Args[0]
22908
22909
22910
22911 for {
22912 t := auxToType(v.Aux)
22913 ptr := v_0
22914 val := v_1
22915 mem := v_2
22916 if !(t.Size() == 1) {
22917 break
22918 }
22919 v.reset(OpARM64MOVBstore)
22920 v.AddArg3(ptr, val, mem)
22921 return true
22922 }
22923
22924
22925
22926 for {
22927 t := auxToType(v.Aux)
22928 ptr := v_0
22929 val := v_1
22930 mem := v_2
22931 if !(t.Size() == 2) {
22932 break
22933 }
22934 v.reset(OpARM64MOVHstore)
22935 v.AddArg3(ptr, val, mem)
22936 return true
22937 }
22938
22939
22940
22941 for {
22942 t := auxToType(v.Aux)
22943 ptr := v_0
22944 val := v_1
22945 mem := v_2
22946 if !(t.Size() == 4 && !t.IsFloat()) {
22947 break
22948 }
22949 v.reset(OpARM64MOVWstore)
22950 v.AddArg3(ptr, val, mem)
22951 return true
22952 }
22953
22954
22955
22956 for {
22957 t := auxToType(v.Aux)
22958 ptr := v_0
22959 val := v_1
22960 mem := v_2
22961 if !(t.Size() == 8 && !t.IsFloat()) {
22962 break
22963 }
22964 v.reset(OpARM64MOVDstore)
22965 v.AddArg3(ptr, val, mem)
22966 return true
22967 }
22968
22969
22970
22971 for {
22972 t := auxToType(v.Aux)
22973 ptr := v_0
22974 val := v_1
22975 mem := v_2
22976 if !(t.Size() == 4 && t.IsFloat()) {
22977 break
22978 }
22979 v.reset(OpARM64FMOVSstore)
22980 v.AddArg3(ptr, val, mem)
22981 return true
22982 }
22983
22984
22985
22986 for {
22987 t := auxToType(v.Aux)
22988 ptr := v_0
22989 val := v_1
22990 mem := v_2
22991 if !(t.Size() == 8 && t.IsFloat()) {
22992 break
22993 }
22994 v.reset(OpARM64FMOVDstore)
22995 v.AddArg3(ptr, val, mem)
22996 return true
22997 }
22998 return false
22999 }
23000 func rewriteValueARM64_OpZero(v *Value) bool {
23001 v_1 := v.Args[1]
23002 v_0 := v.Args[0]
23003 b := v.Block
23004 config := b.Func.Config
23005 typ := &b.Func.Config.Types
23006
23007
23008 for {
23009 if auxIntToInt64(v.AuxInt) != 0 {
23010 break
23011 }
23012 mem := v_1
23013 v.copyOf(mem)
23014 return true
23015 }
23016
23017
23018 for {
23019 if auxIntToInt64(v.AuxInt) != 1 {
23020 break
23021 }
23022 ptr := v_0
23023 mem := v_1
23024 v.reset(OpARM64MOVBstore)
23025 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
23026 v0.AuxInt = int64ToAuxInt(0)
23027 v.AddArg3(ptr, v0, mem)
23028 return true
23029 }
23030
23031
23032 for {
23033 if auxIntToInt64(v.AuxInt) != 2 {
23034 break
23035 }
23036 ptr := v_0
23037 mem := v_1
23038 v.reset(OpARM64MOVHstore)
23039 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
23040 v0.AuxInt = int64ToAuxInt(0)
23041 v.AddArg3(ptr, v0, mem)
23042 return true
23043 }
23044
23045
23046 for {
23047 if auxIntToInt64(v.AuxInt) != 4 {
23048 break
23049 }
23050 ptr := v_0
23051 mem := v_1
23052 v.reset(OpARM64MOVWstore)
23053 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
23054 v0.AuxInt = int64ToAuxInt(0)
23055 v.AddArg3(ptr, v0, mem)
23056 return true
23057 }
23058
23059
23060 for {
23061 if auxIntToInt64(v.AuxInt) != 3 {
23062 break
23063 }
23064 ptr := v_0
23065 mem := v_1
23066 v.reset(OpARM64MOVBstore)
23067 v.AuxInt = int32ToAuxInt(2)
23068 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
23069 v0.AuxInt = int64ToAuxInt(0)
23070 v1 := b.NewValue0(v.Pos, OpARM64MOVHstore, types.TypeMem)
23071 v1.AddArg3(ptr, v0, mem)
23072 v.AddArg3(ptr, v0, v1)
23073 return true
23074 }
23075
23076
23077 for {
23078 if auxIntToInt64(v.AuxInt) != 5 {
23079 break
23080 }
23081 ptr := v_0
23082 mem := v_1
23083 v.reset(OpARM64MOVBstore)
23084 v.AuxInt = int32ToAuxInt(4)
23085 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
23086 v0.AuxInt = int64ToAuxInt(0)
23087 v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
23088 v1.AddArg3(ptr, v0, mem)
23089 v.AddArg3(ptr, v0, v1)
23090 return true
23091 }
23092
23093
23094 for {
23095 if auxIntToInt64(v.AuxInt) != 6 {
23096 break
23097 }
23098 ptr := v_0
23099 mem := v_1
23100 v.reset(OpARM64MOVHstore)
23101 v.AuxInt = int32ToAuxInt(4)
23102 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
23103 v0.AuxInt = int64ToAuxInt(0)
23104 v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
23105 v1.AddArg3(ptr, v0, mem)
23106 v.AddArg3(ptr, v0, v1)
23107 return true
23108 }
23109
23110
23111 for {
23112 if auxIntToInt64(v.AuxInt) != 7 {
23113 break
23114 }
23115 ptr := v_0
23116 mem := v_1
23117 v.reset(OpARM64MOVWstore)
23118 v.AuxInt = int32ToAuxInt(3)
23119 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
23120 v0.AuxInt = int64ToAuxInt(0)
23121 v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
23122 v1.AddArg3(ptr, v0, mem)
23123 v.AddArg3(ptr, v0, v1)
23124 return true
23125 }
23126
23127
23128 for {
23129 if auxIntToInt64(v.AuxInt) != 8 {
23130 break
23131 }
23132 ptr := v_0
23133 mem := v_1
23134 v.reset(OpARM64MOVDstore)
23135 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
23136 v0.AuxInt = int64ToAuxInt(0)
23137 v.AddArg3(ptr, v0, mem)
23138 return true
23139 }
23140
23141
23142 for {
23143 if auxIntToInt64(v.AuxInt) != 9 {
23144 break
23145 }
23146 ptr := v_0
23147 mem := v_1
23148 v.reset(OpARM64MOVBstore)
23149 v.AuxInt = int32ToAuxInt(8)
23150 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
23151 v0.AuxInt = int64ToAuxInt(0)
23152 v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
23153 v1.AddArg3(ptr, v0, mem)
23154 v.AddArg3(ptr, v0, v1)
23155 return true
23156 }
23157
23158
23159 for {
23160 if auxIntToInt64(v.AuxInt) != 10 {
23161 break
23162 }
23163 ptr := v_0
23164 mem := v_1
23165 v.reset(OpARM64MOVHstore)
23166 v.AuxInt = int32ToAuxInt(8)
23167 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
23168 v0.AuxInt = int64ToAuxInt(0)
23169 v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
23170 v1.AddArg3(ptr, v0, mem)
23171 v.AddArg3(ptr, v0, v1)
23172 return true
23173 }
23174
23175
23176 for {
23177 if auxIntToInt64(v.AuxInt) != 11 {
23178 break
23179 }
23180 ptr := v_0
23181 mem := v_1
23182 v.reset(OpARM64MOVDstore)
23183 v.AuxInt = int32ToAuxInt(3)
23184 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
23185 v0.AuxInt = int64ToAuxInt(0)
23186 v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
23187 v1.AddArg3(ptr, v0, mem)
23188 v.AddArg3(ptr, v0, v1)
23189 return true
23190 }
23191
23192
23193 for {
23194 if auxIntToInt64(v.AuxInt) != 12 {
23195 break
23196 }
23197 ptr := v_0
23198 mem := v_1
23199 v.reset(OpARM64MOVWstore)
23200 v.AuxInt = int32ToAuxInt(8)
23201 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
23202 v0.AuxInt = int64ToAuxInt(0)
23203 v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
23204 v1.AddArg3(ptr, v0, mem)
23205 v.AddArg3(ptr, v0, v1)
23206 return true
23207 }
23208
23209
23210 for {
23211 if auxIntToInt64(v.AuxInt) != 13 {
23212 break
23213 }
23214 ptr := v_0
23215 mem := v_1
23216 v.reset(OpARM64MOVDstore)
23217 v.AuxInt = int32ToAuxInt(5)
23218 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
23219 v0.AuxInt = int64ToAuxInt(0)
23220 v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
23221 v1.AddArg3(ptr, v0, mem)
23222 v.AddArg3(ptr, v0, v1)
23223 return true
23224 }
23225
23226
23227 for {
23228 if auxIntToInt64(v.AuxInt) != 14 {
23229 break
23230 }
23231 ptr := v_0
23232 mem := v_1
23233 v.reset(OpARM64MOVDstore)
23234 v.AuxInt = int32ToAuxInt(6)
23235 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
23236 v0.AuxInt = int64ToAuxInt(0)
23237 v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
23238 v1.AddArg3(ptr, v0, mem)
23239 v.AddArg3(ptr, v0, v1)
23240 return true
23241 }
23242
23243
23244 for {
23245 if auxIntToInt64(v.AuxInt) != 15 {
23246 break
23247 }
23248 ptr := v_0
23249 mem := v_1
23250 v.reset(OpARM64MOVDstore)
23251 v.AuxInt = int32ToAuxInt(7)
23252 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
23253 v0.AuxInt = int64ToAuxInt(0)
23254 v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
23255 v1.AddArg3(ptr, v0, mem)
23256 v.AddArg3(ptr, v0, v1)
23257 return true
23258 }
23259
23260
23261 for {
23262 if auxIntToInt64(v.AuxInt) != 16 {
23263 break
23264 }
23265 ptr := v_0
23266 mem := v_1
23267 v.reset(OpARM64STP)
23268 v.AuxInt = int32ToAuxInt(0)
23269 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
23270 v0.AuxInt = int64ToAuxInt(0)
23271 v.AddArg4(ptr, v0, v0, mem)
23272 return true
23273 }
23274
23275
23276 for {
23277 if auxIntToInt64(v.AuxInt) != 32 {
23278 break
23279 }
23280 ptr := v_0
23281 mem := v_1
23282 v.reset(OpARM64STP)
23283 v.AuxInt = int32ToAuxInt(16)
23284 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
23285 v0.AuxInt = int64ToAuxInt(0)
23286 v1 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
23287 v1.AuxInt = int32ToAuxInt(0)
23288 v1.AddArg4(ptr, v0, v0, mem)
23289 v.AddArg4(ptr, v0, v0, v1)
23290 return true
23291 }
23292
23293
23294 for {
23295 if auxIntToInt64(v.AuxInt) != 48 {
23296 break
23297 }
23298 ptr := v_0
23299 mem := v_1
23300 v.reset(OpARM64STP)
23301 v.AuxInt = int32ToAuxInt(32)
23302 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
23303 v0.AuxInt = int64ToAuxInt(0)
23304 v1 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
23305 v1.AuxInt = int32ToAuxInt(16)
23306 v2 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
23307 v2.AuxInt = int32ToAuxInt(0)
23308 v2.AddArg4(ptr, v0, v0, mem)
23309 v1.AddArg4(ptr, v0, v0, v2)
23310 v.AddArg4(ptr, v0, v0, v1)
23311 return true
23312 }
23313
23314
23315 for {
23316 if auxIntToInt64(v.AuxInt) != 64 {
23317 break
23318 }
23319 ptr := v_0
23320 mem := v_1
23321 v.reset(OpARM64STP)
23322 v.AuxInt = int32ToAuxInt(48)
23323 v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
23324 v0.AuxInt = int64ToAuxInt(0)
23325 v1 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
23326 v1.AuxInt = int32ToAuxInt(32)
23327 v2 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
23328 v2.AuxInt = int32ToAuxInt(16)
23329 v3 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
23330 v3.AuxInt = int32ToAuxInt(0)
23331 v3.AddArg4(ptr, v0, v0, mem)
23332 v2.AddArg4(ptr, v0, v0, v3)
23333 v1.AddArg4(ptr, v0, v0, v2)
23334 v.AddArg4(ptr, v0, v0, v1)
23335 return true
23336 }
23337
23338
23339
23340 for {
23341 s := auxIntToInt64(v.AuxInt)
23342 ptr := v_0
23343 mem := v_1
23344 if !(s%16 != 0 && s%16 <= 8 && s > 16) {
23345 break
23346 }
23347 v.reset(OpZero)
23348 v.AuxInt = int64ToAuxInt(8)
23349 v0 := b.NewValue0(v.Pos, OpOffPtr, ptr.Type)
23350 v0.AuxInt = int64ToAuxInt(s - 8)
23351 v0.AddArg(ptr)
23352 v1 := b.NewValue0(v.Pos, OpZero, types.TypeMem)
23353 v1.AuxInt = int64ToAuxInt(s - s%16)
23354 v1.AddArg2(ptr, mem)
23355 v.AddArg2(v0, v1)
23356 return true
23357 }
23358
23359
23360
23361 for {
23362 s := auxIntToInt64(v.AuxInt)
23363 ptr := v_0
23364 mem := v_1
23365 if !(s%16 != 0 && s%16 > 8 && s > 16) {
23366 break
23367 }
23368 v.reset(OpZero)
23369 v.AuxInt = int64ToAuxInt(16)
23370 v0 := b.NewValue0(v.Pos, OpOffPtr, ptr.Type)
23371 v0.AuxInt = int64ToAuxInt(s - 16)
23372 v0.AddArg(ptr)
23373 v1 := b.NewValue0(v.Pos, OpZero, types.TypeMem)
23374 v1.AuxInt = int64ToAuxInt(s - s%16)
23375 v1.AddArg2(ptr, mem)
23376 v.AddArg2(v0, v1)
23377 return true
23378 }
23379
23380
23381
23382 for {
23383 s := auxIntToInt64(v.AuxInt)
23384 ptr := v_0
23385 mem := v_1
23386 if !(s%16 == 0 && s > 64 && s <= 16*64 && !config.noDuffDevice) {
23387 break
23388 }
23389 v.reset(OpARM64DUFFZERO)
23390 v.AuxInt = int64ToAuxInt(4 * (64 - s/16))
23391 v.AddArg2(ptr, mem)
23392 return true
23393 }
23394
23395
23396
23397 for {
23398 s := auxIntToInt64(v.AuxInt)
23399 ptr := v_0
23400 mem := v_1
23401 if !(s%16 == 0 && (s > 16*64 || config.noDuffDevice)) {
23402 break
23403 }
23404 v.reset(OpARM64LoweredZero)
23405 v0 := b.NewValue0(v.Pos, OpARM64ADDconst, ptr.Type)
23406 v0.AuxInt = int64ToAuxInt(s - 16)
23407 v0.AddArg(ptr)
23408 v.AddArg3(ptr, v0, mem)
23409 return true
23410 }
23411 return false
23412 }
23413 func rewriteBlockARM64(b *Block) bool {
23414 typ := &b.Func.Config.Types
23415 switch b.Kind {
23416 case BlockARM64EQ:
23417
23418
23419
23420 for b.Controls[0].Op == OpARM64CMPconst {
23421 v_0 := b.Controls[0]
23422 if auxIntToInt64(v_0.AuxInt) != 0 {
23423 break
23424 }
23425 z := v_0.Args[0]
23426 if z.Op != OpARM64AND {
23427 break
23428 }
23429 _ = z.Args[1]
23430 z_0 := z.Args[0]
23431 z_1 := z.Args[1]
23432 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
23433 x := z_0
23434 y := z_1
23435 if !(z.Uses == 1) {
23436 continue
23437 }
23438 v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
23439 v0.AddArg2(x, y)
23440 b.resetWithControl(BlockARM64EQ, v0)
23441 return true
23442 }
23443 break
23444 }
23445
23446
23447
23448 for b.Controls[0].Op == OpARM64CMPconst {
23449 v_0 := b.Controls[0]
23450 if auxIntToInt64(v_0.AuxInt) != 0 {
23451 break
23452 }
23453 x := v_0.Args[0]
23454 if x.Op != OpARM64ANDconst {
23455 break
23456 }
23457 c := auxIntToInt64(x.AuxInt)
23458 y := x.Args[0]
23459 if !(x.Uses == 1) {
23460 break
23461 }
23462 v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
23463 v0.AuxInt = int64ToAuxInt(c)
23464 v0.AddArg(y)
23465 b.resetWithControl(BlockARM64EQ, v0)
23466 return true
23467 }
23468
23469
23470
23471 for b.Controls[0].Op == OpARM64CMPWconst {
23472 v_0 := b.Controls[0]
23473 if auxIntToInt32(v_0.AuxInt) != 0 {
23474 break
23475 }
23476 z := v_0.Args[0]
23477 if z.Op != OpARM64AND {
23478 break
23479 }
23480 _ = z.Args[1]
23481 z_0 := z.Args[0]
23482 z_1 := z.Args[1]
23483 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
23484 x := z_0
23485 y := z_1
23486 if !(z.Uses == 1) {
23487 continue
23488 }
23489 v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
23490 v0.AddArg2(x, y)
23491 b.resetWithControl(BlockARM64EQ, v0)
23492 return true
23493 }
23494 break
23495 }
23496
23497
23498
23499 for b.Controls[0].Op == OpARM64CMPWconst {
23500 v_0 := b.Controls[0]
23501 if auxIntToInt32(v_0.AuxInt) != 0 {
23502 break
23503 }
23504 x := v_0.Args[0]
23505 if x.Op != OpARM64ANDconst {
23506 break
23507 }
23508 c := auxIntToInt64(x.AuxInt)
23509 y := x.Args[0]
23510 if !(x.Uses == 1) {
23511 break
23512 }
23513 v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
23514 v0.AuxInt = int32ToAuxInt(int32(c))
23515 v0.AddArg(y)
23516 b.resetWithControl(BlockARM64EQ, v0)
23517 return true
23518 }
23519
23520
23521
23522 for b.Controls[0].Op == OpARM64CMPconst {
23523 v_0 := b.Controls[0]
23524 if auxIntToInt64(v_0.AuxInt) != 0 {
23525 break
23526 }
23527 x := v_0.Args[0]
23528 if x.Op != OpARM64ADDconst {
23529 break
23530 }
23531 c := auxIntToInt64(x.AuxInt)
23532 y := x.Args[0]
23533 if !(x.Uses == 1) {
23534 break
23535 }
23536 v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
23537 v0.AuxInt = int64ToAuxInt(c)
23538 v0.AddArg(y)
23539 b.resetWithControl(BlockARM64EQ, v0)
23540 return true
23541 }
23542
23543
23544
23545 for b.Controls[0].Op == OpARM64CMPWconst {
23546 v_0 := b.Controls[0]
23547 if auxIntToInt32(v_0.AuxInt) != 0 {
23548 break
23549 }
23550 x := v_0.Args[0]
23551 if x.Op != OpARM64ADDconst {
23552 break
23553 }
23554 c := auxIntToInt64(x.AuxInt)
23555 y := x.Args[0]
23556 if !(x.Uses == 1) {
23557 break
23558 }
23559 v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
23560 v0.AuxInt = int32ToAuxInt(int32(c))
23561 v0.AddArg(y)
23562 b.resetWithControl(BlockARM64EQ, v0)
23563 return true
23564 }
23565
23566
23567
23568 for b.Controls[0].Op == OpARM64CMPconst {
23569 v_0 := b.Controls[0]
23570 if auxIntToInt64(v_0.AuxInt) != 0 {
23571 break
23572 }
23573 z := v_0.Args[0]
23574 if z.Op != OpARM64ADD {
23575 break
23576 }
23577 _ = z.Args[1]
23578 z_0 := z.Args[0]
23579 z_1 := z.Args[1]
23580 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
23581 x := z_0
23582 y := z_1
23583 if !(z.Uses == 1) {
23584 continue
23585 }
23586 v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
23587 v0.AddArg2(x, y)
23588 b.resetWithControl(BlockARM64EQ, v0)
23589 return true
23590 }
23591 break
23592 }
23593
23594
23595
23596 for b.Controls[0].Op == OpARM64CMPWconst {
23597 v_0 := b.Controls[0]
23598 if auxIntToInt32(v_0.AuxInt) != 0 {
23599 break
23600 }
23601 z := v_0.Args[0]
23602 if z.Op != OpARM64ADD {
23603 break
23604 }
23605 _ = z.Args[1]
23606 z_0 := z.Args[0]
23607 z_1 := z.Args[1]
23608 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
23609 x := z_0
23610 y := z_1
23611 if !(z.Uses == 1) {
23612 continue
23613 }
23614 v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
23615 v0.AddArg2(x, y)
23616 b.resetWithControl(BlockARM64EQ, v0)
23617 return true
23618 }
23619 break
23620 }
23621
23622
23623
23624 for b.Controls[0].Op == OpARM64CMP {
23625 v_0 := b.Controls[0]
23626 _ = v_0.Args[1]
23627 x := v_0.Args[0]
23628 z := v_0.Args[1]
23629 if z.Op != OpARM64NEG {
23630 break
23631 }
23632 y := z.Args[0]
23633 if !(z.Uses == 1) {
23634 break
23635 }
23636 v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
23637 v0.AddArg2(x, y)
23638 b.resetWithControl(BlockARM64EQ, v0)
23639 return true
23640 }
23641
23642
23643
23644 for b.Controls[0].Op == OpARM64CMPW {
23645 v_0 := b.Controls[0]
23646 _ = v_0.Args[1]
23647 x := v_0.Args[0]
23648 z := v_0.Args[1]
23649 if z.Op != OpARM64NEG {
23650 break
23651 }
23652 y := z.Args[0]
23653 if !(z.Uses == 1) {
23654 break
23655 }
23656 v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
23657 v0.AddArg2(x, y)
23658 b.resetWithControl(BlockARM64EQ, v0)
23659 return true
23660 }
23661
23662
23663 for b.Controls[0].Op == OpARM64CMPconst {
23664 v_0 := b.Controls[0]
23665 if auxIntToInt64(v_0.AuxInt) != 0 {
23666 break
23667 }
23668 x := v_0.Args[0]
23669 b.resetWithControl(BlockARM64Z, x)
23670 return true
23671 }
23672
23673
23674 for b.Controls[0].Op == OpARM64CMPWconst {
23675 v_0 := b.Controls[0]
23676 if auxIntToInt32(v_0.AuxInt) != 0 {
23677 break
23678 }
23679 x := v_0.Args[0]
23680 b.resetWithControl(BlockARM64ZW, x)
23681 return true
23682 }
23683
23684
23685
23686 for b.Controls[0].Op == OpARM64CMPconst {
23687 v_0 := b.Controls[0]
23688 if auxIntToInt64(v_0.AuxInt) != 0 {
23689 break
23690 }
23691 z := v_0.Args[0]
23692 if z.Op != OpARM64MADD {
23693 break
23694 }
23695 y := z.Args[2]
23696 a := z.Args[0]
23697 x := z.Args[1]
23698 if !(z.Uses == 1) {
23699 break
23700 }
23701 v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
23702 v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
23703 v1.AddArg2(x, y)
23704 v0.AddArg2(a, v1)
23705 b.resetWithControl(BlockARM64EQ, v0)
23706 return true
23707 }
23708
23709
23710
23711 for b.Controls[0].Op == OpARM64CMPconst {
23712 v_0 := b.Controls[0]
23713 if auxIntToInt64(v_0.AuxInt) != 0 {
23714 break
23715 }
23716 z := v_0.Args[0]
23717 if z.Op != OpARM64MSUB {
23718 break
23719 }
23720 y := z.Args[2]
23721 a := z.Args[0]
23722 x := z.Args[1]
23723 if !(z.Uses == 1) {
23724 break
23725 }
23726 v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
23727 v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
23728 v1.AddArg2(x, y)
23729 v0.AddArg2(a, v1)
23730 b.resetWithControl(BlockARM64EQ, v0)
23731 return true
23732 }
23733
23734
23735
23736 for b.Controls[0].Op == OpARM64CMPWconst {
23737 v_0 := b.Controls[0]
23738 if auxIntToInt32(v_0.AuxInt) != 0 {
23739 break
23740 }
23741 z := v_0.Args[0]
23742 if z.Op != OpARM64MADDW {
23743 break
23744 }
23745 y := z.Args[2]
23746 a := z.Args[0]
23747 x := z.Args[1]
23748 if !(z.Uses == 1) {
23749 break
23750 }
23751 v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
23752 v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
23753 v1.AddArg2(x, y)
23754 v0.AddArg2(a, v1)
23755 b.resetWithControl(BlockARM64EQ, v0)
23756 return true
23757 }
23758
23759
23760
23761 for b.Controls[0].Op == OpARM64CMPWconst {
23762 v_0 := b.Controls[0]
23763 if auxIntToInt32(v_0.AuxInt) != 0 {
23764 break
23765 }
23766 z := v_0.Args[0]
23767 if z.Op != OpARM64MSUBW {
23768 break
23769 }
23770 y := z.Args[2]
23771 a := z.Args[0]
23772 x := z.Args[1]
23773 if !(z.Uses == 1) {
23774 break
23775 }
23776 v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
23777 v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
23778 v1.AddArg2(x, y)
23779 v0.AddArg2(a, v1)
23780 b.resetWithControl(BlockARM64EQ, v0)
23781 return true
23782 }
23783
23784
23785
23786 for b.Controls[0].Op == OpARM64TSTconst {
23787 v_0 := b.Controls[0]
23788 c := auxIntToInt64(v_0.AuxInt)
23789 x := v_0.Args[0]
23790 if !(oneBit(c)) {
23791 break
23792 }
23793 b.resetWithControl(BlockARM64TBZ, x)
23794 b.AuxInt = int64ToAuxInt(int64(ntz64(c)))
23795 return true
23796 }
23797
23798
23799
23800 for b.Controls[0].Op == OpARM64TSTWconst {
23801 v_0 := b.Controls[0]
23802 c := auxIntToInt32(v_0.AuxInt)
23803 x := v_0.Args[0]
23804 if !(oneBit(int64(uint32(c)))) {
23805 break
23806 }
23807 b.resetWithControl(BlockARM64TBZ, x)
23808 b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c)))))
23809 return true
23810 }
23811
23812
23813
23814 for b.Controls[0].Op == OpARM64FlagConstant {
23815 v_0 := b.Controls[0]
23816 fc := auxIntToFlagConstant(v_0.AuxInt)
23817 if !(fc.eq()) {
23818 break
23819 }
23820 b.Reset(BlockFirst)
23821 return true
23822 }
23823
23824
23825
23826 for b.Controls[0].Op == OpARM64FlagConstant {
23827 v_0 := b.Controls[0]
23828 fc := auxIntToFlagConstant(v_0.AuxInt)
23829 if !(!fc.eq()) {
23830 break
23831 }
23832 b.Reset(BlockFirst)
23833 b.swapSuccessors()
23834 return true
23835 }
23836
23837
23838 for b.Controls[0].Op == OpARM64InvertFlags {
23839 v_0 := b.Controls[0]
23840 cmp := v_0.Args[0]
23841 b.resetWithControl(BlockARM64EQ, cmp)
23842 return true
23843 }
23844 case BlockARM64FGE:
23845
23846
23847 for b.Controls[0].Op == OpARM64InvertFlags {
23848 v_0 := b.Controls[0]
23849 cmp := v_0.Args[0]
23850 b.resetWithControl(BlockARM64FLE, cmp)
23851 return true
23852 }
23853 case BlockARM64FGT:
23854
23855
23856 for b.Controls[0].Op == OpARM64InvertFlags {
23857 v_0 := b.Controls[0]
23858 cmp := v_0.Args[0]
23859 b.resetWithControl(BlockARM64FLT, cmp)
23860 return true
23861 }
23862 case BlockARM64FLE:
23863
23864
23865 for b.Controls[0].Op == OpARM64InvertFlags {
23866 v_0 := b.Controls[0]
23867 cmp := v_0.Args[0]
23868 b.resetWithControl(BlockARM64FGE, cmp)
23869 return true
23870 }
23871 case BlockARM64FLT:
23872
23873
23874 for b.Controls[0].Op == OpARM64InvertFlags {
23875 v_0 := b.Controls[0]
23876 cmp := v_0.Args[0]
23877 b.resetWithControl(BlockARM64FGT, cmp)
23878 return true
23879 }
23880 case BlockARM64GE:
23881
23882
23883
23884 for b.Controls[0].Op == OpARM64CMPconst {
23885 v_0 := b.Controls[0]
23886 if auxIntToInt64(v_0.AuxInt) != 0 {
23887 break
23888 }
23889 z := v_0.Args[0]
23890 if z.Op != OpARM64AND {
23891 break
23892 }
23893 _ = z.Args[1]
23894 z_0 := z.Args[0]
23895 z_1 := z.Args[1]
23896 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
23897 x := z_0
23898 y := z_1
23899 if !(z.Uses == 1) {
23900 continue
23901 }
23902 v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
23903 v0.AddArg2(x, y)
23904 b.resetWithControl(BlockARM64GE, v0)
23905 return true
23906 }
23907 break
23908 }
23909
23910
23911
23912 for b.Controls[0].Op == OpARM64CMPconst {
23913 v_0 := b.Controls[0]
23914 if auxIntToInt64(v_0.AuxInt) != 0 {
23915 break
23916 }
23917 x := v_0.Args[0]
23918 if x.Op != OpARM64ANDconst {
23919 break
23920 }
23921 c := auxIntToInt64(x.AuxInt)
23922 y := x.Args[0]
23923 if !(x.Uses == 1) {
23924 break
23925 }
23926 v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
23927 v0.AuxInt = int64ToAuxInt(c)
23928 v0.AddArg(y)
23929 b.resetWithControl(BlockARM64GE, v0)
23930 return true
23931 }
23932
23933
23934
23935 for b.Controls[0].Op == OpARM64CMPWconst {
23936 v_0 := b.Controls[0]
23937 if auxIntToInt32(v_0.AuxInt) != 0 {
23938 break
23939 }
23940 z := v_0.Args[0]
23941 if z.Op != OpARM64AND {
23942 break
23943 }
23944 _ = z.Args[1]
23945 z_0 := z.Args[0]
23946 z_1 := z.Args[1]
23947 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
23948 x := z_0
23949 y := z_1
23950 if !(z.Uses == 1) {
23951 continue
23952 }
23953 v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
23954 v0.AddArg2(x, y)
23955 b.resetWithControl(BlockARM64GE, v0)
23956 return true
23957 }
23958 break
23959 }
23960
23961
23962
23963 for b.Controls[0].Op == OpARM64CMPWconst {
23964 v_0 := b.Controls[0]
23965 if auxIntToInt32(v_0.AuxInt) != 0 {
23966 break
23967 }
23968 x := v_0.Args[0]
23969 if x.Op != OpARM64ANDconst {
23970 break
23971 }
23972 c := auxIntToInt64(x.AuxInt)
23973 y := x.Args[0]
23974 if !(x.Uses == 1) {
23975 break
23976 }
23977 v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
23978 v0.AuxInt = int32ToAuxInt(int32(c))
23979 v0.AddArg(y)
23980 b.resetWithControl(BlockARM64GE, v0)
23981 return true
23982 }
23983
23984
23985
23986 for b.Controls[0].Op == OpARM64CMPconst {
23987 v_0 := b.Controls[0]
23988 if auxIntToInt64(v_0.AuxInt) != 0 {
23989 break
23990 }
23991 x := v_0.Args[0]
23992 if x.Op != OpARM64ADDconst {
23993 break
23994 }
23995 c := auxIntToInt64(x.AuxInt)
23996 y := x.Args[0]
23997 if !(x.Uses == 1) {
23998 break
23999 }
24000 v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
24001 v0.AuxInt = int64ToAuxInt(c)
24002 v0.AddArg(y)
24003 b.resetWithControl(BlockARM64GEnoov, v0)
24004 return true
24005 }
24006
24007
24008
24009 for b.Controls[0].Op == OpARM64CMPWconst {
24010 v_0 := b.Controls[0]
24011 if auxIntToInt32(v_0.AuxInt) != 0 {
24012 break
24013 }
24014 x := v_0.Args[0]
24015 if x.Op != OpARM64ADDconst {
24016 break
24017 }
24018 c := auxIntToInt64(x.AuxInt)
24019 y := x.Args[0]
24020 if !(x.Uses == 1) {
24021 break
24022 }
24023 v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
24024 v0.AuxInt = int32ToAuxInt(int32(c))
24025 v0.AddArg(y)
24026 b.resetWithControl(BlockARM64GEnoov, v0)
24027 return true
24028 }
24029
24030
24031
24032 for b.Controls[0].Op == OpARM64CMPconst {
24033 v_0 := b.Controls[0]
24034 if auxIntToInt64(v_0.AuxInt) != 0 {
24035 break
24036 }
24037 z := v_0.Args[0]
24038 if z.Op != OpARM64ADD {
24039 break
24040 }
24041 _ = z.Args[1]
24042 z_0 := z.Args[0]
24043 z_1 := z.Args[1]
24044 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
24045 x := z_0
24046 y := z_1
24047 if !(z.Uses == 1) {
24048 continue
24049 }
24050 v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
24051 v0.AddArg2(x, y)
24052 b.resetWithControl(BlockARM64GEnoov, v0)
24053 return true
24054 }
24055 break
24056 }
24057
24058
24059
24060 for b.Controls[0].Op == OpARM64CMPWconst {
24061 v_0 := b.Controls[0]
24062 if auxIntToInt32(v_0.AuxInt) != 0 {
24063 break
24064 }
24065 z := v_0.Args[0]
24066 if z.Op != OpARM64ADD {
24067 break
24068 }
24069 _ = z.Args[1]
24070 z_0 := z.Args[0]
24071 z_1 := z.Args[1]
24072 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
24073 x := z_0
24074 y := z_1
24075 if !(z.Uses == 1) {
24076 continue
24077 }
24078 v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
24079 v0.AddArg2(x, y)
24080 b.resetWithControl(BlockARM64GEnoov, v0)
24081 return true
24082 }
24083 break
24084 }
24085
24086
24087
24088 for b.Controls[0].Op == OpARM64CMPconst {
24089 v_0 := b.Controls[0]
24090 if auxIntToInt64(v_0.AuxInt) != 0 {
24091 break
24092 }
24093 z := v_0.Args[0]
24094 if z.Op != OpARM64MADD {
24095 break
24096 }
24097 y := z.Args[2]
24098 a := z.Args[0]
24099 x := z.Args[1]
24100 if !(z.Uses == 1) {
24101 break
24102 }
24103 v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
24104 v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
24105 v1.AddArg2(x, y)
24106 v0.AddArg2(a, v1)
24107 b.resetWithControl(BlockARM64GEnoov, v0)
24108 return true
24109 }
24110
24111
24112
24113 for b.Controls[0].Op == OpARM64CMPconst {
24114 v_0 := b.Controls[0]
24115 if auxIntToInt64(v_0.AuxInt) != 0 {
24116 break
24117 }
24118 z := v_0.Args[0]
24119 if z.Op != OpARM64MSUB {
24120 break
24121 }
24122 y := z.Args[2]
24123 a := z.Args[0]
24124 x := z.Args[1]
24125 if !(z.Uses == 1) {
24126 break
24127 }
24128 v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
24129 v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
24130 v1.AddArg2(x, y)
24131 v0.AddArg2(a, v1)
24132 b.resetWithControl(BlockARM64GEnoov, v0)
24133 return true
24134 }
24135
24136
24137
24138 for b.Controls[0].Op == OpARM64CMPWconst {
24139 v_0 := b.Controls[0]
24140 if auxIntToInt32(v_0.AuxInt) != 0 {
24141 break
24142 }
24143 z := v_0.Args[0]
24144 if z.Op != OpARM64MADDW {
24145 break
24146 }
24147 y := z.Args[2]
24148 a := z.Args[0]
24149 x := z.Args[1]
24150 if !(z.Uses == 1) {
24151 break
24152 }
24153 v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
24154 v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
24155 v1.AddArg2(x, y)
24156 v0.AddArg2(a, v1)
24157 b.resetWithControl(BlockARM64GEnoov, v0)
24158 return true
24159 }
24160
24161
24162
24163 for b.Controls[0].Op == OpARM64CMPWconst {
24164 v_0 := b.Controls[0]
24165 if auxIntToInt32(v_0.AuxInt) != 0 {
24166 break
24167 }
24168 z := v_0.Args[0]
24169 if z.Op != OpARM64MSUBW {
24170 break
24171 }
24172 y := z.Args[2]
24173 a := z.Args[0]
24174 x := z.Args[1]
24175 if !(z.Uses == 1) {
24176 break
24177 }
24178 v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
24179 v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
24180 v1.AddArg2(x, y)
24181 v0.AddArg2(a, v1)
24182 b.resetWithControl(BlockARM64GEnoov, v0)
24183 return true
24184 }
24185
24186
24187 for b.Controls[0].Op == OpARM64CMPWconst {
24188 v_0 := b.Controls[0]
24189 if auxIntToInt32(v_0.AuxInt) != 0 {
24190 break
24191 }
24192 x := v_0.Args[0]
24193 b.resetWithControl(BlockARM64TBZ, x)
24194 b.AuxInt = int64ToAuxInt(31)
24195 return true
24196 }
24197
24198
24199 for b.Controls[0].Op == OpARM64CMPconst {
24200 v_0 := b.Controls[0]
24201 if auxIntToInt64(v_0.AuxInt) != 0 {
24202 break
24203 }
24204 x := v_0.Args[0]
24205 b.resetWithControl(BlockARM64TBZ, x)
24206 b.AuxInt = int64ToAuxInt(63)
24207 return true
24208 }
24209
24210
24211
24212 for b.Controls[0].Op == OpARM64FlagConstant {
24213 v_0 := b.Controls[0]
24214 fc := auxIntToFlagConstant(v_0.AuxInt)
24215 if !(fc.ge()) {
24216 break
24217 }
24218 b.Reset(BlockFirst)
24219 return true
24220 }
24221
24222
24223
24224 for b.Controls[0].Op == OpARM64FlagConstant {
24225 v_0 := b.Controls[0]
24226 fc := auxIntToFlagConstant(v_0.AuxInt)
24227 if !(!fc.ge()) {
24228 break
24229 }
24230 b.Reset(BlockFirst)
24231 b.swapSuccessors()
24232 return true
24233 }
24234
24235
24236 for b.Controls[0].Op == OpARM64InvertFlags {
24237 v_0 := b.Controls[0]
24238 cmp := v_0.Args[0]
24239 b.resetWithControl(BlockARM64LE, cmp)
24240 return true
24241 }
24242 case BlockARM64GEnoov:
24243
24244
24245
24246 for b.Controls[0].Op == OpARM64FlagConstant {
24247 v_0 := b.Controls[0]
24248 fc := auxIntToFlagConstant(v_0.AuxInt)
24249 if !(fc.geNoov()) {
24250 break
24251 }
24252 b.Reset(BlockFirst)
24253 return true
24254 }
24255
24256
24257
24258 for b.Controls[0].Op == OpARM64FlagConstant {
24259 v_0 := b.Controls[0]
24260 fc := auxIntToFlagConstant(v_0.AuxInt)
24261 if !(!fc.geNoov()) {
24262 break
24263 }
24264 b.Reset(BlockFirst)
24265 b.swapSuccessors()
24266 return true
24267 }
24268
24269
24270 for b.Controls[0].Op == OpARM64InvertFlags {
24271 v_0 := b.Controls[0]
24272 cmp := v_0.Args[0]
24273 b.resetWithControl(BlockARM64LEnoov, cmp)
24274 return true
24275 }
24276 case BlockARM64GT:
24277
24278
24279
24280 for b.Controls[0].Op == OpARM64CMPconst {
24281 v_0 := b.Controls[0]
24282 if auxIntToInt64(v_0.AuxInt) != 0 {
24283 break
24284 }
24285 z := v_0.Args[0]
24286 if z.Op != OpARM64AND {
24287 break
24288 }
24289 _ = z.Args[1]
24290 z_0 := z.Args[0]
24291 z_1 := z.Args[1]
24292 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
24293 x := z_0
24294 y := z_1
24295 if !(z.Uses == 1) {
24296 continue
24297 }
24298 v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
24299 v0.AddArg2(x, y)
24300 b.resetWithControl(BlockARM64GT, v0)
24301 return true
24302 }
24303 break
24304 }
24305
24306
24307
24308 for b.Controls[0].Op == OpARM64CMPconst {
24309 v_0 := b.Controls[0]
24310 if auxIntToInt64(v_0.AuxInt) != 0 {
24311 break
24312 }
24313 x := v_0.Args[0]
24314 if x.Op != OpARM64ANDconst {
24315 break
24316 }
24317 c := auxIntToInt64(x.AuxInt)
24318 y := x.Args[0]
24319 if !(x.Uses == 1) {
24320 break
24321 }
24322 v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
24323 v0.AuxInt = int64ToAuxInt(c)
24324 v0.AddArg(y)
24325 b.resetWithControl(BlockARM64GT, v0)
24326 return true
24327 }
24328
24329
24330
24331 for b.Controls[0].Op == OpARM64CMPWconst {
24332 v_0 := b.Controls[0]
24333 if auxIntToInt32(v_0.AuxInt) != 0 {
24334 break
24335 }
24336 z := v_0.Args[0]
24337 if z.Op != OpARM64AND {
24338 break
24339 }
24340 _ = z.Args[1]
24341 z_0 := z.Args[0]
24342 z_1 := z.Args[1]
24343 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
24344 x := z_0
24345 y := z_1
24346 if !(z.Uses == 1) {
24347 continue
24348 }
24349 v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
24350 v0.AddArg2(x, y)
24351 b.resetWithControl(BlockARM64GT, v0)
24352 return true
24353 }
24354 break
24355 }
24356
24357
24358
24359 for b.Controls[0].Op == OpARM64CMPWconst {
24360 v_0 := b.Controls[0]
24361 if auxIntToInt32(v_0.AuxInt) != 0 {
24362 break
24363 }
24364 x := v_0.Args[0]
24365 if x.Op != OpARM64ANDconst {
24366 break
24367 }
24368 c := auxIntToInt64(x.AuxInt)
24369 y := x.Args[0]
24370 if !(x.Uses == 1) {
24371 break
24372 }
24373 v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
24374 v0.AuxInt = int32ToAuxInt(int32(c))
24375 v0.AddArg(y)
24376 b.resetWithControl(BlockARM64GT, v0)
24377 return true
24378 }
24379
24380
24381
24382 for b.Controls[0].Op == OpARM64CMPconst {
24383 v_0 := b.Controls[0]
24384 if auxIntToInt64(v_0.AuxInt) != 0 {
24385 break
24386 }
24387 x := v_0.Args[0]
24388 if x.Op != OpARM64ADDconst {
24389 break
24390 }
24391 c := auxIntToInt64(x.AuxInt)
24392 y := x.Args[0]
24393 if !(x.Uses == 1) {
24394 break
24395 }
24396 v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
24397 v0.AuxInt = int64ToAuxInt(c)
24398 v0.AddArg(y)
24399 b.resetWithControl(BlockARM64GTnoov, v0)
24400 return true
24401 }
24402
24403
24404
24405 for b.Controls[0].Op == OpARM64CMPWconst {
24406 v_0 := b.Controls[0]
24407 if auxIntToInt32(v_0.AuxInt) != 0 {
24408 break
24409 }
24410 x := v_0.Args[0]
24411 if x.Op != OpARM64ADDconst {
24412 break
24413 }
24414 c := auxIntToInt64(x.AuxInt)
24415 y := x.Args[0]
24416 if !(x.Uses == 1) {
24417 break
24418 }
24419 v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
24420 v0.AuxInt = int32ToAuxInt(int32(c))
24421 v0.AddArg(y)
24422 b.resetWithControl(BlockARM64GTnoov, v0)
24423 return true
24424 }
24425
24426
24427
24428 for b.Controls[0].Op == OpARM64CMPconst {
24429 v_0 := b.Controls[0]
24430 if auxIntToInt64(v_0.AuxInt) != 0 {
24431 break
24432 }
24433 z := v_0.Args[0]
24434 if z.Op != OpARM64ADD {
24435 break
24436 }
24437 _ = z.Args[1]
24438 z_0 := z.Args[0]
24439 z_1 := z.Args[1]
24440 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
24441 x := z_0
24442 y := z_1
24443 if !(z.Uses == 1) {
24444 continue
24445 }
24446 v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
24447 v0.AddArg2(x, y)
24448 b.resetWithControl(BlockARM64GTnoov, v0)
24449 return true
24450 }
24451 break
24452 }
24453
24454
24455
24456 for b.Controls[0].Op == OpARM64CMPWconst {
24457 v_0 := b.Controls[0]
24458 if auxIntToInt32(v_0.AuxInt) != 0 {
24459 break
24460 }
24461 z := v_0.Args[0]
24462 if z.Op != OpARM64ADD {
24463 break
24464 }
24465 _ = z.Args[1]
24466 z_0 := z.Args[0]
24467 z_1 := z.Args[1]
24468 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
24469 x := z_0
24470 y := z_1
24471 if !(z.Uses == 1) {
24472 continue
24473 }
24474 v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
24475 v0.AddArg2(x, y)
24476 b.resetWithControl(BlockARM64GTnoov, v0)
24477 return true
24478 }
24479 break
24480 }
24481
24482
24483
24484 for b.Controls[0].Op == OpARM64CMPconst {
24485 v_0 := b.Controls[0]
24486 if auxIntToInt64(v_0.AuxInt) != 0 {
24487 break
24488 }
24489 z := v_0.Args[0]
24490 if z.Op != OpARM64MADD {
24491 break
24492 }
24493 y := z.Args[2]
24494 a := z.Args[0]
24495 x := z.Args[1]
24496 if !(z.Uses == 1) {
24497 break
24498 }
24499 v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
24500 v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
24501 v1.AddArg2(x, y)
24502 v0.AddArg2(a, v1)
24503 b.resetWithControl(BlockARM64GTnoov, v0)
24504 return true
24505 }
24506
24507
24508
24509 for b.Controls[0].Op == OpARM64CMPconst {
24510 v_0 := b.Controls[0]
24511 if auxIntToInt64(v_0.AuxInt) != 0 {
24512 break
24513 }
24514 z := v_0.Args[0]
24515 if z.Op != OpARM64MSUB {
24516 break
24517 }
24518 y := z.Args[2]
24519 a := z.Args[0]
24520 x := z.Args[1]
24521 if !(z.Uses == 1) {
24522 break
24523 }
24524 v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
24525 v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
24526 v1.AddArg2(x, y)
24527 v0.AddArg2(a, v1)
24528 b.resetWithControl(BlockARM64GTnoov, v0)
24529 return true
24530 }
24531
24532
24533
24534 for b.Controls[0].Op == OpARM64CMPWconst {
24535 v_0 := b.Controls[0]
24536 if auxIntToInt32(v_0.AuxInt) != 0 {
24537 break
24538 }
24539 z := v_0.Args[0]
24540 if z.Op != OpARM64MADDW {
24541 break
24542 }
24543 y := z.Args[2]
24544 a := z.Args[0]
24545 x := z.Args[1]
24546 if !(z.Uses == 1) {
24547 break
24548 }
24549 v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
24550 v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
24551 v1.AddArg2(x, y)
24552 v0.AddArg2(a, v1)
24553 b.resetWithControl(BlockARM64GTnoov, v0)
24554 return true
24555 }
24556
24557
24558
24559 for b.Controls[0].Op == OpARM64CMPWconst {
24560 v_0 := b.Controls[0]
24561 if auxIntToInt32(v_0.AuxInt) != 0 {
24562 break
24563 }
24564 z := v_0.Args[0]
24565 if z.Op != OpARM64MSUBW {
24566 break
24567 }
24568 y := z.Args[2]
24569 a := z.Args[0]
24570 x := z.Args[1]
24571 if !(z.Uses == 1) {
24572 break
24573 }
24574 v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
24575 v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
24576 v1.AddArg2(x, y)
24577 v0.AddArg2(a, v1)
24578 b.resetWithControl(BlockARM64GTnoov, v0)
24579 return true
24580 }
24581
24582
24583
24584 for b.Controls[0].Op == OpARM64FlagConstant {
24585 v_0 := b.Controls[0]
24586 fc := auxIntToFlagConstant(v_0.AuxInt)
24587 if !(fc.gt()) {
24588 break
24589 }
24590 b.Reset(BlockFirst)
24591 return true
24592 }
24593
24594
24595
24596 for b.Controls[0].Op == OpARM64FlagConstant {
24597 v_0 := b.Controls[0]
24598 fc := auxIntToFlagConstant(v_0.AuxInt)
24599 if !(!fc.gt()) {
24600 break
24601 }
24602 b.Reset(BlockFirst)
24603 b.swapSuccessors()
24604 return true
24605 }
24606
24607
24608 for b.Controls[0].Op == OpARM64InvertFlags {
24609 v_0 := b.Controls[0]
24610 cmp := v_0.Args[0]
24611 b.resetWithControl(BlockARM64LT, cmp)
24612 return true
24613 }
24614 case BlockARM64GTnoov:
24615
24616
24617
24618 for b.Controls[0].Op == OpARM64FlagConstant {
24619 v_0 := b.Controls[0]
24620 fc := auxIntToFlagConstant(v_0.AuxInt)
24621 if !(fc.gtNoov()) {
24622 break
24623 }
24624 b.Reset(BlockFirst)
24625 return true
24626 }
24627
24628
24629
24630 for b.Controls[0].Op == OpARM64FlagConstant {
24631 v_0 := b.Controls[0]
24632 fc := auxIntToFlagConstant(v_0.AuxInt)
24633 if !(!fc.gtNoov()) {
24634 break
24635 }
24636 b.Reset(BlockFirst)
24637 b.swapSuccessors()
24638 return true
24639 }
24640
24641
24642 for b.Controls[0].Op == OpARM64InvertFlags {
24643 v_0 := b.Controls[0]
24644 cmp := v_0.Args[0]
24645 b.resetWithControl(BlockARM64LTnoov, cmp)
24646 return true
24647 }
24648 case BlockIf:
24649
24650
24651 for b.Controls[0].Op == OpARM64Equal {
24652 v_0 := b.Controls[0]
24653 cc := v_0.Args[0]
24654 b.resetWithControl(BlockARM64EQ, cc)
24655 return true
24656 }
24657
24658
24659 for b.Controls[0].Op == OpARM64NotEqual {
24660 v_0 := b.Controls[0]
24661 cc := v_0.Args[0]
24662 b.resetWithControl(BlockARM64NE, cc)
24663 return true
24664 }
24665
24666
24667 for b.Controls[0].Op == OpARM64LessThan {
24668 v_0 := b.Controls[0]
24669 cc := v_0.Args[0]
24670 b.resetWithControl(BlockARM64LT, cc)
24671 return true
24672 }
24673
24674
24675 for b.Controls[0].Op == OpARM64LessThanU {
24676 v_0 := b.Controls[0]
24677 cc := v_0.Args[0]
24678 b.resetWithControl(BlockARM64ULT, cc)
24679 return true
24680 }
24681
24682
24683 for b.Controls[0].Op == OpARM64LessEqual {
24684 v_0 := b.Controls[0]
24685 cc := v_0.Args[0]
24686 b.resetWithControl(BlockARM64LE, cc)
24687 return true
24688 }
24689
24690
24691 for b.Controls[0].Op == OpARM64LessEqualU {
24692 v_0 := b.Controls[0]
24693 cc := v_0.Args[0]
24694 b.resetWithControl(BlockARM64ULE, cc)
24695 return true
24696 }
24697
24698
24699 for b.Controls[0].Op == OpARM64GreaterThan {
24700 v_0 := b.Controls[0]
24701 cc := v_0.Args[0]
24702 b.resetWithControl(BlockARM64GT, cc)
24703 return true
24704 }
24705
24706
24707 for b.Controls[0].Op == OpARM64GreaterThanU {
24708 v_0 := b.Controls[0]
24709 cc := v_0.Args[0]
24710 b.resetWithControl(BlockARM64UGT, cc)
24711 return true
24712 }
24713
24714
24715 for b.Controls[0].Op == OpARM64GreaterEqual {
24716 v_0 := b.Controls[0]
24717 cc := v_0.Args[0]
24718 b.resetWithControl(BlockARM64GE, cc)
24719 return true
24720 }
24721
24722
24723 for b.Controls[0].Op == OpARM64GreaterEqualU {
24724 v_0 := b.Controls[0]
24725 cc := v_0.Args[0]
24726 b.resetWithControl(BlockARM64UGE, cc)
24727 return true
24728 }
24729
24730
24731 for b.Controls[0].Op == OpARM64LessThanF {
24732 v_0 := b.Controls[0]
24733 cc := v_0.Args[0]
24734 b.resetWithControl(BlockARM64FLT, cc)
24735 return true
24736 }
24737
24738
24739 for b.Controls[0].Op == OpARM64LessEqualF {
24740 v_0 := b.Controls[0]
24741 cc := v_0.Args[0]
24742 b.resetWithControl(BlockARM64FLE, cc)
24743 return true
24744 }
24745
24746
24747 for b.Controls[0].Op == OpARM64GreaterThanF {
24748 v_0 := b.Controls[0]
24749 cc := v_0.Args[0]
24750 b.resetWithControl(BlockARM64FGT, cc)
24751 return true
24752 }
24753
24754
24755 for b.Controls[0].Op == OpARM64GreaterEqualF {
24756 v_0 := b.Controls[0]
24757 cc := v_0.Args[0]
24758 b.resetWithControl(BlockARM64FGE, cc)
24759 return true
24760 }
24761
24762
24763 for {
24764 cond := b.Controls[0]
24765 b.resetWithControl(BlockARM64TBNZ, cond)
24766 b.AuxInt = int64ToAuxInt(0)
24767 return true
24768 }
24769 case BlockJumpTable:
24770
24771
24772 for {
24773 idx := b.Controls[0]
24774 v0 := b.NewValue0(b.Pos, OpARM64MOVDaddr, typ.Uintptr)
24775 v0.Aux = symToAux(makeJumpTableSym(b))
24776 v1 := b.NewValue0(b.Pos, OpSB, typ.Uintptr)
24777 v0.AddArg(v1)
24778 b.resetWithControl2(BlockARM64JUMPTABLE, idx, v0)
24779 b.Aux = symToAux(makeJumpTableSym(b))
24780 return true
24781 }
24782 case BlockARM64LE:
24783
24784
24785
24786 for b.Controls[0].Op == OpARM64CMPconst {
24787 v_0 := b.Controls[0]
24788 if auxIntToInt64(v_0.AuxInt) != 0 {
24789 break
24790 }
24791 z := v_0.Args[0]
24792 if z.Op != OpARM64AND {
24793 break
24794 }
24795 _ = z.Args[1]
24796 z_0 := z.Args[0]
24797 z_1 := z.Args[1]
24798 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
24799 x := z_0
24800 y := z_1
24801 if !(z.Uses == 1) {
24802 continue
24803 }
24804 v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
24805 v0.AddArg2(x, y)
24806 b.resetWithControl(BlockARM64LE, v0)
24807 return true
24808 }
24809 break
24810 }
24811
24812
24813
24814 for b.Controls[0].Op == OpARM64CMPconst {
24815 v_0 := b.Controls[0]
24816 if auxIntToInt64(v_0.AuxInt) != 0 {
24817 break
24818 }
24819 x := v_0.Args[0]
24820 if x.Op != OpARM64ANDconst {
24821 break
24822 }
24823 c := auxIntToInt64(x.AuxInt)
24824 y := x.Args[0]
24825 if !(x.Uses == 1) {
24826 break
24827 }
24828 v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
24829 v0.AuxInt = int64ToAuxInt(c)
24830 v0.AddArg(y)
24831 b.resetWithControl(BlockARM64LE, v0)
24832 return true
24833 }
24834
24835
24836
24837 for b.Controls[0].Op == OpARM64CMPWconst {
24838 v_0 := b.Controls[0]
24839 if auxIntToInt32(v_0.AuxInt) != 0 {
24840 break
24841 }
24842 z := v_0.Args[0]
24843 if z.Op != OpARM64AND {
24844 break
24845 }
24846 _ = z.Args[1]
24847 z_0 := z.Args[0]
24848 z_1 := z.Args[1]
24849 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
24850 x := z_0
24851 y := z_1
24852 if !(z.Uses == 1) {
24853 continue
24854 }
24855 v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
24856 v0.AddArg2(x, y)
24857 b.resetWithControl(BlockARM64LE, v0)
24858 return true
24859 }
24860 break
24861 }
24862
24863
24864
24865 for b.Controls[0].Op == OpARM64CMPWconst {
24866 v_0 := b.Controls[0]
24867 if auxIntToInt32(v_0.AuxInt) != 0 {
24868 break
24869 }
24870 x := v_0.Args[0]
24871 if x.Op != OpARM64ANDconst {
24872 break
24873 }
24874 c := auxIntToInt64(x.AuxInt)
24875 y := x.Args[0]
24876 if !(x.Uses == 1) {
24877 break
24878 }
24879 v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
24880 v0.AuxInt = int32ToAuxInt(int32(c))
24881 v0.AddArg(y)
24882 b.resetWithControl(BlockARM64LE, v0)
24883 return true
24884 }
24885
24886
24887
24888 for b.Controls[0].Op == OpARM64CMPconst {
24889 v_0 := b.Controls[0]
24890 if auxIntToInt64(v_0.AuxInt) != 0 {
24891 break
24892 }
24893 x := v_0.Args[0]
24894 if x.Op != OpARM64ADDconst {
24895 break
24896 }
24897 c := auxIntToInt64(x.AuxInt)
24898 y := x.Args[0]
24899 if !(x.Uses == 1) {
24900 break
24901 }
24902 v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
24903 v0.AuxInt = int64ToAuxInt(c)
24904 v0.AddArg(y)
24905 b.resetWithControl(BlockARM64LEnoov, v0)
24906 return true
24907 }
24908
24909
24910
24911 for b.Controls[0].Op == OpARM64CMPWconst {
24912 v_0 := b.Controls[0]
24913 if auxIntToInt32(v_0.AuxInt) != 0 {
24914 break
24915 }
24916 x := v_0.Args[0]
24917 if x.Op != OpARM64ADDconst {
24918 break
24919 }
24920 c := auxIntToInt64(x.AuxInt)
24921 y := x.Args[0]
24922 if !(x.Uses == 1) {
24923 break
24924 }
24925 v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
24926 v0.AuxInt = int32ToAuxInt(int32(c))
24927 v0.AddArg(y)
24928 b.resetWithControl(BlockARM64LEnoov, v0)
24929 return true
24930 }
24931
24932
24933
24934 for b.Controls[0].Op == OpARM64CMPconst {
24935 v_0 := b.Controls[0]
24936 if auxIntToInt64(v_0.AuxInt) != 0 {
24937 break
24938 }
24939 z := v_0.Args[0]
24940 if z.Op != OpARM64ADD {
24941 break
24942 }
24943 _ = z.Args[1]
24944 z_0 := z.Args[0]
24945 z_1 := z.Args[1]
24946 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
24947 x := z_0
24948 y := z_1
24949 if !(z.Uses == 1) {
24950 continue
24951 }
24952 v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
24953 v0.AddArg2(x, y)
24954 b.resetWithControl(BlockARM64LEnoov, v0)
24955 return true
24956 }
24957 break
24958 }
24959
24960
24961
24962 for b.Controls[0].Op == OpARM64CMPWconst {
24963 v_0 := b.Controls[0]
24964 if auxIntToInt32(v_0.AuxInt) != 0 {
24965 break
24966 }
24967 z := v_0.Args[0]
24968 if z.Op != OpARM64ADD {
24969 break
24970 }
24971 _ = z.Args[1]
24972 z_0 := z.Args[0]
24973 z_1 := z.Args[1]
24974 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
24975 x := z_0
24976 y := z_1
24977 if !(z.Uses == 1) {
24978 continue
24979 }
24980 v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
24981 v0.AddArg2(x, y)
24982 b.resetWithControl(BlockARM64LEnoov, v0)
24983 return true
24984 }
24985 break
24986 }
24987
24988
24989
24990 for b.Controls[0].Op == OpARM64CMPconst {
24991 v_0 := b.Controls[0]
24992 if auxIntToInt64(v_0.AuxInt) != 0 {
24993 break
24994 }
24995 z := v_0.Args[0]
24996 if z.Op != OpARM64MADD {
24997 break
24998 }
24999 y := z.Args[2]
25000 a := z.Args[0]
25001 x := z.Args[1]
25002 if !(z.Uses == 1) {
25003 break
25004 }
25005 v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
25006 v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
25007 v1.AddArg2(x, y)
25008 v0.AddArg2(a, v1)
25009 b.resetWithControl(BlockARM64LEnoov, v0)
25010 return true
25011 }
25012
25013
25014
25015 for b.Controls[0].Op == OpARM64CMPconst {
25016 v_0 := b.Controls[0]
25017 if auxIntToInt64(v_0.AuxInt) != 0 {
25018 break
25019 }
25020 z := v_0.Args[0]
25021 if z.Op != OpARM64MSUB {
25022 break
25023 }
25024 y := z.Args[2]
25025 a := z.Args[0]
25026 x := z.Args[1]
25027 if !(z.Uses == 1) {
25028 break
25029 }
25030 v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
25031 v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
25032 v1.AddArg2(x, y)
25033 v0.AddArg2(a, v1)
25034 b.resetWithControl(BlockARM64LEnoov, v0)
25035 return true
25036 }
25037
25038
25039
25040 for b.Controls[0].Op == OpARM64CMPWconst {
25041 v_0 := b.Controls[0]
25042 if auxIntToInt32(v_0.AuxInt) != 0 {
25043 break
25044 }
25045 z := v_0.Args[0]
25046 if z.Op != OpARM64MADDW {
25047 break
25048 }
25049 y := z.Args[2]
25050 a := z.Args[0]
25051 x := z.Args[1]
25052 if !(z.Uses == 1) {
25053 break
25054 }
25055 v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
25056 v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
25057 v1.AddArg2(x, y)
25058 v0.AddArg2(a, v1)
25059 b.resetWithControl(BlockARM64LEnoov, v0)
25060 return true
25061 }
25062
25063
25064
25065 for b.Controls[0].Op == OpARM64CMPWconst {
25066 v_0 := b.Controls[0]
25067 if auxIntToInt32(v_0.AuxInt) != 0 {
25068 break
25069 }
25070 z := v_0.Args[0]
25071 if z.Op != OpARM64MSUBW {
25072 break
25073 }
25074 y := z.Args[2]
25075 a := z.Args[0]
25076 x := z.Args[1]
25077 if !(z.Uses == 1) {
25078 break
25079 }
25080 v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
25081 v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
25082 v1.AddArg2(x, y)
25083 v0.AddArg2(a, v1)
25084 b.resetWithControl(BlockARM64LEnoov, v0)
25085 return true
25086 }
25087
25088
25089
25090 for b.Controls[0].Op == OpARM64FlagConstant {
25091 v_0 := b.Controls[0]
25092 fc := auxIntToFlagConstant(v_0.AuxInt)
25093 if !(fc.le()) {
25094 break
25095 }
25096 b.Reset(BlockFirst)
25097 return true
25098 }
25099
25100
25101
25102 for b.Controls[0].Op == OpARM64FlagConstant {
25103 v_0 := b.Controls[0]
25104 fc := auxIntToFlagConstant(v_0.AuxInt)
25105 if !(!fc.le()) {
25106 break
25107 }
25108 b.Reset(BlockFirst)
25109 b.swapSuccessors()
25110 return true
25111 }
25112
25113
25114 for b.Controls[0].Op == OpARM64InvertFlags {
25115 v_0 := b.Controls[0]
25116 cmp := v_0.Args[0]
25117 b.resetWithControl(BlockARM64GE, cmp)
25118 return true
25119 }
25120 case BlockARM64LEnoov:
25121
25122
25123
25124 for b.Controls[0].Op == OpARM64FlagConstant {
25125 v_0 := b.Controls[0]
25126 fc := auxIntToFlagConstant(v_0.AuxInt)
25127 if !(fc.leNoov()) {
25128 break
25129 }
25130 b.Reset(BlockFirst)
25131 return true
25132 }
25133
25134
25135
25136 for b.Controls[0].Op == OpARM64FlagConstant {
25137 v_0 := b.Controls[0]
25138 fc := auxIntToFlagConstant(v_0.AuxInt)
25139 if !(!fc.leNoov()) {
25140 break
25141 }
25142 b.Reset(BlockFirst)
25143 b.swapSuccessors()
25144 return true
25145 }
25146
25147
25148 for b.Controls[0].Op == OpARM64InvertFlags {
25149 v_0 := b.Controls[0]
25150 cmp := v_0.Args[0]
25151 b.resetWithControl(BlockARM64GEnoov, cmp)
25152 return true
25153 }
25154 case BlockARM64LT:
25155
25156
25157
25158 for b.Controls[0].Op == OpARM64CMPconst {
25159 v_0 := b.Controls[0]
25160 if auxIntToInt64(v_0.AuxInt) != 0 {
25161 break
25162 }
25163 z := v_0.Args[0]
25164 if z.Op != OpARM64AND {
25165 break
25166 }
25167 _ = z.Args[1]
25168 z_0 := z.Args[0]
25169 z_1 := z.Args[1]
25170 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
25171 x := z_0
25172 y := z_1
25173 if !(z.Uses == 1) {
25174 continue
25175 }
25176 v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
25177 v0.AddArg2(x, y)
25178 b.resetWithControl(BlockARM64LT, v0)
25179 return true
25180 }
25181 break
25182 }
25183
25184
25185
25186 for b.Controls[0].Op == OpARM64CMPconst {
25187 v_0 := b.Controls[0]
25188 if auxIntToInt64(v_0.AuxInt) != 0 {
25189 break
25190 }
25191 x := v_0.Args[0]
25192 if x.Op != OpARM64ANDconst {
25193 break
25194 }
25195 c := auxIntToInt64(x.AuxInt)
25196 y := x.Args[0]
25197 if !(x.Uses == 1) {
25198 break
25199 }
25200 v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
25201 v0.AuxInt = int64ToAuxInt(c)
25202 v0.AddArg(y)
25203 b.resetWithControl(BlockARM64LT, v0)
25204 return true
25205 }
25206
25207
25208
25209 for b.Controls[0].Op == OpARM64CMPWconst {
25210 v_0 := b.Controls[0]
25211 if auxIntToInt32(v_0.AuxInt) != 0 {
25212 break
25213 }
25214 z := v_0.Args[0]
25215 if z.Op != OpARM64AND {
25216 break
25217 }
25218 _ = z.Args[1]
25219 z_0 := z.Args[0]
25220 z_1 := z.Args[1]
25221 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
25222 x := z_0
25223 y := z_1
25224 if !(z.Uses == 1) {
25225 continue
25226 }
25227 v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
25228 v0.AddArg2(x, y)
25229 b.resetWithControl(BlockARM64LT, v0)
25230 return true
25231 }
25232 break
25233 }
25234
25235
25236
25237 for b.Controls[0].Op == OpARM64CMPWconst {
25238 v_0 := b.Controls[0]
25239 if auxIntToInt32(v_0.AuxInt) != 0 {
25240 break
25241 }
25242 x := v_0.Args[0]
25243 if x.Op != OpARM64ANDconst {
25244 break
25245 }
25246 c := auxIntToInt64(x.AuxInt)
25247 y := x.Args[0]
25248 if !(x.Uses == 1) {
25249 break
25250 }
25251 v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
25252 v0.AuxInt = int32ToAuxInt(int32(c))
25253 v0.AddArg(y)
25254 b.resetWithControl(BlockARM64LT, v0)
25255 return true
25256 }
25257
25258
25259
25260 for b.Controls[0].Op == OpARM64CMPconst {
25261 v_0 := b.Controls[0]
25262 if auxIntToInt64(v_0.AuxInt) != 0 {
25263 break
25264 }
25265 x := v_0.Args[0]
25266 if x.Op != OpARM64ADDconst {
25267 break
25268 }
25269 c := auxIntToInt64(x.AuxInt)
25270 y := x.Args[0]
25271 if !(x.Uses == 1) {
25272 break
25273 }
25274 v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
25275 v0.AuxInt = int64ToAuxInt(c)
25276 v0.AddArg(y)
25277 b.resetWithControl(BlockARM64LTnoov, v0)
25278 return true
25279 }
25280
25281
25282
25283 for b.Controls[0].Op == OpARM64CMPWconst {
25284 v_0 := b.Controls[0]
25285 if auxIntToInt32(v_0.AuxInt) != 0 {
25286 break
25287 }
25288 x := v_0.Args[0]
25289 if x.Op != OpARM64ADDconst {
25290 break
25291 }
25292 c := auxIntToInt64(x.AuxInt)
25293 y := x.Args[0]
25294 if !(x.Uses == 1) {
25295 break
25296 }
25297 v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
25298 v0.AuxInt = int32ToAuxInt(int32(c))
25299 v0.AddArg(y)
25300 b.resetWithControl(BlockARM64LTnoov, v0)
25301 return true
25302 }
25303
25304
25305
25306 for b.Controls[0].Op == OpARM64CMPconst {
25307 v_0 := b.Controls[0]
25308 if auxIntToInt64(v_0.AuxInt) != 0 {
25309 break
25310 }
25311 z := v_0.Args[0]
25312 if z.Op != OpARM64ADD {
25313 break
25314 }
25315 _ = z.Args[1]
25316 z_0 := z.Args[0]
25317 z_1 := z.Args[1]
25318 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
25319 x := z_0
25320 y := z_1
25321 if !(z.Uses == 1) {
25322 continue
25323 }
25324 v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
25325 v0.AddArg2(x, y)
25326 b.resetWithControl(BlockARM64LTnoov, v0)
25327 return true
25328 }
25329 break
25330 }
25331
25332
25333
25334 for b.Controls[0].Op == OpARM64CMPWconst {
25335 v_0 := b.Controls[0]
25336 if auxIntToInt32(v_0.AuxInt) != 0 {
25337 break
25338 }
25339 z := v_0.Args[0]
25340 if z.Op != OpARM64ADD {
25341 break
25342 }
25343 _ = z.Args[1]
25344 z_0 := z.Args[0]
25345 z_1 := z.Args[1]
25346 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
25347 x := z_0
25348 y := z_1
25349 if !(z.Uses == 1) {
25350 continue
25351 }
25352 v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
25353 v0.AddArg2(x, y)
25354 b.resetWithControl(BlockARM64LTnoov, v0)
25355 return true
25356 }
25357 break
25358 }
25359
25360
25361
25362 for b.Controls[0].Op == OpARM64CMPconst {
25363 v_0 := b.Controls[0]
25364 if auxIntToInt64(v_0.AuxInt) != 0 {
25365 break
25366 }
25367 z := v_0.Args[0]
25368 if z.Op != OpARM64MADD {
25369 break
25370 }
25371 y := z.Args[2]
25372 a := z.Args[0]
25373 x := z.Args[1]
25374 if !(z.Uses == 1) {
25375 break
25376 }
25377 v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
25378 v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
25379 v1.AddArg2(x, y)
25380 v0.AddArg2(a, v1)
25381 b.resetWithControl(BlockARM64LTnoov, v0)
25382 return true
25383 }
25384
25385
25386
25387 for b.Controls[0].Op == OpARM64CMPconst {
25388 v_0 := b.Controls[0]
25389 if auxIntToInt64(v_0.AuxInt) != 0 {
25390 break
25391 }
25392 z := v_0.Args[0]
25393 if z.Op != OpARM64MSUB {
25394 break
25395 }
25396 y := z.Args[2]
25397 a := z.Args[0]
25398 x := z.Args[1]
25399 if !(z.Uses == 1) {
25400 break
25401 }
25402 v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
25403 v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
25404 v1.AddArg2(x, y)
25405 v0.AddArg2(a, v1)
25406 b.resetWithControl(BlockARM64LTnoov, v0)
25407 return true
25408 }
25409
25410
25411
25412 for b.Controls[0].Op == OpARM64CMPWconst {
25413 v_0 := b.Controls[0]
25414 if auxIntToInt32(v_0.AuxInt) != 0 {
25415 break
25416 }
25417 z := v_0.Args[0]
25418 if z.Op != OpARM64MADDW {
25419 break
25420 }
25421 y := z.Args[2]
25422 a := z.Args[0]
25423 x := z.Args[1]
25424 if !(z.Uses == 1) {
25425 break
25426 }
25427 v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
25428 v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
25429 v1.AddArg2(x, y)
25430 v0.AddArg2(a, v1)
25431 b.resetWithControl(BlockARM64LTnoov, v0)
25432 return true
25433 }
25434
25435
25436
25437 for b.Controls[0].Op == OpARM64CMPWconst {
25438 v_0 := b.Controls[0]
25439 if auxIntToInt32(v_0.AuxInt) != 0 {
25440 break
25441 }
25442 z := v_0.Args[0]
25443 if z.Op != OpARM64MSUBW {
25444 break
25445 }
25446 y := z.Args[2]
25447 a := z.Args[0]
25448 x := z.Args[1]
25449 if !(z.Uses == 1) {
25450 break
25451 }
25452 v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
25453 v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
25454 v1.AddArg2(x, y)
25455 v0.AddArg2(a, v1)
25456 b.resetWithControl(BlockARM64LTnoov, v0)
25457 return true
25458 }
25459
25460
25461 for b.Controls[0].Op == OpARM64CMPWconst {
25462 v_0 := b.Controls[0]
25463 if auxIntToInt32(v_0.AuxInt) != 0 {
25464 break
25465 }
25466 x := v_0.Args[0]
25467 b.resetWithControl(BlockARM64TBNZ, x)
25468 b.AuxInt = int64ToAuxInt(31)
25469 return true
25470 }
25471
25472
25473 for b.Controls[0].Op == OpARM64CMPconst {
25474 v_0 := b.Controls[0]
25475 if auxIntToInt64(v_0.AuxInt) != 0 {
25476 break
25477 }
25478 x := v_0.Args[0]
25479 b.resetWithControl(BlockARM64TBNZ, x)
25480 b.AuxInt = int64ToAuxInt(63)
25481 return true
25482 }
25483
25484
25485
25486 for b.Controls[0].Op == OpARM64FlagConstant {
25487 v_0 := b.Controls[0]
25488 fc := auxIntToFlagConstant(v_0.AuxInt)
25489 if !(fc.lt()) {
25490 break
25491 }
25492 b.Reset(BlockFirst)
25493 return true
25494 }
25495
25496
25497
25498 for b.Controls[0].Op == OpARM64FlagConstant {
25499 v_0 := b.Controls[0]
25500 fc := auxIntToFlagConstant(v_0.AuxInt)
25501 if !(!fc.lt()) {
25502 break
25503 }
25504 b.Reset(BlockFirst)
25505 b.swapSuccessors()
25506 return true
25507 }
25508
25509
25510 for b.Controls[0].Op == OpARM64InvertFlags {
25511 v_0 := b.Controls[0]
25512 cmp := v_0.Args[0]
25513 b.resetWithControl(BlockARM64GT, cmp)
25514 return true
25515 }
25516 case BlockARM64LTnoov:
25517
25518
25519
25520 for b.Controls[0].Op == OpARM64FlagConstant {
25521 v_0 := b.Controls[0]
25522 fc := auxIntToFlagConstant(v_0.AuxInt)
25523 if !(fc.ltNoov()) {
25524 break
25525 }
25526 b.Reset(BlockFirst)
25527 return true
25528 }
25529
25530
25531
25532 for b.Controls[0].Op == OpARM64FlagConstant {
25533 v_0 := b.Controls[0]
25534 fc := auxIntToFlagConstant(v_0.AuxInt)
25535 if !(!fc.ltNoov()) {
25536 break
25537 }
25538 b.Reset(BlockFirst)
25539 b.swapSuccessors()
25540 return true
25541 }
25542
25543
25544 for b.Controls[0].Op == OpARM64InvertFlags {
25545 v_0 := b.Controls[0]
25546 cmp := v_0.Args[0]
25547 b.resetWithControl(BlockARM64GTnoov, cmp)
25548 return true
25549 }
25550 case BlockARM64NE:
25551
25552
25553
25554 for b.Controls[0].Op == OpARM64CMPconst {
25555 v_0 := b.Controls[0]
25556 if auxIntToInt64(v_0.AuxInt) != 0 {
25557 break
25558 }
25559 z := v_0.Args[0]
25560 if z.Op != OpARM64AND {
25561 break
25562 }
25563 _ = z.Args[1]
25564 z_0 := z.Args[0]
25565 z_1 := z.Args[1]
25566 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
25567 x := z_0
25568 y := z_1
25569 if !(z.Uses == 1) {
25570 continue
25571 }
25572 v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
25573 v0.AddArg2(x, y)
25574 b.resetWithControl(BlockARM64NE, v0)
25575 return true
25576 }
25577 break
25578 }
25579
25580
25581
25582 for b.Controls[0].Op == OpARM64CMPconst {
25583 v_0 := b.Controls[0]
25584 if auxIntToInt64(v_0.AuxInt) != 0 {
25585 break
25586 }
25587 x := v_0.Args[0]
25588 if x.Op != OpARM64ANDconst {
25589 break
25590 }
25591 c := auxIntToInt64(x.AuxInt)
25592 y := x.Args[0]
25593 if !(x.Uses == 1) {
25594 break
25595 }
25596 v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
25597 v0.AuxInt = int64ToAuxInt(c)
25598 v0.AddArg(y)
25599 b.resetWithControl(BlockARM64NE, v0)
25600 return true
25601 }
25602
25603
25604
25605 for b.Controls[0].Op == OpARM64CMPWconst {
25606 v_0 := b.Controls[0]
25607 if auxIntToInt32(v_0.AuxInt) != 0 {
25608 break
25609 }
25610 z := v_0.Args[0]
25611 if z.Op != OpARM64AND {
25612 break
25613 }
25614 _ = z.Args[1]
25615 z_0 := z.Args[0]
25616 z_1 := z.Args[1]
25617 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
25618 x := z_0
25619 y := z_1
25620 if !(z.Uses == 1) {
25621 continue
25622 }
25623 v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
25624 v0.AddArg2(x, y)
25625 b.resetWithControl(BlockARM64NE, v0)
25626 return true
25627 }
25628 break
25629 }
25630
25631
25632
25633 for b.Controls[0].Op == OpARM64CMPWconst {
25634 v_0 := b.Controls[0]
25635 if auxIntToInt32(v_0.AuxInt) != 0 {
25636 break
25637 }
25638 x := v_0.Args[0]
25639 if x.Op != OpARM64ANDconst {
25640 break
25641 }
25642 c := auxIntToInt64(x.AuxInt)
25643 y := x.Args[0]
25644 if !(x.Uses == 1) {
25645 break
25646 }
25647 v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
25648 v0.AuxInt = int32ToAuxInt(int32(c))
25649 v0.AddArg(y)
25650 b.resetWithControl(BlockARM64NE, v0)
25651 return true
25652 }
25653
25654
25655
25656 for b.Controls[0].Op == OpARM64CMPconst {
25657 v_0 := b.Controls[0]
25658 if auxIntToInt64(v_0.AuxInt) != 0 {
25659 break
25660 }
25661 x := v_0.Args[0]
25662 if x.Op != OpARM64ADDconst {
25663 break
25664 }
25665 c := auxIntToInt64(x.AuxInt)
25666 y := x.Args[0]
25667 if !(x.Uses == 1) {
25668 break
25669 }
25670 v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
25671 v0.AuxInt = int64ToAuxInt(c)
25672 v0.AddArg(y)
25673 b.resetWithControl(BlockARM64NE, v0)
25674 return true
25675 }
25676
25677
25678
25679 for b.Controls[0].Op == OpARM64CMPWconst {
25680 v_0 := b.Controls[0]
25681 if auxIntToInt32(v_0.AuxInt) != 0 {
25682 break
25683 }
25684 x := v_0.Args[0]
25685 if x.Op != OpARM64ADDconst {
25686 break
25687 }
25688 c := auxIntToInt64(x.AuxInt)
25689 y := x.Args[0]
25690 if !(x.Uses == 1) {
25691 break
25692 }
25693 v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
25694 v0.AuxInt = int32ToAuxInt(int32(c))
25695 v0.AddArg(y)
25696 b.resetWithControl(BlockARM64NE, v0)
25697 return true
25698 }
25699
25700
25701
25702 for b.Controls[0].Op == OpARM64CMPconst {
25703 v_0 := b.Controls[0]
25704 if auxIntToInt64(v_0.AuxInt) != 0 {
25705 break
25706 }
25707 z := v_0.Args[0]
25708 if z.Op != OpARM64ADD {
25709 break
25710 }
25711 _ = z.Args[1]
25712 z_0 := z.Args[0]
25713 z_1 := z.Args[1]
25714 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
25715 x := z_0
25716 y := z_1
25717 if !(z.Uses == 1) {
25718 continue
25719 }
25720 v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
25721 v0.AddArg2(x, y)
25722 b.resetWithControl(BlockARM64NE, v0)
25723 return true
25724 }
25725 break
25726 }
25727
25728
25729
25730 for b.Controls[0].Op == OpARM64CMPWconst {
25731 v_0 := b.Controls[0]
25732 if auxIntToInt32(v_0.AuxInt) != 0 {
25733 break
25734 }
25735 z := v_0.Args[0]
25736 if z.Op != OpARM64ADD {
25737 break
25738 }
25739 _ = z.Args[1]
25740 z_0 := z.Args[0]
25741 z_1 := z.Args[1]
25742 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
25743 x := z_0
25744 y := z_1
25745 if !(z.Uses == 1) {
25746 continue
25747 }
25748 v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
25749 v0.AddArg2(x, y)
25750 b.resetWithControl(BlockARM64NE, v0)
25751 return true
25752 }
25753 break
25754 }
25755
25756
25757
25758 for b.Controls[0].Op == OpARM64CMP {
25759 v_0 := b.Controls[0]
25760 _ = v_0.Args[1]
25761 x := v_0.Args[0]
25762 z := v_0.Args[1]
25763 if z.Op != OpARM64NEG {
25764 break
25765 }
25766 y := z.Args[0]
25767 if !(z.Uses == 1) {
25768 break
25769 }
25770 v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
25771 v0.AddArg2(x, y)
25772 b.resetWithControl(BlockARM64NE, v0)
25773 return true
25774 }
25775
25776
25777
25778 for b.Controls[0].Op == OpARM64CMPW {
25779 v_0 := b.Controls[0]
25780 _ = v_0.Args[1]
25781 x := v_0.Args[0]
25782 z := v_0.Args[1]
25783 if z.Op != OpARM64NEG {
25784 break
25785 }
25786 y := z.Args[0]
25787 if !(z.Uses == 1) {
25788 break
25789 }
25790 v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
25791 v0.AddArg2(x, y)
25792 b.resetWithControl(BlockARM64NE, v0)
25793 return true
25794 }
25795
25796
25797 for b.Controls[0].Op == OpARM64CMPconst {
25798 v_0 := b.Controls[0]
25799 if auxIntToInt64(v_0.AuxInt) != 0 {
25800 break
25801 }
25802 x := v_0.Args[0]
25803 b.resetWithControl(BlockARM64NZ, x)
25804 return true
25805 }
25806
25807
25808 for b.Controls[0].Op == OpARM64CMPWconst {
25809 v_0 := b.Controls[0]
25810 if auxIntToInt32(v_0.AuxInt) != 0 {
25811 break
25812 }
25813 x := v_0.Args[0]
25814 b.resetWithControl(BlockARM64NZW, x)
25815 return true
25816 }
25817
25818
25819
25820 for b.Controls[0].Op == OpARM64CMPconst {
25821 v_0 := b.Controls[0]
25822 if auxIntToInt64(v_0.AuxInt) != 0 {
25823 break
25824 }
25825 z := v_0.Args[0]
25826 if z.Op != OpARM64MADD {
25827 break
25828 }
25829 y := z.Args[2]
25830 a := z.Args[0]
25831 x := z.Args[1]
25832 if !(z.Uses == 1) {
25833 break
25834 }
25835 v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
25836 v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
25837 v1.AddArg2(x, y)
25838 v0.AddArg2(a, v1)
25839 b.resetWithControl(BlockARM64NE, v0)
25840 return true
25841 }
25842
25843
25844
25845 for b.Controls[0].Op == OpARM64CMPconst {
25846 v_0 := b.Controls[0]
25847 if auxIntToInt64(v_0.AuxInt) != 0 {
25848 break
25849 }
25850 z := v_0.Args[0]
25851 if z.Op != OpARM64MSUB {
25852 break
25853 }
25854 y := z.Args[2]
25855 a := z.Args[0]
25856 x := z.Args[1]
25857 if !(z.Uses == 1) {
25858 break
25859 }
25860 v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
25861 v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
25862 v1.AddArg2(x, y)
25863 v0.AddArg2(a, v1)
25864 b.resetWithControl(BlockARM64NE, v0)
25865 return true
25866 }
25867
25868
25869
25870 for b.Controls[0].Op == OpARM64CMPWconst {
25871 v_0 := b.Controls[0]
25872 if auxIntToInt32(v_0.AuxInt) != 0 {
25873 break
25874 }
25875 z := v_0.Args[0]
25876 if z.Op != OpARM64MADDW {
25877 break
25878 }
25879 y := z.Args[2]
25880 a := z.Args[0]
25881 x := z.Args[1]
25882 if !(z.Uses == 1) {
25883 break
25884 }
25885 v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
25886 v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
25887 v1.AddArg2(x, y)
25888 v0.AddArg2(a, v1)
25889 b.resetWithControl(BlockARM64NE, v0)
25890 return true
25891 }
25892
25893
25894
25895 for b.Controls[0].Op == OpARM64CMPWconst {
25896 v_0 := b.Controls[0]
25897 if auxIntToInt32(v_0.AuxInt) != 0 {
25898 break
25899 }
25900 z := v_0.Args[0]
25901 if z.Op != OpARM64MSUBW {
25902 break
25903 }
25904 y := z.Args[2]
25905 a := z.Args[0]
25906 x := z.Args[1]
25907 if !(z.Uses == 1) {
25908 break
25909 }
25910 v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
25911 v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
25912 v1.AddArg2(x, y)
25913 v0.AddArg2(a, v1)
25914 b.resetWithControl(BlockARM64NE, v0)
25915 return true
25916 }
25917
25918
25919
25920 for b.Controls[0].Op == OpARM64TSTconst {
25921 v_0 := b.Controls[0]
25922 c := auxIntToInt64(v_0.AuxInt)
25923 x := v_0.Args[0]
25924 if !(oneBit(c)) {
25925 break
25926 }
25927 b.resetWithControl(BlockARM64TBNZ, x)
25928 b.AuxInt = int64ToAuxInt(int64(ntz64(c)))
25929 return true
25930 }
25931
25932
25933
25934 for b.Controls[0].Op == OpARM64TSTWconst {
25935 v_0 := b.Controls[0]
25936 c := auxIntToInt32(v_0.AuxInt)
25937 x := v_0.Args[0]
25938 if !(oneBit(int64(uint32(c)))) {
25939 break
25940 }
25941 b.resetWithControl(BlockARM64TBNZ, x)
25942 b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c)))))
25943 return true
25944 }
25945
25946
25947
25948 for b.Controls[0].Op == OpARM64FlagConstant {
25949 v_0 := b.Controls[0]
25950 fc := auxIntToFlagConstant(v_0.AuxInt)
25951 if !(fc.ne()) {
25952 break
25953 }
25954 b.Reset(BlockFirst)
25955 return true
25956 }
25957
25958
25959
25960 for b.Controls[0].Op == OpARM64FlagConstant {
25961 v_0 := b.Controls[0]
25962 fc := auxIntToFlagConstant(v_0.AuxInt)
25963 if !(!fc.ne()) {
25964 break
25965 }
25966 b.Reset(BlockFirst)
25967 b.swapSuccessors()
25968 return true
25969 }
25970
25971
25972 for b.Controls[0].Op == OpARM64InvertFlags {
25973 v_0 := b.Controls[0]
25974 cmp := v_0.Args[0]
25975 b.resetWithControl(BlockARM64NE, cmp)
25976 return true
25977 }
25978 case BlockARM64NZ:
25979
25980
25981 for b.Controls[0].Op == OpARM64Equal {
25982 v_0 := b.Controls[0]
25983 cc := v_0.Args[0]
25984 b.resetWithControl(BlockARM64EQ, cc)
25985 return true
25986 }
25987
25988
25989 for b.Controls[0].Op == OpARM64NotEqual {
25990 v_0 := b.Controls[0]
25991 cc := v_0.Args[0]
25992 b.resetWithControl(BlockARM64NE, cc)
25993 return true
25994 }
25995
25996
25997 for b.Controls[0].Op == OpARM64LessThan {
25998 v_0 := b.Controls[0]
25999 cc := v_0.Args[0]
26000 b.resetWithControl(BlockARM64LT, cc)
26001 return true
26002 }
26003
26004
26005 for b.Controls[0].Op == OpARM64LessThanU {
26006 v_0 := b.Controls[0]
26007 cc := v_0.Args[0]
26008 b.resetWithControl(BlockARM64ULT, cc)
26009 return true
26010 }
26011
26012
26013 for b.Controls[0].Op == OpARM64LessEqual {
26014 v_0 := b.Controls[0]
26015 cc := v_0.Args[0]
26016 b.resetWithControl(BlockARM64LE, cc)
26017 return true
26018 }
26019
26020
26021 for b.Controls[0].Op == OpARM64LessEqualU {
26022 v_0 := b.Controls[0]
26023 cc := v_0.Args[0]
26024 b.resetWithControl(BlockARM64ULE, cc)
26025 return true
26026 }
26027
26028
26029 for b.Controls[0].Op == OpARM64GreaterThan {
26030 v_0 := b.Controls[0]
26031 cc := v_0.Args[0]
26032 b.resetWithControl(BlockARM64GT, cc)
26033 return true
26034 }
26035
26036
26037 for b.Controls[0].Op == OpARM64GreaterThanU {
26038 v_0 := b.Controls[0]
26039 cc := v_0.Args[0]
26040 b.resetWithControl(BlockARM64UGT, cc)
26041 return true
26042 }
26043
26044
26045 for b.Controls[0].Op == OpARM64GreaterEqual {
26046 v_0 := b.Controls[0]
26047 cc := v_0.Args[0]
26048 b.resetWithControl(BlockARM64GE, cc)
26049 return true
26050 }
26051
26052
26053 for b.Controls[0].Op == OpARM64GreaterEqualU {
26054 v_0 := b.Controls[0]
26055 cc := v_0.Args[0]
26056 b.resetWithControl(BlockARM64UGE, cc)
26057 return true
26058 }
26059
26060
26061 for b.Controls[0].Op == OpARM64LessThanF {
26062 v_0 := b.Controls[0]
26063 cc := v_0.Args[0]
26064 b.resetWithControl(BlockARM64FLT, cc)
26065 return true
26066 }
26067
26068
26069 for b.Controls[0].Op == OpARM64LessEqualF {
26070 v_0 := b.Controls[0]
26071 cc := v_0.Args[0]
26072 b.resetWithControl(BlockARM64FLE, cc)
26073 return true
26074 }
26075
26076
26077 for b.Controls[0].Op == OpARM64GreaterThanF {
26078 v_0 := b.Controls[0]
26079 cc := v_0.Args[0]
26080 b.resetWithControl(BlockARM64FGT, cc)
26081 return true
26082 }
26083
26084
26085 for b.Controls[0].Op == OpARM64GreaterEqualF {
26086 v_0 := b.Controls[0]
26087 cc := v_0.Args[0]
26088 b.resetWithControl(BlockARM64FGE, cc)
26089 return true
26090 }
26091
26092
26093
26094 for b.Controls[0].Op == OpARM64ANDconst {
26095 v_0 := b.Controls[0]
26096 c := auxIntToInt64(v_0.AuxInt)
26097 x := v_0.Args[0]
26098 if !(oneBit(c)) {
26099 break
26100 }
26101 b.resetWithControl(BlockARM64TBNZ, x)
26102 b.AuxInt = int64ToAuxInt(int64(ntz64(c)))
26103 return true
26104 }
26105
26106
26107 for b.Controls[0].Op == OpARM64MOVDconst {
26108 v_0 := b.Controls[0]
26109 if auxIntToInt64(v_0.AuxInt) != 0 {
26110 break
26111 }
26112 b.Reset(BlockFirst)
26113 b.swapSuccessors()
26114 return true
26115 }
26116
26117
26118
26119 for b.Controls[0].Op == OpARM64MOVDconst {
26120 v_0 := b.Controls[0]
26121 c := auxIntToInt64(v_0.AuxInt)
26122 if !(c != 0) {
26123 break
26124 }
26125 b.Reset(BlockFirst)
26126 return true
26127 }
26128 case BlockARM64NZW:
26129
26130
26131
26132 for b.Controls[0].Op == OpARM64ANDconst {
26133 v_0 := b.Controls[0]
26134 c := auxIntToInt64(v_0.AuxInt)
26135 x := v_0.Args[0]
26136 if !(oneBit(int64(uint32(c)))) {
26137 break
26138 }
26139 b.resetWithControl(BlockARM64TBNZ, x)
26140 b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c)))))
26141 return true
26142 }
26143
26144
26145
26146 for b.Controls[0].Op == OpARM64MOVDconst {
26147 v_0 := b.Controls[0]
26148 c := auxIntToInt64(v_0.AuxInt)
26149 if !(int32(c) == 0) {
26150 break
26151 }
26152 b.Reset(BlockFirst)
26153 b.swapSuccessors()
26154 return true
26155 }
26156
26157
26158
26159 for b.Controls[0].Op == OpARM64MOVDconst {
26160 v_0 := b.Controls[0]
26161 c := auxIntToInt64(v_0.AuxInt)
26162 if !(int32(c) != 0) {
26163 break
26164 }
26165 b.Reset(BlockFirst)
26166 return true
26167 }
26168 case BlockARM64TBNZ:
26169
26170
26171 for b.Controls[0].Op == OpARM64Equal {
26172 v_0 := b.Controls[0]
26173 cc := v_0.Args[0]
26174 if auxIntToInt64(b.AuxInt) != 0 {
26175 break
26176 }
26177 b.resetWithControl(BlockARM64EQ, cc)
26178 return true
26179 }
26180
26181
26182 for b.Controls[0].Op == OpARM64NotEqual {
26183 v_0 := b.Controls[0]
26184 cc := v_0.Args[0]
26185 if auxIntToInt64(b.AuxInt) != 0 {
26186 break
26187 }
26188 b.resetWithControl(BlockARM64NE, cc)
26189 return true
26190 }
26191
26192
26193 for b.Controls[0].Op == OpARM64LessThan {
26194 v_0 := b.Controls[0]
26195 cc := v_0.Args[0]
26196 if auxIntToInt64(b.AuxInt) != 0 {
26197 break
26198 }
26199 b.resetWithControl(BlockARM64LT, cc)
26200 return true
26201 }
26202
26203
26204 for b.Controls[0].Op == OpARM64LessThanU {
26205 v_0 := b.Controls[0]
26206 cc := v_0.Args[0]
26207 if auxIntToInt64(b.AuxInt) != 0 {
26208 break
26209 }
26210 b.resetWithControl(BlockARM64ULT, cc)
26211 return true
26212 }
26213
26214
26215 for b.Controls[0].Op == OpARM64LessEqual {
26216 v_0 := b.Controls[0]
26217 cc := v_0.Args[0]
26218 if auxIntToInt64(b.AuxInt) != 0 {
26219 break
26220 }
26221 b.resetWithControl(BlockARM64LE, cc)
26222 return true
26223 }
26224
26225
26226 for b.Controls[0].Op == OpARM64LessEqualU {
26227 v_0 := b.Controls[0]
26228 cc := v_0.Args[0]
26229 if auxIntToInt64(b.AuxInt) != 0 {
26230 break
26231 }
26232 b.resetWithControl(BlockARM64ULE, cc)
26233 return true
26234 }
26235
26236
26237 for b.Controls[0].Op == OpARM64GreaterThan {
26238 v_0 := b.Controls[0]
26239 cc := v_0.Args[0]
26240 if auxIntToInt64(b.AuxInt) != 0 {
26241 break
26242 }
26243 b.resetWithControl(BlockARM64GT, cc)
26244 return true
26245 }
26246
26247
26248 for b.Controls[0].Op == OpARM64GreaterThanU {
26249 v_0 := b.Controls[0]
26250 cc := v_0.Args[0]
26251 if auxIntToInt64(b.AuxInt) != 0 {
26252 break
26253 }
26254 b.resetWithControl(BlockARM64UGT, cc)
26255 return true
26256 }
26257
26258
26259 for b.Controls[0].Op == OpARM64GreaterEqual {
26260 v_0 := b.Controls[0]
26261 cc := v_0.Args[0]
26262 if auxIntToInt64(b.AuxInt) != 0 {
26263 break
26264 }
26265 b.resetWithControl(BlockARM64GE, cc)
26266 return true
26267 }
26268
26269
26270 for b.Controls[0].Op == OpARM64GreaterEqualU {
26271 v_0 := b.Controls[0]
26272 cc := v_0.Args[0]
26273 if auxIntToInt64(b.AuxInt) != 0 {
26274 break
26275 }
26276 b.resetWithControl(BlockARM64UGE, cc)
26277 return true
26278 }
26279
26280
26281 for b.Controls[0].Op == OpARM64LessThanF {
26282 v_0 := b.Controls[0]
26283 cc := v_0.Args[0]
26284 if auxIntToInt64(b.AuxInt) != 0 {
26285 break
26286 }
26287 b.resetWithControl(BlockARM64FLT, cc)
26288 return true
26289 }
26290
26291
26292 for b.Controls[0].Op == OpARM64LessEqualF {
26293 v_0 := b.Controls[0]
26294 cc := v_0.Args[0]
26295 if auxIntToInt64(b.AuxInt) != 0 {
26296 break
26297 }
26298 b.resetWithControl(BlockARM64FLE, cc)
26299 return true
26300 }
26301
26302
26303 for b.Controls[0].Op == OpARM64GreaterThanF {
26304 v_0 := b.Controls[0]
26305 cc := v_0.Args[0]
26306 if auxIntToInt64(b.AuxInt) != 0 {
26307 break
26308 }
26309 b.resetWithControl(BlockARM64FGT, cc)
26310 return true
26311 }
26312
26313
26314 for b.Controls[0].Op == OpARM64GreaterEqualF {
26315 v_0 := b.Controls[0]
26316 cc := v_0.Args[0]
26317 if auxIntToInt64(b.AuxInt) != 0 {
26318 break
26319 }
26320 b.resetWithControl(BlockARM64FGE, cc)
26321 return true
26322 }
26323 case BlockARM64UGE:
26324
26325
26326
26327 for b.Controls[0].Op == OpARM64FlagConstant {
26328 v_0 := b.Controls[0]
26329 fc := auxIntToFlagConstant(v_0.AuxInt)
26330 if !(fc.uge()) {
26331 break
26332 }
26333 b.Reset(BlockFirst)
26334 return true
26335 }
26336
26337
26338
26339 for b.Controls[0].Op == OpARM64FlagConstant {
26340 v_0 := b.Controls[0]
26341 fc := auxIntToFlagConstant(v_0.AuxInt)
26342 if !(!fc.uge()) {
26343 break
26344 }
26345 b.Reset(BlockFirst)
26346 b.swapSuccessors()
26347 return true
26348 }
26349
26350
26351 for b.Controls[0].Op == OpARM64InvertFlags {
26352 v_0 := b.Controls[0]
26353 cmp := v_0.Args[0]
26354 b.resetWithControl(BlockARM64ULE, cmp)
26355 return true
26356 }
26357 case BlockARM64UGT:
26358
26359
26360
26361 for b.Controls[0].Op == OpARM64FlagConstant {
26362 v_0 := b.Controls[0]
26363 fc := auxIntToFlagConstant(v_0.AuxInt)
26364 if !(fc.ugt()) {
26365 break
26366 }
26367 b.Reset(BlockFirst)
26368 return true
26369 }
26370
26371
26372
26373 for b.Controls[0].Op == OpARM64FlagConstant {
26374 v_0 := b.Controls[0]
26375 fc := auxIntToFlagConstant(v_0.AuxInt)
26376 if !(!fc.ugt()) {
26377 break
26378 }
26379 b.Reset(BlockFirst)
26380 b.swapSuccessors()
26381 return true
26382 }
26383
26384
26385 for b.Controls[0].Op == OpARM64InvertFlags {
26386 v_0 := b.Controls[0]
26387 cmp := v_0.Args[0]
26388 b.resetWithControl(BlockARM64ULT, cmp)
26389 return true
26390 }
26391 case BlockARM64ULE:
26392
26393
26394
26395 for b.Controls[0].Op == OpARM64FlagConstant {
26396 v_0 := b.Controls[0]
26397 fc := auxIntToFlagConstant(v_0.AuxInt)
26398 if !(fc.ule()) {
26399 break
26400 }
26401 b.Reset(BlockFirst)
26402 return true
26403 }
26404
26405
26406
26407 for b.Controls[0].Op == OpARM64FlagConstant {
26408 v_0 := b.Controls[0]
26409 fc := auxIntToFlagConstant(v_0.AuxInt)
26410 if !(!fc.ule()) {
26411 break
26412 }
26413 b.Reset(BlockFirst)
26414 b.swapSuccessors()
26415 return true
26416 }
26417
26418
26419 for b.Controls[0].Op == OpARM64InvertFlags {
26420 v_0 := b.Controls[0]
26421 cmp := v_0.Args[0]
26422 b.resetWithControl(BlockARM64UGE, cmp)
26423 return true
26424 }
26425 case BlockARM64ULT:
26426
26427
26428
26429 for b.Controls[0].Op == OpARM64FlagConstant {
26430 v_0 := b.Controls[0]
26431 fc := auxIntToFlagConstant(v_0.AuxInt)
26432 if !(fc.ult()) {
26433 break
26434 }
26435 b.Reset(BlockFirst)
26436 return true
26437 }
26438
26439
26440
26441 for b.Controls[0].Op == OpARM64FlagConstant {
26442 v_0 := b.Controls[0]
26443 fc := auxIntToFlagConstant(v_0.AuxInt)
26444 if !(!fc.ult()) {
26445 break
26446 }
26447 b.Reset(BlockFirst)
26448 b.swapSuccessors()
26449 return true
26450 }
26451
26452
26453 for b.Controls[0].Op == OpARM64InvertFlags {
26454 v_0 := b.Controls[0]
26455 cmp := v_0.Args[0]
26456 b.resetWithControl(BlockARM64UGT, cmp)
26457 return true
26458 }
26459 case BlockARM64Z:
26460
26461
26462
26463 for b.Controls[0].Op == OpARM64ANDconst {
26464 v_0 := b.Controls[0]
26465 c := auxIntToInt64(v_0.AuxInt)
26466 x := v_0.Args[0]
26467 if !(oneBit(c)) {
26468 break
26469 }
26470 b.resetWithControl(BlockARM64TBZ, x)
26471 b.AuxInt = int64ToAuxInt(int64(ntz64(c)))
26472 return true
26473 }
26474
26475
26476 for b.Controls[0].Op == OpARM64MOVDconst {
26477 v_0 := b.Controls[0]
26478 if auxIntToInt64(v_0.AuxInt) != 0 {
26479 break
26480 }
26481 b.Reset(BlockFirst)
26482 return true
26483 }
26484
26485
26486
26487 for b.Controls[0].Op == OpARM64MOVDconst {
26488 v_0 := b.Controls[0]
26489 c := auxIntToInt64(v_0.AuxInt)
26490 if !(c != 0) {
26491 break
26492 }
26493 b.Reset(BlockFirst)
26494 b.swapSuccessors()
26495 return true
26496 }
26497 case BlockARM64ZW:
26498
26499
26500
26501 for b.Controls[0].Op == OpARM64ANDconst {
26502 v_0 := b.Controls[0]
26503 c := auxIntToInt64(v_0.AuxInt)
26504 x := v_0.Args[0]
26505 if !(oneBit(int64(uint32(c)))) {
26506 break
26507 }
26508 b.resetWithControl(BlockARM64TBZ, x)
26509 b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c)))))
26510 return true
26511 }
26512
26513
26514
26515 for b.Controls[0].Op == OpARM64MOVDconst {
26516 v_0 := b.Controls[0]
26517 c := auxIntToInt64(v_0.AuxInt)
26518 if !(int32(c) == 0) {
26519 break
26520 }
26521 b.Reset(BlockFirst)
26522 return true
26523 }
26524
26525
26526
26527 for b.Controls[0].Op == OpARM64MOVDconst {
26528 v_0 := b.Controls[0]
26529 c := auxIntToInt64(v_0.AuxInt)
26530 if !(int32(c) != 0) {
26531 break
26532 }
26533 b.Reset(BlockFirst)
26534 b.swapSuccessors()
26535 return true
26536 }
26537 }
26538 return false
26539 }
26540
View as plain text