1
2
3 package riscv64
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.OpRISCV64SLLW, 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(32)
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.OpRISCV64SLLW)
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.OpRISCV64SLLW, 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(32)
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.OpRISCV64SLLW)
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.OpRISCV64SLLW, 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(32)
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.OpRISCV64SLLW)
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.OpRISCV64SLLW, 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(32)
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.OpRISCV64SLLW)
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.Int64ToAuxInt(s)
3136 v.Aux = ssa.Int64ToAux(t.Alignment())
3137 v.AddArg3(dst, src, mem)
3138 return true
3139 }
3140
3141
3142
3143 for {
3144 s := ssa.AuxIntToInt64(v.AuxInt)
3145 t := ssa.AuxToType(v.Aux)
3146 dst := v_0
3147 src := v_1
3148 mem := v_2
3149 if !(s > 3*8*ssa.MoveSize(t.Alignment(), config) && ssa.LogLargeCopyValue(v, s)) {
3150 break
3151 }
3152 v.Reset(ssaop.OpRISCV64LoweredMoveLoop)
3153 v.AuxInt = ssa.Int64ToAuxInt(s)
3154 v.Aux = ssa.Int64ToAux(t.Alignment())
3155 v.AddArg3(dst, src, mem)
3156 return true
3157 }
3158 return false
3159 }
3160 func rewriteValue_OpNeq16(v *ssa.Value) bool {
3161 v_1 := v.Args[1]
3162 v_0 := v.Args[0]
3163 b := v.Block
3164 typ := &b.Func.Config.Types
3165
3166
3167 for {
3168 x := v_0
3169 y := v_1
3170 v.Reset(ssaop.OpNot)
3171 v0 := b.NewValue0(v.Pos, ssaop.OpEq16, typ.Bool)
3172 v0.AddArg2(x, y)
3173 v.AddArg(v0)
3174 return true
3175 }
3176 }
3177 func rewriteValue_OpNeq32(v *ssa.Value) bool {
3178 v_1 := v.Args[1]
3179 v_0 := v.Args[0]
3180 b := v.Block
3181 typ := &b.Func.Config.Types
3182
3183
3184 for {
3185 x := v_0
3186 y := v_1
3187 v.Reset(ssaop.OpNot)
3188 v0 := b.NewValue0(v.Pos, ssaop.OpEq32, typ.Bool)
3189 v0.AddArg2(x, y)
3190 v.AddArg(v0)
3191 return true
3192 }
3193 }
3194 func rewriteValue_OpNeq64(v *ssa.Value) bool {
3195 v_1 := v.Args[1]
3196 v_0 := v.Args[0]
3197 b := v.Block
3198 typ := &b.Func.Config.Types
3199
3200
3201 for {
3202 x := v_0
3203 y := v_1
3204 v.Reset(ssaop.OpNot)
3205 v0 := b.NewValue0(v.Pos, ssaop.OpEq64, typ.Bool)
3206 v0.AddArg2(x, y)
3207 v.AddArg(v0)
3208 return true
3209 }
3210 }
3211 func rewriteValue_OpNeq8(v *ssa.Value) bool {
3212 v_1 := v.Args[1]
3213 v_0 := v.Args[0]
3214 b := v.Block
3215 typ := &b.Func.Config.Types
3216
3217
3218 for {
3219 x := v_0
3220 y := v_1
3221 v.Reset(ssaop.OpNot)
3222 v0 := b.NewValue0(v.Pos, ssaop.OpEq8, typ.Bool)
3223 v0.AddArg2(x, y)
3224 v.AddArg(v0)
3225 return true
3226 }
3227 }
3228 func rewriteValue_OpNeqB(v *ssa.Value) bool {
3229 v_1 := v.Args[1]
3230 v_0 := v.Args[0]
3231 b := v.Block
3232 typ := &b.Func.Config.Types
3233
3234
3235 for {
3236 x := v_0
3237 y := v_1
3238 v.Reset(ssaop.OpRISCV64SNEZ)
3239 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SUB, typ.Bool)
3240 v0.AddArg2(x, y)
3241 v.AddArg(v0)
3242 return true
3243 }
3244 }
3245 func rewriteValue_OpNeqPtr(v *ssa.Value) bool {
3246 v_1 := v.Args[1]
3247 v_0 := v.Args[0]
3248 b := v.Block
3249 typ := &b.Func.Config.Types
3250
3251
3252 for {
3253 x := v_0
3254 y := v_1
3255 v.Reset(ssaop.OpNot)
3256 v0 := b.NewValue0(v.Pos, ssaop.OpEqPtr, typ.Bool)
3257 v0.AddArg2(x, y)
3258 v.AddArg(v0)
3259 return true
3260 }
3261 }
3262 func rewriteValue_OpOffPtr(v *ssa.Value) bool {
3263 v_0 := v.Args[0]
3264 b := v.Block
3265 typ := &b.Func.Config.Types
3266
3267
3268
3269 for {
3270 off := ssa.AuxIntToInt64(v.AuxInt)
3271 ptr := v_0
3272 if ptr.Op != ssaop.OpSP || !(ssa.Is32Bit(off)) {
3273 break
3274 }
3275 v.Reset(ssaop.OpRISCV64MOVaddr)
3276 v.AuxInt = ssa.Int32ToAuxInt(int32(off))
3277 v.AddArg(ptr)
3278 return true
3279 }
3280
3281
3282
3283 for {
3284 off := ssa.AuxIntToInt64(v.AuxInt)
3285 ptr := v_0
3286 if !(ssa.Is32Bit(off)) {
3287 break
3288 }
3289 v.Reset(ssaop.OpRISCV64ADDI)
3290 v.AuxInt = ssa.Int64ToAuxInt(off)
3291 v.AddArg(ptr)
3292 return true
3293 }
3294
3295
3296 for {
3297 off := ssa.AuxIntToInt64(v.AuxInt)
3298 ptr := v_0
3299 v.Reset(ssaop.OpRISCV64ADD)
3300 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
3301 v0.AuxInt = ssa.Int64ToAuxInt(off)
3302 v.AddArg2(v0, ptr)
3303 return true
3304 }
3305 }
3306 func rewriteValue_OpPopCount16(v *ssa.Value) bool {
3307 v_0 := v.Args[0]
3308 b := v.Block
3309 typ := &b.Func.Config.Types
3310
3311
3312 for {
3313 x := v_0
3314 v.Reset(ssaop.OpRISCV64CPOP)
3315 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
3316 v0.AddArg(x)
3317 v.AddArg(v0)
3318 return true
3319 }
3320 }
3321 func rewriteValue_OpPopCount8(v *ssa.Value) bool {
3322 v_0 := v.Args[0]
3323 b := v.Block
3324 typ := &b.Func.Config.Types
3325
3326
3327 for {
3328 x := v_0
3329 v.Reset(ssaop.OpRISCV64CPOP)
3330 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
3331 v0.AddArg(x)
3332 v.AddArg(v0)
3333 return true
3334 }
3335 }
3336 func rewriteValue_OpRISCV64ADD(v *ssa.Value) bool {
3337 v_1 := v.Args[1]
3338 v_0 := v.Args[0]
3339
3340
3341
3342 for {
3343 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3344 if v_0.Op != ssaop.OpRISCV64MOVDconst {
3345 continue
3346 }
3347 t := v_0.Type
3348 val := ssa.AuxIntToInt64(v_0.AuxInt)
3349 x := v_1
3350 if !(ssa.Is32Bit(val) && !t.IsPtr()) {
3351 continue
3352 }
3353 v.Reset(ssaop.OpRISCV64ADDI)
3354 v.AuxInt = ssa.Int64ToAuxInt(val)
3355 v.AddArg(x)
3356 return true
3357 }
3358 break
3359 }
3360
3361
3362 for {
3363 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3364 x := v_0
3365 if v_1.Op != ssaop.OpRISCV64NEG {
3366 continue
3367 }
3368 y := v_1.Args[0]
3369 v.Reset(ssaop.OpRISCV64SUB)
3370 v.AddArg2(x, y)
3371 return true
3372 }
3373 break
3374 }
3375
3376
3377
3378 for {
3379 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3380 if v_0.Op != ssaop.OpRISCV64SLLI || ssa.AuxIntToInt64(v_0.AuxInt) != 1 {
3381 continue
3382 }
3383 x := v_0.Args[0]
3384 y := v_1
3385 if !(buildcfg.GORISCV64 >= 22) {
3386 continue
3387 }
3388 v.Reset(ssaop.OpRISCV64SH1ADD)
3389 v.AddArg2(x, y)
3390 return true
3391 }
3392 break
3393 }
3394
3395
3396
3397 for {
3398 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3399 if v_0.Op != ssaop.OpRISCV64SLLI || ssa.AuxIntToInt64(v_0.AuxInt) != 2 {
3400 continue
3401 }
3402 x := v_0.Args[0]
3403 y := v_1
3404 if !(buildcfg.GORISCV64 >= 22) {
3405 continue
3406 }
3407 v.Reset(ssaop.OpRISCV64SH2ADD)
3408 v.AddArg2(x, y)
3409 return true
3410 }
3411 break
3412 }
3413
3414
3415
3416 for {
3417 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3418 if v_0.Op != ssaop.OpRISCV64SLLI || ssa.AuxIntToInt64(v_0.AuxInt) != 3 {
3419 continue
3420 }
3421 x := v_0.Args[0]
3422 y := v_1
3423 if !(buildcfg.GORISCV64 >= 22) {
3424 continue
3425 }
3426 v.Reset(ssaop.OpRISCV64SH3ADD)
3427 v.AddArg2(x, y)
3428 return true
3429 }
3430 break
3431 }
3432 return false
3433 }
3434 func rewriteValue_OpRISCV64ADDI(v *ssa.Value) bool {
3435 v_0 := v.Args[0]
3436
3437
3438
3439 for {
3440 c := ssa.AuxIntToInt64(v.AuxInt)
3441 if v_0.Op != ssaop.OpRISCV64MOVaddr {
3442 break
3443 }
3444 d := ssa.AuxIntToInt32(v_0.AuxInt)
3445 s := ssa.AuxToSym(v_0.Aux)
3446 x := v_0.Args[0]
3447 if !(ssa.Is32Bit(c + int64(d))) {
3448 break
3449 }
3450 v.Reset(ssaop.OpRISCV64MOVaddr)
3451 v.AuxInt = ssa.Int32ToAuxInt(int32(c) + d)
3452 v.Aux = ssa.SymToAux(s)
3453 v.AddArg(x)
3454 return true
3455 }
3456
3457
3458 for {
3459 if ssa.AuxIntToInt64(v.AuxInt) != 0 {
3460 break
3461 }
3462 x := v_0
3463 v.CopyOf(x)
3464 return true
3465 }
3466
3467
3468
3469 for {
3470 x := ssa.AuxIntToInt64(v.AuxInt)
3471 if v_0.Op != ssaop.OpRISCV64MOVDconst {
3472 break
3473 }
3474 y := ssa.AuxIntToInt64(v_0.AuxInt)
3475 if !(ssa.Is32Bit(x + y)) {
3476 break
3477 }
3478 v.Reset(ssaop.OpRISCV64MOVDconst)
3479 v.AuxInt = ssa.Int64ToAuxInt(x + y)
3480 return true
3481 }
3482
3483
3484
3485 for {
3486 x := ssa.AuxIntToInt64(v.AuxInt)
3487 if v_0.Op != ssaop.OpRISCV64ADDI {
3488 break
3489 }
3490 y := ssa.AuxIntToInt64(v_0.AuxInt)
3491 z := v_0.Args[0]
3492 if !(ssa.Is32Bit(x + y)) {
3493 break
3494 }
3495 v.Reset(ssaop.OpRISCV64ADDI)
3496 v.AuxInt = ssa.Int64ToAuxInt(x + y)
3497 v.AddArg(z)
3498 return true
3499 }
3500 return false
3501 }
3502 func rewriteValue_OpRISCV64AND(v *ssa.Value) bool {
3503 v_1 := v.Args[1]
3504 v_0 := v.Args[0]
3505
3506
3507
3508 for {
3509 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3510 if v_0.Op != ssaop.OpRISCV64MOVDconst {
3511 continue
3512 }
3513 val := ssa.AuxIntToInt64(v_0.AuxInt)
3514 x := v_1
3515 if !(ssa.Is32Bit(val)) {
3516 continue
3517 }
3518 v.Reset(ssaop.OpRISCV64ANDI)
3519 v.AuxInt = ssa.Int64ToAuxInt(val)
3520 v.AddArg(x)
3521 return true
3522 }
3523 break
3524 }
3525
3526
3527 for {
3528 x := v_0
3529 if x != v_1 {
3530 break
3531 }
3532 v.CopyOf(x)
3533 return true
3534 }
3535 return false
3536 }
3537 func rewriteValue_OpRISCV64ANDI(v *ssa.Value) bool {
3538 v_0 := v.Args[0]
3539
3540
3541 for {
3542 if ssa.AuxIntToInt64(v.AuxInt) != 0 {
3543 break
3544 }
3545 v.Reset(ssaop.OpRISCV64MOVDconst)
3546 v.AuxInt = ssa.Int64ToAuxInt(0)
3547 return true
3548 }
3549
3550
3551 for {
3552 if ssa.AuxIntToInt64(v.AuxInt) != -1 {
3553 break
3554 }
3555 x := v_0
3556 v.CopyOf(x)
3557 return true
3558 }
3559
3560
3561 for {
3562 x := ssa.AuxIntToInt64(v.AuxInt)
3563 if v_0.Op != ssaop.OpRISCV64MOVDconst {
3564 break
3565 }
3566 y := ssa.AuxIntToInt64(v_0.AuxInt)
3567 v.Reset(ssaop.OpRISCV64MOVDconst)
3568 v.AuxInt = ssa.Int64ToAuxInt(x & y)
3569 return true
3570 }
3571
3572
3573 for {
3574 x := ssa.AuxIntToInt64(v.AuxInt)
3575 if v_0.Op != ssaop.OpRISCV64ANDI {
3576 break
3577 }
3578 y := ssa.AuxIntToInt64(v_0.AuxInt)
3579 z := v_0.Args[0]
3580 v.Reset(ssaop.OpRISCV64ANDI)
3581 v.AuxInt = ssa.Int64ToAuxInt(x & y)
3582 v.AddArg(z)
3583 return true
3584 }
3585 return false
3586 }
3587 func rewriteValue_OpRISCV64CZEROEQZ(v *ssa.Value) bool {
3588 v_1 := v.Args[1]
3589 v_0 := v.Args[0]
3590
3591
3592 for {
3593 x := v_0
3594 if v_1.Op != ssaop.OpRISCV64SNEZ {
3595 break
3596 }
3597 y := v_1.Args[0]
3598 v.Reset(ssaop.OpRISCV64CZEROEQZ)
3599 v.AddArg2(x, y)
3600 return true
3601 }
3602
3603
3604 for {
3605 x := v_0
3606 if v_1.Op != ssaop.OpRISCV64SEQZ {
3607 break
3608 }
3609 y := v_1.Args[0]
3610 v.Reset(ssaop.OpRISCV64CZERONEZ)
3611 v.AddArg2(x, y)
3612 return true
3613 }
3614
3615
3616 for {
3617 x := v_0
3618 if v_1.Op != ssaop.OpRISCV64NEG {
3619 break
3620 }
3621 y := v_1.Args[0]
3622 v.Reset(ssaop.OpRISCV64CZEROEQZ)
3623 v.AddArg2(x, y)
3624 return true
3625 }
3626
3627
3628 for {
3629 x := v_0
3630 if x != v_1 {
3631 break
3632 }
3633 v.CopyOf(x)
3634 return true
3635 }
3636
3637
3638 for {
3639 if v_0.Op != ssaop.OpRISCV64MOVDconst || ssa.AuxIntToInt64(v_0.AuxInt) != 0 {
3640 break
3641 }
3642 v.Reset(ssaop.OpRISCV64MOVDconst)
3643 v.AuxInt = ssa.Int64ToAuxInt(0)
3644 return true
3645 }
3646 return false
3647 }
3648 func rewriteValue_OpRISCV64CZERONEZ(v *ssa.Value) bool {
3649 v_1 := v.Args[1]
3650 v_0 := v.Args[0]
3651
3652
3653 for {
3654 x := v_0
3655 if v_1.Op != ssaop.OpRISCV64SNEZ {
3656 break
3657 }
3658 y := v_1.Args[0]
3659 v.Reset(ssaop.OpRISCV64CZERONEZ)
3660 v.AddArg2(x, y)
3661 return true
3662 }
3663
3664
3665 for {
3666 x := v_0
3667 if v_1.Op != ssaop.OpRISCV64SEQZ {
3668 break
3669 }
3670 y := v_1.Args[0]
3671 v.Reset(ssaop.OpRISCV64CZEROEQZ)
3672 v.AddArg2(x, y)
3673 return true
3674 }
3675
3676
3677 for {
3678 x := v_0
3679 if v_1.Op != ssaop.OpRISCV64NEG {
3680 break
3681 }
3682 y := v_1.Args[0]
3683 v.Reset(ssaop.OpRISCV64CZERONEZ)
3684 v.AddArg2(x, y)
3685 return true
3686 }
3687
3688
3689 for {
3690 x := v_0
3691 if x != v_1 {
3692 break
3693 }
3694 v.Reset(ssaop.OpRISCV64MOVDconst)
3695 v.AuxInt = ssa.Int64ToAuxInt(0)
3696 return true
3697 }
3698
3699
3700 for {
3701 if v_0.Op != ssaop.OpRISCV64MOVDconst || ssa.AuxIntToInt64(v_0.AuxInt) != 0 {
3702 break
3703 }
3704 v.Reset(ssaop.OpRISCV64MOVDconst)
3705 v.AuxInt = ssa.Int64ToAuxInt(0)
3706 return true
3707 }
3708 return false
3709 }
3710 func rewriteValue_OpRISCV64FADDD(v *ssa.Value) bool {
3711 v_1 := v.Args[1]
3712 v_0 := v.Args[0]
3713
3714
3715
3716 for {
3717 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3718 a := v_0
3719 if v_1.Op != ssaop.OpRISCV64FMULD {
3720 continue
3721 }
3722 y := v_1.Args[1]
3723 x := v_1.Args[0]
3724 if !(a.Block.Func.UseFMA(v)) {
3725 continue
3726 }
3727 v.Reset(ssaop.OpRISCV64FMADDD)
3728 v.AddArg3(x, y, a)
3729 return true
3730 }
3731 break
3732 }
3733 return false
3734 }
3735 func rewriteValue_OpRISCV64FADDS(v *ssa.Value) bool {
3736 v_1 := v.Args[1]
3737 v_0 := v.Args[0]
3738
3739
3740
3741 for {
3742 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3743 a := v_0
3744 if v_1.Op != ssaop.OpRISCV64FMULS {
3745 continue
3746 }
3747 y := v_1.Args[1]
3748 x := v_1.Args[0]
3749 if !(a.Block.Func.UseFMA(v)) {
3750 continue
3751 }
3752 v.Reset(ssaop.OpRISCV64FMADDS)
3753 v.AddArg3(x, y, a)
3754 return true
3755 }
3756 break
3757 }
3758 return false
3759 }
3760 func rewriteValue_OpRISCV64FCVTSD(v *ssa.Value) bool {
3761 v_0 := v.Args[0]
3762
3763
3764 for {
3765 if v_0.Op != ssaop.OpRISCV64FABSD {
3766 break
3767 }
3768 v_0_0 := v_0.Args[0]
3769 if v_0_0.Op != ssaop.OpRISCV64FCVTDS {
3770 break
3771 }
3772 X := v_0_0.Args[0]
3773 v.Reset(ssaop.OpRISCV64FABSS)
3774 v.AddArg(X)
3775 return true
3776 }
3777
3778
3779 for {
3780 if v_0.Op != ssaop.OpRISCV64FSQRTD {
3781 break
3782 }
3783 v_0_0 := v_0.Args[0]
3784 if v_0_0.Op != ssaop.OpRISCV64FCVTDS {
3785 break
3786 }
3787 X := v_0_0.Args[0]
3788 v.Reset(ssaop.OpRISCV64FSQRTS)
3789 v.AddArg(X)
3790 return true
3791 }
3792 return false
3793 }
3794 func rewriteValue_OpRISCV64FEQD(v *ssa.Value) bool {
3795 v_1 := v.Args[1]
3796 v_0 := v.Args[0]
3797 b := v.Block
3798 typ := &b.Func.Config.Types
3799
3800
3801 for {
3802 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3803 x := v_0
3804 if v_1.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_1.AuxInt) != math.Inf(-1) {
3805 continue
3806 }
3807 v.Reset(ssaop.OpRISCV64ANDI)
3808 v.AuxInt = ssa.Int64ToAuxInt(0b00_0000_0001)
3809 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
3810 v0.AddArg(x)
3811 v.AddArg(v0)
3812 return true
3813 }
3814 break
3815 }
3816
3817
3818 for {
3819 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3820 x := v_0
3821 if v_1.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_1.AuxInt) != math.Inf(1) {
3822 continue
3823 }
3824 v.Reset(ssaop.OpRISCV64SNEZ)
3825 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
3826 v0.AuxInt = ssa.Int64ToAuxInt(0b00_1000_0000)
3827 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
3828 v1.AddArg(x)
3829 v0.AddArg(v1)
3830 v.AddArg(v0)
3831 return true
3832 }
3833 break
3834 }
3835 return false
3836 }
3837 func rewriteValue_OpRISCV64FLED(v *ssa.Value) bool {
3838 v_1 := v.Args[1]
3839 v_0 := v.Args[0]
3840 b := v.Block
3841 typ := &b.Func.Config.Types
3842
3843
3844 for {
3845 if v_0.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_0.AuxInt) != -math.MaxFloat64 {
3846 break
3847 }
3848 x := v_1
3849 v.Reset(ssaop.OpRISCV64SNEZ)
3850 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
3851 v0.AuxInt = ssa.Int64ToAuxInt(0b00_1111_1110)
3852 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
3853 v1.AddArg(x)
3854 v0.AddArg(v1)
3855 v.AddArg(v0)
3856 return true
3857 }
3858
3859
3860 for {
3861 x := v_0
3862 if v_1.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_1.AuxInt) != math.MaxFloat64 {
3863 break
3864 }
3865 v.Reset(ssaop.OpRISCV64SNEZ)
3866 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
3867 v0.AuxInt = ssa.Int64ToAuxInt(0b00_0111_1111)
3868 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
3869 v1.AddArg(x)
3870 v0.AddArg(v1)
3871 v.AddArg(v0)
3872 return true
3873 }
3874
3875
3876 for {
3877 if v_0.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_0.AuxInt) != +0x1p-1022 {
3878 break
3879 }
3880 x := v_1
3881 v.Reset(ssaop.OpRISCV64SNEZ)
3882 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
3883 v0.AuxInt = ssa.Int64ToAuxInt(0b00_1100_0000)
3884 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
3885 v1.AddArg(x)
3886 v0.AddArg(v1)
3887 v.AddArg(v0)
3888 return true
3889 }
3890
3891
3892 for {
3893 x := v_0
3894 if v_1.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_1.AuxInt) != -0x1p-1022 {
3895 break
3896 }
3897 v.Reset(ssaop.OpRISCV64SNEZ)
3898 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
3899 v0.AuxInt = ssa.Int64ToAuxInt(0b00_0000_0011)
3900 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
3901 v1.AddArg(x)
3902 v0.AddArg(v1)
3903 v.AddArg(v0)
3904 return true
3905 }
3906 return false
3907 }
3908 func rewriteValue_OpRISCV64FLTD(v *ssa.Value) bool {
3909 v_1 := v.Args[1]
3910 v_0 := v.Args[0]
3911 b := v.Block
3912 typ := &b.Func.Config.Types
3913
3914
3915 for {
3916 x := v_0
3917 if v_1.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_1.AuxInt) != -math.MaxFloat64 {
3918 break
3919 }
3920 v.Reset(ssaop.OpRISCV64ANDI)
3921 v.AuxInt = ssa.Int64ToAuxInt(0b00_0000_0001)
3922 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
3923 v0.AddArg(x)
3924 v.AddArg(v0)
3925 return true
3926 }
3927
3928
3929 for {
3930 if v_0.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_0.AuxInt) != math.MaxFloat64 {
3931 break
3932 }
3933 x := v_1
3934 v.Reset(ssaop.OpRISCV64SNEZ)
3935 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
3936 v0.AuxInt = ssa.Int64ToAuxInt(0b00_1000_0000)
3937 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
3938 v1.AddArg(x)
3939 v0.AddArg(v1)
3940 v.AddArg(v0)
3941 return true
3942 }
3943
3944
3945 for {
3946 x := v_0
3947 if v_1.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_1.AuxInt) != +0x1p-1022 {
3948 break
3949 }
3950 v.Reset(ssaop.OpRISCV64SNEZ)
3951 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
3952 v0.AuxInt = ssa.Int64ToAuxInt(0b00_0011_1111)
3953 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
3954 v1.AddArg(x)
3955 v0.AddArg(v1)
3956 v.AddArg(v0)
3957 return true
3958 }
3959
3960
3961 for {
3962 if v_0.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_0.AuxInt) != -0x1p-1022 {
3963 break
3964 }
3965 x := v_1
3966 v.Reset(ssaop.OpRISCV64SNEZ)
3967 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
3968 v0.AuxInt = ssa.Int64ToAuxInt(0b00_1111_1100)
3969 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
3970 v1.AddArg(x)
3971 v0.AddArg(v1)
3972 v.AddArg(v0)
3973 return true
3974 }
3975 return false
3976 }
3977 func rewriteValue_OpRISCV64FMADDD(v *ssa.Value) bool {
3978 v_2 := v.Args[2]
3979 v_1 := v.Args[1]
3980 v_0 := v.Args[0]
3981
3982
3983
3984 for {
3985 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3986 neg := v_0
3987 if neg.Op != ssaop.OpRISCV64FNEGD {
3988 continue
3989 }
3990 x := neg.Args[0]
3991 y := v_1
3992 z := v_2
3993 if !(neg.Uses == 1) {
3994 continue
3995 }
3996 v.Reset(ssaop.OpRISCV64FNMSUBD)
3997 v.AddArg3(x, y, z)
3998 return true
3999 }
4000 break
4001 }
4002
4003
4004
4005 for {
4006 x := v_0
4007 y := v_1
4008 neg := v_2
4009 if neg.Op != ssaop.OpRISCV64FNEGD {
4010 break
4011 }
4012 z := neg.Args[0]
4013 if !(neg.Uses == 1) {
4014 break
4015 }
4016 v.Reset(ssaop.OpRISCV64FMSUBD)
4017 v.AddArg3(x, y, z)
4018 return true
4019 }
4020 return false
4021 }
4022 func rewriteValue_OpRISCV64FMADDS(v *ssa.Value) bool {
4023 v_2 := v.Args[2]
4024 v_1 := v.Args[1]
4025 v_0 := v.Args[0]
4026
4027
4028
4029 for {
4030 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4031 neg := v_0
4032 if neg.Op != ssaop.OpRISCV64FNEGS {
4033 continue
4034 }
4035 x := neg.Args[0]
4036 y := v_1
4037 z := v_2
4038 if !(neg.Uses == 1) {
4039 continue
4040 }
4041 v.Reset(ssaop.OpRISCV64FNMSUBS)
4042 v.AddArg3(x, y, z)
4043 return true
4044 }
4045 break
4046 }
4047
4048
4049
4050 for {
4051 x := v_0
4052 y := v_1
4053 neg := v_2
4054 if neg.Op != ssaop.OpRISCV64FNEGS {
4055 break
4056 }
4057 z := neg.Args[0]
4058 if !(neg.Uses == 1) {
4059 break
4060 }
4061 v.Reset(ssaop.OpRISCV64FMSUBS)
4062 v.AddArg3(x, y, z)
4063 return true
4064 }
4065 return false
4066 }
4067 func rewriteValue_OpRISCV64FMOVDload(v *ssa.Value) bool {
4068 v_1 := v.Args[1]
4069 v_0 := v.Args[0]
4070 b := v.Block
4071 config := b.Func.Config
4072
4073
4074
4075 for {
4076 off1 := ssa.AuxIntToInt32(v.AuxInt)
4077 sym1 := ssa.AuxToSym(v.Aux)
4078 if v_0.Op != ssaop.OpRISCV64MOVaddr {
4079 break
4080 }
4081 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
4082 sym2 := ssa.AuxToSym(v_0.Aux)
4083 base := v_0.Args[0]
4084 mem := v_1
4085 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
4086 break
4087 }
4088 v.Reset(ssaop.OpRISCV64FMOVDload)
4089 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
4090 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
4091 v.AddArg2(base, mem)
4092 return true
4093 }
4094
4095
4096
4097 for {
4098 off1 := ssa.AuxIntToInt32(v.AuxInt)
4099 sym := ssa.AuxToSym(v.Aux)
4100 if v_0.Op != ssaop.OpRISCV64ADDI {
4101 break
4102 }
4103 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
4104 base := v_0.Args[0]
4105 mem := v_1
4106 if !(ssa.Is32Bit(int64(off1) + off2)) {
4107 break
4108 }
4109 v.Reset(ssaop.OpRISCV64FMOVDload)
4110 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
4111 v.Aux = ssa.SymToAux(sym)
4112 v.AddArg2(base, mem)
4113 return true
4114 }
4115
4116
4117
4118 for {
4119 off := ssa.AuxIntToInt32(v.AuxInt)
4120 sym := ssa.AuxToSym(v.Aux)
4121 ptr1 := v_0
4122 if v_1.Op != ssaop.OpRISCV64MOVDstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
4123 break
4124 }
4125 x := v_1.Args[1]
4126 ptr2 := v_1.Args[0]
4127 if !(ssa.IsSamePtr(ptr1, ptr2)) {
4128 break
4129 }
4130 v.Reset(ssaop.OpRISCV64FMVDX)
4131 v.AddArg(x)
4132 return true
4133 }
4134 return false
4135 }
4136 func rewriteValue_OpRISCV64FMOVDstore(v *ssa.Value) bool {
4137 v_2 := v.Args[2]
4138 v_1 := v.Args[1]
4139 v_0 := v.Args[0]
4140 b := v.Block
4141 config := b.Func.Config
4142
4143
4144
4145 for {
4146 off1 := ssa.AuxIntToInt32(v.AuxInt)
4147 sym1 := ssa.AuxToSym(v.Aux)
4148 if v_0.Op != ssaop.OpRISCV64MOVaddr {
4149 break
4150 }
4151 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
4152 sym2 := ssa.AuxToSym(v_0.Aux)
4153 base := v_0.Args[0]
4154 val := v_1
4155 mem := v_2
4156 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
4157 break
4158 }
4159 v.Reset(ssaop.OpRISCV64FMOVDstore)
4160 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
4161 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
4162 v.AddArg3(base, val, mem)
4163 return true
4164 }
4165
4166
4167
4168 for {
4169 off1 := ssa.AuxIntToInt32(v.AuxInt)
4170 sym := ssa.AuxToSym(v.Aux)
4171 if v_0.Op != ssaop.OpRISCV64ADDI {
4172 break
4173 }
4174 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
4175 base := v_0.Args[0]
4176 val := v_1
4177 mem := v_2
4178 if !(ssa.Is32Bit(int64(off1) + off2)) {
4179 break
4180 }
4181 v.Reset(ssaop.OpRISCV64FMOVDstore)
4182 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
4183 v.Aux = ssa.SymToAux(sym)
4184 v.AddArg3(base, val, mem)
4185 return true
4186 }
4187 return false
4188 }
4189 func rewriteValue_OpRISCV64FMOVWload(v *ssa.Value) bool {
4190 v_1 := v.Args[1]
4191 v_0 := v.Args[0]
4192 b := v.Block
4193 config := b.Func.Config
4194
4195
4196
4197 for {
4198 off1 := ssa.AuxIntToInt32(v.AuxInt)
4199 sym1 := ssa.AuxToSym(v.Aux)
4200 if v_0.Op != ssaop.OpRISCV64MOVaddr {
4201 break
4202 }
4203 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
4204 sym2 := ssa.AuxToSym(v_0.Aux)
4205 base := v_0.Args[0]
4206 mem := v_1
4207 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
4208 break
4209 }
4210 v.Reset(ssaop.OpRISCV64FMOVWload)
4211 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
4212 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
4213 v.AddArg2(base, mem)
4214 return true
4215 }
4216
4217
4218
4219 for {
4220 off1 := ssa.AuxIntToInt32(v.AuxInt)
4221 sym := ssa.AuxToSym(v.Aux)
4222 if v_0.Op != ssaop.OpRISCV64ADDI {
4223 break
4224 }
4225 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
4226 base := v_0.Args[0]
4227 mem := v_1
4228 if !(ssa.Is32Bit(int64(off1) + off2)) {
4229 break
4230 }
4231 v.Reset(ssaop.OpRISCV64FMOVWload)
4232 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
4233 v.Aux = ssa.SymToAux(sym)
4234 v.AddArg2(base, mem)
4235 return true
4236 }
4237
4238
4239
4240 for {
4241 off := ssa.AuxIntToInt32(v.AuxInt)
4242 sym := ssa.AuxToSym(v.Aux)
4243 ptr1 := v_0
4244 if v_1.Op != ssaop.OpRISCV64MOVWstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
4245 break
4246 }
4247 x := v_1.Args[1]
4248 ptr2 := v_1.Args[0]
4249 if !(ssa.IsSamePtr(ptr1, ptr2)) {
4250 break
4251 }
4252 v.Reset(ssaop.OpRISCV64FMVSX)
4253 v.AddArg(x)
4254 return true
4255 }
4256 return false
4257 }
4258 func rewriteValue_OpRISCV64FMOVWstore(v *ssa.Value) bool {
4259 v_2 := v.Args[2]
4260 v_1 := v.Args[1]
4261 v_0 := v.Args[0]
4262 b := v.Block
4263 config := b.Func.Config
4264
4265
4266
4267 for {
4268 off1 := ssa.AuxIntToInt32(v.AuxInt)
4269 sym1 := ssa.AuxToSym(v.Aux)
4270 if v_0.Op != ssaop.OpRISCV64MOVaddr {
4271 break
4272 }
4273 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
4274 sym2 := ssa.AuxToSym(v_0.Aux)
4275 base := v_0.Args[0]
4276 val := v_1
4277 mem := v_2
4278 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
4279 break
4280 }
4281 v.Reset(ssaop.OpRISCV64FMOVWstore)
4282 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
4283 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
4284 v.AddArg3(base, val, mem)
4285 return true
4286 }
4287
4288
4289
4290 for {
4291 off1 := ssa.AuxIntToInt32(v.AuxInt)
4292 sym := ssa.AuxToSym(v.Aux)
4293 if v_0.Op != ssaop.OpRISCV64ADDI {
4294 break
4295 }
4296 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
4297 base := v_0.Args[0]
4298 val := v_1
4299 mem := v_2
4300 if !(ssa.Is32Bit(int64(off1) + off2)) {
4301 break
4302 }
4303 v.Reset(ssaop.OpRISCV64FMOVWstore)
4304 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
4305 v.Aux = ssa.SymToAux(sym)
4306 v.AddArg3(base, val, mem)
4307 return true
4308 }
4309 return false
4310 }
4311 func rewriteValue_OpRISCV64FMSUBD(v *ssa.Value) bool {
4312 v_2 := v.Args[2]
4313 v_1 := v.Args[1]
4314 v_0 := v.Args[0]
4315
4316
4317
4318 for {
4319 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4320 neg := v_0
4321 if neg.Op != ssaop.OpRISCV64FNEGD {
4322 continue
4323 }
4324 x := neg.Args[0]
4325 y := v_1
4326 z := v_2
4327 if !(neg.Uses == 1) {
4328 continue
4329 }
4330 v.Reset(ssaop.OpRISCV64FNMADDD)
4331 v.AddArg3(x, y, z)
4332 return true
4333 }
4334 break
4335 }
4336
4337
4338
4339 for {
4340 x := v_0
4341 y := v_1
4342 neg := v_2
4343 if neg.Op != ssaop.OpRISCV64FNEGD {
4344 break
4345 }
4346 z := neg.Args[0]
4347 if !(neg.Uses == 1) {
4348 break
4349 }
4350 v.Reset(ssaop.OpRISCV64FMADDD)
4351 v.AddArg3(x, y, z)
4352 return true
4353 }
4354 return false
4355 }
4356 func rewriteValue_OpRISCV64FMSUBS(v *ssa.Value) bool {
4357 v_2 := v.Args[2]
4358 v_1 := v.Args[1]
4359 v_0 := v.Args[0]
4360
4361
4362
4363 for {
4364 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4365 neg := v_0
4366 if neg.Op != ssaop.OpRISCV64FNEGS {
4367 continue
4368 }
4369 x := neg.Args[0]
4370 y := v_1
4371 z := v_2
4372 if !(neg.Uses == 1) {
4373 continue
4374 }
4375 v.Reset(ssaop.OpRISCV64FNMADDS)
4376 v.AddArg3(x, y, z)
4377 return true
4378 }
4379 break
4380 }
4381
4382
4383
4384 for {
4385 x := v_0
4386 y := v_1
4387 neg := v_2
4388 if neg.Op != ssaop.OpRISCV64FNEGS {
4389 break
4390 }
4391 z := neg.Args[0]
4392 if !(neg.Uses == 1) {
4393 break
4394 }
4395 v.Reset(ssaop.OpRISCV64FMADDS)
4396 v.AddArg3(x, y, z)
4397 return true
4398 }
4399 return false
4400 }
4401 func rewriteValue_OpRISCV64FNED(v *ssa.Value) bool {
4402 v_1 := v.Args[1]
4403 v_0 := v.Args[0]
4404 b := v.Block
4405 typ := &b.Func.Config.Types
4406
4407
4408 for {
4409 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4410 x := v_0
4411 if v_1.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_1.AuxInt) != math.Inf(-1) {
4412 continue
4413 }
4414 v.Reset(ssaop.OpRISCV64SEQZ)
4415 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
4416 v0.AuxInt = ssa.Int64ToAuxInt(0b00_0000_0001)
4417 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
4418 v1.AddArg(x)
4419 v0.AddArg(v1)
4420 v.AddArg(v0)
4421 return true
4422 }
4423 break
4424 }
4425
4426
4427 for {
4428 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4429 x := v_0
4430 if v_1.Op != ssaop.OpRISCV64FMOVDconst || ssa.AuxIntToFloat64(v_1.AuxInt) != math.Inf(1) {
4431 continue
4432 }
4433 v.Reset(ssaop.OpRISCV64SEQZ)
4434 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
4435 v0.AuxInt = ssa.Int64ToAuxInt(0b00_1000_0000)
4436 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
4437 v1.AddArg(x)
4438 v0.AddArg(v1)
4439 v.AddArg(v0)
4440 return true
4441 }
4442 break
4443 }
4444 return false
4445 }
4446 func rewriteValue_OpRISCV64FNMADDD(v *ssa.Value) bool {
4447 v_2 := v.Args[2]
4448 v_1 := v.Args[1]
4449 v_0 := v.Args[0]
4450
4451
4452
4453 for {
4454 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4455 neg := v_0
4456 if neg.Op != ssaop.OpRISCV64FNEGD {
4457 continue
4458 }
4459 x := neg.Args[0]
4460 y := v_1
4461 z := v_2
4462 if !(neg.Uses == 1) {
4463 continue
4464 }
4465 v.Reset(ssaop.OpRISCV64FMSUBD)
4466 v.AddArg3(x, y, z)
4467 return true
4468 }
4469 break
4470 }
4471
4472
4473
4474 for {
4475 x := v_0
4476 y := v_1
4477 neg := v_2
4478 if neg.Op != ssaop.OpRISCV64FNEGD {
4479 break
4480 }
4481 z := neg.Args[0]
4482 if !(neg.Uses == 1) {
4483 break
4484 }
4485 v.Reset(ssaop.OpRISCV64FNMSUBD)
4486 v.AddArg3(x, y, z)
4487 return true
4488 }
4489 return false
4490 }
4491 func rewriteValue_OpRISCV64FNMADDS(v *ssa.Value) bool {
4492 v_2 := v.Args[2]
4493 v_1 := v.Args[1]
4494 v_0 := v.Args[0]
4495
4496
4497
4498 for {
4499 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4500 neg := v_0
4501 if neg.Op != ssaop.OpRISCV64FNEGS {
4502 continue
4503 }
4504 x := neg.Args[0]
4505 y := v_1
4506 z := v_2
4507 if !(neg.Uses == 1) {
4508 continue
4509 }
4510 v.Reset(ssaop.OpRISCV64FMSUBS)
4511 v.AddArg3(x, y, z)
4512 return true
4513 }
4514 break
4515 }
4516
4517
4518
4519 for {
4520 x := v_0
4521 y := v_1
4522 neg := v_2
4523 if neg.Op != ssaop.OpRISCV64FNEGS {
4524 break
4525 }
4526 z := neg.Args[0]
4527 if !(neg.Uses == 1) {
4528 break
4529 }
4530 v.Reset(ssaop.OpRISCV64FNMSUBS)
4531 v.AddArg3(x, y, z)
4532 return true
4533 }
4534 return false
4535 }
4536 func rewriteValue_OpRISCV64FNMSUBD(v *ssa.Value) bool {
4537 v_2 := v.Args[2]
4538 v_1 := v.Args[1]
4539 v_0 := v.Args[0]
4540
4541
4542
4543 for {
4544 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4545 neg := v_0
4546 if neg.Op != ssaop.OpRISCV64FNEGD {
4547 continue
4548 }
4549 x := neg.Args[0]
4550 y := v_1
4551 z := v_2
4552 if !(neg.Uses == 1) {
4553 continue
4554 }
4555 v.Reset(ssaop.OpRISCV64FMADDD)
4556 v.AddArg3(x, y, z)
4557 return true
4558 }
4559 break
4560 }
4561
4562
4563
4564 for {
4565 x := v_0
4566 y := v_1
4567 neg := v_2
4568 if neg.Op != ssaop.OpRISCV64FNEGD {
4569 break
4570 }
4571 z := neg.Args[0]
4572 if !(neg.Uses == 1) {
4573 break
4574 }
4575 v.Reset(ssaop.OpRISCV64FNMADDD)
4576 v.AddArg3(x, y, z)
4577 return true
4578 }
4579 return false
4580 }
4581 func rewriteValue_OpRISCV64FNMSUBS(v *ssa.Value) bool {
4582 v_2 := v.Args[2]
4583 v_1 := v.Args[1]
4584 v_0 := v.Args[0]
4585
4586
4587
4588 for {
4589 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4590 neg := v_0
4591 if neg.Op != ssaop.OpRISCV64FNEGS {
4592 continue
4593 }
4594 x := neg.Args[0]
4595 y := v_1
4596 z := v_2
4597 if !(neg.Uses == 1) {
4598 continue
4599 }
4600 v.Reset(ssaop.OpRISCV64FMADDS)
4601 v.AddArg3(x, y, z)
4602 return true
4603 }
4604 break
4605 }
4606
4607
4608
4609 for {
4610 x := v_0
4611 y := v_1
4612 neg := v_2
4613 if neg.Op != ssaop.OpRISCV64FNEGS {
4614 break
4615 }
4616 z := neg.Args[0]
4617 if !(neg.Uses == 1) {
4618 break
4619 }
4620 v.Reset(ssaop.OpRISCV64FNMADDS)
4621 v.AddArg3(x, y, z)
4622 return true
4623 }
4624 return false
4625 }
4626 func rewriteValue_OpRISCV64FSUBD(v *ssa.Value) bool {
4627 v_1 := v.Args[1]
4628 v_0 := v.Args[0]
4629
4630
4631
4632 for {
4633 a := v_0
4634 if v_1.Op != ssaop.OpRISCV64FMULD {
4635 break
4636 }
4637 y := v_1.Args[1]
4638 x := v_1.Args[0]
4639 if !(a.Block.Func.UseFMA(v)) {
4640 break
4641 }
4642 v.Reset(ssaop.OpRISCV64FNMSUBD)
4643 v.AddArg3(x, y, a)
4644 return true
4645 }
4646
4647
4648
4649 for {
4650 if v_0.Op != ssaop.OpRISCV64FMULD {
4651 break
4652 }
4653 y := v_0.Args[1]
4654 x := v_0.Args[0]
4655 a := v_1
4656 if !(a.Block.Func.UseFMA(v)) {
4657 break
4658 }
4659 v.Reset(ssaop.OpRISCV64FMSUBD)
4660 v.AddArg3(x, y, a)
4661 return true
4662 }
4663 return false
4664 }
4665 func rewriteValue_OpRISCV64FSUBS(v *ssa.Value) bool {
4666 v_1 := v.Args[1]
4667 v_0 := v.Args[0]
4668
4669
4670
4671 for {
4672 a := v_0
4673 if v_1.Op != ssaop.OpRISCV64FMULS {
4674 break
4675 }
4676 y := v_1.Args[1]
4677 x := v_1.Args[0]
4678 if !(a.Block.Func.UseFMA(v)) {
4679 break
4680 }
4681 v.Reset(ssaop.OpRISCV64FNMSUBS)
4682 v.AddArg3(x, y, a)
4683 return true
4684 }
4685
4686
4687
4688 for {
4689 if v_0.Op != ssaop.OpRISCV64FMULS {
4690 break
4691 }
4692 y := v_0.Args[1]
4693 x := v_0.Args[0]
4694 a := v_1
4695 if !(a.Block.Func.UseFMA(v)) {
4696 break
4697 }
4698 v.Reset(ssaop.OpRISCV64FMSUBS)
4699 v.AddArg3(x, y, a)
4700 return true
4701 }
4702 return false
4703 }
4704 func rewriteValue_OpRISCV64LoweredPanicBoundsCR(v *ssa.Value) bool {
4705 v_1 := v.Args[1]
4706 v_0 := v.Args[0]
4707
4708
4709 for {
4710 kind := ssa.AuxIntToInt64(v.AuxInt)
4711 p := ssa.AuxToPanicBoundsC(v.Aux)
4712 if v_0.Op != ssaop.OpRISCV64MOVDconst {
4713 break
4714 }
4715 c := ssa.AuxIntToInt64(v_0.AuxInt)
4716 mem := v_1
4717 v.Reset(ssaop.OpRISCV64LoweredPanicBoundsCC)
4718 v.AuxInt = ssa.Int64ToAuxInt(kind)
4719 v.Aux = ssa.PanicBoundsCCToAux(ssa.PanicBoundsCC{Cx: p.C, Cy: c})
4720 v.AddArg(mem)
4721 return true
4722 }
4723 return false
4724 }
4725 func rewriteValue_OpRISCV64LoweredPanicBoundsRC(v *ssa.Value) bool {
4726 v_1 := v.Args[1]
4727 v_0 := v.Args[0]
4728
4729
4730 for {
4731 kind := ssa.AuxIntToInt64(v.AuxInt)
4732 p := ssa.AuxToPanicBoundsC(v.Aux)
4733 if v_0.Op != ssaop.OpRISCV64MOVDconst {
4734 break
4735 }
4736 c := ssa.AuxIntToInt64(v_0.AuxInt)
4737 mem := v_1
4738 v.Reset(ssaop.OpRISCV64LoweredPanicBoundsCC)
4739 v.AuxInt = ssa.Int64ToAuxInt(kind)
4740 v.Aux = ssa.PanicBoundsCCToAux(ssa.PanicBoundsCC{Cx: c, Cy: p.C})
4741 v.AddArg(mem)
4742 return true
4743 }
4744 return false
4745 }
4746 func rewriteValue_OpRISCV64LoweredPanicBoundsRR(v *ssa.Value) bool {
4747 v_2 := v.Args[2]
4748 v_1 := v.Args[1]
4749 v_0 := v.Args[0]
4750
4751
4752 for {
4753 kind := ssa.AuxIntToInt64(v.AuxInt)
4754 x := v_0
4755 if v_1.Op != ssaop.OpRISCV64MOVDconst {
4756 break
4757 }
4758 c := ssa.AuxIntToInt64(v_1.AuxInt)
4759 mem := v_2
4760 v.Reset(ssaop.OpRISCV64LoweredPanicBoundsRC)
4761 v.AuxInt = ssa.Int64ToAuxInt(kind)
4762 v.Aux = ssa.PanicBoundsCToAux(ssa.PanicBoundsC{C: c})
4763 v.AddArg2(x, mem)
4764 return true
4765 }
4766
4767
4768 for {
4769 kind := ssa.AuxIntToInt64(v.AuxInt)
4770 if v_0.Op != ssaop.OpRISCV64MOVDconst {
4771 break
4772 }
4773 c := ssa.AuxIntToInt64(v_0.AuxInt)
4774 y := v_1
4775 mem := v_2
4776 v.Reset(ssaop.OpRISCV64LoweredPanicBoundsCR)
4777 v.AuxInt = ssa.Int64ToAuxInt(kind)
4778 v.Aux = ssa.PanicBoundsCToAux(ssa.PanicBoundsC{C: c})
4779 v.AddArg2(y, mem)
4780 return true
4781 }
4782 return false
4783 }
4784 func rewriteValue_OpRISCV64MOVBUload(v *ssa.Value) bool {
4785 v_1 := v.Args[1]
4786 v_0 := v.Args[0]
4787 b := v.Block
4788 config := b.Func.Config
4789
4790
4791
4792 for {
4793 off1 := ssa.AuxIntToInt32(v.AuxInt)
4794 sym1 := ssa.AuxToSym(v.Aux)
4795 if v_0.Op != ssaop.OpRISCV64MOVaddr {
4796 break
4797 }
4798 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
4799 sym2 := ssa.AuxToSym(v_0.Aux)
4800 base := v_0.Args[0]
4801 mem := v_1
4802 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
4803 break
4804 }
4805 v.Reset(ssaop.OpRISCV64MOVBUload)
4806 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
4807 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
4808 v.AddArg2(base, mem)
4809 return true
4810 }
4811
4812
4813
4814 for {
4815 off1 := ssa.AuxIntToInt32(v.AuxInt)
4816 sym := ssa.AuxToSym(v.Aux)
4817 if v_0.Op != ssaop.OpRISCV64ADDI {
4818 break
4819 }
4820 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
4821 base := v_0.Args[0]
4822 mem := v_1
4823 if !(ssa.Is32Bit(int64(off1) + off2)) {
4824 break
4825 }
4826 v.Reset(ssaop.OpRISCV64MOVBUload)
4827 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
4828 v.Aux = ssa.SymToAux(sym)
4829 v.AddArg2(base, mem)
4830 return true
4831 }
4832
4833
4834
4835 for {
4836 off := ssa.AuxIntToInt32(v.AuxInt)
4837 sym := ssa.AuxToSym(v.Aux)
4838 ptr1 := v_0
4839 if v_1.Op != ssaop.OpRISCV64MOVBstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
4840 break
4841 }
4842 x := v_1.Args[1]
4843 ptr2 := v_1.Args[0]
4844 if !(ssa.IsSamePtr(ptr1, ptr2)) {
4845 break
4846 }
4847 v.Reset(ssaop.OpRISCV64MOVBUreg)
4848 v.AddArg(x)
4849 return true
4850 }
4851 return false
4852 }
4853 func rewriteValue_OpRISCV64MOVBUreg(v *ssa.Value) bool {
4854 v_0 := v.Args[0]
4855 b := v.Block
4856
4857
4858 for {
4859 x := v_0
4860 if x.Op != ssaop.OpRISCV64FLES {
4861 break
4862 }
4863 v.CopyOf(x)
4864 return true
4865 }
4866
4867
4868 for {
4869 x := v_0
4870 if x.Op != ssaop.OpRISCV64FLTS {
4871 break
4872 }
4873 v.CopyOf(x)
4874 return true
4875 }
4876
4877
4878 for {
4879 x := v_0
4880 if x.Op != ssaop.OpRISCV64FEQS {
4881 break
4882 }
4883 v.CopyOf(x)
4884 return true
4885 }
4886
4887
4888 for {
4889 x := v_0
4890 if x.Op != ssaop.OpRISCV64FNES {
4891 break
4892 }
4893 v.CopyOf(x)
4894 return true
4895 }
4896
4897
4898 for {
4899 x := v_0
4900 if x.Op != ssaop.OpRISCV64FLED {
4901 break
4902 }
4903 v.CopyOf(x)
4904 return true
4905 }
4906
4907
4908 for {
4909 x := v_0
4910 if x.Op != ssaop.OpRISCV64FLTD {
4911 break
4912 }
4913 v.CopyOf(x)
4914 return true
4915 }
4916
4917
4918 for {
4919 x := v_0
4920 if x.Op != ssaop.OpRISCV64FEQD {
4921 break
4922 }
4923 v.CopyOf(x)
4924 return true
4925 }
4926
4927
4928 for {
4929 x := v_0
4930 if x.Op != ssaop.OpRISCV64FNED {
4931 break
4932 }
4933 v.CopyOf(x)
4934 return true
4935 }
4936
4937
4938 for {
4939 x := v_0
4940 if x.Op != ssaop.OpRISCV64SEQZ {
4941 break
4942 }
4943 v.CopyOf(x)
4944 return true
4945 }
4946
4947
4948 for {
4949 x := v_0
4950 if x.Op != ssaop.OpRISCV64SNEZ {
4951 break
4952 }
4953 v.CopyOf(x)
4954 return true
4955 }
4956
4957
4958 for {
4959 x := v_0
4960 if x.Op != ssaop.OpRISCV64SLT {
4961 break
4962 }
4963 v.CopyOf(x)
4964 return true
4965 }
4966
4967
4968 for {
4969 x := v_0
4970 if x.Op != ssaop.OpRISCV64SLTU {
4971 break
4972 }
4973 v.CopyOf(x)
4974 return true
4975 }
4976
4977
4978
4979 for {
4980 x := v_0
4981 if x.Op != ssaop.OpRISCV64ANDI {
4982 break
4983 }
4984 c := ssa.AuxIntToInt64(x.AuxInt)
4985 if !(c >= 0 && int64(uint8(c)) == c) {
4986 break
4987 }
4988 v.CopyOf(x)
4989 return true
4990 }
4991
4992
4993
4994 for {
4995 if v_0.Op != ssaop.OpRISCV64ANDI {
4996 break
4997 }
4998 c := ssa.AuxIntToInt64(v_0.AuxInt)
4999 x := v_0.Args[0]
5000 if !(c < 0) {
5001 break
5002 }
5003 v.Reset(ssaop.OpRISCV64ANDI)
5004 v.AuxInt = ssa.Int64ToAuxInt(int64(uint8(c)))
5005 v.AddArg(x)
5006 return true
5007 }
5008
5009
5010
5011 for {
5012 x := v_0
5013 if x.Op != ssaop.OpRISCV64SRLI {
5014 break
5015 }
5016 c := ssa.AuxIntToInt64(x.AuxInt)
5017 if !(c >= 56) {
5018 break
5019 }
5020 v.CopyOf(x)
5021 return true
5022 }
5023
5024
5025
5026 for {
5027 x := v_0
5028 if x.Op != ssaop.OpRISCV64SRLIW {
5029 break
5030 }
5031 c := ssa.AuxIntToInt64(x.AuxInt)
5032 if !(c >= 24) {
5033 break
5034 }
5035 v.CopyOf(x)
5036 return true
5037 }
5038
5039
5040 for {
5041 if v_0.Op != ssaop.OpRISCV64MOVDconst {
5042 break
5043 }
5044 c := ssa.AuxIntToInt64(v_0.AuxInt)
5045 v.Reset(ssaop.OpRISCV64MOVDconst)
5046 v.AuxInt = ssa.Int64ToAuxInt(int64(uint8(c)))
5047 return true
5048 }
5049
5050
5051 for {
5052 x := v_0
5053 if x.Op != ssaop.OpRISCV64MOVBUload {
5054 break
5055 }
5056 v.Reset(ssaop.OpRISCV64MOVDreg)
5057 v.AddArg(x)
5058 return true
5059 }
5060
5061
5062 for {
5063 x := v_0
5064 if x.Op != ssaop.OpSelect0 {
5065 break
5066 }
5067 x_0 := x.Args[0]
5068 if x_0.Op != ssaop.OpRISCV64LoweredAtomicLoad8 {
5069 break
5070 }
5071 v.Reset(ssaop.OpRISCV64MOVDreg)
5072 v.AddArg(x)
5073 return true
5074 }
5075
5076
5077 for {
5078 x := v_0
5079 if x.Op != ssaop.OpSelect0 {
5080 break
5081 }
5082 x_0 := x.Args[0]
5083 if x_0.Op != ssaop.OpRISCV64LoweredAtomicCas32 {
5084 break
5085 }
5086 v.Reset(ssaop.OpRISCV64MOVDreg)
5087 v.AddArg(x)
5088 return true
5089 }
5090
5091
5092 for {
5093 x := v_0
5094 if x.Op != ssaop.OpSelect0 {
5095 break
5096 }
5097 x_0 := x.Args[0]
5098 if x_0.Op != ssaop.OpRISCV64LoweredAtomicCas64 {
5099 break
5100 }
5101 v.Reset(ssaop.OpRISCV64MOVDreg)
5102 v.AddArg(x)
5103 return true
5104 }
5105
5106
5107 for {
5108 x := v_0
5109 if x.Op != ssaop.OpRISCV64MOVBUreg {
5110 break
5111 }
5112 v.Reset(ssaop.OpRISCV64MOVDreg)
5113 v.AddArg(x)
5114 return true
5115 }
5116
5117
5118
5119 for {
5120 t := v.Type
5121 x := v_0
5122 if x.Op != ssaop.OpRISCV64MOVBload {
5123 break
5124 }
5125 off := ssa.AuxIntToInt32(x.AuxInt)
5126 sym := ssa.AuxToSym(x.Aux)
5127 mem := x.Args[1]
5128 ptr := x.Args[0]
5129 if !(x.Uses == 1 && ssa.Clobber(x)) {
5130 break
5131 }
5132 b = x.Block
5133 v0 := b.NewValue0(x.Pos, ssaop.OpRISCV64MOVBUload, t)
5134 v.CopyOf(v0)
5135 v0.AuxInt = ssa.Int32ToAuxInt(off)
5136 v0.Aux = ssa.SymToAux(sym)
5137 v0.AddArg2(ptr, mem)
5138 return true
5139 }
5140 return false
5141 }
5142 func rewriteValue_OpRISCV64MOVBload(v *ssa.Value) bool {
5143 v_1 := v.Args[1]
5144 v_0 := v.Args[0]
5145 b := v.Block
5146 config := b.Func.Config
5147
5148
5149
5150 for {
5151 off1 := ssa.AuxIntToInt32(v.AuxInt)
5152 sym1 := ssa.AuxToSym(v.Aux)
5153 if v_0.Op != ssaop.OpRISCV64MOVaddr {
5154 break
5155 }
5156 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
5157 sym2 := ssa.AuxToSym(v_0.Aux)
5158 base := v_0.Args[0]
5159 mem := v_1
5160 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
5161 break
5162 }
5163 v.Reset(ssaop.OpRISCV64MOVBload)
5164 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
5165 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
5166 v.AddArg2(base, mem)
5167 return true
5168 }
5169
5170
5171
5172 for {
5173 off1 := ssa.AuxIntToInt32(v.AuxInt)
5174 sym := ssa.AuxToSym(v.Aux)
5175 if v_0.Op != ssaop.OpRISCV64ADDI {
5176 break
5177 }
5178 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
5179 base := v_0.Args[0]
5180 mem := v_1
5181 if !(ssa.Is32Bit(int64(off1) + off2)) {
5182 break
5183 }
5184 v.Reset(ssaop.OpRISCV64MOVBload)
5185 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
5186 v.Aux = ssa.SymToAux(sym)
5187 v.AddArg2(base, mem)
5188 return true
5189 }
5190
5191
5192
5193 for {
5194 off := ssa.AuxIntToInt32(v.AuxInt)
5195 sym := ssa.AuxToSym(v.Aux)
5196 ptr1 := v_0
5197 if v_1.Op != ssaop.OpRISCV64MOVBstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
5198 break
5199 }
5200 x := v_1.Args[1]
5201 ptr2 := v_1.Args[0]
5202 if !(ssa.IsSamePtr(ptr1, ptr2)) {
5203 break
5204 }
5205 v.Reset(ssaop.OpRISCV64MOVBreg)
5206 v.AddArg(x)
5207 return true
5208 }
5209 return false
5210 }
5211 func rewriteValue_OpRISCV64MOVBreg(v *ssa.Value) bool {
5212 v_0 := v.Args[0]
5213 b := v.Block
5214
5215
5216
5217 for {
5218 x := v_0
5219 if x.Op != ssaop.OpRISCV64ANDI {
5220 break
5221 }
5222 c := ssa.AuxIntToInt64(x.AuxInt)
5223 if !(c >= 0 && int64(int8(c)) == c) {
5224 break
5225 }
5226 v.CopyOf(x)
5227 return true
5228 }
5229
5230
5231 for {
5232 if v_0.Op != ssaop.OpRISCV64MOVDconst {
5233 break
5234 }
5235 c := ssa.AuxIntToInt64(v_0.AuxInt)
5236 v.Reset(ssaop.OpRISCV64MOVDconst)
5237 v.AuxInt = ssa.Int64ToAuxInt(int64(int8(c)))
5238 return true
5239 }
5240
5241
5242 for {
5243 x := v_0
5244 if x.Op != ssaop.OpRISCV64MOVBload {
5245 break
5246 }
5247 v.Reset(ssaop.OpRISCV64MOVDreg)
5248 v.AddArg(x)
5249 return true
5250 }
5251
5252
5253 for {
5254 x := v_0
5255 if x.Op != ssaop.OpRISCV64MOVBreg {
5256 break
5257 }
5258 v.Reset(ssaop.OpRISCV64MOVDreg)
5259 v.AddArg(x)
5260 return true
5261 }
5262
5263
5264
5265 for {
5266 t := v.Type
5267 x := v_0
5268 if x.Op != ssaop.OpRISCV64MOVBUload {
5269 break
5270 }
5271 off := ssa.AuxIntToInt32(x.AuxInt)
5272 sym := ssa.AuxToSym(x.Aux)
5273 mem := x.Args[1]
5274 ptr := x.Args[0]
5275 if !(x.Uses == 1 && ssa.Clobber(x)) {
5276 break
5277 }
5278 b = x.Block
5279 v0 := b.NewValue0(x.Pos, ssaop.OpRISCV64MOVBload, t)
5280 v.CopyOf(v0)
5281 v0.AuxInt = ssa.Int32ToAuxInt(off)
5282 v0.Aux = ssa.SymToAux(sym)
5283 v0.AddArg2(ptr, mem)
5284 return true
5285 }
5286 return false
5287 }
5288 func rewriteValue_OpRISCV64MOVBstore(v *ssa.Value) bool {
5289 v_2 := v.Args[2]
5290 v_1 := v.Args[1]
5291 v_0 := v.Args[0]
5292 b := v.Block
5293 config := b.Func.Config
5294
5295
5296
5297 for {
5298 off1 := ssa.AuxIntToInt32(v.AuxInt)
5299 sym1 := ssa.AuxToSym(v.Aux)
5300 if v_0.Op != ssaop.OpRISCV64MOVaddr {
5301 break
5302 }
5303 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
5304 sym2 := ssa.AuxToSym(v_0.Aux)
5305 base := v_0.Args[0]
5306 val := v_1
5307 mem := v_2
5308 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
5309 break
5310 }
5311 v.Reset(ssaop.OpRISCV64MOVBstore)
5312 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
5313 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
5314 v.AddArg3(base, val, mem)
5315 return true
5316 }
5317
5318
5319
5320 for {
5321 off1 := ssa.AuxIntToInt32(v.AuxInt)
5322 sym := ssa.AuxToSym(v.Aux)
5323 if v_0.Op != ssaop.OpRISCV64ADDI {
5324 break
5325 }
5326 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
5327 base := v_0.Args[0]
5328 val := v_1
5329 mem := v_2
5330 if !(ssa.Is32Bit(int64(off1) + off2)) {
5331 break
5332 }
5333 v.Reset(ssaop.OpRISCV64MOVBstore)
5334 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
5335 v.Aux = ssa.SymToAux(sym)
5336 v.AddArg3(base, val, mem)
5337 return true
5338 }
5339
5340
5341 for {
5342 off := ssa.AuxIntToInt32(v.AuxInt)
5343 sym := ssa.AuxToSym(v.Aux)
5344 ptr := v_0
5345 if v_1.Op != ssaop.OpRISCV64MOVDconst || ssa.AuxIntToInt64(v_1.AuxInt) != 0 {
5346 break
5347 }
5348 mem := v_2
5349 v.Reset(ssaop.OpRISCV64MOVBstorezero)
5350 v.AuxInt = ssa.Int32ToAuxInt(off)
5351 v.Aux = ssa.SymToAux(sym)
5352 v.AddArg2(ptr, mem)
5353 return true
5354 }
5355
5356
5357 for {
5358 off := ssa.AuxIntToInt32(v.AuxInt)
5359 sym := ssa.AuxToSym(v.Aux)
5360 ptr := v_0
5361 if v_1.Op != ssaop.OpRISCV64MOVBreg {
5362 break
5363 }
5364 x := v_1.Args[0]
5365 mem := v_2
5366 v.Reset(ssaop.OpRISCV64MOVBstore)
5367 v.AuxInt = ssa.Int32ToAuxInt(off)
5368 v.Aux = ssa.SymToAux(sym)
5369 v.AddArg3(ptr, x, mem)
5370 return true
5371 }
5372
5373
5374 for {
5375 off := ssa.AuxIntToInt32(v.AuxInt)
5376 sym := ssa.AuxToSym(v.Aux)
5377 ptr := v_0
5378 if v_1.Op != ssaop.OpRISCV64MOVHreg {
5379 break
5380 }
5381 x := v_1.Args[0]
5382 mem := v_2
5383 v.Reset(ssaop.OpRISCV64MOVBstore)
5384 v.AuxInt = ssa.Int32ToAuxInt(off)
5385 v.Aux = ssa.SymToAux(sym)
5386 v.AddArg3(ptr, x, mem)
5387 return true
5388 }
5389
5390
5391 for {
5392 off := ssa.AuxIntToInt32(v.AuxInt)
5393 sym := ssa.AuxToSym(v.Aux)
5394 ptr := v_0
5395 if v_1.Op != ssaop.OpRISCV64MOVWreg {
5396 break
5397 }
5398 x := v_1.Args[0]
5399 mem := v_2
5400 v.Reset(ssaop.OpRISCV64MOVBstore)
5401 v.AuxInt = ssa.Int32ToAuxInt(off)
5402 v.Aux = ssa.SymToAux(sym)
5403 v.AddArg3(ptr, x, mem)
5404 return true
5405 }
5406
5407
5408 for {
5409 off := ssa.AuxIntToInt32(v.AuxInt)
5410 sym := ssa.AuxToSym(v.Aux)
5411 ptr := v_0
5412 if v_1.Op != ssaop.OpRISCV64MOVBUreg {
5413 break
5414 }
5415 x := v_1.Args[0]
5416 mem := v_2
5417 v.Reset(ssaop.OpRISCV64MOVBstore)
5418 v.AuxInt = ssa.Int32ToAuxInt(off)
5419 v.Aux = ssa.SymToAux(sym)
5420 v.AddArg3(ptr, x, mem)
5421 return true
5422 }
5423
5424
5425 for {
5426 off := ssa.AuxIntToInt32(v.AuxInt)
5427 sym := ssa.AuxToSym(v.Aux)
5428 ptr := v_0
5429 if v_1.Op != ssaop.OpRISCV64MOVHUreg {
5430 break
5431 }
5432 x := v_1.Args[0]
5433 mem := v_2
5434 v.Reset(ssaop.OpRISCV64MOVBstore)
5435 v.AuxInt = ssa.Int32ToAuxInt(off)
5436 v.Aux = ssa.SymToAux(sym)
5437 v.AddArg3(ptr, x, mem)
5438 return true
5439 }
5440
5441
5442 for {
5443 off := ssa.AuxIntToInt32(v.AuxInt)
5444 sym := ssa.AuxToSym(v.Aux)
5445 ptr := v_0
5446 if v_1.Op != ssaop.OpRISCV64MOVWUreg {
5447 break
5448 }
5449 x := v_1.Args[0]
5450 mem := v_2
5451 v.Reset(ssaop.OpRISCV64MOVBstore)
5452 v.AuxInt = ssa.Int32ToAuxInt(off)
5453 v.Aux = ssa.SymToAux(sym)
5454 v.AddArg3(ptr, x, mem)
5455 return true
5456 }
5457 return false
5458 }
5459 func rewriteValue_OpRISCV64MOVBstorezero(v *ssa.Value) bool {
5460 v_1 := v.Args[1]
5461 v_0 := v.Args[0]
5462 b := v.Block
5463 config := b.Func.Config
5464
5465
5466
5467 for {
5468 off1 := ssa.AuxIntToInt32(v.AuxInt)
5469 sym1 := ssa.AuxToSym(v.Aux)
5470 if v_0.Op != ssaop.OpRISCV64MOVaddr {
5471 break
5472 }
5473 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
5474 sym2 := ssa.AuxToSym(v_0.Aux)
5475 base := v_0.Args[0]
5476 mem := v_1
5477 if !(ssa.CanMergeSym(sym1, sym2) && ssa.Is32Bit(int64(off1)+int64(off2)) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
5478 break
5479 }
5480 v.Reset(ssaop.OpRISCV64MOVBstorezero)
5481 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
5482 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
5483 v.AddArg2(base, mem)
5484 return true
5485 }
5486
5487
5488
5489 for {
5490 off1 := ssa.AuxIntToInt32(v.AuxInt)
5491 sym := ssa.AuxToSym(v.Aux)
5492 if v_0.Op != ssaop.OpRISCV64ADDI {
5493 break
5494 }
5495 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
5496 base := v_0.Args[0]
5497 mem := v_1
5498 if !(ssa.Is32Bit(int64(off1) + off2)) {
5499 break
5500 }
5501 v.Reset(ssaop.OpRISCV64MOVBstorezero)
5502 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
5503 v.Aux = ssa.SymToAux(sym)
5504 v.AddArg2(base, mem)
5505 return true
5506 }
5507 return false
5508 }
5509 func rewriteValue_OpRISCV64MOVDload(v *ssa.Value) bool {
5510 v_1 := v.Args[1]
5511 v_0 := v.Args[0]
5512 b := v.Block
5513 config := b.Func.Config
5514
5515
5516
5517 for {
5518 off1 := ssa.AuxIntToInt32(v.AuxInt)
5519 sym1 := ssa.AuxToSym(v.Aux)
5520 if v_0.Op != ssaop.OpRISCV64MOVaddr {
5521 break
5522 }
5523 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
5524 sym2 := ssa.AuxToSym(v_0.Aux)
5525 base := v_0.Args[0]
5526 mem := v_1
5527 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
5528 break
5529 }
5530 v.Reset(ssaop.OpRISCV64MOVDload)
5531 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
5532 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
5533 v.AddArg2(base, mem)
5534 return true
5535 }
5536
5537
5538
5539 for {
5540 off1 := ssa.AuxIntToInt32(v.AuxInt)
5541 sym := ssa.AuxToSym(v.Aux)
5542 if v_0.Op != ssaop.OpRISCV64ADDI {
5543 break
5544 }
5545 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
5546 base := v_0.Args[0]
5547 mem := v_1
5548 if !(ssa.Is32Bit(int64(off1) + off2)) {
5549 break
5550 }
5551 v.Reset(ssaop.OpRISCV64MOVDload)
5552 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
5553 v.Aux = ssa.SymToAux(sym)
5554 v.AddArg2(base, mem)
5555 return true
5556 }
5557
5558
5559
5560 for {
5561 off := ssa.AuxIntToInt32(v.AuxInt)
5562 sym := ssa.AuxToSym(v.Aux)
5563 ptr1 := v_0
5564 if v_1.Op != ssaop.OpRISCV64MOVDstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
5565 break
5566 }
5567 x := v_1.Args[1]
5568 ptr2 := v_1.Args[0]
5569 if !(ssa.IsSamePtr(ptr1, ptr2)) {
5570 break
5571 }
5572 v.Reset(ssaop.OpRISCV64MOVDreg)
5573 v.AddArg(x)
5574 return true
5575 }
5576
5577
5578
5579 for {
5580 off := ssa.AuxIntToInt32(v.AuxInt)
5581 sym := ssa.AuxToSym(v.Aux)
5582 ptr1 := v_0
5583 if v_1.Op != ssaop.OpRISCV64FMOVDstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
5584 break
5585 }
5586 x := v_1.Args[1]
5587 ptr2 := v_1.Args[0]
5588 if !(ssa.IsSamePtr(ptr1, ptr2)) {
5589 break
5590 }
5591 v.Reset(ssaop.OpRISCV64FMVXD)
5592 v.AddArg(x)
5593 return true
5594 }
5595 return false
5596 }
5597 func rewriteValue_OpRISCV64MOVDnop(v *ssa.Value) bool {
5598 v_0 := v.Args[0]
5599
5600
5601 for {
5602 if v_0.Op != ssaop.OpRISCV64MOVDconst {
5603 break
5604 }
5605 c := ssa.AuxIntToInt64(v_0.AuxInt)
5606 v.Reset(ssaop.OpRISCV64MOVDconst)
5607 v.AuxInt = ssa.Int64ToAuxInt(c)
5608 return true
5609 }
5610 return false
5611 }
5612 func rewriteValue_OpRISCV64MOVDreg(v *ssa.Value) bool {
5613 v_0 := v.Args[0]
5614
5615
5616
5617 for {
5618 x := v_0
5619 if !(x.Uses == 1) {
5620 break
5621 }
5622 v.Reset(ssaop.OpRISCV64MOVDnop)
5623 v.AddArg(x)
5624 return true
5625 }
5626 return false
5627 }
5628 func rewriteValue_OpRISCV64MOVDstore(v *ssa.Value) bool {
5629 v_2 := v.Args[2]
5630 v_1 := v.Args[1]
5631 v_0 := v.Args[0]
5632 b := v.Block
5633 config := b.Func.Config
5634
5635
5636
5637 for {
5638 off1 := ssa.AuxIntToInt32(v.AuxInt)
5639 sym1 := ssa.AuxToSym(v.Aux)
5640 if v_0.Op != ssaop.OpRISCV64MOVaddr {
5641 break
5642 }
5643 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
5644 sym2 := ssa.AuxToSym(v_0.Aux)
5645 base := v_0.Args[0]
5646 val := v_1
5647 mem := v_2
5648 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
5649 break
5650 }
5651 v.Reset(ssaop.OpRISCV64MOVDstore)
5652 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
5653 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
5654 v.AddArg3(base, val, mem)
5655 return true
5656 }
5657
5658
5659
5660 for {
5661 off1 := ssa.AuxIntToInt32(v.AuxInt)
5662 sym := ssa.AuxToSym(v.Aux)
5663 if v_0.Op != ssaop.OpRISCV64ADDI {
5664 break
5665 }
5666 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
5667 base := v_0.Args[0]
5668 val := v_1
5669 mem := v_2
5670 if !(ssa.Is32Bit(int64(off1) + off2)) {
5671 break
5672 }
5673 v.Reset(ssaop.OpRISCV64MOVDstore)
5674 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
5675 v.Aux = ssa.SymToAux(sym)
5676 v.AddArg3(base, val, mem)
5677 return true
5678 }
5679
5680
5681 for {
5682 off := ssa.AuxIntToInt32(v.AuxInt)
5683 sym := ssa.AuxToSym(v.Aux)
5684 ptr := v_0
5685 if v_1.Op != ssaop.OpRISCV64MOVDconst || ssa.AuxIntToInt64(v_1.AuxInt) != 0 {
5686 break
5687 }
5688 mem := v_2
5689 v.Reset(ssaop.OpRISCV64MOVDstorezero)
5690 v.AuxInt = ssa.Int32ToAuxInt(off)
5691 v.Aux = ssa.SymToAux(sym)
5692 v.AddArg2(ptr, mem)
5693 return true
5694 }
5695 return false
5696 }
5697 func rewriteValue_OpRISCV64MOVDstorezero(v *ssa.Value) bool {
5698 v_1 := v.Args[1]
5699 v_0 := v.Args[0]
5700 b := v.Block
5701 config := b.Func.Config
5702
5703
5704
5705 for {
5706 off1 := ssa.AuxIntToInt32(v.AuxInt)
5707 sym1 := ssa.AuxToSym(v.Aux)
5708 if v_0.Op != ssaop.OpRISCV64MOVaddr {
5709 break
5710 }
5711 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
5712 sym2 := ssa.AuxToSym(v_0.Aux)
5713 base := v_0.Args[0]
5714 mem := v_1
5715 if !(ssa.CanMergeSym(sym1, sym2) && ssa.Is32Bit(int64(off1)+int64(off2)) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
5716 break
5717 }
5718 v.Reset(ssaop.OpRISCV64MOVDstorezero)
5719 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
5720 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
5721 v.AddArg2(base, mem)
5722 return true
5723 }
5724
5725
5726
5727 for {
5728 off1 := ssa.AuxIntToInt32(v.AuxInt)
5729 sym := ssa.AuxToSym(v.Aux)
5730 if v_0.Op != ssaop.OpRISCV64ADDI {
5731 break
5732 }
5733 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
5734 base := v_0.Args[0]
5735 mem := v_1
5736 if !(ssa.Is32Bit(int64(off1) + off2)) {
5737 break
5738 }
5739 v.Reset(ssaop.OpRISCV64MOVDstorezero)
5740 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
5741 v.Aux = ssa.SymToAux(sym)
5742 v.AddArg2(base, mem)
5743 return true
5744 }
5745 return false
5746 }
5747 func rewriteValue_OpRISCV64MOVHUload(v *ssa.Value) bool {
5748 v_1 := v.Args[1]
5749 v_0 := v.Args[0]
5750 b := v.Block
5751 config := b.Func.Config
5752
5753
5754
5755 for {
5756 off1 := ssa.AuxIntToInt32(v.AuxInt)
5757 sym1 := ssa.AuxToSym(v.Aux)
5758 if v_0.Op != ssaop.OpRISCV64MOVaddr {
5759 break
5760 }
5761 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
5762 sym2 := ssa.AuxToSym(v_0.Aux)
5763 base := v_0.Args[0]
5764 mem := v_1
5765 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
5766 break
5767 }
5768 v.Reset(ssaop.OpRISCV64MOVHUload)
5769 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
5770 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
5771 v.AddArg2(base, mem)
5772 return true
5773 }
5774
5775
5776
5777 for {
5778 off1 := ssa.AuxIntToInt32(v.AuxInt)
5779 sym := ssa.AuxToSym(v.Aux)
5780 if v_0.Op != ssaop.OpRISCV64ADDI {
5781 break
5782 }
5783 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
5784 base := v_0.Args[0]
5785 mem := v_1
5786 if !(ssa.Is32Bit(int64(off1) + off2)) {
5787 break
5788 }
5789 v.Reset(ssaop.OpRISCV64MOVHUload)
5790 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
5791 v.Aux = ssa.SymToAux(sym)
5792 v.AddArg2(base, mem)
5793 return true
5794 }
5795
5796
5797
5798 for {
5799 off := ssa.AuxIntToInt32(v.AuxInt)
5800 sym := ssa.AuxToSym(v.Aux)
5801 ptr1 := v_0
5802 if v_1.Op != ssaop.OpRISCV64MOVHstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
5803 break
5804 }
5805 x := v_1.Args[1]
5806 ptr2 := v_1.Args[0]
5807 if !(ssa.IsSamePtr(ptr1, ptr2)) {
5808 break
5809 }
5810 v.Reset(ssaop.OpRISCV64MOVHUreg)
5811 v.AddArg(x)
5812 return true
5813 }
5814 return false
5815 }
5816 func rewriteValue_OpRISCV64MOVHUreg(v *ssa.Value) bool {
5817 v_0 := v.Args[0]
5818 b := v.Block
5819
5820
5821
5822 for {
5823 x := v_0
5824 if x.Op != ssaop.OpRISCV64ANDI {
5825 break
5826 }
5827 c := ssa.AuxIntToInt64(x.AuxInt)
5828 if !(c >= 0 && int64(uint16(c)) == c) {
5829 break
5830 }
5831 v.CopyOf(x)
5832 return true
5833 }
5834
5835
5836
5837 for {
5838 if v_0.Op != ssaop.OpRISCV64ANDI {
5839 break
5840 }
5841 c := ssa.AuxIntToInt64(v_0.AuxInt)
5842 x := v_0.Args[0]
5843 if !(c < 0) {
5844 break
5845 }
5846 v.Reset(ssaop.OpRISCV64ANDI)
5847 v.AuxInt = ssa.Int64ToAuxInt(int64(uint16(c)))
5848 v.AddArg(x)
5849 return true
5850 }
5851
5852
5853
5854 for {
5855 x := v_0
5856 if x.Op != ssaop.OpRISCV64SRLI {
5857 break
5858 }
5859 c := ssa.AuxIntToInt64(x.AuxInt)
5860 if !(c >= 48) {
5861 break
5862 }
5863 v.CopyOf(x)
5864 return true
5865 }
5866
5867
5868
5869 for {
5870 x := v_0
5871 if x.Op != ssaop.OpRISCV64SRLIW {
5872 break
5873 }
5874 c := ssa.AuxIntToInt64(x.AuxInt)
5875 if !(c >= 16) {
5876 break
5877 }
5878 v.CopyOf(x)
5879 return true
5880 }
5881
5882
5883 for {
5884 if v_0.Op != ssaop.OpRISCV64MOVDconst {
5885 break
5886 }
5887 c := ssa.AuxIntToInt64(v_0.AuxInt)
5888 v.Reset(ssaop.OpRISCV64MOVDconst)
5889 v.AuxInt = ssa.Int64ToAuxInt(int64(uint16(c)))
5890 return true
5891 }
5892
5893
5894 for {
5895 x := v_0
5896 if x.Op != ssaop.OpRISCV64MOVBUload {
5897 break
5898 }
5899 v.Reset(ssaop.OpRISCV64MOVDreg)
5900 v.AddArg(x)
5901 return true
5902 }
5903
5904
5905 for {
5906 x := v_0
5907 if x.Op != ssaop.OpRISCV64MOVHUload {
5908 break
5909 }
5910 v.Reset(ssaop.OpRISCV64MOVDreg)
5911 v.AddArg(x)
5912 return true
5913 }
5914
5915
5916 for {
5917 x := v_0
5918 if x.Op != ssaop.OpRISCV64MOVBUreg {
5919 break
5920 }
5921 v.Reset(ssaop.OpRISCV64MOVDreg)
5922 v.AddArg(x)
5923 return true
5924 }
5925
5926
5927 for {
5928 x := v_0
5929 if x.Op != ssaop.OpRISCV64MOVHUreg {
5930 break
5931 }
5932 v.Reset(ssaop.OpRISCV64MOVDreg)
5933 v.AddArg(x)
5934 return true
5935 }
5936
5937
5938
5939 for {
5940 t := v.Type
5941 x := v_0
5942 if x.Op != ssaop.OpRISCV64MOVHload {
5943 break
5944 }
5945 off := ssa.AuxIntToInt32(x.AuxInt)
5946 sym := ssa.AuxToSym(x.Aux)
5947 mem := x.Args[1]
5948 ptr := x.Args[0]
5949 if !(x.Uses == 1 && ssa.Clobber(x)) {
5950 break
5951 }
5952 b = x.Block
5953 v0 := b.NewValue0(x.Pos, ssaop.OpRISCV64MOVHUload, t)
5954 v.CopyOf(v0)
5955 v0.AuxInt = ssa.Int32ToAuxInt(off)
5956 v0.Aux = ssa.SymToAux(sym)
5957 v0.AddArg2(ptr, mem)
5958 return true
5959 }
5960 return false
5961 }
5962 func rewriteValue_OpRISCV64MOVHload(v *ssa.Value) bool {
5963 v_1 := v.Args[1]
5964 v_0 := v.Args[0]
5965 b := v.Block
5966 config := b.Func.Config
5967
5968
5969
5970 for {
5971 off1 := ssa.AuxIntToInt32(v.AuxInt)
5972 sym1 := ssa.AuxToSym(v.Aux)
5973 if v_0.Op != ssaop.OpRISCV64MOVaddr {
5974 break
5975 }
5976 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
5977 sym2 := ssa.AuxToSym(v_0.Aux)
5978 base := v_0.Args[0]
5979 mem := v_1
5980 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
5981 break
5982 }
5983 v.Reset(ssaop.OpRISCV64MOVHload)
5984 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
5985 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
5986 v.AddArg2(base, mem)
5987 return true
5988 }
5989
5990
5991
5992 for {
5993 off1 := ssa.AuxIntToInt32(v.AuxInt)
5994 sym := ssa.AuxToSym(v.Aux)
5995 if v_0.Op != ssaop.OpRISCV64ADDI {
5996 break
5997 }
5998 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
5999 base := v_0.Args[0]
6000 mem := v_1
6001 if !(ssa.Is32Bit(int64(off1) + off2)) {
6002 break
6003 }
6004 v.Reset(ssaop.OpRISCV64MOVHload)
6005 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
6006 v.Aux = ssa.SymToAux(sym)
6007 v.AddArg2(base, mem)
6008 return true
6009 }
6010
6011
6012
6013 for {
6014 off := ssa.AuxIntToInt32(v.AuxInt)
6015 sym := ssa.AuxToSym(v.Aux)
6016 ptr1 := v_0
6017 if v_1.Op != ssaop.OpRISCV64MOVHstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
6018 break
6019 }
6020 x := v_1.Args[1]
6021 ptr2 := v_1.Args[0]
6022 if !(ssa.IsSamePtr(ptr1, ptr2)) {
6023 break
6024 }
6025 v.Reset(ssaop.OpRISCV64MOVHreg)
6026 v.AddArg(x)
6027 return true
6028 }
6029 return false
6030 }
6031 func rewriteValue_OpRISCV64MOVHreg(v *ssa.Value) bool {
6032 v_0 := v.Args[0]
6033 b := v.Block
6034
6035
6036
6037 for {
6038 x := v_0
6039 if x.Op != ssaop.OpRISCV64ANDI {
6040 break
6041 }
6042 c := ssa.AuxIntToInt64(x.AuxInt)
6043 if !(c >= 0 && int64(int16(c)) == c) {
6044 break
6045 }
6046 v.CopyOf(x)
6047 return true
6048 }
6049
6050
6051 for {
6052 if v_0.Op != ssaop.OpRISCV64MOVDconst {
6053 break
6054 }
6055 c := ssa.AuxIntToInt64(v_0.AuxInt)
6056 v.Reset(ssaop.OpRISCV64MOVDconst)
6057 v.AuxInt = ssa.Int64ToAuxInt(int64(int16(c)))
6058 return true
6059 }
6060
6061
6062 for {
6063 x := v_0
6064 if x.Op != ssaop.OpRISCV64MOVBload {
6065 break
6066 }
6067 v.Reset(ssaop.OpRISCV64MOVDreg)
6068 v.AddArg(x)
6069 return true
6070 }
6071
6072
6073 for {
6074 x := v_0
6075 if x.Op != ssaop.OpRISCV64MOVBUload {
6076 break
6077 }
6078 v.Reset(ssaop.OpRISCV64MOVDreg)
6079 v.AddArg(x)
6080 return true
6081 }
6082
6083
6084 for {
6085 x := v_0
6086 if x.Op != ssaop.OpRISCV64MOVHload {
6087 break
6088 }
6089 v.Reset(ssaop.OpRISCV64MOVDreg)
6090 v.AddArg(x)
6091 return true
6092 }
6093
6094
6095 for {
6096 x := v_0
6097 if x.Op != ssaop.OpRISCV64MOVBreg {
6098 break
6099 }
6100 v.Reset(ssaop.OpRISCV64MOVDreg)
6101 v.AddArg(x)
6102 return true
6103 }
6104
6105
6106 for {
6107 x := v_0
6108 if x.Op != ssaop.OpRISCV64MOVBUreg {
6109 break
6110 }
6111 v.Reset(ssaop.OpRISCV64MOVDreg)
6112 v.AddArg(x)
6113 return true
6114 }
6115
6116
6117 for {
6118 x := v_0
6119 if x.Op != ssaop.OpRISCV64MOVHreg {
6120 break
6121 }
6122 v.Reset(ssaop.OpRISCV64MOVDreg)
6123 v.AddArg(x)
6124 return true
6125 }
6126
6127
6128
6129 for {
6130 t := v.Type
6131 x := v_0
6132 if x.Op != ssaop.OpRISCV64MOVHUload {
6133 break
6134 }
6135 off := ssa.AuxIntToInt32(x.AuxInt)
6136 sym := ssa.AuxToSym(x.Aux)
6137 mem := x.Args[1]
6138 ptr := x.Args[0]
6139 if !(x.Uses == 1 && ssa.Clobber(x)) {
6140 break
6141 }
6142 b = x.Block
6143 v0 := b.NewValue0(x.Pos, ssaop.OpRISCV64MOVHload, t)
6144 v.CopyOf(v0)
6145 v0.AuxInt = ssa.Int32ToAuxInt(off)
6146 v0.Aux = ssa.SymToAux(sym)
6147 v0.AddArg2(ptr, mem)
6148 return true
6149 }
6150 return false
6151 }
6152 func rewriteValue_OpRISCV64MOVHstore(v *ssa.Value) bool {
6153 v_2 := v.Args[2]
6154 v_1 := v.Args[1]
6155 v_0 := v.Args[0]
6156 b := v.Block
6157 config := b.Func.Config
6158
6159
6160
6161 for {
6162 off1 := ssa.AuxIntToInt32(v.AuxInt)
6163 sym1 := ssa.AuxToSym(v.Aux)
6164 if v_0.Op != ssaop.OpRISCV64MOVaddr {
6165 break
6166 }
6167 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
6168 sym2 := ssa.AuxToSym(v_0.Aux)
6169 base := v_0.Args[0]
6170 val := v_1
6171 mem := v_2
6172 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
6173 break
6174 }
6175 v.Reset(ssaop.OpRISCV64MOVHstore)
6176 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
6177 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
6178 v.AddArg3(base, val, mem)
6179 return true
6180 }
6181
6182
6183
6184 for {
6185 off1 := ssa.AuxIntToInt32(v.AuxInt)
6186 sym := ssa.AuxToSym(v.Aux)
6187 if v_0.Op != ssaop.OpRISCV64ADDI {
6188 break
6189 }
6190 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
6191 base := v_0.Args[0]
6192 val := v_1
6193 mem := v_2
6194 if !(ssa.Is32Bit(int64(off1) + off2)) {
6195 break
6196 }
6197 v.Reset(ssaop.OpRISCV64MOVHstore)
6198 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
6199 v.Aux = ssa.SymToAux(sym)
6200 v.AddArg3(base, val, mem)
6201 return true
6202 }
6203
6204
6205 for {
6206 off := ssa.AuxIntToInt32(v.AuxInt)
6207 sym := ssa.AuxToSym(v.Aux)
6208 ptr := v_0
6209 if v_1.Op != ssaop.OpRISCV64MOVDconst || ssa.AuxIntToInt64(v_1.AuxInt) != 0 {
6210 break
6211 }
6212 mem := v_2
6213 v.Reset(ssaop.OpRISCV64MOVHstorezero)
6214 v.AuxInt = ssa.Int32ToAuxInt(off)
6215 v.Aux = ssa.SymToAux(sym)
6216 v.AddArg2(ptr, mem)
6217 return true
6218 }
6219
6220
6221 for {
6222 off := ssa.AuxIntToInt32(v.AuxInt)
6223 sym := ssa.AuxToSym(v.Aux)
6224 ptr := v_0
6225 if v_1.Op != ssaop.OpRISCV64MOVHreg {
6226 break
6227 }
6228 x := v_1.Args[0]
6229 mem := v_2
6230 v.Reset(ssaop.OpRISCV64MOVHstore)
6231 v.AuxInt = ssa.Int32ToAuxInt(off)
6232 v.Aux = ssa.SymToAux(sym)
6233 v.AddArg3(ptr, x, mem)
6234 return true
6235 }
6236
6237
6238 for {
6239 off := ssa.AuxIntToInt32(v.AuxInt)
6240 sym := ssa.AuxToSym(v.Aux)
6241 ptr := v_0
6242 if v_1.Op != ssaop.OpRISCV64MOVWreg {
6243 break
6244 }
6245 x := v_1.Args[0]
6246 mem := v_2
6247 v.Reset(ssaop.OpRISCV64MOVHstore)
6248 v.AuxInt = ssa.Int32ToAuxInt(off)
6249 v.Aux = ssa.SymToAux(sym)
6250 v.AddArg3(ptr, x, mem)
6251 return true
6252 }
6253
6254
6255 for {
6256 off := ssa.AuxIntToInt32(v.AuxInt)
6257 sym := ssa.AuxToSym(v.Aux)
6258 ptr := v_0
6259 if v_1.Op != ssaop.OpRISCV64MOVHUreg {
6260 break
6261 }
6262 x := v_1.Args[0]
6263 mem := v_2
6264 v.Reset(ssaop.OpRISCV64MOVHstore)
6265 v.AuxInt = ssa.Int32ToAuxInt(off)
6266 v.Aux = ssa.SymToAux(sym)
6267 v.AddArg3(ptr, x, mem)
6268 return true
6269 }
6270
6271
6272 for {
6273 off := ssa.AuxIntToInt32(v.AuxInt)
6274 sym := ssa.AuxToSym(v.Aux)
6275 ptr := v_0
6276 if v_1.Op != ssaop.OpRISCV64MOVWUreg {
6277 break
6278 }
6279 x := v_1.Args[0]
6280 mem := v_2
6281 v.Reset(ssaop.OpRISCV64MOVHstore)
6282 v.AuxInt = ssa.Int32ToAuxInt(off)
6283 v.Aux = ssa.SymToAux(sym)
6284 v.AddArg3(ptr, x, mem)
6285 return true
6286 }
6287 return false
6288 }
6289 func rewriteValue_OpRISCV64MOVHstorezero(v *ssa.Value) bool {
6290 v_1 := v.Args[1]
6291 v_0 := v.Args[0]
6292 b := v.Block
6293 config := b.Func.Config
6294
6295
6296
6297 for {
6298 off1 := ssa.AuxIntToInt32(v.AuxInt)
6299 sym1 := ssa.AuxToSym(v.Aux)
6300 if v_0.Op != ssaop.OpRISCV64MOVaddr {
6301 break
6302 }
6303 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
6304 sym2 := ssa.AuxToSym(v_0.Aux)
6305 base := v_0.Args[0]
6306 mem := v_1
6307 if !(ssa.CanMergeSym(sym1, sym2) && ssa.Is32Bit(int64(off1)+int64(off2)) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
6308 break
6309 }
6310 v.Reset(ssaop.OpRISCV64MOVHstorezero)
6311 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
6312 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
6313 v.AddArg2(base, mem)
6314 return true
6315 }
6316
6317
6318
6319 for {
6320 off1 := ssa.AuxIntToInt32(v.AuxInt)
6321 sym := ssa.AuxToSym(v.Aux)
6322 if v_0.Op != ssaop.OpRISCV64ADDI {
6323 break
6324 }
6325 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
6326 base := v_0.Args[0]
6327 mem := v_1
6328 if !(ssa.Is32Bit(int64(off1) + off2)) {
6329 break
6330 }
6331 v.Reset(ssaop.OpRISCV64MOVHstorezero)
6332 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
6333 v.Aux = ssa.SymToAux(sym)
6334 v.AddArg2(base, mem)
6335 return true
6336 }
6337 return false
6338 }
6339 func rewriteValue_OpRISCV64MOVWUload(v *ssa.Value) bool {
6340 v_1 := v.Args[1]
6341 v_0 := v.Args[0]
6342 b := v.Block
6343 config := b.Func.Config
6344 typ := &b.Func.Config.Types
6345
6346
6347
6348 for {
6349 off1 := ssa.AuxIntToInt32(v.AuxInt)
6350 sym1 := ssa.AuxToSym(v.Aux)
6351 if v_0.Op != ssaop.OpRISCV64MOVaddr {
6352 break
6353 }
6354 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
6355 sym2 := ssa.AuxToSym(v_0.Aux)
6356 base := v_0.Args[0]
6357 mem := v_1
6358 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
6359 break
6360 }
6361 v.Reset(ssaop.OpRISCV64MOVWUload)
6362 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
6363 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
6364 v.AddArg2(base, mem)
6365 return true
6366 }
6367
6368
6369
6370 for {
6371 off1 := ssa.AuxIntToInt32(v.AuxInt)
6372 sym := ssa.AuxToSym(v.Aux)
6373 if v_0.Op != ssaop.OpRISCV64ADDI {
6374 break
6375 }
6376 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
6377 base := v_0.Args[0]
6378 mem := v_1
6379 if !(ssa.Is32Bit(int64(off1) + off2)) {
6380 break
6381 }
6382 v.Reset(ssaop.OpRISCV64MOVWUload)
6383 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
6384 v.Aux = ssa.SymToAux(sym)
6385 v.AddArg2(base, mem)
6386 return true
6387 }
6388
6389
6390
6391 for {
6392 off := ssa.AuxIntToInt32(v.AuxInt)
6393 sym := ssa.AuxToSym(v.Aux)
6394 ptr1 := v_0
6395 if v_1.Op != ssaop.OpRISCV64MOVWstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
6396 break
6397 }
6398 x := v_1.Args[1]
6399 ptr2 := v_1.Args[0]
6400 if !(ssa.IsSamePtr(ptr1, ptr2)) {
6401 break
6402 }
6403 v.Reset(ssaop.OpRISCV64MOVWUreg)
6404 v.AddArg(x)
6405 return true
6406 }
6407
6408
6409
6410 for {
6411 off := ssa.AuxIntToInt32(v.AuxInt)
6412 sym := ssa.AuxToSym(v.Aux)
6413 ptr1 := v_0
6414 if v_1.Op != ssaop.OpRISCV64FMOVWstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
6415 break
6416 }
6417 x := v_1.Args[1]
6418 ptr2 := v_1.Args[0]
6419 if !(ssa.IsSamePtr(ptr1, ptr2)) {
6420 break
6421 }
6422 v.Reset(ssaop.OpRISCV64MOVWUreg)
6423 v0 := b.NewValue0(v_1.Pos, ssaop.OpRISCV64FMVXS, typ.Int32)
6424 v0.AddArg(x)
6425 v.AddArg(v0)
6426 return true
6427 }
6428 return false
6429 }
6430 func rewriteValue_OpRISCV64MOVWUreg(v *ssa.Value) bool {
6431 v_0 := v.Args[0]
6432 b := v.Block
6433 typ := &b.Func.Config.Types
6434
6435
6436
6437 for {
6438 x := v_0
6439 if x.Op != ssaop.OpRISCV64ANDI {
6440 break
6441 }
6442 c := ssa.AuxIntToInt64(x.AuxInt)
6443 if !(c >= 0 && int64(uint32(c)) == c) {
6444 break
6445 }
6446 v.CopyOf(x)
6447 return true
6448 }
6449
6450
6451
6452 for {
6453 if v_0.Op != ssaop.OpRISCV64ANDI {
6454 break
6455 }
6456 c := ssa.AuxIntToInt64(v_0.AuxInt)
6457 x := v_0.Args[0]
6458 if !(c < 0) {
6459 break
6460 }
6461 v.Reset(ssaop.OpRISCV64AND)
6462 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
6463 v0.AuxInt = ssa.Int64ToAuxInt(int64(uint32(c)))
6464 v.AddArg2(v0, x)
6465 return true
6466 }
6467
6468
6469
6470 for {
6471 x := v_0
6472 if x.Op != ssaop.OpRISCV64SRLI {
6473 break
6474 }
6475 c := ssa.AuxIntToInt64(x.AuxInt)
6476 if !(c >= 32) {
6477 break
6478 }
6479 v.CopyOf(x)
6480 return true
6481 }
6482
6483
6484 for {
6485 x := v_0
6486 if x.Op != ssaop.OpRISCV64SRLIW {
6487 break
6488 }
6489 v.CopyOf(x)
6490 return true
6491 }
6492
6493
6494 for {
6495 if v_0.Op != ssaop.OpRISCV64MOVDconst {
6496 break
6497 }
6498 c := ssa.AuxIntToInt64(v_0.AuxInt)
6499 v.Reset(ssaop.OpRISCV64MOVDconst)
6500 v.AuxInt = ssa.Int64ToAuxInt(int64(uint32(c)))
6501 return true
6502 }
6503
6504
6505 for {
6506 x := v_0
6507 if x.Op != ssaop.OpRISCV64MOVBUload {
6508 break
6509 }
6510 v.Reset(ssaop.OpRISCV64MOVDreg)
6511 v.AddArg(x)
6512 return true
6513 }
6514
6515
6516 for {
6517 x := v_0
6518 if x.Op != ssaop.OpRISCV64MOVHUload {
6519 break
6520 }
6521 v.Reset(ssaop.OpRISCV64MOVDreg)
6522 v.AddArg(x)
6523 return true
6524 }
6525
6526
6527 for {
6528 x := v_0
6529 if x.Op != ssaop.OpRISCV64MOVWUload {
6530 break
6531 }
6532 v.Reset(ssaop.OpRISCV64MOVDreg)
6533 v.AddArg(x)
6534 return true
6535 }
6536
6537
6538 for {
6539 x := v_0
6540 if x.Op != ssaop.OpRISCV64MOVBUreg {
6541 break
6542 }
6543 v.Reset(ssaop.OpRISCV64MOVDreg)
6544 v.AddArg(x)
6545 return true
6546 }
6547
6548
6549 for {
6550 x := v_0
6551 if x.Op != ssaop.OpRISCV64MOVHUreg {
6552 break
6553 }
6554 v.Reset(ssaop.OpRISCV64MOVDreg)
6555 v.AddArg(x)
6556 return true
6557 }
6558
6559
6560 for {
6561 x := v_0
6562 if x.Op != ssaop.OpRISCV64MOVWUreg {
6563 break
6564 }
6565 v.Reset(ssaop.OpRISCV64MOVDreg)
6566 v.AddArg(x)
6567 return true
6568 }
6569
6570
6571
6572 for {
6573 t := v.Type
6574 x := v_0
6575 if x.Op != ssaop.OpRISCV64MOVWload {
6576 break
6577 }
6578 off := ssa.AuxIntToInt32(x.AuxInt)
6579 sym := ssa.AuxToSym(x.Aux)
6580 mem := x.Args[1]
6581 ptr := x.Args[0]
6582 if !(x.Uses == 1 && ssa.Clobber(x)) {
6583 break
6584 }
6585 b = x.Block
6586 v0 := b.NewValue0(x.Pos, ssaop.OpRISCV64MOVWUload, t)
6587 v.CopyOf(v0)
6588 v0.AuxInt = ssa.Int32ToAuxInt(off)
6589 v0.Aux = ssa.SymToAux(sym)
6590 v0.AddArg2(ptr, mem)
6591 return true
6592 }
6593 return false
6594 }
6595 func rewriteValue_OpRISCV64MOVWload(v *ssa.Value) bool {
6596 v_1 := v.Args[1]
6597 v_0 := v.Args[0]
6598 b := v.Block
6599 config := b.Func.Config
6600
6601
6602
6603 for {
6604 off1 := ssa.AuxIntToInt32(v.AuxInt)
6605 sym1 := ssa.AuxToSym(v.Aux)
6606 if v_0.Op != ssaop.OpRISCV64MOVaddr {
6607 break
6608 }
6609 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
6610 sym2 := ssa.AuxToSym(v_0.Aux)
6611 base := v_0.Args[0]
6612 mem := v_1
6613 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
6614 break
6615 }
6616 v.Reset(ssaop.OpRISCV64MOVWload)
6617 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
6618 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
6619 v.AddArg2(base, mem)
6620 return true
6621 }
6622
6623
6624
6625 for {
6626 off1 := ssa.AuxIntToInt32(v.AuxInt)
6627 sym := ssa.AuxToSym(v.Aux)
6628 if v_0.Op != ssaop.OpRISCV64ADDI {
6629 break
6630 }
6631 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
6632 base := v_0.Args[0]
6633 mem := v_1
6634 if !(ssa.Is32Bit(int64(off1) + off2)) {
6635 break
6636 }
6637 v.Reset(ssaop.OpRISCV64MOVWload)
6638 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
6639 v.Aux = ssa.SymToAux(sym)
6640 v.AddArg2(base, mem)
6641 return true
6642 }
6643
6644
6645
6646 for {
6647 off := ssa.AuxIntToInt32(v.AuxInt)
6648 sym := ssa.AuxToSym(v.Aux)
6649 ptr1 := v_0
6650 if v_1.Op != ssaop.OpRISCV64MOVWstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
6651 break
6652 }
6653 x := v_1.Args[1]
6654 ptr2 := v_1.Args[0]
6655 if !(ssa.IsSamePtr(ptr1, ptr2)) {
6656 break
6657 }
6658 v.Reset(ssaop.OpRISCV64MOVWreg)
6659 v.AddArg(x)
6660 return true
6661 }
6662
6663
6664
6665 for {
6666 off := ssa.AuxIntToInt32(v.AuxInt)
6667 sym := ssa.AuxToSym(v.Aux)
6668 ptr1 := v_0
6669 if v_1.Op != ssaop.OpRISCV64FMOVWstore || ssa.AuxIntToInt32(v_1.AuxInt) != off || ssa.AuxToSym(v_1.Aux) != sym {
6670 break
6671 }
6672 x := v_1.Args[1]
6673 ptr2 := v_1.Args[0]
6674 if !(ssa.IsSamePtr(ptr1, ptr2)) {
6675 break
6676 }
6677 v.Reset(ssaop.OpRISCV64FMVXS)
6678 v.AddArg(x)
6679 return true
6680 }
6681 return false
6682 }
6683 func rewriteValue_OpRISCV64MOVWreg(v *ssa.Value) bool {
6684 v_0 := v.Args[0]
6685 b := v.Block
6686
6687
6688
6689 for {
6690 x := v_0
6691 if x.Op != ssaop.OpRISCV64ANDI {
6692 break
6693 }
6694 c := ssa.AuxIntToInt64(x.AuxInt)
6695 if !(c >= 0 && int64(int32(c)) == c) {
6696 break
6697 }
6698 v.CopyOf(x)
6699 return true
6700 }
6701
6702
6703 for {
6704 if v_0.Op != ssaop.OpRISCV64NEG {
6705 break
6706 }
6707 x := v_0.Args[0]
6708 v.Reset(ssaop.OpRISCV64NEGW)
6709 v.AddArg(x)
6710 return true
6711 }
6712
6713
6714 for {
6715 if v_0.Op != ssaop.OpRISCV64MOVDconst {
6716 break
6717 }
6718 c := ssa.AuxIntToInt64(v_0.AuxInt)
6719 v.Reset(ssaop.OpRISCV64MOVDconst)
6720 v.AuxInt = ssa.Int64ToAuxInt(int64(int32(c)))
6721 return true
6722 }
6723
6724
6725 for {
6726 x := v_0
6727 if x.Op != ssaop.OpRISCV64MOVBload {
6728 break
6729 }
6730 v.Reset(ssaop.OpRISCV64MOVDreg)
6731 v.AddArg(x)
6732 return true
6733 }
6734
6735
6736 for {
6737 x := v_0
6738 if x.Op != ssaop.OpRISCV64MOVBUload {
6739 break
6740 }
6741 v.Reset(ssaop.OpRISCV64MOVDreg)
6742 v.AddArg(x)
6743 return true
6744 }
6745
6746
6747 for {
6748 x := v_0
6749 if x.Op != ssaop.OpRISCV64MOVHload {
6750 break
6751 }
6752 v.Reset(ssaop.OpRISCV64MOVDreg)
6753 v.AddArg(x)
6754 return true
6755 }
6756
6757
6758 for {
6759 x := v_0
6760 if x.Op != ssaop.OpRISCV64MOVHUload {
6761 break
6762 }
6763 v.Reset(ssaop.OpRISCV64MOVDreg)
6764 v.AddArg(x)
6765 return true
6766 }
6767
6768
6769 for {
6770 x := v_0
6771 if x.Op != ssaop.OpRISCV64MOVWload {
6772 break
6773 }
6774 v.Reset(ssaop.OpRISCV64MOVDreg)
6775 v.AddArg(x)
6776 return true
6777 }
6778
6779
6780
6781 for {
6782 x := v_0
6783 if x.Op != ssaop.OpRISCV64ADDIW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6784 break
6785 }
6786 v.Reset(ssaop.OpRISCV64MOVDreg)
6787 v.AddArg(x)
6788 return true
6789 }
6790
6791
6792
6793 for {
6794 x := v_0
6795 if x.Op != ssaop.OpRISCV64SUBW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6796 break
6797 }
6798 v.Reset(ssaop.OpRISCV64MOVDreg)
6799 v.AddArg(x)
6800 return true
6801 }
6802
6803
6804
6805 for {
6806 x := v_0
6807 if x.Op != ssaop.OpRISCV64NEGW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6808 break
6809 }
6810 v.Reset(ssaop.OpRISCV64MOVDreg)
6811 v.AddArg(x)
6812 return true
6813 }
6814
6815
6816
6817 for {
6818 x := v_0
6819 if x.Op != ssaop.OpRISCV64MULW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6820 break
6821 }
6822 v.Reset(ssaop.OpRISCV64MOVDreg)
6823 v.AddArg(x)
6824 return true
6825 }
6826
6827
6828
6829 for {
6830 x := v_0
6831 if x.Op != ssaop.OpRISCV64DIVW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6832 break
6833 }
6834 v.Reset(ssaop.OpRISCV64MOVDreg)
6835 v.AddArg(x)
6836 return true
6837 }
6838
6839
6840
6841 for {
6842 x := v_0
6843 if x.Op != ssaop.OpRISCV64DIVUW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6844 break
6845 }
6846 v.Reset(ssaop.OpRISCV64MOVDreg)
6847 v.AddArg(x)
6848 return true
6849 }
6850
6851
6852
6853 for {
6854 x := v_0
6855 if x.Op != ssaop.OpRISCV64REMW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6856 break
6857 }
6858 v.Reset(ssaop.OpRISCV64MOVDreg)
6859 v.AddArg(x)
6860 return true
6861 }
6862
6863
6864
6865 for {
6866 x := v_0
6867 if x.Op != ssaop.OpRISCV64REMUW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6868 break
6869 }
6870 v.Reset(ssaop.OpRISCV64MOVDreg)
6871 v.AddArg(x)
6872 return true
6873 }
6874
6875
6876
6877 for {
6878 x := v_0
6879 if x.Op != ssaop.OpRISCV64ROLW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6880 break
6881 }
6882 v.Reset(ssaop.OpRISCV64MOVDreg)
6883 v.AddArg(x)
6884 return true
6885 }
6886
6887
6888
6889 for {
6890 x := v_0
6891 if x.Op != ssaop.OpRISCV64RORW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6892 break
6893 }
6894 v.Reset(ssaop.OpRISCV64MOVDreg)
6895 v.AddArg(x)
6896 return true
6897 }
6898
6899
6900
6901 for {
6902 x := v_0
6903 if x.Op != ssaop.OpRISCV64RORIW || !(x.Type.Size() == 8 || (x.Type.Size() == 4 && x.Type.IsSigned())) {
6904 break
6905 }
6906 v.Reset(ssaop.OpRISCV64MOVDreg)
6907 v.AddArg(x)
6908 return true
6909 }
6910
6911
6912 for {
6913 x := v_0
6914 if x.Op != ssaop.OpRISCV64MOVBreg {
6915 break
6916 }
6917 v.Reset(ssaop.OpRISCV64MOVDreg)
6918 v.AddArg(x)
6919 return true
6920 }
6921
6922
6923 for {
6924 x := v_0
6925 if x.Op != ssaop.OpRISCV64MOVBUreg {
6926 break
6927 }
6928 v.Reset(ssaop.OpRISCV64MOVDreg)
6929 v.AddArg(x)
6930 return true
6931 }
6932
6933
6934 for {
6935 x := v_0
6936 if x.Op != ssaop.OpRISCV64MOVHreg {
6937 break
6938 }
6939 v.Reset(ssaop.OpRISCV64MOVDreg)
6940 v.AddArg(x)
6941 return true
6942 }
6943
6944
6945 for {
6946 x := v_0
6947 if x.Op != ssaop.OpRISCV64MOVWreg {
6948 break
6949 }
6950 v.Reset(ssaop.OpRISCV64MOVDreg)
6951 v.AddArg(x)
6952 return true
6953 }
6954
6955
6956
6957 for {
6958 t := v.Type
6959 x := v_0
6960 if x.Op != ssaop.OpRISCV64MOVWUload {
6961 break
6962 }
6963 off := ssa.AuxIntToInt32(x.AuxInt)
6964 sym := ssa.AuxToSym(x.Aux)
6965 mem := x.Args[1]
6966 ptr := x.Args[0]
6967 if !(x.Uses == 1 && ssa.Clobber(x)) {
6968 break
6969 }
6970 b = x.Block
6971 v0 := b.NewValue0(x.Pos, ssaop.OpRISCV64MOVWload, t)
6972 v.CopyOf(v0)
6973 v0.AuxInt = ssa.Int32ToAuxInt(off)
6974 v0.Aux = ssa.SymToAux(sym)
6975 v0.AddArg2(ptr, mem)
6976 return true
6977 }
6978 return false
6979 }
6980 func rewriteValue_OpRISCV64MOVWstore(v *ssa.Value) bool {
6981 v_2 := v.Args[2]
6982 v_1 := v.Args[1]
6983 v_0 := v.Args[0]
6984 b := v.Block
6985 config := b.Func.Config
6986
6987
6988
6989 for {
6990 off1 := ssa.AuxIntToInt32(v.AuxInt)
6991 sym1 := ssa.AuxToSym(v.Aux)
6992 if v_0.Op != ssaop.OpRISCV64MOVaddr {
6993 break
6994 }
6995 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
6996 sym2 := ssa.AuxToSym(v_0.Aux)
6997 base := v_0.Args[0]
6998 val := v_1
6999 mem := v_2
7000 if !(ssa.Is32Bit(int64(off1)+int64(off2)) && ssa.CanMergeSym(sym1, sym2) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
7001 break
7002 }
7003 v.Reset(ssaop.OpRISCV64MOVWstore)
7004 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
7005 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
7006 v.AddArg3(base, val, mem)
7007 return true
7008 }
7009
7010
7011
7012 for {
7013 off1 := ssa.AuxIntToInt32(v.AuxInt)
7014 sym := ssa.AuxToSym(v.Aux)
7015 if v_0.Op != ssaop.OpRISCV64ADDI {
7016 break
7017 }
7018 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
7019 base := v_0.Args[0]
7020 val := v_1
7021 mem := v_2
7022 if !(ssa.Is32Bit(int64(off1) + off2)) {
7023 break
7024 }
7025 v.Reset(ssaop.OpRISCV64MOVWstore)
7026 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
7027 v.Aux = ssa.SymToAux(sym)
7028 v.AddArg3(base, val, mem)
7029 return true
7030 }
7031
7032
7033 for {
7034 off := ssa.AuxIntToInt32(v.AuxInt)
7035 sym := ssa.AuxToSym(v.Aux)
7036 ptr := v_0
7037 if v_1.Op != ssaop.OpRISCV64MOVDconst || ssa.AuxIntToInt64(v_1.AuxInt) != 0 {
7038 break
7039 }
7040 mem := v_2
7041 v.Reset(ssaop.OpRISCV64MOVWstorezero)
7042 v.AuxInt = ssa.Int32ToAuxInt(off)
7043 v.Aux = ssa.SymToAux(sym)
7044 v.AddArg2(ptr, mem)
7045 return true
7046 }
7047
7048
7049 for {
7050 off := ssa.AuxIntToInt32(v.AuxInt)
7051 sym := ssa.AuxToSym(v.Aux)
7052 ptr := v_0
7053 if v_1.Op != ssaop.OpRISCV64MOVWreg {
7054 break
7055 }
7056 x := v_1.Args[0]
7057 mem := v_2
7058 v.Reset(ssaop.OpRISCV64MOVWstore)
7059 v.AuxInt = ssa.Int32ToAuxInt(off)
7060 v.Aux = ssa.SymToAux(sym)
7061 v.AddArg3(ptr, x, mem)
7062 return true
7063 }
7064
7065
7066 for {
7067 off := ssa.AuxIntToInt32(v.AuxInt)
7068 sym := ssa.AuxToSym(v.Aux)
7069 ptr := v_0
7070 if v_1.Op != ssaop.OpRISCV64MOVWUreg {
7071 break
7072 }
7073 x := v_1.Args[0]
7074 mem := v_2
7075 v.Reset(ssaop.OpRISCV64MOVWstore)
7076 v.AuxInt = ssa.Int32ToAuxInt(off)
7077 v.Aux = ssa.SymToAux(sym)
7078 v.AddArg3(ptr, x, mem)
7079 return true
7080 }
7081 return false
7082 }
7083 func rewriteValue_OpRISCV64MOVWstorezero(v *ssa.Value) bool {
7084 v_1 := v.Args[1]
7085 v_0 := v.Args[0]
7086 b := v.Block
7087 config := b.Func.Config
7088
7089
7090
7091 for {
7092 off1 := ssa.AuxIntToInt32(v.AuxInt)
7093 sym1 := ssa.AuxToSym(v.Aux)
7094 if v_0.Op != ssaop.OpRISCV64MOVaddr {
7095 break
7096 }
7097 off2 := ssa.AuxIntToInt32(v_0.AuxInt)
7098 sym2 := ssa.AuxToSym(v_0.Aux)
7099 base := v_0.Args[0]
7100 mem := v_1
7101 if !(ssa.CanMergeSym(sym1, sym2) && ssa.Is32Bit(int64(off1)+int64(off2)) && (base.Op != ssaop.OpSB || !config.Ctxt.Flag_dynlink)) {
7102 break
7103 }
7104 v.Reset(ssaop.OpRISCV64MOVWstorezero)
7105 v.AuxInt = ssa.Int32ToAuxInt(off1 + off2)
7106 v.Aux = ssa.SymToAux(ssa.MergeSym(sym1, sym2))
7107 v.AddArg2(base, mem)
7108 return true
7109 }
7110
7111
7112
7113 for {
7114 off1 := ssa.AuxIntToInt32(v.AuxInt)
7115 sym := ssa.AuxToSym(v.Aux)
7116 if v_0.Op != ssaop.OpRISCV64ADDI {
7117 break
7118 }
7119 off2 := ssa.AuxIntToInt64(v_0.AuxInt)
7120 base := v_0.Args[0]
7121 mem := v_1
7122 if !(ssa.Is32Bit(int64(off1) + off2)) {
7123 break
7124 }
7125 v.Reset(ssaop.OpRISCV64MOVWstorezero)
7126 v.AuxInt = ssa.Int32ToAuxInt(off1 + int32(off2))
7127 v.Aux = ssa.SymToAux(sym)
7128 v.AddArg2(base, mem)
7129 return true
7130 }
7131 return false
7132 }
7133 func rewriteValue_OpRISCV64MUL(v *ssa.Value) bool {
7134 v_1 := v.Args[1]
7135 v_0 := v.Args[0]
7136 b := v.Block
7137
7138
7139
7140 for {
7141 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7142 x := v_0
7143 if v_1.Op != ssaop.OpRISCV64MOVDconst {
7144 continue
7145 }
7146 c := ssa.AuxIntToInt64(v_1.AuxInt)
7147 if !(c%3 == 0 && ssa.IsPowerOfTwo(c/3) && buildcfg.GORISCV64 >= 22) {
7148 continue
7149 }
7150 v.Reset(ssaop.OpRISCV64SLLI)
7151 v.AuxInt = ssa.Int64ToAuxInt(ssa.Log64(c / 3))
7152 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SH1ADD, x.Type)
7153 v0.AddArg2(x, x)
7154 v.AddArg(v0)
7155 return true
7156 }
7157 break
7158 }
7159
7160
7161
7162 for {
7163 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7164 x := v_0
7165 if v_1.Op != ssaop.OpRISCV64MOVDconst {
7166 continue
7167 }
7168 c := ssa.AuxIntToInt64(v_1.AuxInt)
7169 if !(c%5 == 0 && ssa.IsPowerOfTwo(c/5) && buildcfg.GORISCV64 >= 22) {
7170 continue
7171 }
7172 v.Reset(ssaop.OpRISCV64SLLI)
7173 v.AuxInt = ssa.Int64ToAuxInt(ssa.Log64(c / 5))
7174 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SH2ADD, x.Type)
7175 v0.AddArg2(x, x)
7176 v.AddArg(v0)
7177 return true
7178 }
7179 break
7180 }
7181
7182
7183
7184 for {
7185 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7186 x := v_0
7187 if v_1.Op != ssaop.OpRISCV64MOVDconst {
7188 continue
7189 }
7190 c := ssa.AuxIntToInt64(v_1.AuxInt)
7191 if !(c%9 == 0 && ssa.IsPowerOfTwo(c/9) && buildcfg.GORISCV64 >= 22) {
7192 continue
7193 }
7194 v.Reset(ssaop.OpRISCV64SLLI)
7195 v.AuxInt = ssa.Int64ToAuxInt(ssa.Log64(c / 9))
7196 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SH3ADD, x.Type)
7197 v0.AddArg2(x, x)
7198 v.AddArg(v0)
7199 return true
7200 }
7201 break
7202 }
7203 return false
7204 }
7205 func rewriteValue_OpRISCV64MULW(v *ssa.Value) bool {
7206 v_1 := v.Args[1]
7207 v_0 := v.Args[0]
7208 b := v.Block
7209
7210
7211
7212 for {
7213 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7214 x := v_0
7215 if v_1.Op != ssaop.OpRISCV64MOVDconst {
7216 continue
7217 }
7218 c := ssa.AuxIntToInt64(v_1.AuxInt)
7219 if !(c%3 == 0 && ssa.IsPowerOfTwo(c/3) && buildcfg.GORISCV64 >= 22) {
7220 continue
7221 }
7222 v.Reset(ssaop.OpRISCV64SLLIW)
7223 v.AuxInt = ssa.Int64ToAuxInt(ssa.Log64(c / 3))
7224 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SH1ADD, x.Type)
7225 v0.AddArg2(x, x)
7226 v.AddArg(v0)
7227 return true
7228 }
7229 break
7230 }
7231
7232
7233
7234 for {
7235 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7236 x := v_0
7237 if v_1.Op != ssaop.OpRISCV64MOVDconst {
7238 continue
7239 }
7240 c := ssa.AuxIntToInt64(v_1.AuxInt)
7241 if !(c%5 == 0 && ssa.IsPowerOfTwo(c/5) && buildcfg.GORISCV64 >= 22) {
7242 continue
7243 }
7244 v.Reset(ssaop.OpRISCV64SLLIW)
7245 v.AuxInt = ssa.Int64ToAuxInt(ssa.Log64(c / 5))
7246 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SH2ADD, x.Type)
7247 v0.AddArg2(x, x)
7248 v.AddArg(v0)
7249 return true
7250 }
7251 break
7252 }
7253
7254
7255
7256 for {
7257 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7258 x := v_0
7259 if v_1.Op != ssaop.OpRISCV64MOVDconst {
7260 continue
7261 }
7262 c := ssa.AuxIntToInt64(v_1.AuxInt)
7263 if !(c%9 == 0 && ssa.IsPowerOfTwo(c/9) && buildcfg.GORISCV64 >= 22) {
7264 continue
7265 }
7266 v.Reset(ssaop.OpRISCV64SLLIW)
7267 v.AuxInt = ssa.Int64ToAuxInt(ssa.Log64(c / 9))
7268 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SH3ADD, x.Type)
7269 v0.AddArg2(x, x)
7270 v.AddArg(v0)
7271 return true
7272 }
7273 break
7274 }
7275 return false
7276 }
7277 func rewriteValue_OpRISCV64NEG(v *ssa.Value) bool {
7278 v_0 := v.Args[0]
7279 b := v.Block
7280
7281
7282 for {
7283 if v_0.Op != ssaop.OpRISCV64SUB {
7284 break
7285 }
7286 y := v_0.Args[1]
7287 x := v_0.Args[0]
7288 v.Reset(ssaop.OpRISCV64SUB)
7289 v.AddArg2(y, x)
7290 return true
7291 }
7292
7293
7294
7295 for {
7296 t := v.Type
7297 s := v_0
7298 if s.Op != ssaop.OpRISCV64ADDI {
7299 break
7300 }
7301 val := ssa.AuxIntToInt64(s.AuxInt)
7302 s_0 := s.Args[0]
7303 if s_0.Op != ssaop.OpRISCV64SUB {
7304 break
7305 }
7306 y := s_0.Args[1]
7307 x := s_0.Args[0]
7308 if !(s.Uses == 1 && ssa.Is32Bit(-val)) {
7309 break
7310 }
7311 v.Reset(ssaop.OpRISCV64ADDI)
7312 v.AuxInt = ssa.Int64ToAuxInt(-val)
7313 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SUB, t)
7314 v0.AddArg2(y, x)
7315 v.AddArg(v0)
7316 return true
7317 }
7318
7319
7320 for {
7321 if v_0.Op != ssaop.OpRISCV64NEG {
7322 break
7323 }
7324 x := v_0.Args[0]
7325 v.CopyOf(x)
7326 return true
7327 }
7328
7329
7330
7331 for {
7332 s := v_0
7333 if s.Op != ssaop.OpRISCV64ADDI {
7334 break
7335 }
7336 val := ssa.AuxIntToInt64(s.AuxInt)
7337 s_0 := s.Args[0]
7338 if s_0.Op != ssaop.OpRISCV64NEG {
7339 break
7340 }
7341 x := s_0.Args[0]
7342 if !(s.Uses == 1 && ssa.Is32Bit(-val)) {
7343 break
7344 }
7345 v.Reset(ssaop.OpRISCV64ADDI)
7346 v.AuxInt = ssa.Int64ToAuxInt(-val)
7347 v.AddArg(x)
7348 return true
7349 }
7350
7351
7352 for {
7353 if v_0.Op != ssaop.OpRISCV64MOVDconst {
7354 break
7355 }
7356 x := ssa.AuxIntToInt64(v_0.AuxInt)
7357 v.Reset(ssaop.OpRISCV64MOVDconst)
7358 v.AuxInt = ssa.Int64ToAuxInt(-x)
7359 return true
7360 }
7361 return false
7362 }
7363 func rewriteValue_OpRISCV64NEGW(v *ssa.Value) bool {
7364 v_0 := v.Args[0]
7365
7366
7367 for {
7368 if v_0.Op != ssaop.OpRISCV64MOVDconst {
7369 break
7370 }
7371 x := ssa.AuxIntToInt64(v_0.AuxInt)
7372 v.Reset(ssaop.OpRISCV64MOVDconst)
7373 v.AuxInt = ssa.Int64ToAuxInt(int64(int32(-x)))
7374 return true
7375 }
7376 return false
7377 }
7378 func rewriteValue_OpRISCV64OR(v *ssa.Value) bool {
7379 v_1 := v.Args[1]
7380 v_0 := v.Args[0]
7381 b := v.Block
7382 typ := &b.Func.Config.Types
7383
7384
7385
7386 for {
7387 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7388 if v_0.Op != ssaop.OpRISCV64MOVDconst {
7389 continue
7390 }
7391 val := ssa.AuxIntToInt64(v_0.AuxInt)
7392 x := v_1
7393 if !(ssa.Is32Bit(val)) {
7394 continue
7395 }
7396 v.Reset(ssaop.OpRISCV64ORI)
7397 v.AuxInt = ssa.Int64ToAuxInt(val)
7398 v.AddArg(x)
7399 return true
7400 }
7401 break
7402 }
7403
7404
7405 for {
7406 x := v_0
7407 if x != v_1 {
7408 break
7409 }
7410 v.CopyOf(x)
7411 return true
7412 }
7413
7414
7415 for {
7416 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7417 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7418 continue
7419 }
7420 t := v_0.Type
7421 cond := v_0.Args[1]
7422 x := v_0.Args[0]
7423 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7424 continue
7425 }
7426 _ = v_1.Args[1]
7427 v_1_0 := v_1.Args[0]
7428 if v_1_0.Op != ssaop.OpRISCV64ADD {
7429 continue
7430 }
7431 _ = v_1_0.Args[1]
7432 v_1_0_0 := v_1_0.Args[0]
7433 v_1_0_1 := v_1_0.Args[1]
7434 for _i1 := 0; _i1 <= 1; _i1, v_1_0_0, v_1_0_1 = _i1+1, v_1_0_1, v_1_0_0 {
7435 if x != v_1_0_0 {
7436 continue
7437 }
7438 y := v_1_0_1
7439 if cond != v_1.Args[1] {
7440 continue
7441 }
7442 v.Reset(ssaop.OpRISCV64ADD)
7443 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZERONEZ, t)
7444 v0.AddArg2(y, cond)
7445 v.AddArg2(x, v0)
7446 return true
7447 }
7448 }
7449 break
7450 }
7451
7452
7453 for {
7454 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7455 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7456 continue
7457 }
7458 t := v_0.Type
7459 cond := v_0.Args[1]
7460 x := v_0.Args[0]
7461 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7462 continue
7463 }
7464 _ = v_1.Args[1]
7465 v_1_0 := v_1.Args[0]
7466 if v_1_0.Op != ssaop.OpRISCV64SUB {
7467 continue
7468 }
7469 y := v_1_0.Args[1]
7470 if x != v_1_0.Args[0] || cond != v_1.Args[1] {
7471 continue
7472 }
7473 v.Reset(ssaop.OpRISCV64SUB)
7474 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZERONEZ, t)
7475 v0.AddArg2(y, cond)
7476 v.AddArg2(x, v0)
7477 return true
7478 }
7479 break
7480 }
7481
7482
7483 for {
7484 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7485 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7486 continue
7487 }
7488 t := v_0.Type
7489 cond := v_0.Args[1]
7490 x := v_0.Args[0]
7491 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7492 continue
7493 }
7494 _ = v_1.Args[1]
7495 v_1_0 := v_1.Args[0]
7496 if v_1_0.Op != ssaop.OpRISCV64OR {
7497 continue
7498 }
7499 _ = v_1_0.Args[1]
7500 v_1_0_0 := v_1_0.Args[0]
7501 v_1_0_1 := v_1_0.Args[1]
7502 for _i1 := 0; _i1 <= 1; _i1, v_1_0_0, v_1_0_1 = _i1+1, v_1_0_1, v_1_0_0 {
7503 if x != v_1_0_0 {
7504 continue
7505 }
7506 y := v_1_0_1
7507 if cond != v_1.Args[1] {
7508 continue
7509 }
7510 v.Reset(ssaop.OpRISCV64OR)
7511 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZERONEZ, t)
7512 v0.AddArg2(y, cond)
7513 v.AddArg2(x, v0)
7514 return true
7515 }
7516 }
7517 break
7518 }
7519
7520
7521 for {
7522 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7523 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7524 continue
7525 }
7526 t := v_0.Type
7527 cond := v_0.Args[1]
7528 x := v_0.Args[0]
7529 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7530 continue
7531 }
7532 _ = v_1.Args[1]
7533 v_1_0 := v_1.Args[0]
7534 if v_1_0.Op != ssaop.OpRISCV64XOR {
7535 continue
7536 }
7537 _ = v_1_0.Args[1]
7538 v_1_0_0 := v_1_0.Args[0]
7539 v_1_0_1 := v_1_0.Args[1]
7540 for _i1 := 0; _i1 <= 1; _i1, v_1_0_0, v_1_0_1 = _i1+1, v_1_0_1, v_1_0_0 {
7541 if x != v_1_0_0 {
7542 continue
7543 }
7544 y := v_1_0_1
7545 if cond != v_1.Args[1] {
7546 continue
7547 }
7548 v.Reset(ssaop.OpRISCV64XOR)
7549 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZERONEZ, t)
7550 v0.AddArg2(y, cond)
7551 v.AddArg2(x, v0)
7552 return true
7553 }
7554 }
7555 break
7556 }
7557
7558
7559 for {
7560 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7561 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7562 continue
7563 }
7564 t := v_0.Type
7565 cond := v_0.Args[1]
7566 x := v_0.Args[0]
7567 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7568 continue
7569 }
7570 _ = v_1.Args[1]
7571 v_1_0 := v_1.Args[0]
7572 if v_1_0.Op != ssaop.OpRISCV64SUBW {
7573 continue
7574 }
7575 y := v_1_0.Args[1]
7576 if x != v_1_0.Args[0] || cond != v_1.Args[1] {
7577 continue
7578 }
7579 v.Reset(ssaop.OpRISCV64SUBW)
7580 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZERONEZ, t)
7581 v0.AddArg2(y, cond)
7582 v.AddArg2(x, v0)
7583 return true
7584 }
7585 break
7586 }
7587
7588
7589 for {
7590 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7591 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7592 continue
7593 }
7594 t := v_0.Type
7595 cond := v_0.Args[1]
7596 v_0_0 := v_0.Args[0]
7597 if v_0_0.Op != ssaop.OpRISCV64ADD {
7598 continue
7599 }
7600 _ = v_0_0.Args[1]
7601 v_0_0_0 := v_0_0.Args[0]
7602 v_0_0_1 := v_0_0.Args[1]
7603 for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
7604 x := v_0_0_0
7605 y := v_0_0_1
7606 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7607 continue
7608 }
7609 _ = v_1.Args[1]
7610 if x != v_1.Args[0] || cond != v_1.Args[1] {
7611 continue
7612 }
7613 v.Reset(ssaop.OpRISCV64ADD)
7614 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZEROEQZ, t)
7615 v0.AddArg2(y, cond)
7616 v.AddArg2(x, v0)
7617 return true
7618 }
7619 }
7620 break
7621 }
7622
7623
7624 for {
7625 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7626 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7627 continue
7628 }
7629 t := v_0.Type
7630 cond := v_0.Args[1]
7631 v_0_0 := v_0.Args[0]
7632 if v_0_0.Op != ssaop.OpRISCV64SUB {
7633 continue
7634 }
7635 y := v_0_0.Args[1]
7636 x := v_0_0.Args[0]
7637 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7638 continue
7639 }
7640 _ = v_1.Args[1]
7641 if x != v_1.Args[0] || cond != v_1.Args[1] {
7642 continue
7643 }
7644 v.Reset(ssaop.OpRISCV64SUB)
7645 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZEROEQZ, t)
7646 v0.AddArg2(y, cond)
7647 v.AddArg2(x, v0)
7648 return true
7649 }
7650 break
7651 }
7652
7653
7654 for {
7655 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7656 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7657 continue
7658 }
7659 t := v_0.Type
7660 cond := v_0.Args[1]
7661 v_0_0 := v_0.Args[0]
7662 if v_0_0.Op != ssaop.OpRISCV64OR {
7663 continue
7664 }
7665 _ = v_0_0.Args[1]
7666 v_0_0_0 := v_0_0.Args[0]
7667 v_0_0_1 := v_0_0.Args[1]
7668 for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
7669 x := v_0_0_0
7670 y := v_0_0_1
7671 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7672 continue
7673 }
7674 _ = v_1.Args[1]
7675 if x != v_1.Args[0] || cond != v_1.Args[1] {
7676 continue
7677 }
7678 v.Reset(ssaop.OpRISCV64OR)
7679 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZEROEQZ, t)
7680 v0.AddArg2(y, cond)
7681 v.AddArg2(x, v0)
7682 return true
7683 }
7684 }
7685 break
7686 }
7687
7688
7689 for {
7690 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7691 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7692 continue
7693 }
7694 t := v_0.Type
7695 cond := v_0.Args[1]
7696 v_0_0 := v_0.Args[0]
7697 if v_0_0.Op != ssaop.OpRISCV64XOR {
7698 continue
7699 }
7700 _ = v_0_0.Args[1]
7701 v_0_0_0 := v_0_0.Args[0]
7702 v_0_0_1 := v_0_0.Args[1]
7703 for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {
7704 x := v_0_0_0
7705 y := v_0_0_1
7706 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7707 continue
7708 }
7709 _ = v_1.Args[1]
7710 if x != v_1.Args[0] || cond != v_1.Args[1] {
7711 continue
7712 }
7713 v.Reset(ssaop.OpRISCV64XOR)
7714 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZEROEQZ, t)
7715 v0.AddArg2(y, cond)
7716 v.AddArg2(x, v0)
7717 return true
7718 }
7719 }
7720 break
7721 }
7722
7723
7724 for {
7725 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7726 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7727 continue
7728 }
7729 t := v_0.Type
7730 cond := v_0.Args[1]
7731 v_0_0 := v_0.Args[0]
7732 if v_0_0.Op != ssaop.OpRISCV64SUBW {
7733 continue
7734 }
7735 y := v_0_0.Args[1]
7736 x := v_0_0.Args[0]
7737 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7738 continue
7739 }
7740 _ = v_1.Args[1]
7741 if x != v_1.Args[0] || cond != v_1.Args[1] {
7742 continue
7743 }
7744 v.Reset(ssaop.OpRISCV64SUBW)
7745 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZEROEQZ, t)
7746 v0.AddArg2(y, cond)
7747 v.AddArg2(x, v0)
7748 return true
7749 }
7750 break
7751 }
7752
7753
7754 for {
7755 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7756 x := v_0
7757 if x.Op != ssaop.OpRISCV64CZEROEQZ {
7758 continue
7759 }
7760 cond := x.Args[1]
7761 z := x.Args[0]
7762 if v_1.Op != ssaop.OpRISCV64CZERONEZ {
7763 continue
7764 }
7765 _ = v_1.Args[1]
7766 y := v_1.Args[0]
7767 if y.Op != ssaop.OpRISCV64AND {
7768 continue
7769 }
7770 y_0 := y.Args[0]
7771 y_1 := y.Args[1]
7772 for _i1 := 0; _i1 <= 1; _i1, y_0, y_1 = _i1+1, y_1, y_0 {
7773 if z != y_0 || cond != v_1.Args[1] {
7774 continue
7775 }
7776 v.Reset(ssaop.OpRISCV64OR)
7777 v.AddArg2(y, x)
7778 return true
7779 }
7780 }
7781 break
7782 }
7783
7784
7785 for {
7786 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7787 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7788 continue
7789 }
7790 cond := v_0.Args[1]
7791 x := v_0.Args[0]
7792 if x.Op != ssaop.OpRISCV64AND {
7793 continue
7794 }
7795 x_0 := x.Args[0]
7796 x_1 := x.Args[1]
7797 for _i1 := 0; _i1 <= 1; _i1, x_0, x_1 = _i1+1, x_1, x_0 {
7798 z := x_0
7799 y := v_1
7800 if y.Op != ssaop.OpRISCV64CZERONEZ {
7801 continue
7802 }
7803 _ = y.Args[1]
7804 if z != y.Args[0] || cond != y.Args[1] {
7805 continue
7806 }
7807 v.Reset(ssaop.OpRISCV64OR)
7808 v.AddArg2(x, y)
7809 return true
7810 }
7811 }
7812 break
7813 }
7814
7815
7816 for {
7817 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7818 x := v_0
7819 if x.Op != ssaop.OpRISCV64CZEROEQZ {
7820 continue
7821 }
7822 cond := x.Args[1]
7823 z := x.Args[0]
7824 if v_1.Op != ssaop.OpRISCV64CZERONEZ {
7825 continue
7826 }
7827 _ = v_1.Args[1]
7828 y := v_1.Args[0]
7829 if y.Op != ssaop.OpRISCV64ANDI {
7830 continue
7831 }
7832 if z != y.Args[0] || cond != v_1.Args[1] {
7833 continue
7834 }
7835 v.Reset(ssaop.OpRISCV64OR)
7836 v.AddArg2(y, x)
7837 return true
7838 }
7839 break
7840 }
7841
7842
7843 for {
7844 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7845 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7846 continue
7847 }
7848 cond := v_0.Args[1]
7849 x := v_0.Args[0]
7850 if x.Op != ssaop.OpRISCV64ANDI {
7851 continue
7852 }
7853 z := x.Args[0]
7854 y := v_1
7855 if y.Op != ssaop.OpRISCV64CZERONEZ {
7856 continue
7857 }
7858 _ = y.Args[1]
7859 if z != y.Args[0] || cond != y.Args[1] {
7860 continue
7861 }
7862 v.Reset(ssaop.OpRISCV64OR)
7863 v.AddArg2(x, y)
7864 return true
7865 }
7866 break
7867 }
7868
7869
7870 for {
7871 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7872 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7873 continue
7874 }
7875 t := v_0.Type
7876 cond := v_0.Args[1]
7877 x := v_0.Args[0]
7878 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7879 continue
7880 }
7881 _ = v_1.Args[1]
7882 v_1_0 := v_1.Args[0]
7883 if v_1_0.Op != ssaop.OpRISCV64ADDI {
7884 continue
7885 }
7886 c := ssa.AuxIntToInt64(v_1_0.AuxInt)
7887 if x != v_1_0.Args[0] || cond != v_1.Args[1] {
7888 continue
7889 }
7890 v.Reset(ssaop.OpRISCV64ADD)
7891 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZERONEZ, t)
7892 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
7893 v1.AuxInt = ssa.Int64ToAuxInt(c)
7894 v0.AddArg2(v1, cond)
7895 v.AddArg2(x, v0)
7896 return true
7897 }
7898 break
7899 }
7900
7901
7902 for {
7903 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7904 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7905 continue
7906 }
7907 t := v_0.Type
7908 cond := v_0.Args[1]
7909 x := v_0.Args[0]
7910 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7911 continue
7912 }
7913 _ = v_1.Args[1]
7914 v_1_0 := v_1.Args[0]
7915 if v_1_0.Op != ssaop.OpRISCV64ORI {
7916 continue
7917 }
7918 c := ssa.AuxIntToInt64(v_1_0.AuxInt)
7919 if x != v_1_0.Args[0] || cond != v_1.Args[1] {
7920 continue
7921 }
7922 v.Reset(ssaop.OpRISCV64OR)
7923 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZERONEZ, t)
7924 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
7925 v1.AuxInt = ssa.Int64ToAuxInt(c)
7926 v0.AddArg2(v1, cond)
7927 v.AddArg2(x, v0)
7928 return true
7929 }
7930 break
7931 }
7932
7933
7934 for {
7935 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7936 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7937 continue
7938 }
7939 t := v_0.Type
7940 cond := v_0.Args[1]
7941 x := v_0.Args[0]
7942 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7943 continue
7944 }
7945 _ = v_1.Args[1]
7946 v_1_0 := v_1.Args[0]
7947 if v_1_0.Op != ssaop.OpRISCV64XORI {
7948 continue
7949 }
7950 c := ssa.AuxIntToInt64(v_1_0.AuxInt)
7951 if x != v_1_0.Args[0] || cond != v_1.Args[1] {
7952 continue
7953 }
7954 v.Reset(ssaop.OpRISCV64XOR)
7955 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZERONEZ, t)
7956 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
7957 v1.AuxInt = ssa.Int64ToAuxInt(c)
7958 v0.AddArg2(v1, cond)
7959 v.AddArg2(x, v0)
7960 return true
7961 }
7962 break
7963 }
7964
7965
7966 for {
7967 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7968 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
7969 continue
7970 }
7971 t := v_0.Type
7972 cond := v_0.Args[1]
7973 v_0_0 := v_0.Args[0]
7974 if v_0_0.Op != ssaop.OpRISCV64ADDI {
7975 continue
7976 }
7977 c := ssa.AuxIntToInt64(v_0_0.AuxInt)
7978 x := v_0_0.Args[0]
7979 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
7980 continue
7981 }
7982 _ = v_1.Args[1]
7983 if x != v_1.Args[0] || cond != v_1.Args[1] {
7984 continue
7985 }
7986 v.Reset(ssaop.OpRISCV64ADD)
7987 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZEROEQZ, t)
7988 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
7989 v1.AuxInt = ssa.Int64ToAuxInt(c)
7990 v0.AddArg2(v1, cond)
7991 v.AddArg2(x, v0)
7992 return true
7993 }
7994 break
7995 }
7996
7997
7998 for {
7999 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8000 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
8001 continue
8002 }
8003 t := v_0.Type
8004 cond := v_0.Args[1]
8005 v_0_0 := v_0.Args[0]
8006 if v_0_0.Op != ssaop.OpRISCV64ORI {
8007 continue
8008 }
8009 c := ssa.AuxIntToInt64(v_0_0.AuxInt)
8010 x := v_0_0.Args[0]
8011 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
8012 continue
8013 }
8014 _ = v_1.Args[1]
8015 if x != v_1.Args[0] || cond != v_1.Args[1] {
8016 continue
8017 }
8018 v.Reset(ssaop.OpRISCV64OR)
8019 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZEROEQZ, t)
8020 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
8021 v1.AuxInt = ssa.Int64ToAuxInt(c)
8022 v0.AddArg2(v1, cond)
8023 v.AddArg2(x, v0)
8024 return true
8025 }
8026 break
8027 }
8028
8029
8030 for {
8031 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8032 if v_0.Op != ssaop.OpRISCV64CZEROEQZ {
8033 continue
8034 }
8035 t := v_0.Type
8036 cond := v_0.Args[1]
8037 v_0_0 := v_0.Args[0]
8038 if v_0_0.Op != ssaop.OpRISCV64XORI {
8039 continue
8040 }
8041 c := ssa.AuxIntToInt64(v_0_0.AuxInt)
8042 x := v_0_0.Args[0]
8043 if v_1.Op != ssaop.OpRISCV64CZERONEZ || v_1.Type != t {
8044 continue
8045 }
8046 _ = v_1.Args[1]
8047 if x != v_1.Args[0] || cond != v_1.Args[1] {
8048 continue
8049 }
8050 v.Reset(ssaop.OpRISCV64XOR)
8051 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64CZEROEQZ, t)
8052 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
8053 v1.AuxInt = ssa.Int64ToAuxInt(c)
8054 v0.AddArg2(v1, cond)
8055 v.AddArg2(x, v0)
8056 return true
8057 }
8058 break
8059 }
8060 return false
8061 }
8062 func rewriteValue_OpRISCV64ORI(v *ssa.Value) bool {
8063 v_0 := v.Args[0]
8064
8065
8066 for {
8067 if ssa.AuxIntToInt64(v.AuxInt) != 0 {
8068 break
8069 }
8070 x := v_0
8071 v.CopyOf(x)
8072 return true
8073 }
8074
8075
8076 for {
8077 if ssa.AuxIntToInt64(v.AuxInt) != -1 {
8078 break
8079 }
8080 v.Reset(ssaop.OpRISCV64MOVDconst)
8081 v.AuxInt = ssa.Int64ToAuxInt(-1)
8082 return true
8083 }
8084
8085
8086 for {
8087 x := ssa.AuxIntToInt64(v.AuxInt)
8088 if v_0.Op != ssaop.OpRISCV64MOVDconst {
8089 break
8090 }
8091 y := ssa.AuxIntToInt64(v_0.AuxInt)
8092 v.Reset(ssaop.OpRISCV64MOVDconst)
8093 v.AuxInt = ssa.Int64ToAuxInt(x | y)
8094 return true
8095 }
8096
8097
8098 for {
8099 x := ssa.AuxIntToInt64(v.AuxInt)
8100 if v_0.Op != ssaop.OpRISCV64ORI {
8101 break
8102 }
8103 y := ssa.AuxIntToInt64(v_0.AuxInt)
8104 z := v_0.Args[0]
8105 v.Reset(ssaop.OpRISCV64ORI)
8106 v.AuxInt = ssa.Int64ToAuxInt(x | y)
8107 v.AddArg(z)
8108 return true
8109 }
8110 return false
8111 }
8112 func rewriteValue_OpRISCV64ORN(v *ssa.Value) bool {
8113 v_1 := v.Args[1]
8114 v_0 := v.Args[0]
8115
8116
8117 for {
8118 x := v_0
8119 if x != v_1 {
8120 break
8121 }
8122 v.Reset(ssaop.OpRISCV64MOVDconst)
8123 v.AuxInt = ssa.Int64ToAuxInt(-1)
8124 return true
8125 }
8126 return false
8127 }
8128 func rewriteValue_OpRISCV64ROL(v *ssa.Value) bool {
8129 v_1 := v.Args[1]
8130 v_0 := v.Args[0]
8131
8132
8133 for {
8134 x := v_0
8135 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8136 break
8137 }
8138 val := ssa.AuxIntToInt64(v_1.AuxInt)
8139 v.Reset(ssaop.OpRISCV64RORI)
8140 v.AuxInt = ssa.Int64ToAuxInt(-val & 63)
8141 v.AddArg(x)
8142 return true
8143 }
8144
8145
8146 for {
8147 x := v_0
8148 if v_1.Op != ssaop.OpRISCV64NEG {
8149 break
8150 }
8151 y := v_1.Args[0]
8152 v.Reset(ssaop.OpRISCV64ROR)
8153 v.AddArg2(x, y)
8154 return true
8155 }
8156 return false
8157 }
8158 func rewriteValue_OpRISCV64ROLW(v *ssa.Value) bool {
8159 v_1 := v.Args[1]
8160 v_0 := v.Args[0]
8161
8162
8163 for {
8164 x := v_0
8165 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8166 break
8167 }
8168 val := ssa.AuxIntToInt64(v_1.AuxInt)
8169 v.Reset(ssaop.OpRISCV64RORIW)
8170 v.AuxInt = ssa.Int64ToAuxInt(-val & 31)
8171 v.AddArg(x)
8172 return true
8173 }
8174
8175
8176 for {
8177 x := v_0
8178 if v_1.Op != ssaop.OpRISCV64NEG {
8179 break
8180 }
8181 y := v_1.Args[0]
8182 v.Reset(ssaop.OpRISCV64RORW)
8183 v.AddArg2(x, y)
8184 return true
8185 }
8186 return false
8187 }
8188 func rewriteValue_OpRISCV64ROR(v *ssa.Value) bool {
8189 v_1 := v.Args[1]
8190 v_0 := v.Args[0]
8191
8192
8193 for {
8194 x := v_0
8195 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8196 break
8197 }
8198 val := ssa.AuxIntToInt64(v_1.AuxInt)
8199 v.Reset(ssaop.OpRISCV64RORI)
8200 v.AuxInt = ssa.Int64ToAuxInt(val & 63)
8201 v.AddArg(x)
8202 return true
8203 }
8204 return false
8205 }
8206 func rewriteValue_OpRISCV64RORW(v *ssa.Value) bool {
8207 v_1 := v.Args[1]
8208 v_0 := v.Args[0]
8209
8210
8211 for {
8212 x := v_0
8213 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8214 break
8215 }
8216 val := ssa.AuxIntToInt64(v_1.AuxInt)
8217 v.Reset(ssaop.OpRISCV64RORIW)
8218 v.AuxInt = ssa.Int64ToAuxInt(val & 31)
8219 v.AddArg(x)
8220 return true
8221 }
8222 return false
8223 }
8224 func rewriteValue_OpRISCV64SEQZ(v *ssa.Value) bool {
8225 v_0 := v.Args[0]
8226 b := v.Block
8227 typ := &b.Func.Config.Types
8228
8229
8230 for {
8231 if v_0.Op != ssaop.OpRISCV64NEG {
8232 break
8233 }
8234 x := v_0.Args[0]
8235 v.Reset(ssaop.OpRISCV64SEQZ)
8236 v.AddArg(x)
8237 return true
8238 }
8239
8240
8241 for {
8242 if v_0.Op != ssaop.OpRISCV64SEQZ {
8243 break
8244 }
8245 x := v_0.Args[0]
8246 v.Reset(ssaop.OpRISCV64SNEZ)
8247 v.AddArg(x)
8248 return true
8249 }
8250
8251
8252 for {
8253 if v_0.Op != ssaop.OpRISCV64SNEZ {
8254 break
8255 }
8256 x := v_0.Args[0]
8257 v.Reset(ssaop.OpRISCV64SEQZ)
8258 v.AddArg(x)
8259 return true
8260 }
8261
8262
8263 for {
8264 if v_0.Op != ssaop.OpRISCV64ANDI {
8265 break
8266 }
8267 c := ssa.AuxIntToInt64(v_0.AuxInt)
8268 v_0_0 := v_0.Args[0]
8269 if v_0_0.Op != ssaop.OpRISCV64FCLASSD {
8270 break
8271 }
8272 v_0_0_0 := v_0_0.Args[0]
8273 if v_0_0_0.Op != ssaop.OpRISCV64FNEGD {
8274 break
8275 }
8276 x := v_0_0_0.Args[0]
8277 v.Reset(ssaop.OpRISCV64SEQZ)
8278 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
8279 v0.AuxInt = ssa.Int64ToAuxInt((c & 0b11_0000_0000) | int64(bits.Reverse8(uint8(c))&0b1111_1111))
8280 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
8281 v1.AddArg(x)
8282 v0.AddArg(v1)
8283 v.AddArg(v0)
8284 return true
8285 }
8286
8287
8288 for {
8289 if v_0.Op != ssaop.OpRISCV64ANDI {
8290 break
8291 }
8292 c := ssa.AuxIntToInt64(v_0.AuxInt)
8293 v_0_0 := v_0.Args[0]
8294 if v_0_0.Op != ssaop.OpRISCV64FCLASSD {
8295 break
8296 }
8297 v_0_0_0 := v_0_0.Args[0]
8298 if v_0_0_0.Op != ssaop.OpRISCV64FABSD {
8299 break
8300 }
8301 x := v_0_0_0.Args[0]
8302 v.Reset(ssaop.OpRISCV64SEQZ)
8303 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
8304 v0.AuxInt = ssa.Int64ToAuxInt((c & 0b11_1111_0000) | int64(bits.Reverse8(uint8(c))&0b0000_1111))
8305 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
8306 v1.AddArg(x)
8307 v0.AddArg(v1)
8308 v.AddArg(v0)
8309 return true
8310 }
8311 return false
8312 }
8313 func rewriteValue_OpRISCV64SLL(v *ssa.Value) bool {
8314 v_1 := v.Args[1]
8315 v_0 := v.Args[0]
8316
8317
8318 for {
8319 x := v_0
8320 if v_1.Op != ssaop.OpRISCV64ANDI || ssa.AuxIntToInt64(v_1.AuxInt) != 63 {
8321 break
8322 }
8323 y := v_1.Args[0]
8324 v.Reset(ssaop.OpRISCV64SLL)
8325 v.AddArg2(x, y)
8326 return true
8327 }
8328
8329
8330 for {
8331 x := v_0
8332 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8333 break
8334 }
8335 val := ssa.AuxIntToInt64(v_1.AuxInt)
8336 v.Reset(ssaop.OpRISCV64SLLI)
8337 v.AuxInt = ssa.Int64ToAuxInt(val & 63)
8338 v.AddArg(x)
8339 return true
8340 }
8341 return false
8342 }
8343 func rewriteValue_OpRISCV64SLLI(v *ssa.Value) bool {
8344 v_0 := v.Args[0]
8345
8346
8347
8348 for {
8349 x := ssa.AuxIntToInt64(v.AuxInt)
8350 if v_0.Op != ssaop.OpRISCV64MOVDconst {
8351 break
8352 }
8353 y := ssa.AuxIntToInt64(v_0.AuxInt)
8354 if !(ssa.Is32Bit(y << uint32(x))) {
8355 break
8356 }
8357 v.Reset(ssaop.OpRISCV64MOVDconst)
8358 v.AuxInt = ssa.Int64ToAuxInt(y << uint32(x))
8359 return true
8360 }
8361
8362
8363
8364 for {
8365 t := v.Type
8366 c := ssa.AuxIntToInt64(v.AuxInt)
8367 if v_0.Op != ssaop.OpRISCV64ADD {
8368 break
8369 }
8370 x := v_0.Args[1]
8371 if x != v_0.Args[0] || !(c < t.Size()*8-1) {
8372 break
8373 }
8374 v.Reset(ssaop.OpRISCV64SLLI)
8375 v.AuxInt = ssa.Int64ToAuxInt(c + 1)
8376 v.AddArg(x)
8377 return true
8378 }
8379
8380
8381
8382 for {
8383 t := v.Type
8384 c := ssa.AuxIntToInt64(v.AuxInt)
8385 if v_0.Op != ssaop.OpRISCV64ADD {
8386 break
8387 }
8388 x := v_0.Args[1]
8389 if x != v_0.Args[0] || !(c >= t.Size()*8-1) {
8390 break
8391 }
8392 v.Reset(ssaop.OpRISCV64MOVDconst)
8393 v.AuxInt = ssa.Int64ToAuxInt(0)
8394 return true
8395 }
8396 return false
8397 }
8398 func rewriteValue_OpRISCV64SLLW(v *ssa.Value) bool {
8399 v_1 := v.Args[1]
8400 v_0 := v.Args[0]
8401
8402
8403 for {
8404 x := v_0
8405 if v_1.Op != ssaop.OpRISCV64ANDI || ssa.AuxIntToInt64(v_1.AuxInt) != 31 {
8406 break
8407 }
8408 y := v_1.Args[0]
8409 v.Reset(ssaop.OpRISCV64SLLW)
8410 v.AddArg2(x, y)
8411 return true
8412 }
8413
8414
8415 for {
8416 x := v_0
8417 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8418 break
8419 }
8420 val := ssa.AuxIntToInt64(v_1.AuxInt)
8421 v.Reset(ssaop.OpRISCV64SLLIW)
8422 v.AuxInt = ssa.Int64ToAuxInt(val & 31)
8423 v.AddArg(x)
8424 return true
8425 }
8426 return false
8427 }
8428 func rewriteValue_OpRISCV64SLT(v *ssa.Value) bool {
8429 v_1 := v.Args[1]
8430 v_0 := v.Args[0]
8431
8432
8433
8434 for {
8435 x := v_0
8436 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8437 break
8438 }
8439 val := ssa.AuxIntToInt64(v_1.AuxInt)
8440 if !(ssa.Is12Bit(val)) {
8441 break
8442 }
8443 v.Reset(ssaop.OpRISCV64SLTI)
8444 v.AuxInt = ssa.Int64ToAuxInt(val)
8445 v.AddArg(x)
8446 return true
8447 }
8448
8449
8450 for {
8451 x := v_0
8452 if x != v_1 {
8453 break
8454 }
8455 v.Reset(ssaop.OpRISCV64MOVDconst)
8456 v.AuxInt = ssa.Int64ToAuxInt(0)
8457 return true
8458 }
8459 return false
8460 }
8461 func rewriteValue_OpRISCV64SLTI(v *ssa.Value) bool {
8462 v_0 := v.Args[0]
8463
8464
8465 for {
8466 x := ssa.AuxIntToInt64(v.AuxInt)
8467 if v_0.Op != ssaop.OpRISCV64MOVDconst {
8468 break
8469 }
8470 y := ssa.AuxIntToInt64(v_0.AuxInt)
8471 v.Reset(ssaop.OpRISCV64MOVDconst)
8472 v.AuxInt = ssa.Int64ToAuxInt(ssa.B2i(int64(y) < int64(x)))
8473 return true
8474 }
8475
8476
8477
8478 for {
8479 x := ssa.AuxIntToInt64(v.AuxInt)
8480 if v_0.Op != ssaop.OpRISCV64ANDI {
8481 break
8482 }
8483 y := ssa.AuxIntToInt64(v_0.AuxInt)
8484 if !(y >= 0 && int64(y) < int64(x)) {
8485 break
8486 }
8487 v.Reset(ssaop.OpRISCV64MOVDconst)
8488 v.AuxInt = ssa.Int64ToAuxInt(1)
8489 return true
8490 }
8491 return false
8492 }
8493 func rewriteValue_OpRISCV64SLTIU(v *ssa.Value) bool {
8494 v_0 := v.Args[0]
8495
8496
8497 for {
8498 x := ssa.AuxIntToInt64(v.AuxInt)
8499 if v_0.Op != ssaop.OpRISCV64MOVDconst {
8500 break
8501 }
8502 y := ssa.AuxIntToInt64(v_0.AuxInt)
8503 v.Reset(ssaop.OpRISCV64MOVDconst)
8504 v.AuxInt = ssa.Int64ToAuxInt(ssa.B2i(uint64(y) < uint64(x)))
8505 return true
8506 }
8507
8508
8509
8510 for {
8511 x := ssa.AuxIntToInt64(v.AuxInt)
8512 if v_0.Op != ssaop.OpRISCV64ANDI {
8513 break
8514 }
8515 y := ssa.AuxIntToInt64(v_0.AuxInt)
8516 if !(y >= 0 && uint64(y) < uint64(x)) {
8517 break
8518 }
8519 v.Reset(ssaop.OpRISCV64MOVDconst)
8520 v.AuxInt = ssa.Int64ToAuxInt(1)
8521 return true
8522 }
8523
8524
8525
8526 for {
8527 x := ssa.AuxIntToInt64(v.AuxInt)
8528 if v_0.Op != ssaop.OpRISCV64ORI {
8529 break
8530 }
8531 y := ssa.AuxIntToInt64(v_0.AuxInt)
8532 if !(y >= 0 && uint64(y) >= uint64(x)) {
8533 break
8534 }
8535 v.Reset(ssaop.OpRISCV64MOVDconst)
8536 v.AuxInt = ssa.Int64ToAuxInt(0)
8537 return true
8538 }
8539 return false
8540 }
8541 func rewriteValue_OpRISCV64SLTU(v *ssa.Value) bool {
8542 v_1 := v.Args[1]
8543 v_0 := v.Args[0]
8544
8545
8546
8547 for {
8548 x := v_0
8549 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8550 break
8551 }
8552 val := ssa.AuxIntToInt64(v_1.AuxInt)
8553 if !(ssa.Is12Bit(val)) {
8554 break
8555 }
8556 v.Reset(ssaop.OpRISCV64SLTIU)
8557 v.AuxInt = ssa.Int64ToAuxInt(val)
8558 v.AddArg(x)
8559 return true
8560 }
8561
8562
8563 for {
8564 x := v_0
8565 if x != v_1 {
8566 break
8567 }
8568 v.Reset(ssaop.OpRISCV64MOVDconst)
8569 v.AuxInt = ssa.Int64ToAuxInt(0)
8570 return true
8571 }
8572 return false
8573 }
8574 func rewriteValue_OpRISCV64SNEZ(v *ssa.Value) bool {
8575 v_0 := v.Args[0]
8576 b := v.Block
8577 typ := &b.Func.Config.Types
8578
8579
8580 for {
8581 if v_0.Op != ssaop.OpRISCV64NEG {
8582 break
8583 }
8584 x := v_0.Args[0]
8585 v.Reset(ssaop.OpRISCV64SNEZ)
8586 v.AddArg(x)
8587 return true
8588 }
8589
8590
8591 for {
8592 if v_0.Op != ssaop.OpRISCV64SEQZ {
8593 break
8594 }
8595 x := v_0.Args[0]
8596 v.Reset(ssaop.OpRISCV64SEQZ)
8597 v.AddArg(x)
8598 return true
8599 }
8600
8601
8602 for {
8603 if v_0.Op != ssaop.OpRISCV64SNEZ {
8604 break
8605 }
8606 x := v_0.Args[0]
8607 v.Reset(ssaop.OpRISCV64SNEZ)
8608 v.AddArg(x)
8609 return true
8610 }
8611
8612
8613 for {
8614 if v_0.Op != ssaop.OpRISCV64ANDI {
8615 break
8616 }
8617 c := ssa.AuxIntToInt64(v_0.AuxInt)
8618 v_0_0 := v_0.Args[0]
8619 if v_0_0.Op != ssaop.OpRISCV64FCLASSD {
8620 break
8621 }
8622 v_0_0_0 := v_0_0.Args[0]
8623 if v_0_0_0.Op != ssaop.OpRISCV64FNEGD {
8624 break
8625 }
8626 x := v_0_0_0.Args[0]
8627 v.Reset(ssaop.OpRISCV64SNEZ)
8628 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
8629 v0.AuxInt = ssa.Int64ToAuxInt((c & 0b11_0000_0000) | int64(bits.Reverse8(uint8(c))&0b1111_1111))
8630 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
8631 v1.AddArg(x)
8632 v0.AddArg(v1)
8633 v.AddArg(v0)
8634 return true
8635 }
8636
8637
8638 for {
8639 if v_0.Op != ssaop.OpRISCV64ANDI {
8640 break
8641 }
8642 c := ssa.AuxIntToInt64(v_0.AuxInt)
8643 v_0_0 := v_0.Args[0]
8644 if v_0_0.Op != ssaop.OpRISCV64FCLASSD {
8645 break
8646 }
8647 v_0_0_0 := v_0_0.Args[0]
8648 if v_0_0_0.Op != ssaop.OpRISCV64FABSD {
8649 break
8650 }
8651 x := v_0_0_0.Args[0]
8652 v.Reset(ssaop.OpRISCV64SNEZ)
8653 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
8654 v0.AuxInt = ssa.Int64ToAuxInt((c & 0b11_1111_0000) | int64(bits.Reverse8(uint8(c))&0b0000_1111))
8655 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
8656 v1.AddArg(x)
8657 v0.AddArg(v1)
8658 v.AddArg(v0)
8659 return true
8660 }
8661 return false
8662 }
8663 func rewriteValue_OpRISCV64SRA(v *ssa.Value) bool {
8664 v_1 := v.Args[1]
8665 v_0 := v.Args[0]
8666
8667
8668 for {
8669 x := v_0
8670 if v_1.Op != ssaop.OpRISCV64ANDI || ssa.AuxIntToInt64(v_1.AuxInt) != 63 {
8671 break
8672 }
8673 y := v_1.Args[0]
8674 v.Reset(ssaop.OpRISCV64SRA)
8675 v.AddArg2(x, y)
8676 return true
8677 }
8678
8679
8680 for {
8681 x := v_0
8682 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8683 break
8684 }
8685 val := ssa.AuxIntToInt64(v_1.AuxInt)
8686 v.Reset(ssaop.OpRISCV64SRAI)
8687 v.AuxInt = ssa.Int64ToAuxInt(val & 63)
8688 v.AddArg(x)
8689 return true
8690 }
8691 return false
8692 }
8693 func rewriteValue_OpRISCV64SRAI(v *ssa.Value) bool {
8694 v_0 := v.Args[0]
8695 b := v.Block
8696
8697
8698
8699 for {
8700 x := ssa.AuxIntToInt64(v.AuxInt)
8701 if v_0.Op != ssaop.OpRISCV64MOVWreg {
8702 break
8703 }
8704 y := v_0.Args[0]
8705 if !(x >= 0 && x <= 31) {
8706 break
8707 }
8708 v.Reset(ssaop.OpRISCV64SRAIW)
8709 v.AuxInt = ssa.Int64ToAuxInt(x)
8710 v.AddArg(y)
8711 return true
8712 }
8713
8714
8715
8716 for {
8717 t := v.Type
8718 x := ssa.AuxIntToInt64(v.AuxInt)
8719 if v_0.Op != ssaop.OpRISCV64MOVBreg {
8720 break
8721 }
8722 y := v_0.Args[0]
8723 if !(x >= 8) {
8724 break
8725 }
8726 v.Reset(ssaop.OpRISCV64SRAI)
8727 v.AuxInt = ssa.Int64ToAuxInt(63)
8728 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLLI, t)
8729 v0.AuxInt = ssa.Int64ToAuxInt(56)
8730 v0.AddArg(y)
8731 v.AddArg(v0)
8732 return true
8733 }
8734
8735
8736
8737 for {
8738 t := v.Type
8739 x := ssa.AuxIntToInt64(v.AuxInt)
8740 if v_0.Op != ssaop.OpRISCV64MOVHreg {
8741 break
8742 }
8743 y := v_0.Args[0]
8744 if !(x >= 16) {
8745 break
8746 }
8747 v.Reset(ssaop.OpRISCV64SRAI)
8748 v.AuxInt = ssa.Int64ToAuxInt(63)
8749 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLLI, t)
8750 v0.AuxInt = ssa.Int64ToAuxInt(48)
8751 v0.AddArg(y)
8752 v.AddArg(v0)
8753 return true
8754 }
8755
8756
8757
8758 for {
8759 x := ssa.AuxIntToInt64(v.AuxInt)
8760 if v_0.Op != ssaop.OpRISCV64MOVWreg {
8761 break
8762 }
8763 y := v_0.Args[0]
8764 if !(x >= 32) {
8765 break
8766 }
8767 v.Reset(ssaop.OpRISCV64SRAIW)
8768 v.AuxInt = ssa.Int64ToAuxInt(31)
8769 v.AddArg(y)
8770 return true
8771 }
8772
8773
8774 for {
8775 x := ssa.AuxIntToInt64(v.AuxInt)
8776 if v_0.Op != ssaop.OpRISCV64MOVDconst {
8777 break
8778 }
8779 y := ssa.AuxIntToInt64(v_0.AuxInt)
8780 v.Reset(ssaop.OpRISCV64MOVDconst)
8781 v.AuxInt = ssa.Int64ToAuxInt(int64(y) >> uint32(x))
8782 return true
8783 }
8784 return false
8785 }
8786 func rewriteValue_OpRISCV64SRAW(v *ssa.Value) bool {
8787 v_1 := v.Args[1]
8788 v_0 := v.Args[0]
8789
8790
8791 for {
8792 x := v_0
8793 if v_1.Op != ssaop.OpRISCV64ANDI || ssa.AuxIntToInt64(v_1.AuxInt) != 31 {
8794 break
8795 }
8796 y := v_1.Args[0]
8797 v.Reset(ssaop.OpRISCV64SRAW)
8798 v.AddArg2(x, y)
8799 return true
8800 }
8801
8802
8803 for {
8804 x := v_0
8805 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8806 break
8807 }
8808 val := ssa.AuxIntToInt64(v_1.AuxInt)
8809 v.Reset(ssaop.OpRISCV64SRAIW)
8810 v.AuxInt = ssa.Int64ToAuxInt(val & 31)
8811 v.AddArg(x)
8812 return true
8813 }
8814 return false
8815 }
8816 func rewriteValue_OpRISCV64SRL(v *ssa.Value) bool {
8817 v_1 := v.Args[1]
8818 v_0 := v.Args[0]
8819
8820
8821 for {
8822 x := v_0
8823 if v_1.Op != ssaop.OpRISCV64ANDI || ssa.AuxIntToInt64(v_1.AuxInt) != 63 {
8824 break
8825 }
8826 y := v_1.Args[0]
8827 v.Reset(ssaop.OpRISCV64SRL)
8828 v.AddArg2(x, y)
8829 return true
8830 }
8831
8832
8833 for {
8834 x := v_0
8835 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8836 break
8837 }
8838 val := ssa.AuxIntToInt64(v_1.AuxInt)
8839 v.Reset(ssaop.OpRISCV64SRLI)
8840 v.AuxInt = ssa.Int64ToAuxInt(val & 63)
8841 v.AddArg(x)
8842 return true
8843 }
8844 return false
8845 }
8846 func rewriteValue_OpRISCV64SRLI(v *ssa.Value) bool {
8847 v_0 := v.Args[0]
8848
8849
8850
8851 for {
8852 x := ssa.AuxIntToInt64(v.AuxInt)
8853 if v_0.Op != ssaop.OpRISCV64MOVWUreg {
8854 break
8855 }
8856 y := v_0.Args[0]
8857 if !(x >= 0 && x <= 31) {
8858 break
8859 }
8860 v.Reset(ssaop.OpRISCV64SRLIW)
8861 v.AuxInt = ssa.Int64ToAuxInt(x)
8862 v.AddArg(y)
8863 return true
8864 }
8865
8866
8867
8868 for {
8869 x := ssa.AuxIntToInt64(v.AuxInt)
8870 if v_0.Op != ssaop.OpRISCV64MOVBUreg {
8871 break
8872 }
8873 if !(x >= 8) {
8874 break
8875 }
8876 v.Reset(ssaop.OpRISCV64MOVDconst)
8877 v.AuxInt = ssa.Int64ToAuxInt(0)
8878 return true
8879 }
8880
8881
8882
8883 for {
8884 x := ssa.AuxIntToInt64(v.AuxInt)
8885 if v_0.Op != ssaop.OpRISCV64MOVHUreg {
8886 break
8887 }
8888 if !(x >= 16) {
8889 break
8890 }
8891 v.Reset(ssaop.OpRISCV64MOVDconst)
8892 v.AuxInt = ssa.Int64ToAuxInt(0)
8893 return true
8894 }
8895
8896
8897
8898 for {
8899 x := ssa.AuxIntToInt64(v.AuxInt)
8900 if v_0.Op != ssaop.OpRISCV64MOVWUreg {
8901 break
8902 }
8903 if !(x >= 32) {
8904 break
8905 }
8906 v.Reset(ssaop.OpRISCV64MOVDconst)
8907 v.AuxInt = ssa.Int64ToAuxInt(0)
8908 return true
8909 }
8910
8911
8912 for {
8913 x := ssa.AuxIntToInt64(v.AuxInt)
8914 if v_0.Op != ssaop.OpRISCV64MOVDconst {
8915 break
8916 }
8917 y := ssa.AuxIntToInt64(v_0.AuxInt)
8918 v.Reset(ssaop.OpRISCV64MOVDconst)
8919 v.AuxInt = ssa.Int64ToAuxInt(int64(uint64(y) >> uint32(x)))
8920 return true
8921 }
8922 return false
8923 }
8924 func rewriteValue_OpRISCV64SRLW(v *ssa.Value) bool {
8925 v_1 := v.Args[1]
8926 v_0 := v.Args[0]
8927
8928
8929 for {
8930 x := v_0
8931 if v_1.Op != ssaop.OpRISCV64ANDI || ssa.AuxIntToInt64(v_1.AuxInt) != 31 {
8932 break
8933 }
8934 y := v_1.Args[0]
8935 v.Reset(ssaop.OpRISCV64SRLW)
8936 v.AddArg2(x, y)
8937 return true
8938 }
8939
8940
8941 for {
8942 x := v_0
8943 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8944 break
8945 }
8946 val := ssa.AuxIntToInt64(v_1.AuxInt)
8947 v.Reset(ssaop.OpRISCV64SRLIW)
8948 v.AuxInt = ssa.Int64ToAuxInt(val & 31)
8949 v.AddArg(x)
8950 return true
8951 }
8952 return false
8953 }
8954 func rewriteValue_OpRISCV64SUB(v *ssa.Value) bool {
8955 v_1 := v.Args[1]
8956 v_0 := v.Args[0]
8957 b := v.Block
8958
8959
8960 for {
8961 x := v_0
8962 if v_1.Op != ssaop.OpRISCV64NEG {
8963 break
8964 }
8965 y := v_1.Args[0]
8966 v.Reset(ssaop.OpRISCV64ADD)
8967 v.AddArg2(x, y)
8968 return true
8969 }
8970
8971
8972 for {
8973 x := v_0
8974 if x != v_1 {
8975 break
8976 }
8977 v.Reset(ssaop.OpRISCV64MOVDconst)
8978 v.AuxInt = ssa.Int64ToAuxInt(0)
8979 return true
8980 }
8981
8982
8983
8984 for {
8985 x := v_0
8986 if v_1.Op != ssaop.OpRISCV64MOVDconst {
8987 break
8988 }
8989 val := ssa.AuxIntToInt64(v_1.AuxInt)
8990 if !(ssa.Is32Bit(-val)) {
8991 break
8992 }
8993 v.Reset(ssaop.OpRISCV64ADDI)
8994 v.AuxInt = ssa.Int64ToAuxInt(-val)
8995 v.AddArg(x)
8996 return true
8997 }
8998
8999
9000
9001 for {
9002 t := v.Type
9003 if v_0.Op != ssaop.OpRISCV64MOVDconst {
9004 break
9005 }
9006 val := ssa.AuxIntToInt64(v_0.AuxInt)
9007 y := v_1
9008 if !(ssa.Is32Bit(-val)) {
9009 break
9010 }
9011 v.Reset(ssaop.OpRISCV64NEG)
9012 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, t)
9013 v0.AuxInt = ssa.Int64ToAuxInt(-val)
9014 v0.AddArg(y)
9015 v.AddArg(v0)
9016 return true
9017 }
9018
9019
9020 for {
9021 x := v_0
9022 if v_1.Op != ssaop.OpRISCV64MOVDconst || ssa.AuxIntToInt64(v_1.AuxInt) != 0 {
9023 break
9024 }
9025 v.CopyOf(x)
9026 return true
9027 }
9028
9029
9030 for {
9031 if v_0.Op != ssaop.OpRISCV64MOVDconst || ssa.AuxIntToInt64(v_0.AuxInt) != 0 {
9032 break
9033 }
9034 x := v_1
9035 v.Reset(ssaop.OpRISCV64NEG)
9036 v.AddArg(x)
9037 return true
9038 }
9039 return false
9040 }
9041 func rewriteValue_OpRISCV64SUBW(v *ssa.Value) bool {
9042 v_1 := v.Args[1]
9043 v_0 := v.Args[0]
9044
9045
9046 for {
9047 x := v_0
9048 if v_1.Op != ssaop.OpRISCV64MOVDconst || ssa.AuxIntToInt64(v_1.AuxInt) != 0 {
9049 break
9050 }
9051 v.Reset(ssaop.OpRISCV64ADDIW)
9052 v.AuxInt = ssa.Int64ToAuxInt(0)
9053 v.AddArg(x)
9054 return true
9055 }
9056
9057
9058 for {
9059 if v_0.Op != ssaop.OpRISCV64MOVDconst || ssa.AuxIntToInt64(v_0.AuxInt) != 0 {
9060 break
9061 }
9062 x := v_1
9063 v.Reset(ssaop.OpRISCV64NEGW)
9064 v.AddArg(x)
9065 return true
9066 }
9067 return false
9068 }
9069 func rewriteValue_OpRISCV64XOR(v *ssa.Value) bool {
9070 v_1 := v.Args[1]
9071 v_0 := v.Args[0]
9072
9073
9074
9075 for {
9076 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9077 if v_0.Op != ssaop.OpRISCV64MOVDconst {
9078 continue
9079 }
9080 val := ssa.AuxIntToInt64(v_0.AuxInt)
9081 x := v_1
9082 if !(ssa.Is32Bit(val)) {
9083 continue
9084 }
9085 v.Reset(ssaop.OpRISCV64XORI)
9086 v.AuxInt = ssa.Int64ToAuxInt(val)
9087 v.AddArg(x)
9088 return true
9089 }
9090 break
9091 }
9092
9093
9094 for {
9095 x := v_0
9096 if x != v_1 {
9097 break
9098 }
9099 v.Reset(ssaop.OpRISCV64MOVDconst)
9100 v.AuxInt = ssa.Int64ToAuxInt(0)
9101 return true
9102 }
9103 return false
9104 }
9105 func rewriteValue_OpRotateLeft16(v *ssa.Value) bool {
9106 v_1 := v.Args[1]
9107 v_0 := v.Args[0]
9108 b := v.Block
9109 typ := &b.Func.Config.Types
9110
9111
9112 for {
9113 t := v.Type
9114 x := v_0
9115 y := v_1
9116 v.Reset(ssaop.OpRISCV64OR)
9117 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, t)
9118 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, y.Type)
9119 v1.AuxInt = ssa.Int64ToAuxInt(15)
9120 v1.AddArg(y)
9121 v0.AddArg2(x, v1)
9122 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
9123 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9124 v3.AddArg(x)
9125 v4 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, y.Type)
9126 v4.AuxInt = ssa.Int64ToAuxInt(15)
9127 v5 := b.NewValue0(v.Pos, ssaop.OpRISCV64NEG, y.Type)
9128 v5.AddArg(y)
9129 v4.AddArg(v5)
9130 v2.AddArg2(v3, v4)
9131 v.AddArg2(v0, v2)
9132 return true
9133 }
9134 }
9135 func rewriteValue_OpRotateLeft8(v *ssa.Value) bool {
9136 v_1 := v.Args[1]
9137 v_0 := v.Args[0]
9138 b := v.Block
9139 typ := &b.Func.Config.Types
9140
9141
9142 for {
9143 t := v.Type
9144 x := v_0
9145 y := v_1
9146 v.Reset(ssaop.OpRISCV64OR)
9147 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLL, t)
9148 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, y.Type)
9149 v1.AuxInt = ssa.Int64ToAuxInt(7)
9150 v1.AddArg(y)
9151 v0.AddArg2(x, v1)
9152 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
9153 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
9154 v3.AddArg(x)
9155 v4 := b.NewValue0(v.Pos, ssaop.OpRISCV64ANDI, y.Type)
9156 v4.AuxInt = ssa.Int64ToAuxInt(7)
9157 v5 := b.NewValue0(v.Pos, ssaop.OpRISCV64NEG, y.Type)
9158 v5.AddArg(y)
9159 v4.AddArg(v5)
9160 v2.AddArg2(v3, v4)
9161 v.AddArg2(v0, v2)
9162 return true
9163 }
9164 }
9165 func rewriteValue_OpRsh16Ux16(v *ssa.Value) bool {
9166 v_1 := v.Args[1]
9167 v_0 := v.Args[0]
9168 b := v.Block
9169 typ := &b.Func.Config.Types
9170
9171
9172
9173 for {
9174 t := v.Type
9175 x := v_0
9176 y := v_1
9177 if !(!ssa.ShiftIsBounded(v)) {
9178 break
9179 }
9180 v.Reset(ssaop.OpRISCV64AND)
9181 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
9182 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9183 v1.AddArg(x)
9184 v0.AddArg2(v1, y)
9185 v2 := b.NewValue0(v.Pos, ssaop.OpNeg16, t)
9186 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9187 v3.AuxInt = ssa.Int64ToAuxInt(64)
9188 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9189 v4.AddArg(y)
9190 v3.AddArg(v4)
9191 v2.AddArg(v3)
9192 v.AddArg2(v0, v2)
9193 return true
9194 }
9195
9196
9197
9198 for {
9199 x := v_0
9200 y := v_1
9201 if !(ssa.ShiftIsBounded(v)) {
9202 break
9203 }
9204 v.Reset(ssaop.OpRISCV64SRL)
9205 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9206 v0.AddArg(x)
9207 v.AddArg2(v0, y)
9208 return true
9209 }
9210 return false
9211 }
9212 func rewriteValue_OpRsh16Ux32(v *ssa.Value) bool {
9213 v_1 := v.Args[1]
9214 v_0 := v.Args[0]
9215 b := v.Block
9216 typ := &b.Func.Config.Types
9217
9218
9219
9220 for {
9221 t := v.Type
9222 x := v_0
9223 y := v_1
9224 if !(!ssa.ShiftIsBounded(v)) {
9225 break
9226 }
9227 v.Reset(ssaop.OpRISCV64AND)
9228 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
9229 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9230 v1.AddArg(x)
9231 v0.AddArg2(v1, y)
9232 v2 := b.NewValue0(v.Pos, ssaop.OpNeg16, t)
9233 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9234 v3.AuxInt = ssa.Int64ToAuxInt(64)
9235 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
9236 v4.AddArg(y)
9237 v3.AddArg(v4)
9238 v2.AddArg(v3)
9239 v.AddArg2(v0, v2)
9240 return true
9241 }
9242
9243
9244
9245 for {
9246 x := v_0
9247 y := v_1
9248 if !(ssa.ShiftIsBounded(v)) {
9249 break
9250 }
9251 v.Reset(ssaop.OpRISCV64SRL)
9252 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9253 v0.AddArg(x)
9254 v.AddArg2(v0, y)
9255 return true
9256 }
9257 return false
9258 }
9259 func rewriteValue_OpRsh16Ux64(v *ssa.Value) bool {
9260 v_1 := v.Args[1]
9261 v_0 := v.Args[0]
9262 b := v.Block
9263 typ := &b.Func.Config.Types
9264
9265
9266
9267 for {
9268 t := v.Type
9269 x := v_0
9270 y := v_1
9271 if !(!ssa.ShiftIsBounded(v)) {
9272 break
9273 }
9274 v.Reset(ssaop.OpRISCV64AND)
9275 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
9276 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9277 v1.AddArg(x)
9278 v0.AddArg2(v1, y)
9279 v2 := b.NewValue0(v.Pos, ssaop.OpNeg16, t)
9280 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9281 v3.AuxInt = ssa.Int64ToAuxInt(64)
9282 v3.AddArg(y)
9283 v2.AddArg(v3)
9284 v.AddArg2(v0, v2)
9285 return true
9286 }
9287
9288
9289
9290 for {
9291 x := v_0
9292 y := v_1
9293 if !(ssa.ShiftIsBounded(v)) {
9294 break
9295 }
9296 v.Reset(ssaop.OpRISCV64SRL)
9297 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9298 v0.AddArg(x)
9299 v.AddArg2(v0, y)
9300 return true
9301 }
9302 return false
9303 }
9304 func rewriteValue_OpRsh16Ux8(v *ssa.Value) bool {
9305 v_1 := v.Args[1]
9306 v_0 := v.Args[0]
9307 b := v.Block
9308 typ := &b.Func.Config.Types
9309
9310
9311
9312 for {
9313 t := v.Type
9314 x := v_0
9315 y := v_1
9316 if !(!ssa.ShiftIsBounded(v)) {
9317 break
9318 }
9319 v.Reset(ssaop.OpRISCV64AND)
9320 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
9321 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9322 v1.AddArg(x)
9323 v0.AddArg2(v1, y)
9324 v2 := b.NewValue0(v.Pos, ssaop.OpNeg16, t)
9325 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9326 v3.AuxInt = ssa.Int64ToAuxInt(64)
9327 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
9328 v4.AddArg(y)
9329 v3.AddArg(v4)
9330 v2.AddArg(v3)
9331 v.AddArg2(v0, v2)
9332 return true
9333 }
9334
9335
9336
9337 for {
9338 x := v_0
9339 y := v_1
9340 if !(ssa.ShiftIsBounded(v)) {
9341 break
9342 }
9343 v.Reset(ssaop.OpRISCV64SRL)
9344 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9345 v0.AddArg(x)
9346 v.AddArg2(v0, y)
9347 return true
9348 }
9349 return false
9350 }
9351 func rewriteValue_OpRsh16x16(v *ssa.Value) bool {
9352 v_1 := v.Args[1]
9353 v_0 := v.Args[0]
9354 b := v.Block
9355 typ := &b.Func.Config.Types
9356
9357
9358
9359 for {
9360 t := v.Type
9361 x := v_0
9362 y := v_1
9363 if !(!ssa.ShiftIsBounded(v)) {
9364 break
9365 }
9366 v.Reset(ssaop.OpRISCV64SRA)
9367 v.Type = t
9368 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to64, typ.Int64)
9369 v0.AddArg(x)
9370 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
9371 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
9372 v2.AuxInt = ssa.Int64ToAuxInt(-1)
9373 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
9374 v3.AuxInt = ssa.Int64ToAuxInt(64)
9375 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9376 v4.AddArg(y)
9377 v3.AddArg(v4)
9378 v2.AddArg(v3)
9379 v1.AddArg2(y, v2)
9380 v.AddArg2(v0, v1)
9381 return true
9382 }
9383
9384
9385
9386 for {
9387 x := v_0
9388 y := v_1
9389 if !(ssa.ShiftIsBounded(v)) {
9390 break
9391 }
9392 v.Reset(ssaop.OpRISCV64SRA)
9393 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to64, typ.Int64)
9394 v0.AddArg(x)
9395 v.AddArg2(v0, y)
9396 return true
9397 }
9398 return false
9399 }
9400 func rewriteValue_OpRsh16x32(v *ssa.Value) bool {
9401 v_1 := v.Args[1]
9402 v_0 := v.Args[0]
9403 b := v.Block
9404 typ := &b.Func.Config.Types
9405
9406
9407
9408 for {
9409 t := v.Type
9410 x := v_0
9411 y := v_1
9412 if !(!ssa.ShiftIsBounded(v)) {
9413 break
9414 }
9415 v.Reset(ssaop.OpRISCV64SRA)
9416 v.Type = t
9417 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to64, typ.Int64)
9418 v0.AddArg(x)
9419 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
9420 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
9421 v2.AuxInt = ssa.Int64ToAuxInt(-1)
9422 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
9423 v3.AuxInt = ssa.Int64ToAuxInt(64)
9424 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
9425 v4.AddArg(y)
9426 v3.AddArg(v4)
9427 v2.AddArg(v3)
9428 v1.AddArg2(y, v2)
9429 v.AddArg2(v0, v1)
9430 return true
9431 }
9432
9433
9434
9435 for {
9436 x := v_0
9437 y := v_1
9438 if !(ssa.ShiftIsBounded(v)) {
9439 break
9440 }
9441 v.Reset(ssaop.OpRISCV64SRA)
9442 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to64, typ.Int64)
9443 v0.AddArg(x)
9444 v.AddArg2(v0, y)
9445 return true
9446 }
9447 return false
9448 }
9449 func rewriteValue_OpRsh16x64(v *ssa.Value) bool {
9450 v_1 := v.Args[1]
9451 v_0 := v.Args[0]
9452 b := v.Block
9453 typ := &b.Func.Config.Types
9454
9455
9456
9457 for {
9458 t := v.Type
9459 x := v_0
9460 y := v_1
9461 if !(!ssa.ShiftIsBounded(v)) {
9462 break
9463 }
9464 v.Reset(ssaop.OpRISCV64SRA)
9465 v.Type = t
9466 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to64, typ.Int64)
9467 v0.AddArg(x)
9468 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
9469 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
9470 v2.AuxInt = ssa.Int64ToAuxInt(-1)
9471 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
9472 v3.AuxInt = ssa.Int64ToAuxInt(64)
9473 v3.AddArg(y)
9474 v2.AddArg(v3)
9475 v1.AddArg2(y, v2)
9476 v.AddArg2(v0, v1)
9477 return true
9478 }
9479
9480
9481
9482 for {
9483 x := v_0
9484 y := v_1
9485 if !(ssa.ShiftIsBounded(v)) {
9486 break
9487 }
9488 v.Reset(ssaop.OpRISCV64SRA)
9489 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to64, typ.Int64)
9490 v0.AddArg(x)
9491 v.AddArg2(v0, y)
9492 return true
9493 }
9494 return false
9495 }
9496 func rewriteValue_OpRsh16x8(v *ssa.Value) bool {
9497 v_1 := v.Args[1]
9498 v_0 := v.Args[0]
9499 b := v.Block
9500 typ := &b.Func.Config.Types
9501
9502
9503
9504 for {
9505 t := v.Type
9506 x := v_0
9507 y := v_1
9508 if !(!ssa.ShiftIsBounded(v)) {
9509 break
9510 }
9511 v.Reset(ssaop.OpRISCV64SRA)
9512 v.Type = t
9513 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to64, typ.Int64)
9514 v0.AddArg(x)
9515 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
9516 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
9517 v2.AuxInt = ssa.Int64ToAuxInt(-1)
9518 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
9519 v3.AuxInt = ssa.Int64ToAuxInt(64)
9520 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
9521 v4.AddArg(y)
9522 v3.AddArg(v4)
9523 v2.AddArg(v3)
9524 v1.AddArg2(y, v2)
9525 v.AddArg2(v0, v1)
9526 return true
9527 }
9528
9529
9530
9531 for {
9532 x := v_0
9533 y := v_1
9534 if !(ssa.ShiftIsBounded(v)) {
9535 break
9536 }
9537 v.Reset(ssaop.OpRISCV64SRA)
9538 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to64, typ.Int64)
9539 v0.AddArg(x)
9540 v.AddArg2(v0, y)
9541 return true
9542 }
9543 return false
9544 }
9545 func rewriteValue_OpRsh32Ux16(v *ssa.Value) bool {
9546 v_1 := v.Args[1]
9547 v_0 := v.Args[0]
9548 b := v.Block
9549 typ := &b.Func.Config.Types
9550
9551
9552
9553 for {
9554 t := v.Type
9555 x := v_0
9556 y := v_1
9557 if !(!ssa.ShiftIsBounded(v)) {
9558 break
9559 }
9560 v.Reset(ssaop.OpRISCV64AND)
9561 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRLW, t)
9562 v0.AddArg2(x, y)
9563 v1 := b.NewValue0(v.Pos, ssaop.OpNeg32, t)
9564 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9565 v2.AuxInt = ssa.Int64ToAuxInt(32)
9566 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9567 v3.AddArg(y)
9568 v2.AddArg(v3)
9569 v1.AddArg(v2)
9570 v.AddArg2(v0, v1)
9571 return true
9572 }
9573
9574
9575
9576 for {
9577 x := v_0
9578 y := v_1
9579 if !(ssa.ShiftIsBounded(v)) {
9580 break
9581 }
9582 v.Reset(ssaop.OpRISCV64SRLW)
9583 v.AddArg2(x, y)
9584 return true
9585 }
9586 return false
9587 }
9588 func rewriteValue_OpRsh32Ux32(v *ssa.Value) bool {
9589 v_1 := v.Args[1]
9590 v_0 := v.Args[0]
9591 b := v.Block
9592 typ := &b.Func.Config.Types
9593
9594
9595
9596 for {
9597 t := v.Type
9598 x := v_0
9599 y := v_1
9600 if !(!ssa.ShiftIsBounded(v)) {
9601 break
9602 }
9603 v.Reset(ssaop.OpRISCV64AND)
9604 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRLW, t)
9605 v0.AddArg2(x, y)
9606 v1 := b.NewValue0(v.Pos, ssaop.OpNeg32, t)
9607 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9608 v2.AuxInt = ssa.Int64ToAuxInt(32)
9609 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
9610 v3.AddArg(y)
9611 v2.AddArg(v3)
9612 v1.AddArg(v2)
9613 v.AddArg2(v0, v1)
9614 return true
9615 }
9616
9617
9618
9619 for {
9620 x := v_0
9621 y := v_1
9622 if !(ssa.ShiftIsBounded(v)) {
9623 break
9624 }
9625 v.Reset(ssaop.OpRISCV64SRLW)
9626 v.AddArg2(x, y)
9627 return true
9628 }
9629 return false
9630 }
9631 func rewriteValue_OpRsh32Ux64(v *ssa.Value) bool {
9632 v_1 := v.Args[1]
9633 v_0 := v.Args[0]
9634 b := v.Block
9635
9636
9637
9638 for {
9639 t := v.Type
9640 x := v_0
9641 y := v_1
9642 if !(!ssa.ShiftIsBounded(v)) {
9643 break
9644 }
9645 v.Reset(ssaop.OpRISCV64AND)
9646 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRLW, t)
9647 v0.AddArg2(x, y)
9648 v1 := b.NewValue0(v.Pos, ssaop.OpNeg32, t)
9649 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9650 v2.AuxInt = ssa.Int64ToAuxInt(32)
9651 v2.AddArg(y)
9652 v1.AddArg(v2)
9653 v.AddArg2(v0, v1)
9654 return true
9655 }
9656
9657
9658
9659 for {
9660 x := v_0
9661 y := v_1
9662 if !(ssa.ShiftIsBounded(v)) {
9663 break
9664 }
9665 v.Reset(ssaop.OpRISCV64SRLW)
9666 v.AddArg2(x, y)
9667 return true
9668 }
9669 return false
9670 }
9671 func rewriteValue_OpRsh32Ux8(v *ssa.Value) bool {
9672 v_1 := v.Args[1]
9673 v_0 := v.Args[0]
9674 b := v.Block
9675 typ := &b.Func.Config.Types
9676
9677
9678
9679 for {
9680 t := v.Type
9681 x := v_0
9682 y := v_1
9683 if !(!ssa.ShiftIsBounded(v)) {
9684 break
9685 }
9686 v.Reset(ssaop.OpRISCV64AND)
9687 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRLW, t)
9688 v0.AddArg2(x, y)
9689 v1 := b.NewValue0(v.Pos, ssaop.OpNeg32, t)
9690 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9691 v2.AuxInt = ssa.Int64ToAuxInt(32)
9692 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
9693 v3.AddArg(y)
9694 v2.AddArg(v3)
9695 v1.AddArg(v2)
9696 v.AddArg2(v0, v1)
9697 return true
9698 }
9699
9700
9701
9702 for {
9703 x := v_0
9704 y := v_1
9705 if !(ssa.ShiftIsBounded(v)) {
9706 break
9707 }
9708 v.Reset(ssaop.OpRISCV64SRLW)
9709 v.AddArg2(x, y)
9710 return true
9711 }
9712 return false
9713 }
9714 func rewriteValue_OpRsh32x16(v *ssa.Value) bool {
9715 v_1 := v.Args[1]
9716 v_0 := v.Args[0]
9717 b := v.Block
9718 typ := &b.Func.Config.Types
9719
9720
9721
9722 for {
9723 t := v.Type
9724 x := v_0
9725 y := v_1
9726 if !(!ssa.ShiftIsBounded(v)) {
9727 break
9728 }
9729 v.Reset(ssaop.OpRISCV64SRAW)
9730 v.Type = t
9731 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
9732 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
9733 v1.AuxInt = ssa.Int64ToAuxInt(-1)
9734 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
9735 v2.AuxInt = ssa.Int64ToAuxInt(32)
9736 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9737 v3.AddArg(y)
9738 v2.AddArg(v3)
9739 v1.AddArg(v2)
9740 v0.AddArg2(y, v1)
9741 v.AddArg2(x, v0)
9742 return true
9743 }
9744
9745
9746
9747 for {
9748 x := v_0
9749 y := v_1
9750 if !(ssa.ShiftIsBounded(v)) {
9751 break
9752 }
9753 v.Reset(ssaop.OpRISCV64SRAW)
9754 v.AddArg2(x, y)
9755 return true
9756 }
9757 return false
9758 }
9759 func rewriteValue_OpRsh32x32(v *ssa.Value) bool {
9760 v_1 := v.Args[1]
9761 v_0 := v.Args[0]
9762 b := v.Block
9763 typ := &b.Func.Config.Types
9764
9765
9766
9767 for {
9768 t := v.Type
9769 x := v_0
9770 y := v_1
9771 if !(!ssa.ShiftIsBounded(v)) {
9772 break
9773 }
9774 v.Reset(ssaop.OpRISCV64SRAW)
9775 v.Type = t
9776 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
9777 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
9778 v1.AuxInt = ssa.Int64ToAuxInt(-1)
9779 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
9780 v2.AuxInt = ssa.Int64ToAuxInt(32)
9781 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
9782 v3.AddArg(y)
9783 v2.AddArg(v3)
9784 v1.AddArg(v2)
9785 v0.AddArg2(y, v1)
9786 v.AddArg2(x, v0)
9787 return true
9788 }
9789
9790
9791
9792 for {
9793 x := v_0
9794 y := v_1
9795 if !(ssa.ShiftIsBounded(v)) {
9796 break
9797 }
9798 v.Reset(ssaop.OpRISCV64SRAW)
9799 v.AddArg2(x, y)
9800 return true
9801 }
9802 return false
9803 }
9804 func rewriteValue_OpRsh32x64(v *ssa.Value) bool {
9805 v_1 := v.Args[1]
9806 v_0 := v.Args[0]
9807 b := v.Block
9808
9809
9810
9811 for {
9812 t := v.Type
9813 x := v_0
9814 y := v_1
9815 if !(!ssa.ShiftIsBounded(v)) {
9816 break
9817 }
9818 v.Reset(ssaop.OpRISCV64SRAW)
9819 v.Type = t
9820 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
9821 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
9822 v1.AuxInt = ssa.Int64ToAuxInt(-1)
9823 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
9824 v2.AuxInt = ssa.Int64ToAuxInt(32)
9825 v2.AddArg(y)
9826 v1.AddArg(v2)
9827 v0.AddArg2(y, v1)
9828 v.AddArg2(x, v0)
9829 return true
9830 }
9831
9832
9833
9834 for {
9835 x := v_0
9836 y := v_1
9837 if !(ssa.ShiftIsBounded(v)) {
9838 break
9839 }
9840 v.Reset(ssaop.OpRISCV64SRAW)
9841 v.AddArg2(x, y)
9842 return true
9843 }
9844 return false
9845 }
9846 func rewriteValue_OpRsh32x8(v *ssa.Value) bool {
9847 v_1 := v.Args[1]
9848 v_0 := v.Args[0]
9849 b := v.Block
9850 typ := &b.Func.Config.Types
9851
9852
9853
9854 for {
9855 t := v.Type
9856 x := v_0
9857 y := v_1
9858 if !(!ssa.ShiftIsBounded(v)) {
9859 break
9860 }
9861 v.Reset(ssaop.OpRISCV64SRAW)
9862 v.Type = t
9863 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
9864 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
9865 v1.AuxInt = ssa.Int64ToAuxInt(-1)
9866 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
9867 v2.AuxInt = ssa.Int64ToAuxInt(32)
9868 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
9869 v3.AddArg(y)
9870 v2.AddArg(v3)
9871 v1.AddArg(v2)
9872 v0.AddArg2(y, v1)
9873 v.AddArg2(x, v0)
9874 return true
9875 }
9876
9877
9878
9879 for {
9880 x := v_0
9881 y := v_1
9882 if !(ssa.ShiftIsBounded(v)) {
9883 break
9884 }
9885 v.Reset(ssaop.OpRISCV64SRAW)
9886 v.AddArg2(x, y)
9887 return true
9888 }
9889 return false
9890 }
9891 func rewriteValue_OpRsh64Ux16(v *ssa.Value) bool {
9892 v_1 := v.Args[1]
9893 v_0 := v.Args[0]
9894 b := v.Block
9895 typ := &b.Func.Config.Types
9896
9897
9898
9899 for {
9900 t := v.Type
9901 x := v_0
9902 y := v_1
9903 if !(!ssa.ShiftIsBounded(v)) {
9904 break
9905 }
9906 v.Reset(ssaop.OpRISCV64AND)
9907 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
9908 v0.AddArg2(x, y)
9909 v1 := b.NewValue0(v.Pos, ssaop.OpNeg64, t)
9910 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9911 v2.AuxInt = ssa.Int64ToAuxInt(64)
9912 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
9913 v3.AddArg(y)
9914 v2.AddArg(v3)
9915 v1.AddArg(v2)
9916 v.AddArg2(v0, v1)
9917 return true
9918 }
9919
9920
9921
9922 for {
9923 x := v_0
9924 y := v_1
9925 if !(ssa.ShiftIsBounded(v)) {
9926 break
9927 }
9928 v.Reset(ssaop.OpRISCV64SRL)
9929 v.AddArg2(x, y)
9930 return true
9931 }
9932 return false
9933 }
9934 func rewriteValue_OpRsh64Ux32(v *ssa.Value) bool {
9935 v_1 := v.Args[1]
9936 v_0 := v.Args[0]
9937 b := v.Block
9938 typ := &b.Func.Config.Types
9939
9940
9941
9942 for {
9943 t := v.Type
9944 x := v_0
9945 y := v_1
9946 if !(!ssa.ShiftIsBounded(v)) {
9947 break
9948 }
9949 v.Reset(ssaop.OpRISCV64AND)
9950 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
9951 v0.AddArg2(x, y)
9952 v1 := b.NewValue0(v.Pos, ssaop.OpNeg64, t)
9953 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9954 v2.AuxInt = ssa.Int64ToAuxInt(64)
9955 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
9956 v3.AddArg(y)
9957 v2.AddArg(v3)
9958 v1.AddArg(v2)
9959 v.AddArg2(v0, v1)
9960 return true
9961 }
9962
9963
9964
9965 for {
9966 x := v_0
9967 y := v_1
9968 if !(ssa.ShiftIsBounded(v)) {
9969 break
9970 }
9971 v.Reset(ssaop.OpRISCV64SRL)
9972 v.AddArg2(x, y)
9973 return true
9974 }
9975 return false
9976 }
9977 func rewriteValue_OpRsh64Ux64(v *ssa.Value) bool {
9978 v_1 := v.Args[1]
9979 v_0 := v.Args[0]
9980 b := v.Block
9981
9982
9983
9984 for {
9985 t := v.Type
9986 x := v_0
9987 y := v_1
9988 if !(!ssa.ShiftIsBounded(v)) {
9989 break
9990 }
9991 v.Reset(ssaop.OpRISCV64AND)
9992 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
9993 v0.AddArg2(x, y)
9994 v1 := b.NewValue0(v.Pos, ssaop.OpNeg64, t)
9995 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
9996 v2.AuxInt = ssa.Int64ToAuxInt(64)
9997 v2.AddArg(y)
9998 v1.AddArg(v2)
9999 v.AddArg2(v0, v1)
10000 return true
10001 }
10002
10003
10004
10005 for {
10006 x := v_0
10007 y := v_1
10008 if !(ssa.ShiftIsBounded(v)) {
10009 break
10010 }
10011 v.Reset(ssaop.OpRISCV64SRL)
10012 v.AddArg2(x, y)
10013 return true
10014 }
10015 return false
10016 }
10017 func rewriteValue_OpRsh64Ux8(v *ssa.Value) bool {
10018 v_1 := v.Args[1]
10019 v_0 := v.Args[0]
10020 b := v.Block
10021 typ := &b.Func.Config.Types
10022
10023
10024
10025 for {
10026 t := v.Type
10027 x := v_0
10028 y := v_1
10029 if !(!ssa.ShiftIsBounded(v)) {
10030 break
10031 }
10032 v.Reset(ssaop.OpRISCV64AND)
10033 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
10034 v0.AddArg2(x, y)
10035 v1 := b.NewValue0(v.Pos, ssaop.OpNeg64, t)
10036 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
10037 v2.AuxInt = ssa.Int64ToAuxInt(64)
10038 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10039 v3.AddArg(y)
10040 v2.AddArg(v3)
10041 v1.AddArg(v2)
10042 v.AddArg2(v0, v1)
10043 return true
10044 }
10045
10046
10047
10048 for {
10049 x := v_0
10050 y := v_1
10051 if !(ssa.ShiftIsBounded(v)) {
10052 break
10053 }
10054 v.Reset(ssaop.OpRISCV64SRL)
10055 v.AddArg2(x, y)
10056 return true
10057 }
10058 return false
10059 }
10060 func rewriteValue_OpRsh64x16(v *ssa.Value) bool {
10061 v_1 := v.Args[1]
10062 v_0 := v.Args[0]
10063 b := v.Block
10064 typ := &b.Func.Config.Types
10065
10066
10067
10068 for {
10069 t := v.Type
10070 x := v_0
10071 y := v_1
10072 if !(!ssa.ShiftIsBounded(v)) {
10073 break
10074 }
10075 v.Reset(ssaop.OpRISCV64SRA)
10076 v.Type = t
10077 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
10078 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
10079 v1.AuxInt = ssa.Int64ToAuxInt(-1)
10080 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
10081 v2.AuxInt = ssa.Int64ToAuxInt(64)
10082 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
10083 v3.AddArg(y)
10084 v2.AddArg(v3)
10085 v1.AddArg(v2)
10086 v0.AddArg2(y, v1)
10087 v.AddArg2(x, v0)
10088 return true
10089 }
10090
10091
10092
10093 for {
10094 x := v_0
10095 y := v_1
10096 if !(ssa.ShiftIsBounded(v)) {
10097 break
10098 }
10099 v.Reset(ssaop.OpRISCV64SRA)
10100 v.AddArg2(x, y)
10101 return true
10102 }
10103 return false
10104 }
10105 func rewriteValue_OpRsh64x32(v *ssa.Value) bool {
10106 v_1 := v.Args[1]
10107 v_0 := v.Args[0]
10108 b := v.Block
10109 typ := &b.Func.Config.Types
10110
10111
10112
10113 for {
10114 t := v.Type
10115 x := v_0
10116 y := v_1
10117 if !(!ssa.ShiftIsBounded(v)) {
10118 break
10119 }
10120 v.Reset(ssaop.OpRISCV64SRA)
10121 v.Type = t
10122 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
10123 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
10124 v1.AuxInt = ssa.Int64ToAuxInt(-1)
10125 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
10126 v2.AuxInt = ssa.Int64ToAuxInt(64)
10127 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
10128 v3.AddArg(y)
10129 v2.AddArg(v3)
10130 v1.AddArg(v2)
10131 v0.AddArg2(y, v1)
10132 v.AddArg2(x, v0)
10133 return true
10134 }
10135
10136
10137
10138 for {
10139 x := v_0
10140 y := v_1
10141 if !(ssa.ShiftIsBounded(v)) {
10142 break
10143 }
10144 v.Reset(ssaop.OpRISCV64SRA)
10145 v.AddArg2(x, y)
10146 return true
10147 }
10148 return false
10149 }
10150 func rewriteValue_OpRsh64x64(v *ssa.Value) bool {
10151 v_1 := v.Args[1]
10152 v_0 := v.Args[0]
10153 b := v.Block
10154
10155
10156
10157 for {
10158 t := v.Type
10159 x := v_0
10160 y := v_1
10161 if !(!ssa.ShiftIsBounded(v)) {
10162 break
10163 }
10164 v.Reset(ssaop.OpRISCV64SRA)
10165 v.Type = t
10166 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
10167 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
10168 v1.AuxInt = ssa.Int64ToAuxInt(-1)
10169 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
10170 v2.AuxInt = ssa.Int64ToAuxInt(64)
10171 v2.AddArg(y)
10172 v1.AddArg(v2)
10173 v0.AddArg2(y, v1)
10174 v.AddArg2(x, v0)
10175 return true
10176 }
10177
10178
10179
10180 for {
10181 x := v_0
10182 y := v_1
10183 if !(ssa.ShiftIsBounded(v)) {
10184 break
10185 }
10186 v.Reset(ssaop.OpRISCV64SRA)
10187 v.AddArg2(x, y)
10188 return true
10189 }
10190 return false
10191 }
10192 func rewriteValue_OpRsh64x8(v *ssa.Value) bool {
10193 v_1 := v.Args[1]
10194 v_0 := v.Args[0]
10195 b := v.Block
10196 typ := &b.Func.Config.Types
10197
10198
10199
10200 for {
10201 t := v.Type
10202 x := v_0
10203 y := v_1
10204 if !(!ssa.ShiftIsBounded(v)) {
10205 break
10206 }
10207 v.Reset(ssaop.OpRISCV64SRA)
10208 v.Type = t
10209 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
10210 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
10211 v1.AuxInt = ssa.Int64ToAuxInt(-1)
10212 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
10213 v2.AuxInt = ssa.Int64ToAuxInt(64)
10214 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10215 v3.AddArg(y)
10216 v2.AddArg(v3)
10217 v1.AddArg(v2)
10218 v0.AddArg2(y, v1)
10219 v.AddArg2(x, v0)
10220 return true
10221 }
10222
10223
10224
10225 for {
10226 x := v_0
10227 y := v_1
10228 if !(ssa.ShiftIsBounded(v)) {
10229 break
10230 }
10231 v.Reset(ssaop.OpRISCV64SRA)
10232 v.AddArg2(x, y)
10233 return true
10234 }
10235 return false
10236 }
10237 func rewriteValue_OpRsh8Ux16(v *ssa.Value) bool {
10238 v_1 := v.Args[1]
10239 v_0 := v.Args[0]
10240 b := v.Block
10241 typ := &b.Func.Config.Types
10242
10243
10244
10245 for {
10246 t := v.Type
10247 x := v_0
10248 y := v_1
10249 if !(!ssa.ShiftIsBounded(v)) {
10250 break
10251 }
10252 v.Reset(ssaop.OpRISCV64AND)
10253 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
10254 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10255 v1.AddArg(x)
10256 v0.AddArg2(v1, y)
10257 v2 := b.NewValue0(v.Pos, ssaop.OpNeg8, t)
10258 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
10259 v3.AuxInt = ssa.Int64ToAuxInt(64)
10260 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
10261 v4.AddArg(y)
10262 v3.AddArg(v4)
10263 v2.AddArg(v3)
10264 v.AddArg2(v0, v2)
10265 return true
10266 }
10267
10268
10269
10270 for {
10271 x := v_0
10272 y := v_1
10273 if !(ssa.ShiftIsBounded(v)) {
10274 break
10275 }
10276 v.Reset(ssaop.OpRISCV64SRL)
10277 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10278 v0.AddArg(x)
10279 v.AddArg2(v0, y)
10280 return true
10281 }
10282 return false
10283 }
10284 func rewriteValue_OpRsh8Ux32(v *ssa.Value) bool {
10285 v_1 := v.Args[1]
10286 v_0 := v.Args[0]
10287 b := v.Block
10288 typ := &b.Func.Config.Types
10289
10290
10291
10292 for {
10293 t := v.Type
10294 x := v_0
10295 y := v_1
10296 if !(!ssa.ShiftIsBounded(v)) {
10297 break
10298 }
10299 v.Reset(ssaop.OpRISCV64AND)
10300 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
10301 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10302 v1.AddArg(x)
10303 v0.AddArg2(v1, y)
10304 v2 := b.NewValue0(v.Pos, ssaop.OpNeg8, t)
10305 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
10306 v3.AuxInt = ssa.Int64ToAuxInt(64)
10307 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
10308 v4.AddArg(y)
10309 v3.AddArg(v4)
10310 v2.AddArg(v3)
10311 v.AddArg2(v0, v2)
10312 return true
10313 }
10314
10315
10316
10317 for {
10318 x := v_0
10319 y := v_1
10320 if !(ssa.ShiftIsBounded(v)) {
10321 break
10322 }
10323 v.Reset(ssaop.OpRISCV64SRL)
10324 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10325 v0.AddArg(x)
10326 v.AddArg2(v0, y)
10327 return true
10328 }
10329 return false
10330 }
10331 func rewriteValue_OpRsh8Ux64(v *ssa.Value) bool {
10332 v_1 := v.Args[1]
10333 v_0 := v.Args[0]
10334 b := v.Block
10335 typ := &b.Func.Config.Types
10336
10337
10338
10339 for {
10340 t := v.Type
10341 x := v_0
10342 y := v_1
10343 if !(!ssa.ShiftIsBounded(v)) {
10344 break
10345 }
10346 v.Reset(ssaop.OpRISCV64AND)
10347 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
10348 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10349 v1.AddArg(x)
10350 v0.AddArg2(v1, y)
10351 v2 := b.NewValue0(v.Pos, ssaop.OpNeg8, t)
10352 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
10353 v3.AuxInt = ssa.Int64ToAuxInt(64)
10354 v3.AddArg(y)
10355 v2.AddArg(v3)
10356 v.AddArg2(v0, v2)
10357 return true
10358 }
10359
10360
10361
10362 for {
10363 x := v_0
10364 y := v_1
10365 if !(ssa.ShiftIsBounded(v)) {
10366 break
10367 }
10368 v.Reset(ssaop.OpRISCV64SRL)
10369 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10370 v0.AddArg(x)
10371 v.AddArg2(v0, y)
10372 return true
10373 }
10374 return false
10375 }
10376 func rewriteValue_OpRsh8Ux8(v *ssa.Value) bool {
10377 v_1 := v.Args[1]
10378 v_0 := v.Args[0]
10379 b := v.Block
10380 typ := &b.Func.Config.Types
10381
10382
10383
10384 for {
10385 t := v.Type
10386 x := v_0
10387 y := v_1
10388 if !(!ssa.ShiftIsBounded(v)) {
10389 break
10390 }
10391 v.Reset(ssaop.OpRISCV64AND)
10392 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SRL, t)
10393 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10394 v1.AddArg(x)
10395 v0.AddArg2(v1, y)
10396 v2 := b.NewValue0(v.Pos, ssaop.OpNeg8, t)
10397 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, t)
10398 v3.AuxInt = ssa.Int64ToAuxInt(64)
10399 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10400 v4.AddArg(y)
10401 v3.AddArg(v4)
10402 v2.AddArg(v3)
10403 v.AddArg2(v0, v2)
10404 return true
10405 }
10406
10407
10408
10409 for {
10410 x := v_0
10411 y := v_1
10412 if !(ssa.ShiftIsBounded(v)) {
10413 break
10414 }
10415 v.Reset(ssaop.OpRISCV64SRL)
10416 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10417 v0.AddArg(x)
10418 v.AddArg2(v0, y)
10419 return true
10420 }
10421 return false
10422 }
10423 func rewriteValue_OpRsh8x16(v *ssa.Value) bool {
10424 v_1 := v.Args[1]
10425 v_0 := v.Args[0]
10426 b := v.Block
10427 typ := &b.Func.Config.Types
10428
10429
10430
10431 for {
10432 t := v.Type
10433 x := v_0
10434 y := v_1
10435 if !(!ssa.ShiftIsBounded(v)) {
10436 break
10437 }
10438 v.Reset(ssaop.OpRISCV64SRA)
10439 v.Type = t
10440 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt8to64, typ.Int64)
10441 v0.AddArg(x)
10442 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
10443 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
10444 v2.AuxInt = ssa.Int64ToAuxInt(-1)
10445 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
10446 v3.AuxInt = ssa.Int64ToAuxInt(64)
10447 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)
10448 v4.AddArg(y)
10449 v3.AddArg(v4)
10450 v2.AddArg(v3)
10451 v1.AddArg2(y, v2)
10452 v.AddArg2(v0, v1)
10453 return true
10454 }
10455
10456
10457
10458 for {
10459 x := v_0
10460 y := v_1
10461 if !(ssa.ShiftIsBounded(v)) {
10462 break
10463 }
10464 v.Reset(ssaop.OpRISCV64SRA)
10465 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt8to64, typ.Int64)
10466 v0.AddArg(x)
10467 v.AddArg2(v0, y)
10468 return true
10469 }
10470 return false
10471 }
10472 func rewriteValue_OpRsh8x32(v *ssa.Value) bool {
10473 v_1 := v.Args[1]
10474 v_0 := v.Args[0]
10475 b := v.Block
10476 typ := &b.Func.Config.Types
10477
10478
10479
10480 for {
10481 t := v.Type
10482 x := v_0
10483 y := v_1
10484 if !(!ssa.ShiftIsBounded(v)) {
10485 break
10486 }
10487 v.Reset(ssaop.OpRISCV64SRA)
10488 v.Type = t
10489 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt8to64, typ.Int64)
10490 v0.AddArg(x)
10491 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
10492 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
10493 v2.AuxInt = ssa.Int64ToAuxInt(-1)
10494 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
10495 v3.AuxInt = ssa.Int64ToAuxInt(64)
10496 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)
10497 v4.AddArg(y)
10498 v3.AddArg(v4)
10499 v2.AddArg(v3)
10500 v1.AddArg2(y, v2)
10501 v.AddArg2(v0, v1)
10502 return true
10503 }
10504
10505
10506
10507 for {
10508 x := v_0
10509 y := v_1
10510 if !(ssa.ShiftIsBounded(v)) {
10511 break
10512 }
10513 v.Reset(ssaop.OpRISCV64SRA)
10514 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt8to64, typ.Int64)
10515 v0.AddArg(x)
10516 v.AddArg2(v0, y)
10517 return true
10518 }
10519 return false
10520 }
10521 func rewriteValue_OpRsh8x64(v *ssa.Value) bool {
10522 v_1 := v.Args[1]
10523 v_0 := v.Args[0]
10524 b := v.Block
10525 typ := &b.Func.Config.Types
10526
10527
10528
10529 for {
10530 t := v.Type
10531 x := v_0
10532 y := v_1
10533 if !(!ssa.ShiftIsBounded(v)) {
10534 break
10535 }
10536 v.Reset(ssaop.OpRISCV64SRA)
10537 v.Type = t
10538 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt8to64, typ.Int64)
10539 v0.AddArg(x)
10540 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
10541 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
10542 v2.AuxInt = ssa.Int64ToAuxInt(-1)
10543 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
10544 v3.AuxInt = ssa.Int64ToAuxInt(64)
10545 v3.AddArg(y)
10546 v2.AddArg(v3)
10547 v1.AddArg2(y, v2)
10548 v.AddArg2(v0, v1)
10549 return true
10550 }
10551
10552
10553
10554 for {
10555 x := v_0
10556 y := v_1
10557 if !(ssa.ShiftIsBounded(v)) {
10558 break
10559 }
10560 v.Reset(ssaop.OpRISCV64SRA)
10561 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt8to64, typ.Int64)
10562 v0.AddArg(x)
10563 v.AddArg2(v0, y)
10564 return true
10565 }
10566 return false
10567 }
10568 func rewriteValue_OpRsh8x8(v *ssa.Value) bool {
10569 v_1 := v.Args[1]
10570 v_0 := v.Args[0]
10571 b := v.Block
10572 typ := &b.Func.Config.Types
10573
10574
10575
10576 for {
10577 t := v.Type
10578 x := v_0
10579 y := v_1
10580 if !(!ssa.ShiftIsBounded(v)) {
10581 break
10582 }
10583 v.Reset(ssaop.OpRISCV64SRA)
10584 v.Type = t
10585 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt8to64, typ.Int64)
10586 v0.AddArg(x)
10587 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64OR, y.Type)
10588 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADDI, y.Type)
10589 v2.AuxInt = ssa.Int64ToAuxInt(-1)
10590 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTIU, y.Type)
10591 v3.AuxInt = ssa.Int64ToAuxInt(64)
10592 v4 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)
10593 v4.AddArg(y)
10594 v3.AddArg(v4)
10595 v2.AddArg(v3)
10596 v1.AddArg2(y, v2)
10597 v.AddArg2(v0, v1)
10598 return true
10599 }
10600
10601
10602
10603 for {
10604 x := v_0
10605 y := v_1
10606 if !(ssa.ShiftIsBounded(v)) {
10607 break
10608 }
10609 v.Reset(ssaop.OpRISCV64SRA)
10610 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt8to64, typ.Int64)
10611 v0.AddArg(x)
10612 v.AddArg2(v0, y)
10613 return true
10614 }
10615 return false
10616 }
10617 func rewriteValue_OpSelect0(v *ssa.Value) bool {
10618 v_0 := v.Args[0]
10619 b := v.Block
10620 typ := &b.Func.Config.Types
10621
10622
10623 for {
10624 if v_0.Op != ssaop.OpAdd64carry {
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.OpRISCV64ADD)
10631 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADD, typ.UInt64)
10632 v0.AddArg2(x, y)
10633 v.AddArg2(v0, c)
10634 return true
10635 }
10636
10637
10638 for {
10639 if v_0.Op != ssaop.OpSub64borrow {
10640 break
10641 }
10642 c := v_0.Args[2]
10643 x := v_0.Args[0]
10644 y := v_0.Args[1]
10645 v.Reset(ssaop.OpRISCV64SUB)
10646 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SUB, typ.UInt64)
10647 v0.AddArg2(x, y)
10648 v.AddArg2(v0, c)
10649 return true
10650 }
10651
10652
10653
10654 for {
10655 m := v_0
10656 if m.Op != ssaop.OpRISCV64LoweredMuluhilo {
10657 break
10658 }
10659 y := m.Args[1]
10660 x := m.Args[0]
10661 if !(m.Uses == 1) {
10662 break
10663 }
10664 v.Reset(ssaop.OpRISCV64MULHU)
10665 v.AddArg2(x, y)
10666 return true
10667 }
10668 return false
10669 }
10670 func rewriteValue_OpSelect1(v *ssa.Value) bool {
10671 v_0 := v.Args[0]
10672 b := v.Block
10673 typ := &b.Func.Config.Types
10674
10675
10676 for {
10677 if v_0.Op != ssaop.OpAdd64carry {
10678 break
10679 }
10680 c := v_0.Args[2]
10681 x := v_0.Args[0]
10682 y := v_0.Args[1]
10683 v.Reset(ssaop.OpRISCV64OR)
10684 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTU, typ.UInt64)
10685 s := b.NewValue0(v.Pos, ssaop.OpRISCV64ADD, typ.UInt64)
10686 s.AddArg2(x, y)
10687 v0.AddArg2(s, x)
10688 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTU, typ.UInt64)
10689 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64ADD, typ.UInt64)
10690 v3.AddArg2(s, c)
10691 v2.AddArg2(v3, s)
10692 v.AddArg2(v0, v2)
10693 return true
10694 }
10695
10696
10697 for {
10698 if v_0.Op != ssaop.OpSub64borrow {
10699 break
10700 }
10701 c := v_0.Args[2]
10702 x := v_0.Args[0]
10703 y := v_0.Args[1]
10704 v.Reset(ssaop.OpRISCV64OR)
10705 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTU, typ.UInt64)
10706 s := b.NewValue0(v.Pos, ssaop.OpRISCV64SUB, typ.UInt64)
10707 s.AddArg2(x, y)
10708 v0.AddArg2(x, s)
10709 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64SLTU, typ.UInt64)
10710 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64SUB, typ.UInt64)
10711 v3.AddArg2(s, c)
10712 v2.AddArg2(s, v3)
10713 v.AddArg2(v0, v2)
10714 return true
10715 }
10716
10717
10718
10719 for {
10720 m := v_0
10721 if m.Op != ssaop.OpRISCV64LoweredMuluhilo {
10722 break
10723 }
10724 y := m.Args[1]
10725 x := m.Args[0]
10726 if !(m.Uses == 1) {
10727 break
10728 }
10729 v.Reset(ssaop.OpRISCV64MUL)
10730 v.AddArg2(x, y)
10731 return true
10732 }
10733 return false
10734 }
10735 func rewriteValue_OpSlicemask(v *ssa.Value) bool {
10736 v_0 := v.Args[0]
10737 b := v.Block
10738
10739
10740 for {
10741 t := v.Type
10742 x := v_0
10743 v.Reset(ssaop.OpRISCV64SRAI)
10744 v.AuxInt = ssa.Int64ToAuxInt(63)
10745 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64NEG, t)
10746 v0.AddArg(x)
10747 v.AddArg(v0)
10748 return true
10749 }
10750 }
10751 func rewriteValue_OpStore(v *ssa.Value) bool {
10752 v_2 := v.Args[2]
10753 v_1 := v.Args[1]
10754 v_0 := v.Args[0]
10755
10756
10757
10758 for {
10759 t := ssa.AuxToType(v.Aux)
10760 ptr := v_0
10761 val := v_1
10762 mem := v_2
10763 if !(t.Size() == 1) {
10764 break
10765 }
10766 v.Reset(ssaop.OpRISCV64MOVBstore)
10767 v.AddArg3(ptr, val, mem)
10768 return true
10769 }
10770
10771
10772
10773 for {
10774 t := ssa.AuxToType(v.Aux)
10775 ptr := v_0
10776 val := v_1
10777 mem := v_2
10778 if !(t.Size() == 2) {
10779 break
10780 }
10781 v.Reset(ssaop.OpRISCV64MOVHstore)
10782 v.AddArg3(ptr, val, mem)
10783 return true
10784 }
10785
10786
10787
10788 for {
10789 t := ssa.AuxToType(v.Aux)
10790 ptr := v_0
10791 val := v_1
10792 mem := v_2
10793 if !(t.Size() == 4 && !t.IsFloat()) {
10794 break
10795 }
10796 v.Reset(ssaop.OpRISCV64MOVWstore)
10797 v.AddArg3(ptr, val, mem)
10798 return true
10799 }
10800
10801
10802
10803 for {
10804 t := ssa.AuxToType(v.Aux)
10805 ptr := v_0
10806 val := v_1
10807 mem := v_2
10808 if !(t.Size() == 8 && !t.IsFloat()) {
10809 break
10810 }
10811 v.Reset(ssaop.OpRISCV64MOVDstore)
10812 v.AddArg3(ptr, val, mem)
10813 return true
10814 }
10815
10816
10817
10818 for {
10819 t := ssa.AuxToType(v.Aux)
10820 ptr := v_0
10821 val := v_1
10822 mem := v_2
10823 if !(t.Size() == 4 && t.IsFloat()) {
10824 break
10825 }
10826 v.Reset(ssaop.OpRISCV64FMOVWstore)
10827 v.AddArg3(ptr, val, mem)
10828 return true
10829 }
10830
10831
10832
10833 for {
10834 t := ssa.AuxToType(v.Aux)
10835 ptr := v_0
10836 val := v_1
10837 mem := v_2
10838 if !(t.Size() == 8 && t.IsFloat()) {
10839 break
10840 }
10841 v.Reset(ssaop.OpRISCV64FMOVDstore)
10842 v.AddArg3(ptr, val, mem)
10843 return true
10844 }
10845 return false
10846 }
10847 func rewriteValue_OpZero(v *ssa.Value) bool {
10848 v_1 := v.Args[1]
10849 v_0 := v.Args[0]
10850 b := v.Block
10851 config := b.Func.Config
10852 typ := &b.Func.Config.Types
10853
10854
10855 for {
10856 if ssa.AuxIntToInt64(v.AuxInt) != 0 {
10857 break
10858 }
10859 mem := v_1
10860 v.CopyOf(mem)
10861 return true
10862 }
10863
10864
10865 for {
10866 if ssa.AuxIntToInt64(v.AuxInt) != 1 {
10867 break
10868 }
10869 ptr := v_0
10870 mem := v_1
10871 v.Reset(ssaop.OpRISCV64MOVBstore)
10872 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
10873 v0.AuxInt = ssa.Int64ToAuxInt(0)
10874 v.AddArg3(ptr, v0, mem)
10875 return true
10876 }
10877
10878
10879
10880 for {
10881 if ssa.AuxIntToInt64(v.AuxInt) != 2 {
10882 break
10883 }
10884 t := ssa.AuxToType(v.Aux)
10885 ptr := v_0
10886 mem := v_1
10887 if !(t.Alignment()%2 == 0) {
10888 break
10889 }
10890 v.Reset(ssaop.OpRISCV64MOVHstore)
10891 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
10892 v0.AuxInt = ssa.Int64ToAuxInt(0)
10893 v.AddArg3(ptr, v0, mem)
10894 return true
10895 }
10896
10897
10898 for {
10899 if ssa.AuxIntToInt64(v.AuxInt) != 2 {
10900 break
10901 }
10902 ptr := v_0
10903 mem := v_1
10904 v.Reset(ssaop.OpRISCV64MOVBstore)
10905 v.AuxInt = ssa.Int32ToAuxInt(1)
10906 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
10907 v0.AuxInt = ssa.Int64ToAuxInt(0)
10908 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBstore, types.TypeMem)
10909 v1.AddArg3(ptr, v0, mem)
10910 v.AddArg3(ptr, v0, v1)
10911 return true
10912 }
10913
10914
10915
10916 for {
10917 if ssa.AuxIntToInt64(v.AuxInt) != 4 {
10918 break
10919 }
10920 t := ssa.AuxToType(v.Aux)
10921 ptr := v_0
10922 mem := v_1
10923 if !(t.Alignment()%4 == 0) {
10924 break
10925 }
10926 v.Reset(ssaop.OpRISCV64MOVWstore)
10927 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
10928 v0.AuxInt = ssa.Int64ToAuxInt(0)
10929 v.AddArg3(ptr, v0, mem)
10930 return true
10931 }
10932
10933
10934
10935 for {
10936 if ssa.AuxIntToInt64(v.AuxInt) != 4 {
10937 break
10938 }
10939 t := ssa.AuxToType(v.Aux)
10940 ptr := v_0
10941 mem := v_1
10942 if !(t.Alignment()%2 == 0) {
10943 break
10944 }
10945 v.Reset(ssaop.OpRISCV64MOVHstore)
10946 v.AuxInt = ssa.Int32ToAuxInt(2)
10947 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
10948 v0.AuxInt = ssa.Int64ToAuxInt(0)
10949 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHstore, types.TypeMem)
10950 v1.AddArg3(ptr, v0, mem)
10951 v.AddArg3(ptr, v0, v1)
10952 return true
10953 }
10954
10955
10956 for {
10957 if ssa.AuxIntToInt64(v.AuxInt) != 4 {
10958 break
10959 }
10960 ptr := v_0
10961 mem := v_1
10962 v.Reset(ssaop.OpRISCV64MOVBstore)
10963 v.AuxInt = ssa.Int32ToAuxInt(3)
10964 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
10965 v0.AuxInt = ssa.Int64ToAuxInt(0)
10966 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBstore, types.TypeMem)
10967 v1.AuxInt = ssa.Int32ToAuxInt(2)
10968 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBstore, types.TypeMem)
10969 v2.AuxInt = ssa.Int32ToAuxInt(1)
10970 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBstore, types.TypeMem)
10971 v3.AddArg3(ptr, v0, mem)
10972 v2.AddArg3(ptr, v0, v3)
10973 v1.AddArg3(ptr, v0, v2)
10974 v.AddArg3(ptr, v0, v1)
10975 return true
10976 }
10977
10978
10979
10980 for {
10981 if ssa.AuxIntToInt64(v.AuxInt) != 8 {
10982 break
10983 }
10984 t := ssa.AuxToType(v.Aux)
10985 ptr := v_0
10986 mem := v_1
10987 if !(t.Alignment()%8 == 0) {
10988 break
10989 }
10990 v.Reset(ssaop.OpRISCV64MOVDstore)
10991 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
10992 v0.AuxInt = ssa.Int64ToAuxInt(0)
10993 v.AddArg3(ptr, v0, mem)
10994 return true
10995 }
10996
10997
10998
10999 for {
11000 if ssa.AuxIntToInt64(v.AuxInt) != 8 {
11001 break
11002 }
11003 t := ssa.AuxToType(v.Aux)
11004 ptr := v_0
11005 mem := v_1
11006 if !(t.Alignment()%4 == 0) {
11007 break
11008 }
11009 v.Reset(ssaop.OpRISCV64MOVWstore)
11010 v.AuxInt = ssa.Int32ToAuxInt(4)
11011 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
11012 v0.AuxInt = ssa.Int64ToAuxInt(0)
11013 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVWstore, types.TypeMem)
11014 v1.AddArg3(ptr, v0, mem)
11015 v.AddArg3(ptr, v0, v1)
11016 return true
11017 }
11018
11019
11020
11021 for {
11022 if ssa.AuxIntToInt64(v.AuxInt) != 8 {
11023 break
11024 }
11025 t := ssa.AuxToType(v.Aux)
11026 ptr := v_0
11027 mem := v_1
11028 if !(t.Alignment()%2 == 0) {
11029 break
11030 }
11031 v.Reset(ssaop.OpRISCV64MOVHstore)
11032 v.AuxInt = ssa.Int32ToAuxInt(6)
11033 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
11034 v0.AuxInt = ssa.Int64ToAuxInt(0)
11035 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHstore, types.TypeMem)
11036 v1.AuxInt = ssa.Int32ToAuxInt(4)
11037 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHstore, types.TypeMem)
11038 v2.AuxInt = ssa.Int32ToAuxInt(2)
11039 v3 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHstore, types.TypeMem)
11040 v3.AddArg3(ptr, v0, mem)
11041 v2.AddArg3(ptr, v0, v3)
11042 v1.AddArg3(ptr, v0, v2)
11043 v.AddArg3(ptr, v0, v1)
11044 return true
11045 }
11046
11047
11048 for {
11049 if ssa.AuxIntToInt64(v.AuxInt) != 3 {
11050 break
11051 }
11052 ptr := v_0
11053 mem := v_1
11054 v.Reset(ssaop.OpRISCV64MOVBstore)
11055 v.AuxInt = ssa.Int32ToAuxInt(2)
11056 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
11057 v0.AuxInt = ssa.Int64ToAuxInt(0)
11058 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBstore, types.TypeMem)
11059 v1.AuxInt = ssa.Int32ToAuxInt(1)
11060 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVBstore, types.TypeMem)
11061 v2.AddArg3(ptr, v0, mem)
11062 v1.AddArg3(ptr, v0, v2)
11063 v.AddArg3(ptr, v0, v1)
11064 return true
11065 }
11066
11067
11068
11069 for {
11070 if ssa.AuxIntToInt64(v.AuxInt) != 6 {
11071 break
11072 }
11073 t := ssa.AuxToType(v.Aux)
11074 ptr := v_0
11075 mem := v_1
11076 if !(t.Alignment()%2 == 0) {
11077 break
11078 }
11079 v.Reset(ssaop.OpRISCV64MOVHstore)
11080 v.AuxInt = ssa.Int32ToAuxInt(4)
11081 v0 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
11082 v0.AuxInt = ssa.Int64ToAuxInt(0)
11083 v1 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHstore, types.TypeMem)
11084 v1.AuxInt = ssa.Int32ToAuxInt(2)
11085 v2 := b.NewValue0(v.Pos, ssaop.OpRISCV64MOVHstore, types.TypeMem)
11086 v2.AddArg3(ptr, v0, mem)
11087 v1.AddArg3(ptr, v0, v2)
11088 v.AddArg3(ptr, v0, v1)
11089 return true
11090 }
11091
11092
11093
11094 for {
11095 s := ssa.AuxIntToInt64(v.AuxInt)
11096 t := ssa.AuxToType(v.Aux)
11097 ptr := v_0
11098 mem := v_1
11099 if !(s <= 24*ssa.MoveSize(t.Alignment(), config)) {
11100 break
11101 }
11102 v.Reset(ssaop.OpRISCV64LoweredZero)
11103 v.AuxInt = ssa.Int64ToAuxInt(s)
11104 v.Aux = ssa.Int64ToAux(t.Alignment())
11105 v.AddArg2(ptr, mem)
11106 return true
11107 }
11108
11109
11110
11111 for {
11112 s := ssa.AuxIntToInt64(v.AuxInt)
11113 t := ssa.AuxToType(v.Aux)
11114 ptr := v_0
11115 mem := v_1
11116 if !(s > 24*ssa.MoveSize(t.Alignment(), config)) {
11117 break
11118 }
11119 v.Reset(ssaop.OpRISCV64LoweredZeroLoop)
11120 v.AuxInt = ssa.Int64ToAuxInt(s)
11121 v.Aux = ssa.Int64ToAux(t.Alignment())
11122 v.AddArg2(ptr, mem)
11123 return true
11124 }
11125 return false
11126 }
11127 func RewriteBlock(b *ssa.Block) bool {
11128 typ := &b.Func.Config.Types
11129 switch b.Kind {
11130 case block.BlockRISCV64BEQ:
11131
11132
11133 for b.Controls[0].Op == ssaop.OpRISCV64MOVDconst {
11134 v_0 := b.Controls[0]
11135 if ssa.AuxIntToInt64(v_0.AuxInt) != 0 {
11136 break
11137 }
11138 cond := b.Controls[1]
11139 b.ResetWithControl(block.BlockRISCV64BEQZ, cond)
11140 return true
11141 }
11142
11143
11144 for b.Controls[1].Op == ssaop.OpRISCV64MOVDconst {
11145 cond := b.Controls[0]
11146 v_1 := b.Controls[1]
11147 if ssa.AuxIntToInt64(v_1.AuxInt) != 0 {
11148 break
11149 }
11150 b.ResetWithControl(block.BlockRISCV64BEQZ, cond)
11151 return true
11152 }
11153 case block.BlockRISCV64BEQZ:
11154
11155
11156 for b.Controls[0].Op == ssaop.OpRISCV64SEQZ {
11157 v_0 := b.Controls[0]
11158 x := v_0.Args[0]
11159 b.ResetWithControl(block.BlockRISCV64BNEZ, x)
11160 return true
11161 }
11162
11163
11164 for b.Controls[0].Op == ssaop.OpRISCV64SNEZ {
11165 v_0 := b.Controls[0]
11166 x := v_0.Args[0]
11167 b.ResetWithControl(block.BlockRISCV64BEQZ, x)
11168 return true
11169 }
11170
11171
11172 for b.Controls[0].Op == ssaop.OpRISCV64NEG {
11173 v_0 := b.Controls[0]
11174 x := v_0.Args[0]
11175 b.ResetWithControl(block.BlockRISCV64BEQZ, x)
11176 return true
11177 }
11178
11179
11180 for b.Controls[0].Op == ssaop.OpRISCV64FNES {
11181 v_0 := b.Controls[0]
11182 t := v_0.Type
11183 _ = v_0.Args[1]
11184 v_0_0 := v_0.Args[0]
11185 v_0_1 := v_0.Args[1]
11186 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
11187 x := v_0_0
11188 y := v_0_1
11189 v0 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64FEQS, t)
11190 v0.AddArg2(x, y)
11191 b.ResetWithControl(block.BlockRISCV64BNEZ, v0)
11192 return true
11193 }
11194 }
11195
11196
11197 for b.Controls[0].Op == ssaop.OpRISCV64FNED {
11198 v_0 := b.Controls[0]
11199 t := v_0.Type
11200 _ = v_0.Args[1]
11201 v_0_0 := v_0.Args[0]
11202 v_0_1 := v_0.Args[1]
11203 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
11204 x := v_0_0
11205 y := v_0_1
11206 v0 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64FEQD, t)
11207 v0.AddArg2(x, y)
11208 b.ResetWithControl(block.BlockRISCV64BNEZ, v0)
11209 return true
11210 }
11211 }
11212
11213
11214 for b.Controls[0].Op == ssaop.OpRISCV64SUB {
11215 v_0 := b.Controls[0]
11216 y := v_0.Args[1]
11217 x := v_0.Args[0]
11218 b.ResetWithControl2(block.BlockRISCV64BEQ, x, y)
11219 return true
11220 }
11221
11222
11223 for b.Controls[0].Op == ssaop.OpRISCV64SLT {
11224 v_0 := b.Controls[0]
11225 y := v_0.Args[1]
11226 x := v_0.Args[0]
11227 b.ResetWithControl2(block.BlockRISCV64BGE, x, y)
11228 return true
11229 }
11230
11231
11232 for b.Controls[0].Op == ssaop.OpRISCV64SLTU {
11233 v_0 := b.Controls[0]
11234 y := v_0.Args[1]
11235 x := v_0.Args[0]
11236 b.ResetWithControl2(block.BlockRISCV64BGEU, x, y)
11237 return true
11238 }
11239
11240
11241 for b.Controls[0].Op == ssaop.OpRISCV64SLTI {
11242 v_0 := b.Controls[0]
11243 x := ssa.AuxIntToInt64(v_0.AuxInt)
11244 y := v_0.Args[0]
11245 v0 := b.NewValue0(b.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
11246 v0.AuxInt = ssa.Int64ToAuxInt(x)
11247 b.ResetWithControl2(block.BlockRISCV64BGE, y, v0)
11248 return true
11249 }
11250
11251
11252 for b.Controls[0].Op == ssaop.OpRISCV64SLTIU {
11253 v_0 := b.Controls[0]
11254 x := ssa.AuxIntToInt64(v_0.AuxInt)
11255 y := v_0.Args[0]
11256 v0 := b.NewValue0(b.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
11257 v0.AuxInt = ssa.Int64ToAuxInt(x)
11258 b.ResetWithControl2(block.BlockRISCV64BGEU, y, v0)
11259 return true
11260 }
11261
11262
11263 for b.Controls[0].Op == ssaop.OpRISCV64ANDI {
11264 v_0 := b.Controls[0]
11265 c := ssa.AuxIntToInt64(v_0.AuxInt)
11266 v_0_0 := v_0.Args[0]
11267 if v_0_0.Op != ssaop.OpRISCV64FCLASSD {
11268 break
11269 }
11270 v_0_0_0 := v_0_0.Args[0]
11271 if v_0_0_0.Op != ssaop.OpRISCV64FNEGD {
11272 break
11273 }
11274 x := v_0_0_0.Args[0]
11275 v0 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
11276 v0.AuxInt = ssa.Int64ToAuxInt((c & 0b11_0000_0000) | int64(bits.Reverse8(uint8(c))&0b1111_1111))
11277 v1 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
11278 v1.AddArg(x)
11279 v0.AddArg(v1)
11280 b.ResetWithControl(block.BlockRISCV64BEQZ, v0)
11281 return true
11282 }
11283
11284
11285 for b.Controls[0].Op == ssaop.OpRISCV64ANDI {
11286 v_0 := b.Controls[0]
11287 c := ssa.AuxIntToInt64(v_0.AuxInt)
11288 v_0_0 := v_0.Args[0]
11289 if v_0_0.Op != ssaop.OpRISCV64FCLASSD {
11290 break
11291 }
11292 v_0_0_0 := v_0_0.Args[0]
11293 if v_0_0_0.Op != ssaop.OpRISCV64FABSD {
11294 break
11295 }
11296 x := v_0_0_0.Args[0]
11297 v0 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
11298 v0.AuxInt = ssa.Int64ToAuxInt((c & 0b11_1111_0000) | int64(bits.Reverse8(uint8(c))&0b0000_1111))
11299 v1 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
11300 v1.AddArg(x)
11301 v0.AddArg(v1)
11302 b.ResetWithControl(block.BlockRISCV64BEQZ, v0)
11303 return true
11304 }
11305 case block.BlockRISCV64BGE:
11306
11307
11308 for b.Controls[0].Op == ssaop.OpRISCV64MOVDconst {
11309 v_0 := b.Controls[0]
11310 if ssa.AuxIntToInt64(v_0.AuxInt) != 0 {
11311 break
11312 }
11313 cond := b.Controls[1]
11314 b.ResetWithControl(block.BlockRISCV64BLEZ, cond)
11315 return true
11316 }
11317
11318
11319 for b.Controls[1].Op == ssaop.OpRISCV64MOVDconst {
11320 cond := b.Controls[0]
11321 v_1 := b.Controls[1]
11322 if ssa.AuxIntToInt64(v_1.AuxInt) != 0 {
11323 break
11324 }
11325 b.ResetWithControl(block.BlockRISCV64BGEZ, cond)
11326 return true
11327 }
11328 case block.BlockRISCV64BGEU:
11329
11330
11331 for b.Controls[0].Op == ssaop.OpRISCV64MOVDconst {
11332 v_0 := b.Controls[0]
11333 if ssa.AuxIntToInt64(v_0.AuxInt) != 0 {
11334 break
11335 }
11336 cond := b.Controls[1]
11337 b.ResetWithControl(block.BlockRISCV64BEQZ, cond)
11338 return true
11339 }
11340 case block.BlockRISCV64BLT:
11341
11342
11343 for b.Controls[0].Op == ssaop.OpRISCV64MOVDconst {
11344 v_0 := b.Controls[0]
11345 if ssa.AuxIntToInt64(v_0.AuxInt) != 0 {
11346 break
11347 }
11348 cond := b.Controls[1]
11349 b.ResetWithControl(block.BlockRISCV64BGTZ, cond)
11350 return true
11351 }
11352
11353
11354 for b.Controls[1].Op == ssaop.OpRISCV64MOVDconst {
11355 cond := b.Controls[0]
11356 v_1 := b.Controls[1]
11357 if ssa.AuxIntToInt64(v_1.AuxInt) != 0 {
11358 break
11359 }
11360 b.ResetWithControl(block.BlockRISCV64BLTZ, cond)
11361 return true
11362 }
11363 case block.BlockRISCV64BLTU:
11364
11365
11366 for b.Controls[0].Op == ssaop.OpRISCV64MOVDconst {
11367 v_0 := b.Controls[0]
11368 if ssa.AuxIntToInt64(v_0.AuxInt) != 0 {
11369 break
11370 }
11371 cond := b.Controls[1]
11372 b.ResetWithControl(block.BlockRISCV64BNEZ, cond)
11373 return true
11374 }
11375 case block.BlockRISCV64BNE:
11376
11377
11378 for b.Controls[0].Op == ssaop.OpRISCV64MOVDconst {
11379 v_0 := b.Controls[0]
11380 if ssa.AuxIntToInt64(v_0.AuxInt) != 0 {
11381 break
11382 }
11383 cond := b.Controls[1]
11384 b.ResetWithControl(block.BlockRISCV64BNEZ, cond)
11385 return true
11386 }
11387
11388
11389 for b.Controls[1].Op == ssaop.OpRISCV64MOVDconst {
11390 cond := b.Controls[0]
11391 v_1 := b.Controls[1]
11392 if ssa.AuxIntToInt64(v_1.AuxInt) != 0 {
11393 break
11394 }
11395 b.ResetWithControl(block.BlockRISCV64BNEZ, cond)
11396 return true
11397 }
11398 case block.BlockRISCV64BNEZ:
11399
11400
11401 for b.Controls[0].Op == ssaop.OpRISCV64SEQZ {
11402 v_0 := b.Controls[0]
11403 x := v_0.Args[0]
11404 b.ResetWithControl(block.BlockRISCV64BEQZ, x)
11405 return true
11406 }
11407
11408
11409 for b.Controls[0].Op == ssaop.OpRISCV64SNEZ {
11410 v_0 := b.Controls[0]
11411 x := v_0.Args[0]
11412 b.ResetWithControl(block.BlockRISCV64BNEZ, x)
11413 return true
11414 }
11415
11416
11417 for b.Controls[0].Op == ssaop.OpRISCV64NEG {
11418 v_0 := b.Controls[0]
11419 x := v_0.Args[0]
11420 b.ResetWithControl(block.BlockRISCV64BNEZ, x)
11421 return true
11422 }
11423
11424
11425 for b.Controls[0].Op == ssaop.OpRISCV64FNES {
11426 v_0 := b.Controls[0]
11427 t := v_0.Type
11428 _ = v_0.Args[1]
11429 v_0_0 := v_0.Args[0]
11430 v_0_1 := v_0.Args[1]
11431 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
11432 x := v_0_0
11433 y := v_0_1
11434 v0 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64FEQS, t)
11435 v0.AddArg2(x, y)
11436 b.ResetWithControl(block.BlockRISCV64BEQZ, v0)
11437 return true
11438 }
11439 }
11440
11441
11442 for b.Controls[0].Op == ssaop.OpRISCV64FNED {
11443 v_0 := b.Controls[0]
11444 t := v_0.Type
11445 _ = v_0.Args[1]
11446 v_0_0 := v_0.Args[0]
11447 v_0_1 := v_0.Args[1]
11448 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
11449 x := v_0_0
11450 y := v_0_1
11451 v0 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64FEQD, t)
11452 v0.AddArg2(x, y)
11453 b.ResetWithControl(block.BlockRISCV64BEQZ, v0)
11454 return true
11455 }
11456 }
11457
11458
11459 for b.Controls[0].Op == ssaop.OpRISCV64SUB {
11460 v_0 := b.Controls[0]
11461 y := v_0.Args[1]
11462 x := v_0.Args[0]
11463 b.ResetWithControl2(block.BlockRISCV64BNE, x, y)
11464 return true
11465 }
11466
11467
11468 for b.Controls[0].Op == ssaop.OpRISCV64SLT {
11469 v_0 := b.Controls[0]
11470 y := v_0.Args[1]
11471 x := v_0.Args[0]
11472 b.ResetWithControl2(block.BlockRISCV64BLT, x, y)
11473 return true
11474 }
11475
11476
11477 for b.Controls[0].Op == ssaop.OpRISCV64SLTU {
11478 v_0 := b.Controls[0]
11479 y := v_0.Args[1]
11480 x := v_0.Args[0]
11481 b.ResetWithControl2(block.BlockRISCV64BLTU, x, y)
11482 return true
11483 }
11484
11485
11486 for b.Controls[0].Op == ssaop.OpRISCV64SLTI {
11487 v_0 := b.Controls[0]
11488 x := ssa.AuxIntToInt64(v_0.AuxInt)
11489 y := v_0.Args[0]
11490 v0 := b.NewValue0(b.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
11491 v0.AuxInt = ssa.Int64ToAuxInt(x)
11492 b.ResetWithControl2(block.BlockRISCV64BLT, y, v0)
11493 return true
11494 }
11495
11496
11497 for b.Controls[0].Op == ssaop.OpRISCV64SLTIU {
11498 v_0 := b.Controls[0]
11499 x := ssa.AuxIntToInt64(v_0.AuxInt)
11500 y := v_0.Args[0]
11501 v0 := b.NewValue0(b.Pos, ssaop.OpRISCV64MOVDconst, typ.UInt64)
11502 v0.AuxInt = ssa.Int64ToAuxInt(x)
11503 b.ResetWithControl2(block.BlockRISCV64BLTU, y, v0)
11504 return true
11505 }
11506
11507
11508 for b.Controls[0].Op == ssaop.OpRISCV64ANDI {
11509 v_0 := b.Controls[0]
11510 c := ssa.AuxIntToInt64(v_0.AuxInt)
11511 v_0_0 := v_0.Args[0]
11512 if v_0_0.Op != ssaop.OpRISCV64FCLASSD {
11513 break
11514 }
11515 v_0_0_0 := v_0_0.Args[0]
11516 if v_0_0_0.Op != ssaop.OpRISCV64FNEGD {
11517 break
11518 }
11519 x := v_0_0_0.Args[0]
11520 v0 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
11521 v0.AuxInt = ssa.Int64ToAuxInt((c & 0b11_0000_0000) | int64(bits.Reverse8(uint8(c))&0b1111_1111))
11522 v1 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
11523 v1.AddArg(x)
11524 v0.AddArg(v1)
11525 b.ResetWithControl(block.BlockRISCV64BNEZ, v0)
11526 return true
11527 }
11528
11529
11530 for b.Controls[0].Op == ssaop.OpRISCV64ANDI {
11531 v_0 := b.Controls[0]
11532 c := ssa.AuxIntToInt64(v_0.AuxInt)
11533 v_0_0 := v_0.Args[0]
11534 if v_0_0.Op != ssaop.OpRISCV64FCLASSD {
11535 break
11536 }
11537 v_0_0_0 := v_0_0.Args[0]
11538 if v_0_0_0.Op != ssaop.OpRISCV64FABSD {
11539 break
11540 }
11541 x := v_0_0_0.Args[0]
11542 v0 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64ANDI, typ.Int64)
11543 v0.AuxInt = ssa.Int64ToAuxInt((c & 0b11_1111_0000) | int64(bits.Reverse8(uint8(c))&0b0000_1111))
11544 v1 := b.NewValue0(v_0.Pos, ssaop.OpRISCV64FCLASSD, typ.Int64)
11545 v1.AddArg(x)
11546 v0.AddArg(v1)
11547 b.ResetWithControl(block.BlockRISCV64BNEZ, v0)
11548 return true
11549 }
11550 case block.BlockIf:
11551
11552
11553 for {
11554 cond := b.Controls[0]
11555 v0 := b.NewValue0(cond.Pos, ssaop.OpRISCV64MOVBUreg, typ.UInt64)
11556 v0.AddArg(cond)
11557 b.ResetWithControl(block.BlockRISCV64BNEZ, v0)
11558 return true
11559 }
11560 case block.BlockJumpTable:
11561
11562
11563 for {
11564 idx := b.Controls[0]
11565 v0 := b.NewValue0(b.Pos, ssaop.OpRISCV64MOVaddr, typ.Uintptr)
11566 v0.Aux = ssa.SymToAux(ssa.MakeJumpTableSym(b))
11567 v1 := b.NewValue0(b.Pos, ssaop.OpSB, typ.Uintptr)
11568 v0.AddArg(v1)
11569 b.ResetWithControl2(block.BlockRISCV64JUMPTABLE, idx, v0)
11570 b.Aux = ssa.SymToAux(ssa.MakeJumpTableSym(b))
11571 return true
11572 }
11573 }
11574 return false
11575 }
11576
View as plain text