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