1
2
3 package rewriteriscv64
4
5 import "internal/buildcfg"
6 import "math"
7 import "math/bits"
8 import "cmd/compile/internal/types"
9 import "cmd/compile/internal/ssa/block"
10 import "cmd/compile/internal/ssa/ssaop"
11 import "cmd/compile/internal/ssa"
12
13 func RewriteValue(v *ssa.Value) bool {
14 switch v.Op {
15 case ssaop.OpAbs:
16 v.Op = ssaop.OpRISCV64FABSD
17 return true
18 case ssaop.OpAdd16:
19 v.Op = ssaop.OpRISCV64ADD
20 return true
21 case ssaop.OpAdd32:
22 v.Op = ssaop.OpRISCV64ADD
23 return true
24 case ssaop.OpAdd32F:
25 v.Op = ssaop.OpRISCV64FADDS
26 return true
27 case ssaop.OpAdd64:
28 v.Op = ssaop.OpRISCV64ADD
29 return true
30 case ssaop.OpAdd64F:
31 v.Op = ssaop.OpRISCV64FADDD
32 return true
33 case ssaop.OpAdd8:
34 v.Op = ssaop.OpRISCV64ADD
35 return true
36 case ssaop.OpAddPtr:
37 v.Op = ssaop.OpRISCV64ADD
38 return true
39 case ssaop.OpAddr:
40 return rewriteValue_OpAddr(v)
41 case ssaop.OpAnd16:
42 v.Op = ssaop.OpRISCV64AND
43 return true
44 case ssaop.OpAnd32:
45 v.Op = ssaop.OpRISCV64AND
46 return true
47 case ssaop.OpAnd64:
48 v.Op = ssaop.OpRISCV64AND
49 return true
50 case ssaop.OpAnd8:
51 v.Op = ssaop.OpRISCV64AND
52 return true
53 case ssaop.OpAndB:
54 v.Op = ssaop.OpRISCV64AND
55 return true
56 case ssaop.OpAtomicAdd32:
57 v.Op = ssaop.OpRISCV64LoweredAtomicAdd32
58 return true
59 case ssaop.OpAtomicAdd64:
60 v.Op = ssaop.OpRISCV64LoweredAtomicAdd64
61 return true
62 case ssaop.OpAtomicAnd32:
63 v.Op = ssaop.OpRISCV64LoweredAtomicAnd32
64 return true
65 case ssaop.OpAtomicAnd32value:
66 v.Op = ssaop.OpRISCV64LoweredAtomicAnd32value
67 return true
68 case ssaop.OpAtomicAnd64value:
69 v.Op = ssaop.OpRISCV64LoweredAtomicAnd64value
70 return true
71 case ssaop.OpAtomicAnd8:
72 return rewriteValue_OpAtomicAnd8(v)
73 case ssaop.OpAtomicCompareAndSwap32:
74 return rewriteValue_OpAtomicCompareAndSwap32(v)
75 case ssaop.OpAtomicCompareAndSwap64:
76 v.Op = ssaop.OpRISCV64LoweredAtomicCas64
77 return true
78 case ssaop.OpAtomicExchange32:
79 v.Op = ssaop.OpRISCV64LoweredAtomicExchange32
80 return true
81 case ssaop.OpAtomicExchange64:
82 v.Op = ssaop.OpRISCV64LoweredAtomicExchange64
83 return true
84 case ssaop.OpAtomicLoad32:
85 v.Op = ssaop.OpRISCV64LoweredAtomicLoad32
86 return true
87 case ssaop.OpAtomicLoad64:
88 v.Op = ssaop.OpRISCV64LoweredAtomicLoad64
89 return true
90 case ssaop.OpAtomicLoad8:
91 v.Op = ssaop.OpRISCV64LoweredAtomicLoad8
92 return true
93 case ssaop.OpAtomicLoadPtr:
94 v.Op = ssaop.OpRISCV64LoweredAtomicLoad64
95 return true
96 case ssaop.OpAtomicOr32:
97 v.Op = ssaop.OpRISCV64LoweredAtomicOr32
98 return true
99 case ssaop.OpAtomicOr32value:
100 v.Op = ssaop.OpRISCV64LoweredAtomicOr32value
101 return true
102 case ssaop.OpAtomicOr64value:
103 v.Op = ssaop.OpRISCV64LoweredAtomicOr64value
104 return true
105 case ssaop.OpAtomicOr8:
106 return rewriteValue_OpAtomicOr8(v)
107 case ssaop.OpAtomicStore32:
108 v.Op = ssaop.OpRISCV64LoweredAtomicStore32
109 return true
110 case ssaop.OpAtomicStore64:
111 v.Op = ssaop.OpRISCV64LoweredAtomicStore64
112 return true
113 case ssaop.OpAtomicStore8:
114 v.Op = ssaop.OpRISCV64LoweredAtomicStore8
115 return true
116 case ssaop.OpAtomicStorePtrNoWB:
117 v.Op = ssaop.OpRISCV64LoweredAtomicStore64
118 return true
119 case ssaop.OpAvg64u:
120 return rewriteValue_OpAvg64u(v)
121 case ssaop.OpBitLen16:
122 return rewriteValue_OpBitLen16(v)
123 case ssaop.OpBitLen32:
124 return rewriteValue_OpBitLen32(v)
125 case ssaop.OpBitLen64:
126 return rewriteValue_OpBitLen64(v)
127 case ssaop.OpBitLen8:
128 return rewriteValue_OpBitLen8(v)
129 case ssaop.OpBswap16:
130 return rewriteValue_OpBswap16(v)
131 case ssaop.OpBswap32:
132 return rewriteValue_OpBswap32(v)
133 case ssaop.OpBswap64:
134 v.Op = ssaop.OpRISCV64REV8
135 return true
136 case ssaop.OpClosureCall:
137 v.Op = ssaop.OpRISCV64CALLclosure
138 return true
139 case ssaop.OpCom16:
140 v.Op = ssaop.OpRISCV64NOT
141 return true
142 case ssaop.OpCom32:
143 v.Op = ssaop.OpRISCV64NOT
144 return true
145 case ssaop.OpCom64:
146 v.Op = ssaop.OpRISCV64NOT
147 return true
148 case ssaop.OpCom8:
149 v.Op = ssaop.OpRISCV64NOT
150 return true
151 case ssaop.OpCondSelect:
152 return rewriteValue_OpCondSelect(v)
153 case ssaop.OpConst16:
154 return rewriteValue_OpConst16(v)
155 case ssaop.OpConst32:
156 return rewriteValue_OpConst32(v)
157 case ssaop.OpConst32F:
158 v.Op = ssaop.OpRISCV64FMOVFconst
159 return true
160 case ssaop.OpConst64:
161 return rewriteValue_OpConst64(v)
162 case ssaop.OpConst64F:
163 v.Op = ssaop.OpRISCV64FMOVDconst
164 return true
165 case ssaop.OpConst8:
166 return rewriteValue_OpConst8(v)
167 case ssaop.OpConstBool:
168 return rewriteValue_OpConstBool(v)
169 case ssaop.OpConstNil:
170 return rewriteValue_OpConstNil(v)
171 case ssaop.OpCopysign:
172 v.Op = ssaop.OpRISCV64FSGNJD
173 return true
174 case ssaop.OpCtz16:
175 return rewriteValue_OpCtz16(v)
176 case ssaop.OpCtz16NonZero:
177 v.Op = ssaop.OpCtz64
178 return true
179 case ssaop.OpCtz32:
180 v.Op = ssaop.OpRISCV64CTZW
181 return true
182 case ssaop.OpCtz32NonZero:
183 v.Op = ssaop.OpCtz64
184 return true
185 case ssaop.OpCtz64:
186 v.Op = ssaop.OpRISCV64CTZ
187 return true
188 case ssaop.OpCtz64NonZero:
189 v.Op = ssaop.OpCtz64
190 return true
191 case ssaop.OpCtz8:
192 return rewriteValue_OpCtz8(v)
193 case ssaop.OpCtz8NonZero:
194 v.Op = ssaop.OpCtz64
195 return true
196 case ssaop.OpCvt32Fto32:
197 v.Op = ssaop.OpRISCV64FCVTWS
198 return true
199 case ssaop.OpCvt32Fto64:
200 v.Op = ssaop.OpRISCV64FCVTLS
201 return true
202 case ssaop.OpCvt32Fto64F:
203 v.Op = ssaop.OpRISCV64FCVTDS
204 return true
205 case ssaop.OpCvt32to32F:
206 v.Op = ssaop.OpRISCV64FCVTSW
207 return true
208 case ssaop.OpCvt32to64F:
209 v.Op = ssaop.OpRISCV64FCVTDW
210 return true
211 case ssaop.OpCvt64Fto32:
212 v.Op = ssaop.OpRISCV64FCVTWD
213 return true
214 case ssaop.OpCvt64Fto32F:
215 v.Op = ssaop.OpRISCV64FCVTSD
216 return true
217 case ssaop.OpCvt64Fto64:
218 v.Op = ssaop.OpRISCV64FCVTLD
219 return true
220 case ssaop.OpCvt64to32F:
221 v.Op = ssaop.OpRISCV64FCVTSL
222 return true
223 case ssaop.OpCvt64to64F:
224 v.Op = ssaop.OpRISCV64FCVTDL
225 return true
226 case ssaop.OpCvtBoolToUint8:
227 v.Op = ssaop.OpCopy
228 return true
229 case ssaop.OpDiv16:
230 return rewriteValue_OpDiv16(v)
231 case ssaop.OpDiv16u:
232 return rewriteValue_OpDiv16u(v)
233 case ssaop.OpDiv32:
234 return rewriteValue_OpDiv32(v)
235 case ssaop.OpDiv32F:
236 v.Op = ssaop.OpRISCV64FDIVS
237 return true
238 case ssaop.OpDiv32u:
239 v.Op = ssaop.OpRISCV64DIVUW
240 return true
241 case ssaop.OpDiv64:
242 return rewriteValue_OpDiv64(v)
243 case ssaop.OpDiv64F:
244 v.Op = ssaop.OpRISCV64FDIVD
245 return true
246 case ssaop.OpDiv64u:
247 v.Op = ssaop.OpRISCV64DIVU
248 return true
249 case ssaop.OpDiv8:
250 return rewriteValue_OpDiv8(v)
251 case ssaop.OpDiv8u:
252 return rewriteValue_OpDiv8u(v)
253 case ssaop.OpEq16:
254 return rewriteValue_OpEq16(v)
255 case ssaop.OpEq32:
256 return rewriteValue_OpEq32(v)
257 case ssaop.OpEq32F:
258 v.Op = ssaop.OpRISCV64FEQS
259 return true
260 case ssaop.OpEq64:
261 return rewriteValue_OpEq64(v)
262 case ssaop.OpEq64F:
263 v.Op = ssaop.OpRISCV64FEQD
264 return true
265 case ssaop.OpEq8:
266 return rewriteValue_OpEq8(v)
267 case ssaop.OpEqB:
268 return rewriteValue_OpEqB(v)
269 case ssaop.OpEqPtr:
270 return rewriteValue_OpEqPtr(v)
271 case ssaop.OpFMA:
272 v.Op = ssaop.OpRISCV64FMADDD
273 return true
274 case ssaop.OpGetCallerPC:
275 v.Op = ssaop.OpRISCV64LoweredGetCallerPC
276 return true
277 case ssaop.OpGetCallerSP:
278 v.Op = ssaop.OpRISCV64LoweredGetCallerSP
279 return true
280 case ssaop.OpGetClosurePtr:
281 v.Op = ssaop.OpRISCV64LoweredGetClosurePtr
282 return true
283 case ssaop.OpHmul32:
284 return rewriteValue_OpHmul32(v)
285 case ssaop.OpHmul32u:
286 return rewriteValue_OpHmul32u(v)
287 case ssaop.OpHmul64:
288 v.Op = ssaop.OpRISCV64MULH
289 return true
290 case ssaop.OpHmul64u:
291 v.Op = ssaop.OpRISCV64MULHU
292 return true
293 case ssaop.OpInterCall:
294 v.Op = ssaop.OpRISCV64CALLinter
295 return true
296 case ssaop.OpIsInBounds:
297 v.Op = ssaop.OpLess64U
298 return true
299 case ssaop.OpIsNonNil:
300 v.Op = ssaop.OpRISCV64SNEZ
301 return true
302 case ssaop.OpIsSliceInBounds:
303 v.Op = ssaop.OpLeq64U
304 return true
305 case ssaop.OpLeq16:
306 return rewriteValue_OpLeq16(v)
307 case ssaop.OpLeq16U:
308 return rewriteValue_OpLeq16U(v)
309 case ssaop.OpLeq32:
310 return rewriteValue_OpLeq32(v)
311 case ssaop.OpLeq32F:
312 v.Op = ssaop.OpRISCV64FLES
313 return true
314 case ssaop.OpLeq32U:
315 return rewriteValue_OpLeq32U(v)
316 case ssaop.OpLeq64:
317 return rewriteValue_OpLeq64(v)
318 case ssaop.OpLeq64F:
319 v.Op = ssaop.OpRISCV64FLED
320 return true
321 case ssaop.OpLeq64U:
322 return rewriteValue_OpLeq64U(v)
323 case ssaop.OpLeq8:
324 return rewriteValue_OpLeq8(v)
325 case ssaop.OpLeq8U:
326 return rewriteValue_OpLeq8U(v)
327 case ssaop.OpLess16:
328 return rewriteValue_OpLess16(v)
329 case ssaop.OpLess16U:
330 return rewriteValue_OpLess16U(v)
331 case ssaop.OpLess32:
332 return rewriteValue_OpLess32(v)
333 case ssaop.OpLess32F:
334 v.Op = ssaop.OpRISCV64FLTS
335 return true
336 case ssaop.OpLess32U:
337 return rewriteValue_OpLess32U(v)
338 case ssaop.OpLess64:
339 v.Op = ssaop.OpRISCV64SLT
340 return true
341 case ssaop.OpLess64F:
342 v.Op = ssaop.OpRISCV64FLTD
343 return true
344 case ssaop.OpLess64U:
345 v.Op = ssaop.OpRISCV64SLTU
346 return true
347 case ssaop.OpLess8:
348 return rewriteValue_OpLess8(v)
349 case ssaop.OpLess8U:
350 return rewriteValue_OpLess8U(v)
351 case ssaop.OpLoad:
352 return rewriteValue_OpLoad(v)
353 case ssaop.OpLocalAddr:
354 return rewriteValue_OpLocalAddr(v)
355 case ssaop.OpLsh16x16:
356 return rewriteValue_OpLsh16x16(v)
357 case ssaop.OpLsh16x32:
358 return rewriteValue_OpLsh16x32(v)
359 case ssaop.OpLsh16x64:
360 return rewriteValue_OpLsh16x64(v)
361 case ssaop.OpLsh16x8:
362 return rewriteValue_OpLsh16x8(v)
363 case ssaop.OpLsh32x16:
364 return rewriteValue_OpLsh32x16(v)
365 case ssaop.OpLsh32x32:
366 return rewriteValue_OpLsh32x32(v)
367 case ssaop.OpLsh32x64:
368 return rewriteValue_OpLsh32x64(v)
369 case ssaop.OpLsh32x8:
370 return rewriteValue_OpLsh32x8(v)
371 case ssaop.OpLsh64x16:
372 return rewriteValue_OpLsh64x16(v)
373 case ssaop.OpLsh64x32:
374 return rewriteValue_OpLsh64x32(v)
375 case ssaop.OpLsh64x64:
376 return rewriteValue_OpLsh64x64(v)
377 case ssaop.OpLsh64x8:
378 return rewriteValue_OpLsh64x8(v)
379 case ssaop.OpLsh8x16:
380 return rewriteValue_OpLsh8x16(v)
381 case ssaop.OpLsh8x32:
382 return rewriteValue_OpLsh8x32(v)
383 case ssaop.OpLsh8x64:
384 return rewriteValue_OpLsh8x64(v)
385 case ssaop.OpLsh8x8:
386 return rewriteValue_OpLsh8x8(v)
387 case ssaop.OpMax32F:
388 v.Op = ssaop.OpRISCV64LoweredFMAXS
389 return true
390 case ssaop.OpMax64:
391 return rewriteValue_OpMax64(v)
392 case ssaop.OpMax64F:
393 v.Op = ssaop.OpRISCV64LoweredFMAXD
394 return true
395 case ssaop.OpMax64u:
396 return rewriteValue_OpMax64u(v)
397 case ssaop.OpMin32F:
398 v.Op = ssaop.OpRISCV64LoweredFMINS
399 return true
400 case ssaop.OpMin64:
401 return rewriteValue_OpMin64(v)
402 case ssaop.OpMin64F:
403 v.Op = ssaop.OpRISCV64LoweredFMIND
404 return true
405 case ssaop.OpMin64u:
406 return rewriteValue_OpMin64u(v)
407 case ssaop.OpMod16:
408 return rewriteValue_OpMod16(v)
409 case ssaop.OpMod16u:
410 return rewriteValue_OpMod16u(v)
411 case ssaop.OpMod32:
412 return rewriteValue_OpMod32(v)
413 case ssaop.OpMod32u:
414 v.Op = ssaop.OpRISCV64REMUW
415 return true
416 case ssaop.OpMod64:
417 return rewriteValue_OpMod64(v)
418 case ssaop.OpMod64u:
419 v.Op = ssaop.OpRISCV64REMU
420 return true
421 case ssaop.OpMod8:
422 return rewriteValue_OpMod8(v)
423 case ssaop.OpMod8u:
424 return rewriteValue_OpMod8u(v)
425 case ssaop.OpMove:
426 return rewriteValue_OpMove(v)
427 case ssaop.OpMul16:
428 v.Op = ssaop.OpRISCV64MULW
429 return true
430 case ssaop.OpMul32:
431 v.Op = ssaop.OpRISCV64MULW
432 return true
433 case ssaop.OpMul32F:
434 v.Op = ssaop.OpRISCV64FMULS
435 return true
436 case ssaop.OpMul64:
437 v.Op = ssaop.OpRISCV64MUL
438 return true
439 case ssaop.OpMul64F:
440 v.Op = ssaop.OpRISCV64FMULD
441 return true
442 case ssaop.OpMul64uhilo:
443 v.Op = ssaop.OpRISCV64LoweredMuluhilo
444 return true
445 case ssaop.OpMul64uover:
446 v.Op = ssaop.OpRISCV64LoweredMuluover
447 return true
448 case ssaop.OpMul8:
449 v.Op = ssaop.OpRISCV64MULW
450 return true
451 case ssaop.OpNeg16:
452 v.Op = ssaop.OpRISCV64NEG
453 return true
454 case ssaop.OpNeg32:
455 v.Op = ssaop.OpRISCV64NEG
456 return true
457 case ssaop.OpNeg32F:
458 v.Op = ssaop.OpRISCV64FNEGS
459 return true
460 case ssaop.OpNeg64:
461 v.Op = ssaop.OpRISCV64NEG
462 return true
463 case ssaop.OpNeg64F:
464 v.Op = ssaop.OpRISCV64FNEGD
465 return true
466 case ssaop.OpNeg8:
467 v.Op = ssaop.OpRISCV64NEG
468 return true
469 case ssaop.OpNeq16:
470 return rewriteValue_OpNeq16(v)
471 case ssaop.OpNeq32:
472 return rewriteValue_OpNeq32(v)
473 case ssaop.OpNeq32F:
474 v.Op = ssaop.OpRISCV64FNES
475 return true
476 case ssaop.OpNeq64:
477 return rewriteValue_OpNeq64(v)
478 case ssaop.OpNeq64F:
479 v.Op = ssaop.OpRISCV64FNED
480 return true
481 case ssaop.OpNeq8:
482 return rewriteValue_OpNeq8(v)
483 case ssaop.OpNeqB:
484 return rewriteValue_OpNeqB(v)
485 case ssaop.OpNeqPtr:
486 return rewriteValue_OpNeqPtr(v)
487 case ssaop.OpNilCheck:
488 v.Op = ssaop.OpRISCV64LoweredNilCheck
489 return true
490 case ssaop.OpNot:
491 v.Op = ssaop.OpRISCV64SEQZ
492 return true
493 case ssaop.OpOffPtr:
494 return rewriteValue_OpOffPtr(v)
495 case ssaop.OpOr16:
496 v.Op = ssaop.OpRISCV64OR
497 return true
498 case ssaop.OpOr32:
499 v.Op = ssaop.OpRISCV64OR
500 return true
501 case ssaop.OpOr64:
502 v.Op = ssaop.OpRISCV64OR
503 return true
504 case ssaop.OpOr8:
505 v.Op = ssaop.OpRISCV64OR
506 return true
507 case ssaop.OpOrB:
508 v.Op = ssaop.OpRISCV64OR
509 return true
510 case ssaop.OpPanicBounds:
511 v.Op = ssaop.OpRISCV64LoweredPanicBoundsRR
512 return true
513 case ssaop.OpPopCount16:
514 return rewriteValue_OpPopCount16(v)
515 case ssaop.OpPopCount32:
516 v.Op = ssaop.OpRISCV64CPOPW
517 return true
518 case ssaop.OpPopCount64:
519 v.Op = ssaop.OpRISCV64CPOP
520 return true
521 case ssaop.OpPopCount8:
522 return rewriteValue_OpPopCount8(v)
523 case ssaop.OpPubBarrier:
524 v.Op = ssaop.OpRISCV64LoweredPubBarrier
525 return true
526 case ssaop.OpRISCV64ADD:
527 return rewriteValue_OpRISCV64ADD(v)
528 case ssaop.OpRISCV64ADDI:
529 return rewriteValue_OpRISCV64ADDI(v)
530 case ssaop.OpRISCV64AND:
531 return rewriteValue_OpRISCV64AND(v)
532 case ssaop.OpRISCV64ANDI:
533 return rewriteValue_OpRISCV64ANDI(v)
534 case ssaop.OpRISCV64CZEROEQZ:
535 return rewriteValue_OpRISCV64CZEROEQZ(v)
536 case ssaop.OpRISCV64CZERONEZ:
537 return rewriteValue_OpRISCV64CZERONEZ(v)
538 case ssaop.OpRISCV64FADDD:
539 return rewriteValue_OpRISCV64FADDD(v)
540 case ssaop.OpRISCV64FADDS:
541 return rewriteValue_OpRISCV64FADDS(v)
542 case ssaop.OpRISCV64FCVTSD:
543 return rewriteValue_OpRISCV64FCVTSD(v)
544 case ssaop.OpRISCV64FEQD:
545 return rewriteValue_OpRISCV64FEQD(v)
546 case ssaop.OpRISCV64FLED:
547 return rewriteValue_OpRISCV64FLED(v)
548 case ssaop.OpRISCV64FLTD:
549 return rewriteValue_OpRISCV64FLTD(v)
550 case ssaop.OpRISCV64FMADDD:
551 return rewriteValue_OpRISCV64FMADDD(v)
552 case ssaop.OpRISCV64FMADDS:
553 return rewriteValue_OpRISCV64FMADDS(v)
554 case ssaop.OpRISCV64FMOVDload:
555 return rewriteValue_OpRISCV64FMOVDload(v)
556 case ssaop.OpRISCV64FMOVDstore:
557 return rewriteValue_OpRISCV64FMOVDstore(v)
558 case ssaop.OpRISCV64FMOVWload:
559 return rewriteValue_OpRISCV64FMOVWload(v)
560 case ssaop.OpRISCV64FMOVWstore:
561 return rewriteValue_OpRISCV64FMOVWstore(v)
562 case ssaop.OpRISCV64FMSUBD:
563 return rewriteValue_OpRISCV64FMSUBD(v)
564 case ssaop.OpRISCV64FMSUBS:
565 return rewriteValue_OpRISCV64FMSUBS(v)
566 case ssaop.OpRISCV64FNED:
567 return rewriteValue_OpRISCV64FNED(v)
568 case ssaop.OpRISCV64FNMADDD:
569 return rewriteValue_OpRISCV64FNMADDD(v)
570 case ssaop.OpRISCV64FNMADDS:
571 return rewriteValue_OpRISCV64FNMADDS(v)
572 case ssaop.OpRISCV64FNMSUBD:
573 return rewriteValue_OpRISCV64FNMSUBD(v)
574 case ssaop.OpRISCV64FNMSUBS:
575 return rewriteValue_OpRISCV64FNMSUBS(v)
576 case ssaop.OpRISCV64FSUBD:
577 return rewriteValue_OpRISCV64FSUBD(v)
578 case ssaop.OpRISCV64FSUBS:
579 return rewriteValue_OpRISCV64FSUBS(v)
580 case ssaop.OpRISCV64LoweredPanicBoundsCR:
581 return rewriteValue_OpRISCV64LoweredPanicBoundsCR(v)
582 case ssaop.OpRISCV64LoweredPanicBoundsRC:
583 return rewriteValue_OpRISCV64LoweredPanicBoundsRC(v)
584 case ssaop.OpRISCV64LoweredPanicBoundsRR:
585 return rewriteValue_OpRISCV64LoweredPanicBoundsRR(v)
586 case ssaop.OpRISCV64MOVBUload:
587 return rewriteValue_OpRISCV64MOVBUload(v)
588 case ssaop.OpRISCV64MOVBUreg:
589 return rewriteValue_OpRISCV64MOVBUreg(v)
590 case ssaop.OpRISCV64MOVBload:
591 return rewriteValue_OpRISCV64MOVBload(v)
592 case ssaop.OpRISCV64MOVBreg:
593 return rewriteValue_OpRISCV64MOVBreg(v)
594 case ssaop.OpRISCV64MOVBstore:
595 return rewriteValue_OpRISCV64MOVBstore(v)
596 case ssaop.OpRISCV64MOVBstorezero:
597 return rewriteValue_OpRISCV64MOVBstorezero(v)
598 case ssaop.OpRISCV64MOVDload:
599 return rewriteValue_OpRISCV64MOVDload(v)
600 case ssaop.OpRISCV64MOVDnop:
601 return rewriteValue_OpRISCV64MOVDnop(v)
602 case ssaop.OpRISCV64MOVDreg:
603 return rewriteValue_OpRISCV64MOVDreg(v)
604 case ssaop.OpRISCV64MOVDstore:
605 return rewriteValue_OpRISCV64MOVDstore(v)
606 case ssaop.OpRISCV64MOVDstorezero:
607 return rewriteValue_OpRISCV64MOVDstorezero(v)
608 case ssaop.OpRISCV64MOVHUload:
609 return rewriteValue_OpRISCV64MOVHUload(v)
610 case ssaop.OpRISCV64MOVHUreg:
611 return rewriteValue_OpRISCV64MOVHUreg(v)
612 case ssaop.OpRISCV64MOVHload:
613 return rewriteValue_OpRISCV64MOVHload(v)
614 case ssaop.OpRISCV64MOVHreg:
615 return rewriteValue_OpRISCV64MOVHreg(v)
616 case ssaop.OpRISCV64MOVHstore:
617 return rewriteValue_OpRISCV64MOVHstore(v)
618 case ssaop.OpRISCV64MOVHstorezero:
619 return rewriteValue_OpRISCV64MOVHstorezero(v)
620 case ssaop.OpRISCV64MOVWUload:
621 return rewriteValue_OpRISCV64MOVWUload(v)
622 case ssaop.OpRISCV64MOVWUreg:
623 return rewriteValue_OpRISCV64MOVWUreg(v)
624 case ssaop.OpRISCV64MOVWload:
625 return rewriteValue_OpRISCV64MOVWload(v)
626 case ssaop.OpRISCV64MOVWreg:
627 return rewriteValue_OpRISCV64MOVWreg(v)
628 case ssaop.OpRISCV64MOVWstore:
629 return rewriteValue_OpRISCV64MOVWstore(v)
630 case ssaop.OpRISCV64MOVWstorezero:
631 return rewriteValue_OpRISCV64MOVWstorezero(v)
632 case ssaop.OpRISCV64MUL:
633 return rewriteValue_OpRISCV64MUL(v)
634 case ssaop.OpRISCV64MULW:
635 return rewriteValue_OpRISCV64MULW(v)
636 case ssaop.OpRISCV64NEG:
637 return rewriteValue_OpRISCV64NEG(v)
638 case ssaop.OpRISCV64NEGW:
639 return rewriteValue_OpRISCV64NEGW(v)
640 case ssaop.OpRISCV64OR:
641 return rewriteValue_OpRISCV64OR(v)
642 case ssaop.OpRISCV64ORI:
643 return rewriteValue_OpRISCV64ORI(v)
644 case ssaop.OpRISCV64ORN:
645 return rewriteValue_OpRISCV64ORN(v)
646 case ssaop.OpRISCV64ROL:
647 return rewriteValue_OpRISCV64ROL(v)
648 case ssaop.OpRISCV64ROLW:
649 return rewriteValue_OpRISCV64ROLW(v)
650 case ssaop.OpRISCV64ROR:
651 return rewriteValue_OpRISCV64ROR(v)
652 case ssaop.OpRISCV64RORW:
653 return rewriteValue_OpRISCV64RORW(v)
654 case ssaop.OpRISCV64SEQZ:
655 return rewriteValue_OpRISCV64SEQZ(v)
656 case ssaop.OpRISCV64SLL:
657 return rewriteValue_OpRISCV64SLL(v)
658 case ssaop.OpRISCV64SLLI:
659 return rewriteValue_OpRISCV64SLLI(v)
660 case ssaop.OpRISCV64SLLW:
661 return rewriteValue_OpRISCV64SLLW(v)
662 case ssaop.OpRISCV64SLT:
663 return rewriteValue_OpRISCV64SLT(v)
664 case ssaop.OpRISCV64SLTI:
665 return rewriteValue_OpRISCV64SLTI(v)
666 case ssaop.OpRISCV64SLTIU:
667 return rewriteValue_OpRISCV64SLTIU(v)
668 case ssaop.OpRISCV64SLTU:
669 return rewriteValue_OpRISCV64SLTU(v)
670 case ssaop.OpRISCV64SNEZ:
671 return rewriteValue_OpRISCV64SNEZ(v)
672 case ssaop.OpRISCV64SRA:
673 return rewriteValue_OpRISCV64SRA(v)
674 case ssaop.OpRISCV64SRAI:
675 return rewriteValue_OpRISCV64SRAI(v)
676 case ssaop.OpRISCV64SRAW:
677 return rewriteValue_OpRISCV64SRAW(v)
678 case ssaop.OpRISCV64SRL:
679 return rewriteValue_OpRISCV64SRL(v)
680 case ssaop.OpRISCV64SRLI:
681 return rewriteValue_OpRISCV64SRLI(v)
682 case ssaop.OpRISCV64SRLW:
683 return rewriteValue_OpRISCV64SRLW(v)
684 case ssaop.OpRISCV64SUB:
685 return rewriteValue_OpRISCV64SUB(v)
686 case ssaop.OpRISCV64SUBW:
687 return rewriteValue_OpRISCV64SUBW(v)
688 case ssaop.OpRISCV64XOR:
689 return rewriteValue_OpRISCV64XOR(v)
690 case ssaop.OpRotateLeft16:
691 return rewriteValue_OpRotateLeft16(v)
692 case ssaop.OpRotateLeft32:
693 v.Op = ssaop.OpRISCV64ROLW
694 return true
695 case ssaop.OpRotateLeft64:
696 v.Op = ssaop.OpRISCV64ROL
697 return true
698 case ssaop.OpRotateLeft8:
699 return rewriteValue_OpRotateLeft8(v)
700 case ssaop.OpRound32F:
701 v.Op = ssaop.OpRISCV64LoweredRound32F
702 return true
703 case ssaop.OpRound64F:
704 v.Op = ssaop.OpRISCV64LoweredRound64F
705 return true
706 case ssaop.OpRsh16Ux16:
707 return rewriteValue_OpRsh16Ux16(v)
708 case ssaop.OpRsh16Ux32:
709 return rewriteValue_OpRsh16Ux32(v)
710 case ssaop.OpRsh16Ux64:
711 return rewriteValue_OpRsh16Ux64(v)
712 case ssaop.OpRsh16Ux8:
713 return rewriteValue_OpRsh16Ux8(v)
714 case ssaop.OpRsh16x16:
715 return rewriteValue_OpRsh16x16(v)
716 case ssaop.OpRsh16x32:
717 return rewriteValue_OpRsh16x32(v)
718 case ssaop.OpRsh16x64:
719 return rewriteValue_OpRsh16x64(v)
720 case ssaop.OpRsh16x8:
721 return rewriteValue_OpRsh16x8(v)
722 case ssaop.OpRsh32Ux16:
723 return rewriteValue_OpRsh32Ux16(v)
724 case ssaop.OpRsh32Ux32:
725 return rewriteValue_OpRsh32Ux32(v)
726 case ssaop.OpRsh32Ux64:
727 return rewriteValue_OpRsh32Ux64(v)
728 case ssaop.OpRsh32Ux8:
729 return rewriteValue_OpRsh32Ux8(v)
730 case ssaop.OpRsh32x16:
731 return rewriteValue_OpRsh32x16(v)
732 case ssaop.OpRsh32x32:
733 return rewriteValue_OpRsh32x32(v)
734 case ssaop.OpRsh32x64:
735 return rewriteValue_OpRsh32x64(v)
736 case ssaop.OpRsh32x8:
737 return rewriteValue_OpRsh32x8(v)
738 case ssaop.OpRsh64Ux16:
739 return rewriteValue_OpRsh64Ux16(v)
740 case ssaop.OpRsh64Ux32:
741 return rewriteValue_OpRsh64Ux32(v)
742 case ssaop.OpRsh64Ux64:
743 return rewriteValue_OpRsh64Ux64(v)
744 case ssaop.OpRsh64Ux8:
745 return rewriteValue_OpRsh64Ux8(v)
746 case ssaop.OpRsh64x16:
747 return rewriteValue_OpRsh64x16(v)
748 case ssaop.OpRsh64x32:
749 return rewriteValue_OpRsh64x32(v)
750 case ssaop.OpRsh64x64:
751 return rewriteValue_OpRsh64x64(v)
752 case ssaop.OpRsh64x8:
753 return rewriteValue_OpRsh64x8(v)
754 case ssaop.OpRsh8Ux16:
755 return rewriteValue_OpRsh8Ux16(v)
756 case ssaop.OpRsh8Ux32:
757 return rewriteValue_OpRsh8Ux32(v)
758 case ssaop.OpRsh8Ux64:
759 return rewriteValue_OpRsh8Ux64(v)
760 case ssaop.OpRsh8Ux8:
761 return rewriteValue_OpRsh8Ux8(v)
762 case ssaop.OpRsh8x16:
763 return rewriteValue_OpRsh8x16(v)
764 case ssaop.OpRsh8x32:
765 return rewriteValue_OpRsh8x32(v)
766 case ssaop.OpRsh8x64:
767 return rewriteValue_OpRsh8x64(v)
768 case ssaop.OpRsh8x8:
769 return rewriteValue_OpRsh8x8(v)
770 case ssaop.OpSelect0:
771 return rewriteValue_OpSelect0(v)
772 case ssaop.OpSelect1:
773 return rewriteValue_OpSelect1(v)
774 case ssaop.OpSignExt16to32:
775 v.Op = ssaop.OpRISCV64MOVHreg
776 return true
777 case ssaop.OpSignExt16to64:
778 v.Op = ssaop.OpRISCV64MOVHreg
779 return true
780 case ssaop.OpSignExt32to64:
781 v.Op = ssaop.OpRISCV64MOVWreg
782 return true
783 case ssaop.OpSignExt8to16:
784 v.Op = ssaop.OpRISCV64MOVBreg
785 return true
786 case ssaop.OpSignExt8to32:
787 v.Op = ssaop.OpRISCV64MOVBreg
788 return true
789 case ssaop.OpSignExt8to64:
790 v.Op = ssaop.OpRISCV64MOVBreg
791 return true
792 case ssaop.OpSlicemask:
793 return rewriteValue_OpSlicemask(v)
794 case ssaop.OpSqrt:
795 v.Op = ssaop.OpRISCV64FSQRTD
796 return true
797 case ssaop.OpSqrt32:
798 v.Op = ssaop.OpRISCV64FSQRTS
799 return true
800 case ssaop.OpStaticCall:
801 v.Op = ssaop.OpRISCV64CALLstatic
802 return true
803 case ssaop.OpStore:
804 return rewriteValue_OpStore(v)
805 case ssaop.OpSub16:
806 v.Op = ssaop.OpRISCV64SUB
807 return true
808 case ssaop.OpSub32:
809 v.Op = ssaop.OpRISCV64SUB
810 return true
811 case ssaop.OpSub32F:
812 v.Op = ssaop.OpRISCV64FSUBS
813 return true
814 case ssaop.OpSub64:
815 v.Op = ssaop.OpRISCV64SUB
816 return true
817 case ssaop.OpSub64F:
818 v.Op = ssaop.OpRISCV64FSUBD
819 return true
820 case ssaop.OpSub8:
821 v.Op = ssaop.OpRISCV64SUB
822 return true
823 case ssaop.OpSubPtr:
824 v.Op = ssaop.OpRISCV64SUB
825 return true
826 case ssaop.OpTailCall:
827 v.Op = ssaop.OpRISCV64CALLtail
828 return true
829 case ssaop.OpTailCallInter:
830 v.Op = ssaop.OpRISCV64CALLtailinter
831 return true
832 case ssaop.OpTrunc16to8:
833 v.Op = ssaop.OpCopy
834 return true
835 case ssaop.OpTrunc32to16:
836 v.Op = ssaop.OpCopy
837 return true
838 case ssaop.OpTrunc32to8:
839 v.Op = ssaop.OpCopy
840 return true
841 case ssaop.OpTrunc64to16:
842 v.Op = ssaop.OpCopy
843 return true
844 case ssaop.OpTrunc64to32:
845 v.Op = ssaop.OpCopy
846 return true
847 case ssaop.OpTrunc64to8:
848 v.Op = ssaop.OpCopy
849 return true
850 case ssaop.OpWB:
851 v.Op = ssaop.OpRISCV64LoweredWB
852 return true
853 case ssaop.OpXor16:
854 v.Op = ssaop.OpRISCV64XOR
855 return true
856 case ssaop.OpXor32:
857 v.Op = ssaop.OpRISCV64XOR
858 return true
859 case ssaop.OpXor64:
860 v.Op = ssaop.OpRISCV64XOR
861 return true
862 case ssaop.OpXor8:
863 v.Op = ssaop.OpRISCV64XOR
864 return true
865 case ssaop.OpZero:
866 return rewriteValue_OpZero(v)
867 case ssaop.OpZeroExt16to32:
868 v.Op = ssaop.OpRISCV64MOVHUreg
869 return true
870 case ssaop.OpZeroExt16to64:
871 v.Op = ssaop.OpRISCV64MOVHUreg
872 return true
873 case ssaop.OpZeroExt32to64:
874 v.Op = ssaop.OpRISCV64MOVWUreg
875 return true
876 case ssaop.OpZeroExt8to16:
877 v.Op = ssaop.OpRISCV64MOVBUreg
878 return true
879 case ssaop.OpZeroExt8to32:
880 v.Op = ssaop.OpRISCV64MOVBUreg
881 return true
882 case ssaop.OpZeroExt8to64:
883 v.Op = ssaop.OpRISCV64MOVBUreg
884 return true
885 }
886 return false
887 }
888 func rewriteValue_OpAddr(v *ssa.Value) bool {
889 v_0 := v.Args[0]
890
891
892 for {
893 sym := ssa.AuxToSym(v.Aux)
894 base := v_0
895 v.Reset(ssaop.OpRISCV64MOVaddr)
896 v.AuxInt = ssa.Int32ToAuxInt(0)
897 v.Aux = ssa.SymToAux(sym)
898 v.AddArg(base)
899 return true
900 }
901 }
902 func rewriteValue_OpAtomicAnd8(v *ssa.Value) bool {
903 v_2 := v.Args[2]
904 v_1 := v.Args[1]
905 v_0 := v.Args[0]
906 b := v.Block
907 typ := &b.Func.Config.Types
908
909
910 for {
911 ptr := v_0
912 val := v_1
913 mem := v_2
914 v.Reset(ssaop.OpRISCV64LoweredAtomicAnd32)
915 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Uintptr)
916 v0.AuxInt = ssa.Int64ToAuxInt(^3)
917 v0.AddArg(ptr)
918 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64NOT, typ.UInt32)
919 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, typ.UInt32)
920 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64XORI, typ.UInt32)
921 v3.AuxInt = ssa.Int64ToAuxInt(0xff)
922 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
923 v4.AddArg(val)
924 v3.AddArg(v4)
925 v5 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLLI, typ.UInt64)
926 v5.AuxInt = ssa.Int64ToAuxInt(3)
927 v6 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.UInt64)
928 v6.AuxInt = ssa.Int64ToAuxInt(3)
929 v6.AddArg(ptr)
930 v5.AddArg(v6)
931 v2.AddArg2(v3, v5)
932 v1.AddArg(v2)
933 v.AddArg3(v0, v1, mem)
934 return true
935 }
936 }
937 func rewriteValue_OpAtomicCompareAndSwap32(v *ssa.Value) bool {
938 v_3 := v.Args[3]
939 v_2 := v.Args[2]
940 v_1 := v.Args[1]
941 v_0 := v.Args[0]
942 b := v.Block
943 typ := &b.Func.Config.Types
944
945
946 for {
947 ptr := v_0
948 old := v_1
949 new := v_2
950 mem := v_3
951 v.Reset(ssaop.OpRISCV64LoweredAtomicCas32)
952 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt32to64, typ.Int64)
953 v0.AddArg(old)
954 v.AddArg4(ptr, v0, new, mem)
955 return true
956 }
957 }
958 func rewriteValue_OpAtomicOr8(v *ssa.Value) bool {
959 v_2 := v.Args[2]
960 v_1 := v.Args[1]
961 v_0 := v.Args[0]
962 b := v.Block
963 typ := &b.Func.Config.Types
964
965
966 for {
967 ptr := v_0
968 val := v_1
969 mem := v_2
970 v.Reset(ssaop.OpRISCV64LoweredAtomicOr32)
971 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Uintptr)
972 v0.AuxInt = ssa.Int64ToAuxInt(^3)
973 v0.AddArg(ptr)
974 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, typ.UInt32)
975 v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
976 v2.AddArg(val)
977 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLLI, typ.UInt64)
978 v3.AuxInt = ssa.Int64ToAuxInt(3)
979 v4 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.UInt64)
980 v4.AuxInt = ssa.Int64ToAuxInt(3)
981 v4.AddArg(ptr)
982 v3.AddArg(v4)
983 v1.AddArg2(v2, v3)
984 v.AddArg3(v0, v1, mem)
985 return true
986 }
987 }
988 func rewriteValue_OpAvg64u(v *ssa.Value) bool {
989 v_1 := v.Args[1]
990 v_0 := v.Args[0]
991 b := v.Block
992
993
994 for {
995 t := v.Type
996 x := v_0
997 y := v_1
998 v.Reset(ssaop.OpRISCV64ADD)
999 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADD, t)
1000 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRLI, t)
1001 v1.AuxInt = ssa.Int64ToAuxInt(1)
1002 v1.AddArg(x)
1003 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRLI, t)
1004 v2.AuxInt = ssa.Int64ToAuxInt(1)
1005 v2.AddArg(y)
1006 v0.AddArg2(v1, v2)
1007 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, t)
1008 v3.AuxInt = ssa.Int64ToAuxInt(1)
1009 v4 := b.NewValue0(v.Pos, ssaop.OpRISCV64AND, t)
1010 v4.AddArg2(x, y)
1011 v3.AddArg(v4)
1012 v.AddArg2(v0, v3)
1013 return true
1014 }
1015 }
1016 func rewriteValue_OpBitLen16(v *ssa.Value) bool {
1017 v_0 := v.Args[0]
1018 b := v.Block
1019 typ := &b.Func.Config.Types
1020
1021
1022 for {
1023 x := v_0
1024 v.Reset(ssaop.OpBitLen64)
1025 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
1026 v0.AddArg(x)
1027 v.AddArg(v0)
1028 return true
1029 }
1030 }
1031 func rewriteValue_OpBitLen32(v *ssa.Value) bool {
1032 v_0 := v.Args[0]
1033 b := v.Block
1034 typ := &b.Func.Config.Types
1035
1036
1037 for {
1038 t := v.Type
1039 x := v_0
1040 v.Reset(ssaop.OpRISCV64SUB)
1041 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
1042 v0.AuxInt = ssa.Int64ToAuxInt(32)
1043 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64CLZW, t)
1044 v1.AddArg(x)
1045 v.AddArg2(v0, v1)
1046 return true
1047 }
1048 }
1049 func rewriteValue_OpBitLen64(v *ssa.Value) bool {
1050 v_0 := v.Args[0]
1051 b := v.Block
1052 typ := &b.Func.Config.Types
1053
1054
1055 for {
1056 t := v.Type
1057 x := v_0
1058 v.Reset(ssaop.OpRISCV64SUB)
1059 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
1060 v0.AuxInt = ssa.Int64ToAuxInt(64)
1061 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64CLZ, t)
1062 v1.AddArg(x)
1063 v.AddArg2(v0, v1)
1064 return true
1065 }
1066 }
1067 func rewriteValue_OpBitLen8(v *ssa.Value) bool {
1068 v_0 := v.Args[0]
1069 b := v.Block
1070 typ := &b.Func.Config.Types
1071
1072
1073 for {
1074 x := v_0
1075 v.Reset(ssaop.OpBitLen64)
1076 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
1077 v0.AddArg(x)
1078 v.AddArg(v0)
1079 return true
1080 }
1081 }
1082 func rewriteValue_OpBswap16(v *ssa.Value) bool {
1083 v_0 := v.Args[0]
1084 b := v.Block
1085
1086
1087 for {
1088 t := v.Type
1089 x := v_0
1090 v.Reset(ssaop.OpRISCV64SRLI)
1091 v.AuxInt = ssa.Int64ToAuxInt(48)
1092 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64REV8, t)
1093 v0.AddArg(x)
1094 v.AddArg(v0)
1095 return true
1096 }
1097 }
1098 func rewriteValue_OpBswap32(v *ssa.Value) bool {
1099 v_0 := v.Args[0]
1100 b := v.Block
1101
1102
1103 for {
1104 t := v.Type
1105 x := v_0
1106 v.Reset(ssaop.OpRISCV64SRLI)
1107 v.AuxInt = ssa.Int64ToAuxInt(32)
1108 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64REV8, t)
1109 v0.AddArg(x)
1110 v.AddArg(v0)
1111 return true
1112 }
1113 }
1114 func rewriteValue_OpCondSelect(v *ssa.Value) bool {
1115 v_2 := v.Args[2]
1116 v_1 := v.Args[1]
1117 v_0 := v.Args[0]
1118 b := v.Block
1119 typ := &b.Func.Config.Types
1120
1121
1122 for {
1123 t := v.Type
1124 x := v_0
1125 y := v_1
1126 cond := v_2
1127 v.Reset(ssaop.OpRISCV64OR)
1128 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZEROEQZ, t)
1129 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBUreg, typ.UInt64)
1130 v1.AddArg(cond)
1131 v0.AddArg2(x, v1)
1132 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZERONEZ, t)
1133 v2.AddArg2(y, v1)
1134 v.AddArg2(v0, v2)
1135 return true
1136 }
1137 }
1138 func rewriteValue_OpConst16(v *ssa.Value) bool {
1139
1140
1141 for {
1142 val := ssa.AuxIntToInt16(v.AuxInt)
1143 v.Reset(ssaop.OpRISCV64MOVDconst)
1144 v.AuxInt = ssa.Int64ToAuxInt(int64(val))
1145 return true
1146 }
1147 }
1148 func rewriteValue_OpConst32(v *ssa.Value) bool {
1149
1150
1151 for {
1152 val := ssa.AuxIntToInt32(v.AuxInt)
1153 v.Reset(ssaop.OpRISCV64MOVDconst)
1154 v.AuxInt = ssa.Int64ToAuxInt(int64(val))
1155 return true
1156 }
1157 }
1158 func rewriteValue_OpConst64(v *ssa.Value) bool {
1159
1160
1161 for {
1162 val := ssa.AuxIntToInt64(v.AuxInt)
1163 v.Reset(ssaop.OpRISCV64MOVDconst)
1164 v.AuxInt = ssa.Int64ToAuxInt(int64(val))
1165 return true
1166 }
1167 }
1168 func rewriteValue_OpConst8(v *ssa.Value) bool {
1169
1170
1171 for {
1172 val := ssa.AuxIntToInt8(v.AuxInt)
1173 v.Reset(ssaop.OpRISCV64MOVDconst)
1174 v.AuxInt = ssa.Int64ToAuxInt(int64(val))
1175 return true
1176 }
1177 }
1178 func rewriteValue_OpConstBool(v *ssa.Value) bool {
1179
1180
1181 for {
1182 val := ssa.AuxIntToBool(v.AuxInt)
1183 v.Reset(ssaop.OpRISCV64MOVDconst)
1184 v.AuxInt = ssa.Int64ToAuxInt(int64(ssa.B2i(val)))
1185 return true
1186 }
1187 }
1188 func rewriteValue_OpConstNil(v *ssa.Value) bool {
1189
1190
1191 for {
1192 v.Reset(ssaop.OpRISCV64MOVDconst)
1193 v.AuxInt = ssa.Int64ToAuxInt(0)
1194 return true
1195 }
1196 }
1197 func rewriteValue_OpCtz16(v *ssa.Value) bool {
1198 v_0 := v.Args[0]
1199 b := v.Block
1200 typ := &b.Func.Config.Types
1201
1202
1203 for {
1204 x := v_0
1205 v.Reset(ssaop.OpRISCV64CTZW)
1206 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ORI, typ.UInt32)
1207 v0.AuxInt = ssa.Int64ToAuxInt(1 << 16)
1208 v0.AddArg(x)
1209 v.AddArg(v0)
1210 return true
1211 }
1212 }
1213 func rewriteValue_OpCtz8(v *ssa.Value) bool {
1214 v_0 := v.Args[0]
1215 b := v.Block
1216 typ := &b.Func.Config.Types
1217
1218
1219 for {
1220 x := v_0
1221 v.Reset(ssaop.OpRISCV64CTZW)
1222 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ORI, typ.UInt32)
1223 v0.AuxInt = ssa.Int64ToAuxInt(1 << 8)
1224 v0.AddArg(x)
1225 v.AddArg(v0)
1226 return true
1227 }
1228 }
1229 func rewriteValue_OpDiv16(v *ssa.Value) bool {
1230 v_1 := v.Args[1]
1231 v_0 := v.Args[0]
1232 b := v.Block
1233 typ := &b.Func.Config.Types
1234
1235
1236 for {
1237 if ssa.AuxIntToBool(v.AuxInt) != false {
1238 break
1239 }
1240 x := v_0
1241 y := v_1
1242 v.Reset(ssaop.OpRISCV64DIVW)
1243 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to32, typ.Int32)
1244 v0.AddArg(x)
1245 v1 := b.NewValue0(v.Pos, ssaop.OpSignExt16to32, typ.Int32)
1246 v1.AddArg(y)
1247 v.AddArg2(v0, v1)
1248 return true
1249 }
1250 return false
1251 }
1252 func rewriteValue_OpDiv16u(v *ssa.Value) bool {
1253 v_1 := v.Args[1]
1254 v_0 := v.Args[0]
1255 b := v.Block
1256 typ := &b.Func.Config.Types
1257
1258
1259 for {
1260 x := v_0
1261 y := v_1
1262 v.Reset(ssaop.OpRISCV64DIVUW)
1263 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
1264 v0.AddArg(x)
1265 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
1266 v1.AddArg(y)
1267 v.AddArg2(v0, v1)
1268 return true
1269 }
1270 }
1271 func rewriteValue_OpDiv32(v *ssa.Value) bool {
1272 v_1 := v.Args[1]
1273 v_0 := v.Args[0]
1274
1275
1276 for {
1277 if ssa.AuxIntToBool(v.AuxInt) != false {
1278 break
1279 }
1280 x := v_0
1281 y := v_1
1282 v.Reset(ssaop.OpRISCV64DIVW)
1283 v.AddArg2(x, y)
1284 return true
1285 }
1286 return false
1287 }
1288 func rewriteValue_OpDiv64(v *ssa.Value) bool {
1289 v_1 := v.Args[1]
1290 v_0 := v.Args[0]
1291
1292
1293 for {
1294 if ssa.AuxIntToBool(v.AuxInt) != false {
1295 break
1296 }
1297 x := v_0
1298 y := v_1
1299 v.Reset(ssaop.OpRISCV64DIV)
1300 v.AddArg2(x, y)
1301 return true
1302 }
1303 return false
1304 }
1305 func rewriteValue_OpDiv8(v *ssa.Value) bool {
1306 v_1 := v.Args[1]
1307 v_0 := v.Args[0]
1308 b := v.Block
1309 typ := &b.Func.Config.Types
1310
1311
1312 for {
1313 x := v_0
1314 y := v_1
1315 v.Reset(ssaop.OpRISCV64DIVW)
1316 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt8to32, typ.Int32)
1317 v0.AddArg(x)
1318 v1 := b.NewValue0(v.Pos, ssaop.OpSignExt8to32, typ.Int32)
1319 v1.AddArg(y)
1320 v.AddArg2(v0, v1)
1321 return true
1322 }
1323 }
1324 func rewriteValue_OpDiv8u(v *ssa.Value) bool {
1325 v_1 := v.Args[1]
1326 v_0 := v.Args[0]
1327 b := v.Block
1328 typ := &b.Func.Config.Types
1329
1330
1331 for {
1332 x := v_0
1333 y := v_1
1334 v.Reset(ssaop.OpRISCV64DIVUW)
1335 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
1336 v0.AddArg(x)
1337 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
1338 v1.AddArg(y)
1339 v.AddArg2(v0, v1)
1340 return true
1341 }
1342 }
1343 func rewriteValue_OpEq16(v *ssa.Value) bool {
1344 v_1 := v.Args[1]
1345 v_0 := v.Args[0]
1346 b := v.Block
1347 typ := &b.Func.Config.Types
1348
1349
1350 for {
1351 x := v_0
1352 y := v_1
1353 v.Reset(ssaop.OpRISCV64SEQZ)
1354 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SUB, x.Type)
1355 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
1356 v1.AddArg(x)
1357 v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
1358 v2.AddArg(y)
1359 v0.AddArg2(v1, v2)
1360 v.AddArg(v0)
1361 return true
1362 }
1363 }
1364 func rewriteValue_OpEq32(v *ssa.Value) bool {
1365 v_1 := v.Args[1]
1366 v_0 := v.Args[0]
1367 b := v.Block
1368 typ := &b.Func.Config.Types
1369
1370
1371
1372 for {
1373 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1374 x := v_0
1375 y := v_1
1376 if !(x.Type.IsSigned()) {
1377 continue
1378 }
1379 v.Reset(ssaop.OpRISCV64SEQZ)
1380 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SUB, x.Type)
1381 v1 := b.NewValue0(v.Pos, ssaop.OpSignExt32to64, typ.Int64)
1382 v1.AddArg(x)
1383 v2 := b.NewValue0(v.Pos, ssaop.OpSignExt32to64, typ.Int64)
1384 v2.AddArg(y)
1385 v0.AddArg2(v1, v2)
1386 v.AddArg(v0)
1387 return true
1388 }
1389 break
1390 }
1391
1392
1393
1394 for {
1395 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1396 x := v_0
1397 y := v_1
1398 if !(!x.Type.IsSigned()) {
1399 continue
1400 }
1401 v.Reset(ssaop.OpRISCV64SEQZ)
1402 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SUB, x.Type)
1403 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
1404 v1.AddArg(x)
1405 v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
1406 v2.AddArg(y)
1407 v0.AddArg2(v1, v2)
1408 v.AddArg(v0)
1409 return true
1410 }
1411 break
1412 }
1413 return false
1414 }
1415 func rewriteValue_OpEq64(v *ssa.Value) bool {
1416 v_1 := v.Args[1]
1417 v_0 := v.Args[0]
1418 b := v.Block
1419
1420
1421 for {
1422 x := v_0
1423 y := v_1
1424 v.Reset(ssaop.OpRISCV64SEQZ)
1425 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SUB, x.Type)
1426 v0.AddArg2(x, y)
1427 v.AddArg(v0)
1428 return true
1429 }
1430 }
1431 func rewriteValue_OpEq8(v *ssa.Value) bool {
1432 v_1 := v.Args[1]
1433 v_0 := v.Args[0]
1434 b := v.Block
1435 typ := &b.Func.Config.Types
1436
1437
1438 for {
1439 x := v_0
1440 y := v_1
1441 v.Reset(ssaop.OpRISCV64SEQZ)
1442 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SUB, x.Type)
1443 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
1444 v1.AddArg(x)
1445 v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
1446 v2.AddArg(y)
1447 v0.AddArg2(v1, v2)
1448 v.AddArg(v0)
1449 return true
1450 }
1451 }
1452 func rewriteValue_OpEqB(v *ssa.Value) bool {
1453 v_1 := v.Args[1]
1454 v_0 := v.Args[0]
1455 b := v.Block
1456 typ := &b.Func.Config.Types
1457
1458
1459 for {
1460 x := v_0
1461 y := v_1
1462 v.Reset(ssaop.OpRISCV64SEQZ)
1463 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SUB, typ.Bool)
1464 v0.AddArg2(x, y)
1465 v.AddArg(v0)
1466 return true
1467 }
1468 }
1469 func rewriteValue_OpEqPtr(v *ssa.Value) bool {
1470 v_1 := v.Args[1]
1471 v_0 := v.Args[0]
1472 b := v.Block
1473 typ := &b.Func.Config.Types
1474
1475
1476 for {
1477 x := v_0
1478 y := v_1
1479 v.Reset(ssaop.OpRISCV64SEQZ)
1480 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SUB, typ.Uintptr)
1481 v0.AddArg2(x, y)
1482 v.AddArg(v0)
1483 return true
1484 }
1485 }
1486 func rewriteValue_OpHmul32(v *ssa.Value) bool {
1487 v_1 := v.Args[1]
1488 v_0 := v.Args[0]
1489 b := v.Block
1490 typ := &b.Func.Config.Types
1491
1492
1493 for {
1494 x := v_0
1495 y := v_1
1496 v.Reset(ssaop.OpRISCV64SRAI)
1497 v.AuxInt = ssa.Int64ToAuxInt(32)
1498 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MUL, typ.Int64)
1499 v1 := b.NewValue0(v.Pos, ssaop.OpSignExt32to64, typ.Int64)
1500 v1.AddArg(x)
1501 v2 := b.NewValue0(v.Pos, ssaop.OpSignExt32to64, typ.Int64)
1502 v2.AddArg(y)
1503 v0.AddArg2(v1, v2)
1504 v.AddArg(v0)
1505 return true
1506 }
1507 }
1508 func rewriteValue_OpHmul32u(v *ssa.Value) bool {
1509 v_1 := v.Args[1]
1510 v_0 := v.Args[0]
1511 b := v.Block
1512 typ := &b.Func.Config.Types
1513
1514
1515 for {
1516 x := v_0
1517 y := v_1
1518 v.Reset(ssaop.OpRISCV64SRLI)
1519 v.AuxInt = ssa.Int64ToAuxInt(32)
1520 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MUL, typ.Int64)
1521 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
1522 v1.AddArg(x)
1523 v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
1524 v2.AddArg(y)
1525 v0.AddArg2(v1, v2)
1526 v.AddArg(v0)
1527 return true
1528 }
1529 }
1530 func rewriteValue_OpLeq16(v *ssa.Value) bool {
1531 v_1 := v.Args[1]
1532 v_0 := v.Args[0]
1533 b := v.Block
1534 typ := &b.Func.Config.Types
1535
1536
1537 for {
1538 x := v_0
1539 y := v_1
1540 v.Reset(ssaop.OpNot)
1541 v0 := b.NewValue0(v.Pos, ssaop.OpLess16, typ.Bool)
1542 v0.AddArg2(y, x)
1543 v.AddArg(v0)
1544 return true
1545 }
1546 }
1547 func rewriteValue_OpLeq16U(v *ssa.Value) bool {
1548 v_1 := v.Args[1]
1549 v_0 := v.Args[0]
1550 b := v.Block
1551 typ := &b.Func.Config.Types
1552
1553
1554 for {
1555 x := v_0
1556 y := v_1
1557 v.Reset(ssaop.OpNot)
1558 v0 := b.NewValue0(v.Pos, ssaop.OpLess16U, typ.Bool)
1559 v0.AddArg2(y, x)
1560 v.AddArg(v0)
1561 return true
1562 }
1563 }
1564 func rewriteValue_OpLeq32(v *ssa.Value) bool {
1565 v_1 := v.Args[1]
1566 v_0 := v.Args[0]
1567 b := v.Block
1568 typ := &b.Func.Config.Types
1569
1570
1571 for {
1572 x := v_0
1573 y := v_1
1574 v.Reset(ssaop.OpNot)
1575 v0 := b.NewValue0(v.Pos, ssaop.OpLess32, typ.Bool)
1576 v0.AddArg2(y, x)
1577 v.AddArg(v0)
1578 return true
1579 }
1580 }
1581 func rewriteValue_OpLeq32U(v *ssa.Value) bool {
1582 v_1 := v.Args[1]
1583 v_0 := v.Args[0]
1584 b := v.Block
1585 typ := &b.Func.Config.Types
1586
1587
1588 for {
1589 x := v_0
1590 y := v_1
1591 v.Reset(ssaop.OpNot)
1592 v0 := b.NewValue0(v.Pos, ssaop.OpLess32U, typ.Bool)
1593 v0.AddArg2(y, x)
1594 v.AddArg(v0)
1595 return true
1596 }
1597 }
1598 func rewriteValue_OpLeq64(v *ssa.Value) bool {
1599 v_1 := v.Args[1]
1600 v_0 := v.Args[0]
1601 b := v.Block
1602 typ := &b.Func.Config.Types
1603
1604
1605 for {
1606 x := v_0
1607 y := v_1
1608 v.Reset(ssaop.OpNot)
1609 v0 := b.NewValue0(v.Pos, ssaop.OpLess64, typ.Bool)
1610 v0.AddArg2(y, x)
1611 v.AddArg(v0)
1612 return true
1613 }
1614 }
1615 func rewriteValue_OpLeq64U(v *ssa.Value) bool {
1616 v_1 := v.Args[1]
1617 v_0 := v.Args[0]
1618 b := v.Block
1619 typ := &b.Func.Config.Types
1620
1621
1622 for {
1623 x := v_0
1624 y := v_1
1625 v.Reset(ssaop.OpNot)
1626 v0 := b.NewValue0(v.Pos, ssaop.OpLess64U, typ.Bool)
1627 v0.AddArg2(y, x)
1628 v.AddArg(v0)
1629 return true
1630 }
1631 }
1632 func rewriteValue_OpLeq8(v *ssa.Value) bool {
1633 v_1 := v.Args[1]
1634 v_0 := v.Args[0]
1635 b := v.Block
1636 typ := &b.Func.Config.Types
1637
1638
1639 for {
1640 x := v_0
1641 y := v_1
1642 v.Reset(ssaop.OpNot)
1643 v0 := b.NewValue0(v.Pos, ssaop.OpLess8, typ.Bool)
1644 v0.AddArg2(y, x)
1645 v.AddArg(v0)
1646 return true
1647 }
1648 }
1649 func rewriteValue_OpLeq8U(v *ssa.Value) bool {
1650 v_1 := v.Args[1]
1651 v_0 := v.Args[0]
1652 b := v.Block
1653 typ := &b.Func.Config.Types
1654
1655
1656 for {
1657 x := v_0
1658 y := v_1
1659 v.Reset(ssaop.OpNot)
1660 v0 := b.NewValue0(v.Pos, ssaop.OpLess8U, typ.Bool)
1661 v0.AddArg2(y, x)
1662 v.AddArg(v0)
1663 return true
1664 }
1665 }
1666 func rewriteValue_OpLess16(v *ssa.Value) bool {
1667 v_1 := v.Args[1]
1668 v_0 := v.Args[0]
1669 b := v.Block
1670 typ := &b.Func.Config.Types
1671
1672
1673 for {
1674 x := v_0
1675 y := v_1
1676 v.Reset(ssaop.OpRISCV64SLT)
1677 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to64, typ.Int64)
1678 v0.AddArg(x)
1679 v1 := b.NewValue0(v.Pos, ssaop.OpSignExt16to64, typ.Int64)
1680 v1.AddArg(y)
1681 v.AddArg2(v0, v1)
1682 return true
1683 }
1684 }
1685 func rewriteValue_OpLess16U(v *ssa.Value) bool {
1686 v_1 := v.Args[1]
1687 v_0 := v.Args[0]
1688 b := v.Block
1689 typ := &b.Func.Config.Types
1690
1691
1692 for {
1693 x := v_0
1694 y := v_1
1695 v.Reset(ssaop.OpRISCV64SLTU)
1696 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
1697 v0.AddArg(x)
1698 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
1699 v1.AddArg(y)
1700 v.AddArg2(v0, v1)
1701 return true
1702 }
1703 }
1704 func rewriteValue_OpLess32(v *ssa.Value) bool {
1705 v_1 := v.Args[1]
1706 v_0 := v.Args[0]
1707 b := v.Block
1708 typ := &b.Func.Config.Types
1709
1710
1711 for {
1712 x := v_0
1713 y := v_1
1714 v.Reset(ssaop.OpRISCV64SLT)
1715 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt32to64, typ.Int64)
1716 v0.AddArg(x)
1717 v1 := b.NewValue0(v.Pos, ssaop.OpSignExt32to64, typ.Int64)
1718 v1.AddArg(y)
1719 v.AddArg2(v0, v1)
1720 return true
1721 }
1722 }
1723 func rewriteValue_OpLess32U(v *ssa.Value) bool {
1724 v_1 := v.Args[1]
1725 v_0 := v.Args[0]
1726 b := v.Block
1727 typ := &b.Func.Config.Types
1728
1729
1730 for {
1731 x := v_0
1732 y := v_1
1733 v.Reset(ssaop.OpRISCV64SLTU)
1734 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
1735 v0.AddArg(x)
1736 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
1737 v1.AddArg(y)
1738 v.AddArg2(v0, v1)
1739 return true
1740 }
1741 }
1742 func rewriteValue_OpLess8(v *ssa.Value) bool {
1743 v_1 := v.Args[1]
1744 v_0 := v.Args[0]
1745 b := v.Block
1746 typ := &b.Func.Config.Types
1747
1748
1749 for {
1750 x := v_0
1751 y := v_1
1752 v.Reset(ssaop.OpRISCV64SLT)
1753 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt8to64, typ.Int64)
1754 v0.AddArg(x)
1755 v1 := b.NewValue0(v.Pos, ssaop.OpSignExt8to64, typ.Int64)
1756 v1.AddArg(y)
1757 v.AddArg2(v0, v1)
1758 return true
1759 }
1760 }
1761 func rewriteValue_OpLess8U(v *ssa.Value) bool {
1762 v_1 := v.Args[1]
1763 v_0 := v.Args[0]
1764 b := v.Block
1765 typ := &b.Func.Config.Types
1766
1767
1768 for {
1769 x := v_0
1770 y := v_1
1771 v.Reset(ssaop.OpRISCV64SLTU)
1772 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
1773 v0.AddArg(x)
1774 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
1775 v1.AddArg(y)
1776 v.AddArg2(v0, v1)
1777 return true
1778 }
1779 }
1780 func rewriteValue_OpLoad(v *ssa.Value) bool {
1781 v_1 := v.Args[1]
1782 v_0 := v.Args[0]
1783
1784
1785
1786 for {
1787 t := v.Type
1788 ptr := v_0
1789 mem := v_1
1790 if !(t.IsBoolean()) {
1791 break
1792 }
1793 v.Reset(ssaop.OpRISCV64MOVBUload)
1794 v.AddArg2(ptr, mem)
1795 return true
1796 }
1797
1798
1799
1800 for {
1801 t := v.Type
1802 ptr := v_0
1803 mem := v_1
1804 if !(ssa.Is8BitInt(t) && t.IsSigned()) {
1805 break
1806 }
1807 v.Reset(ssaop.OpRISCV64MOVBload)
1808 v.AddArg2(ptr, mem)
1809 return true
1810 }
1811
1812
1813
1814 for {
1815 t := v.Type
1816 ptr := v_0
1817 mem := v_1
1818 if !(ssa.Is8BitInt(t) && !t.IsSigned()) {
1819 break
1820 }
1821 v.Reset(ssaop.OpRISCV64MOVBUload)
1822 v.AddArg2(ptr, mem)
1823 return true
1824 }
1825
1826
1827
1828 for {
1829 t := v.Type
1830 ptr := v_0
1831 mem := v_1
1832 if !(ssa.Is16BitInt(t) && t.IsSigned()) {
1833 break
1834 }
1835 v.Reset(ssaop.OpRISCV64MOVHload)
1836 v.AddArg2(ptr, mem)
1837 return true
1838 }
1839
1840
1841
1842 for {
1843 t := v.Type
1844 ptr := v_0
1845 mem := v_1
1846 if !(ssa.Is16BitInt(t) && !t.IsSigned()) {
1847 break
1848 }
1849 v.Reset(ssaop.OpRISCV64MOVHUload)
1850 v.AddArg2(ptr, mem)
1851 return true
1852 }
1853
1854
1855
1856 for {
1857 t := v.Type
1858 ptr := v_0
1859 mem := v_1
1860 if !(ssa.Is32BitInt(t) && t.IsSigned()) {
1861 break
1862 }
1863 v.Reset(ssaop.OpRISCV64MOVWload)
1864 v.AddArg2(ptr, mem)
1865 return true
1866 }
1867
1868
1869
1870 for {
1871 t := v.Type
1872 ptr := v_0
1873 mem := v_1
1874 if !(ssa.Is32BitInt(t) && !t.IsSigned()) {
1875 break
1876 }
1877 v.Reset(ssaop.OpRISCV64MOVWUload)
1878 v.AddArg2(ptr, mem)
1879 return true
1880 }
1881
1882
1883
1884 for {
1885 t := v.Type
1886 ptr := v_0
1887 mem := v_1
1888 if !(ssa.Is64BitInt(t) || ssa.IsPtr(t)) {
1889 break
1890 }
1891 v.Reset(ssaop.OpRISCV64MOVDload)
1892 v.AddArg2(ptr, mem)
1893 return true
1894 }
1895
1896
1897
1898 for {
1899 t := v.Type
1900 ptr := v_0
1901 mem := v_1
1902 if !(ssa.Is32BitFloat(t)) {
1903 break
1904 }
1905 v.Reset(ssaop.OpRISCV64FMOVWload)
1906 v.AddArg2(ptr, mem)
1907 return true
1908 }
1909
1910
1911
1912 for {
1913 t := v.Type
1914 ptr := v_0
1915 mem := v_1
1916 if !(ssa.Is64BitFloat(t)) {
1917 break
1918 }
1919 v.Reset(ssaop.OpRISCV64FMOVDload)
1920 v.AddArg2(ptr, mem)
1921 return true
1922 }
1923 return false
1924 }
1925 func rewriteValue_OpLocalAddr(v *ssa.Value) bool {
1926 v_1 := v.Args[1]
1927 v_0 := v.Args[0]
1928 b := v.Block
1929 typ := &b.Func.Config.Types
1930
1931
1932
1933 for {
1934 t := v.Type
1935 sym := ssa.AuxToSym(v.Aux)
1936 base := v_0
1937 mem := v_1
1938 if !(t.Elem().HasPointers()) {
1939 break
1940 }
1941 v.Reset(ssaop.OpRISCV64MOVaddr)
1942 v.Aux = ssa.SymToAux(sym)
1943 v0 := b.NewValue0(v.Pos, ssaop.OpSPanchored, typ.Uintptr)
1944 v0.AddArg2(base, mem)
1945 v.AddArg(v0)
1946 return true
1947 }
1948
1949
1950
1951 for {
1952 t := v.Type
1953 sym := ssa.AuxToSym(v.Aux)
1954 base := v_0
1955 if !(!t.Elem().HasPointers()) {
1956 break
1957 }
1958 v.Reset(ssaop.OpRISCV64MOVaddr)
1959 v.Aux = ssa.SymToAux(sym)
1960 v.AddArg(base)
1961 return true
1962 }
1963 return false
1964 }
1965 func rewriteValue_OpLsh16x16(v *ssa.Value) bool {
1966 v_1 := v.Args[1]
1967 v_0 := v.Args[0]
1968 b := v.Block
1969 typ := &b.Func.Config.Types
1970
1971
1972
1973 for {
1974 t := v.Type
1975 x := v_0
1976 y := v_1
1977 if !(!ssa.ShiftIsBounded(v)) {
1978 break
1979 }
1980 v.Reset(ssaop.OpRISCV64AND)
1981 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, t)
1982 v0.AddArg2(x, y)
1983 v1 := b.NewValue0(v.Pos, ssaop.OpNeg16, t)
1984 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
1985 v2.AuxInt = ssa.Int64ToAuxInt(64)
1986 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
1987 v3.AddArg(y)
1988 v2.AddArg(v3)
1989 v1.AddArg(v2)
1990 v.AddArg2(v0, v1)
1991 return true
1992 }
1993
1994
1995
1996 for {
1997 x := v_0
1998 y := v_1
1999 if !(ssa.ShiftIsBounded(v)) {
2000 break
2001 }
2002 v.Reset(ssaop.OpRISCV64SLL)
2003 v.AddArg2(x, y)
2004 return true
2005 }
2006 return false
2007 }
2008 func rewriteValue_OpLsh16x32(v *ssa.Value) bool {
2009 v_1 := v.Args[1]
2010 v_0 := v.Args[0]
2011 b := v.Block
2012 typ := &b.Func.Config.Types
2013
2014
2015
2016 for {
2017 t := v.Type
2018 x := v_0
2019 y := v_1
2020 if !(!ssa.ShiftIsBounded(v)) {
2021 break
2022 }
2023 v.Reset(ssaop.OpRISCV64AND)
2024 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, t)
2025 v0.AddArg2(x, y)
2026 v1 := b.NewValue0(v.Pos, ssaop.OpNeg16, t)
2027 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
2028 v2.AuxInt = ssa.Int64ToAuxInt(64)
2029 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
2030 v3.AddArg(y)
2031 v2.AddArg(v3)
2032 v1.AddArg(v2)
2033 v.AddArg2(v0, v1)
2034 return true
2035 }
2036
2037
2038
2039 for {
2040 x := v_0
2041 y := v_1
2042 if !(ssa.ShiftIsBounded(v)) {
2043 break
2044 }
2045 v.Reset(ssaop.OpRISCV64SLL)
2046 v.AddArg2(x, y)
2047 return true
2048 }
2049 return false
2050 }
2051 func rewriteValue_OpLsh16x64(v *ssa.Value) bool {
2052 v_1 := v.Args[1]
2053 v_0 := v.Args[0]
2054 b := v.Block
2055
2056
2057
2058 for {
2059 t := v.Type
2060 x := v_0
2061 y := v_1
2062 if !(!ssa.ShiftIsBounded(v)) {
2063 break
2064 }
2065 v.Reset(ssaop.OpRISCV64AND)
2066 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, t)
2067 v0.AddArg2(x, y)
2068 v1 := b.NewValue0(v.Pos, ssaop.OpNeg16, t)
2069 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
2070 v2.AuxInt = ssa.Int64ToAuxInt(64)
2071 v2.AddArg(y)
2072 v1.AddArg(v2)
2073 v.AddArg2(v0, v1)
2074 return true
2075 }
2076
2077
2078
2079 for {
2080 x := v_0
2081 y := v_1
2082 if !(ssa.ShiftIsBounded(v)) {
2083 break
2084 }
2085 v.Reset(ssaop.OpRISCV64SLL)
2086 v.AddArg2(x, y)
2087 return true
2088 }
2089 return false
2090 }
2091 func rewriteValue_OpLsh16x8(v *ssa.Value) bool {
2092 v_1 := v.Args[1]
2093 v_0 := v.Args[0]
2094 b := v.Block
2095 typ := &b.Func.Config.Types
2096
2097
2098
2099 for {
2100 t := v.Type
2101 x := v_0
2102 y := v_1
2103 if !(!ssa.ShiftIsBounded(v)) {
2104 break
2105 }
2106 v.Reset(ssaop.OpRISCV64AND)
2107 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, t)
2108 v0.AddArg2(x, y)
2109 v1 := b.NewValue0(v.Pos, ssaop.OpNeg16, t)
2110 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
2111 v2.AuxInt = ssa.Int64ToAuxInt(64)
2112 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
2113 v3.AddArg(y)
2114 v2.AddArg(v3)
2115 v1.AddArg(v2)
2116 v.AddArg2(v0, v1)
2117 return true
2118 }
2119
2120
2121
2122 for {
2123 x := v_0
2124 y := v_1
2125 if !(ssa.ShiftIsBounded(v)) {
2126 break
2127 }
2128 v.Reset(ssaop.OpRISCV64SLL)
2129 v.AddArg2(x, y)
2130 return true
2131 }
2132 return false
2133 }
2134 func rewriteValue_OpLsh32x16(v *ssa.Value) bool {
2135 v_1 := v.Args[1]
2136 v_0 := v.Args[0]
2137 b := v.Block
2138 typ := &b.Func.Config.Types
2139
2140
2141
2142 for {
2143 t := v.Type
2144 x := v_0
2145 y := v_1
2146 if !(!ssa.ShiftIsBounded(v)) {
2147 break
2148 }
2149 v.Reset(ssaop.OpRISCV64AND)
2150 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, t)
2151 v0.AddArg2(x, y)
2152 v1 := b.NewValue0(v.Pos, ssaop.OpNeg32, t)
2153 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
2154 v2.AuxInt = ssa.Int64ToAuxInt(64)
2155 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
2156 v3.AddArg(y)
2157 v2.AddArg(v3)
2158 v1.AddArg(v2)
2159 v.AddArg2(v0, v1)
2160 return true
2161 }
2162
2163
2164
2165 for {
2166 x := v_0
2167 y := v_1
2168 if !(ssa.ShiftIsBounded(v)) {
2169 break
2170 }
2171 v.Reset(ssaop.OpRISCV64SLL)
2172 v.AddArg2(x, y)
2173 return true
2174 }
2175 return false
2176 }
2177 func rewriteValue_OpLsh32x32(v *ssa.Value) bool {
2178 v_1 := v.Args[1]
2179 v_0 := v.Args[0]
2180 b := v.Block
2181 typ := &b.Func.Config.Types
2182
2183
2184
2185 for {
2186 t := v.Type
2187 x := v_0
2188 y := v_1
2189 if !(!ssa.ShiftIsBounded(v)) {
2190 break
2191 }
2192 v.Reset(ssaop.OpRISCV64AND)
2193 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, t)
2194 v0.AddArg2(x, y)
2195 v1 := b.NewValue0(v.Pos, ssaop.OpNeg32, t)
2196 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
2197 v2.AuxInt = ssa.Int64ToAuxInt(64)
2198 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
2199 v3.AddArg(y)
2200 v2.AddArg(v3)
2201 v1.AddArg(v2)
2202 v.AddArg2(v0, v1)
2203 return true
2204 }
2205
2206
2207
2208 for {
2209 x := v_0
2210 y := v_1
2211 if !(ssa.ShiftIsBounded(v)) {
2212 break
2213 }
2214 v.Reset(ssaop.OpRISCV64SLL)
2215 v.AddArg2(x, y)
2216 return true
2217 }
2218 return false
2219 }
2220 func rewriteValue_OpLsh32x64(v *ssa.Value) bool {
2221 v_1 := v.Args[1]
2222 v_0 := v.Args[0]
2223 b := v.Block
2224
2225
2226
2227 for {
2228 t := v.Type
2229 x := v_0
2230 y := v_1
2231 if !(!ssa.ShiftIsBounded(v)) {
2232 break
2233 }
2234 v.Reset(ssaop.OpRISCV64AND)
2235 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, t)
2236 v0.AddArg2(x, y)
2237 v1 := b.NewValue0(v.Pos, ssaop.OpNeg32, t)
2238 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
2239 v2.AuxInt = ssa.Int64ToAuxInt(64)
2240 v2.AddArg(y)
2241 v1.AddArg(v2)
2242 v.AddArg2(v0, v1)
2243 return true
2244 }
2245
2246
2247
2248 for {
2249 x := v_0
2250 y := v_1
2251 if !(ssa.ShiftIsBounded(v)) {
2252 break
2253 }
2254 v.Reset(ssaop.OpRISCV64SLL)
2255 v.AddArg2(x, y)
2256 return true
2257 }
2258 return false
2259 }
2260 func rewriteValue_OpLsh32x8(v *ssa.Value) bool {
2261 v_1 := v.Args[1]
2262 v_0 := v.Args[0]
2263 b := v.Block
2264 typ := &b.Func.Config.Types
2265
2266
2267
2268 for {
2269 t := v.Type
2270 x := v_0
2271 y := v_1
2272 if !(!ssa.ShiftIsBounded(v)) {
2273 break
2274 }
2275 v.Reset(ssaop.OpRISCV64AND)
2276 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, t)
2277 v0.AddArg2(x, y)
2278 v1 := b.NewValue0(v.Pos, ssaop.OpNeg32, t)
2279 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
2280 v2.AuxInt = ssa.Int64ToAuxInt(64)
2281 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
2282 v3.AddArg(y)
2283 v2.AddArg(v3)
2284 v1.AddArg(v2)
2285 v.AddArg2(v0, v1)
2286 return true
2287 }
2288
2289
2290
2291 for {
2292 x := v_0
2293 y := v_1
2294 if !(ssa.ShiftIsBounded(v)) {
2295 break
2296 }
2297 v.Reset(ssaop.OpRISCV64SLL)
2298 v.AddArg2(x, y)
2299 return true
2300 }
2301 return false
2302 }
2303 func rewriteValue_OpLsh64x16(v *ssa.Value) bool {
2304 v_1 := v.Args[1]
2305 v_0 := v.Args[0]
2306 b := v.Block
2307 typ := &b.Func.Config.Types
2308
2309
2310
2311 for {
2312 t := v.Type
2313 x := v_0
2314 y := v_1
2315 if !(!ssa.ShiftIsBounded(v)) {
2316 break
2317 }
2318 v.Reset(ssaop.OpRISCV64AND)
2319 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, t)
2320 v0.AddArg2(x, y)
2321 v1 := b.NewValue0(v.Pos, ssaop.OpNeg64, t)
2322 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
2323 v2.AuxInt = ssa.Int64ToAuxInt(64)
2324 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
2325 v3.AddArg(y)
2326 v2.AddArg(v3)
2327 v1.AddArg(v2)
2328 v.AddArg2(v0, v1)
2329 return true
2330 }
2331
2332
2333
2334 for {
2335 x := v_0
2336 y := v_1
2337 if !(ssa.ShiftIsBounded(v)) {
2338 break
2339 }
2340 v.Reset(ssaop.OpRISCV64SLL)
2341 v.AddArg2(x, y)
2342 return true
2343 }
2344 return false
2345 }
2346 func rewriteValue_OpLsh64x32(v *ssa.Value) bool {
2347 v_1 := v.Args[1]
2348 v_0 := v.Args[0]
2349 b := v.Block
2350 typ := &b.Func.Config.Types
2351
2352
2353
2354 for {
2355 t := v.Type
2356 x := v_0
2357 y := v_1
2358 if !(!ssa.ShiftIsBounded(v)) {
2359 break
2360 }
2361 v.Reset(ssaop.OpRISCV64AND)
2362 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, t)
2363 v0.AddArg2(x, y)
2364 v1 := b.NewValue0(v.Pos, ssaop.OpNeg64, t)
2365 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
2366 v2.AuxInt = ssa.Int64ToAuxInt(64)
2367 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
2368 v3.AddArg(y)
2369 v2.AddArg(v3)
2370 v1.AddArg(v2)
2371 v.AddArg2(v0, v1)
2372 return true
2373 }
2374
2375
2376
2377 for {
2378 x := v_0
2379 y := v_1
2380 if !(ssa.ShiftIsBounded(v)) {
2381 break
2382 }
2383 v.Reset(ssaop.OpRISCV64SLL)
2384 v.AddArg2(x, y)
2385 return true
2386 }
2387 return false
2388 }
2389 func rewriteValue_OpLsh64x64(v *ssa.Value) bool {
2390 v_1 := v.Args[1]
2391 v_0 := v.Args[0]
2392 b := v.Block
2393
2394
2395
2396 for {
2397 t := v.Type
2398 x := v_0
2399 y := v_1
2400 if !(!ssa.ShiftIsBounded(v)) {
2401 break
2402 }
2403 v.Reset(ssaop.OpRISCV64AND)
2404 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, t)
2405 v0.AddArg2(x, y)
2406 v1 := b.NewValue0(v.Pos, ssaop.OpNeg64, t)
2407 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
2408 v2.AuxInt = ssa.Int64ToAuxInt(64)
2409 v2.AddArg(y)
2410 v1.AddArg(v2)
2411 v.AddArg2(v0, v1)
2412 return true
2413 }
2414
2415
2416
2417 for {
2418 x := v_0
2419 y := v_1
2420 if !(ssa.ShiftIsBounded(v)) {
2421 break
2422 }
2423 v.Reset(ssaop.OpRISCV64SLL)
2424 v.AddArg2(x, y)
2425 return true
2426 }
2427 return false
2428 }
2429 func rewriteValue_OpLsh64x8(v *ssa.Value) bool {
2430 v_1 := v.Args[1]
2431 v_0 := v.Args[0]
2432 b := v.Block
2433 typ := &b.Func.Config.Types
2434
2435
2436
2437 for {
2438 t := v.Type
2439 x := v_0
2440 y := v_1
2441 if !(!ssa.ShiftIsBounded(v)) {
2442 break
2443 }
2444 v.Reset(ssaop.OpRISCV64AND)
2445 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, t)
2446 v0.AddArg2(x, y)
2447 v1 := b.NewValue0(v.Pos, ssaop.OpNeg64, t)
2448 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
2449 v2.AuxInt = ssa.Int64ToAuxInt(64)
2450 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
2451 v3.AddArg(y)
2452 v2.AddArg(v3)
2453 v1.AddArg(v2)
2454 v.AddArg2(v0, v1)
2455 return true
2456 }
2457
2458
2459
2460 for {
2461 x := v_0
2462 y := v_1
2463 if !(ssa.ShiftIsBounded(v)) {
2464 break
2465 }
2466 v.Reset(ssaop.OpRISCV64SLL)
2467 v.AddArg2(x, y)
2468 return true
2469 }
2470 return false
2471 }
2472 func rewriteValue_OpLsh8x16(v *ssa.Value) bool {
2473 v_1 := v.Args[1]
2474 v_0 := v.Args[0]
2475 b := v.Block
2476 typ := &b.Func.Config.Types
2477
2478
2479
2480 for {
2481 t := v.Type
2482 x := v_0
2483 y := v_1
2484 if !(!ssa.ShiftIsBounded(v)) {
2485 break
2486 }
2487 v.Reset(ssaop.OpRISCV64AND)
2488 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, t)
2489 v0.AddArg2(x, y)
2490 v1 := b.NewValue0(v.Pos, ssaop.OpNeg8, t)
2491 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
2492 v2.AuxInt = ssa.Int64ToAuxInt(64)
2493 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
2494 v3.AddArg(y)
2495 v2.AddArg(v3)
2496 v1.AddArg(v2)
2497 v.AddArg2(v0, v1)
2498 return true
2499 }
2500
2501
2502
2503 for {
2504 x := v_0
2505 y := v_1
2506 if !(ssa.ShiftIsBounded(v)) {
2507 break
2508 }
2509 v.Reset(ssaop.OpRISCV64SLL)
2510 v.AddArg2(x, y)
2511 return true
2512 }
2513 return false
2514 }
2515 func rewriteValue_OpLsh8x32(v *ssa.Value) bool {
2516 v_1 := v.Args[1]
2517 v_0 := v.Args[0]
2518 b := v.Block
2519 typ := &b.Func.Config.Types
2520
2521
2522
2523 for {
2524 t := v.Type
2525 x := v_0
2526 y := v_1
2527 if !(!ssa.ShiftIsBounded(v)) {
2528 break
2529 }
2530 v.Reset(ssaop.OpRISCV64AND)
2531 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, t)
2532 v0.AddArg2(x, y)
2533 v1 := b.NewValue0(v.Pos, ssaop.OpNeg8, t)
2534 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
2535 v2.AuxInt = ssa.Int64ToAuxInt(64)
2536 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
2537 v3.AddArg(y)
2538 v2.AddArg(v3)
2539 v1.AddArg(v2)
2540 v.AddArg2(v0, v1)
2541 return true
2542 }
2543
2544
2545
2546 for {
2547 x := v_0
2548 y := v_1
2549 if !(ssa.ShiftIsBounded(v)) {
2550 break
2551 }
2552 v.Reset(ssaop.OpRISCV64SLL)
2553 v.AddArg2(x, y)
2554 return true
2555 }
2556 return false
2557 }
2558 func rewriteValue_OpLsh8x64(v *ssa.Value) bool {
2559 v_1 := v.Args[1]
2560 v_0 := v.Args[0]
2561 b := v.Block
2562
2563
2564
2565 for {
2566 t := v.Type
2567 x := v_0
2568 y := v_1
2569 if !(!ssa.ShiftIsBounded(v)) {
2570 break
2571 }
2572 v.Reset(ssaop.OpRISCV64AND)
2573 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, t)
2574 v0.AddArg2(x, y)
2575 v1 := b.NewValue0(v.Pos, ssaop.OpNeg8, t)
2576 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
2577 v2.AuxInt = ssa.Int64ToAuxInt(64)
2578 v2.AddArg(y)
2579 v1.AddArg(v2)
2580 v.AddArg2(v0, v1)
2581 return true
2582 }
2583
2584
2585
2586 for {
2587 x := v_0
2588 y := v_1
2589 if !(ssa.ShiftIsBounded(v)) {
2590 break
2591 }
2592 v.Reset(ssaop.OpRISCV64SLL)
2593 v.AddArg2(x, y)
2594 return true
2595 }
2596 return false
2597 }
2598 func rewriteValue_OpLsh8x8(v *ssa.Value) bool {
2599 v_1 := v.Args[1]
2600 v_0 := v.Args[0]
2601 b := v.Block
2602 typ := &b.Func.Config.Types
2603
2604
2605
2606 for {
2607 t := v.Type
2608 x := v_0
2609 y := v_1
2610 if !(!ssa.ShiftIsBounded(v)) {
2611 break
2612 }
2613 v.Reset(ssaop.OpRISCV64AND)
2614 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, t)
2615 v0.AddArg2(x, y)
2616 v1 := b.NewValue0(v.Pos, ssaop.OpNeg8, t)
2617 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
2618 v2.AuxInt = ssa.Int64ToAuxInt(64)
2619 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
2620 v3.AddArg(y)
2621 v2.AddArg(v3)
2622 v1.AddArg(v2)
2623 v.AddArg2(v0, v1)
2624 return true
2625 }
2626
2627
2628
2629 for {
2630 x := v_0
2631 y := v_1
2632 if !(ssa.ShiftIsBounded(v)) {
2633 break
2634 }
2635 v.Reset(ssaop.OpRISCV64SLL)
2636 v.AddArg2(x, y)
2637 return true
2638 }
2639 return false
2640 }
2641 func rewriteValue_OpMax64(v *ssa.Value) bool {
2642 v_1 := v.Args[1]
2643 v_0 := v.Args[0]
2644
2645
2646
2647 for {
2648 x := v_0
2649 y := v_1
2650 if !(buildcfg.GORISCV64 >= 22) {
2651 break
2652 }
2653 v.Reset(ssaop.OpRISCV64MAX)
2654 v.AddArg2(x, y)
2655 return true
2656 }
2657 return false
2658 }
2659 func rewriteValue_OpMax64u(v *ssa.Value) bool {
2660 v_1 := v.Args[1]
2661 v_0 := v.Args[0]
2662
2663
2664
2665 for {
2666 x := v_0
2667 y := v_1
2668 if !(buildcfg.GORISCV64 >= 22) {
2669 break
2670 }
2671 v.Reset(ssaop.OpRISCV64MAXU)
2672 v.AddArg2(x, y)
2673 return true
2674 }
2675 return false
2676 }
2677 func rewriteValue_OpMin64(v *ssa.Value) bool {
2678 v_1 := v.Args[1]
2679 v_0 := v.Args[0]
2680
2681
2682
2683 for {
2684 x := v_0
2685 y := v_1
2686 if !(buildcfg.GORISCV64 >= 22) {
2687 break
2688 }
2689 v.Reset(ssaop.OpRISCV64MIN)
2690 v.AddArg2(x, y)
2691 return true
2692 }
2693 return false
2694 }
2695 func rewriteValue_OpMin64u(v *ssa.Value) bool {
2696 v_1 := v.Args[1]
2697 v_0 := v.Args[0]
2698
2699
2700
2701 for {
2702 x := v_0
2703 y := v_1
2704 if !(buildcfg.GORISCV64 >= 22) {
2705 break
2706 }
2707 v.Reset(ssaop.OpRISCV64MINU)
2708 v.AddArg2(x, y)
2709 return true
2710 }
2711 return false
2712 }
2713 func rewriteValue_OpMod16(v *ssa.Value) bool {
2714 v_1 := v.Args[1]
2715 v_0 := v.Args[0]
2716 b := v.Block
2717 typ := &b.Func.Config.Types
2718
2719
2720 for {
2721 if ssa.AuxIntToBool(v.AuxInt) != false {
2722 break
2723 }
2724 x := v_0
2725 y := v_1
2726 v.Reset(ssaop.OpRISCV64REMW)
2727 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to32, typ.Int32)
2728 v0.AddArg(x)
2729 v1 := b.NewValue0(v.Pos, ssaop.OpSignExt16to32, typ.Int32)
2730 v1.AddArg(y)
2731 v.AddArg2(v0, v1)
2732 return true
2733 }
2734 return false
2735 }
2736 func rewriteValue_OpMod16u(v *ssa.Value) bool {
2737 v_1 := v.Args[1]
2738 v_0 := v.Args[0]
2739 b := v.Block
2740 typ := &b.Func.Config.Types
2741
2742
2743 for {
2744 x := v_0
2745 y := v_1
2746 v.Reset(ssaop.OpRISCV64REMUW)
2747 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
2748 v0.AddArg(x)
2749 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to32, typ.UInt32)
2750 v1.AddArg(y)
2751 v.AddArg2(v0, v1)
2752 return true
2753 }
2754 }
2755 func rewriteValue_OpMod32(v *ssa.Value) bool {
2756 v_1 := v.Args[1]
2757 v_0 := v.Args[0]
2758
2759
2760 for {
2761 if ssa.AuxIntToBool(v.AuxInt) != false {
2762 break
2763 }
2764 x := v_0
2765 y := v_1
2766 v.Reset(ssaop.OpRISCV64REMW)
2767 v.AddArg2(x, y)
2768 return true
2769 }
2770 return false
2771 }
2772 func rewriteValue_OpMod64(v *ssa.Value) bool {
2773 v_1 := v.Args[1]
2774 v_0 := v.Args[0]
2775
2776
2777 for {
2778 if ssa.AuxIntToBool(v.AuxInt) != false {
2779 break
2780 }
2781 x := v_0
2782 y := v_1
2783 v.Reset(ssaop.OpRISCV64REM)
2784 v.AddArg2(x, y)
2785 return true
2786 }
2787 return false
2788 }
2789 func rewriteValue_OpMod8(v *ssa.Value) bool {
2790 v_1 := v.Args[1]
2791 v_0 := v.Args[0]
2792 b := v.Block
2793 typ := &b.Func.Config.Types
2794
2795
2796 for {
2797 x := v_0
2798 y := v_1
2799 v.Reset(ssaop.OpRISCV64REMW)
2800 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt8to32, typ.Int32)
2801 v0.AddArg(x)
2802 v1 := b.NewValue0(v.Pos, ssaop.OpSignExt8to32, typ.Int32)
2803 v1.AddArg(y)
2804 v.AddArg2(v0, v1)
2805 return true
2806 }
2807 }
2808 func rewriteValue_OpMod8u(v *ssa.Value) bool {
2809 v_1 := v.Args[1]
2810 v_0 := v.Args[0]
2811 b := v.Block
2812 typ := &b.Func.Config.Types
2813
2814
2815 for {
2816 x := v_0
2817 y := v_1
2818 v.Reset(ssaop.OpRISCV64REMUW)
2819 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
2820 v0.AddArg(x)
2821 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)
2822 v1.AddArg(y)
2823 v.AddArg2(v0, v1)
2824 return true
2825 }
2826 }
2827 func rewriteValue_OpMove(v *ssa.Value) bool {
2828 v_2 := v.Args[2]
2829 v_1 := v.Args[1]
2830 v_0 := v.Args[0]
2831 b := v.Block
2832 config := b.Func.Config
2833 typ := &b.Func.Config.Types
2834
2835
2836 for {
2837 if ssa.AuxIntToInt64(v.AuxInt) != 0 {
2838 break
2839 }
2840 mem := v_2
2841 v.CopyOf(mem)
2842 return true
2843 }
2844
2845
2846 for {
2847 if ssa.AuxIntToInt64(v.AuxInt) != 1 {
2848 break
2849 }
2850 dst := v_0
2851 src := v_1
2852 mem := v_2
2853 v.Reset(ssaop.OpRISCV64MOVBstore)
2854 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBload, typ.Int8)
2855 v0.AddArg2(src, mem)
2856 v.AddArg3(dst, v0, mem)
2857 return true
2858 }
2859
2860
2861
2862 for {
2863 if ssa.AuxIntToInt64(v.AuxInt) != 2 {
2864 break
2865 }
2866 t := ssa.AuxToType(v.Aux)
2867 dst := v_0
2868 src := v_1
2869 mem := v_2
2870 if !(t.Alignment()%2 == 0) {
2871 break
2872 }
2873 v.Reset(ssaop.OpRISCV64MOVHstore)
2874 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHload, typ.Int16)
2875 v0.AddArg2(src, mem)
2876 v.AddArg3(dst, v0, mem)
2877 return true
2878 }
2879
2880
2881 for {
2882 if ssa.AuxIntToInt64(v.AuxInt) != 2 {
2883 break
2884 }
2885 dst := v_0
2886 src := v_1
2887 mem := v_2
2888 v.Reset(ssaop.OpRISCV64MOVBstore)
2889 v.AuxInt = ssa.Int32ToAuxInt(1)
2890 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBload, typ.Int8)
2891 v0.AuxInt = ssa.Int32ToAuxInt(1)
2892 v0.AddArg2(src, mem)
2893 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBstore, types.TypeMem)
2894 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBload, typ.Int8)
2895 v2.AddArg2(src, mem)
2896 v1.AddArg3(dst, v2, mem)
2897 v.AddArg3(dst, v0, v1)
2898 return true
2899 }
2900
2901
2902
2903 for {
2904 if ssa.AuxIntToInt64(v.AuxInt) != 4 {
2905 break
2906 }
2907 t := ssa.AuxToType(v.Aux)
2908 dst := v_0
2909 src := v_1
2910 mem := v_2
2911 if !(t.Alignment()%4 == 0) {
2912 break
2913 }
2914 v.Reset(ssaop.OpRISCV64MOVWstore)
2915 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVWload, typ.Int32)
2916 v0.AddArg2(src, mem)
2917 v.AddArg3(dst, v0, mem)
2918 return true
2919 }
2920
2921
2922
2923 for {
2924 if ssa.AuxIntToInt64(v.AuxInt) != 4 {
2925 break
2926 }
2927 t := ssa.AuxToType(v.Aux)
2928 dst := v_0
2929 src := v_1
2930 mem := v_2
2931 if !(t.Alignment()%2 == 0) {
2932 break
2933 }
2934 v.Reset(ssaop.OpRISCV64MOVHstore)
2935 v.AuxInt = ssa.Int32ToAuxInt(2)
2936 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHload, typ.Int16)
2937 v0.AuxInt = ssa.Int32ToAuxInt(2)
2938 v0.AddArg2(src, mem)
2939 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHstore, types.TypeMem)
2940 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHload, typ.Int16)
2941 v2.AddArg2(src, mem)
2942 v1.AddArg3(dst, v2, mem)
2943 v.AddArg3(dst, v0, v1)
2944 return true
2945 }
2946
2947
2948 for {
2949 if ssa.AuxIntToInt64(v.AuxInt) != 4 {
2950 break
2951 }
2952 dst := v_0
2953 src := v_1
2954 mem := v_2
2955 v.Reset(ssaop.OpRISCV64MOVBstore)
2956 v.AuxInt = ssa.Int32ToAuxInt(3)
2957 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBload, typ.Int8)
2958 v0.AuxInt = ssa.Int32ToAuxInt(3)
2959 v0.AddArg2(src, mem)
2960 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBstore, types.TypeMem)
2961 v1.AuxInt = ssa.Int32ToAuxInt(2)
2962 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBload, typ.Int8)
2963 v2.AuxInt = ssa.Int32ToAuxInt(2)
2964 v2.AddArg2(src, mem)
2965 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBstore, types.TypeMem)
2966 v3.AuxInt = ssa.Int32ToAuxInt(1)
2967 v4 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBload, typ.Int8)
2968 v4.AuxInt = ssa.Int32ToAuxInt(1)
2969 v4.AddArg2(src, mem)
2970 v5 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBstore, types.TypeMem)
2971 v6 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBload, typ.Int8)
2972 v6.AddArg2(src, mem)
2973 v5.AddArg3(dst, v6, mem)
2974 v3.AddArg3(dst, v4, v5)
2975 v1.AddArg3(dst, v2, v3)
2976 v.AddArg3(dst, v0, v1)
2977 return true
2978 }
2979
2980
2981
2982 for {
2983 if ssa.AuxIntToInt64(v.AuxInt) != 8 {
2984 break
2985 }
2986 t := ssa.AuxToType(v.Aux)
2987 dst := v_0
2988 src := v_1
2989 mem := v_2
2990 if !(t.Alignment()%8 == 0) {
2991 break
2992 }
2993 v.Reset(ssaop.OpRISCV64MOVDstore)
2994 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDload, typ.Int64)
2995 v0.AddArg2(src, mem)
2996 v.AddArg3(dst, v0, mem)
2997 return true
2998 }
2999
3000
3001
3002 for {
3003 if ssa.AuxIntToInt64(v.AuxInt) != 8 {
3004 break
3005 }
3006 t := ssa.AuxToType(v.Aux)
3007 dst := v_0
3008 src := v_1
3009 mem := v_2
3010 if !(t.Alignment()%4 == 0) {
3011 break
3012 }
3013 v.Reset(ssaop.OpRISCV64MOVWstore)
3014 v.AuxInt = ssa.Int32ToAuxInt(4)
3015 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVWload, typ.Int32)
3016 v0.AuxInt = ssa.Int32ToAuxInt(4)
3017 v0.AddArg2(src, mem)
3018 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVWstore, types.TypeMem)
3019 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVWload, typ.Int32)
3020 v2.AddArg2(src, mem)
3021 v1.AddArg3(dst, v2, mem)
3022 v.AddArg3(dst, v0, v1)
3023 return true
3024 }
3025
3026
3027
3028 for {
3029 if ssa.AuxIntToInt64(v.AuxInt) != 8 {
3030 break
3031 }
3032 t := ssa.AuxToType(v.Aux)
3033 dst := v_0
3034 src := v_1
3035 mem := v_2
3036 if !(t.Alignment()%2 == 0) {
3037 break
3038 }
3039 v.Reset(ssaop.OpRISCV64MOVHstore)
3040 v.AuxInt = ssa.Int32ToAuxInt(6)
3041 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHload, typ.Int16)
3042 v0.AuxInt = ssa.Int32ToAuxInt(6)
3043 v0.AddArg2(src, mem)
3044 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHstore, types.TypeMem)
3045 v1.AuxInt = ssa.Int32ToAuxInt(4)
3046 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHload, typ.Int16)
3047 v2.AuxInt = ssa.Int32ToAuxInt(4)
3048 v2.AddArg2(src, mem)
3049 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHstore, types.TypeMem)
3050 v3.AuxInt = ssa.Int32ToAuxInt(2)
3051 v4 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHload, typ.Int16)
3052 v4.AuxInt = ssa.Int32ToAuxInt(2)
3053 v4.AddArg2(src, mem)
3054 v5 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHstore, types.TypeMem)
3055 v6 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHload, typ.Int16)
3056 v6.AddArg2(src, mem)
3057 v5.AddArg3(dst, v6, mem)
3058 v3.AddArg3(dst, v4, v5)
3059 v1.AddArg3(dst, v2, v3)
3060 v.AddArg3(dst, v0, v1)
3061 return true
3062 }
3063
3064
3065 for {
3066 if ssa.AuxIntToInt64(v.AuxInt) != 3 {
3067 break
3068 }
3069 dst := v_0
3070 src := v_1
3071 mem := v_2
3072 v.Reset(ssaop.OpRISCV64MOVBstore)
3073 v.AuxInt = ssa.Int32ToAuxInt(2)
3074 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBload, typ.Int8)
3075 v0.AuxInt = ssa.Int32ToAuxInt(2)
3076 v0.AddArg2(src, mem)
3077 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBstore, types.TypeMem)
3078 v1.AuxInt = ssa.Int32ToAuxInt(1)
3079 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBload, typ.Int8)
3080 v2.AuxInt = ssa.Int32ToAuxInt(1)
3081 v2.AddArg2(src, mem)
3082 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBstore, types.TypeMem)
3083 v4 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBload, typ.Int8)
3084 v4.AddArg2(src, mem)
3085 v3.AddArg3(dst, v4, mem)
3086 v1.AddArg3(dst, v2, v3)
3087 v.AddArg3(dst, v0, v1)
3088 return true
3089 }
3090
3091
3092
3093 for {
3094 if ssa.AuxIntToInt64(v.AuxInt) != 6 {
3095 break
3096 }
3097 t := ssa.AuxToType(v.Aux)
3098 dst := v_0
3099 src := v_1
3100 mem := v_2
3101 if !(t.Alignment()%2 == 0) {
3102 break
3103 }
3104 v.Reset(ssaop.OpRISCV64MOVHstore)
3105 v.AuxInt = ssa.Int32ToAuxInt(4)
3106 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHload, typ.Int16)
3107 v0.AuxInt = ssa.Int32ToAuxInt(4)
3108 v0.AddArg2(src, mem)
3109 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHstore, types.TypeMem)
3110 v1.AuxInt = ssa.Int32ToAuxInt(2)
3111 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHload, typ.Int16)
3112 v2.AuxInt = ssa.Int32ToAuxInt(2)
3113 v2.AddArg2(src, mem)
3114 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHstore, types.TypeMem)
3115 v4 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHload, typ.Int16)
3116 v4.AddArg2(src, mem)
3117 v3.AddArg3(dst, v4, mem)
3118 v1.AddArg3(dst, v2, v3)
3119 v.AddArg3(dst, v0, v1)
3120 return true
3121 }
3122
3123
3124
3125 for {
3126 s := ssa.AuxIntToInt64(v.AuxInt)
3127 t := ssa.AuxToType(v.Aux)
3128 dst := v_0
3129 src := v_1
3130 mem := v_2
3131 if !(s > 0 && s <= 3*8*ssa.MoveSize(t.Alignment(), config) && ssa.LogLargeCopyValue(v, s)) {
3132 break
3133 }
3134 v.Reset(ssaop.OpRISCV64LoweredMove)
3135 v.AuxInt = ssa.ValAndOffToAuxInt(ssa.MakeValAndOff(int32(s), int32(t.Alignment())))
3136 v.AddArg3(dst, src, mem)
3137 return true
3138 }
3139
3140
3141
3142 for {
3143 s := ssa.AuxIntToInt64(v.AuxInt)
3144 t := ssa.AuxToType(v.Aux)
3145 dst := v_0
3146 src := v_1
3147 mem := v_2
3148 if !(s > 3*8*ssa.MoveSize(t.Alignment(), config) && ssa.LogLargeCopyValue(v, s)) {
3149 break
3150 }
3151 v.Reset(ssaop.OpRISCV64LoweredMoveLoop)
3152 v.AuxInt = ssa.ValAndOffToAuxInt(ssa.MakeValAndOff(int32(s), int32(t.Alignment())))
3153 v.AddArg3(dst, src, mem)
3154 return true
3155 }
3156 return false
3157 }
3158 func rewriteValue_OpNeq16(v *ssa.Value) bool {
3159 v_1 := v.Args[1]
3160 v_0 := v.Args[0]
3161 b := v.Block
3162 typ := &b.Func.Config.Types
3163
3164
3165 for {
3166 x := v_0
3167 y := v_1
3168 v.Reset(ssaop.OpNot)
3169 v0 := b.NewValue0(v.Pos, ssaop.OpEq16, typ.Bool)
3170 v0.AddArg2(x, y)
3171 v.AddArg(v0)
3172 return true
3173 }
3174 }
3175 func rewriteValue_OpNeq32(v *ssa.Value) bool {
3176 v_1 := v.Args[1]
3177 v_0 := v.Args[0]
3178 b := v.Block
3179 typ := &b.Func.Config.Types
3180
3181
3182 for {
3183 x := v_0
3184 y := v_1
3185 v.Reset(ssaop.OpNot)
3186 v0 := b.NewValue0(v.Pos, ssaop.OpEq32, typ.Bool)
3187 v0.AddArg2(x, y)
3188 v.AddArg(v0)
3189 return true
3190 }
3191 }
3192 func rewriteValue_OpNeq64(v *ssa.Value) bool {
3193 v_1 := v.Args[1]
3194 v_0 := v.Args[0]
3195 b := v.Block
3196 typ := &b.Func.Config.Types
3197
3198
3199 for {
3200 x := v_0
3201 y := v_1
3202 v.Reset(ssaop.OpNot)
3203 v0 := b.NewValue0(v.Pos, ssaop.OpEq64, typ.Bool)
3204 v0.AddArg2(x, y)
3205 v.AddArg(v0)
3206 return true
3207 }
3208 }
3209 func rewriteValue_OpNeq8(v *ssa.Value) bool {
3210 v_1 := v.Args[1]
3211 v_0 := v.Args[0]
3212 b := v.Block
3213 typ := &b.Func.Config.Types
3214
3215
3216 for {
3217 x := v_0
3218 y := v_1
3219 v.Reset(ssaop.OpNot)
3220 v0 := b.NewValue0(v.Pos, ssaop.OpEq8, typ.Bool)
3221 v0.AddArg2(x, y)
3222 v.AddArg(v0)
3223 return true
3224 }
3225 }
3226 func rewriteValue_OpNeqB(v *ssa.Value) bool {
3227 v_1 := v.Args[1]
3228 v_0 := v.Args[0]
3229 b := v.Block
3230 typ := &b.Func.Config.Types
3231
3232
3233 for {
3234 x := v_0
3235 y := v_1
3236 v.Reset(ssaop.OpRISCV64SNEZ)
3237 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SUB, typ.Bool)
3238 v0.AddArg2(x, y)
3239 v.AddArg(v0)
3240 return true
3241 }
3242 }
3243 func rewriteValue_OpNeqPtr(v *ssa.Value) bool {
3244 v_1 := v.Args[1]
3245 v_0 := v.Args[0]
3246 b := v.Block
3247 typ := &b.Func.Config.Types
3248
3249
3250 for {
3251 x := v_0
3252 y := v_1
3253 v.Reset(ssaop.OpNot)
3254 v0 := b.NewValue0(v.Pos, ssaop.OpEqPtr, typ.Bool)
3255 v0.AddArg2(x, y)
3256 v.AddArg(v0)
3257 return true
3258 }
3259 }
3260 func rewriteValue_OpOffPtr(v *ssa.Value) bool {
3261 v_0 := v.Args[0]
3262 b := v.Block
3263 typ := &b.Func.Config.Types
3264
3265
3266
3267 for {
3268 off := ssa.AuxIntToInt64(v.AuxInt)
3269 ptr := v_0
3270 if ptr.Op != ssaop.OpSP || !(ssa.Is32Bit(off)) {
3271 break
3272 }
3273 v.Reset(ssaop.OpRISCV64MOVaddr)
3274 v.AuxInt = ssa.Int32ToAuxInt(int32(off))
3275 v.AddArg(ptr)
3276 return true
3277 }
3278
3279
3280
3281 for {
3282 off := ssa.AuxIntToInt64(v.AuxInt)
3283 ptr := v_0
3284 if !(ssa.Is32Bit(off)) {
3285 break
3286 }
3287 v.Reset(ssaop.OpRISCV64ADDI)
3288 v.AuxInt = ssa.Int64ToAuxInt(off)
3289 v.AddArg(ptr)
3290 return true
3291 }
3292
3293
3294 for {
3295 off := ssa.AuxIntToInt64(v.AuxInt)
3296 ptr := v_0
3297 v.Reset(ssaop.OpRISCV64ADD)
3298 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
3299 v0.AuxInt = ssa.Int64ToAuxInt(off)
3300 v.AddArg2(v0, ptr)
3301 return true
3302 }
3303 }
3304 func rewriteValue_OpPopCount16(v *ssa.Value) bool {
3305 v_0 := v.Args[0]
3306 b := v.Block
3307 typ := &b.Func.Config.Types
3308
3309
3310 for {
3311 x := v_0
3312 v.Reset(ssaop.OpRISCV64CPOP)
3313 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
3314 v0.AddArg(x)
3315 v.AddArg(v0)
3316 return true
3317 }
3318 }
3319 func rewriteValue_OpPopCount8(v *ssa.Value) bool {
3320 v_0 := v.Args[0]
3321 b := v.Block
3322 typ := &b.Func.Config.Types
3323
3324
3325 for {
3326 x := v_0
3327 v.Reset(ssaop.OpRISCV64CPOP)
3328 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
3329 v0.AddArg(x)
3330 v.AddArg(v0)
3331 return true
3332 }
3333 }
3334 func rewriteValue_OpRISCV64ADD(v *ssa.Value) bool {
3335 v_1 := v.Args[1]
3336 v_0 := v.Args[0]
3337
3338
3339
3340 for {
3341 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3342 if v_0.Op != ssaop.OpRISCV64MOVDconst {
3343 continue
3344 }
3345 t := v_0.Type
3346 val := ssa.AuxIntToInt64(v_0.AuxInt)
3347 x := v_1
3348 if !(ssa.Is32Bit(val) && !t.IsPtr()) {
3349 continue
3350 }
3351 v.Reset(ssaop.OpRISCV64ADDI)
3352 v.AuxInt = ssa.Int64ToAuxInt(val)
3353 v.AddArg(x)
3354 return true
3355 }
3356 break
3357 }
3358
3359
3360 for {
3361 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3362 x := v_0
3363 if v_1.Op != ssaop.OpRISCV64NEG {
3364 continue
3365 }
3366 y := v_1.Args[0]
3367 v.Reset(ssaop.OpRISCV64SUB)
3368 v.AddArg2(x, y)
3369 return true
3370 }
3371 break
3372 }
3373
3374
3375
3376 for {
3377 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3378 if v_0.Op != ssaop.OpRISCV64SLLI || ssa.AuxIntToInt64(v_0.AuxInt) != 1 {
3379 continue
3380 }
3381 x := v_0.Args[0]
3382 y := v_1
3383 if !(buildcfg.GORISCV64 >= 22) {
3384 continue
3385 }
3386 v.Reset(ssaop.OpRISCV64SH1ADD)
3387 v.AddArg2(x, y)
3388 return true
3389 }
3390 break
3391 }
3392
3393
3394
3395 for {
3396 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3397 if v_0.Op != ssaop.OpRISCV64SLLI || ssa.AuxIntToInt64(v_0.AuxInt) != 2 {
3398 continue
3399 }
3400 x := v_0.Args[0]
3401 y := v_1
3402 if !(buildcfg.GORISCV64 >= 22) {
3403 continue
3404 }
3405 v.Reset(ssaop.OpRISCV64SH2ADD)
3406 v.AddArg2(x, y)
3407 return true
3408 }
3409 break
3410 }
3411
3412
3413
3414 for {
3415 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3416 if v_0.Op != ssaop.OpRISCV64SLLI || ssa.AuxIntToInt64(v_0.AuxInt) != 3 {
3417 continue
3418 }
3419 x := v_0.Args[0]
3420 y := v_1
3421 if !(buildcfg.GORISCV64 >= 22) {
3422 continue
3423 }
3424 v.Reset(ssaop.OpRISCV64SH3ADD)
3425 v.AddArg2(x, y)
3426 return true
3427 }
3428 break
3429 }
3430 return false
3431 }
3432 func rewriteValue_OpRISCV64ADDI(v *ssa.Value) bool {
3433 v_0 := v.Args[0]
3434
3435
3436
3437 for {
3438 c := ssa.AuxIntToInt64(v.AuxInt)
3439 if v_0.Op != ssaop.OpRISCV64MOVaddr {
3440 break
3441 }
3442 d := ssa.AuxIntToInt32(v_0.AuxInt)
3443 s := ssa.AuxToSym(v_0.Aux)
3444 x := v_0.Args[0]
3445 if !(ssa.Is32Bit(c + int64(d))) {
3446 break
3447 }
3448 v.Reset(ssaop.OpRISCV64MOVaddr)
3449 v.AuxInt = ssa.Int32ToAuxInt(int32(c) + d)
3450 v.Aux = ssa.SymToAux(s)
3451 v.AddArg(x)
3452 return true
3453 }
3454
3455
3456 for {
3457 if ssa.AuxIntToInt64(v.AuxInt) != 0 {
3458 break
3459 }
3460 x := v_0
3461 v.CopyOf(x)
3462 return true
3463 }
3464
3465
3466
3467 for {
3468 x := ssa.AuxIntToInt64(v.AuxInt)
3469 if v_0.Op != ssaop.OpRISCV64MOVDconst {
3470 break
3471 }
3472 y := ssa.AuxIntToInt64(v_0.AuxInt)
3473 if !(ssa.Is32Bit(x + y)) {
3474 break
3475 }
3476 v.Reset(ssaop.OpRISCV64MOVDconst)
3477 v.AuxInt = ssa.Int64ToAuxInt(x + y)
3478 return true
3479 }
3480
3481
3482
3483 for {
3484 x := ssa.AuxIntToInt64(v.AuxInt)
3485 if v_0.Op != ssaop.OpRISCV64ADDI {
3486 break
3487 }
3488 y := ssa.AuxIntToInt64(v_0.AuxInt)
3489 z := v_0.Args[0]
3490 if !(ssa.Is32Bit(x + y)) {
3491 break
3492 }
3493 v.Reset(ssaop.OpRISCV64ADDI)
3494 v.AuxInt = ssa.Int64ToAuxInt(x + y)
3495 v.AddArg(z)
3496 return true
3497 }
3498 return false
3499 }
3500 func rewriteValue_OpRISCV64AND(v *ssa.Value) bool {
3501 v_1 := v.Args[1]
3502 v_0 := v.Args[0]
3503
3504
3505
3506 for {
3507 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3508 if v_0.Op != ssaop.OpRISCV64MOVDconst {
3509 continue
3510 }
3511 val := ssa.AuxIntToInt64(v_0.AuxInt)
3512 x := v_1
3513 if !(ssa.Is32Bit(val)) {
3514 continue
3515 }
3516 v.Reset(ssaop.OpRISCV64ANDI)
3517 v.AuxInt = ssa.Int64ToAuxInt(val)
3518 v.AddArg(x)
3519 return true
3520 }
3521 break
3522 }
3523
3524
3525 for {
3526 x := v_0
3527 if x != v_1 {
3528 break
3529 }
3530 v.CopyOf(x)
3531 return true
3532 }
3533 return false
3534 }
3535 func rewriteValue_OpRISCV64ANDI(v *ssa.Value) bool {
3536 v_0 := v.Args[0]
3537
3538
3539 for {
3540 if ssa.AuxIntToInt64(v.AuxInt) != 0 {
3541 break
3542 }
3543 v.Reset(ssaop.OpRISCV64MOVDconst)
3544 v.AuxInt = ssa.Int64ToAuxInt(0)
3545 return true
3546 }
3547
3548
3549 for {
3550 if ssa.AuxIntToInt64(v.AuxInt) != -1 {
3551 break
3552 }
3553 x := v_0
3554 v.CopyOf(x)
3555 return true
3556 }
3557
3558
3559 for {
3560 x := ssa.AuxIntToInt64(v.AuxInt)
3561 if v_0.Op != ssaop.OpRISCV64MOVDconst {
3562 break
3563 }
3564 y := ssa.AuxIntToInt64(v_0.AuxInt)
3565 v.Reset(ssaop.OpRISCV64MOVDconst)
3566 v.AuxInt = ssa.Int64ToAuxInt(x & y)
3567 return true
3568 }
3569
3570
3571 for {
3572 x := ssa.AuxIntToInt64(v.AuxInt)
3573 if v_0.Op != ssaop.OpRISCV64ANDI {
3574 break
3575 }
3576 y := ssa.AuxIntToInt64(v_0.AuxInt)
3577 z := v_0.Args[0]
3578 v.Reset(ssaop.OpRISCV64ANDI)
3579 v.AuxInt = ssa.Int64ToAuxInt(x & y)
3580 v.AddArg(z)
3581 return true
3582 }
3583 return false
3584 }
3585 func rewriteValue_OpRISCV64CZEROEQZ(v *ssa.Value) bool {
3586 v_1 := v.Args[1]
3587 v_0 := v.Args[0]
3588
3589
3590 for {
3591 x := v_0
3592 if v_1.Op != ssaop.OpRISCV64SNEZ {
3593 break
3594 }
3595 y := v_1.Args[0]
3596 v.Reset(ssaop.OpRISCV64CZEROEQZ)
3597 v.AddArg2(x, y)
3598 return true
3599 }
3600
3601
3602 for {
3603 x := v_0
3604 if v_1.Op != ssaop.OpRISCV64SEQZ {
3605 break
3606 }
3607 y := v_1.Args[0]
3608 v.Reset(ssaop.OpRISCV64CZERONEZ)
3609 v.AddArg2(x, y)
3610 return true
3611 }
3612
3613
3614 for {
3615 x := v_0
3616 if v_1.Op != ssaop.OpRISCV64NEG {
3617 break
3618 }
3619 y := v_1.Args[0]
3620 v.Reset(ssaop.OpRISCV64CZEROEQZ)
3621 v.AddArg2(x, y)
3622 return true
3623 }
3624
3625
3626 for {
3627 x := v_0
3628 if x != v_1 {
3629 break
3630 }
3631 v.CopyOf(x)
3632 return true
3633 }
3634
3635
3636 for {
3637 if v_0.Op != ssaop.OpRISCV64MOVDconst || ssa.AuxIntToInt64(v_0.AuxInt) != 0 {
3638 break
3639 }
3640 v.Reset(ssaop.OpRISCV64MOVDconst)
3641 v.AuxInt = ssa.Int64ToAuxInt(0)
3642 return true
3643 }
3644 return false
3645 }
3646 func rewriteValue_OpRISCV64CZERONEZ(v *ssa.Value) bool {
3647 v_1 := v.Args[1]
3648 v_0 := v.Args[0]
3649
3650
3651 for {
3652 x := v_0
3653 if v_1.Op != ssaop.OpRISCV64SNEZ {
3654 break
3655 }
3656 y := v_1.Args[0]
3657 v.Reset(ssaop.OpRISCV64CZERONEZ)
3658 v.AddArg2(x, y)
3659 return true
3660 }
3661
3662
3663 for {
3664 x := v_0
3665 if v_1.Op != ssaop.OpRISCV64SEQZ {
3666 break
3667 }
3668 y := v_1.Args[0]
3669 v.Reset(ssaop.OpRISCV64CZEROEQZ)
3670 v.AddArg2(x, y)
3671 return true
3672 }
3673
3674
3675 for {
3676 x := v_0
3677 if v_1.Op != ssaop.OpRISCV64NEG {
3678 break
3679 }
3680 y := v_1.Args[0]
3681 v.Reset(ssaop.OpRISCV64CZERONEZ)
3682 v.AddArg2(x, y)
3683 return true
3684 }
3685
3686
3687 for {
3688 x := v_0
3689 if x != v_1 {
3690 break
3691 }
3692 v.Reset(ssaop.OpRISCV64MOVDconst)
3693 v.AuxInt = ssa.Int64ToAuxInt(0)
3694 return true
3695 }
3696
3697
3698 for {
3699 if v_0.Op != ssaop.OpRISCV64MOVDconst || ssa.AuxIntToInt64(v_0.AuxInt) != 0 {
3700 break
3701 }
3702 v.Reset(ssaop.OpRISCV64MOVDconst)
3703 v.AuxInt = ssa.Int64ToAuxInt(0)
3704 return true
3705 }
3706 return false
3707 }
3708 func rewriteValue_OpRISCV64FADDD(v *ssa.Value) bool {
3709 v_1 := v.Args[1]
3710 v_0 := v.Args[0]
3711
3712
3713
3714 for {
3715 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3716 a := v_0
3717 if v_1.Op != ssaop.OpRISCV64FMULD {
3718 continue
3719 }
3720 y := v_1.Args[1]
3721 x := v_1.Args[0]
3722 if !(a.Block.Func.UseFMA(v)) {
3723 continue
3724 }
3725 v.Reset(ssaop.OpRISCV64FMADDD)
3726 v.AddArg3(x, y, a)
3727 return true
3728 }
3729 break
3730 }
3731 return false
3732 }
3733 func rewriteValue_OpRISCV64FADDS(v *ssa.Value) bool {
3734 v_1 := v.Args[1]
3735 v_0 := v.Args[0]
3736
3737
3738
3739 for {
3740 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3741 a := v_0
3742 if v_1.Op != ssaop.OpRISCV64FMULS {
3743 continue
3744 }
3745 y := v_1.Args[1]
3746 x := v_1.Args[0]
3747 if !(a.Block.Func.UseFMA(v)) {
3748 continue
3749 }
3750 v.Reset(ssaop.OpRISCV64FMADDS)
3751 v.AddArg3(x, y, a)
3752 return true
3753 }
3754 break
3755 }
3756 return false
3757 }
3758 func rewriteValue_OpRISCV64FCVTSD(v *ssa.Value) bool {
3759 v_0 := v.Args[0]
3760
3761
3762 for {
3763 if v_0.Op != ssaop.OpRISCV64FABSD {
3764 break
3765 }
3766 v_0_0 := v_0.Args[0]
3767 if v_0_0.Op != ssaop.OpRISCV64FCVTDS {
3768 break
3769 }
3770 X := v_0_0.Args[0]
3771 v.Reset(ssaop.OpRISCV64FABSS)
3772 v.AddArg(X)
3773 return true
3774 }
3775
3776
3777 for {
3778 if v_0.Op != ssaop.OpRISCV64FSQRTD {
3779 break
3780 }
3781 v_0_0 := v_0.Args[0]
3782 if v_0_0.Op != ssaop.OpRISCV64FCVTDS {
3783 break
3784 }
3785 X := v_0_0.Args[0]
3786 v.Reset(ssaop.OpRISCV64FSQRTS)
3787 v.AddArg(X)
3788 return true
3789 }
3790 return false
3791 }
3792 func rewriteValue_OpRISCV64FEQD(v *ssa.Value) bool {
3793 v_1 := v.Args[1]
3794 v_0 := v.Args[0]
3795 b := v.Block
3796 typ := &b.Func.Config.Types
3797
3798
3799 for {
3800 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3801 x := v_0
3802 if v_1.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_1.AuxInt) != math.Inf(-1) {
3803 continue
3804 }
3805 v.Reset(ssaop.OpRISCV64ANDI)
3806 v.AuxInt = ssa.Int64ToAuxInt(0b00_0000_0001)
3807 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
3808 v0.AddArg(x)
3809 v.AddArg(v0)
3810 return true
3811 }
3812 break
3813 }
3814
3815
3816 for {
3817 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3818 x := v_0
3819 if v_1.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_1.AuxInt) != math.Inf(1) {
3820 continue
3821 }
3822 v.Reset(ssaop.OpRISCV64SNEZ)
3823 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
3824 v0.AuxInt = ssa.Int64ToAuxInt(0b00_1000_0000)
3825 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
3826 v1.AddArg(x)
3827 v0.AddArg(v1)
3828 v.AddArg(v0)
3829 return true
3830 }
3831 break
3832 }
3833 return false
3834 }
3835 func rewriteValue_OpRISCV64FLED(v *ssa.Value) bool {
3836 v_1 := v.Args[1]
3837 v_0 := v.Args[0]
3838 b := v.Block
3839 typ := &b.Func.Config.Types
3840
3841
3842 for {
3843 if v_0.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_0.AuxInt) != -math.MaxFloat64 {
3844 break
3845 }
3846 x := v_1
3847 v.Reset(ssaop.OpRISCV64SNEZ)
3848 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
3849 v0.AuxInt = ssa.Int64ToAuxInt(0b00_1111_1110)
3850 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
3851 v1.AddArg(x)
3852 v0.AddArg(v1)
3853 v.AddArg(v0)
3854 return true
3855 }
3856
3857
3858 for {
3859 x := v_0
3860 if v_1.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_1.AuxInt) != math.MaxFloat64 {
3861 break
3862 }
3863 v.Reset(ssaop.OpRISCV64SNEZ)
3864 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
3865 v0.AuxInt = ssa.Int64ToAuxInt(0b00_0111_1111)
3866 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
3867 v1.AddArg(x)
3868 v0.AddArg(v1)
3869 v.AddArg(v0)
3870 return true
3871 }
3872
3873
3874 for {
3875 if v_0.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_0.AuxInt) != +0x1p-1022 {
3876 break
3877 }
3878 x := v_1
3879 v.Reset(ssaop.OpRISCV64SNEZ)
3880 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
3881 v0.AuxInt = ssa.Int64ToAuxInt(0b00_1100_0000)
3882 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
3883 v1.AddArg(x)
3884 v0.AddArg(v1)
3885 v.AddArg(v0)
3886 return true
3887 }
3888
3889
3890 for {
3891 x := v_0
3892 if v_1.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_1.AuxInt) != -0x1p-1022 {
3893 break
3894 }
3895 v.Reset(ssaop.OpRISCV64SNEZ)
3896 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
3897 v0.AuxInt = ssa.Int64ToAuxInt(0b00_0000_0011)
3898 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
3899 v1.AddArg(x)
3900 v0.AddArg(v1)
3901 v.AddArg(v0)
3902 return true
3903 }
3904 return false
3905 }
3906 func rewriteValue_OpRISCV64FLTD(v *ssa.Value) bool {
3907 v_1 := v.Args[1]
3908 v_0 := v.Args[0]
3909 b := v.Block
3910 typ := &b.Func.Config.Types
3911
3912
3913 for {
3914 x := v_0
3915 if v_1.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_1.AuxInt) != -math.MaxFloat64 {
3916 break
3917 }
3918 v.Reset(ssaop.OpRISCV64ANDI)
3919 v.AuxInt = ssa.Int64ToAuxInt(0b00_0000_0001)
3920 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
3921 v0.AddArg(x)
3922 v.AddArg(v0)
3923 return true
3924 }
3925
3926
3927 for {
3928 if v_0.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_0.AuxInt) != math.MaxFloat64 {
3929 break
3930 }
3931 x := v_1
3932 v.Reset(ssaop.OpRISCV64SNEZ)
3933 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
3934 v0.AuxInt = ssa.Int64ToAuxInt(0b00_1000_0000)
3935 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
3936 v1.AddArg(x)
3937 v0.AddArg(v1)
3938 v.AddArg(v0)
3939 return true
3940 }
3941
3942
3943 for {
3944 x := v_0
3945 if v_1.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_1.AuxInt) != +0x1p-1022 {
3946 break
3947 }
3948 v.Reset(ssaop.OpRISCV64SNEZ)
3949 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
3950 v0.AuxInt = ssa.Int64ToAuxInt(0b00_0011_1111)
3951 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
3952 v1.AddArg(x)
3953 v0.AddArg(v1)
3954 v.AddArg(v0)
3955 return true
3956 }
3957
3958
3959 for {
3960 if v_0.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_0.AuxInt) != -0x1p-1022 {
3961 break
3962 }
3963 x := v_1
3964 v.Reset(ssaop.OpRISCV64SNEZ)
3965 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
3966 v0.AuxInt = ssa.Int64ToAuxInt(0b00_1111_1100)
3967 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
3968 v1.AddArg(x)
3969 v0.AddArg(v1)
3970 v.AddArg(v0)
3971 return true
3972 }
3973 return false
3974 }
3975 func rewriteValue_OpRISCV64FMADDD(v *ssa.Value) bool {
3976 v_2 := v.Args[2]
3977 v_1 := v.Args[1]
3978 v_0 := v.Args[0]
3979
3980
3981
3982 for {
3983 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3984 neg := v_0
3985 if neg.Op != ssaop.OpRISCV64FNEGD {
3986 continue
3987 }
3988 x := neg.Args[0]
3989 y := v_1
3990 z := v_2
3991 if !(neg.Uses == 1) {
3992 continue
3993 }
3994 v.Reset(ssaop.OpRISCV64FNMSUBD)
3995 v.AddArg3(x, y, z)
3996 return true
3997 }
3998 break
3999 }
4000
4001
4002
4003 for {
4004 x := v_0
4005 y := v_1
4006 neg := v_2
4007 if neg.Op != ssaop.OpRISCV64FNEGD {
4008 break
4009 }
4010 z := neg.Args[0]
4011 if !(neg.Uses == 1) {
4012 break
4013 }
4014 v.Reset(ssaop.OpRISCV64FMSUBD)
4015 v.AddArg3(x, y, z)
4016 return true
4017 }
4018 return false
4019 }
4020 func rewriteValue_OpRISCV64FMADDS(v *ssa.Value) bool {
4021 v_2 := v.Args[2]
4022 v_1 := v.Args[1]
4023 v_0 := v.Args[0]
4024
4025
4026
4027 for {
4028 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4029 neg := v_0
4030 if neg.Op != ssaop.OpRISCV64FNEGS {
4031 continue
4032 }
4033 x := neg.Args[0]
4034 y := v_1
4035 z := v_2
4036 if !(neg.Uses == 1) {
4037 continue
4038 }
4039 v.Reset(ssaop.OpRISCV64FNMSUBS)
4040 v.AddArg3(x, y, z)
4041 return true
4042 }
4043 break
4044 }
4045
4046
4047
4048 for {
4049 x := v_0
4050 y := v_1
4051 neg := v_2
4052 if neg.Op != ssaop.OpRISCV64FNEGS {
4053 break
4054 }
4055 z := neg.Args[0]
4056 if !(neg.Uses == 1) {
4057 break
4058 }
4059 v.Reset(ssaop.OpRISCV64FMSUBS)
4060 v.AddArg3(x, y, z)
4061 return true
4062 }
4063 return false
4064 }
4065 func rewriteValue_OpRISCV64FMOVDload(v *ssa.Value) bool {
4066 v_1 := v.Args[1]
4067 v_0 := v.Args[0]
4068 b := v.Block
4069 config := b.Func.Config
4070
4071
4072
4073 for {
4074 off1 := ssa.AuxIntToInt32(v.AuxInt)
4075 sym1 := ssa.AuxToSym(v.Aux)
4076 if v_0.Op != ssaop.OpRISCV64MOVaddr {
4077 break
4078 }
4079 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
4080 sym2 := ssa.AuxToSym(v_0.Aux)
4081 base := v_0.Args[0]
4082 mem := v_1
4083 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
4084 break
4085 }
4086 v.Reset(ssaop.OpRISCV64FMOVDload)
4087 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
4088 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
4089 v.AddArg2(base, mem)
4090 return true
4091 }
4092
4093
4094
4095 for {
4096 off1 := ssa.AuxIntToInt32(v.AuxInt)
4097 sym := ssa.AuxToSym(v.Aux)
4098 if v_0.Op != ssaop.OpRISCV64ADDI {
4099 break
4100 }
4101 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
4102 base := v_0.Args[0]
4103 mem := v_1
4104 if !(ssa.Is32Bit(int64(off1) + off2)) {
4105 break
4106 }
4107 v.Reset(ssaop.OpRISCV64FMOVDload)
4108 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
4109 v.Aux = ssa.SymToAux(sym)
4110 v.AddArg2(base, mem)
4111 return true
4112 }
4113
4114
4115
4116 for {
4117 off := ssa.AuxIntToInt32(v.AuxInt)
4118 sym := ssa.AuxToSym(v.Aux)
4119 ptr1 := v_0
4120 if v_1.Op != ssaop.OpRISCV64MOVDstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
4121 break
4122 }
4123 x := v_1.Args[1]
4124 ptr2 := v_1.Args[0]
4125 if !(ssa.IsSamePtr(ptr1, ptr2)) {
4126 break
4127 }
4128 v.Reset(ssaop.OpRISCV64FMVDX)
4129 v.AddArg(x)
4130 return true
4131 }
4132 return false
4133 }
4134 func rewriteValue_OpRISCV64FMOVDstore(v *ssa.Value) bool {
4135 v_2 := v.Args[2]
4136 v_1 := v.Args[1]
4137 v_0 := v.Args[0]
4138 b := v.Block
4139 config := b.Func.Config
4140
4141
4142
4143 for {
4144 off1 := ssa.AuxIntToInt32(v.AuxInt)
4145 sym1 := ssa.AuxToSym(v.Aux)
4146 if v_0.Op != ssaop.OpRISCV64MOVaddr {
4147 break
4148 }
4149 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
4150 sym2 := ssa.AuxToSym(v_0.Aux)
4151 base := v_0.Args[0]
4152 val := v_1
4153 mem := v_2
4154 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
4155 break
4156 }
4157 v.Reset(ssaop.OpRISCV64FMOVDstore)
4158 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
4159 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
4160 v.AddArg3(base, val, mem)
4161 return true
4162 }
4163
4164
4165
4166 for {
4167 off1 := ssa.AuxIntToInt32(v.AuxInt)
4168 sym := ssa.AuxToSym(v.Aux)
4169 if v_0.Op != ssaop.OpRISCV64ADDI {
4170 break
4171 }
4172 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
4173 base := v_0.Args[0]
4174 val := v_1
4175 mem := v_2
4176 if !(ssa.Is32Bit(int64(off1) + off2)) {
4177 break
4178 }
4179 v.Reset(ssaop.OpRISCV64FMOVDstore)
4180 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
4181 v.Aux = ssa.SymToAux(sym)
4182 v.AddArg3(base, val, mem)
4183 return true
4184 }
4185 return false
4186 }
4187 func rewriteValue_OpRISCV64FMOVWload(v *ssa.Value) bool {
4188 v_1 := v.Args[1]
4189 v_0 := v.Args[0]
4190 b := v.Block
4191 config := b.Func.Config
4192
4193
4194
4195 for {
4196 off1 := ssa.AuxIntToInt32(v.AuxInt)
4197 sym1 := ssa.AuxToSym(v.Aux)
4198 if v_0.Op != ssaop.OpRISCV64MOVaddr {
4199 break
4200 }
4201 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
4202 sym2 := ssa.AuxToSym(v_0.Aux)
4203 base := v_0.Args[0]
4204 mem := v_1
4205 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
4206 break
4207 }
4208 v.Reset(ssaop.OpRISCV64FMOVWload)
4209 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
4210 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
4211 v.AddArg2(base, mem)
4212 return true
4213 }
4214
4215
4216
4217 for {
4218 off1 := ssa.AuxIntToInt32(v.AuxInt)
4219 sym := ssa.AuxToSym(v.Aux)
4220 if v_0.Op != ssaop.OpRISCV64ADDI {
4221 break
4222 }
4223 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
4224 base := v_0.Args[0]
4225 mem := v_1
4226 if !(ssa.Is32Bit(int64(off1) + off2)) {
4227 break
4228 }
4229 v.Reset(ssaop.OpRISCV64FMOVWload)
4230 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
4231 v.Aux = ssa.SymToAux(sym)
4232 v.AddArg2(base, mem)
4233 return true
4234 }
4235
4236
4237
4238 for {
4239 off := ssa.AuxIntToInt32(v.AuxInt)
4240 sym := ssa.AuxToSym(v.Aux)
4241 ptr1 := v_0
4242 if v_1.Op != ssaop.OpRISCV64MOVWstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
4243 break
4244 }
4245 x := v_1.Args[1]
4246 ptr2 := v_1.Args[0]
4247 if !(ssa.IsSamePtr(ptr1, ptr2)) {
4248 break
4249 }
4250 v.Reset(ssaop.OpRISCV64FMVSX)
4251 v.AddArg(x)
4252 return true
4253 }
4254 return false
4255 }
4256 func rewriteValue_OpRISCV64FMOVWstore(v *ssa.Value) bool {
4257 v_2 := v.Args[2]
4258 v_1 := v.Args[1]
4259 v_0 := v.Args[0]
4260 b := v.Block
4261 config := b.Func.Config
4262
4263
4264
4265 for {
4266 off1 := ssa.AuxIntToInt32(v.AuxInt)
4267 sym1 := ssa.AuxToSym(v.Aux)
4268 if v_0.Op != ssaop.OpRISCV64MOVaddr {
4269 break
4270 }
4271 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
4272 sym2 := ssa.AuxToSym(v_0.Aux)
4273 base := v_0.Args[0]
4274 val := v_1
4275 mem := v_2
4276 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
4277 break
4278 }
4279 v.Reset(ssaop.OpRISCV64FMOVWstore)
4280 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
4281 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
4282 v.AddArg3(base, val, mem)
4283 return true
4284 }
4285
4286
4287
4288 for {
4289 off1 := ssa.AuxIntToInt32(v.AuxInt)
4290 sym := ssa.AuxToSym(v.Aux)
4291 if v_0.Op != ssaop.OpRISCV64ADDI {
4292 break
4293 }
4294 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
4295 base := v_0.Args[0]
4296 val := v_1
4297 mem := v_2
4298 if !(ssa.Is32Bit(int64(off1) + off2)) {
4299 break
4300 }
4301 v.Reset(ssaop.OpRISCV64FMOVWstore)
4302 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
4303 v.Aux = ssa.SymToAux(sym)
4304 v.AddArg3(base, val, mem)
4305 return true
4306 }
4307 return false
4308 }
4309 func rewriteValue_OpRISCV64FMSUBD(v *ssa.Value) bool {
4310 v_2 := v.Args[2]
4311 v_1 := v.Args[1]
4312 v_0 := v.Args[0]
4313
4314
4315
4316 for {
4317 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4318 neg := v_0
4319 if neg.Op != ssaop.OpRISCV64FNEGD {
4320 continue
4321 }
4322 x := neg.Args[0]
4323 y := v_1
4324 z := v_2
4325 if !(neg.Uses == 1) {
4326 continue
4327 }
4328 v.Reset(ssaop.OpRISCV64FNMADDD)
4329 v.AddArg3(x, y, z)
4330 return true
4331 }
4332 break
4333 }
4334
4335
4336
4337 for {
4338 x := v_0
4339 y := v_1
4340 neg := v_2
4341 if neg.Op != ssaop.OpRISCV64FNEGD {
4342 break
4343 }
4344 z := neg.Args[0]
4345 if !(neg.Uses == 1) {
4346 break
4347 }
4348 v.Reset(ssaop.OpRISCV64FMADDD)
4349 v.AddArg3(x, y, z)
4350 return true
4351 }
4352 return false
4353 }
4354 func rewriteValue_OpRISCV64FMSUBS(v *ssa.Value) bool {
4355 v_2 := v.Args[2]
4356 v_1 := v.Args[1]
4357 v_0 := v.Args[0]
4358
4359
4360
4361 for {
4362 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4363 neg := v_0
4364 if neg.Op != ssaop.OpRISCV64FNEGS {
4365 continue
4366 }
4367 x := neg.Args[0]
4368 y := v_1
4369 z := v_2
4370 if !(neg.Uses == 1) {
4371 continue
4372 }
4373 v.Reset(ssaop.OpRISCV64FNMADDS)
4374 v.AddArg3(x, y, z)
4375 return true
4376 }
4377 break
4378 }
4379
4380
4381
4382 for {
4383 x := v_0
4384 y := v_1
4385 neg := v_2
4386 if neg.Op != ssaop.OpRISCV64FNEGS {
4387 break
4388 }
4389 z := neg.Args[0]
4390 if !(neg.Uses == 1) {
4391 break
4392 }
4393 v.Reset(ssaop.OpRISCV64FMADDS)
4394 v.AddArg3(x, y, z)
4395 return true
4396 }
4397 return false
4398 }
4399 func rewriteValue_OpRISCV64FNED(v *ssa.Value) bool {
4400 v_1 := v.Args[1]
4401 v_0 := v.Args[0]
4402 b := v.Block
4403 typ := &b.Func.Config.Types
4404
4405
4406 for {
4407 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4408 x := v_0
4409 if v_1.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_1.AuxInt) != math.Inf(-1) {
4410 continue
4411 }
4412 v.Reset(ssaop.OpRISCV64SEQZ)
4413 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
4414 v0.AuxInt = ssa.Int64ToAuxInt(0b00_0000_0001)
4415 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
4416 v1.AddArg(x)
4417 v0.AddArg(v1)
4418 v.AddArg(v0)
4419 return true
4420 }
4421 break
4422 }
4423
4424
4425 for {
4426 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4427 x := v_0
4428 if v_1.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_1.AuxInt) != math.Inf(1) {
4429 continue
4430 }
4431 v.Reset(ssaop.OpRISCV64SEQZ)
4432 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
4433 v0.AuxInt = ssa.Int64ToAuxInt(0b00_1000_0000)
4434 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
4435 v1.AddArg(x)
4436 v0.AddArg(v1)
4437 v.AddArg(v0)
4438 return true
4439 }
4440 break
4441 }
4442 return false
4443 }
4444 func rewriteValue_OpRISCV64FNMADDD(v *ssa.Value) bool {
4445 v_2 := v.Args[2]
4446 v_1 := v.Args[1]
4447 v_0 := v.Args[0]
4448
4449
4450
4451 for {
4452 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4453 neg := v_0
4454 if neg.Op != ssaop.OpRISCV64FNEGD {
4455 continue
4456 }
4457 x := neg.Args[0]
4458 y := v_1
4459 z := v_2
4460 if !(neg.Uses == 1) {
4461 continue
4462 }
4463 v.Reset(ssaop.OpRISCV64FMSUBD)
4464 v.AddArg3(x, y, z)
4465 return true
4466 }
4467 break
4468 }
4469
4470
4471
4472 for {
4473 x := v_0
4474 y := v_1
4475 neg := v_2
4476 if neg.Op != ssaop.OpRISCV64FNEGD {
4477 break
4478 }
4479 z := neg.Args[0]
4480 if !(neg.Uses == 1) {
4481 break
4482 }
4483 v.Reset(ssaop.OpRISCV64FNMSUBD)
4484 v.AddArg3(x, y, z)
4485 return true
4486 }
4487 return false
4488 }
4489 func rewriteValue_OpRISCV64FNMADDS(v *ssa.Value) bool {
4490 v_2 := v.Args[2]
4491 v_1 := v.Args[1]
4492 v_0 := v.Args[0]
4493
4494
4495
4496 for {
4497 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4498 neg := v_0
4499 if neg.Op != ssaop.OpRISCV64FNEGS {
4500 continue
4501 }
4502 x := neg.Args[0]
4503 y := v_1
4504 z := v_2
4505 if !(neg.Uses == 1) {
4506 continue
4507 }
4508 v.Reset(ssaop.OpRISCV64FMSUBS)
4509 v.AddArg3(x, y, z)
4510 return true
4511 }
4512 break
4513 }
4514
4515
4516
4517 for {
4518 x := v_0
4519 y := v_1
4520 neg := v_2
4521 if neg.Op != ssaop.OpRISCV64FNEGS {
4522 break
4523 }
4524 z := neg.Args[0]
4525 if !(neg.Uses == 1) {
4526 break
4527 }
4528 v.Reset(ssaop.OpRISCV64FNMSUBS)
4529 v.AddArg3(x, y, z)
4530 return true
4531 }
4532 return false
4533 }
4534 func rewriteValue_OpRISCV64FNMSUBD(v *ssa.Value) bool {
4535 v_2 := v.Args[2]
4536 v_1 := v.Args[1]
4537 v_0 := v.Args[0]
4538
4539
4540
4541 for {
4542 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4543 neg := v_0
4544 if neg.Op != ssaop.OpRISCV64FNEGD {
4545 continue
4546 }
4547 x := neg.Args[0]
4548 y := v_1
4549 z := v_2
4550 if !(neg.Uses == 1) {
4551 continue
4552 }
4553 v.Reset(ssaop.OpRISCV64FMADDD)
4554 v.AddArg3(x, y, z)
4555 return true
4556 }
4557 break
4558 }
4559
4560
4561
4562 for {
4563 x := v_0
4564 y := v_1
4565 neg := v_2
4566 if neg.Op != ssaop.OpRISCV64FNEGD {
4567 break
4568 }
4569 z := neg.Args[0]
4570 if !(neg.Uses == 1) {
4571 break
4572 }
4573 v.Reset(ssaop.OpRISCV64FNMADDD)
4574 v.AddArg3(x, y, z)
4575 return true
4576 }
4577 return false
4578 }
4579 func rewriteValue_OpRISCV64FNMSUBS(v *ssa.Value) bool {
4580 v_2 := v.Args[2]
4581 v_1 := v.Args[1]
4582 v_0 := v.Args[0]
4583
4584
4585
4586 for {
4587 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4588 neg := v_0
4589 if neg.Op != ssaop.OpRISCV64FNEGS {
4590 continue
4591 }
4592 x := neg.Args[0]
4593 y := v_1
4594 z := v_2
4595 if !(neg.Uses == 1) {
4596 continue
4597 }
4598 v.Reset(ssaop.OpRISCV64FMADDS)
4599 v.AddArg3(x, y, z)
4600 return true
4601 }
4602 break
4603 }
4604
4605
4606
4607 for {
4608 x := v_0
4609 y := v_1
4610 neg := v_2
4611 if neg.Op != ssaop.OpRISCV64FNEGS {
4612 break
4613 }
4614 z := neg.Args[0]
4615 if !(neg.Uses == 1) {
4616 break
4617 }
4618 v.Reset(ssaop.OpRISCV64FNMADDS)
4619 v.AddArg3(x, y, z)
4620 return true
4621 }
4622 return false
4623 }
4624 func rewriteValue_OpRISCV64FSUBD(v *ssa.Value) bool {
4625 v_1 := v.Args[1]
4626 v_0 := v.Args[0]
4627
4628
4629
4630 for {
4631 a := v_0
4632 if v_1.Op != ssaop.OpRISCV64FMULD {
4633 break
4634 }
4635 y := v_1.Args[1]
4636 x := v_1.Args[0]
4637 if !(a.Block.Func.UseFMA(v)) {
4638 break
4639 }
4640 v.Reset(ssaop.OpRISCV64FNMSUBD)
4641 v.AddArg3(x, y, a)
4642 return true
4643 }
4644
4645
4646
4647 for {
4648 if v_0.Op != ssaop.OpRISCV64FMULD {
4649 break
4650 }
4651 y := v_0.Args[1]
4652 x := v_0.Args[0]
4653 a := v_1
4654 if !(a.Block.Func.UseFMA(v)) {
4655 break
4656 }
4657 v.Reset(ssaop.OpRISCV64FMSUBD)
4658 v.AddArg3(x, y, a)
4659 return true
4660 }
4661 return false
4662 }
4663 func rewriteValue_OpRISCV64FSUBS(v *ssa.Value) bool {
4664 v_1 := v.Args[1]
4665 v_0 := v.Args[0]
4666
4667
4668
4669 for {
4670 a := v_0
4671 if v_1.Op != ssaop.OpRISCV64FMULS {
4672 break
4673 }
4674 y := v_1.Args[1]
4675 x := v_1.Args[0]
4676 if !(a.Block.Func.UseFMA(v)) {
4677 break
4678 }
4679 v.Reset(ssaop.OpRISCV64FNMSUBS)
4680 v.AddArg3(x, y, a)
4681 return true
4682 }
4683
4684
4685
4686 for {
4687 if v_0.Op != ssaop.OpRISCV64FMULS {
4688 break
4689 }
4690 y := v_0.Args[1]
4691 x := v_0.Args[0]
4692 a := v_1
4693 if !(a.Block.Func.UseFMA(v)) {
4694 break
4695 }
4696 v.Reset(ssaop.OpRISCV64FMSUBS)
4697 v.AddArg3(x, y, a)
4698 return true
4699 }
4700 return false
4701 }
4702 func rewriteValue_OpRISCV64LoweredPanicBoundsCR(v *ssa.Value) bool {
4703 v_1 := v.Args[1]
4704 v_0 := v.Args[0]
4705
4706
4707 for {
4708 kind := ssa.AuxIntToInt64(v.AuxInt)
4709 p := ssa.AuxToPanicBoundsC(v.Aux)
4710 if v_0.Op != ssaop.OpRISCV64MOVDconst {
4711 break
4712 }
4713 c := ssa.AuxIntToInt64(v_0.AuxInt)
4714 mem := v_1
4715 v.Reset(ssaop.OpRISCV64LoweredPanicBoundsCC)
4716 v.AuxInt = ssa.Int64ToAuxInt(kind)
4717 v.Aux = ssa.PanicBoundsCCToAux(ssa.PanicBoundsCC{Cx: p.C, Cy: c})
4718 v.AddArg(mem)
4719 return true
4720 }
4721 return false
4722 }
4723 func rewriteValue_OpRISCV64LoweredPanicBoundsRC(v *ssa.Value) bool {
4724 v_1 := v.Args[1]
4725 v_0 := v.Args[0]
4726
4727
4728 for {
4729 kind := ssa.AuxIntToInt64(v.AuxInt)
4730 p := ssa.AuxToPanicBoundsC(v.Aux)
4731 if v_0.Op != ssaop.OpRISCV64MOVDconst {
4732 break
4733 }
4734 c := ssa.AuxIntToInt64(v_0.AuxInt)
4735 mem := v_1
4736 v.Reset(ssaop.OpRISCV64LoweredPanicBoundsCC)
4737 v.AuxInt = ssa.Int64ToAuxInt(kind)
4738 v.Aux = ssa.PanicBoundsCCToAux(ssa.PanicBoundsCC{Cx: c, Cy: p.C})
4739 v.AddArg(mem)
4740 return true
4741 }
4742 return false
4743 }
4744 func rewriteValue_OpRISCV64LoweredPanicBoundsRR(v *ssa.Value) bool {
4745 v_2 := v.Args[2]
4746 v_1 := v.Args[1]
4747 v_0 := v.Args[0]
4748
4749
4750 for {
4751 kind := ssa.AuxIntToInt64(v.AuxInt)
4752 x := v_0
4753 if v_1.Op != ssaop.OpRISCV64MOVDconst {
4754 break
4755 }
4756 c := ssa.AuxIntToInt64(v_1.AuxInt)
4757 mem := v_2
4758 v.Reset(ssaop.OpRISCV64LoweredPanicBoundsRC)
4759 v.AuxInt = ssa.Int64ToAuxInt(kind)
4760 v.Aux = ssa.PanicBoundsCToAux(ssa.PanicBoundsC{C: c})
4761 v.AddArg2(x, mem)
4762 return true
4763 }
4764
4765
4766 for {
4767 kind := ssa.AuxIntToInt64(v.AuxInt)
4768 if v_0.Op != ssaop.OpRISCV64MOVDconst {
4769 break
4770 }
4771 c := ssa.AuxIntToInt64(v_0.AuxInt)
4772 y := v_1
4773 mem := v_2
4774 v.Reset(ssaop.OpRISCV64LoweredPanicBoundsCR)
4775 v.AuxInt = ssa.Int64ToAuxInt(kind)
4776 v.Aux = ssa.PanicBoundsCToAux(ssa.PanicBoundsC{C: c})
4777 v.AddArg2(y, mem)
4778 return true
4779 }
4780 return false
4781 }
4782 func rewriteValue_OpRISCV64MOVBUload(v *ssa.Value) bool {
4783 v_1 := v.Args[1]
4784 v_0 := v.Args[0]
4785 b := v.Block
4786 config := b.Func.Config
4787
4788
4789
4790 for {
4791 off1 := ssa.AuxIntToInt32(v.AuxInt)
4792 sym1 := ssa.AuxToSym(v.Aux)
4793 if v_0.Op != ssaop.OpRISCV64MOVaddr {
4794 break
4795 }
4796 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
4797 sym2 := ssa.AuxToSym(v_0.Aux)
4798 base := v_0.Args[0]
4799 mem := v_1
4800 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
4801 break
4802 }
4803 v.Reset(ssaop.OpRISCV64MOVBUload)
4804 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
4805 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
4806 v.AddArg2(base, mem)
4807 return true
4808 }
4809
4810
4811
4812 for {
4813 off1 := ssa.AuxIntToInt32(v.AuxInt)
4814 sym := ssa.AuxToSym(v.Aux)
4815 if v_0.Op != ssaop.OpRISCV64ADDI {
4816 break
4817 }
4818 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
4819 base := v_0.Args[0]
4820 mem := v_1
4821 if !(ssa.Is32Bit(int64(off1) + off2)) {
4822 break
4823 }
4824 v.Reset(ssaop.OpRISCV64MOVBUload)
4825 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
4826 v.Aux = ssa.SymToAux(sym)
4827 v.AddArg2(base, mem)
4828 return true
4829 }
4830
4831
4832
4833 for {
4834 off := ssa.AuxIntToInt32(v.AuxInt)
4835 sym := ssa.AuxToSym(v.Aux)
4836 ptr1 := v_0
4837 if v_1.Op != ssaop.OpRISCV64MOVBstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
4838 break
4839 }
4840 x := v_1.Args[1]
4841 ptr2 := v_1.Args[0]
4842 if !(ssa.IsSamePtr(ptr1, ptr2)) {
4843 break
4844 }
4845 v.Reset(ssaop.OpRISCV64MOVBUreg)
4846 v.AddArg(x)
4847 return true
4848 }
4849 return false
4850 }
4851 func rewriteValue_OpRISCV64MOVBUreg(v *ssa.Value) bool {
4852 v_0 := v.Args[0]
4853 b := v.Block
4854
4855
4856 for {
4857 x := v_0
4858 if x.Op != ssaop.OpRISCV64FLES {
4859 break
4860 }
4861 v.CopyOf(x)
4862 return true
4863 }
4864
4865
4866 for {
4867 x := v_0
4868 if x.Op != ssaop.OpRISCV64FLTS {
4869 break
4870 }
4871 v.CopyOf(x)
4872 return true
4873 }
4874
4875
4876 for {
4877 x := v_0
4878 if x.Op != ssaop.OpRISCV64FEQS {
4879 break
4880 }
4881 v.CopyOf(x)
4882 return true
4883 }
4884
4885
4886 for {
4887 x := v_0
4888 if x.Op != ssaop.OpRISCV64FNES {
4889 break
4890 }
4891 v.CopyOf(x)
4892 return true
4893 }
4894
4895
4896 for {
4897 x := v_0
4898 if x.Op != ssaop.OpRISCV64FLED {
4899 break
4900 }
4901 v.CopyOf(x)
4902 return true
4903 }
4904
4905
4906 for {
4907 x := v_0
4908 if x.Op != ssaop.OpRISCV64FLTD {
4909 break
4910 }
4911 v.CopyOf(x)
4912 return true
4913 }
4914
4915
4916 for {
4917 x := v_0
4918 if x.Op != ssaop.OpRISCV64FEQD {
4919 break
4920 }
4921 v.CopyOf(x)
4922 return true
4923 }
4924
4925
4926 for {
4927 x := v_0
4928 if x.Op != ssaop.OpRISCV64FNED {
4929 break
4930 }
4931 v.CopyOf(x)
4932 return true
4933 }
4934
4935
4936 for {
4937 x := v_0
4938 if x.Op != ssaop.OpRISCV64SEQZ {
4939 break
4940 }
4941 v.CopyOf(x)
4942 return true
4943 }
4944
4945
4946 for {
4947 x := v_0
4948 if x.Op != ssaop.OpRISCV64SNEZ {
4949 break
4950 }
4951 v.CopyOf(x)
4952 return true
4953 }
4954
4955
4956 for {
4957 x := v_0
4958 if x.Op != ssaop.OpRISCV64SLT {
4959 break
4960 }
4961 v.CopyOf(x)
4962 return true
4963 }
4964
4965
4966 for {
4967 x := v_0
4968 if x.Op != ssaop.OpRISCV64SLTU {
4969 break
4970 }
4971 v.CopyOf(x)
4972 return true
4973 }
4974
4975
4976
4977 for {
4978 x := v_0
4979 if x.Op != ssaop.OpRISCV64ANDI {
4980 break
4981 }
4982 c := ssa.AuxIntToInt64(x.AuxInt)
4983 if !(c >= 0 && int64(uint8(c)) == c) {
4984 break
4985 }
4986 v.CopyOf(x)
4987 return true
4988 }
4989
4990
4991
4992 for {
4993 if v_0.Op != ssaop.OpRISCV64ANDI {
4994 break
4995 }
4996 c := ssa.AuxIntToInt64(v_0.AuxInt)
4997 x := v_0.Args[0]
4998 if !(c < 0) {
4999 break
5000 }
5001 v.Reset(ssaop.OpRISCV64ANDI)
5002 v.AuxInt = ssa.Int64ToAuxInt(int64(uint8(c)))
5003 v.AddArg(x)
5004 return true
5005 }
5006
5007
5008
5009 for {
5010 x := v_0
5011 if x.Op != ssaop.OpRISCV64SRLI {
5012 break
5013 }
5014 c := ssa.AuxIntToInt64(x.AuxInt)
5015 if !(c >= 56) {
5016 break
5017 }
5018 v.CopyOf(x)
5019 return true
5020 }
5021
5022
5023
5024 for {
5025 x := v_0
5026 if x.Op != ssaop.OpRISCV64SRLIW {
5027 break
5028 }
5029 c := ssa.AuxIntToInt64(x.AuxInt)
5030 if !(c >= 24) {
5031 break
5032 }
5033 v.CopyOf(x)
5034 return true
5035 }
5036
5037
5038 for {
5039 if v_0.Op != ssaop.OpRISCV64MOVDconst {
5040 break
5041 }
5042 c := ssa.AuxIntToInt64(v_0.AuxInt)
5043 v.Reset(ssaop.OpRISCV64MOVDconst)
5044 v.AuxInt = ssa.Int64ToAuxInt(int64(uint8(c)))
5045 return true
5046 }
5047
5048
5049 for {
5050 x := v_0
5051 if x.Op != ssaop.OpRISCV64MOVBUload {
5052 break
5053 }
5054 v.Reset(ssaop.OpRISCV64MOVDreg)
5055 v.AddArg(x)
5056 return true
5057 }
5058
5059
5060 for {
5061 x := v_0
5062 if x.Op != ssaop.OpSelect0 {
5063 break
5064 }
5065 x_0 := x.Args[0]
5066 if x_0.Op != ssaop.OpRISCV64LoweredAtomicLoad8 {
5067 break
5068 }
5069 v.Reset(ssaop.OpRISCV64MOVDreg)
5070 v.AddArg(x)
5071 return true
5072 }
5073
5074
5075 for {
5076 x := v_0
5077 if x.Op != ssaop.OpSelect0 {
5078 break
5079 }
5080 x_0 := x.Args[0]
5081 if x_0.Op != ssaop.OpRISCV64LoweredAtomicCas32 {
5082 break
5083 }
5084 v.Reset(ssaop.OpRISCV64MOVDreg)
5085 v.AddArg(x)
5086 return true
5087 }
5088
5089
5090 for {
5091 x := v_0
5092 if x.Op != ssaop.OpSelect0 {
5093 break
5094 }
5095 x_0 := x.Args[0]
5096 if x_0.Op != ssaop.OpRISCV64LoweredAtomicCas64 {
5097 break
5098 }
5099 v.Reset(ssaop.OpRISCV64MOVDreg)
5100 v.AddArg(x)
5101 return true
5102 }
5103
5104
5105 for {
5106 x := v_0
5107 if x.Op != ssaop.OpRISCV64MOVBUreg {
5108 break
5109 }
5110 v.Reset(ssaop.OpRISCV64MOVDreg)
5111 v.AddArg(x)
5112 return true
5113 }
5114
5115
5116
5117 for {
5118 t := v.Type
5119 x := v_0
5120 if x.Op != ssaop.OpRISCV64MOVBload {
5121 break
5122 }
5123 off := ssa.AuxIntToInt32(x.AuxInt)
5124 sym := ssa.AuxToSym(x.Aux)
5125 mem := x.Args[1]
5126 ptr := x.Args[0]
5127 if !(x.Uses == 1 && ssa.Clobber(x)) {
5128 break
5129 }
5130 b = x.Block
5131 v0 := b.NewValue0(x.Pos, ssaop.OpRISCV64MOVBUload, t)
5132 v.CopyOf(v0)
5133 v0.AuxInt = ssa.Int32ToAuxInt(off)
5134 v0.Aux = ssa.SymToAux(sym)
5135 v0.AddArg2(ptr, mem)
5136 return true
5137 }
5138 return false
5139 }
5140 func rewriteValue_OpRISCV64MOVBload(v *ssa.Value) bool {
5141 v_1 := v.Args[1]
5142 v_0 := v.Args[0]
5143 b := v.Block
5144 config := b.Func.Config
5145
5146
5147
5148 for {
5149 off1 := ssa.AuxIntToInt32(v.AuxInt)
5150 sym1 := ssa.AuxToSym(v.Aux)
5151 if v_0.Op != ssaop.OpRISCV64MOVaddr {
5152 break
5153 }
5154 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
5155 sym2 := ssa.AuxToSym(v_0.Aux)
5156 base := v_0.Args[0]
5157 mem := v_1
5158 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
5159 break
5160 }
5161 v.Reset(ssaop.OpRISCV64MOVBload)
5162 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
5163 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
5164 v.AddArg2(base, mem)
5165 return true
5166 }
5167
5168
5169
5170 for {
5171 off1 := ssa.AuxIntToInt32(v.AuxInt)
5172 sym := ssa.AuxToSym(v.Aux)
5173 if v_0.Op != ssaop.OpRISCV64ADDI {
5174 break
5175 }
5176 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
5177 base := v_0.Args[0]
5178 mem := v_1
5179 if !(ssa.Is32Bit(int64(off1) + off2)) {
5180 break
5181 }
5182 v.Reset(ssaop.OpRISCV64MOVBload)
5183 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
5184 v.Aux = ssa.SymToAux(sym)
5185 v.AddArg2(base, mem)
5186 return true
5187 }
5188
5189
5190
5191 for {
5192 off := ssa.AuxIntToInt32(v.AuxInt)
5193 sym := ssa.AuxToSym(v.Aux)
5194 ptr1 := v_0
5195 if v_1.Op != ssaop.OpRISCV64MOVBstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
5196 break
5197 }
5198 x := v_1.Args[1]
5199 ptr2 := v_1.Args[0]
5200 if !(ssa.IsSamePtr(ptr1, ptr2)) {
5201 break
5202 }
5203 v.Reset(ssaop.OpRISCV64MOVBreg)
5204 v.AddArg(x)
5205 return true
5206 }
5207 return false
5208 }
5209 func rewriteValue_OpRISCV64MOVBreg(v *ssa.Value) bool {
5210 v_0 := v.Args[0]
5211 b := v.Block
5212
5213
5214
5215 for {
5216 x := v_0
5217 if x.Op != ssaop.OpRISCV64ANDI {
5218 break
5219 }
5220 c := ssa.AuxIntToInt64(x.AuxInt)
5221 if !(c >= 0 && int64(int8(c)) == c) {
5222 break
5223 }
5224 v.CopyOf(x)
5225 return true
5226 }
5227
5228
5229 for {
5230 if v_0.Op != ssaop.OpRISCV64MOVDconst {
5231 break
5232 }
5233 c := ssa.AuxIntToInt64(v_0.AuxInt)
5234 v.Reset(ssaop.OpRISCV64MOVDconst)
5235 v.AuxInt = ssa.Int64ToAuxInt(int64(int8(c)))
5236 return true
5237 }
5238
5239
5240 for {
5241 x := v_0
5242 if x.Op != ssaop.OpRISCV64MOVBload {
5243 break
5244 }
5245 v.Reset(ssaop.OpRISCV64MOVDreg)
5246 v.AddArg(x)
5247 return true
5248 }
5249
5250
5251 for {
5252 x := v_0
5253 if x.Op != ssaop.OpRISCV64MOVBreg {
5254 break
5255 }
5256 v.Reset(ssaop.OpRISCV64MOVDreg)
5257 v.AddArg(x)
5258 return true
5259 }
5260
5261
5262
5263 for {
5264 t := v.Type
5265 x := v_0
5266 if x.Op != ssaop.OpRISCV64MOVBUload {
5267 break
5268 }
5269 off := ssa.AuxIntToInt32(x.AuxInt)
5270 sym := ssa.AuxToSym(x.Aux)
5271 mem := x.Args[1]
5272 ptr := x.Args[0]
5273 if !(x.Uses == 1 && ssa.Clobber(x)) {
5274 break
5275 }
5276 b = x.Block
5277 v0 := b.NewValue0(x.Pos, ssaop.OpRISCV64MOVBload, t)
5278 v.CopyOf(v0)
5279 v0.AuxInt = ssa.Int32ToAuxInt(off)
5280 v0.Aux = ssa.SymToAux(sym)
5281 v0.AddArg2(ptr, mem)
5282 return true
5283 }
5284 return false
5285 }
5286 func rewriteValue_OpRISCV64MOVBstore(v *ssa.Value) bool {
5287 v_2 := v.Args[2]
5288 v_1 := v.Args[1]
5289 v_0 := v.Args[0]
5290 b := v.Block
5291 config := b.Func.Config
5292
5293
5294
5295 for {
5296 off1 := ssa.AuxIntToInt32(v.AuxInt)
5297 sym1 := ssa.AuxToSym(v.Aux)
5298 if v_0.Op != ssaop.OpRISCV64MOVaddr {
5299 break
5300 }
5301 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
5302 sym2 := ssa.AuxToSym(v_0.Aux)
5303 base := v_0.Args[0]
5304 val := v_1
5305 mem := v_2
5306 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
5307 break
5308 }
5309 v.Reset(ssaop.OpRISCV64MOVBstore)
5310 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
5311 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
5312 v.AddArg3(base, val, mem)
5313 return true
5314 }
5315
5316
5317
5318 for {
5319 off1 := ssa.AuxIntToInt32(v.AuxInt)
5320 sym := ssa.AuxToSym(v.Aux)
5321 if v_0.Op != ssaop.OpRISCV64ADDI {
5322 break
5323 }
5324 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
5325 base := v_0.Args[0]
5326 val := v_1
5327 mem := v_2
5328 if !(ssa.Is32Bit(int64(off1) + off2)) {
5329 break
5330 }
5331 v.Reset(ssaop.OpRISCV64MOVBstore)
5332 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
5333 v.Aux = ssa.SymToAux(sym)
5334 v.AddArg3(base, val, mem)
5335 return true
5336 }
5337
5338
5339 for {
5340 off := ssa.AuxIntToInt32(v.AuxInt)
5341 sym := ssa.AuxToSym(v.Aux)
5342 ptr := v_0
5343 if v_1.Op != ssaop.OpRISCV64MOVDconst || ssa.AuxIntToInt64(v_1.AuxInt) != 0 {
5344 break
5345 }
5346 mem := v_2
5347 v.Reset(ssaop.OpRISCV64MOVBstorezero)
5348 v.AuxInt = ssa.Int32ToAuxInt(off)
5349 v.Aux = ssa.SymToAux(sym)
5350 v.AddArg2(ptr, mem)
5351 return true
5352 }
5353
5354
5355 for {
5356 off := ssa.AuxIntToInt32(v.AuxInt)
5357 sym := ssa.AuxToSym(v.Aux)
5358 ptr := v_0
5359 if v_1.Op != ssaop.OpRISCV64MOVBreg {
5360 break
5361 }
5362 x := v_1.Args[0]
5363 mem := v_2
5364 v.Reset(ssaop.OpRISCV64MOVBstore)
5365 v.AuxInt = ssa.Int32ToAuxInt(off)
5366 v.Aux = ssa.SymToAux(sym)
5367 v.AddArg3(ptr, x, mem)
5368 return true
5369 }
5370
5371
5372 for {
5373 off := ssa.AuxIntToInt32(v.AuxInt)
5374 sym := ssa.AuxToSym(v.Aux)
5375 ptr := v_0
5376 if v_1.Op != ssaop.OpRISCV64MOVHreg {
5377 break
5378 }
5379 x := v_1.Args[0]
5380 mem := v_2
5381 v.Reset(ssaop.OpRISCV64MOVBstore)
5382 v.AuxInt = ssa.Int32ToAuxInt(off)
5383 v.Aux = ssa.SymToAux(sym)
5384 v.AddArg3(ptr, x, mem)
5385 return true
5386 }
5387
5388
5389 for {
5390 off := ssa.AuxIntToInt32(v.AuxInt)
5391 sym := ssa.AuxToSym(v.Aux)
5392 ptr := v_0
5393 if v_1.Op != ssaop.OpRISCV64MOVWreg {
5394 break
5395 }
5396 x := v_1.Args[0]
5397 mem := v_2
5398 v.Reset(ssaop.OpRISCV64MOVBstore)
5399 v.AuxInt = ssa.Int32ToAuxInt(off)
5400 v.Aux = ssa.SymToAux(sym)
5401 v.AddArg3(ptr, x, mem)
5402 return true
5403 }
5404
5405
5406 for {
5407 off := ssa.AuxIntToInt32(v.AuxInt)
5408 sym := ssa.AuxToSym(v.Aux)
5409 ptr := v_0
5410 if v_1.Op != ssaop.OpRISCV64MOVBUreg {
5411 break
5412 }
5413 x := v_1.Args[0]
5414 mem := v_2
5415 v.Reset(ssaop.OpRISCV64MOVBstore)
5416 v.AuxInt = ssa.Int32ToAuxInt(off)
5417 v.Aux = ssa.SymToAux(sym)
5418 v.AddArg3(ptr, x, mem)
5419 return true
5420 }
5421
5422
5423 for {
5424 off := ssa.AuxIntToInt32(v.AuxInt)
5425 sym := ssa.AuxToSym(v.Aux)
5426 ptr := v_0
5427 if v_1.Op != ssaop.OpRISCV64MOVHUreg {
5428 break
5429 }
5430 x := v_1.Args[0]
5431 mem := v_2
5432 v.Reset(ssaop.OpRISCV64MOVBstore)
5433 v.AuxInt = ssa.Int32ToAuxInt(off)
5434 v.Aux = ssa.SymToAux(sym)
5435 v.AddArg3(ptr, x, mem)
5436 return true
5437 }
5438
5439
5440 for {
5441 off := ssa.AuxIntToInt32(v.AuxInt)
5442 sym := ssa.AuxToSym(v.Aux)
5443 ptr := v_0
5444 if v_1.Op != ssaop.OpRISCV64MOVWUreg {
5445 break
5446 }
5447 x := v_1.Args[0]
5448 mem := v_2
5449 v.Reset(ssaop.OpRISCV64MOVBstore)
5450 v.AuxInt = ssa.Int32ToAuxInt(off)
5451 v.Aux = ssa.SymToAux(sym)
5452 v.AddArg3(ptr, x, mem)
5453 return true
5454 }
5455 return false
5456 }
5457 func rewriteValue_OpRISCV64MOVBstorezero(v *ssa.Value) bool {
5458 v_1 := v.Args[1]
5459 v_0 := v.Args[0]
5460 b := v.Block
5461 config := b.Func.Config
5462
5463
5464
5465 for {
5466 off1 := ssa.AuxIntToInt32(v.AuxInt)
5467 sym1 := ssa.AuxToSym(v.Aux)
5468 if v_0.Op != ssaop.OpRISCV64MOVaddr {
5469 break
5470 }
5471 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
5472 sym2 := ssa.AuxToSym(v_0.Aux)
5473 base := v_0.Args[0]
5474 mem := v_1
5475 if !(ssa.CanMergeSym(sym1, sym2) && ssa.Is32Bit(int64(off1)+int64(off2)) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
5476 break
5477 }
5478 v.Reset(ssaop.OpRISCV64MOVBstorezero)
5479 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
5480 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
5481 v.AddArg2(base, mem)
5482 return true
5483 }
5484
5485
5486
5487 for {
5488 off1 := ssa.AuxIntToInt32(v.AuxInt)
5489 sym := ssa.AuxToSym(v.Aux)
5490 if v_0.Op != ssaop.OpRISCV64ADDI {
5491 break
5492 }
5493 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
5494 base := v_0.Args[0]
5495 mem := v_1
5496 if !(ssa.Is32Bit(int64(off1) + off2)) {
5497 break
5498 }
5499 v.Reset(ssaop.OpRISCV64MOVBstorezero)
5500 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
5501 v.Aux = ssa.SymToAux(sym)
5502 v.AddArg2(base, mem)
5503 return true
5504 }
5505 return false
5506 }
5507 func rewriteValue_OpRISCV64MOVDload(v *ssa.Value) bool {
5508 v_1 := v.Args[1]
5509 v_0 := v.Args[0]
5510 b := v.Block
5511 config := b.Func.Config
5512
5513
5514
5515 for {
5516 off1 := ssa.AuxIntToInt32(v.AuxInt)
5517 sym1 := ssa.AuxToSym(v.Aux)
5518 if v_0.Op != ssaop.OpRISCV64MOVaddr {
5519 break
5520 }
5521 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
5522 sym2 := ssa.AuxToSym(v_0.Aux)
5523 base := v_0.Args[0]
5524 mem := v_1
5525 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
5526 break
5527 }
5528 v.Reset(ssaop.OpRISCV64MOVDload)
5529 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
5530 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
5531 v.AddArg2(base, mem)
5532 return true
5533 }
5534
5535
5536
5537 for {
5538 off1 := ssa.AuxIntToInt32(v.AuxInt)
5539 sym := ssa.AuxToSym(v.Aux)
5540 if v_0.Op != ssaop.OpRISCV64ADDI {
5541 break
5542 }
5543 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
5544 base := v_0.Args[0]
5545 mem := v_1
5546 if !(ssa.Is32Bit(int64(off1) + off2)) {
5547 break
5548 }
5549 v.Reset(ssaop.OpRISCV64MOVDload)
5550 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
5551 v.Aux = ssa.SymToAux(sym)
5552 v.AddArg2(base, mem)
5553 return true
5554 }
5555
5556
5557
5558 for {
5559 off := ssa.AuxIntToInt32(v.AuxInt)
5560 sym := ssa.AuxToSym(v.Aux)
5561 ptr1 := v_0
5562 if v_1.Op != ssaop.OpRISCV64MOVDstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
5563 break
5564 }
5565 x := v_1.Args[1]
5566 ptr2 := v_1.Args[0]
5567 if !(ssa.IsSamePtr(ptr1, ptr2)) {
5568 break
5569 }
5570 v.Reset(ssaop.OpRISCV64MOVDreg)
5571 v.AddArg(x)
5572 return true
5573 }
5574
5575
5576
5577 for {
5578 off := ssa.AuxIntToInt32(v.AuxInt)
5579 sym := ssa.AuxToSym(v.Aux)
5580 ptr1 := v_0
5581 if v_1.Op != ssaop.OpRISCV64FMOVDstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
5582 break
5583 }
5584 x := v_1.Args[1]
5585 ptr2 := v_1.Args[0]
5586 if !(ssa.IsSamePtr(ptr1, ptr2)) {
5587 break
5588 }
5589 v.Reset(ssaop.OpRISCV64FMVXD)
5590 v.AddArg(x)
5591 return true
5592 }
5593 return false
5594 }
5595 func rewriteValue_OpRISCV64MOVDnop(v *ssa.Value) bool {
5596 v_0 := v.Args[0]
5597
5598
5599 for {
5600 if v_0.Op != ssaop.OpRISCV64MOVDconst {
5601 break
5602 }
5603 c := ssa.AuxIntToInt64(v_0.AuxInt)
5604 v.Reset(ssaop.OpRISCV64MOVDconst)
5605 v.AuxInt = ssa.Int64ToAuxInt(c)
5606 return true
5607 }
5608 return false
5609 }
5610 func rewriteValue_OpRISCV64MOVDreg(v *ssa.Value) bool {
5611 v_0 := v.Args[0]
5612
5613
5614
5615 for {
5616 x := v_0
5617 if !(x.Uses == 1) {
5618 break
5619 }
5620 v.Reset(ssaop.OpRISCV64MOVDnop)
5621 v.AddArg(x)
5622 return true
5623 }
5624 return false
5625 }
5626 func rewriteValue_OpRISCV64MOVDstore(v *ssa.Value) bool {
5627 v_2 := v.Args[2]
5628 v_1 := v.Args[1]
5629 v_0 := v.Args[0]
5630 b := v.Block
5631 config := b.Func.Config
5632
5633
5634
5635 for {
5636 off1 := ssa.AuxIntToInt32(v.AuxInt)
5637 sym1 := ssa.AuxToSym(v.Aux)
5638 if v_0.Op != ssaop.OpRISCV64MOVaddr {
5639 break
5640 }
5641 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
5642 sym2 := ssa.AuxToSym(v_0.Aux)
5643 base := v_0.Args[0]
5644 val := v_1
5645 mem := v_2
5646 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
5647 break
5648 }
5649 v.Reset(ssaop.OpRISCV64MOVDstore)
5650 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
5651 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
5652 v.AddArg3(base, val, mem)
5653 return true
5654 }
5655
5656
5657
5658 for {
5659 off1 := ssa.AuxIntToInt32(v.AuxInt)
5660 sym := ssa.AuxToSym(v.Aux)
5661 if v_0.Op != ssaop.OpRISCV64ADDI {
5662 break
5663 }
5664 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
5665 base := v_0.Args[0]
5666 val := v_1
5667 mem := v_2
5668 if !(ssa.Is32Bit(int64(off1) + off2)) {
5669 break
5670 }
5671 v.Reset(ssaop.OpRISCV64MOVDstore)
5672 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
5673 v.Aux = ssa.SymToAux(sym)
5674 v.AddArg3(base, val, mem)
5675 return true
5676 }
5677
5678
5679 for {
5680 off := ssa.AuxIntToInt32(v.AuxInt)
5681 sym := ssa.AuxToSym(v.Aux)
5682 ptr := v_0
5683 if v_1.Op != ssaop.OpRISCV64MOVDconst || ssa.AuxIntToInt64(v_1.AuxInt) != 0 {
5684 break
5685 }
5686 mem := v_2
5687 v.Reset(ssaop.OpRISCV64MOVDstorezero)
5688 v.AuxInt = ssa.Int32ToAuxInt(off)
5689 v.Aux = ssa.SymToAux(sym)
5690 v.AddArg2(ptr, mem)
5691 return true
5692 }
5693 return false
5694 }
5695 func rewriteValue_OpRISCV64MOVDstorezero(v *ssa.Value) bool {
5696 v_1 := v.Args[1]
5697 v_0 := v.Args[0]
5698 b := v.Block
5699 config := b.Func.Config
5700
5701
5702
5703 for {
5704 off1 := ssa.AuxIntToInt32(v.AuxInt)
5705 sym1 := ssa.AuxToSym(v.Aux)
5706 if v_0.Op != ssaop.OpRISCV64MOVaddr {
5707 break
5708 }
5709 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
5710 sym2 := ssa.AuxToSym(v_0.Aux)
5711 base := v_0.Args[0]
5712 mem := v_1
5713 if !(ssa.CanMergeSym(sym1, sym2) && ssa.Is32Bit(int64(off1)+int64(off2)) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
5714 break
5715 }
5716 v.Reset(ssaop.OpRISCV64MOVDstorezero)
5717 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
5718 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
5719 v.AddArg2(base, mem)
5720 return true
5721 }
5722
5723
5724
5725 for {
5726 off1 := ssa.AuxIntToInt32(v.AuxInt)
5727 sym := ssa.AuxToSym(v.Aux)
5728 if v_0.Op != ssaop.OpRISCV64ADDI {
5729 break
5730 }
5731 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
5732 base := v_0.Args[0]
5733 mem := v_1
5734 if !(ssa.Is32Bit(int64(off1) + off2)) {
5735 break
5736 }
5737 v.Reset(ssaop.OpRISCV64MOVDstorezero)
5738 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
5739 v.Aux = ssa.SymToAux(sym)
5740 v.AddArg2(base, mem)
5741 return true
5742 }
5743 return false
5744 }
5745 func rewriteValue_OpRISCV64MOVHUload(v *ssa.Value) bool {
5746 v_1 := v.Args[1]
5747 v_0 := v.Args[0]
5748 b := v.Block
5749 config := b.Func.Config
5750
5751
5752
5753 for {
5754 off1 := ssa.AuxIntToInt32(v.AuxInt)
5755 sym1 := ssa.AuxToSym(v.Aux)
5756 if v_0.Op != ssaop.OpRISCV64MOVaddr {
5757 break
5758 }
5759 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
5760 sym2 := ssa.AuxToSym(v_0.Aux)
5761 base := v_0.Args[0]
5762 mem := v_1
5763 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
5764 break
5765 }
5766 v.Reset(ssaop.OpRISCV64MOVHUload)
5767 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
5768 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
5769 v.AddArg2(base, mem)
5770 return true
5771 }
5772
5773
5774
5775 for {
5776 off1 := ssa.AuxIntToInt32(v.AuxInt)
5777 sym := ssa.AuxToSym(v.Aux)
5778 if v_0.Op != ssaop.OpRISCV64ADDI {
5779 break
5780 }
5781 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
5782 base := v_0.Args[0]
5783 mem := v_1
5784 if !(ssa.Is32Bit(int64(off1) + off2)) {
5785 break
5786 }
5787 v.Reset(ssaop.OpRISCV64MOVHUload)
5788 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
5789 v.Aux = ssa.SymToAux(sym)
5790 v.AddArg2(base, mem)
5791 return true
5792 }
5793
5794
5795
5796 for {
5797 off := ssa.AuxIntToInt32(v.AuxInt)
5798 sym := ssa.AuxToSym(v.Aux)
5799 ptr1 := v_0
5800 if v_1.Op != ssaop.OpRISCV64MOVHstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
5801 break
5802 }
5803 x := v_1.Args[1]
5804 ptr2 := v_1.Args[0]
5805 if !(ssa.IsSamePtr(ptr1, ptr2)) {
5806 break
5807 }
5808 v.Reset(ssaop.OpRISCV64MOVHUreg)
5809 v.AddArg(x)
5810 return true
5811 }
5812 return false
5813 }
5814 func rewriteValue_OpRISCV64MOVHUreg(v *ssa.Value) bool {
5815 v_0 := v.Args[0]
5816 b := v.Block
5817
5818
5819
5820 for {
5821 x := v_0
5822 if x.Op != ssaop.OpRISCV64ANDI {
5823 break
5824 }
5825 c := ssa.AuxIntToInt64(x.AuxInt)
5826 if !(c >= 0 && int64(uint16(c)) == c) {
5827 break
5828 }
5829 v.CopyOf(x)
5830 return true
5831 }
5832
5833
5834
5835 for {
5836 if v_0.Op != ssaop.OpRISCV64ANDI {
5837 break
5838 }
5839 c := ssa.AuxIntToInt64(v_0.AuxInt)
5840 x := v_0.Args[0]
5841 if !(c < 0) {
5842 break
5843 }
5844 v.Reset(ssaop.OpRISCV64ANDI)
5845 v.AuxInt = ssa.Int64ToAuxInt(int64(uint16(c)))
5846 v.AddArg(x)
5847 return true
5848 }
5849
5850
5851
5852 for {
5853 x := v_0
5854 if x.Op != ssaop.OpRISCV64SRLI {
5855 break
5856 }
5857 c := ssa.AuxIntToInt64(x.AuxInt)
5858 if !(c >= 48) {
5859 break
5860 }
5861 v.CopyOf(x)
5862 return true
5863 }
5864
5865
5866
5867 for {
5868 x := v_0
5869 if x.Op != ssaop.OpRISCV64SRLIW {
5870 break
5871 }
5872 c := ssa.AuxIntToInt64(x.AuxInt)
5873 if !(c >= 16) {
5874 break
5875 }
5876 v.CopyOf(x)
5877 return true
5878 }
5879
5880
5881 for {
5882 if v_0.Op != ssaop.OpRISCV64MOVDconst {
5883 break
5884 }
5885 c := ssa.AuxIntToInt64(v_0.AuxInt)
5886 v.Reset(ssaop.OpRISCV64MOVDconst)
5887 v.AuxInt = ssa.Int64ToAuxInt(int64(uint16(c)))
5888 return true
5889 }
5890
5891
5892 for {
5893 x := v_0
5894 if x.Op != ssaop.OpRISCV64MOVBUload {
5895 break
5896 }
5897 v.Reset(ssaop.OpRISCV64MOVDreg)
5898 v.AddArg(x)
5899 return true
5900 }
5901
5902
5903 for {
5904 x := v_0
5905 if x.Op != ssaop.OpRISCV64MOVHUload {
5906 break
5907 }
5908 v.Reset(ssaop.OpRISCV64MOVDreg)
5909 v.AddArg(x)
5910 return true
5911 }
5912
5913
5914 for {
5915 x := v_0
5916 if x.Op != ssaop.OpRISCV64MOVBUreg {
5917 break
5918 }
5919 v.Reset(ssaop.OpRISCV64MOVDreg)
5920 v.AddArg(x)
5921 return true
5922 }
5923
5924
5925 for {
5926 x := v_0
5927 if x.Op != ssaop.OpRISCV64MOVHUreg {
5928 break
5929 }
5930 v.Reset(ssaop.OpRISCV64MOVDreg)
5931 v.AddArg(x)
5932 return true
5933 }
5934
5935
5936
5937 for {
5938 t := v.Type
5939 x := v_0
5940 if x.Op != ssaop.OpRISCV64MOVHload {
5941 break
5942 }
5943 off := ssa.AuxIntToInt32(x.AuxInt)
5944 sym := ssa.AuxToSym(x.Aux)
5945 mem := x.Args[1]
5946 ptr := x.Args[0]
5947 if !(x.Uses == 1 && ssa.Clobber(x)) {
5948 break
5949 }
5950 b = x.Block
5951 v0 := b.NewValue0(x.Pos, ssaop.OpRISCV64MOVHUload, t)
5952 v.CopyOf(v0)
5953 v0.AuxInt = ssa.Int32ToAuxInt(off)
5954 v0.Aux = ssa.SymToAux(sym)
5955 v0.AddArg2(ptr, mem)
5956 return true
5957 }
5958 return false
5959 }
5960 func rewriteValue_OpRISCV64MOVHload(v *ssa.Value) bool {
5961 v_1 := v.Args[1]
5962 v_0 := v.Args[0]
5963 b := v.Block
5964 config := b.Func.Config
5965
5966
5967
5968 for {
5969 off1 := ssa.AuxIntToInt32(v.AuxInt)
5970 sym1 := ssa.AuxToSym(v.Aux)
5971 if v_0.Op != ssaop.OpRISCV64MOVaddr {
5972 break
5973 }
5974 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
5975 sym2 := ssa.AuxToSym(v_0.Aux)
5976 base := v_0.Args[0]
5977 mem := v_1
5978 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
5979 break
5980 }
5981 v.Reset(ssaop.OpRISCV64MOVHload)
5982 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
5983 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
5984 v.AddArg2(base, mem)
5985 return true
5986 }
5987
5988
5989
5990 for {
5991 off1 := ssa.AuxIntToInt32(v.AuxInt)
5992 sym := ssa.AuxToSym(v.Aux)
5993 if v_0.Op != ssaop.OpRISCV64ADDI {
5994 break
5995 }
5996 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
5997 base := v_0.Args[0]
5998 mem := v_1
5999 if !(ssa.Is32Bit(int64(off1) + off2)) {
6000 break
6001 }
6002 v.Reset(ssaop.OpRISCV64MOVHload)
6003 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
6004 v.Aux = ssa.SymToAux(sym)
6005 v.AddArg2(base, mem)
6006 return true
6007 }
6008
6009
6010
6011 for {
6012 off := ssa.AuxIntToInt32(v.AuxInt)
6013 sym := ssa.AuxToSym(v.Aux)
6014 ptr1 := v_0
6015 if v_1.Op != ssaop.OpRISCV64MOVHstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
6016 break
6017 }
6018 x := v_1.Args[1]
6019 ptr2 := v_1.Args[0]
6020 if !(ssa.IsSamePtr(ptr1, ptr2)) {
6021 break
6022 }
6023 v.Reset(ssaop.OpRISCV64MOVHreg)
6024 v.AddArg(x)
6025 return true
6026 }
6027 return false
6028 }
6029 func rewriteValue_OpRISCV64MOVHreg(v *ssa.Value) bool {
6030 v_0 := v.Args[0]
6031 b := v.Block
6032
6033
6034
6035 for {
6036 x := v_0
6037 if x.Op != ssaop.OpRISCV64ANDI {
6038 break
6039 }
6040 c := ssa.AuxIntToInt64(x.AuxInt)
6041 if !(c >= 0 && int64(int16(c)) == c) {
6042 break
6043 }
6044 v.CopyOf(x)
6045 return true
6046 }
6047
6048
6049 for {
6050 if v_0.Op != ssaop.OpRISCV64MOVDconst {
6051 break
6052 }
6053 c := ssa.AuxIntToInt64(v_0.AuxInt)
6054 v.Reset(ssaop.OpRISCV64MOVDconst)
6055 v.AuxInt = ssa.Int64ToAuxInt(int64(int16(c)))
6056 return true
6057 }
6058
6059
6060 for {
6061 x := v_0
6062 if x.Op != ssaop.OpRISCV64MOVBload {
6063 break
6064 }
6065 v.Reset(ssaop.OpRISCV64MOVDreg)
6066 v.AddArg(x)
6067 return true
6068 }
6069
6070
6071 for {
6072 x := v_0
6073 if x.Op != ssaop.OpRISCV64MOVBUload {
6074 break
6075 }
6076 v.Reset(ssaop.OpRISCV64MOVDreg)
6077 v.AddArg(x)
6078 return true
6079 }
6080
6081
6082 for {
6083 x := v_0
6084 if x.Op != ssaop.OpRISCV64MOVHload {
6085 break
6086 }
6087 v.Reset(ssaop.OpRISCV64MOVDreg)
6088 v.AddArg(x)
6089 return true
6090 }
6091
6092
6093 for {
6094 x := v_0
6095 if x.Op != ssaop.OpRISCV64MOVBreg {
6096 break
6097 }
6098 v.Reset(ssaop.OpRISCV64MOVDreg)
6099 v.AddArg(x)
6100 return true
6101 }
6102
6103
6104 for {
6105 x := v_0
6106 if x.Op != ssaop.OpRISCV64MOVBUreg {
6107 break
6108 }
6109 v.Reset(ssaop.OpRISCV64MOVDreg)
6110 v.AddArg(x)
6111 return true
6112 }
6113
6114
6115 for {
6116 x := v_0
6117 if x.Op != ssaop.OpRISCV64MOVHreg {
6118 break
6119 }
6120 v.Reset(ssaop.OpRISCV64MOVDreg)
6121 v.AddArg(x)
6122 return true
6123 }
6124
6125
6126
6127 for {
6128 t := v.Type
6129 x := v_0
6130 if x.Op != ssaop.OpRISCV64MOVHUload {
6131 break
6132 }
6133 off := ssa.AuxIntToInt32(x.AuxInt)
6134 sym := ssa.AuxToSym(x.Aux)
6135 mem := x.Args[1]
6136 ptr := x.Args[0]
6137 if !(x.Uses == 1 && ssa.Clobber(x)) {
6138 break
6139 }
6140 b = x.Block
6141 v0 := b.NewValue0(x.Pos, ssaop.OpRISCV64MOVHload, t)
6142 v.CopyOf(v0)
6143 v0.AuxInt = ssa.Int32ToAuxInt(off)
6144 v0.Aux = ssa.SymToAux(sym)
6145 v0.AddArg2(ptr, mem)
6146 return true
6147 }
6148 return false
6149 }
6150 func rewriteValue_OpRISCV64MOVHstore(v *ssa.Value) bool {
6151 v_2 := v.Args[2]
6152 v_1 := v.Args[1]
6153 v_0 := v.Args[0]
6154 b := v.Block
6155 config := b.Func.Config
6156
6157
6158
6159 for {
6160 off1 := ssa.AuxIntToInt32(v.AuxInt)
6161 sym1 := ssa.AuxToSym(v.Aux)
6162 if v_0.Op != ssaop.OpRISCV64MOVaddr {
6163 break
6164 }
6165 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
6166 sym2 := ssa.AuxToSym(v_0.Aux)
6167 base := v_0.Args[0]
6168 val := v_1
6169 mem := v_2
6170 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
6171 break
6172 }
6173 v.Reset(ssaop.OpRISCV64MOVHstore)
6174 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
6175 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
6176 v.AddArg3(base, val, mem)
6177 return true
6178 }
6179
6180
6181
6182 for {
6183 off1 := ssa.AuxIntToInt32(v.AuxInt)
6184 sym := ssa.AuxToSym(v.Aux)
6185 if v_0.Op != ssaop.OpRISCV64ADDI {
6186 break
6187 }
6188 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
6189 base := v_0.Args[0]
6190 val := v_1
6191 mem := v_2
6192 if !(ssa.Is32Bit(int64(off1) + off2)) {
6193 break
6194 }
6195 v.Reset(ssaop.OpRISCV64MOVHstore)
6196 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
6197 v.Aux = ssa.SymToAux(sym)
6198 v.AddArg3(base, val, mem)
6199 return true
6200 }
6201
6202
6203 for {
6204 off := ssa.AuxIntToInt32(v.AuxInt)
6205 sym := ssa.AuxToSym(v.Aux)
6206 ptr := v_0
6207 if v_1.Op != ssaop.OpRISCV64MOVDconst || ssa.AuxIntToInt64(v_1.AuxInt) != 0 {
6208 break
6209 }
6210 mem := v_2
6211 v.Reset(ssaop.OpRISCV64MOVHstorezero)
6212 v.AuxInt = ssa.Int32ToAuxInt(off)
6213 v.Aux = ssa.SymToAux(sym)
6214 v.AddArg2(ptr, mem)
6215 return true
6216 }
6217
6218
6219 for {
6220 off := ssa.AuxIntToInt32(v.AuxInt)
6221 sym := ssa.AuxToSym(v.Aux)
6222 ptr := v_0
6223 if v_1.Op != ssaop.OpRISCV64MOVHreg {
6224 break
6225 }
6226 x := v_1.Args[0]
6227 mem := v_2
6228 v.Reset(ssaop.OpRISCV64MOVHstore)
6229 v.AuxInt = ssa.Int32ToAuxInt(off)
6230 v.Aux = ssa.SymToAux(sym)
6231 v.AddArg3(ptr, x, mem)
6232 return true
6233 }
6234
6235
6236 for {
6237 off := ssa.AuxIntToInt32(v.AuxInt)
6238 sym := ssa.AuxToSym(v.Aux)
6239 ptr := v_0
6240 if v_1.Op != ssaop.OpRISCV64MOVWreg {
6241 break
6242 }
6243 x := v_1.Args[0]
6244 mem := v_2
6245 v.Reset(ssaop.OpRISCV64MOVHstore)
6246 v.AuxInt = ssa.Int32ToAuxInt(off)
6247 v.Aux = ssa.SymToAux(sym)
6248 v.AddArg3(ptr, x, mem)
6249 return true
6250 }
6251
6252
6253 for {
6254 off := ssa.AuxIntToInt32(v.AuxInt)
6255 sym := ssa.AuxToSym(v.Aux)
6256 ptr := v_0
6257 if v_1.Op != ssaop.OpRISCV64MOVHUreg {
6258 break
6259 }
6260 x := v_1.Args[0]
6261 mem := v_2
6262 v.Reset(ssaop.OpRISCV64MOVHstore)
6263 v.AuxInt = ssa.Int32ToAuxInt(off)
6264 v.Aux = ssa.SymToAux(sym)
6265 v.AddArg3(ptr, x, mem)
6266 return true
6267 }
6268
6269
6270 for {
6271 off := ssa.AuxIntToInt32(v.AuxInt)
6272 sym := ssa.AuxToSym(v.Aux)
6273 ptr := v_0
6274 if v_1.Op != ssaop.OpRISCV64MOVWUreg {
6275 break
6276 }
6277 x := v_1.Args[0]
6278 mem := v_2
6279 v.Reset(ssaop.OpRISCV64MOVHstore)
6280 v.AuxInt = ssa.Int32ToAuxInt(off)
6281 v.Aux = ssa.SymToAux(sym)
6282 v.AddArg3(ptr, x, mem)
6283 return true
6284 }
6285 return false
6286 }
6287 func rewriteValue_OpRISCV64MOVHstorezero(v *ssa.Value) bool {
6288 v_1 := v.Args[1]
6289 v_0 := v.Args[0]
6290 b := v.Block
6291 config := b.Func.Config
6292
6293
6294
6295 for {
6296 off1 := ssa.AuxIntToInt32(v.AuxInt)
6297 sym1 := ssa.AuxToSym(v.Aux)
6298 if v_0.Op != ssaop.OpRISCV64MOVaddr {
6299 break
6300 }
6301 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
6302 sym2 := ssa.AuxToSym(v_0.Aux)
6303 base := v_0.Args[0]
6304 mem := v_1
6305 if !(ssa.CanMergeSym(sym1, sym2) && ssa.Is32Bit(int64(off1)+int64(off2)) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
6306 break
6307 }
6308 v.Reset(ssaop.OpRISCV64MOVHstorezero)
6309 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
6310 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
6311 v.AddArg2(base, mem)
6312 return true
6313 }
6314
6315
6316
6317 for {
6318 off1 := ssa.AuxIntToInt32(v.AuxInt)
6319 sym := ssa.AuxToSym(v.Aux)
6320 if v_0.Op != ssaop.OpRISCV64ADDI {
6321 break
6322 }
6323 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
6324 base := v_0.Args[0]
6325 mem := v_1
6326 if !(ssa.Is32Bit(int64(off1) + off2)) {
6327 break
6328 }
6329 v.Reset(ssaop.OpRISCV64MOVHstorezero)
6330 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
6331 v.Aux = ssa.SymToAux(sym)
6332 v.AddArg2(base, mem)
6333 return true
6334 }
6335 return false
6336 }
6337 func rewriteValue_OpRISCV64MOVWUload(v *ssa.Value) bool {
6338 v_1 := v.Args[1]
6339 v_0 := v.Args[0]
6340 b := v.Block
6341 config := b.Func.Config
6342 typ := &b.Func.Config.Types
6343
6344
6345
6346 for {
6347 off1 := ssa.AuxIntToInt32(v.AuxInt)
6348 sym1 := ssa.AuxToSym(v.Aux)
6349 if v_0.Op != ssaop.OpRISCV64MOVaddr {
6350 break
6351 }
6352 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
6353 sym2 := ssa.AuxToSym(v_0.Aux)
6354 base := v_0.Args[0]
6355 mem := v_1
6356 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
6357 break
6358 }
6359 v.Reset(ssaop.OpRISCV64MOVWUload)
6360 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
6361 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
6362 v.AddArg2(base, mem)
6363 return true
6364 }
6365
6366
6367
6368 for {
6369 off1 := ssa.AuxIntToInt32(v.AuxInt)
6370 sym := ssa.AuxToSym(v.Aux)
6371 if v_0.Op != ssaop.OpRISCV64ADDI {
6372 break
6373 }
6374 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
6375 base := v_0.Args[0]
6376 mem := v_1
6377 if !(ssa.Is32Bit(int64(off1) + off2)) {
6378 break
6379 }
6380 v.Reset(ssaop.OpRISCV64MOVWUload)
6381 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
6382 v.Aux = ssa.SymToAux(sym)
6383 v.AddArg2(base, mem)
6384 return true
6385 }
6386
6387
6388
6389 for {
6390 off := ssa.AuxIntToInt32(v.AuxInt)
6391 sym := ssa.AuxToSym(v.Aux)
6392 ptr1 := v_0
6393 if v_1.Op != ssaop.OpRISCV64MOVWstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
6394 break
6395 }
6396 x := v_1.Args[1]
6397 ptr2 := v_1.Args[0]
6398 if !(ssa.IsSamePtr(ptr1, ptr2)) {
6399 break
6400 }
6401 v.Reset(ssaop.OpRISCV64MOVWUreg)
6402 v.AddArg(x)
6403 return true
6404 }
6405
6406
6407
6408 for {
6409 off := ssa.AuxIntToInt32(v.AuxInt)
6410 sym := ssa.AuxToSym(v.Aux)
6411 ptr1 := v_0
6412 if v_1.Op != ssaop.OpRISCV64FMOVWstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
6413 break
6414 }
6415 x := v_1.Args[1]
6416 ptr2 := v_1.Args[0]
6417 if !(ssa.IsSamePtr(ptr1, ptr2)) {
6418 break
6419 }
6420 v.Reset(ssaop.OpRISCV64MOVWUreg)
6421 v0 := b.NewValue0(v_1.Pos, ssaop.OpRISCV64FMVXS, typ.Int32)
6422 v0.AddArg(x)
6423 v.AddArg(v0)
6424 return true
6425 }
6426 return false
6427 }
6428 func rewriteValue_OpRISCV64MOVWUreg(v *ssa.Value) bool {
6429 v_0 := v.Args[0]
6430 b := v.Block
6431 typ := &b.Func.Config.Types
6432
6433
6434
6435 for {
6436 x := v_0
6437 if x.Op != ssaop.OpRISCV64ANDI {
6438 break
6439 }
6440 c := ssa.AuxIntToInt64(x.AuxInt)
6441 if !(c >= 0 && int64(uint32(c)) == c) {
6442 break
6443 }
6444 v.CopyOf(x)
6445 return true
6446 }
6447
6448
6449
6450 for {
6451 if v_0.Op != ssaop.OpRISCV64ANDI {
6452 break
6453 }
6454 c := ssa.AuxIntToInt64(v_0.AuxInt)
6455 x := v_0.Args[0]
6456 if !(c < 0) {
6457 break
6458 }
6459 v.Reset(ssaop.OpRISCV64AND)
6460 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
6461 v0.AuxInt = ssa.Int64ToAuxInt(int64(uint32(c)))
6462 v.AddArg2(v0, x)
6463 return true
6464 }
6465
6466
6467
6468 for {
6469 x := v_0
6470 if x.Op != ssaop.OpRISCV64SRLI {
6471 break
6472 }
6473 c := ssa.AuxIntToInt64(x.AuxInt)
6474 if !(c >= 32) {
6475 break
6476 }
6477 v.CopyOf(x)
6478 return true
6479 }
6480
6481
6482 for {
6483 x := v_0
6484 if x.Op != ssaop.OpRISCV64SRLIW {
6485 break
6486 }
6487 v.CopyOf(x)
6488 return true
6489 }
6490
6491
6492 for {
6493 if v_0.Op != ssaop.OpRISCV64MOVDconst {
6494 break
6495 }
6496 c := ssa.AuxIntToInt64(v_0.AuxInt)
6497 v.Reset(ssaop.OpRISCV64MOVDconst)
6498 v.AuxInt = ssa.Int64ToAuxInt(int64(uint32(c)))
6499 return true
6500 }
6501
6502
6503 for {
6504 x := v_0
6505 if x.Op != ssaop.OpRISCV64MOVBUload {
6506 break
6507 }
6508 v.Reset(ssaop.OpRISCV64MOVDreg)
6509 v.AddArg(x)
6510 return true
6511 }
6512
6513
6514 for {
6515 x := v_0
6516 if x.Op != ssaop.OpRISCV64MOVHUload {
6517 break
6518 }
6519 v.Reset(ssaop.OpRISCV64MOVDreg)
6520 v.AddArg(x)
6521 return true
6522 }
6523
6524
6525 for {
6526 x := v_0
6527 if x.Op != ssaop.OpRISCV64MOVWUload {
6528 break
6529 }
6530 v.Reset(ssaop.OpRISCV64MOVDreg)
6531 v.AddArg(x)
6532 return true
6533 }
6534
6535
6536 for {
6537 x := v_0
6538 if x.Op != ssaop.OpRISCV64MOVBUreg {
6539 break
6540 }
6541 v.Reset(ssaop.OpRISCV64MOVDreg)
6542 v.AddArg(x)
6543 return true
6544 }
6545
6546
6547 for {
6548 x := v_0
6549 if x.Op != ssaop.OpRISCV64MOVHUreg {
6550 break
6551 }
6552 v.Reset(ssaop.OpRISCV64MOVDreg)
6553 v.AddArg(x)
6554 return true
6555 }
6556
6557
6558 for {
6559 x := v_0
6560 if x.Op != ssaop.OpRISCV64MOVWUreg {
6561 break
6562 }
6563 v.Reset(ssaop.OpRISCV64MOVDreg)
6564 v.AddArg(x)
6565 return true
6566 }
6567
6568
6569
6570 for {
6571 t := v.Type
6572 x := v_0
6573 if x.Op != ssaop.OpRISCV64MOVWload {
6574 break
6575 }
6576 off := ssa.AuxIntToInt32(x.AuxInt)
6577 sym := ssa.AuxToSym(x.Aux)
6578 mem := x.Args[1]
6579 ptr := x.Args[0]
6580 if !(x.Uses == 1 && ssa.Clobber(x)) {
6581 break
6582 }
6583 b = x.Block
6584 v0 := b.NewValue0(x.Pos, ssaop.OpRISCV64MOVWUload, t)
6585 v.CopyOf(v0)
6586 v0.AuxInt = ssa.Int32ToAuxInt(off)
6587 v0.Aux = ssa.SymToAux(sym)
6588 v0.AddArg2(ptr, mem)
6589 return true
6590 }
6591 return false
6592 }
6593 func rewriteValue_OpRISCV64MOVWload(v *ssa.Value) bool {
6594 v_1 := v.Args[1]
6595 v_0 := v.Args[0]
6596 b := v.Block
6597 config := b.Func.Config
6598
6599
6600
6601 for {
6602 off1 := ssa.AuxIntToInt32(v.AuxInt)
6603 sym1 := ssa.AuxToSym(v.Aux)
6604 if v_0.Op != ssaop.OpRISCV64MOVaddr {
6605 break
6606 }
6607 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
6608 sym2 := ssa.AuxToSym(v_0.Aux)
6609 base := v_0.Args[0]
6610 mem := v_1
6611 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
6612 break
6613 }
6614 v.Reset(ssaop.OpRISCV64MOVWload)
6615 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
6616 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
6617 v.AddArg2(base, mem)
6618 return true
6619 }
6620
6621
6622
6623 for {
6624 off1 := ssa.AuxIntToInt32(v.AuxInt)
6625 sym := ssa.AuxToSym(v.Aux)
6626 if v_0.Op != ssaop.OpRISCV64ADDI {
6627 break
6628 }
6629 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
6630 base := v_0.Args[0]
6631 mem := v_1
6632 if !(ssa.Is32Bit(int64(off1) + off2)) {
6633 break
6634 }
6635 v.Reset(ssaop.OpRISCV64MOVWload)
6636 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
6637 v.Aux = ssa.SymToAux(sym)
6638 v.AddArg2(base, mem)
6639 return true
6640 }
6641
6642
6643
6644 for {
6645 off := ssa.AuxIntToInt32(v.AuxInt)
6646 sym := ssa.AuxToSym(v.Aux)
6647 ptr1 := v_0
6648 if v_1.Op != ssaop.OpRISCV64MOVWstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
6649 break
6650 }
6651 x := v_1.Args[1]
6652 ptr2 := v_1.Args[0]
6653 if !(ssa.IsSamePtr(ptr1, ptr2)) {
6654 break
6655 }
6656 v.Reset(ssaop.OpRISCV64MOVWreg)
6657 v.AddArg(x)
6658 return true
6659 }
6660
6661
6662
6663 for {
6664 off := ssa.AuxIntToInt32(v.AuxInt)
6665 sym := ssa.AuxToSym(v.Aux)
6666 ptr1 := v_0
6667 if v_1.Op != ssaop.OpRISCV64FMOVWstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
6668 break
6669 }
6670 x := v_1.Args[1]
6671 ptr2 := v_1.Args[0]
6672 if !(ssa.IsSamePtr(ptr1, ptr2)) {
6673 break
6674 }
6675 v.Reset(ssaop.OpRISCV64FMVXS)
6676 v.AddArg(x)
6677 return true
6678 }
6679 return false
6680 }
6681 func rewriteValue_OpRISCV64MOVWreg(v *ssa.Value) bool {
6682 v_0 := v.Args[0]
6683 b := v.Block
6684
6685
6686
6687 for {
6688 x := v_0
6689 if x.Op != ssaop.OpRISCV64ANDI {
6690 break
6691 }
6692 c := ssa.AuxIntToInt64(x.AuxInt)
6693 if !(c >= 0 && int64(int32(c)) == c) {
6694 break
6695 }
6696 v.CopyOf(x)
6697 return true
6698 }
6699
6700
6701 for {
6702 if v_0.Op != ssaop.OpRISCV64NEG {
6703 break
6704 }
6705 x := v_0.Args[0]
6706 v.Reset(ssaop.OpRISCV64NEGW)
6707 v.AddArg(x)
6708 return true
6709 }
6710
6711
6712 for {
6713 if v_0.Op != ssaop.OpRISCV64MOVDconst {
6714 break
6715 }
6716 c := ssa.AuxIntToInt64(v_0.AuxInt)
6717 v.Reset(ssaop.OpRISCV64MOVDconst)
6718 v.AuxInt = ssa.Int64ToAuxInt(int64(int32(c)))
6719 return true
6720 }
6721
6722
6723 for {
6724 x := v_0
6725 if x.Op != ssaop.OpRISCV64MOVBload {
6726 break
6727 }
6728 v.Reset(ssaop.OpRISCV64MOVDreg)
6729 v.AddArg(x)
6730 return true
6731 }
6732
6733
6734 for {
6735 x := v_0
6736 if x.Op != ssaop.OpRISCV64MOVBUload {
6737 break
6738 }
6739 v.Reset(ssaop.OpRISCV64MOVDreg)
6740 v.AddArg(x)
6741 return true
6742 }
6743
6744
6745 for {
6746 x := v_0
6747 if x.Op != ssaop.OpRISCV64MOVHload {
6748 break
6749 }
6750 v.Reset(ssaop.OpRISCV64MOVDreg)
6751 v.AddArg(x)
6752 return true
6753 }
6754
6755
6756 for {
6757 x := v_0
6758 if x.Op != ssaop.OpRISCV64MOVHUload {
6759 break
6760 }
6761 v.Reset(ssaop.OpRISCV64MOVDreg)
6762 v.AddArg(x)
6763 return true
6764 }
6765
6766
6767 for {
6768 x := v_0
6769 if x.Op != ssaop.OpRISCV64MOVWload {
6770 break
6771 }
6772 v.Reset(ssaop.OpRISCV64MOVDreg)
6773 v.AddArg(x)
6774 return true
6775 }
6776
6777
6778
6779 for {
6780 x := v_0
6781 if x.Op != ssaop.OpRISCV64ADDIW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6782 break
6783 }
6784 v.Reset(ssaop.OpRISCV64MOVDreg)
6785 v.AddArg(x)
6786 return true
6787 }
6788
6789
6790
6791 for {
6792 x := v_0
6793 if x.Op != ssaop.OpRISCV64SUBW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6794 break
6795 }
6796 v.Reset(ssaop.OpRISCV64MOVDreg)
6797 v.AddArg(x)
6798 return true
6799 }
6800
6801
6802
6803 for {
6804 x := v_0
6805 if x.Op != ssaop.OpRISCV64NEGW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6806 break
6807 }
6808 v.Reset(ssaop.OpRISCV64MOVDreg)
6809 v.AddArg(x)
6810 return true
6811 }
6812
6813
6814
6815 for {
6816 x := v_0
6817 if x.Op != ssaop.OpRISCV64MULW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6818 break
6819 }
6820 v.Reset(ssaop.OpRISCV64MOVDreg)
6821 v.AddArg(x)
6822 return true
6823 }
6824
6825
6826
6827 for {
6828 x := v_0
6829 if x.Op != ssaop.OpRISCV64DIVW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6830 break
6831 }
6832 v.Reset(ssaop.OpRISCV64MOVDreg)
6833 v.AddArg(x)
6834 return true
6835 }
6836
6837
6838
6839 for {
6840 x := v_0
6841 if x.Op != ssaop.OpRISCV64DIVUW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6842 break
6843 }
6844 v.Reset(ssaop.OpRISCV64MOVDreg)
6845 v.AddArg(x)
6846 return true
6847 }
6848
6849
6850
6851 for {
6852 x := v_0
6853 if x.Op != ssaop.OpRISCV64REMW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6854 break
6855 }
6856 v.Reset(ssaop.OpRISCV64MOVDreg)
6857 v.AddArg(x)
6858 return true
6859 }
6860
6861
6862
6863 for {
6864 x := v_0
6865 if x.Op != ssaop.OpRISCV64REMUW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6866 break
6867 }
6868 v.Reset(ssaop.OpRISCV64MOVDreg)
6869 v.AddArg(x)
6870 return true
6871 }
6872
6873
6874
6875 for {
6876 x := v_0
6877 if x.Op != ssaop.OpRISCV64ROLW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6878 break
6879 }
6880 v.Reset(ssaop.OpRISCV64MOVDreg)
6881 v.AddArg(x)
6882 return true
6883 }
6884
6885
6886
6887 for {
6888 x := v_0
6889 if x.Op != ssaop.OpRISCV64RORW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6890 break
6891 }
6892 v.Reset(ssaop.OpRISCV64MOVDreg)
6893 v.AddArg(x)
6894 return true
6895 }
6896
6897
6898
6899 for {
6900 x := v_0
6901 if x.Op != ssaop.OpRISCV64RORIW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6902 break
6903 }
6904 v.Reset(ssaop.OpRISCV64MOVDreg)
6905 v.AddArg(x)
6906 return true
6907 }
6908
6909
6910 for {
6911 x := v_0
6912 if x.Op != ssaop.OpRISCV64MOVBreg {
6913 break
6914 }
6915 v.Reset(ssaop.OpRISCV64MOVDreg)
6916 v.AddArg(x)
6917 return true
6918 }
6919
6920
6921 for {
6922 x := v_0
6923 if x.Op != ssaop.OpRISCV64MOVBUreg {
6924 break
6925 }
6926 v.Reset(ssaop.OpRISCV64MOVDreg)
6927 v.AddArg(x)
6928 return true
6929 }
6930
6931
6932 for {
6933 x := v_0
6934 if x.Op != ssaop.OpRISCV64MOVHreg {
6935 break
6936 }
6937 v.Reset(ssaop.OpRISCV64MOVDreg)
6938 v.AddArg(x)
6939 return true
6940 }
6941
6942
6943 for {
6944 x := v_0
6945 if x.Op != ssaop.OpRISCV64MOVWreg {
6946 break
6947 }
6948 v.Reset(ssaop.OpRISCV64MOVDreg)
6949 v.AddArg(x)
6950 return true
6951 }
6952
6953
6954
6955 for {
6956 t := v.Type
6957 x := v_0
6958 if x.Op != ssaop.OpRISCV64MOVWUload {
6959 break
6960 }
6961 off := ssa.AuxIntToInt32(x.AuxInt)
6962 sym := ssa.AuxToSym(x.Aux)
6963 mem := x.Args[1]
6964 ptr := x.Args[0]
6965 if !(x.Uses == 1 && ssa.Clobber(x)) {
6966 break
6967 }
6968 b = x.Block
6969 v0 := b.NewValue0(x.Pos, ssaop.OpRISCV64MOVWload, t)
6970 v.CopyOf(v0)
6971 v0.AuxInt = ssa.Int32ToAuxInt(off)
6972 v0.Aux = ssa.SymToAux(sym)
6973 v0.AddArg2(ptr, mem)
6974 return true
6975 }
6976 return false
6977 }
6978 func rewriteValue_OpRISCV64MOVWstore(v *ssa.Value) bool {
6979 v_2 := v.Args[2]
6980 v_1 := v.Args[1]
6981 v_0 := v.Args[0]
6982 b := v.Block
6983 config := b.Func.Config
6984
6985
6986
6987 for {
6988 off1 := ssa.AuxIntToInt32(v.AuxInt)
6989 sym1 := ssa.AuxToSym(v.Aux)
6990 if v_0.Op != ssaop.OpRISCV64MOVaddr {
6991 break
6992 }
6993 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
6994 sym2 := ssa.AuxToSym(v_0.Aux)
6995 base := v_0.Args[0]
6996 val := v_1
6997 mem := v_2
6998 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
6999 break
7000 }
7001 v.Reset(ssaop.OpRISCV64MOVWstore)
7002 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
7003 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
7004 v.AddArg3(base, val, mem)
7005 return true
7006 }
7007
7008
7009
7010 for {
7011 off1 := ssa.AuxIntToInt32(v.AuxInt)
7012 sym := ssa.AuxToSym(v.Aux)
7013 if v_0.Op != ssaop.OpRISCV64ADDI {
7014 break
7015 }
7016 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
7017 base := v_0.Args[0]
7018 val := v_1
7019 mem := v_2
7020 if !(ssa.Is32Bit(int64(off1) + off2)) {
7021 break
7022 }
7023 v.Reset(ssaop.OpRISCV64MOVWstore)
7024 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
7025 v.Aux = ssa.SymToAux(sym)
7026 v.AddArg3(base, val, mem)
7027 return true
7028 }
7029
7030
7031 for {
7032 off := ssa.AuxIntToInt32(v.AuxInt)
7033 sym := ssa.AuxToSym(v.Aux)
7034 ptr := v_0
7035 if v_1.Op != ssaop.OpRISCV64MOVDconst || ssa.AuxIntToInt64(v_1.AuxInt) != 0 {
7036 break
7037 }
7038 mem := v_2
7039 v.Reset(ssaop.OpRISCV64MOVWstorezero)
7040 v.AuxInt = ssa.Int32ToAuxInt(off)
7041 v.Aux = ssa.SymToAux(sym)
7042 v.AddArg2(ptr, mem)
7043 return true
7044 }
7045
7046
7047 for {
7048 off := ssa.AuxIntToInt32(v.AuxInt)
7049 sym := ssa.AuxToSym(v.Aux)
7050 ptr := v_0
7051 if v_1.Op != ssaop.OpRISCV64MOVWreg {
7052 break
7053 }
7054 x := v_1.Args[0]
7055 mem := v_2
7056 v.Reset(ssaop.OpRISCV64MOVWstore)
7057 v.AuxInt = ssa.Int32ToAuxInt(off)
7058 v.Aux = ssa.SymToAux(sym)
7059 v.AddArg3(ptr, x, mem)
7060 return true
7061 }
7062
7063
7064 for {
7065 off := ssa.AuxIntToInt32(v.AuxInt)
7066 sym := ssa.AuxToSym(v.Aux)
7067 ptr := v_0
7068 if v_1.Op != ssaop.OpRISCV64MOVWUreg {
7069 break
7070 }
7071 x := v_1.Args[0]
7072 mem := v_2
7073 v.Reset(ssaop.OpRISCV64MOVWstore)
7074 v.AuxInt = ssa.Int32ToAuxInt(off)
7075 v.Aux = ssa.SymToAux(sym)
7076 v.AddArg3(ptr, x, mem)
7077 return true
7078 }
7079 return false
7080 }
7081 func rewriteValue_OpRISCV64MOVWstorezero(v *ssa.Value) bool {
7082 v_1 := v.Args[1]
7083 v_0 := v.Args[0]
7084 b := v.Block
7085 config := b.Func.Config
7086
7087
7088
7089 for {
7090 off1 := ssa.AuxIntToInt32(v.AuxInt)
7091 sym1 := ssa.AuxToSym(v.Aux)
7092 if v_0.Op != ssaop.OpRISCV64MOVaddr {
7093 break
7094 }
7095 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
7096 sym2 := ssa.AuxToSym(v_0.Aux)
7097 base := v_0.Args[0]
7098 mem := v_1
7099 if !(ssa.CanMergeSym(sym1, sym2) && ssa.Is32Bit(int64(off1)+int64(off2)) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
7100 break
7101 }
7102 v.Reset(ssaop.OpRISCV64MOVWstorezero)
7103 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
7104 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
7105 v.AddArg2(base, mem)
7106 return true
7107 }
7108
7109
7110
7111 for {
7112 off1 := ssa.AuxIntToInt32(v.AuxInt)
7113 sym := ssa.AuxToSym(v.Aux)
7114 if v_0.Op != ssaop.OpRISCV64ADDI {
7115 break
7116 }
7117 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
7118 base := v_0.Args[0]
7119 mem := v_1
7120 if !(ssa.Is32Bit(int64(off1) + off2)) {
7121 break
7122 }
7123 v.Reset(ssaop.OpRISCV64MOVWstorezero)
7124 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
7125 v.Aux = ssa.SymToAux(sym)
7126 v.AddArg2(base, mem)
7127 return true
7128 }
7129 return false
7130 }
7131 func rewriteValue_OpRISCV64MUL(v *ssa.Value) bool {
7132 v_1 := v.Args[1]
7133 v_0 := v.Args[0]
7134 b := v.Block
7135
7136
7137
7138 for {
7139 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7140 x := v_0
7141 if v_1.Op != ssaop.OpRISCV64MOVDconst {
7142 continue
7143 }
7144 c := ssa.AuxIntToInt64(v_1.AuxInt)
7145 if !(c%3 == 0 && ssa.IsPowerOfTwo(c/3) && buildcfg.GORISCV64 >= 22) {
7146 continue
7147 }
7148 v.Reset(ssaop.OpRISCV64SLLI)
7149 v.AuxInt = ssa.Int64ToAuxInt(ssa.Log64(c / 3))
7150 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SH1ADD, x.Type)
7151 v0.AddArg2(x, x)
7152 v.AddArg(v0)
7153 return true
7154 }
7155 break
7156 }
7157
7158
7159
7160 for {
7161 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7162 x := v_0
7163 if v_1.Op != ssaop.OpRISCV64MOVDconst {
7164 continue
7165 }
7166 c := ssa.AuxIntToInt64(v_1.AuxInt)
7167 if !(c%5 == 0 && ssa.IsPowerOfTwo(c/5) && buildcfg.GORISCV64 >= 22) {
7168 continue
7169 }
7170 v.Reset(ssaop.OpRISCV64SLLI)
7171 v.AuxInt = ssa.Int64ToAuxInt(ssa.Log64(c / 5))
7172 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SH2ADD, x.Type)
7173 v0.AddArg2(x, x)
7174 v.AddArg(v0)
7175 return true
7176 }
7177 break
7178 }
7179
7180
7181
7182 for {
7183 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7184 x := v_0
7185 if v_1.Op != ssaop.OpRISCV64MOVDconst {
7186 continue
7187 }
7188 c := ssa.AuxIntToInt64(v_1.AuxInt)
7189 if !(c%9 == 0 && ssa.IsPowerOfTwo(c/9) && buildcfg.GORISCV64 >= 22) {
7190 continue
7191 }
7192 v.Reset(ssaop.OpRISCV64SLLI)
7193 v.AuxInt = ssa.Int64ToAuxInt(ssa.Log64(c / 9))
7194 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SH3ADD, x.Type)
7195 v0.AddArg2(x, x)
7196 v.AddArg(v0)
7197 return true
7198 }
7199 break
7200 }
7201 return false
7202 }
7203 func rewriteValue_OpRISCV64MULW(v *ssa.Value) bool {
7204 v_1 := v.Args[1]
7205 v_0 := v.Args[0]
7206 b := v.Block
7207
7208
7209
7210 for {
7211 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7212 x := v_0
7213 if v_1.Op != ssaop.OpRISCV64MOVDconst {
7214 continue
7215 }
7216 c := ssa.AuxIntToInt64(v_1.AuxInt)
7217 if !(c%3 == 0 && ssa.IsPowerOfTwo(c/3) && buildcfg.GORISCV64 >= 22) {
7218 continue
7219 }
7220 v.Reset(ssaop.OpRISCV64SLLIW)
7221 v.AuxInt = ssa.Int64ToAuxInt(ssa.Log64(c / 3))
7222 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SH1ADD, x.Type)
7223 v0.AddArg2(x, x)
7224 v.AddArg(v0)
7225 return true
7226 }
7227 break
7228 }
7229
7230
7231
7232 for {
7233 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7234 x := v_0
7235 if v_1.Op != ssaop.OpRISCV64MOVDconst {
7236 continue
7237 }
7238 c := ssa.AuxIntToInt64(v_1.AuxInt)
7239 if !(c%5 == 0 && ssa.IsPowerOfTwo(c/5) && buildcfg.GORISCV64 >= 22) {
7240 continue
7241 }
7242 v.Reset(ssaop.OpRISCV64SLLIW)
7243 v.AuxInt = ssa.Int64ToAuxInt(ssa.Log64(c / 5))
7244 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SH2ADD, x.Type)
7245 v0.AddArg2(x, x)
7246 v.AddArg(v0)
7247 return true
7248 }
7249 break
7250 }
7251
7252
7253
7254 for {
7255 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7256 x := v_0
7257 if v_1.Op != ssaop.OpRISCV64MOVDconst {
7258 continue
7259 }
7260 c := ssa.AuxIntToInt64(v_1.AuxInt)
7261 if !(c%9 == 0 && ssa.IsPowerOfTwo(c/9) && buildcfg.GORISCV64 >= 22) {
7262 continue
7263 }
7264 v.Reset(ssaop.OpRISCV64SLLIW)
7265 v.AuxInt = ssa.Int64ToAuxInt(ssa.Log64(c / 9))
7266 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SH3ADD, x.Type)
7267 v0.AddArg2(x, x)
7268 v.AddArg(v0)
7269 return true
7270 }
7271 break
7272 }
7273 return false
7274 }
7275 func rewriteValue_OpRISCV64NEG(v *ssa.Value) bool {
7276 v_0 := v.Args[0]
7277 b := v.Block
7278
7279
7280 for {
7281 if v_0.Op != ssaop.OpRISCV64SUB {
7282 break
7283 }
7284 y := v_0.Args[1]
7285 x := v_0.Args[0]
7286 v.Reset(ssaop.OpRISCV64SUB)
7287 v.AddArg2(y, x)
7288 return true
7289 }
7290
7291
7292
7293 for {
7294 t := v.Type
7295 s := v_0
7296 if s.Op != ssaop.OpRISCV64ADDI {
7297 break
7298 }
7299 val := ssa.AuxIntToInt64(s.AuxInt)
7300 s_0 := s.Args[0]
7301 if s_0.Op != ssaop.OpRISCV64SUB {
7302 break
7303 }
7304 y := s_0.Args[1]
7305 x := s_0.Args[0]
7306 if !(s.Uses == 1 && ssa.Is32Bit(-val)) {
7307 break
7308 }
7309 v.Reset(ssaop.OpRISCV64ADDI)
7310 v.AuxInt = ssa.Int64ToAuxInt(-val)
7311 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SUB, t)
7312 v0.AddArg2(y, x)
7313 v.AddArg(v0)
7314 return true
7315 }
7316
7317
7318 for {
7319 if v_0.Op != ssaop.OpRISCV64NEG {
7320 break
7321 }
7322 x := v_0.Args[0]
7323 v.CopyOf(x)
7324 return true
7325 }
7326
7327
7328
7329 for {
7330 s := v_0
7331 if s.Op != ssaop.OpRISCV64ADDI {
7332 break
7333 }
7334 val := ssa.AuxIntToInt64(s.AuxInt)
7335 s_0 := s.Args[0]
7336 if s_0.Op != ssaop.OpRISCV64NEG {
7337 break
7338 }
7339 x := s_0.Args[0]
7340 if !(s.Uses == 1 && ssa.Is32Bit(-val)) {
7341 break
7342 }
7343 v.Reset(ssaop.OpRISCV64ADDI)
7344 v.AuxInt = ssa.Int64ToAuxInt(-val)
7345 v.AddArg(x)
7346 return true
7347 }
7348
7349
7350 for {
7351 if v_0.Op != ssaop.OpRISCV64MOVDconst {
7352 break
7353 }
7354 x := ssa.AuxIntToInt64(v_0.AuxInt)
7355 v.Reset(ssaop.OpRISCV64MOVDconst)
7356 v.AuxInt = ssa.Int64ToAuxInt(-x)
7357 return true
7358 }
7359 return false
7360 }
7361 func rewriteValue_OpRISCV64NEGW(v *ssa.Value) bool {
7362 v_0 := v.Args[0]
7363
7364
7365 for {
7366 if v_0.Op != ssaop.OpRISCV64MOVDconst {
7367 break
7368 }
7369 x := ssa.AuxIntToInt64(v_0.AuxInt)
7370 v.Reset(ssaop.OpRISCV64MOVDconst)
7371 v.AuxInt = ssa.Int64ToAuxInt(int64(int32(-x)))
7372 return true
7373 }
7374 return false
7375 }
7376 func rewriteValue_OpRISCV64OR(v *ssa.Value) bool {
7377 v_1 := v.Args[1]
7378 v_0 := v.Args[0]
7379 b := v.Block
7380 typ := &b.Func.Config.Types
7381
7382
7383
7384 for {
7385 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7386 if v_0.Op != ssaop.OpRISCV64MOVDconst {
7387 continue
7388 }
7389 val := ssa.AuxIntToInt64(v_0.AuxInt)
7390 x := v_1
7391 if !(ssa.Is32Bit(val)) {
7392 continue
7393 }
7394 v.Reset(ssaop.OpRISCV64ORI)
7395 v.AuxInt = ssa.Int64ToAuxInt(val)
7396 v.AddArg(x)
7397 return true
7398 }
7399 break
7400 }
7401
7402
7403 for {
7404 x := v_0
7405 if x != v_1 {
7406 break
7407 }
7408 v.CopyOf(x)
7409 return true
7410 }
7411
7412
7413 for {
7414 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7415 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7416 continue
7417 }
7418 t := v_0.Type
7419 cond := v_0.Args[1]
7420 x := v_0.Args[0]
7421 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7422 continue
7423 }
7424 _ = v_1.Args[1]
7425 v_1_0 := v_1.Args[0]
7426 if v_1_0.Op != ssaop.OpRISCV64ADD {
7427 continue
7428 }
7429 _ = v_1_0.Args[1]
7430 v_1_0_0 := v_1_0.Args[0]
7431 v_1_0_1 := v_1_0.Args[1]
7432 for _i1 := 0; _i1 <= 1; _i1, v_1_0_0, v_1_0_1 = _i1+1, v_1_0_1, v_1_0_0 {
7433 if x != v_1_0_0 {
7434 continue
7435 }
7436 y := v_1_0_1
7437 if cond != v_1.Args[1] {
7438 continue
7439 }
7440 v.Reset(ssaop.OpRISCV64ADD)
7441 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZERONEZ, t)
7442 v0.AddArg2(y, cond)
7443 v.AddArg2(x, v0)
7444 return true
7445 }
7446 }
7447 break
7448 }
7449
7450
7451 for {
7452 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7453 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7454 continue
7455 }
7456 t := v_0.Type
7457 cond := v_0.Args[1]
7458 x := v_0.Args[0]
7459 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7460 continue
7461 }
7462 _ = v_1.Args[1]
7463 v_1_0 := v_1.Args[0]
7464 if v_1_0.Op != ssaop.OpRISCV64SUB {
7465 continue
7466 }
7467 y := v_1_0.Args[1]
7468 if x != v_1_0.Args[0] || cond != v_1.Args[1] {
7469 continue
7470 }
7471 v.Reset(ssaop.OpRISCV64SUB)
7472 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZERONEZ, t)
7473 v0.AddArg2(y, cond)
7474 v.AddArg2(x, v0)
7475 return true
7476 }
7477 break
7478 }
7479
7480
7481 for {
7482 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7483 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7484 continue
7485 }
7486 t := v_0.Type
7487 cond := v_0.Args[1]
7488 x := v_0.Args[0]
7489 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7490 continue
7491 }
7492 _ = v_1.Args[1]
7493 v_1_0 := v_1.Args[0]
7494 if v_1_0.Op != ssaop.OpRISCV64OR {
7495 continue
7496 }
7497 _ = v_1_0.Args[1]
7498 v_1_0_0 := v_1_0.Args[0]
7499 v_1_0_1 := v_1_0.Args[1]
7500 for _i1 := 0; _i1 <= 1; _i1, v_1_0_0, v_1_0_1 = _i1+1, v_1_0_1, v_1_0_0 {
7501 if x != v_1_0_0 {
7502 continue
7503 }
7504 y := v_1_0_1
7505 if cond != v_1.Args[1] {
7506 continue
7507 }
7508 v.Reset(ssaop.OpRISCV64OR)
7509 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZERONEZ, t)
7510 v0.AddArg2(y, cond)
7511 v.AddArg2(x, v0)
7512 return true
7513 }
7514 }
7515 break
7516 }
7517
7518
7519 for {
7520 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7521 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7522 continue
7523 }
7524 t := v_0.Type
7525 cond := v_0.Args[1]
7526 x := v_0.Args[0]
7527 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7528 continue
7529 }
7530 _ = v_1.Args[1]
7531 v_1_0 := v_1.Args[0]
7532 if v_1_0.Op != ssaop.OpRISCV64XOR {
7533 continue
7534 }
7535 _ = v_1_0.Args[1]
7536 v_1_0_0 := v_1_0.Args[0]
7537 v_1_0_1 := v_1_0.Args[1]
7538 for _i1 := 0; _i1 <= 1; _i1, v_1_0_0, v_1_0_1 = _i1+1, v_1_0_1, v_1_0_0 {
7539 if x != v_1_0_0 {
7540 continue
7541 }
7542 y := v_1_0_1
7543 if cond != v_1.Args[1] {
7544 continue
7545 }
7546 v.Reset(ssaop.OpRISCV64XOR)
7547 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZERONEZ, t)
7548 v0.AddArg2(y, cond)
7549 v.AddArg2(x, v0)
7550 return true
7551 }
7552 }
7553 break
7554 }
7555
7556
7557 for {
7558 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7559 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7560 continue
7561 }
7562 t := v_0.Type
7563 cond := v_0.Args[1]
7564 x := v_0.Args[0]
7565 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7566 continue
7567 }
7568 _ = v_1.Args[1]
7569 v_1_0 := v_1.Args[0]
7570 if v_1_0.Op != ssaop.OpRISCV64SUBW {
7571 continue
7572 }
7573 y := v_1_0.Args[1]
7574 if x != v_1_0.Args[0] || cond != v_1.Args[1] {
7575 continue
7576 }
7577 v.Reset(ssaop.OpRISCV64SUBW)
7578 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZERONEZ, t)
7579 v0.AddArg2(y, cond)
7580 v.AddArg2(x, v0)
7581 return true
7582 }
7583 break
7584 }
7585
7586
7587 for {
7588 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7589 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7590 continue
7591 }
7592 t := v_0.Type
7593 cond := v_0.Args[1]
7594 v_0_0 := v_0.Args[0]
7595 if v_0_0.Op != ssaop.OpRISCV64ADD {
7596 continue
7597 }
7598 _ = v_0_0.Args[1]
7599 v_0_0_0 := v_0_0.Args[0]
7600 v_0_0_1 := v_0_0.Args[1]
7601 for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
7602 x := v_0_0_0
7603 y := v_0_0_1
7604 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7605 continue
7606 }
7607 _ = v_1.Args[1]
7608 if x != v_1.Args[0] || cond != v_1.Args[1] {
7609 continue
7610 }
7611 v.Reset(ssaop.OpRISCV64ADD)
7612 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZEROEQZ, t)
7613 v0.AddArg2(y, cond)
7614 v.AddArg2(x, v0)
7615 return true
7616 }
7617 }
7618 break
7619 }
7620
7621
7622 for {
7623 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7624 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7625 continue
7626 }
7627 t := v_0.Type
7628 cond := v_0.Args[1]
7629 v_0_0 := v_0.Args[0]
7630 if v_0_0.Op != ssaop.OpRISCV64SUB {
7631 continue
7632 }
7633 y := v_0_0.Args[1]
7634 x := v_0_0.Args[0]
7635 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7636 continue
7637 }
7638 _ = v_1.Args[1]
7639 if x != v_1.Args[0] || cond != v_1.Args[1] {
7640 continue
7641 }
7642 v.Reset(ssaop.OpRISCV64SUB)
7643 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZEROEQZ, t)
7644 v0.AddArg2(y, cond)
7645 v.AddArg2(x, v0)
7646 return true
7647 }
7648 break
7649 }
7650
7651
7652 for {
7653 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7654 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7655 continue
7656 }
7657 t := v_0.Type
7658 cond := v_0.Args[1]
7659 v_0_0 := v_0.Args[0]
7660 if v_0_0.Op != ssaop.OpRISCV64OR {
7661 continue
7662 }
7663 _ = v_0_0.Args[1]
7664 v_0_0_0 := v_0_0.Args[0]
7665 v_0_0_1 := v_0_0.Args[1]
7666 for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
7667 x := v_0_0_0
7668 y := v_0_0_1
7669 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7670 continue
7671 }
7672 _ = v_1.Args[1]
7673 if x != v_1.Args[0] || cond != v_1.Args[1] {
7674 continue
7675 }
7676 v.Reset(ssaop.OpRISCV64OR)
7677 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZEROEQZ, t)
7678 v0.AddArg2(y, cond)
7679 v.AddArg2(x, v0)
7680 return true
7681 }
7682 }
7683 break
7684 }
7685
7686
7687 for {
7688 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7689 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7690 continue
7691 }
7692 t := v_0.Type
7693 cond := v_0.Args[1]
7694 v_0_0 := v_0.Args[0]
7695 if v_0_0.Op != ssaop.OpRISCV64XOR {
7696 continue
7697 }
7698 _ = v_0_0.Args[1]
7699 v_0_0_0 := v_0_0.Args[0]
7700 v_0_0_1 := v_0_0.Args[1]
7701 for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
7702 x := v_0_0_0
7703 y := v_0_0_1
7704 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7705 continue
7706 }
7707 _ = v_1.Args[1]
7708 if x != v_1.Args[0] || cond != v_1.Args[1] {
7709 continue
7710 }
7711 v.Reset(ssaop.OpRISCV64XOR)
7712 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZEROEQZ, t)
7713 v0.AddArg2(y, cond)
7714 v.AddArg2(x, v0)
7715 return true
7716 }
7717 }
7718 break
7719 }
7720
7721
7722 for {
7723 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7724 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7725 continue
7726 }
7727 t := v_0.Type
7728 cond := v_0.Args[1]
7729 v_0_0 := v_0.Args[0]
7730 if v_0_0.Op != ssaop.OpRISCV64SUBW {
7731 continue
7732 }
7733 y := v_0_0.Args[1]
7734 x := v_0_0.Args[0]
7735 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7736 continue
7737 }
7738 _ = v_1.Args[1]
7739 if x != v_1.Args[0] || cond != v_1.Args[1] {
7740 continue
7741 }
7742 v.Reset(ssaop.OpRISCV64SUBW)
7743 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZEROEQZ, t)
7744 v0.AddArg2(y, cond)
7745 v.AddArg2(x, v0)
7746 return true
7747 }
7748 break
7749 }
7750
7751
7752 for {
7753 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7754 x := v_0
7755 if x.Op != ssaop.OpRISCV64CZEROEQZ {
7756 continue
7757 }
7758 cond := x.Args[1]
7759 z := x.Args[0]
7760 if v_1.Op != ssaop.OpRISCV64CZERONEZ {
7761 continue
7762 }
7763 _ = v_1.Args[1]
7764 y := v_1.Args[0]
7765 if y.Op != ssaop.OpRISCV64AND {
7766 continue
7767 }
7768 y_0 := y.Args[0]
7769 y_1 := y.Args[1]
7770 for _i1 := 0; _i1 <= 1; _i1, y_0, y_1 = _i1+1, y_1, y_0 {
7771 if z != y_0 || cond != v_1.Args[1] {
7772 continue
7773 }
7774 v.Reset(ssaop.OpRISCV64OR)
7775 v.AddArg2(y, x)
7776 return true
7777 }
7778 }
7779 break
7780 }
7781
7782
7783 for {
7784 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7785 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7786 continue
7787 }
7788 cond := v_0.Args[1]
7789 x := v_0.Args[0]
7790 if x.Op != ssaop.OpRISCV64AND {
7791 continue
7792 }
7793 x_0 := x.Args[0]
7794 x_1 := x.Args[1]
7795 for _i1 := 0; _i1 <= 1; _i1, x_0, x_1 = _i1+1, x_1, x_0 {
7796 z := x_0
7797 y := v_1
7798 if y.Op != ssaop.OpRISCV64CZERONEZ {
7799 continue
7800 }
7801 _ = y.Args[1]
7802 if z != y.Args[0] || cond != y.Args[1] {
7803 continue
7804 }
7805 v.Reset(ssaop.OpRISCV64OR)
7806 v.AddArg2(x, y)
7807 return true
7808 }
7809 }
7810 break
7811 }
7812
7813
7814 for {
7815 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7816 x := v_0
7817 if x.Op != ssaop.OpRISCV64CZEROEQZ {
7818 continue
7819 }
7820 cond := x.Args[1]
7821 z := x.Args[0]
7822 if v_1.Op != ssaop.OpRISCV64CZERONEZ {
7823 continue
7824 }
7825 _ = v_1.Args[1]
7826 y := v_1.Args[0]
7827 if y.Op != ssaop.OpRISCV64ANDI {
7828 continue
7829 }
7830 if z != y.Args[0] || cond != v_1.Args[1] {
7831 continue
7832 }
7833 v.Reset(ssaop.OpRISCV64OR)
7834 v.AddArg2(y, x)
7835 return true
7836 }
7837 break
7838 }
7839
7840
7841 for {
7842 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7843 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7844 continue
7845 }
7846 cond := v_0.Args[1]
7847 x := v_0.Args[0]
7848 if x.Op != ssaop.OpRISCV64ANDI {
7849 continue
7850 }
7851 z := x.Args[0]
7852 y := v_1
7853 if y.Op != ssaop.OpRISCV64CZERONEZ {
7854 continue
7855 }
7856 _ = y.Args[1]
7857 if z != y.Args[0] || cond != y.Args[1] {
7858 continue
7859 }
7860 v.Reset(ssaop.OpRISCV64OR)
7861 v.AddArg2(x, y)
7862 return true
7863 }
7864 break
7865 }
7866
7867
7868 for {
7869 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7870 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7871 continue
7872 }
7873 t := v_0.Type
7874 cond := v_0.Args[1]
7875 x := v_0.Args[0]
7876 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7877 continue
7878 }
7879 _ = v_1.Args[1]
7880 v_1_0 := v_1.Args[0]
7881 if v_1_0.Op != ssaop.OpRISCV64ADDI {
7882 continue
7883 }
7884 c := ssa.AuxIntToInt64(v_1_0.AuxInt)
7885 if x != v_1_0.Args[0] || cond != v_1.Args[1] {
7886 continue
7887 }
7888 v.Reset(ssaop.OpRISCV64ADD)
7889 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZERONEZ, t)
7890 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
7891 v1.AuxInt = ssa.Int64ToAuxInt(c)
7892 v0.AddArg2(v1, cond)
7893 v.AddArg2(x, v0)
7894 return true
7895 }
7896 break
7897 }
7898
7899
7900 for {
7901 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7902 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7903 continue
7904 }
7905 t := v_0.Type
7906 cond := v_0.Args[1]
7907 x := v_0.Args[0]
7908 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7909 continue
7910 }
7911 _ = v_1.Args[1]
7912 v_1_0 := v_1.Args[0]
7913 if v_1_0.Op != ssaop.OpRISCV64ORI {
7914 continue
7915 }
7916 c := ssa.AuxIntToInt64(v_1_0.AuxInt)
7917 if x != v_1_0.Args[0] || cond != v_1.Args[1] {
7918 continue
7919 }
7920 v.Reset(ssaop.OpRISCV64OR)
7921 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZERONEZ, t)
7922 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
7923 v1.AuxInt = ssa.Int64ToAuxInt(c)
7924 v0.AddArg2(v1, cond)
7925 v.AddArg2(x, v0)
7926 return true
7927 }
7928 break
7929 }
7930
7931
7932 for {
7933 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7934 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7935 continue
7936 }
7937 t := v_0.Type
7938 cond := v_0.Args[1]
7939 x := v_0.Args[0]
7940 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7941 continue
7942 }
7943 _ = v_1.Args[1]
7944 v_1_0 := v_1.Args[0]
7945 if v_1_0.Op != ssaop.OpRISCV64XORI {
7946 continue
7947 }
7948 c := ssa.AuxIntToInt64(v_1_0.AuxInt)
7949 if x != v_1_0.Args[0] || cond != v_1.Args[1] {
7950 continue
7951 }
7952 v.Reset(ssaop.OpRISCV64XOR)
7953 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZERONEZ, t)
7954 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
7955 v1.AuxInt = ssa.Int64ToAuxInt(c)
7956 v0.AddArg2(v1, cond)
7957 v.AddArg2(x, v0)
7958 return true
7959 }
7960 break
7961 }
7962
7963
7964 for {
7965 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7966 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7967 continue
7968 }
7969 t := v_0.Type
7970 cond := v_0.Args[1]
7971 v_0_0 := v_0.Args[0]
7972 if v_0_0.Op != ssaop.OpRISCV64ADDI {
7973 continue
7974 }
7975 c := ssa.AuxIntToInt64(v_0_0.AuxInt)
7976 x := v_0_0.Args[0]
7977 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7978 continue
7979 }
7980 _ = v_1.Args[1]
7981 if x != v_1.Args[0] || cond != v_1.Args[1] {
7982 continue
7983 }
7984 v.Reset(ssaop.OpRISCV64ADD)
7985 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZEROEQZ, t)
7986 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
7987 v1.AuxInt = ssa.Int64ToAuxInt(c)
7988 v0.AddArg2(v1, cond)
7989 v.AddArg2(x, v0)
7990 return true
7991 }
7992 break
7993 }
7994
7995
7996 for {
7997 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7998 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7999 continue
8000 }
8001 t := v_0.Type
8002 cond := v_0.Args[1]
8003 v_0_0 := v_0.Args[0]
8004 if v_0_0.Op != ssaop.OpRISCV64ORI {
8005 continue
8006 }
8007 c := ssa.AuxIntToInt64(v_0_0.AuxInt)
8008 x := v_0_0.Args[0]
8009 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
8010 continue
8011 }
8012 _ = v_1.Args[1]
8013 if x != v_1.Args[0] || cond != v_1.Args[1] {
8014 continue
8015 }
8016 v.Reset(ssaop.OpRISCV64OR)
8017 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZEROEQZ, t)
8018 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
8019 v1.AuxInt = ssa.Int64ToAuxInt(c)
8020 v0.AddArg2(v1, cond)
8021 v.AddArg2(x, v0)
8022 return true
8023 }
8024 break
8025 }
8026
8027
8028 for {
8029 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8030 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
8031 continue
8032 }
8033 t := v_0.Type
8034 cond := v_0.Args[1]
8035 v_0_0 := v_0.Args[0]
8036 if v_0_0.Op != ssaop.OpRISCV64XORI {
8037 continue
8038 }
8039 c := ssa.AuxIntToInt64(v_0_0.AuxInt)
8040 x := v_0_0.Args[0]
8041 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
8042 continue
8043 }
8044 _ = v_1.Args[1]
8045 if x != v_1.Args[0] || cond != v_1.Args[1] {
8046 continue
8047 }
8048 v.Reset(ssaop.OpRISCV64XOR)
8049 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZEROEQZ, t)
8050 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
8051 v1.AuxInt = ssa.Int64ToAuxInt(c)
8052 v0.AddArg2(v1, cond)
8053 v.AddArg2(x, v0)
8054 return true
8055 }
8056 break
8057 }
8058 return false
8059 }
8060 func rewriteValue_OpRISCV64ORI(v *ssa.Value) bool {
8061 v_0 := v.Args[0]
8062
8063
8064 for {
8065 if ssa.AuxIntToInt64(v.AuxInt) != 0 {
8066 break
8067 }
8068 x := v_0
8069 v.CopyOf(x)
8070 return true
8071 }
8072
8073
8074 for {
8075 if ssa.AuxIntToInt64(v.AuxInt) != -1 {
8076 break
8077 }
8078 v.Reset(ssaop.OpRISCV64MOVDconst)
8079 v.AuxInt = ssa.Int64ToAuxInt(-1)
8080 return true
8081 }
8082
8083
8084 for {
8085 x := ssa.AuxIntToInt64(v.AuxInt)
8086 if v_0.Op != ssaop.OpRISCV64MOVDconst {
8087 break
8088 }
8089 y := ssa.AuxIntToInt64(v_0.AuxInt)
8090 v.Reset(ssaop.OpRISCV64MOVDconst)
8091 v.AuxInt = ssa.Int64ToAuxInt(x | y)
8092 return true
8093 }
8094
8095
8096 for {
8097 x := ssa.AuxIntToInt64(v.AuxInt)
8098 if v_0.Op != ssaop.OpRISCV64ORI {
8099 break
8100 }
8101 y := ssa.AuxIntToInt64(v_0.AuxInt)
8102 z := v_0.Args[0]
8103 v.Reset(ssaop.OpRISCV64ORI)
8104 v.AuxInt = ssa.Int64ToAuxInt(x | y)
8105 v.AddArg(z)
8106 return true
8107 }
8108 return false
8109 }
8110 func rewriteValue_OpRISCV64ORN(v *ssa.Value) bool {
8111 v_1 := v.Args[1]
8112 v_0 := v.Args[0]
8113
8114
8115 for {
8116 x := v_0
8117 if x != v_1 {
8118 break
8119 }
8120 v.Reset(ssaop.OpRISCV64MOVDconst)
8121 v.AuxInt = ssa.Int64ToAuxInt(-1)
8122 return true
8123 }
8124 return false
8125 }
8126 func rewriteValue_OpRISCV64ROL(v *ssa.Value) bool {
8127 v_1 := v.Args[1]
8128 v_0 := v.Args[0]
8129
8130
8131 for {
8132 x := v_0
8133 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8134 break
8135 }
8136 val := ssa.AuxIntToInt64(v_1.AuxInt)
8137 v.Reset(ssaop.OpRISCV64RORI)
8138 v.AuxInt = ssa.Int64ToAuxInt(-val & 63)
8139 v.AddArg(x)
8140 return true
8141 }
8142
8143
8144 for {
8145 x := v_0
8146 if v_1.Op != ssaop.OpRISCV64NEG {
8147 break
8148 }
8149 y := v_1.Args[0]
8150 v.Reset(ssaop.OpRISCV64ROR)
8151 v.AddArg2(x, y)
8152 return true
8153 }
8154 return false
8155 }
8156 func rewriteValue_OpRISCV64ROLW(v *ssa.Value) bool {
8157 v_1 := v.Args[1]
8158 v_0 := v.Args[0]
8159
8160
8161 for {
8162 x := v_0
8163 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8164 break
8165 }
8166 val := ssa.AuxIntToInt64(v_1.AuxInt)
8167 v.Reset(ssaop.OpRISCV64RORIW)
8168 v.AuxInt = ssa.Int64ToAuxInt(-val & 31)
8169 v.AddArg(x)
8170 return true
8171 }
8172
8173
8174 for {
8175 x := v_0
8176 if v_1.Op != ssaop.OpRISCV64NEG {
8177 break
8178 }
8179 y := v_1.Args[0]
8180 v.Reset(ssaop.OpRISCV64RORW)
8181 v.AddArg2(x, y)
8182 return true
8183 }
8184 return false
8185 }
8186 func rewriteValue_OpRISCV64ROR(v *ssa.Value) bool {
8187 v_1 := v.Args[1]
8188 v_0 := v.Args[0]
8189
8190
8191 for {
8192 x := v_0
8193 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8194 break
8195 }
8196 val := ssa.AuxIntToInt64(v_1.AuxInt)
8197 v.Reset(ssaop.OpRISCV64RORI)
8198 v.AuxInt = ssa.Int64ToAuxInt(val & 63)
8199 v.AddArg(x)
8200 return true
8201 }
8202 return false
8203 }
8204 func rewriteValue_OpRISCV64RORW(v *ssa.Value) bool {
8205 v_1 := v.Args[1]
8206 v_0 := v.Args[0]
8207
8208
8209 for {
8210 x := v_0
8211 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8212 break
8213 }
8214 val := ssa.AuxIntToInt64(v_1.AuxInt)
8215 v.Reset(ssaop.OpRISCV64RORIW)
8216 v.AuxInt = ssa.Int64ToAuxInt(val & 31)
8217 v.AddArg(x)
8218 return true
8219 }
8220 return false
8221 }
8222 func rewriteValue_OpRISCV64SEQZ(v *ssa.Value) bool {
8223 v_0 := v.Args[0]
8224 b := v.Block
8225 typ := &b.Func.Config.Types
8226
8227
8228 for {
8229 if v_0.Op != ssaop.OpRISCV64NEG {
8230 break
8231 }
8232 x := v_0.Args[0]
8233 v.Reset(ssaop.OpRISCV64SEQZ)
8234 v.AddArg(x)
8235 return true
8236 }
8237
8238
8239 for {
8240 if v_0.Op != ssaop.OpRISCV64SEQZ {
8241 break
8242 }
8243 x := v_0.Args[0]
8244 v.Reset(ssaop.OpRISCV64SNEZ)
8245 v.AddArg(x)
8246 return true
8247 }
8248
8249
8250 for {
8251 if v_0.Op != ssaop.OpRISCV64SNEZ {
8252 break
8253 }
8254 x := v_0.Args[0]
8255 v.Reset(ssaop.OpRISCV64SEQZ)
8256 v.AddArg(x)
8257 return true
8258 }
8259
8260
8261 for {
8262 if v_0.Op != ssaop.OpRISCV64ANDI {
8263 break
8264 }
8265 c := ssa.AuxIntToInt64(v_0.AuxInt)
8266 v_0_0 := v_0.Args[0]
8267 if v_0_0.Op != ssaop.OpRISCV64FCLASSD {
8268 break
8269 }
8270 v_0_0_0 := v_0_0.Args[0]
8271 if v_0_0_0.Op != ssaop.OpRISCV64FNEGD {
8272 break
8273 }
8274 x := v_0_0_0.Args[0]
8275 v.Reset(ssaop.OpRISCV64SEQZ)
8276 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
8277 v0.AuxInt = ssa.Int64ToAuxInt((c & 0b11_0000_0000) | int64(bits.Reverse8(uint8(c))&0b1111_1111))
8278 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
8279 v1.AddArg(x)
8280 v0.AddArg(v1)
8281 v.AddArg(v0)
8282 return true
8283 }
8284
8285
8286 for {
8287 if v_0.Op != ssaop.OpRISCV64ANDI {
8288 break
8289 }
8290 c := ssa.AuxIntToInt64(v_0.AuxInt)
8291 v_0_0 := v_0.Args[0]
8292 if v_0_0.Op != ssaop.OpRISCV64FCLASSD {
8293 break
8294 }
8295 v_0_0_0 := v_0_0.Args[0]
8296 if v_0_0_0.Op != ssaop.OpRISCV64FABSD {
8297 break
8298 }
8299 x := v_0_0_0.Args[0]
8300 v.Reset(ssaop.OpRISCV64SEQZ)
8301 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
8302 v0.AuxInt = ssa.Int64ToAuxInt((c & 0b11_1111_0000) | int64(bits.Reverse8(uint8(c))&0b0000_1111))
8303 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
8304 v1.AddArg(x)
8305 v0.AddArg(v1)
8306 v.AddArg(v0)
8307 return true
8308 }
8309 return false
8310 }
8311 func rewriteValue_OpRISCV64SLL(v *ssa.Value) bool {
8312 v_1 := v.Args[1]
8313 v_0 := v.Args[0]
8314
8315
8316 for {
8317 x := v_0
8318 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8319 break
8320 }
8321 val := ssa.AuxIntToInt64(v_1.AuxInt)
8322 v.Reset(ssaop.OpRISCV64SLLI)
8323 v.AuxInt = ssa.Int64ToAuxInt(val & 63)
8324 v.AddArg(x)
8325 return true
8326 }
8327 return false
8328 }
8329 func rewriteValue_OpRISCV64SLLI(v *ssa.Value) bool {
8330 v_0 := v.Args[0]
8331
8332
8333
8334 for {
8335 x := ssa.AuxIntToInt64(v.AuxInt)
8336 if v_0.Op != ssaop.OpRISCV64MOVDconst {
8337 break
8338 }
8339 y := ssa.AuxIntToInt64(v_0.AuxInt)
8340 if !(ssa.Is32Bit(y << uint32(x))) {
8341 break
8342 }
8343 v.Reset(ssaop.OpRISCV64MOVDconst)
8344 v.AuxInt = ssa.Int64ToAuxInt(y << uint32(x))
8345 return true
8346 }
8347
8348
8349
8350 for {
8351 t := v.Type
8352 c := ssa.AuxIntToInt64(v.AuxInt)
8353 if v_0.Op != ssaop.OpRISCV64ADD {
8354 break
8355 }
8356 x := v_0.Args[1]
8357 if x != v_0.Args[0] || !(c < t.Size()*8-1) {
8358 break
8359 }
8360 v.Reset(ssaop.OpRISCV64SLLI)
8361 v.AuxInt = ssa.Int64ToAuxInt(c + 1)
8362 v.AddArg(x)
8363 return true
8364 }
8365
8366
8367
8368 for {
8369 t := v.Type
8370 c := ssa.AuxIntToInt64(v.AuxInt)
8371 if v_0.Op != ssaop.OpRISCV64ADD {
8372 break
8373 }
8374 x := v_0.Args[1]
8375 if x != v_0.Args[0] || !(c >= t.Size()*8-1) {
8376 break
8377 }
8378 v.Reset(ssaop.OpRISCV64MOVDconst)
8379 v.AuxInt = ssa.Int64ToAuxInt(0)
8380 return true
8381 }
8382 return false
8383 }
8384 func rewriteValue_OpRISCV64SLLW(v *ssa.Value) bool {
8385 v_1 := v.Args[1]
8386 v_0 := v.Args[0]
8387
8388
8389 for {
8390 x := v_0
8391 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8392 break
8393 }
8394 val := ssa.AuxIntToInt64(v_1.AuxInt)
8395 v.Reset(ssaop.OpRISCV64SLLIW)
8396 v.AuxInt = ssa.Int64ToAuxInt(val & 31)
8397 v.AddArg(x)
8398 return true
8399 }
8400 return false
8401 }
8402 func rewriteValue_OpRISCV64SLT(v *ssa.Value) bool {
8403 v_1 := v.Args[1]
8404 v_0 := v.Args[0]
8405
8406
8407
8408 for {
8409 x := v_0
8410 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8411 break
8412 }
8413 val := ssa.AuxIntToInt64(v_1.AuxInt)
8414 if !(ssa.Is12Bit(val)) {
8415 break
8416 }
8417 v.Reset(ssaop.OpRISCV64SLTI)
8418 v.AuxInt = ssa.Int64ToAuxInt(val)
8419 v.AddArg(x)
8420 return true
8421 }
8422
8423
8424 for {
8425 x := v_0
8426 if x != v_1 {
8427 break
8428 }
8429 v.Reset(ssaop.OpRISCV64MOVDconst)
8430 v.AuxInt = ssa.Int64ToAuxInt(0)
8431 return true
8432 }
8433 return false
8434 }
8435 func rewriteValue_OpRISCV64SLTI(v *ssa.Value) bool {
8436 v_0 := v.Args[0]
8437
8438
8439 for {
8440 x := ssa.AuxIntToInt64(v.AuxInt)
8441 if v_0.Op != ssaop.OpRISCV64MOVDconst {
8442 break
8443 }
8444 y := ssa.AuxIntToInt64(v_0.AuxInt)
8445 v.Reset(ssaop.OpRISCV64MOVDconst)
8446 v.AuxInt = ssa.Int64ToAuxInt(ssa.B2i(int64(y) < int64(x)))
8447 return true
8448 }
8449
8450
8451
8452 for {
8453 x := ssa.AuxIntToInt64(v.AuxInt)
8454 if v_0.Op != ssaop.OpRISCV64ANDI {
8455 break
8456 }
8457 y := ssa.AuxIntToInt64(v_0.AuxInt)
8458 if !(y >= 0 && int64(y) < int64(x)) {
8459 break
8460 }
8461 v.Reset(ssaop.OpRISCV64MOVDconst)
8462 v.AuxInt = ssa.Int64ToAuxInt(1)
8463 return true
8464 }
8465 return false
8466 }
8467 func rewriteValue_OpRISCV64SLTIU(v *ssa.Value) bool {
8468 v_0 := v.Args[0]
8469
8470
8471 for {
8472 x := ssa.AuxIntToInt64(v.AuxInt)
8473 if v_0.Op != ssaop.OpRISCV64MOVDconst {
8474 break
8475 }
8476 y := ssa.AuxIntToInt64(v_0.AuxInt)
8477 v.Reset(ssaop.OpRISCV64MOVDconst)
8478 v.AuxInt = ssa.Int64ToAuxInt(ssa.B2i(uint64(y) < uint64(x)))
8479 return true
8480 }
8481
8482
8483
8484 for {
8485 x := ssa.AuxIntToInt64(v.AuxInt)
8486 if v_0.Op != ssaop.OpRISCV64ANDI {
8487 break
8488 }
8489 y := ssa.AuxIntToInt64(v_0.AuxInt)
8490 if !(y >= 0 && uint64(y) < uint64(x)) {
8491 break
8492 }
8493 v.Reset(ssaop.OpRISCV64MOVDconst)
8494 v.AuxInt = ssa.Int64ToAuxInt(1)
8495 return true
8496 }
8497
8498
8499
8500 for {
8501 x := ssa.AuxIntToInt64(v.AuxInt)
8502 if v_0.Op != ssaop.OpRISCV64ORI {
8503 break
8504 }
8505 y := ssa.AuxIntToInt64(v_0.AuxInt)
8506 if !(y >= 0 && uint64(y) >= uint64(x)) {
8507 break
8508 }
8509 v.Reset(ssaop.OpRISCV64MOVDconst)
8510 v.AuxInt = ssa.Int64ToAuxInt(0)
8511 return true
8512 }
8513 return false
8514 }
8515 func rewriteValue_OpRISCV64SLTU(v *ssa.Value) bool {
8516 v_1 := v.Args[1]
8517 v_0 := v.Args[0]
8518
8519
8520
8521 for {
8522 x := v_0
8523 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8524 break
8525 }
8526 val := ssa.AuxIntToInt64(v_1.AuxInt)
8527 if !(ssa.Is12Bit(val)) {
8528 break
8529 }
8530 v.Reset(ssaop.OpRISCV64SLTIU)
8531 v.AuxInt = ssa.Int64ToAuxInt(val)
8532 v.AddArg(x)
8533 return true
8534 }
8535
8536
8537 for {
8538 x := v_0
8539 if x != v_1 {
8540 break
8541 }
8542 v.Reset(ssaop.OpRISCV64MOVDconst)
8543 v.AuxInt = ssa.Int64ToAuxInt(0)
8544 return true
8545 }
8546 return false
8547 }
8548 func rewriteValue_OpRISCV64SNEZ(v *ssa.Value) bool {
8549 v_0 := v.Args[0]
8550 b := v.Block
8551 typ := &b.Func.Config.Types
8552
8553
8554 for {
8555 if v_0.Op != ssaop.OpRISCV64NEG {
8556 break
8557 }
8558 x := v_0.Args[0]
8559 v.Reset(ssaop.OpRISCV64SNEZ)
8560 v.AddArg(x)
8561 return true
8562 }
8563
8564
8565 for {
8566 if v_0.Op != ssaop.OpRISCV64SEQZ {
8567 break
8568 }
8569 x := v_0.Args[0]
8570 v.Reset(ssaop.OpRISCV64SEQZ)
8571 v.AddArg(x)
8572 return true
8573 }
8574
8575
8576 for {
8577 if v_0.Op != ssaop.OpRISCV64SNEZ {
8578 break
8579 }
8580 x := v_0.Args[0]
8581 v.Reset(ssaop.OpRISCV64SNEZ)
8582 v.AddArg(x)
8583 return true
8584 }
8585
8586
8587 for {
8588 if v_0.Op != ssaop.OpRISCV64ANDI {
8589 break
8590 }
8591 c := ssa.AuxIntToInt64(v_0.AuxInt)
8592 v_0_0 := v_0.Args[0]
8593 if v_0_0.Op != ssaop.OpRISCV64FCLASSD {
8594 break
8595 }
8596 v_0_0_0 := v_0_0.Args[0]
8597 if v_0_0_0.Op != ssaop.OpRISCV64FNEGD {
8598 break
8599 }
8600 x := v_0_0_0.Args[0]
8601 v.Reset(ssaop.OpRISCV64SNEZ)
8602 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
8603 v0.AuxInt = ssa.Int64ToAuxInt((c & 0b11_0000_0000) | int64(bits.Reverse8(uint8(c))&0b1111_1111))
8604 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
8605 v1.AddArg(x)
8606 v0.AddArg(v1)
8607 v.AddArg(v0)
8608 return true
8609 }
8610
8611
8612 for {
8613 if v_0.Op != ssaop.OpRISCV64ANDI {
8614 break
8615 }
8616 c := ssa.AuxIntToInt64(v_0.AuxInt)
8617 v_0_0 := v_0.Args[0]
8618 if v_0_0.Op != ssaop.OpRISCV64FCLASSD {
8619 break
8620 }
8621 v_0_0_0 := v_0_0.Args[0]
8622 if v_0_0_0.Op != ssaop.OpRISCV64FABSD {
8623 break
8624 }
8625 x := v_0_0_0.Args[0]
8626 v.Reset(ssaop.OpRISCV64SNEZ)
8627 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
8628 v0.AuxInt = ssa.Int64ToAuxInt((c & 0b11_1111_0000) | int64(bits.Reverse8(uint8(c))&0b0000_1111))
8629 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
8630 v1.AddArg(x)
8631 v0.AddArg(v1)
8632 v.AddArg(v0)
8633 return true
8634 }
8635 return false
8636 }
8637 func rewriteValue_OpRISCV64SRA(v *ssa.Value) bool {
8638 v_1 := v.Args[1]
8639 v_0 := v.Args[0]
8640
8641
8642 for {
8643 x := v_0
8644 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8645 break
8646 }
8647 val := ssa.AuxIntToInt64(v_1.AuxInt)
8648 v.Reset(ssaop.OpRISCV64SRAI)
8649 v.AuxInt = ssa.Int64ToAuxInt(val & 63)
8650 v.AddArg(x)
8651 return true
8652 }
8653 return false
8654 }
8655 func rewriteValue_OpRISCV64SRAI(v *ssa.Value) bool {
8656 v_0 := v.Args[0]
8657 b := v.Block
8658
8659
8660
8661 for {
8662 x := ssa.AuxIntToInt64(v.AuxInt)
8663 if v_0.Op != ssaop.OpRISCV64MOVWreg {
8664 break
8665 }
8666 y := v_0.Args[0]
8667 if !(x >= 0 && x <= 31) {
8668 break
8669 }
8670 v.Reset(ssaop.OpRISCV64SRAIW)
8671 v.AuxInt = ssa.Int64ToAuxInt(x)
8672 v.AddArg(y)
8673 return true
8674 }
8675
8676
8677
8678 for {
8679 t := v.Type
8680 x := ssa.AuxIntToInt64(v.AuxInt)
8681 if v_0.Op != ssaop.OpRISCV64MOVBreg {
8682 break
8683 }
8684 y := v_0.Args[0]
8685 if !(x >= 8) {
8686 break
8687 }
8688 v.Reset(ssaop.OpRISCV64SRAI)
8689 v.AuxInt = ssa.Int64ToAuxInt(63)
8690 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLLI, t)
8691 v0.AuxInt = ssa.Int64ToAuxInt(56)
8692 v0.AddArg(y)
8693 v.AddArg(v0)
8694 return true
8695 }
8696
8697
8698
8699 for {
8700 t := v.Type
8701 x := ssa.AuxIntToInt64(v.AuxInt)
8702 if v_0.Op != ssaop.OpRISCV64MOVHreg {
8703 break
8704 }
8705 y := v_0.Args[0]
8706 if !(x >= 16) {
8707 break
8708 }
8709 v.Reset(ssaop.OpRISCV64SRAI)
8710 v.AuxInt = ssa.Int64ToAuxInt(63)
8711 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLLI, t)
8712 v0.AuxInt = ssa.Int64ToAuxInt(48)
8713 v0.AddArg(y)
8714 v.AddArg(v0)
8715 return true
8716 }
8717
8718
8719
8720 for {
8721 x := ssa.AuxIntToInt64(v.AuxInt)
8722 if v_0.Op != ssaop.OpRISCV64MOVWreg {
8723 break
8724 }
8725 y := v_0.Args[0]
8726 if !(x >= 32) {
8727 break
8728 }
8729 v.Reset(ssaop.OpRISCV64SRAIW)
8730 v.AuxInt = ssa.Int64ToAuxInt(31)
8731 v.AddArg(y)
8732 return true
8733 }
8734
8735
8736 for {
8737 x := ssa.AuxIntToInt64(v.AuxInt)
8738 if v_0.Op != ssaop.OpRISCV64MOVDconst {
8739 break
8740 }
8741 y := ssa.AuxIntToInt64(v_0.AuxInt)
8742 v.Reset(ssaop.OpRISCV64MOVDconst)
8743 v.AuxInt = ssa.Int64ToAuxInt(int64(y) >> uint32(x))
8744 return true
8745 }
8746 return false
8747 }
8748 func rewriteValue_OpRISCV64SRAW(v *ssa.Value) bool {
8749 v_1 := v.Args[1]
8750 v_0 := v.Args[0]
8751
8752
8753 for {
8754 x := v_0
8755 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8756 break
8757 }
8758 val := ssa.AuxIntToInt64(v_1.AuxInt)
8759 v.Reset(ssaop.OpRISCV64SRAIW)
8760 v.AuxInt = ssa.Int64ToAuxInt(val & 31)
8761 v.AddArg(x)
8762 return true
8763 }
8764 return false
8765 }
8766 func rewriteValue_OpRISCV64SRL(v *ssa.Value) bool {
8767 v_1 := v.Args[1]
8768 v_0 := v.Args[0]
8769
8770
8771 for {
8772 x := v_0
8773 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8774 break
8775 }
8776 val := ssa.AuxIntToInt64(v_1.AuxInt)
8777 v.Reset(ssaop.OpRISCV64SRLI)
8778 v.AuxInt = ssa.Int64ToAuxInt(val & 63)
8779 v.AddArg(x)
8780 return true
8781 }
8782 return false
8783 }
8784 func rewriteValue_OpRISCV64SRLI(v *ssa.Value) bool {
8785 v_0 := v.Args[0]
8786
8787
8788
8789 for {
8790 x := ssa.AuxIntToInt64(v.AuxInt)
8791 if v_0.Op != ssaop.OpRISCV64MOVWUreg {
8792 break
8793 }
8794 y := v_0.Args[0]
8795 if !(x >= 0 && x <= 31) {
8796 break
8797 }
8798 v.Reset(ssaop.OpRISCV64SRLIW)
8799 v.AuxInt = ssa.Int64ToAuxInt(x)
8800 v.AddArg(y)
8801 return true
8802 }
8803
8804
8805
8806 for {
8807 x := ssa.AuxIntToInt64(v.AuxInt)
8808 if v_0.Op != ssaop.OpRISCV64MOVBUreg {
8809 break
8810 }
8811 if !(x >= 8) {
8812 break
8813 }
8814 v.Reset(ssaop.OpRISCV64MOVDconst)
8815 v.AuxInt = ssa.Int64ToAuxInt(0)
8816 return true
8817 }
8818
8819
8820
8821 for {
8822 x := ssa.AuxIntToInt64(v.AuxInt)
8823 if v_0.Op != ssaop.OpRISCV64MOVHUreg {
8824 break
8825 }
8826 if !(x >= 16) {
8827 break
8828 }
8829 v.Reset(ssaop.OpRISCV64MOVDconst)
8830 v.AuxInt = ssa.Int64ToAuxInt(0)
8831 return true
8832 }
8833
8834
8835
8836 for {
8837 x := ssa.AuxIntToInt64(v.AuxInt)
8838 if v_0.Op != ssaop.OpRISCV64MOVWUreg {
8839 break
8840 }
8841 if !(x >= 32) {
8842 break
8843 }
8844 v.Reset(ssaop.OpRISCV64MOVDconst)
8845 v.AuxInt = ssa.Int64ToAuxInt(0)
8846 return true
8847 }
8848
8849
8850 for {
8851 x := ssa.AuxIntToInt64(v.AuxInt)
8852 if v_0.Op != ssaop.OpRISCV64MOVDconst {
8853 break
8854 }
8855 y := ssa.AuxIntToInt64(v_0.AuxInt)
8856 v.Reset(ssaop.OpRISCV64MOVDconst)
8857 v.AuxInt = ssa.Int64ToAuxInt(int64(uint64(y) >> uint32(x)))
8858 return true
8859 }
8860 return false
8861 }
8862 func rewriteValue_OpRISCV64SRLW(v *ssa.Value) bool {
8863 v_1 := v.Args[1]
8864 v_0 := v.Args[0]
8865
8866
8867 for {
8868 x := v_0
8869 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8870 break
8871 }
8872 val := ssa.AuxIntToInt64(v_1.AuxInt)
8873 v.Reset(ssaop.OpRISCV64SRLIW)
8874 v.AuxInt = ssa.Int64ToAuxInt(val & 31)
8875 v.AddArg(x)
8876 return true
8877 }
8878 return false
8879 }
8880 func rewriteValue_OpRISCV64SUB(v *ssa.Value) bool {
8881 v_1 := v.Args[1]
8882 v_0 := v.Args[0]
8883 b := v.Block
8884
8885
8886 for {
8887 x := v_0
8888 if v_1.Op != ssaop.OpRISCV64NEG {
8889 break
8890 }
8891 y := v_1.Args[0]
8892 v.Reset(ssaop.OpRISCV64ADD)
8893 v.AddArg2(x, y)
8894 return true
8895 }
8896
8897
8898 for {
8899 x := v_0
8900 if x != v_1 {
8901 break
8902 }
8903 v.Reset(ssaop.OpRISCV64MOVDconst)
8904 v.AuxInt = ssa.Int64ToAuxInt(0)
8905 return true
8906 }
8907
8908
8909
8910 for {
8911 x := v_0
8912 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8913 break
8914 }
8915 val := ssa.AuxIntToInt64(v_1.AuxInt)
8916 if !(ssa.Is32Bit(-val)) {
8917 break
8918 }
8919 v.Reset(ssaop.OpRISCV64ADDI)
8920 v.AuxInt = ssa.Int64ToAuxInt(-val)
8921 v.AddArg(x)
8922 return true
8923 }
8924
8925
8926
8927 for {
8928 t := v.Type
8929 if v_0.Op != ssaop.OpRISCV64MOVDconst {
8930 break
8931 }
8932 val := ssa.AuxIntToInt64(v_0.AuxInt)
8933 y := v_1
8934 if !(ssa.Is32Bit(-val)) {
8935 break
8936 }
8937 v.Reset(ssaop.OpRISCV64NEG)
8938 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, t)
8939 v0.AuxInt = ssa.Int64ToAuxInt(-val)
8940 v0.AddArg(y)
8941 v.AddArg(v0)
8942 return true
8943 }
8944
8945
8946 for {
8947 x := v_0
8948 if v_1.Op != ssaop.OpRISCV64MOVDconst || ssa.AuxIntToInt64(v_1.AuxInt) != 0 {
8949 break
8950 }
8951 v.CopyOf(x)
8952 return true
8953 }
8954
8955
8956 for {
8957 if v_0.Op != ssaop.OpRISCV64MOVDconst || ssa.AuxIntToInt64(v_0.AuxInt) != 0 {
8958 break
8959 }
8960 x := v_1
8961 v.Reset(ssaop.OpRISCV64NEG)
8962 v.AddArg(x)
8963 return true
8964 }
8965 return false
8966 }
8967 func rewriteValue_OpRISCV64SUBW(v *ssa.Value) bool {
8968 v_1 := v.Args[1]
8969 v_0 := v.Args[0]
8970
8971
8972 for {
8973 x := v_0
8974 if v_1.Op != ssaop.OpRISCV64MOVDconst || ssa.AuxIntToInt64(v_1.AuxInt) != 0 {
8975 break
8976 }
8977 v.Reset(ssaop.OpRISCV64ADDIW)
8978 v.AuxInt = ssa.Int64ToAuxInt(0)
8979 v.AddArg(x)
8980 return true
8981 }
8982
8983
8984 for {
8985 if v_0.Op != ssaop.OpRISCV64MOVDconst || ssa.AuxIntToInt64(v_0.AuxInt) != 0 {
8986 break
8987 }
8988 x := v_1
8989 v.Reset(ssaop.OpRISCV64NEGW)
8990 v.AddArg(x)
8991 return true
8992 }
8993 return false
8994 }
8995 func rewriteValue_OpRISCV64XOR(v *ssa.Value) bool {
8996 v_1 := v.Args[1]
8997 v_0 := v.Args[0]
8998
8999
9000
9001 for {
9002 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9003 if v_0.Op != ssaop.OpRISCV64MOVDconst {
9004 continue
9005 }
9006 val := ssa.AuxIntToInt64(v_0.AuxInt)
9007 x := v_1
9008 if !(ssa.Is32Bit(val)) {
9009 continue
9010 }
9011 v.Reset(ssaop.OpRISCV64XORI)
9012 v.AuxInt = ssa.Int64ToAuxInt(val)
9013 v.AddArg(x)
9014 return true
9015 }
9016 break
9017 }
9018
9019
9020 for {
9021 x := v_0
9022 if x != v_1 {
9023 break
9024 }
9025 v.Reset(ssaop.OpRISCV64MOVDconst)
9026 v.AuxInt = ssa.Int64ToAuxInt(0)
9027 return true
9028 }
9029 return false
9030 }
9031 func rewriteValue_OpRotateLeft16(v *ssa.Value) bool {
9032 v_1 := v.Args[1]
9033 v_0 := v.Args[0]
9034 b := v.Block
9035 typ := &b.Func.Config.Types
9036
9037
9038 for {
9039 t := v.Type
9040 x := v_0
9041 y := v_1
9042 v.Reset(ssaop.OpRISCV64OR)
9043 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, t)
9044 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, y.Type)
9045 v1.AuxInt = ssa.Int64ToAuxInt(15)
9046 v1.AddArg(y)
9047 v0.AddArg2(x, v1)
9048 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
9049 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9050 v3.AddArg(x)
9051 v4 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, y.Type)
9052 v4.AuxInt = ssa.Int64ToAuxInt(15)
9053 v5 := b.NewValue0(v.Pos, ssaop.OpRISCV64NEG, y.Type)
9054 v5.AddArg(y)
9055 v4.AddArg(v5)
9056 v2.AddArg2(v3, v4)
9057 v.AddArg2(v0, v2)
9058 return true
9059 }
9060 }
9061 func rewriteValue_OpRotateLeft8(v *ssa.Value) bool {
9062 v_1 := v.Args[1]
9063 v_0 := v.Args[0]
9064 b := v.Block
9065 typ := &b.Func.Config.Types
9066
9067
9068 for {
9069 t := v.Type
9070 x := v_0
9071 y := v_1
9072 v.Reset(ssaop.OpRISCV64OR)
9073 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, t)
9074 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, y.Type)
9075 v1.AuxInt = ssa.Int64ToAuxInt(7)
9076 v1.AddArg(y)
9077 v0.AddArg2(x, v1)
9078 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
9079 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
9080 v3.AddArg(x)
9081 v4 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, y.Type)
9082 v4.AuxInt = ssa.Int64ToAuxInt(7)
9083 v5 := b.NewValue0(v.Pos, ssaop.OpRISCV64NEG, y.Type)
9084 v5.AddArg(y)
9085 v4.AddArg(v5)
9086 v2.AddArg2(v3, v4)
9087 v.AddArg2(v0, v2)
9088 return true
9089 }
9090 }
9091 func rewriteValue_OpRsh16Ux16(v *ssa.Value) bool {
9092 v_1 := v.Args[1]
9093 v_0 := v.Args[0]
9094 b := v.Block
9095 typ := &b.Func.Config.Types
9096
9097
9098
9099 for {
9100 t := v.Type
9101 x := v_0
9102 y := v_1
9103 if !(!ssa.ShiftIsBounded(v)) {
9104 break
9105 }
9106 v.Reset(ssaop.OpRISCV64AND)
9107 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
9108 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9109 v1.AddArg(x)
9110 v0.AddArg2(v1, y)
9111 v2 := b.NewValue0(v.Pos, ssaop.OpNeg16, t)
9112 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9113 v3.AuxInt = ssa.Int64ToAuxInt(64)
9114 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9115 v4.AddArg(y)
9116 v3.AddArg(v4)
9117 v2.AddArg(v3)
9118 v.AddArg2(v0, v2)
9119 return true
9120 }
9121
9122
9123
9124 for {
9125 x := v_0
9126 y := v_1
9127 if !(ssa.ShiftIsBounded(v)) {
9128 break
9129 }
9130 v.Reset(ssaop.OpRISCV64SRL)
9131 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9132 v0.AddArg(x)
9133 v.AddArg2(v0, y)
9134 return true
9135 }
9136 return false
9137 }
9138 func rewriteValue_OpRsh16Ux32(v *ssa.Value) bool {
9139 v_1 := v.Args[1]
9140 v_0 := v.Args[0]
9141 b := v.Block
9142 typ := &b.Func.Config.Types
9143
9144
9145
9146 for {
9147 t := v.Type
9148 x := v_0
9149 y := v_1
9150 if !(!ssa.ShiftIsBounded(v)) {
9151 break
9152 }
9153 v.Reset(ssaop.OpRISCV64AND)
9154 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
9155 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9156 v1.AddArg(x)
9157 v0.AddArg2(v1, y)
9158 v2 := b.NewValue0(v.Pos, ssaop.OpNeg16, t)
9159 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9160 v3.AuxInt = ssa.Int64ToAuxInt(64)
9161 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
9162 v4.AddArg(y)
9163 v3.AddArg(v4)
9164 v2.AddArg(v3)
9165 v.AddArg2(v0, v2)
9166 return true
9167 }
9168
9169
9170
9171 for {
9172 x := v_0
9173 y := v_1
9174 if !(ssa.ShiftIsBounded(v)) {
9175 break
9176 }
9177 v.Reset(ssaop.OpRISCV64SRL)
9178 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9179 v0.AddArg(x)
9180 v.AddArg2(v0, y)
9181 return true
9182 }
9183 return false
9184 }
9185 func rewriteValue_OpRsh16Ux64(v *ssa.Value) bool {
9186 v_1 := v.Args[1]
9187 v_0 := v.Args[0]
9188 b := v.Block
9189 typ := &b.Func.Config.Types
9190
9191
9192
9193 for {
9194 t := v.Type
9195 x := v_0
9196 y := v_1
9197 if !(!ssa.ShiftIsBounded(v)) {
9198 break
9199 }
9200 v.Reset(ssaop.OpRISCV64AND)
9201 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
9202 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9203 v1.AddArg(x)
9204 v0.AddArg2(v1, y)
9205 v2 := b.NewValue0(v.Pos, ssaop.OpNeg16, t)
9206 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9207 v3.AuxInt = ssa.Int64ToAuxInt(64)
9208 v3.AddArg(y)
9209 v2.AddArg(v3)
9210 v.AddArg2(v0, v2)
9211 return true
9212 }
9213
9214
9215
9216 for {
9217 x := v_0
9218 y := v_1
9219 if !(ssa.ShiftIsBounded(v)) {
9220 break
9221 }
9222 v.Reset(ssaop.OpRISCV64SRL)
9223 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9224 v0.AddArg(x)
9225 v.AddArg2(v0, y)
9226 return true
9227 }
9228 return false
9229 }
9230 func rewriteValue_OpRsh16Ux8(v *ssa.Value) bool {
9231 v_1 := v.Args[1]
9232 v_0 := v.Args[0]
9233 b := v.Block
9234 typ := &b.Func.Config.Types
9235
9236
9237
9238 for {
9239 t := v.Type
9240 x := v_0
9241 y := v_1
9242 if !(!ssa.ShiftIsBounded(v)) {
9243 break
9244 }
9245 v.Reset(ssaop.OpRISCV64AND)
9246 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
9247 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9248 v1.AddArg(x)
9249 v0.AddArg2(v1, y)
9250 v2 := b.NewValue0(v.Pos, ssaop.OpNeg16, t)
9251 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9252 v3.AuxInt = ssa.Int64ToAuxInt(64)
9253 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
9254 v4.AddArg(y)
9255 v3.AddArg(v4)
9256 v2.AddArg(v3)
9257 v.AddArg2(v0, v2)
9258 return true
9259 }
9260
9261
9262
9263 for {
9264 x := v_0
9265 y := v_1
9266 if !(ssa.ShiftIsBounded(v)) {
9267 break
9268 }
9269 v.Reset(ssaop.OpRISCV64SRL)
9270 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9271 v0.AddArg(x)
9272 v.AddArg2(v0, y)
9273 return true
9274 }
9275 return false
9276 }
9277 func rewriteValue_OpRsh16x16(v *ssa.Value) bool {
9278 v_1 := v.Args[1]
9279 v_0 := v.Args[0]
9280 b := v.Block
9281 typ := &b.Func.Config.Types
9282
9283
9284
9285 for {
9286 t := v.Type
9287 x := v_0
9288 y := v_1
9289 if !(!ssa.ShiftIsBounded(v)) {
9290 break
9291 }
9292 v.Reset(ssaop.OpRISCV64SRA)
9293 v.Type = t
9294 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to64, typ.Int64)
9295 v0.AddArg(x)
9296 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
9297 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
9298 v2.AuxInt = ssa.Int64ToAuxInt(-1)
9299 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
9300 v3.AuxInt = ssa.Int64ToAuxInt(64)
9301 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9302 v4.AddArg(y)
9303 v3.AddArg(v4)
9304 v2.AddArg(v3)
9305 v1.AddArg2(y, v2)
9306 v.AddArg2(v0, v1)
9307 return true
9308 }
9309
9310
9311
9312 for {
9313 x := v_0
9314 y := v_1
9315 if !(ssa.ShiftIsBounded(v)) {
9316 break
9317 }
9318 v.Reset(ssaop.OpRISCV64SRA)
9319 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to64, typ.Int64)
9320 v0.AddArg(x)
9321 v.AddArg2(v0, y)
9322 return true
9323 }
9324 return false
9325 }
9326 func rewriteValue_OpRsh16x32(v *ssa.Value) bool {
9327 v_1 := v.Args[1]
9328 v_0 := v.Args[0]
9329 b := v.Block
9330 typ := &b.Func.Config.Types
9331
9332
9333
9334 for {
9335 t := v.Type
9336 x := v_0
9337 y := v_1
9338 if !(!ssa.ShiftIsBounded(v)) {
9339 break
9340 }
9341 v.Reset(ssaop.OpRISCV64SRA)
9342 v.Type = t
9343 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to64, typ.Int64)
9344 v0.AddArg(x)
9345 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
9346 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
9347 v2.AuxInt = ssa.Int64ToAuxInt(-1)
9348 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
9349 v3.AuxInt = ssa.Int64ToAuxInt(64)
9350 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
9351 v4.AddArg(y)
9352 v3.AddArg(v4)
9353 v2.AddArg(v3)
9354 v1.AddArg2(y, v2)
9355 v.AddArg2(v0, v1)
9356 return true
9357 }
9358
9359
9360
9361 for {
9362 x := v_0
9363 y := v_1
9364 if !(ssa.ShiftIsBounded(v)) {
9365 break
9366 }
9367 v.Reset(ssaop.OpRISCV64SRA)
9368 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to64, typ.Int64)
9369 v0.AddArg(x)
9370 v.AddArg2(v0, y)
9371 return true
9372 }
9373 return false
9374 }
9375 func rewriteValue_OpRsh16x64(v *ssa.Value) bool {
9376 v_1 := v.Args[1]
9377 v_0 := v.Args[0]
9378 b := v.Block
9379 typ := &b.Func.Config.Types
9380
9381
9382
9383 for {
9384 t := v.Type
9385 x := v_0
9386 y := v_1
9387 if !(!ssa.ShiftIsBounded(v)) {
9388 break
9389 }
9390 v.Reset(ssaop.OpRISCV64SRA)
9391 v.Type = t
9392 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to64, typ.Int64)
9393 v0.AddArg(x)
9394 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
9395 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
9396 v2.AuxInt = ssa.Int64ToAuxInt(-1)
9397 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
9398 v3.AuxInt = ssa.Int64ToAuxInt(64)
9399 v3.AddArg(y)
9400 v2.AddArg(v3)
9401 v1.AddArg2(y, v2)
9402 v.AddArg2(v0, v1)
9403 return true
9404 }
9405
9406
9407
9408 for {
9409 x := v_0
9410 y := v_1
9411 if !(ssa.ShiftIsBounded(v)) {
9412 break
9413 }
9414 v.Reset(ssaop.OpRISCV64SRA)
9415 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to64, typ.Int64)
9416 v0.AddArg(x)
9417 v.AddArg2(v0, y)
9418 return true
9419 }
9420 return false
9421 }
9422 func rewriteValue_OpRsh16x8(v *ssa.Value) bool {
9423 v_1 := v.Args[1]
9424 v_0 := v.Args[0]
9425 b := v.Block
9426 typ := &b.Func.Config.Types
9427
9428
9429
9430 for {
9431 t := v.Type
9432 x := v_0
9433 y := v_1
9434 if !(!ssa.ShiftIsBounded(v)) {
9435 break
9436 }
9437 v.Reset(ssaop.OpRISCV64SRA)
9438 v.Type = t
9439 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to64, typ.Int64)
9440 v0.AddArg(x)
9441 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
9442 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
9443 v2.AuxInt = ssa.Int64ToAuxInt(-1)
9444 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
9445 v3.AuxInt = ssa.Int64ToAuxInt(64)
9446 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
9447 v4.AddArg(y)
9448 v3.AddArg(v4)
9449 v2.AddArg(v3)
9450 v1.AddArg2(y, v2)
9451 v.AddArg2(v0, v1)
9452 return true
9453 }
9454
9455
9456
9457 for {
9458 x := v_0
9459 y := v_1
9460 if !(ssa.ShiftIsBounded(v)) {
9461 break
9462 }
9463 v.Reset(ssaop.OpRISCV64SRA)
9464 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to64, typ.Int64)
9465 v0.AddArg(x)
9466 v.AddArg2(v0, y)
9467 return true
9468 }
9469 return false
9470 }
9471 func rewriteValue_OpRsh32Ux16(v *ssa.Value) bool {
9472 v_1 := v.Args[1]
9473 v_0 := v.Args[0]
9474 b := v.Block
9475 typ := &b.Func.Config.Types
9476
9477
9478
9479 for {
9480 t := v.Type
9481 x := v_0
9482 y := v_1
9483 if !(!ssa.ShiftIsBounded(v)) {
9484 break
9485 }
9486 v.Reset(ssaop.OpRISCV64AND)
9487 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRLW, t)
9488 v0.AddArg2(x, y)
9489 v1 := b.NewValue0(v.Pos, ssaop.OpNeg32, t)
9490 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9491 v2.AuxInt = ssa.Int64ToAuxInt(32)
9492 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9493 v3.AddArg(y)
9494 v2.AddArg(v3)
9495 v1.AddArg(v2)
9496 v.AddArg2(v0, v1)
9497 return true
9498 }
9499
9500
9501
9502 for {
9503 x := v_0
9504 y := v_1
9505 if !(ssa.ShiftIsBounded(v)) {
9506 break
9507 }
9508 v.Reset(ssaop.OpRISCV64SRLW)
9509 v.AddArg2(x, y)
9510 return true
9511 }
9512 return false
9513 }
9514 func rewriteValue_OpRsh32Ux32(v *ssa.Value) bool {
9515 v_1 := v.Args[1]
9516 v_0 := v.Args[0]
9517 b := v.Block
9518 typ := &b.Func.Config.Types
9519
9520
9521
9522 for {
9523 t := v.Type
9524 x := v_0
9525 y := v_1
9526 if !(!ssa.ShiftIsBounded(v)) {
9527 break
9528 }
9529 v.Reset(ssaop.OpRISCV64AND)
9530 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRLW, t)
9531 v0.AddArg2(x, y)
9532 v1 := b.NewValue0(v.Pos, ssaop.OpNeg32, t)
9533 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9534 v2.AuxInt = ssa.Int64ToAuxInt(32)
9535 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
9536 v3.AddArg(y)
9537 v2.AddArg(v3)
9538 v1.AddArg(v2)
9539 v.AddArg2(v0, v1)
9540 return true
9541 }
9542
9543
9544
9545 for {
9546 x := v_0
9547 y := v_1
9548 if !(ssa.ShiftIsBounded(v)) {
9549 break
9550 }
9551 v.Reset(ssaop.OpRISCV64SRLW)
9552 v.AddArg2(x, y)
9553 return true
9554 }
9555 return false
9556 }
9557 func rewriteValue_OpRsh32Ux64(v *ssa.Value) bool {
9558 v_1 := v.Args[1]
9559 v_0 := v.Args[0]
9560 b := v.Block
9561
9562
9563
9564 for {
9565 t := v.Type
9566 x := v_0
9567 y := v_1
9568 if !(!ssa.ShiftIsBounded(v)) {
9569 break
9570 }
9571 v.Reset(ssaop.OpRISCV64AND)
9572 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRLW, t)
9573 v0.AddArg2(x, y)
9574 v1 := b.NewValue0(v.Pos, ssaop.OpNeg32, t)
9575 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9576 v2.AuxInt = ssa.Int64ToAuxInt(32)
9577 v2.AddArg(y)
9578 v1.AddArg(v2)
9579 v.AddArg2(v0, v1)
9580 return true
9581 }
9582
9583
9584
9585 for {
9586 x := v_0
9587 y := v_1
9588 if !(ssa.ShiftIsBounded(v)) {
9589 break
9590 }
9591 v.Reset(ssaop.OpRISCV64SRLW)
9592 v.AddArg2(x, y)
9593 return true
9594 }
9595 return false
9596 }
9597 func rewriteValue_OpRsh32Ux8(v *ssa.Value) bool {
9598 v_1 := v.Args[1]
9599 v_0 := v.Args[0]
9600 b := v.Block
9601 typ := &b.Func.Config.Types
9602
9603
9604
9605 for {
9606 t := v.Type
9607 x := v_0
9608 y := v_1
9609 if !(!ssa.ShiftIsBounded(v)) {
9610 break
9611 }
9612 v.Reset(ssaop.OpRISCV64AND)
9613 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRLW, t)
9614 v0.AddArg2(x, y)
9615 v1 := b.NewValue0(v.Pos, ssaop.OpNeg32, t)
9616 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9617 v2.AuxInt = ssa.Int64ToAuxInt(32)
9618 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
9619 v3.AddArg(y)
9620 v2.AddArg(v3)
9621 v1.AddArg(v2)
9622 v.AddArg2(v0, v1)
9623 return true
9624 }
9625
9626
9627
9628 for {
9629 x := v_0
9630 y := v_1
9631 if !(ssa.ShiftIsBounded(v)) {
9632 break
9633 }
9634 v.Reset(ssaop.OpRISCV64SRLW)
9635 v.AddArg2(x, y)
9636 return true
9637 }
9638 return false
9639 }
9640 func rewriteValue_OpRsh32x16(v *ssa.Value) bool {
9641 v_1 := v.Args[1]
9642 v_0 := v.Args[0]
9643 b := v.Block
9644 typ := &b.Func.Config.Types
9645
9646
9647
9648 for {
9649 t := v.Type
9650 x := v_0
9651 y := v_1
9652 if !(!ssa.ShiftIsBounded(v)) {
9653 break
9654 }
9655 v.Reset(ssaop.OpRISCV64SRAW)
9656 v.Type = t
9657 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
9658 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
9659 v1.AuxInt = ssa.Int64ToAuxInt(-1)
9660 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
9661 v2.AuxInt = ssa.Int64ToAuxInt(32)
9662 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9663 v3.AddArg(y)
9664 v2.AddArg(v3)
9665 v1.AddArg(v2)
9666 v0.AddArg2(y, v1)
9667 v.AddArg2(x, v0)
9668 return true
9669 }
9670
9671
9672
9673 for {
9674 x := v_0
9675 y := v_1
9676 if !(ssa.ShiftIsBounded(v)) {
9677 break
9678 }
9679 v.Reset(ssaop.OpRISCV64SRAW)
9680 v.AddArg2(x, y)
9681 return true
9682 }
9683 return false
9684 }
9685 func rewriteValue_OpRsh32x32(v *ssa.Value) bool {
9686 v_1 := v.Args[1]
9687 v_0 := v.Args[0]
9688 b := v.Block
9689 typ := &b.Func.Config.Types
9690
9691
9692
9693 for {
9694 t := v.Type
9695 x := v_0
9696 y := v_1
9697 if !(!ssa.ShiftIsBounded(v)) {
9698 break
9699 }
9700 v.Reset(ssaop.OpRISCV64SRAW)
9701 v.Type = t
9702 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
9703 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
9704 v1.AuxInt = ssa.Int64ToAuxInt(-1)
9705 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
9706 v2.AuxInt = ssa.Int64ToAuxInt(32)
9707 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
9708 v3.AddArg(y)
9709 v2.AddArg(v3)
9710 v1.AddArg(v2)
9711 v0.AddArg2(y, v1)
9712 v.AddArg2(x, v0)
9713 return true
9714 }
9715
9716
9717
9718 for {
9719 x := v_0
9720 y := v_1
9721 if !(ssa.ShiftIsBounded(v)) {
9722 break
9723 }
9724 v.Reset(ssaop.OpRISCV64SRAW)
9725 v.AddArg2(x, y)
9726 return true
9727 }
9728 return false
9729 }
9730 func rewriteValue_OpRsh32x64(v *ssa.Value) bool {
9731 v_1 := v.Args[1]
9732 v_0 := v.Args[0]
9733 b := v.Block
9734
9735
9736
9737 for {
9738 t := v.Type
9739 x := v_0
9740 y := v_1
9741 if !(!ssa.ShiftIsBounded(v)) {
9742 break
9743 }
9744 v.Reset(ssaop.OpRISCV64SRAW)
9745 v.Type = t
9746 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
9747 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
9748 v1.AuxInt = ssa.Int64ToAuxInt(-1)
9749 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
9750 v2.AuxInt = ssa.Int64ToAuxInt(32)
9751 v2.AddArg(y)
9752 v1.AddArg(v2)
9753 v0.AddArg2(y, v1)
9754 v.AddArg2(x, v0)
9755 return true
9756 }
9757
9758
9759
9760 for {
9761 x := v_0
9762 y := v_1
9763 if !(ssa.ShiftIsBounded(v)) {
9764 break
9765 }
9766 v.Reset(ssaop.OpRISCV64SRAW)
9767 v.AddArg2(x, y)
9768 return true
9769 }
9770 return false
9771 }
9772 func rewriteValue_OpRsh32x8(v *ssa.Value) bool {
9773 v_1 := v.Args[1]
9774 v_0 := v.Args[0]
9775 b := v.Block
9776 typ := &b.Func.Config.Types
9777
9778
9779
9780 for {
9781 t := v.Type
9782 x := v_0
9783 y := v_1
9784 if !(!ssa.ShiftIsBounded(v)) {
9785 break
9786 }
9787 v.Reset(ssaop.OpRISCV64SRAW)
9788 v.Type = t
9789 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
9790 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
9791 v1.AuxInt = ssa.Int64ToAuxInt(-1)
9792 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
9793 v2.AuxInt = ssa.Int64ToAuxInt(32)
9794 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
9795 v3.AddArg(y)
9796 v2.AddArg(v3)
9797 v1.AddArg(v2)
9798 v0.AddArg2(y, v1)
9799 v.AddArg2(x, v0)
9800 return true
9801 }
9802
9803
9804
9805 for {
9806 x := v_0
9807 y := v_1
9808 if !(ssa.ShiftIsBounded(v)) {
9809 break
9810 }
9811 v.Reset(ssaop.OpRISCV64SRAW)
9812 v.AddArg2(x, y)
9813 return true
9814 }
9815 return false
9816 }
9817 func rewriteValue_OpRsh64Ux16(v *ssa.Value) bool {
9818 v_1 := v.Args[1]
9819 v_0 := v.Args[0]
9820 b := v.Block
9821 typ := &b.Func.Config.Types
9822
9823
9824
9825 for {
9826 t := v.Type
9827 x := v_0
9828 y := v_1
9829 if !(!ssa.ShiftIsBounded(v)) {
9830 break
9831 }
9832 v.Reset(ssaop.OpRISCV64AND)
9833 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
9834 v0.AddArg2(x, y)
9835 v1 := b.NewValue0(v.Pos, ssaop.OpNeg64, t)
9836 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9837 v2.AuxInt = ssa.Int64ToAuxInt(64)
9838 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9839 v3.AddArg(y)
9840 v2.AddArg(v3)
9841 v1.AddArg(v2)
9842 v.AddArg2(v0, v1)
9843 return true
9844 }
9845
9846
9847
9848 for {
9849 x := v_0
9850 y := v_1
9851 if !(ssa.ShiftIsBounded(v)) {
9852 break
9853 }
9854 v.Reset(ssaop.OpRISCV64SRL)
9855 v.AddArg2(x, y)
9856 return true
9857 }
9858 return false
9859 }
9860 func rewriteValue_OpRsh64Ux32(v *ssa.Value) bool {
9861 v_1 := v.Args[1]
9862 v_0 := v.Args[0]
9863 b := v.Block
9864 typ := &b.Func.Config.Types
9865
9866
9867
9868 for {
9869 t := v.Type
9870 x := v_0
9871 y := v_1
9872 if !(!ssa.ShiftIsBounded(v)) {
9873 break
9874 }
9875 v.Reset(ssaop.OpRISCV64AND)
9876 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
9877 v0.AddArg2(x, y)
9878 v1 := b.NewValue0(v.Pos, ssaop.OpNeg64, t)
9879 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9880 v2.AuxInt = ssa.Int64ToAuxInt(64)
9881 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
9882 v3.AddArg(y)
9883 v2.AddArg(v3)
9884 v1.AddArg(v2)
9885 v.AddArg2(v0, v1)
9886 return true
9887 }
9888
9889
9890
9891 for {
9892 x := v_0
9893 y := v_1
9894 if !(ssa.ShiftIsBounded(v)) {
9895 break
9896 }
9897 v.Reset(ssaop.OpRISCV64SRL)
9898 v.AddArg2(x, y)
9899 return true
9900 }
9901 return false
9902 }
9903 func rewriteValue_OpRsh64Ux64(v *ssa.Value) bool {
9904 v_1 := v.Args[1]
9905 v_0 := v.Args[0]
9906 b := v.Block
9907
9908
9909
9910 for {
9911 t := v.Type
9912 x := v_0
9913 y := v_1
9914 if !(!ssa.ShiftIsBounded(v)) {
9915 break
9916 }
9917 v.Reset(ssaop.OpRISCV64AND)
9918 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
9919 v0.AddArg2(x, y)
9920 v1 := b.NewValue0(v.Pos, ssaop.OpNeg64, t)
9921 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9922 v2.AuxInt = ssa.Int64ToAuxInt(64)
9923 v2.AddArg(y)
9924 v1.AddArg(v2)
9925 v.AddArg2(v0, v1)
9926 return true
9927 }
9928
9929
9930
9931 for {
9932 x := v_0
9933 y := v_1
9934 if !(ssa.ShiftIsBounded(v)) {
9935 break
9936 }
9937 v.Reset(ssaop.OpRISCV64SRL)
9938 v.AddArg2(x, y)
9939 return true
9940 }
9941 return false
9942 }
9943 func rewriteValue_OpRsh64Ux8(v *ssa.Value) bool {
9944 v_1 := v.Args[1]
9945 v_0 := v.Args[0]
9946 b := v.Block
9947 typ := &b.Func.Config.Types
9948
9949
9950
9951 for {
9952 t := v.Type
9953 x := v_0
9954 y := v_1
9955 if !(!ssa.ShiftIsBounded(v)) {
9956 break
9957 }
9958 v.Reset(ssaop.OpRISCV64AND)
9959 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
9960 v0.AddArg2(x, y)
9961 v1 := b.NewValue0(v.Pos, ssaop.OpNeg64, t)
9962 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9963 v2.AuxInt = ssa.Int64ToAuxInt(64)
9964 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
9965 v3.AddArg(y)
9966 v2.AddArg(v3)
9967 v1.AddArg(v2)
9968 v.AddArg2(v0, v1)
9969 return true
9970 }
9971
9972
9973
9974 for {
9975 x := v_0
9976 y := v_1
9977 if !(ssa.ShiftIsBounded(v)) {
9978 break
9979 }
9980 v.Reset(ssaop.OpRISCV64SRL)
9981 v.AddArg2(x, y)
9982 return true
9983 }
9984 return false
9985 }
9986 func rewriteValue_OpRsh64x16(v *ssa.Value) bool {
9987 v_1 := v.Args[1]
9988 v_0 := v.Args[0]
9989 b := v.Block
9990 typ := &b.Func.Config.Types
9991
9992
9993
9994 for {
9995 t := v.Type
9996 x := v_0
9997 y := v_1
9998 if !(!ssa.ShiftIsBounded(v)) {
9999 break
10000 }
10001 v.Reset(ssaop.OpRISCV64SRA)
10002 v.Type = t
10003 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
10004 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
10005 v1.AuxInt = ssa.Int64ToAuxInt(-1)
10006 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
10007 v2.AuxInt = ssa.Int64ToAuxInt(64)
10008 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
10009 v3.AddArg(y)
10010 v2.AddArg(v3)
10011 v1.AddArg(v2)
10012 v0.AddArg2(y, v1)
10013 v.AddArg2(x, v0)
10014 return true
10015 }
10016
10017
10018
10019 for {
10020 x := v_0
10021 y := v_1
10022 if !(ssa.ShiftIsBounded(v)) {
10023 break
10024 }
10025 v.Reset(ssaop.OpRISCV64SRA)
10026 v.AddArg2(x, y)
10027 return true
10028 }
10029 return false
10030 }
10031 func rewriteValue_OpRsh64x32(v *ssa.Value) bool {
10032 v_1 := v.Args[1]
10033 v_0 := v.Args[0]
10034 b := v.Block
10035 typ := &b.Func.Config.Types
10036
10037
10038
10039 for {
10040 t := v.Type
10041 x := v_0
10042 y := v_1
10043 if !(!ssa.ShiftIsBounded(v)) {
10044 break
10045 }
10046 v.Reset(ssaop.OpRISCV64SRA)
10047 v.Type = t
10048 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
10049 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
10050 v1.AuxInt = ssa.Int64ToAuxInt(-1)
10051 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
10052 v2.AuxInt = ssa.Int64ToAuxInt(64)
10053 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
10054 v3.AddArg(y)
10055 v2.AddArg(v3)
10056 v1.AddArg(v2)
10057 v0.AddArg2(y, v1)
10058 v.AddArg2(x, v0)
10059 return true
10060 }
10061
10062
10063
10064 for {
10065 x := v_0
10066 y := v_1
10067 if !(ssa.ShiftIsBounded(v)) {
10068 break
10069 }
10070 v.Reset(ssaop.OpRISCV64SRA)
10071 v.AddArg2(x, y)
10072 return true
10073 }
10074 return false
10075 }
10076 func rewriteValue_OpRsh64x64(v *ssa.Value) bool {
10077 v_1 := v.Args[1]
10078 v_0 := v.Args[0]
10079 b := v.Block
10080
10081
10082
10083 for {
10084 t := v.Type
10085 x := v_0
10086 y := v_1
10087 if !(!ssa.ShiftIsBounded(v)) {
10088 break
10089 }
10090 v.Reset(ssaop.OpRISCV64SRA)
10091 v.Type = t
10092 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
10093 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
10094 v1.AuxInt = ssa.Int64ToAuxInt(-1)
10095 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
10096 v2.AuxInt = ssa.Int64ToAuxInt(64)
10097 v2.AddArg(y)
10098 v1.AddArg(v2)
10099 v0.AddArg2(y, v1)
10100 v.AddArg2(x, v0)
10101 return true
10102 }
10103
10104
10105
10106 for {
10107 x := v_0
10108 y := v_1
10109 if !(ssa.ShiftIsBounded(v)) {
10110 break
10111 }
10112 v.Reset(ssaop.OpRISCV64SRA)
10113 v.AddArg2(x, y)
10114 return true
10115 }
10116 return false
10117 }
10118 func rewriteValue_OpRsh64x8(v *ssa.Value) bool {
10119 v_1 := v.Args[1]
10120 v_0 := v.Args[0]
10121 b := v.Block
10122 typ := &b.Func.Config.Types
10123
10124
10125
10126 for {
10127 t := v.Type
10128 x := v_0
10129 y := v_1
10130 if !(!ssa.ShiftIsBounded(v)) {
10131 break
10132 }
10133 v.Reset(ssaop.OpRISCV64SRA)
10134 v.Type = t
10135 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
10136 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
10137 v1.AuxInt = ssa.Int64ToAuxInt(-1)
10138 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
10139 v2.AuxInt = ssa.Int64ToAuxInt(64)
10140 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10141 v3.AddArg(y)
10142 v2.AddArg(v3)
10143 v1.AddArg(v2)
10144 v0.AddArg2(y, v1)
10145 v.AddArg2(x, v0)
10146 return true
10147 }
10148
10149
10150
10151 for {
10152 x := v_0
10153 y := v_1
10154 if !(ssa.ShiftIsBounded(v)) {
10155 break
10156 }
10157 v.Reset(ssaop.OpRISCV64SRA)
10158 v.AddArg2(x, y)
10159 return true
10160 }
10161 return false
10162 }
10163 func rewriteValue_OpRsh8Ux16(v *ssa.Value) bool {
10164 v_1 := v.Args[1]
10165 v_0 := v.Args[0]
10166 b := v.Block
10167 typ := &b.Func.Config.Types
10168
10169
10170
10171 for {
10172 t := v.Type
10173 x := v_0
10174 y := v_1
10175 if !(!ssa.ShiftIsBounded(v)) {
10176 break
10177 }
10178 v.Reset(ssaop.OpRISCV64AND)
10179 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
10180 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10181 v1.AddArg(x)
10182 v0.AddArg2(v1, y)
10183 v2 := b.NewValue0(v.Pos, ssaop.OpNeg8, t)
10184 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
10185 v3.AuxInt = ssa.Int64ToAuxInt(64)
10186 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
10187 v4.AddArg(y)
10188 v3.AddArg(v4)
10189 v2.AddArg(v3)
10190 v.AddArg2(v0, v2)
10191 return true
10192 }
10193
10194
10195
10196 for {
10197 x := v_0
10198 y := v_1
10199 if !(ssa.ShiftIsBounded(v)) {
10200 break
10201 }
10202 v.Reset(ssaop.OpRISCV64SRL)
10203 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10204 v0.AddArg(x)
10205 v.AddArg2(v0, y)
10206 return true
10207 }
10208 return false
10209 }
10210 func rewriteValue_OpRsh8Ux32(v *ssa.Value) bool {
10211 v_1 := v.Args[1]
10212 v_0 := v.Args[0]
10213 b := v.Block
10214 typ := &b.Func.Config.Types
10215
10216
10217
10218 for {
10219 t := v.Type
10220 x := v_0
10221 y := v_1
10222 if !(!ssa.ShiftIsBounded(v)) {
10223 break
10224 }
10225 v.Reset(ssaop.OpRISCV64AND)
10226 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
10227 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10228 v1.AddArg(x)
10229 v0.AddArg2(v1, y)
10230 v2 := b.NewValue0(v.Pos, ssaop.OpNeg8, t)
10231 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
10232 v3.AuxInt = ssa.Int64ToAuxInt(64)
10233 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
10234 v4.AddArg(y)
10235 v3.AddArg(v4)
10236 v2.AddArg(v3)
10237 v.AddArg2(v0, v2)
10238 return true
10239 }
10240
10241
10242
10243 for {
10244 x := v_0
10245 y := v_1
10246 if !(ssa.ShiftIsBounded(v)) {
10247 break
10248 }
10249 v.Reset(ssaop.OpRISCV64SRL)
10250 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10251 v0.AddArg(x)
10252 v.AddArg2(v0, y)
10253 return true
10254 }
10255 return false
10256 }
10257 func rewriteValue_OpRsh8Ux64(v *ssa.Value) bool {
10258 v_1 := v.Args[1]
10259 v_0 := v.Args[0]
10260 b := v.Block
10261 typ := &b.Func.Config.Types
10262
10263
10264
10265 for {
10266 t := v.Type
10267 x := v_0
10268 y := v_1
10269 if !(!ssa.ShiftIsBounded(v)) {
10270 break
10271 }
10272 v.Reset(ssaop.OpRISCV64AND)
10273 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
10274 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10275 v1.AddArg(x)
10276 v0.AddArg2(v1, y)
10277 v2 := b.NewValue0(v.Pos, ssaop.OpNeg8, t)
10278 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
10279 v3.AuxInt = ssa.Int64ToAuxInt(64)
10280 v3.AddArg(y)
10281 v2.AddArg(v3)
10282 v.AddArg2(v0, v2)
10283 return true
10284 }
10285
10286
10287
10288 for {
10289 x := v_0
10290 y := v_1
10291 if !(ssa.ShiftIsBounded(v)) {
10292 break
10293 }
10294 v.Reset(ssaop.OpRISCV64SRL)
10295 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10296 v0.AddArg(x)
10297 v.AddArg2(v0, y)
10298 return true
10299 }
10300 return false
10301 }
10302 func rewriteValue_OpRsh8Ux8(v *ssa.Value) bool {
10303 v_1 := v.Args[1]
10304 v_0 := v.Args[0]
10305 b := v.Block
10306 typ := &b.Func.Config.Types
10307
10308
10309
10310 for {
10311 t := v.Type
10312 x := v_0
10313 y := v_1
10314 if !(!ssa.ShiftIsBounded(v)) {
10315 break
10316 }
10317 v.Reset(ssaop.OpRISCV64AND)
10318 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
10319 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10320 v1.AddArg(x)
10321 v0.AddArg2(v1, y)
10322 v2 := b.NewValue0(v.Pos, ssaop.OpNeg8, t)
10323 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
10324 v3.AuxInt = ssa.Int64ToAuxInt(64)
10325 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10326 v4.AddArg(y)
10327 v3.AddArg(v4)
10328 v2.AddArg(v3)
10329 v.AddArg2(v0, v2)
10330 return true
10331 }
10332
10333
10334
10335 for {
10336 x := v_0
10337 y := v_1
10338 if !(ssa.ShiftIsBounded(v)) {
10339 break
10340 }
10341 v.Reset(ssaop.OpRISCV64SRL)
10342 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10343 v0.AddArg(x)
10344 v.AddArg2(v0, y)
10345 return true
10346 }
10347 return false
10348 }
10349 func rewriteValue_OpRsh8x16(v *ssa.Value) bool {
10350 v_1 := v.Args[1]
10351 v_0 := v.Args[0]
10352 b := v.Block
10353 typ := &b.Func.Config.Types
10354
10355
10356
10357 for {
10358 t := v.Type
10359 x := v_0
10360 y := v_1
10361 if !(!ssa.ShiftIsBounded(v)) {
10362 break
10363 }
10364 v.Reset(ssaop.OpRISCV64SRA)
10365 v.Type = t
10366 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt8to64, typ.Int64)
10367 v0.AddArg(x)
10368 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
10369 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
10370 v2.AuxInt = ssa.Int64ToAuxInt(-1)
10371 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
10372 v3.AuxInt = ssa.Int64ToAuxInt(64)
10373 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
10374 v4.AddArg(y)
10375 v3.AddArg(v4)
10376 v2.AddArg(v3)
10377 v1.AddArg2(y, v2)
10378 v.AddArg2(v0, v1)
10379 return true
10380 }
10381
10382
10383
10384 for {
10385 x := v_0
10386 y := v_1
10387 if !(ssa.ShiftIsBounded(v)) {
10388 break
10389 }
10390 v.Reset(ssaop.OpRISCV64SRA)
10391 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt8to64, typ.Int64)
10392 v0.AddArg(x)
10393 v.AddArg2(v0, y)
10394 return true
10395 }
10396 return false
10397 }
10398 func rewriteValue_OpRsh8x32(v *ssa.Value) bool {
10399 v_1 := v.Args[1]
10400 v_0 := v.Args[0]
10401 b := v.Block
10402 typ := &b.Func.Config.Types
10403
10404
10405
10406 for {
10407 t := v.Type
10408 x := v_0
10409 y := v_1
10410 if !(!ssa.ShiftIsBounded(v)) {
10411 break
10412 }
10413 v.Reset(ssaop.OpRISCV64SRA)
10414 v.Type = t
10415 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt8to64, typ.Int64)
10416 v0.AddArg(x)
10417 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
10418 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
10419 v2.AuxInt = ssa.Int64ToAuxInt(-1)
10420 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
10421 v3.AuxInt = ssa.Int64ToAuxInt(64)
10422 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
10423 v4.AddArg(y)
10424 v3.AddArg(v4)
10425 v2.AddArg(v3)
10426 v1.AddArg2(y, v2)
10427 v.AddArg2(v0, v1)
10428 return true
10429 }
10430
10431
10432
10433 for {
10434 x := v_0
10435 y := v_1
10436 if !(ssa.ShiftIsBounded(v)) {
10437 break
10438 }
10439 v.Reset(ssaop.OpRISCV64SRA)
10440 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt8to64, typ.Int64)
10441 v0.AddArg(x)
10442 v.AddArg2(v0, y)
10443 return true
10444 }
10445 return false
10446 }
10447 func rewriteValue_OpRsh8x64(v *ssa.Value) bool {
10448 v_1 := v.Args[1]
10449 v_0 := v.Args[0]
10450 b := v.Block
10451 typ := &b.Func.Config.Types
10452
10453
10454
10455 for {
10456 t := v.Type
10457 x := v_0
10458 y := v_1
10459 if !(!ssa.ShiftIsBounded(v)) {
10460 break
10461 }
10462 v.Reset(ssaop.OpRISCV64SRA)
10463 v.Type = t
10464 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt8to64, typ.Int64)
10465 v0.AddArg(x)
10466 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
10467 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
10468 v2.AuxInt = ssa.Int64ToAuxInt(-1)
10469 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
10470 v3.AuxInt = ssa.Int64ToAuxInt(64)
10471 v3.AddArg(y)
10472 v2.AddArg(v3)
10473 v1.AddArg2(y, v2)
10474 v.AddArg2(v0, v1)
10475 return true
10476 }
10477
10478
10479
10480 for {
10481 x := v_0
10482 y := v_1
10483 if !(ssa.ShiftIsBounded(v)) {
10484 break
10485 }
10486 v.Reset(ssaop.OpRISCV64SRA)
10487 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt8to64, typ.Int64)
10488 v0.AddArg(x)
10489 v.AddArg2(v0, y)
10490 return true
10491 }
10492 return false
10493 }
10494 func rewriteValue_OpRsh8x8(v *ssa.Value) bool {
10495 v_1 := v.Args[1]
10496 v_0 := v.Args[0]
10497 b := v.Block
10498 typ := &b.Func.Config.Types
10499
10500
10501
10502 for {
10503 t := v.Type
10504 x := v_0
10505 y := v_1
10506 if !(!ssa.ShiftIsBounded(v)) {
10507 break
10508 }
10509 v.Reset(ssaop.OpRISCV64SRA)
10510 v.Type = t
10511 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt8to64, typ.Int64)
10512 v0.AddArg(x)
10513 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
10514 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
10515 v2.AuxInt = ssa.Int64ToAuxInt(-1)
10516 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
10517 v3.AuxInt = ssa.Int64ToAuxInt(64)
10518 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10519 v4.AddArg(y)
10520 v3.AddArg(v4)
10521 v2.AddArg(v3)
10522 v1.AddArg2(y, v2)
10523 v.AddArg2(v0, v1)
10524 return true
10525 }
10526
10527
10528
10529 for {
10530 x := v_0
10531 y := v_1
10532 if !(ssa.ShiftIsBounded(v)) {
10533 break
10534 }
10535 v.Reset(ssaop.OpRISCV64SRA)
10536 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt8to64, typ.Int64)
10537 v0.AddArg(x)
10538 v.AddArg2(v0, y)
10539 return true
10540 }
10541 return false
10542 }
10543 func rewriteValue_OpSelect0(v *ssa.Value) bool {
10544 v_0 := v.Args[0]
10545 b := v.Block
10546 typ := &b.Func.Config.Types
10547
10548
10549 for {
10550 if v_0.Op != ssaop.OpAdd64carry {
10551 break
10552 }
10553 c := v_0.Args[2]
10554 x := v_0.Args[0]
10555 y := v_0.Args[1]
10556 v.Reset(ssaop.OpRISCV64ADD)
10557 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADD, typ.UInt64)
10558 v0.AddArg2(x, y)
10559 v.AddArg2(v0, c)
10560 return true
10561 }
10562
10563
10564 for {
10565 if v_0.Op != ssaop.OpSub64borrow {
10566 break
10567 }
10568 c := v_0.Args[2]
10569 x := v_0.Args[0]
10570 y := v_0.Args[1]
10571 v.Reset(ssaop.OpRISCV64SUB)
10572 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SUB, typ.UInt64)
10573 v0.AddArg2(x, y)
10574 v.AddArg2(v0, c)
10575 return true
10576 }
10577
10578
10579
10580 for {
10581 m := v_0
10582 if m.Op != ssaop.OpRISCV64LoweredMuluhilo {
10583 break
10584 }
10585 y := m.Args[1]
10586 x := m.Args[0]
10587 if !(m.Uses == 1) {
10588 break
10589 }
10590 v.Reset(ssaop.OpRISCV64MULHU)
10591 v.AddArg2(x, y)
10592 return true
10593 }
10594 return false
10595 }
10596 func rewriteValue_OpSelect1(v *ssa.Value) bool {
10597 v_0 := v.Args[0]
10598 b := v.Block
10599 typ := &b.Func.Config.Types
10600
10601
10602 for {
10603 if v_0.Op != ssaop.OpAdd64carry {
10604 break
10605 }
10606 c := v_0.Args[2]
10607 x := v_0.Args[0]
10608 y := v_0.Args[1]
10609 v.Reset(ssaop.OpRISCV64OR)
10610 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTU, typ.UInt64)
10611 s := b.NewValue0(v.Pos, ssaop.OpRISCV64ADD, typ.UInt64)
10612 s.AddArg2(x, y)
10613 v0.AddArg2(s, x)
10614 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTU, typ.UInt64)
10615 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADD, typ.UInt64)
10616 v3.AddArg2(s, c)
10617 v2.AddArg2(v3, s)
10618 v.AddArg2(v0, v2)
10619 return true
10620 }
10621
10622
10623 for {
10624 if v_0.Op != ssaop.OpSub64borrow {
10625 break
10626 }
10627 c := v_0.Args[2]
10628 x := v_0.Args[0]
10629 y := v_0.Args[1]
10630 v.Reset(ssaop.OpRISCV64OR)
10631 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTU, typ.UInt64)
10632 s := b.NewValue0(v.Pos, ssaop.OpRISCV64SUB, typ.UInt64)
10633 s.AddArg2(x, y)
10634 v0.AddArg2(x, s)
10635 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTU, typ.UInt64)
10636 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SUB, typ.UInt64)
10637 v3.AddArg2(s, c)
10638 v2.AddArg2(s, v3)
10639 v.AddArg2(v0, v2)
10640 return true
10641 }
10642
10643
10644
10645 for {
10646 m := v_0
10647 if m.Op != ssaop.OpRISCV64LoweredMuluhilo {
10648 break
10649 }
10650 y := m.Args[1]
10651 x := m.Args[0]
10652 if !(m.Uses == 1) {
10653 break
10654 }
10655 v.Reset(ssaop.OpRISCV64MUL)
10656 v.AddArg2(x, y)
10657 return true
10658 }
10659 return false
10660 }
10661 func rewriteValue_OpSlicemask(v *ssa.Value) bool {
10662 v_0 := v.Args[0]
10663 b := v.Block
10664
10665
10666 for {
10667 t := v.Type
10668 x := v_0
10669 v.Reset(ssaop.OpRISCV64SRAI)
10670 v.AuxInt = ssa.Int64ToAuxInt(63)
10671 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64NEG, t)
10672 v0.AddArg(x)
10673 v.AddArg(v0)
10674 return true
10675 }
10676 }
10677 func rewriteValue_OpStore(v *ssa.Value) bool {
10678 v_2 := v.Args[2]
10679 v_1 := v.Args[1]
10680 v_0 := v.Args[0]
10681
10682
10683
10684 for {
10685 t := ssa.AuxToType(v.Aux)
10686 ptr := v_0
10687 val := v_1
10688 mem := v_2
10689 if !(t.Size() == 1) {
10690 break
10691 }
10692 v.Reset(ssaop.OpRISCV64MOVBstore)
10693 v.AddArg3(ptr, val, mem)
10694 return true
10695 }
10696
10697
10698
10699 for {
10700 t := ssa.AuxToType(v.Aux)
10701 ptr := v_0
10702 val := v_1
10703 mem := v_2
10704 if !(t.Size() == 2) {
10705 break
10706 }
10707 v.Reset(ssaop.OpRISCV64MOVHstore)
10708 v.AddArg3(ptr, val, mem)
10709 return true
10710 }
10711
10712
10713
10714 for {
10715 t := ssa.AuxToType(v.Aux)
10716 ptr := v_0
10717 val := v_1
10718 mem := v_2
10719 if !(t.Size() == 4 && !t.IsFloat()) {
10720 break
10721 }
10722 v.Reset(ssaop.OpRISCV64MOVWstore)
10723 v.AddArg3(ptr, val, mem)
10724 return true
10725 }
10726
10727
10728
10729 for {
10730 t := ssa.AuxToType(v.Aux)
10731 ptr := v_0
10732 val := v_1
10733 mem := v_2
10734 if !(t.Size() == 8 && !t.IsFloat()) {
10735 break
10736 }
10737 v.Reset(ssaop.OpRISCV64MOVDstore)
10738 v.AddArg3(ptr, val, mem)
10739 return true
10740 }
10741
10742
10743
10744 for {
10745 t := ssa.AuxToType(v.Aux)
10746 ptr := v_0
10747 val := v_1
10748 mem := v_2
10749 if !(t.Size() == 4 && t.IsFloat()) {
10750 break
10751 }
10752 v.Reset(ssaop.OpRISCV64FMOVWstore)
10753 v.AddArg3(ptr, val, mem)
10754 return true
10755 }
10756
10757
10758
10759 for {
10760 t := ssa.AuxToType(v.Aux)
10761 ptr := v_0
10762 val := v_1
10763 mem := v_2
10764 if !(t.Size() == 8 && t.IsFloat()) {
10765 break
10766 }
10767 v.Reset(ssaop.OpRISCV64FMOVDstore)
10768 v.AddArg3(ptr, val, mem)
10769 return true
10770 }
10771 return false
10772 }
10773 func rewriteValue_OpZero(v *ssa.Value) bool {
10774 v_1 := v.Args[1]
10775 v_0 := v.Args[0]
10776 b := v.Block
10777 config := b.Func.Config
10778 typ := &b.Func.Config.Types
10779
10780
10781 for {
10782 if ssa.AuxIntToInt64(v.AuxInt) != 0 {
10783 break
10784 }
10785 mem := v_1
10786 v.CopyOf(mem)
10787 return true
10788 }
10789
10790
10791 for {
10792 if ssa.AuxIntToInt64(v.AuxInt) != 1 {
10793 break
10794 }
10795 ptr := v_0
10796 mem := v_1
10797 v.Reset(ssaop.OpRISCV64MOVBstore)
10798 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
10799 v0.AuxInt = ssa.Int64ToAuxInt(0)
10800 v.AddArg3(ptr, v0, mem)
10801 return true
10802 }
10803
10804
10805
10806 for {
10807 if ssa.AuxIntToInt64(v.AuxInt) != 2 {
10808 break
10809 }
10810 t := ssa.AuxToType(v.Aux)
10811 ptr := v_0
10812 mem := v_1
10813 if !(t.Alignment()%2 == 0) {
10814 break
10815 }
10816 v.Reset(ssaop.OpRISCV64MOVHstore)
10817 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
10818 v0.AuxInt = ssa.Int64ToAuxInt(0)
10819 v.AddArg3(ptr, v0, mem)
10820 return true
10821 }
10822
10823
10824 for {
10825 if ssa.AuxIntToInt64(v.AuxInt) != 2 {
10826 break
10827 }
10828 ptr := v_0
10829 mem := v_1
10830 v.Reset(ssaop.OpRISCV64MOVBstore)
10831 v.AuxInt = ssa.Int32ToAuxInt(1)
10832 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
10833 v0.AuxInt = ssa.Int64ToAuxInt(0)
10834 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBstore, types.TypeMem)
10835 v1.AddArg3(ptr, v0, mem)
10836 v.AddArg3(ptr, v0, v1)
10837 return true
10838 }
10839
10840
10841
10842 for {
10843 if ssa.AuxIntToInt64(v.AuxInt) != 4 {
10844 break
10845 }
10846 t := ssa.AuxToType(v.Aux)
10847 ptr := v_0
10848 mem := v_1
10849 if !(t.Alignment()%4 == 0) {
10850 break
10851 }
10852 v.Reset(ssaop.OpRISCV64MOVWstore)
10853 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
10854 v0.AuxInt = ssa.Int64ToAuxInt(0)
10855 v.AddArg3(ptr, v0, mem)
10856 return true
10857 }
10858
10859
10860
10861 for {
10862 if ssa.AuxIntToInt64(v.AuxInt) != 4 {
10863 break
10864 }
10865 t := ssa.AuxToType(v.Aux)
10866 ptr := v_0
10867 mem := v_1
10868 if !(t.Alignment()%2 == 0) {
10869 break
10870 }
10871 v.Reset(ssaop.OpRISCV64MOVHstore)
10872 v.AuxInt = ssa.Int32ToAuxInt(2)
10873 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
10874 v0.AuxInt = ssa.Int64ToAuxInt(0)
10875 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHstore, types.TypeMem)
10876 v1.AddArg3(ptr, v0, mem)
10877 v.AddArg3(ptr, v0, v1)
10878 return true
10879 }
10880
10881
10882 for {
10883 if ssa.AuxIntToInt64(v.AuxInt) != 4 {
10884 break
10885 }
10886 ptr := v_0
10887 mem := v_1
10888 v.Reset(ssaop.OpRISCV64MOVBstore)
10889 v.AuxInt = ssa.Int32ToAuxInt(3)
10890 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
10891 v0.AuxInt = ssa.Int64ToAuxInt(0)
10892 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBstore, types.TypeMem)
10893 v1.AuxInt = ssa.Int32ToAuxInt(2)
10894 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBstore, types.TypeMem)
10895 v2.AuxInt = ssa.Int32ToAuxInt(1)
10896 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBstore, types.TypeMem)
10897 v3.AddArg3(ptr, v0, mem)
10898 v2.AddArg3(ptr, v0, v3)
10899 v1.AddArg3(ptr, v0, v2)
10900 v.AddArg3(ptr, v0, v1)
10901 return true
10902 }
10903
10904
10905
10906 for {
10907 if ssa.AuxIntToInt64(v.AuxInt) != 8 {
10908 break
10909 }
10910 t := ssa.AuxToType(v.Aux)
10911 ptr := v_0
10912 mem := v_1
10913 if !(t.Alignment()%8 == 0) {
10914 break
10915 }
10916 v.Reset(ssaop.OpRISCV64MOVDstore)
10917 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
10918 v0.AuxInt = ssa.Int64ToAuxInt(0)
10919 v.AddArg3(ptr, v0, mem)
10920 return true
10921 }
10922
10923
10924
10925 for {
10926 if ssa.AuxIntToInt64(v.AuxInt) != 8 {
10927 break
10928 }
10929 t := ssa.AuxToType(v.Aux)
10930 ptr := v_0
10931 mem := v_1
10932 if !(t.Alignment()%4 == 0) {
10933 break
10934 }
10935 v.Reset(ssaop.OpRISCV64MOVWstore)
10936 v.AuxInt = ssa.Int32ToAuxInt(4)
10937 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
10938 v0.AuxInt = ssa.Int64ToAuxInt(0)
10939 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVWstore, types.TypeMem)
10940 v1.AddArg3(ptr, v0, mem)
10941 v.AddArg3(ptr, v0, v1)
10942 return true
10943 }
10944
10945
10946
10947 for {
10948 if ssa.AuxIntToInt64(v.AuxInt) != 8 {
10949 break
10950 }
10951 t := ssa.AuxToType(v.Aux)
10952 ptr := v_0
10953 mem := v_1
10954 if !(t.Alignment()%2 == 0) {
10955 break
10956 }
10957 v.Reset(ssaop.OpRISCV64MOVHstore)
10958 v.AuxInt = ssa.Int32ToAuxInt(6)
10959 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
10960 v0.AuxInt = ssa.Int64ToAuxInt(0)
10961 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHstore, types.TypeMem)
10962 v1.AuxInt = ssa.Int32ToAuxInt(4)
10963 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHstore, types.TypeMem)
10964 v2.AuxInt = ssa.Int32ToAuxInt(2)
10965 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHstore, types.TypeMem)
10966 v3.AddArg3(ptr, v0, mem)
10967 v2.AddArg3(ptr, v0, v3)
10968 v1.AddArg3(ptr, v0, v2)
10969 v.AddArg3(ptr, v0, v1)
10970 return true
10971 }
10972
10973
10974 for {
10975 if ssa.AuxIntToInt64(v.AuxInt) != 3 {
10976 break
10977 }
10978 ptr := v_0
10979 mem := v_1
10980 v.Reset(ssaop.OpRISCV64MOVBstore)
10981 v.AuxInt = ssa.Int32ToAuxInt(2)
10982 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
10983 v0.AuxInt = ssa.Int64ToAuxInt(0)
10984 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBstore, types.TypeMem)
10985 v1.AuxInt = ssa.Int32ToAuxInt(1)
10986 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBstore, types.TypeMem)
10987 v2.AddArg3(ptr, v0, mem)
10988 v1.AddArg3(ptr, v0, v2)
10989 v.AddArg3(ptr, v0, v1)
10990 return true
10991 }
10992
10993
10994
10995 for {
10996 if ssa.AuxIntToInt64(v.AuxInt) != 6 {
10997 break
10998 }
10999 t := ssa.AuxToType(v.Aux)
11000 ptr := v_0
11001 mem := v_1
11002 if !(t.Alignment()%2 == 0) {
11003 break
11004 }
11005 v.Reset(ssaop.OpRISCV64MOVHstore)
11006 v.AuxInt = ssa.Int32ToAuxInt(4)
11007 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
11008 v0.AuxInt = ssa.Int64ToAuxInt(0)
11009 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHstore, types.TypeMem)
11010 v1.AuxInt = ssa.Int32ToAuxInt(2)
11011 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHstore, types.TypeMem)
11012 v2.AddArg3(ptr, v0, mem)
11013 v1.AddArg3(ptr, v0, v2)
11014 v.AddArg3(ptr, v0, v1)
11015 return true
11016 }
11017
11018
11019
11020 for {
11021 s := ssa.AuxIntToInt64(v.AuxInt)
11022 t := ssa.AuxToType(v.Aux)
11023 ptr := v_0
11024 mem := v_1
11025 if !(s <= 24*ssa.MoveSize(t.Alignment(), config)) {
11026 break
11027 }
11028 v.Reset(ssaop.OpRISCV64LoweredZero)
11029 v.AuxInt = ssa.ValAndOffToAuxInt(ssa.MakeValAndOff(int32(s), int32(t.Alignment())))
11030 v.AddArg2(ptr, mem)
11031 return true
11032 }
11033
11034
11035
11036 for {
11037 s := ssa.AuxIntToInt64(v.AuxInt)
11038 t := ssa.AuxToType(v.Aux)
11039 ptr := v_0
11040 mem := v_1
11041 if !(s > 24*ssa.MoveSize(t.Alignment(), config)) {
11042 break
11043 }
11044 v.Reset(ssaop.OpRISCV64LoweredZeroLoop)
11045 v.AuxInt = ssa.ValAndOffToAuxInt(ssa.MakeValAndOff(int32(s), int32(t.Alignment())))
11046 v.AddArg2(ptr, mem)
11047 return true
11048 }
11049 return false
11050 }
11051 func RewriteBlock(b *ssa.Block) bool {
11052 typ := &b.Func.Config.Types
11053 switch b.Kind {
11054 case block.BlockRISCV64BEQ:
11055
11056
11057 for b.Controls[0].Op == ssaop.OpRISCV64MOVDconst {
11058 v_0 := b.Controls[0]
11059 if ssa.AuxIntToInt64(v_0.AuxInt) != 0 {
11060 break
11061 }
11062 cond := b.Controls[1]
11063 b.ResetWithControl(block.BlockRISCV64BEQZ, cond)
11064 return true
11065 }
11066
11067
11068 for b.Controls[1].Op == ssaop.OpRISCV64MOVDconst {
11069 cond := b.Controls[0]
11070 v_1 := b.Controls[1]
11071 if ssa.AuxIntToInt64(v_1.AuxInt) != 0 {
11072 break
11073 }
11074 b.ResetWithControl(block.BlockRISCV64BEQZ, cond)
11075 return true
11076 }
11077 case block.BlockRISCV64BEQZ:
11078
11079
11080 for b.Controls[0].Op == ssaop.OpRISCV64SEQZ {
11081 v_0 := b.Controls[0]
11082 x := v_0.Args[0]
11083 b.ResetWithControl(block.BlockRISCV64BNEZ, x)
11084 return true
11085 }
11086
11087
11088 for b.Controls[0].Op == ssaop.OpRISCV64SNEZ {
11089 v_0 := b.Controls[0]
11090 x := v_0.Args[0]
11091 b.ResetWithControl(block.BlockRISCV64BEQZ, x)
11092 return true
11093 }
11094
11095
11096 for b.Controls[0].Op == ssaop.OpRISCV64NEG {
11097 v_0 := b.Controls[0]
11098 x := v_0.Args[0]
11099 b.ResetWithControl(block.BlockRISCV64BEQZ, x)
11100 return true
11101 }
11102
11103
11104 for b.Controls[0].Op == ssaop.OpRISCV64FNES {
11105 v_0 := b.Controls[0]
11106 t := v_0.Type
11107 _ = v_0.Args[1]
11108 v_0_0 := v_0.Args[0]
11109 v_0_1 := v_0.Args[1]
11110 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
11111 x := v_0_0
11112 y := v_0_1
11113 v0 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64FEQS, t)
11114 v0.AddArg2(x, y)
11115 b.ResetWithControl(block.BlockRISCV64BNEZ, v0)
11116 return true
11117 }
11118 }
11119
11120
11121 for b.Controls[0].Op == ssaop.OpRISCV64FNED {
11122 v_0 := b.Controls[0]
11123 t := v_0.Type
11124 _ = v_0.Args[1]
11125 v_0_0 := v_0.Args[0]
11126 v_0_1 := v_0.Args[1]
11127 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
11128 x := v_0_0
11129 y := v_0_1
11130 v0 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64FEQD, t)
11131 v0.AddArg2(x, y)
11132 b.ResetWithControl(block.BlockRISCV64BNEZ, v0)
11133 return true
11134 }
11135 }
11136
11137
11138 for b.Controls[0].Op == ssaop.OpRISCV64SUB {
11139 v_0 := b.Controls[0]
11140 y := v_0.Args[1]
11141 x := v_0.Args[0]
11142 b.ResetWithControl2(block.BlockRISCV64BEQ, x, y)
11143 return true
11144 }
11145
11146
11147 for b.Controls[0].Op == ssaop.OpRISCV64SLT {
11148 v_0 := b.Controls[0]
11149 y := v_0.Args[1]
11150 x := v_0.Args[0]
11151 b.ResetWithControl2(block.BlockRISCV64BGE, x, y)
11152 return true
11153 }
11154
11155
11156 for b.Controls[0].Op == ssaop.OpRISCV64SLTU {
11157 v_0 := b.Controls[0]
11158 y := v_0.Args[1]
11159 x := v_0.Args[0]
11160 b.ResetWithControl2(block.BlockRISCV64BGEU, x, y)
11161 return true
11162 }
11163
11164
11165 for b.Controls[0].Op == ssaop.OpRISCV64SLTI {
11166 v_0 := b.Controls[0]
11167 x := ssa.AuxIntToInt64(v_0.AuxInt)
11168 y := v_0.Args[0]
11169 v0 := b.NewValue0(b.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
11170 v0.AuxInt = ssa.Int64ToAuxInt(x)
11171 b.ResetWithControl2(block.BlockRISCV64BGE, y, v0)
11172 return true
11173 }
11174
11175
11176 for b.Controls[0].Op == ssaop.OpRISCV64SLTIU {
11177 v_0 := b.Controls[0]
11178 x := ssa.AuxIntToInt64(v_0.AuxInt)
11179 y := v_0.Args[0]
11180 v0 := b.NewValue0(b.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
11181 v0.AuxInt = ssa.Int64ToAuxInt(x)
11182 b.ResetWithControl2(block.BlockRISCV64BGEU, y, v0)
11183 return true
11184 }
11185
11186
11187 for b.Controls[0].Op == ssaop.OpRISCV64ANDI {
11188 v_0 := b.Controls[0]
11189 c := ssa.AuxIntToInt64(v_0.AuxInt)
11190 v_0_0 := v_0.Args[0]
11191 if v_0_0.Op != ssaop.OpRISCV64FCLASSD {
11192 break
11193 }
11194 v_0_0_0 := v_0_0.Args[0]
11195 if v_0_0_0.Op != ssaop.OpRISCV64FNEGD {
11196 break
11197 }
11198 x := v_0_0_0.Args[0]
11199 v0 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
11200 v0.AuxInt = ssa.Int64ToAuxInt((c & 0b11_0000_0000) | int64(bits.Reverse8(uint8(c))&0b1111_1111))
11201 v1 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
11202 v1.AddArg(x)
11203 v0.AddArg(v1)
11204 b.ResetWithControl(block.BlockRISCV64BEQZ, v0)
11205 return true
11206 }
11207
11208
11209 for b.Controls[0].Op == ssaop.OpRISCV64ANDI {
11210 v_0 := b.Controls[0]
11211 c := ssa.AuxIntToInt64(v_0.AuxInt)
11212 v_0_0 := v_0.Args[0]
11213 if v_0_0.Op != ssaop.OpRISCV64FCLASSD {
11214 break
11215 }
11216 v_0_0_0 := v_0_0.Args[0]
11217 if v_0_0_0.Op != ssaop.OpRISCV64FABSD {
11218 break
11219 }
11220 x := v_0_0_0.Args[0]
11221 v0 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
11222 v0.AuxInt = ssa.Int64ToAuxInt((c & 0b11_1111_0000) | int64(bits.Reverse8(uint8(c))&0b0000_1111))
11223 v1 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
11224 v1.AddArg(x)
11225 v0.AddArg(v1)
11226 b.ResetWithControl(block.BlockRISCV64BEQZ, v0)
11227 return true
11228 }
11229 case block.BlockRISCV64BGE:
11230
11231
11232 for b.Controls[0].Op == ssaop.OpRISCV64MOVDconst {
11233 v_0 := b.Controls[0]
11234 if ssa.AuxIntToInt64(v_0.AuxInt) != 0 {
11235 break
11236 }
11237 cond := b.Controls[1]
11238 b.ResetWithControl(block.BlockRISCV64BLEZ, cond)
11239 return true
11240 }
11241
11242
11243 for b.Controls[1].Op == ssaop.OpRISCV64MOVDconst {
11244 cond := b.Controls[0]
11245 v_1 := b.Controls[1]
11246 if ssa.AuxIntToInt64(v_1.AuxInt) != 0 {
11247 break
11248 }
11249 b.ResetWithControl(block.BlockRISCV64BGEZ, cond)
11250 return true
11251 }
11252 case block.BlockRISCV64BGEU:
11253
11254
11255 for b.Controls[0].Op == ssaop.OpRISCV64MOVDconst {
11256 v_0 := b.Controls[0]
11257 if ssa.AuxIntToInt64(v_0.AuxInt) != 0 {
11258 break
11259 }
11260 cond := b.Controls[1]
11261 b.ResetWithControl(block.BlockRISCV64BEQZ, cond)
11262 return true
11263 }
11264 case block.BlockRISCV64BLT:
11265
11266
11267 for b.Controls[0].Op == ssaop.OpRISCV64MOVDconst {
11268 v_0 := b.Controls[0]
11269 if ssa.AuxIntToInt64(v_0.AuxInt) != 0 {
11270 break
11271 }
11272 cond := b.Controls[1]
11273 b.ResetWithControl(block.BlockRISCV64BGTZ, cond)
11274 return true
11275 }
11276
11277
11278 for b.Controls[1].Op == ssaop.OpRISCV64MOVDconst {
11279 cond := b.Controls[0]
11280 v_1 := b.Controls[1]
11281 if ssa.AuxIntToInt64(v_1.AuxInt) != 0 {
11282 break
11283 }
11284 b.ResetWithControl(block.BlockRISCV64BLTZ, cond)
11285 return true
11286 }
11287 case block.BlockRISCV64BLTU:
11288
11289
11290 for b.Controls[0].Op == ssaop.OpRISCV64MOVDconst {
11291 v_0 := b.Controls[0]
11292 if ssa.AuxIntToInt64(v_0.AuxInt) != 0 {
11293 break
11294 }
11295 cond := b.Controls[1]
11296 b.ResetWithControl(block.BlockRISCV64BNEZ, cond)
11297 return true
11298 }
11299 case block.BlockRISCV64BNE:
11300
11301
11302 for b.Controls[0].Op == ssaop.OpRISCV64MOVDconst {
11303 v_0 := b.Controls[0]
11304 if ssa.AuxIntToInt64(v_0.AuxInt) != 0 {
11305 break
11306 }
11307 cond := b.Controls[1]
11308 b.ResetWithControl(block.BlockRISCV64BNEZ, cond)
11309 return true
11310 }
11311
11312
11313 for b.Controls[1].Op == ssaop.OpRISCV64MOVDconst {
11314 cond := b.Controls[0]
11315 v_1 := b.Controls[1]
11316 if ssa.AuxIntToInt64(v_1.AuxInt) != 0 {
11317 break
11318 }
11319 b.ResetWithControl(block.BlockRISCV64BNEZ, cond)
11320 return true
11321 }
11322 case block.BlockRISCV64BNEZ:
11323
11324
11325 for b.Controls[0].Op == ssaop.OpRISCV64SEQZ {
11326 v_0 := b.Controls[0]
11327 x := v_0.Args[0]
11328 b.ResetWithControl(block.BlockRISCV64BEQZ, x)
11329 return true
11330 }
11331
11332
11333 for b.Controls[0].Op == ssaop.OpRISCV64SNEZ {
11334 v_0 := b.Controls[0]
11335 x := v_0.Args[0]
11336 b.ResetWithControl(block.BlockRISCV64BNEZ, x)
11337 return true
11338 }
11339
11340
11341 for b.Controls[0].Op == ssaop.OpRISCV64NEG {
11342 v_0 := b.Controls[0]
11343 x := v_0.Args[0]
11344 b.ResetWithControl(block.BlockRISCV64BNEZ, x)
11345 return true
11346 }
11347
11348
11349 for b.Controls[0].Op == ssaop.OpRISCV64FNES {
11350 v_0 := b.Controls[0]
11351 t := v_0.Type
11352 _ = v_0.Args[1]
11353 v_0_0 := v_0.Args[0]
11354 v_0_1 := v_0.Args[1]
11355 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
11356 x := v_0_0
11357 y := v_0_1
11358 v0 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64FEQS, t)
11359 v0.AddArg2(x, y)
11360 b.ResetWithControl(block.BlockRISCV64BEQZ, v0)
11361 return true
11362 }
11363 }
11364
11365
11366 for b.Controls[0].Op == ssaop.OpRISCV64FNED {
11367 v_0 := b.Controls[0]
11368 t := v_0.Type
11369 _ = v_0.Args[1]
11370 v_0_0 := v_0.Args[0]
11371 v_0_1 := v_0.Args[1]
11372 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
11373 x := v_0_0
11374 y := v_0_1
11375 v0 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64FEQD, t)
11376 v0.AddArg2(x, y)
11377 b.ResetWithControl(block.BlockRISCV64BEQZ, v0)
11378 return true
11379 }
11380 }
11381
11382
11383 for b.Controls[0].Op == ssaop.OpRISCV64SUB {
11384 v_0 := b.Controls[0]
11385 y := v_0.Args[1]
11386 x := v_0.Args[0]
11387 b.ResetWithControl2(block.BlockRISCV64BNE, x, y)
11388 return true
11389 }
11390
11391
11392 for b.Controls[0].Op == ssaop.OpRISCV64SLT {
11393 v_0 := b.Controls[0]
11394 y := v_0.Args[1]
11395 x := v_0.Args[0]
11396 b.ResetWithControl2(block.BlockRISCV64BLT, x, y)
11397 return true
11398 }
11399
11400
11401 for b.Controls[0].Op == ssaop.OpRISCV64SLTU {
11402 v_0 := b.Controls[0]
11403 y := v_0.Args[1]
11404 x := v_0.Args[0]
11405 b.ResetWithControl2(block.BlockRISCV64BLTU, x, y)
11406 return true
11407 }
11408
11409
11410 for b.Controls[0].Op == ssaop.OpRISCV64SLTI {
11411 v_0 := b.Controls[0]
11412 x := ssa.AuxIntToInt64(v_0.AuxInt)
11413 y := v_0.Args[0]
11414 v0 := b.NewValue0(b.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
11415 v0.AuxInt = ssa.Int64ToAuxInt(x)
11416 b.ResetWithControl2(block.BlockRISCV64BLT, y, v0)
11417 return true
11418 }
11419
11420
11421 for b.Controls[0].Op == ssaop.OpRISCV64SLTIU {
11422 v_0 := b.Controls[0]
11423 x := ssa.AuxIntToInt64(v_0.AuxInt)
11424 y := v_0.Args[0]
11425 v0 := b.NewValue0(b.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
11426 v0.AuxInt = ssa.Int64ToAuxInt(x)
11427 b.ResetWithControl2(block.BlockRISCV64BLTU, y, v0)
11428 return true
11429 }
11430
11431
11432 for b.Controls[0].Op == ssaop.OpRISCV64ANDI {
11433 v_0 := b.Controls[0]
11434 c := ssa.AuxIntToInt64(v_0.AuxInt)
11435 v_0_0 := v_0.Args[0]
11436 if v_0_0.Op != ssaop.OpRISCV64FCLASSD {
11437 break
11438 }
11439 v_0_0_0 := v_0_0.Args[0]
11440 if v_0_0_0.Op != ssaop.OpRISCV64FNEGD {
11441 break
11442 }
11443 x := v_0_0_0.Args[0]
11444 v0 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
11445 v0.AuxInt = ssa.Int64ToAuxInt((c & 0b11_0000_0000) | int64(bits.Reverse8(uint8(c))&0b1111_1111))
11446 v1 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
11447 v1.AddArg(x)
11448 v0.AddArg(v1)
11449 b.ResetWithControl(block.BlockRISCV64BNEZ, v0)
11450 return true
11451 }
11452
11453
11454 for b.Controls[0].Op == ssaop.OpRISCV64ANDI {
11455 v_0 := b.Controls[0]
11456 c := ssa.AuxIntToInt64(v_0.AuxInt)
11457 v_0_0 := v_0.Args[0]
11458 if v_0_0.Op != ssaop.OpRISCV64FCLASSD {
11459 break
11460 }
11461 v_0_0_0 := v_0_0.Args[0]
11462 if v_0_0_0.Op != ssaop.OpRISCV64FABSD {
11463 break
11464 }
11465 x := v_0_0_0.Args[0]
11466 v0 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
11467 v0.AuxInt = ssa.Int64ToAuxInt((c & 0b11_1111_0000) | int64(bits.Reverse8(uint8(c))&0b0000_1111))
11468 v1 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
11469 v1.AddArg(x)
11470 v0.AddArg(v1)
11471 b.ResetWithControl(block.BlockRISCV64BNEZ, v0)
11472 return true
11473 }
11474 case block.BlockIf:
11475
11476
11477 for {
11478 cond := b.Controls[0]
11479 v0 := b.NewValue0(cond.Pos, ssaop.OpRISCV64MOVBUreg, typ.UInt64)
11480 v0.AddArg(cond)
11481 b.ResetWithControl(block.BlockRISCV64BNEZ, v0)
11482 return true
11483 }
11484 case block.BlockJumpTable:
11485
11486
11487 for {
11488 idx := b.Controls[0]
11489 v0 := b.NewValue0(b.Pos, ssaop.OpRISCV64MOVaddr, typ.Uintptr)
11490 v0.Aux = ssa.SymToAux(ssa.MakeJumpTableSym(b))
11491 v1 := b.NewValue0(b.Pos, ssaop.OpSB, typ.Uintptr)
11492 v0.AddArg(v1)
11493 b.ResetWithControl2(block.BlockRISCV64JUMPTABLE, idx, v0)
11494 b.Aux = ssa.SymToAux(ssa.MakeJumpTableSym(b))
11495 return true
11496 }
11497 }
11498 return false
11499 }
11500
View as plain text