1// Code generated from _gen/LOONG64.rules using 'go generate'; DO NOT EDIT.23package loong6445import "cmd/compile/internal/types"6import "cmd/compile/internal/ssa/block"7import "cmd/compile/internal/ssa/ssaop"8import "cmd/compile/internal/ssa"910func RewriteValue(v *ssa.Value) bool {11 switch v.Op {12 case ssaop.OpAbs:13 v.Op = ssaop.OpLOONG64ABSD14 return true15 case ssaop.OpAdd16:16 v.Op = ssaop.OpLOONG64ADDV17 return true18 case ssaop.OpAdd32:19 v.Op = ssaop.OpLOONG64ADDV20 return true21 case ssaop.OpAdd32F:22 v.Op = ssaop.OpLOONG64ADDF23 return true24 case ssaop.OpAdd64:25 v.Op = ssaop.OpLOONG64ADDV26 return true27 case ssaop.OpAdd64F:28 v.Op = ssaop.OpLOONG64ADDD29 return true30 case ssaop.OpAdd8:31 v.Op = ssaop.OpLOONG64ADDV32 return true33 case ssaop.OpAddPtr:34 v.Op = ssaop.OpLOONG64ADDV35 return true36 case ssaop.OpAddr:37 return rewriteValue_OpAddr(v)38 case ssaop.OpAnd16:39 v.Op = ssaop.OpLOONG64AND40 return true41 case ssaop.OpAnd32:42 v.Op = ssaop.OpLOONG64AND43 return true44 case ssaop.OpAnd64:45 v.Op = ssaop.OpLOONG64AND46 return true47 case ssaop.OpAnd8:48 v.Op = ssaop.OpLOONG64AND49 return true50 case ssaop.OpAndB:51 v.Op = ssaop.OpLOONG64AND52 return true53 case ssaop.OpAtomicAdd32:54 v.Op = ssaop.OpLOONG64LoweredAtomicAdd3255 return true56 case ssaop.OpAtomicAdd64:57 v.Op = ssaop.OpLOONG64LoweredAtomicAdd6458 return true59 case ssaop.OpAtomicAnd32:60 v.Op = ssaop.OpLOONG64LoweredAtomicAnd3261 return true62 case ssaop.OpAtomicAnd32value:63 v.Op = ssaop.OpLOONG64LoweredAtomicAnd32value64 return true65 case ssaop.OpAtomicAnd64value:66 v.Op = ssaop.OpLOONG64LoweredAtomicAnd64value67 return true68 case ssaop.OpAtomicAnd8:69 return rewriteValue_OpAtomicAnd8(v)70 case ssaop.OpAtomicCompareAndSwap32:71 return rewriteValue_OpAtomicCompareAndSwap32(v)72 case ssaop.OpAtomicCompareAndSwap32Variant:73 return rewriteValue_OpAtomicCompareAndSwap32Variant(v)74 case ssaop.OpAtomicCompareAndSwap64:75 v.Op = ssaop.OpLOONG64LoweredAtomicCas6476 return true77 case ssaop.OpAtomicCompareAndSwap64Variant:78 v.Op = ssaop.OpLOONG64LoweredAtomicCas64Variant79 return true80 case ssaop.OpAtomicExchange32:81 v.Op = ssaop.OpLOONG64LoweredAtomicExchange3282 return true83 case ssaop.OpAtomicExchange64:84 v.Op = ssaop.OpLOONG64LoweredAtomicExchange6485 return true86 case ssaop.OpAtomicExchange8Variant:87 v.Op = ssaop.OpLOONG64LoweredAtomicExchange8Variant88 return true89 case ssaop.OpAtomicLoad32:90 v.Op = ssaop.OpLOONG64LoweredAtomicLoad3291 return true92 case ssaop.OpAtomicLoad64:93 v.Op = ssaop.OpLOONG64LoweredAtomicLoad6494 return true95 case ssaop.OpAtomicLoad8:96 v.Op = ssaop.OpLOONG64LoweredAtomicLoad897 return true98 case ssaop.OpAtomicLoadPtr:99 v.Op = ssaop.OpLOONG64LoweredAtomicLoad64100 return true101 case ssaop.OpAtomicOr32:102 v.Op = ssaop.OpLOONG64LoweredAtomicOr32103 return true104 case ssaop.OpAtomicOr32value:105 v.Op = ssaop.OpLOONG64LoweredAtomicOr32value106 return true107 case ssaop.OpAtomicOr64value:108 v.Op = ssaop.OpLOONG64LoweredAtomicOr64value109 return true110 case ssaop.OpAtomicOr8:111 return rewriteValue_OpAtomicOr8(v)112 case ssaop.OpAtomicStore32:113 v.Op = ssaop.OpLOONG64LoweredAtomicStore32114 return true115 case ssaop.OpAtomicStore32Variant:116 v.Op = ssaop.OpLOONG64LoweredAtomicStore32Variant117 return true118 case ssaop.OpAtomicStore64:119 v.Op = ssaop.OpLOONG64LoweredAtomicStore64120 return true121 case ssaop.OpAtomicStore64Variant:122 v.Op = ssaop.OpLOONG64LoweredAtomicStore64Variant123 return true124 case ssaop.OpAtomicStore8:125 v.Op = ssaop.OpLOONG64LoweredAtomicStore8126 return true127 case ssaop.OpAtomicStore8Variant:128 v.Op = ssaop.OpLOONG64LoweredAtomicStore8Variant129 return true130 case ssaop.OpAtomicStorePtrNoWB:131 v.Op = ssaop.OpLOONG64LoweredAtomicStore64132 return true133 case ssaop.OpAvg64u:134 return rewriteValue_OpAvg64u(v)135 case ssaop.OpBitLen16:136 return rewriteValue_OpBitLen16(v)137 case ssaop.OpBitLen32:138 return rewriteValue_OpBitLen32(v)139 case ssaop.OpBitLen64:140 return rewriteValue_OpBitLen64(v)141 case ssaop.OpBitLen8:142 return rewriteValue_OpBitLen8(v)143 case ssaop.OpBitRev16:144 return rewriteValue_OpBitRev16(v)145 case ssaop.OpBitRev32:146 v.Op = ssaop.OpLOONG64BITREVW147 return true148 case ssaop.OpBitRev64:149 v.Op = ssaop.OpLOONG64BITREVV150 return true151 case ssaop.OpBitRev8:152 v.Op = ssaop.OpLOONG64BITREV4B153 return true154 case ssaop.OpBswap16:155 v.Op = ssaop.OpLOONG64REVB2H156 return true157 case ssaop.OpBswap32:158 v.Op = ssaop.OpLOONG64REVB2W159 return true160 case ssaop.OpBswap64:161 v.Op = ssaop.OpLOONG64REVBV162 return true163 case ssaop.OpCeil:164 v.Op = ssaop.OpLOONG64FRINTPD165 return true166 case ssaop.OpClosureCall:167 v.Op = ssaop.OpLOONG64CALLclosure168 return true169 case ssaop.OpCom16:170 return rewriteValue_OpCom16(v)171 case ssaop.OpCom32:172 return rewriteValue_OpCom32(v)173 case ssaop.OpCom64:174 return rewriteValue_OpCom64(v)175 case ssaop.OpCom8:176 return rewriteValue_OpCom8(v)177 case ssaop.OpCondSelect:178 return rewriteValue_OpCondSelect(v)179 case ssaop.OpConst16:180 return rewriteValue_OpConst16(v)181 case ssaop.OpConst32:182 return rewriteValue_OpConst32(v)183 case ssaop.OpConst32F:184 return rewriteValue_OpConst32F(v)185 case ssaop.OpConst64:186 return rewriteValue_OpConst64(v)187 case ssaop.OpConst64F:188 return rewriteValue_OpConst64F(v)189 case ssaop.OpConst8:190 return rewriteValue_OpConst8(v)191 case ssaop.OpConstBool:192 return rewriteValue_OpConstBool(v)193 case ssaop.OpConstNil:194 return rewriteValue_OpConstNil(v)195 case ssaop.OpCopysign:196 v.Op = ssaop.OpLOONG64FCOPYSGD197 return true198 case ssaop.OpCtz16:199 return rewriteValue_OpCtz16(v)200 case ssaop.OpCtz16NonZero:201 v.Op = ssaop.OpCtz64202 return true203 case ssaop.OpCtz32:204 v.Op = ssaop.OpLOONG64CTZW205 return true206 case ssaop.OpCtz32NonZero:207 v.Op = ssaop.OpCtz64208 return true209 case ssaop.OpCtz64:210 v.Op = ssaop.OpLOONG64CTZV211 return true212 case ssaop.OpCtz64NonZero:213 v.Op = ssaop.OpCtz64214 return true215 case ssaop.OpCtz8:216 return rewriteValue_OpCtz8(v)217 case ssaop.OpCtz8NonZero:218 v.Op = ssaop.OpCtz64219 return true220 case ssaop.OpCvt32Fto32:221 return rewriteValue_OpCvt32Fto32(v)222 case ssaop.OpCvt32Fto64:223 return rewriteValue_OpCvt32Fto64(v)224 case ssaop.OpCvt32Fto64F:225 v.Op = ssaop.OpLOONG64MOVFD226 return true227 case ssaop.OpCvt32to32F:228 return rewriteValue_OpCvt32to32F(v)229 case ssaop.OpCvt32to64F:230 return rewriteValue_OpCvt32to64F(v)231 case ssaop.OpCvt64Fto32:232 return rewriteValue_OpCvt64Fto32(v)233 case ssaop.OpCvt64Fto32F:234 v.Op = ssaop.OpLOONG64MOVDF235 return true236 case ssaop.OpCvt64Fto64:237 return rewriteValue_OpCvt64Fto64(v)238 case ssaop.OpCvt64to32F:239 return rewriteValue_OpCvt64to32F(v)240 case ssaop.OpCvt64to64F:241 return rewriteValue_OpCvt64to64F(v)242 case ssaop.OpCvtBoolToUint8:243 v.Op = ssaop.OpCopy244 return true245 case ssaop.OpDiv16:246 return rewriteValue_OpDiv16(v)247 case ssaop.OpDiv16u:248 return rewriteValue_OpDiv16u(v)249 case ssaop.OpDiv32:250 return rewriteValue_OpDiv32(v)251 case ssaop.OpDiv32F:252 v.Op = ssaop.OpLOONG64DIVF253 return true254 case ssaop.OpDiv32u:255 return rewriteValue_OpDiv32u(v)256 case ssaop.OpDiv64:257 return rewriteValue_OpDiv64(v)258 case ssaop.OpDiv64F:259 v.Op = ssaop.OpLOONG64DIVD260 return true261 case ssaop.OpDiv64u:262 v.Op = ssaop.OpLOONG64DIVVU263 return true264 case ssaop.OpDiv8:265 return rewriteValue_OpDiv8(v)266 case ssaop.OpDiv8u:267 return rewriteValue_OpDiv8u(v)268 case ssaop.OpEq16:269 return rewriteValue_OpEq16(v)270 case ssaop.OpEq32:271 return rewriteValue_OpEq32(v)272 case ssaop.OpEq32F:273 return rewriteValue_OpEq32F(v)274 case ssaop.OpEq64:275 return rewriteValue_OpEq64(v)276 case ssaop.OpEq64F:277 return rewriteValue_OpEq64F(v)278 case ssaop.OpEq8:279 return rewriteValue_OpEq8(v)280 case ssaop.OpEqB:281 return rewriteValue_OpEqB(v)282 case ssaop.OpEqPtr:283 return rewriteValue_OpEqPtr(v)284 case ssaop.OpFMA:285 v.Op = ssaop.OpLOONG64FMADDD286 return true287 case ssaop.OpFloor:288 v.Op = ssaop.OpLOONG64FRINTMD289 return true290 case ssaop.OpGetCallerPC:291 v.Op = ssaop.OpLOONG64LoweredGetCallerPC292 return true293 case ssaop.OpGetCallerSP:294 v.Op = ssaop.OpLOONG64LoweredGetCallerSP295 return true296 case ssaop.OpGetClosurePtr:297 v.Op = ssaop.OpLOONG64LoweredGetClosurePtr298 return true299 case ssaop.OpHmul32:300 v.Op = ssaop.OpLOONG64MULH301 return true302 case ssaop.OpHmul32u:303 v.Op = ssaop.OpLOONG64MULHU304 return true305 case ssaop.OpHmul64:306 v.Op = ssaop.OpLOONG64MULHV307 return true308 case ssaop.OpHmul64u:309 v.Op = ssaop.OpLOONG64MULHVU310 return true311 case ssaop.OpInterCall:312 v.Op = ssaop.OpLOONG64CALLinter313 return true314 case ssaop.OpIsInBounds:315 return rewriteValue_OpIsInBounds(v)316 case ssaop.OpIsNonNil:317 return rewriteValue_OpIsNonNil(v)318 case ssaop.OpIsSliceInBounds:319 return rewriteValue_OpIsSliceInBounds(v)320 case ssaop.OpLOONG64ADDD:321 return rewriteValue_OpLOONG64ADDD(v)322 case ssaop.OpLOONG64ADDF:323 return rewriteValue_OpLOONG64ADDF(v)324 case ssaop.OpLOONG64ADDV:325 return rewriteValue_OpLOONG64ADDV(v)326 case ssaop.OpLOONG64ADDVconst:327 return rewriteValue_OpLOONG64ADDVconst(v)328 case ssaop.OpLOONG64ADDshiftLLV:329 return rewriteValue_OpLOONG64ADDshiftLLV(v)330 case ssaop.OpLOONG64AND:331 return rewriteValue_OpLOONG64AND(v)332 case ssaop.OpLOONG64ANDconst:333 return rewriteValue_OpLOONG64ANDconst(v)334 case ssaop.OpLOONG64DIVV:335 return rewriteValue_OpLOONG64DIVV(v)336 case ssaop.OpLOONG64DIVVU:337 return rewriteValue_OpLOONG64DIVVU(v)338 case ssaop.OpLOONG64LoweredPanicBoundsCR:339 return rewriteValue_OpLOONG64LoweredPanicBoundsCR(v)340 case ssaop.OpLOONG64LoweredPanicBoundsRC:341 return rewriteValue_OpLOONG64LoweredPanicBoundsRC(v)342 case ssaop.OpLOONG64LoweredPanicBoundsRR:343 return rewriteValue_OpLOONG64LoweredPanicBoundsRR(v)344 case ssaop.OpLOONG64MASKEQZ:345 return rewriteValue_OpLOONG64MASKEQZ(v)346 case ssaop.OpLOONG64MASKNEZ:347 return rewriteValue_OpLOONG64MASKNEZ(v)348 case ssaop.OpLOONG64MOVBUload:349 return rewriteValue_OpLOONG64MOVBUload(v)350 case ssaop.OpLOONG64MOVBUloadidx:351 return rewriteValue_OpLOONG64MOVBUloadidx(v)352 case ssaop.OpLOONG64MOVBUreg:353 return rewriteValue_OpLOONG64MOVBUreg(v)354 case ssaop.OpLOONG64MOVBload:355 return rewriteValue_OpLOONG64MOVBload(v)356 case ssaop.OpLOONG64MOVBloadidx:357 return rewriteValue_OpLOONG64MOVBloadidx(v)358 case ssaop.OpLOONG64MOVBreg:359 return rewriteValue_OpLOONG64MOVBreg(v)360 case ssaop.OpLOONG64MOVBstore:361 return rewriteValue_OpLOONG64MOVBstore(v)362 case ssaop.OpLOONG64MOVBstoreidx:363 return rewriteValue_OpLOONG64MOVBstoreidx(v)364 case ssaop.OpLOONG64MOVDF:365 return rewriteValue_OpLOONG64MOVDF(v)366 case ssaop.OpLOONG64MOVDload:367 return rewriteValue_OpLOONG64MOVDload(v)368 case ssaop.OpLOONG64MOVDloadidx:369 return rewriteValue_OpLOONG64MOVDloadidx(v)370 case ssaop.OpLOONG64MOVDstore:371 return rewriteValue_OpLOONG64MOVDstore(v)372 case ssaop.OpLOONG64MOVDstoreidx:373 return rewriteValue_OpLOONG64MOVDstoreidx(v)374 case ssaop.OpLOONG64MOVFload:375 return rewriteValue_OpLOONG64MOVFload(v)376 case ssaop.OpLOONG64MOVFloadidx:377 return rewriteValue_OpLOONG64MOVFloadidx(v)378 case ssaop.OpLOONG64MOVFstore:379 return rewriteValue_OpLOONG64MOVFstore(v)380 case ssaop.OpLOONG64MOVFstoreidx:381 return rewriteValue_OpLOONG64MOVFstoreidx(v)382 case ssaop.OpLOONG64MOVHUload:383 return rewriteValue_OpLOONG64MOVHUload(v)384 case ssaop.OpLOONG64MOVHUloadidx:385 return rewriteValue_OpLOONG64MOVHUloadidx(v)386 case ssaop.OpLOONG64MOVHUreg:387 return rewriteValue_OpLOONG64MOVHUreg(v)388 case ssaop.OpLOONG64MOVHload:389 return rewriteValue_OpLOONG64MOVHload(v)390 case ssaop.OpLOONG64MOVHloadidx:391 return rewriteValue_OpLOONG64MOVHloadidx(v)392 case ssaop.OpLOONG64MOVHreg:393 return rewriteValue_OpLOONG64MOVHreg(v)394 case ssaop.OpLOONG64MOVHstore:395 return rewriteValue_OpLOONG64MOVHstore(v)396 case ssaop.OpLOONG64MOVHstoreidx:397 return rewriteValue_OpLOONG64MOVHstoreidx(v)398 case ssaop.OpLOONG64MOVVload:399 return rewriteValue_OpLOONG64MOVVload(v)400 case ssaop.OpLOONG64MOVVloadidx:401 return rewriteValue_OpLOONG64MOVVloadidx(v)402 case ssaop.OpLOONG64MOVVreg:403 return rewriteValue_OpLOONG64MOVVreg(v)404 case ssaop.OpLOONG64MOVVstore:405 return rewriteValue_OpLOONG64MOVVstore(v)406 case ssaop.OpLOONG64MOVVstoreidx:407 return rewriteValue_OpLOONG64MOVVstoreidx(v)408 case ssaop.OpLOONG64MOVWUload:409 return rewriteValue_OpLOONG64MOVWUload(v)410 case ssaop.OpLOONG64MOVWUloadidx:411 return rewriteValue_OpLOONG64MOVWUloadidx(v)412 case ssaop.OpLOONG64MOVWUreg:413 return rewriteValue_OpLOONG64MOVWUreg(v)414 case ssaop.OpLOONG64MOVWload:415 return rewriteValue_OpLOONG64MOVWload(v)416 case ssaop.OpLOONG64MOVWloadidx:417 return rewriteValue_OpLOONG64MOVWloadidx(v)418 case ssaop.OpLOONG64MOVWreg:419 return rewriteValue_OpLOONG64MOVWreg(v)420 case ssaop.OpLOONG64MOVWstore:421 return rewriteValue_OpLOONG64MOVWstore(v)422 case ssaop.OpLOONG64MOVWstoreidx:423 return rewriteValue_OpLOONG64MOVWstoreidx(v)424 case ssaop.OpLOONG64MULV:425 return rewriteValue_OpLOONG64MULV(v)426 case ssaop.OpLOONG64NEGV:427 return rewriteValue_OpLOONG64NEGV(v)428 case ssaop.OpLOONG64NOR:429 return rewriteValue_OpLOONG64NOR(v)430 case ssaop.OpLOONG64NORconst:431 return rewriteValue_OpLOONG64NORconst(v)432 case ssaop.OpLOONG64OR:433 return rewriteValue_OpLOONG64OR(v)434 case ssaop.OpLOONG64ORN:435 return rewriteValue_OpLOONG64ORN(v)436 case ssaop.OpLOONG64ORconst:437 return rewriteValue_OpLOONG64ORconst(v)438 case ssaop.OpLOONG64REMV:439 return rewriteValue_OpLOONG64REMV(v)440 case ssaop.OpLOONG64REMVU:441 return rewriteValue_OpLOONG64REMVU(v)442 case ssaop.OpLOONG64ROTR:443 return rewriteValue_OpLOONG64ROTR(v)444 case ssaop.OpLOONG64ROTRV:445 return rewriteValue_OpLOONG64ROTRV(v)446 case ssaop.OpLOONG64SGT:447 return rewriteValue_OpLOONG64SGT(v)448 case ssaop.OpLOONG64SGTU:449 return rewriteValue_OpLOONG64SGTU(v)450 case ssaop.OpLOONG64SGTUconst:451 return rewriteValue_OpLOONG64SGTUconst(v)452 case ssaop.OpLOONG64SGTconst:453 return rewriteValue_OpLOONG64SGTconst(v)454 case ssaop.OpLOONG64SLL:455 return rewriteValue_OpLOONG64SLL(v)456 case ssaop.OpLOONG64SLLV:457 return rewriteValue_OpLOONG64SLLV(v)458 case ssaop.OpLOONG64SLLVconst:459 return rewriteValue_OpLOONG64SLLVconst(v)460 case ssaop.OpLOONG64SLLconst:461 return rewriteValue_OpLOONG64SLLconst(v)462 case ssaop.OpLOONG64SRA:463 return rewriteValue_OpLOONG64SRA(v)464 case ssaop.OpLOONG64SRAV:465 return rewriteValue_OpLOONG64SRAV(v)466 case ssaop.OpLOONG64SRAVconst:467 return rewriteValue_OpLOONG64SRAVconst(v)468 case ssaop.OpLOONG64SRL:469 return rewriteValue_OpLOONG64SRL(v)470 case ssaop.OpLOONG64SRLV:471 return rewriteValue_OpLOONG64SRLV(v)472 case ssaop.OpLOONG64SRLVconst:473 return rewriteValue_OpLOONG64SRLVconst(v)474 case ssaop.OpLOONG64SUBD:475 return rewriteValue_OpLOONG64SUBD(v)476 case ssaop.OpLOONG64SUBF:477 return rewriteValue_OpLOONG64SUBF(v)478 case ssaop.OpLOONG64SUBV:479 return rewriteValue_OpLOONG64SUBV(v)480 case ssaop.OpLOONG64SUBVconst:481 return rewriteValue_OpLOONG64SUBVconst(v)482 case ssaop.OpLOONG64XOR:483 return rewriteValue_OpLOONG64XOR(v)484 case ssaop.OpLOONG64XORconst:485 return rewriteValue_OpLOONG64XORconst(v)486 case ssaop.OpLeq16:487 return rewriteValue_OpLeq16(v)488 case ssaop.OpLeq16U:489 return rewriteValue_OpLeq16U(v)490 case ssaop.OpLeq32:491 return rewriteValue_OpLeq32(v)492 case ssaop.OpLeq32F:493 return rewriteValue_OpLeq32F(v)494 case ssaop.OpLeq32U:495 return rewriteValue_OpLeq32U(v)496 case ssaop.OpLeq64:497 return rewriteValue_OpLeq64(v)498 case ssaop.OpLeq64F:499 return rewriteValue_OpLeq64F(v)500 case ssaop.OpLeq64U:501 return rewriteValue_OpLeq64U(v)502 case ssaop.OpLeq8:503 return rewriteValue_OpLeq8(v)504 case ssaop.OpLeq8U:505 return rewriteValue_OpLeq8U(v)506 case ssaop.OpLess16:507 return rewriteValue_OpLess16(v)508 case ssaop.OpLess16U:509 return rewriteValue_OpLess16U(v)510 case ssaop.OpLess32:511 return rewriteValue_OpLess32(v)512 case ssaop.OpLess32F:513 return rewriteValue_OpLess32F(v)514 case ssaop.OpLess32U:515 return rewriteValue_OpLess32U(v)516 case ssaop.OpLess64:517 return rewriteValue_OpLess64(v)518 case ssaop.OpLess64F:519 return rewriteValue_OpLess64F(v)520 case ssaop.OpLess64U:521 return rewriteValue_OpLess64U(v)522 case ssaop.OpLess8:523 return rewriteValue_OpLess8(v)524 case ssaop.OpLess8U:525 return rewriteValue_OpLess8U(v)526 case ssaop.OpLoad:527 return rewriteValue_OpLoad(v)528 case ssaop.OpLocalAddr:529 return rewriteValue_OpLocalAddr(v)530 case ssaop.OpLsh16x16:531 return rewriteValue_OpLsh16x16(v)532 case ssaop.OpLsh16x32:533 return rewriteValue_OpLsh16x32(v)534 case ssaop.OpLsh16x64:535 return rewriteValue_OpLsh16x64(v)536 case ssaop.OpLsh16x8:537 return rewriteValue_OpLsh16x8(v)538 case ssaop.OpLsh32x16:539 return rewriteValue_OpLsh32x16(v)540 case ssaop.OpLsh32x32:541 return rewriteValue_OpLsh32x32(v)542 case ssaop.OpLsh32x64:543 return rewriteValue_OpLsh32x64(v)544 case ssaop.OpLsh32x8:545 return rewriteValue_OpLsh32x8(v)546 case ssaop.OpLsh64x16:547 return rewriteValue_OpLsh64x16(v)548 case ssaop.OpLsh64x32:549 return rewriteValue_OpLsh64x32(v)550 case ssaop.OpLsh64x64:551 return rewriteValue_OpLsh64x64(v)552 case ssaop.OpLsh64x8:553 return rewriteValue_OpLsh64x8(v)554 case ssaop.OpLsh8x16:555 return rewriteValue_OpLsh8x16(v)556 case ssaop.OpLsh8x32:557 return rewriteValue_OpLsh8x32(v)558 case ssaop.OpLsh8x64:559 return rewriteValue_OpLsh8x64(v)560 case ssaop.OpLsh8x8:561 return rewriteValue_OpLsh8x8(v)562 case ssaop.OpMax32F:563 v.Op = ssaop.OpLOONG64FMAXF564 return true565 case ssaop.OpMax64F:566 v.Op = ssaop.OpLOONG64FMAXD567 return true568 case ssaop.OpMin32F:569 v.Op = ssaop.OpLOONG64FMINF570 return true571 case ssaop.OpMin64F:572 v.Op = ssaop.OpLOONG64FMIND573 return true574 case ssaop.OpMod16:575 return rewriteValue_OpMod16(v)576 case ssaop.OpMod16u:577 return rewriteValue_OpMod16u(v)578 case ssaop.OpMod32:579 return rewriteValue_OpMod32(v)580 case ssaop.OpMod32u:581 return rewriteValue_OpMod32u(v)582 case ssaop.OpMod64:583 return rewriteValue_OpMod64(v)584 case ssaop.OpMod64u:585 v.Op = ssaop.OpLOONG64REMVU586 return true587 case ssaop.OpMod8:588 return rewriteValue_OpMod8(v)589 case ssaop.OpMod8u:590 return rewriteValue_OpMod8u(v)591 case ssaop.OpMove:592 return rewriteValue_OpMove(v)593 case ssaop.OpMul16:594 v.Op = ssaop.OpLOONG64MULV595 return true596 case ssaop.OpMul32:597 v.Op = ssaop.OpLOONG64MULV598 return true599 case ssaop.OpMul32F:600 v.Op = ssaop.OpLOONG64MULF601 return true602 case ssaop.OpMul64:603 v.Op = ssaop.OpLOONG64MULV604 return true605 case ssaop.OpMul64F:606 v.Op = ssaop.OpLOONG64MULD607 return true608 case ssaop.OpMul8:609 v.Op = ssaop.OpLOONG64MULV610 return true611 case ssaop.OpNeg16:612 v.Op = ssaop.OpLOONG64NEGV613 return true614 case ssaop.OpNeg32:615 v.Op = ssaop.OpLOONG64NEGV616 return true617 case ssaop.OpNeg32F:618 v.Op = ssaop.OpLOONG64NEGF619 return true620 case ssaop.OpNeg64:621 v.Op = ssaop.OpLOONG64NEGV622 return true623 case ssaop.OpNeg64F:624 v.Op = ssaop.OpLOONG64NEGD625 return true626 case ssaop.OpNeg8:627 v.Op = ssaop.OpLOONG64NEGV628 return true629 case ssaop.OpNeq16:630 return rewriteValue_OpNeq16(v)631 case ssaop.OpNeq32:632 return rewriteValue_OpNeq32(v)633 case ssaop.OpNeq32F:634 return rewriteValue_OpNeq32F(v)635 case ssaop.OpNeq64:636 return rewriteValue_OpNeq64(v)637 case ssaop.OpNeq64F:638 return rewriteValue_OpNeq64F(v)639 case ssaop.OpNeq8:640 return rewriteValue_OpNeq8(v)641 case ssaop.OpNeqB:642 v.Op = ssaop.OpLOONG64XOR643 return true644 case ssaop.OpNeqPtr:645 return rewriteValue_OpNeqPtr(v)646 case ssaop.OpNilCheck:647 v.Op = ssaop.OpLOONG64LoweredNilCheck648 return true649 case ssaop.OpNot:650 return rewriteValue_OpNot(v)651 case ssaop.OpOffPtr:652 return rewriteValue_OpOffPtr(v)653 case ssaop.OpOr16:654 v.Op = ssaop.OpLOONG64OR655 return true656 case ssaop.OpOr32:657 v.Op = ssaop.OpLOONG64OR658 return true659 case ssaop.OpOr64:660 v.Op = ssaop.OpLOONG64OR661 return true662 case ssaop.OpOr8:663 v.Op = ssaop.OpLOONG64OR664 return true665 case ssaop.OpOrB:666 v.Op = ssaop.OpLOONG64OR667 return true668 case ssaop.OpPanicBounds:669 v.Op = ssaop.OpLOONG64LoweredPanicBoundsRR670 return true671 case ssaop.OpPopCount16:672 return rewriteValue_OpPopCount16(v)673 case ssaop.OpPopCount32:674 return rewriteValue_OpPopCount32(v)675 case ssaop.OpPopCount64:676 return rewriteValue_OpPopCount64(v)677 case ssaop.OpPrefetchCache:678 return rewriteValue_OpPrefetchCache(v)679 case ssaop.OpPrefetchCacheStreamed:680 return rewriteValue_OpPrefetchCacheStreamed(v)681 case ssaop.OpPubBarrier:682 v.Op = ssaop.OpLOONG64LoweredPubBarrier683 return true684 case ssaop.OpRotateLeft16:685 return rewriteValue_OpRotateLeft16(v)686 case ssaop.OpRotateLeft32:687 return rewriteValue_OpRotateLeft32(v)688 case ssaop.OpRotateLeft64:689 return rewriteValue_OpRotateLeft64(v)690 case ssaop.OpRotateLeft8:691 return rewriteValue_OpRotateLeft8(v)692 case ssaop.OpRound32F:693 v.Op = ssaop.OpLOONG64LoweredRound32F694 return true695 case ssaop.OpRound64F:696 v.Op = ssaop.OpLOONG64LoweredRound64F697 return true698 case ssaop.OpRoundToEven:699 v.Op = ssaop.OpLOONG64FRINTND700 return true701 case ssaop.OpRsh16Ux16:702 return rewriteValue_OpRsh16Ux16(v)703 case ssaop.OpRsh16Ux32:704 return rewriteValue_OpRsh16Ux32(v)705 case ssaop.OpRsh16Ux64:706 return rewriteValue_OpRsh16Ux64(v)707 case ssaop.OpRsh16Ux8:708 return rewriteValue_OpRsh16Ux8(v)709 case ssaop.OpRsh16x16:710 return rewriteValue_OpRsh16x16(v)711 case ssaop.OpRsh16x32:712 return rewriteValue_OpRsh16x32(v)713 case ssaop.OpRsh16x64:714 return rewriteValue_OpRsh16x64(v)715 case ssaop.OpRsh16x8:716 return rewriteValue_OpRsh16x8(v)717 case ssaop.OpRsh32Ux16:718 return rewriteValue_OpRsh32Ux16(v)719 case ssaop.OpRsh32Ux32:720 return rewriteValue_OpRsh32Ux32(v)721 case ssaop.OpRsh32Ux64:722 return rewriteValue_OpRsh32Ux64(v)723 case ssaop.OpRsh32Ux8:724 return rewriteValue_OpRsh32Ux8(v)725 case ssaop.OpRsh32x16:726 return rewriteValue_OpRsh32x16(v)727 case ssaop.OpRsh32x32:728 return rewriteValue_OpRsh32x32(v)729 case ssaop.OpRsh32x64:730 return rewriteValue_OpRsh32x64(v)731 case ssaop.OpRsh32x8:732 return rewriteValue_OpRsh32x8(v)733 case ssaop.OpRsh64Ux16:734 return rewriteValue_OpRsh64Ux16(v)735 case ssaop.OpRsh64Ux32:736 return rewriteValue_OpRsh64Ux32(v)737 case ssaop.OpRsh64Ux64:738 return rewriteValue_OpRsh64Ux64(v)739 case ssaop.OpRsh64Ux8:740 return rewriteValue_OpRsh64Ux8(v)741 case ssaop.OpRsh64x16:742 return rewriteValue_OpRsh64x16(v)743 case ssaop.OpRsh64x32:744 return rewriteValue_OpRsh64x32(v)745 case ssaop.OpRsh64x64:746 return rewriteValue_OpRsh64x64(v)747 case ssaop.OpRsh64x8:748 return rewriteValue_OpRsh64x8(v)749 case ssaop.OpRsh8Ux16:750 return rewriteValue_OpRsh8Ux16(v)751 case ssaop.OpRsh8Ux32:752 return rewriteValue_OpRsh8Ux32(v)753 case ssaop.OpRsh8Ux64:754 return rewriteValue_OpRsh8Ux64(v)755 case ssaop.OpRsh8Ux8:756 return rewriteValue_OpRsh8Ux8(v)757 case ssaop.OpRsh8x16:758 return rewriteValue_OpRsh8x16(v)759 case ssaop.OpRsh8x32:760 return rewriteValue_OpRsh8x32(v)761 case ssaop.OpRsh8x64:762 return rewriteValue_OpRsh8x64(v)763 case ssaop.OpRsh8x8:764 return rewriteValue_OpRsh8x8(v)765 case ssaop.OpSelect0:766 return rewriteValue_OpSelect0(v)767 case ssaop.OpSelect1:768 return rewriteValue_OpSelect1(v)769 case ssaop.OpSelectN:770 return rewriteValue_OpSelectN(v)771 case ssaop.OpSignExt16to32:772 v.Op = ssaop.OpLOONG64MOVHreg773 return true774 case ssaop.OpSignExt16to64:775 v.Op = ssaop.OpLOONG64MOVHreg776 return true777 case ssaop.OpSignExt32to64:778 v.Op = ssaop.OpLOONG64MOVWreg779 return true780 case ssaop.OpSignExt8to16:781 v.Op = ssaop.OpLOONG64MOVBreg782 return true783 case ssaop.OpSignExt8to32:784 v.Op = ssaop.OpLOONG64MOVBreg785 return true786 case ssaop.OpSignExt8to64:787 v.Op = ssaop.OpLOONG64MOVBreg788 return true789 case ssaop.OpSlicemask:790 return rewriteValue_OpSlicemask(v)791 case ssaop.OpSqrt:792 v.Op = ssaop.OpLOONG64SQRTD793 return true794 case ssaop.OpSqrt32:795 v.Op = ssaop.OpLOONG64SQRTF796 return true797 case ssaop.OpStaticCall:798 v.Op = ssaop.OpLOONG64CALLstatic799 return true800 case ssaop.OpStore:801 return rewriteValue_OpStore(v)802 case ssaop.OpSub16:803 v.Op = ssaop.OpLOONG64SUBV804 return true805 case ssaop.OpSub32:806 v.Op = ssaop.OpLOONG64SUBV807 return true808 case ssaop.OpSub32F:809 v.Op = ssaop.OpLOONG64SUBF810 return true811 case ssaop.OpSub64:812 v.Op = ssaop.OpLOONG64SUBV813 return true814 case ssaop.OpSub64F:815 v.Op = ssaop.OpLOONG64SUBD816 return true817 case ssaop.OpSub8:818 v.Op = ssaop.OpLOONG64SUBV819 return true820 case ssaop.OpSubPtr:821 v.Op = ssaop.OpLOONG64SUBV822 return true823 case ssaop.OpTailCall:824 v.Op = ssaop.OpLOONG64CALLtail825 return true826 case ssaop.OpTailCallInter:827 v.Op = ssaop.OpLOONG64CALLtailinter828 return true829 case ssaop.OpTrunc:830 v.Op = ssaop.OpLOONG64FRINTZD831 return true832 case ssaop.OpTrunc16to8:833 v.Op = ssaop.OpCopy834 return true835 case ssaop.OpTrunc32to16:836 v.Op = ssaop.OpCopy837 return true838 case ssaop.OpTrunc32to8:839 v.Op = ssaop.OpCopy840 return true841 case ssaop.OpTrunc64to16:842 v.Op = ssaop.OpCopy843 return true844 case ssaop.OpTrunc64to32:845 v.Op = ssaop.OpCopy846 return true847 case ssaop.OpTrunc64to8:848 v.Op = ssaop.OpCopy849 return true850 case ssaop.OpWB:851 v.Op = ssaop.OpLOONG64LoweredWB852 return true853 case ssaop.OpXor16:854 v.Op = ssaop.OpLOONG64XOR855 return true856 case ssaop.OpXor32:857 v.Op = ssaop.OpLOONG64XOR858 return true859 case ssaop.OpXor64:860 v.Op = ssaop.OpLOONG64XOR861 return true862 case ssaop.OpXor8:863 v.Op = ssaop.OpLOONG64XOR864 return true865 case ssaop.OpZero:866 return rewriteValue_OpZero(v)867 case ssaop.OpZeroExt16to32:868 v.Op = ssaop.OpLOONG64MOVHUreg869 return true870 case ssaop.OpZeroExt16to64:871 v.Op = ssaop.OpLOONG64MOVHUreg872 return true873 case ssaop.OpZeroExt32to64:874 v.Op = ssaop.OpLOONG64MOVWUreg875 return true876 case ssaop.OpZeroExt8to16:877 v.Op = ssaop.OpLOONG64MOVBUreg878 return true879 case ssaop.OpZeroExt8to32:880 v.Op = ssaop.OpLOONG64MOVBUreg881 return true882 case ssaop.OpZeroExt8to64:883 v.Op = ssaop.OpLOONG64MOVBUreg884 return true885 }886 return false887}888func rewriteValue_OpAddr(v *ssa.Value) bool {889 v_0 := v.Args[0]890 // match: (Addr {sym} base)891 // result: (MOVVaddr {sym} base)892 for {893 sym := ssa.AuxToSym(v.Aux)894 base := v_0895 v.Reset(ssaop.OpLOONG64MOVVaddr)896 v.Aux = ssa.SymToAux(sym)897 v.AddArg(base)898 return true899 }900}901func rewriteValue_OpAtomicAnd8(v *ssa.Value) bool {902 v_2 := v.Args[2]903 v_1 := v.Args[1]904 v_0 := v.Args[0]905 b := v.Block906 typ := &b.Func.Config.Types907 // match: (AtomicAnd8 ptr val mem)908 // result: (LoweredAtomicAnd32 (AND <typ.Uintptr> (MOVVconst [^3]) ptr) (NORconst [0] <typ.UInt32> (SLLV <typ.UInt32> (XORconst <typ.UInt32> [0xff] (ZeroExt8to32 val)) (SLLVconst <typ.UInt64> [3] (ANDconst <typ.UInt64> [3] ptr)))) mem)909 for {910 ptr := v_0911 val := v_1912 mem := v_2913 v.Reset(ssaop.OpLOONG64LoweredAtomicAnd32)914 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64AND, typ.Uintptr)915 v1 := b.NewValue0(v.Pos, ssaop.OpLOONG64MOVVconst, typ.UInt64)916 v1.AuxInt = ssa.Int64ToAuxInt(^3)917 v0.AddArg2(v1, ptr)918 v2 := b.NewValue0(v.Pos, ssaop.OpLOONG64NORconst, typ.UInt32)919 v2.AuxInt = ssa.Int64ToAuxInt(0)920 v3 := b.NewValue0(v.Pos, ssaop.OpLOONG64SLLV, typ.UInt32)921 v4 := b.NewValue0(v.Pos, ssaop.OpLOONG64XORconst, typ.UInt32)922 v4.AuxInt = ssa.Int64ToAuxInt(0xff)923 v5 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)924 v5.AddArg(val)925 v4.AddArg(v5)926 v6 := b.NewValue0(v.Pos, ssaop.OpLOONG64SLLVconst, typ.UInt64)927 v6.AuxInt = ssa.Int64ToAuxInt(3)928 v7 := b.NewValue0(v.Pos, ssaop.OpLOONG64ANDconst, typ.UInt64)929 v7.AuxInt = ssa.Int64ToAuxInt(3)930 v7.AddArg(ptr)931 v6.AddArg(v7)932 v3.AddArg2(v4, v6)933 v2.AddArg(v3)934 v.AddArg3(v0, v2, mem)935 return true936 }937}938func rewriteValue_OpAtomicCompareAndSwap32(v *ssa.Value) bool {939 v_3 := v.Args[3]940 v_2 := v.Args[2]941 v_1 := v.Args[1]942 v_0 := v.Args[0]943 b := v.Block944 typ := &b.Func.Config.Types945 // match: (AtomicCompareAndSwap32 ptr old new mem)946 // result: (LoweredAtomicCas32 ptr (SignExt32to64 old) new mem)947 for {948 ptr := v_0949 old := v_1950 new := v_2951 mem := v_3952 v.Reset(ssaop.OpLOONG64LoweredAtomicCas32)953 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt32to64, typ.Int64)954 v0.AddArg(old)955 v.AddArg4(ptr, v0, new, mem)956 return true957 }958}959func rewriteValue_OpAtomicCompareAndSwap32Variant(v *ssa.Value) bool {960 v_3 := v.Args[3]961 v_2 := v.Args[2]962 v_1 := v.Args[1]963 v_0 := v.Args[0]964 b := v.Block965 typ := &b.Func.Config.Types966 // match: (AtomicCompareAndSwap32Variant ptr old new mem)967 // result: (LoweredAtomicCas32Variant ptr (SignExt32to64 old) new mem)968 for {969 ptr := v_0970 old := v_1971 new := v_2972 mem := v_3973 v.Reset(ssaop.OpLOONG64LoweredAtomicCas32Variant)974 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt32to64, typ.Int64)975 v0.AddArg(old)976 v.AddArg4(ptr, v0, new, mem)977 return true978 }979}980func rewriteValue_OpAtomicOr8(v *ssa.Value) bool {981 v_2 := v.Args[2]982 v_1 := v.Args[1]983 v_0 := v.Args[0]984 b := v.Block985 typ := &b.Func.Config.Types986 // match: (AtomicOr8 ptr val mem)987 // result: (LoweredAtomicOr32 (AND <typ.Uintptr> (MOVVconst [^3]) ptr) (SLLV <typ.UInt32> (ZeroExt8to32 val) (SLLVconst <typ.UInt64> [3] (ANDconst <typ.UInt64> [3] ptr))) mem)988 for {989 ptr := v_0990 val := v_1991 mem := v_2992 v.Reset(ssaop.OpLOONG64LoweredAtomicOr32)993 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64AND, typ.Uintptr)994 v1 := b.NewValue0(v.Pos, ssaop.OpLOONG64MOVVconst, typ.UInt64)995 v1.AuxInt = ssa.Int64ToAuxInt(^3)996 v0.AddArg2(v1, ptr)997 v2 := b.NewValue0(v.Pos, ssaop.OpLOONG64SLLV, typ.UInt32)998 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to32, typ.UInt32)999 v3.AddArg(val)1000 v4 := b.NewValue0(v.Pos, ssaop.OpLOONG64SLLVconst, typ.UInt64)1001 v4.AuxInt = ssa.Int64ToAuxInt(3)1002 v5 := b.NewValue0(v.Pos, ssaop.OpLOONG64ANDconst, typ.UInt64)1003 v5.AuxInt = ssa.Int64ToAuxInt(3)1004 v5.AddArg(ptr)1005 v4.AddArg(v5)1006 v2.AddArg2(v3, v4)1007 v.AddArg3(v0, v2, mem)1008 return true1009 }1010}1011func rewriteValue_OpAvg64u(v *ssa.Value) bool {1012 v_1 := v.Args[1]1013 v_0 := v.Args[0]1014 b := v.Block1015 // match: (Avg64u <t> x y)1016 // result: (ADDV (SRLVconst <t> (SUBV <t> x y) [1]) y)1017 for {1018 t := v.Type1019 x := v_01020 y := v_11021 v.Reset(ssaop.OpLOONG64ADDV)1022 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64SRLVconst, t)1023 v0.AuxInt = ssa.Int64ToAuxInt(1)1024 v1 := b.NewValue0(v.Pos, ssaop.OpLOONG64SUBV, t)1025 v1.AddArg2(x, y)1026 v0.AddArg(v1)1027 v.AddArg2(v0, y)1028 return true1029 }1030}1031func rewriteValue_OpBitLen16(v *ssa.Value) bool {1032 v_0 := v.Args[0]1033 b := v.Block1034 typ := &b.Func.Config.Types1035 // match: (BitLen16 x)1036 // result: (BitLen64 (ZeroExt16to64 x))1037 for {1038 x := v_01039 v.Reset(ssaop.OpBitLen64)1040 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)1041 v0.AddArg(x)1042 v.AddArg(v0)1043 return true1044 }1045}1046func rewriteValue_OpBitLen32(v *ssa.Value) bool {1047 v_0 := v.Args[0]1048 b := v.Block1049 // match: (BitLen32 <t> x)1050 // result: (NEGV <t> (SUBVconst <t> [32] (CLZW <t> x)))1051 for {1052 t := v.Type1053 x := v_01054 v.Reset(ssaop.OpLOONG64NEGV)1055 v.Type = t1056 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64SUBVconst, t)1057 v0.AuxInt = ssa.Int64ToAuxInt(32)1058 v1 := b.NewValue0(v.Pos, ssaop.OpLOONG64CLZW, t)1059 v1.AddArg(x)1060 v0.AddArg(v1)1061 v.AddArg(v0)1062 return true1063 }1064}1065func rewriteValue_OpBitLen64(v *ssa.Value) bool {1066 v_0 := v.Args[0]1067 b := v.Block1068 // match: (BitLen64 <t> x)1069 // result: (NEGV <t> (SUBVconst <t> [64] (CLZV <t> x)))1070 for {1071 t := v.Type1072 x := v_01073 v.Reset(ssaop.OpLOONG64NEGV)1074 v.Type = t1075 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64SUBVconst, t)1076 v0.AuxInt = ssa.Int64ToAuxInt(64)1077 v1 := b.NewValue0(v.Pos, ssaop.OpLOONG64CLZV, t)1078 v1.AddArg(x)1079 v0.AddArg(v1)1080 v.AddArg(v0)1081 return true1082 }1083}1084func rewriteValue_OpBitLen8(v *ssa.Value) bool {1085 v_0 := v.Args[0]1086 b := v.Block1087 typ := &b.Func.Config.Types1088 // match: (BitLen8 x)1089 // result: (BitLen64 (ZeroExt8to64 x))1090 for {1091 x := v_01092 v.Reset(ssaop.OpBitLen64)1093 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)1094 v0.AddArg(x)1095 v.AddArg(v0)1096 return true1097 }1098}1099func rewriteValue_OpBitRev16(v *ssa.Value) bool {1100 v_0 := v.Args[0]1101 b := v.Block1102 // match: (BitRev16 <t> x)1103 // result: (REVB2H (BITREV4B <t> x))1104 for {1105 t := v.Type1106 x := v_01107 v.Reset(ssaop.OpLOONG64REVB2H)1108 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64BITREV4B, t)1109 v0.AddArg(x)1110 v.AddArg(v0)1111 return true1112 }1113}1114func rewriteValue_OpCom16(v *ssa.Value) bool {1115 v_0 := v.Args[0]1116 b := v.Block1117 typ := &b.Func.Config.Types1118 // match: (Com16 x)1119 // result: (NOR (MOVVconst [0]) x)1120 for {1121 x := v_01122 v.Reset(ssaop.OpLOONG64NOR)1123 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64MOVVconst, typ.UInt64)1124 v0.AuxInt = ssa.Int64ToAuxInt(0)1125 v.AddArg2(v0, x)1126 return true1127 }1128}1129func rewriteValue_OpCom32(v *ssa.Value) bool {1130 v_0 := v.Args[0]1131 b := v.Block1132 typ := &b.Func.Config.Types1133 // match: (Com32 x)1134 // result: (NOR (MOVVconst [0]) x)1135 for {1136 x := v_01137 v.Reset(ssaop.OpLOONG64NOR)1138 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64MOVVconst, typ.UInt64)1139 v0.AuxInt = ssa.Int64ToAuxInt(0)1140 v.AddArg2(v0, x)1141 return true1142 }1143}1144func rewriteValue_OpCom64(v *ssa.Value) bool {1145 v_0 := v.Args[0]1146 b := v.Block1147 typ := &b.Func.Config.Types1148 // match: (Com64 x)1149 // result: (NOR (MOVVconst [0]) x)1150 for {1151 x := v_01152 v.Reset(ssaop.OpLOONG64NOR)1153 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64MOVVconst, typ.UInt64)1154 v0.AuxInt = ssa.Int64ToAuxInt(0)1155 v.AddArg2(v0, x)1156 return true1157 }1158}1159func rewriteValue_OpCom8(v *ssa.Value) bool {1160 v_0 := v.Args[0]1161 b := v.Block1162 typ := &b.Func.Config.Types1163 // match: (Com8 x)1164 // result: (NOR (MOVVconst [0]) x)1165 for {1166 x := v_01167 v.Reset(ssaop.OpLOONG64NOR)1168 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64MOVVconst, typ.UInt64)1169 v0.AuxInt = ssa.Int64ToAuxInt(0)1170 v.AddArg2(v0, x)1171 return true1172 }1173}1174func rewriteValue_OpCondSelect(v *ssa.Value) bool {1175 v_2 := v.Args[2]1176 v_1 := v.Args[1]1177 v_0 := v.Args[0]1178 b := v.Block1179 // match: (CondSelect <t> x y cond)1180 // result: (OR (MASKEQZ <t> x cond) (MASKNEZ <t> y cond))1181 for {1182 t := v.Type1183 x := v_01184 y := v_11185 cond := v_21186 v.Reset(ssaop.OpLOONG64OR)1187 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64MASKEQZ, t)1188 v0.AddArg2(x, cond)1189 v1 := b.NewValue0(v.Pos, ssaop.OpLOONG64MASKNEZ, t)1190 v1.AddArg2(y, cond)1191 v.AddArg2(v0, v1)1192 return true1193 }1194}1195func rewriteValue_OpConst16(v *ssa.Value) bool {1196 // match: (Const16 [val])1197 // result: (MOVVconst [int64(val)])1198 for {1199 val := ssa.AuxIntToInt16(v.AuxInt)1200 v.Reset(ssaop.OpLOONG64MOVVconst)1201 v.AuxInt = ssa.Int64ToAuxInt(int64(val))1202 return true1203 }1204}1205func rewriteValue_OpConst32(v *ssa.Value) bool {1206 // match: (Const32 [val])1207 // result: (MOVVconst [int64(val)])1208 for {1209 val := ssa.AuxIntToInt32(v.AuxInt)1210 v.Reset(ssaop.OpLOONG64MOVVconst)1211 v.AuxInt = ssa.Int64ToAuxInt(int64(val))1212 return true1213 }1214}1215func rewriteValue_OpConst32F(v *ssa.Value) bool {1216 // match: (Const32F [val])1217 // result: (MOVFconst [float64(val)])1218 for {1219 val := ssa.AuxIntToFloat32(v.AuxInt)1220 v.Reset(ssaop.OpLOONG64MOVFconst)1221 v.AuxInt = ssa.Float64ToAuxInt(float64(val))1222 return true1223 }1224}1225func rewriteValue_OpConst64(v *ssa.Value) bool {1226 // match: (Const64 [val])1227 // result: (MOVVconst [int64(val)])1228 for {1229 val := ssa.AuxIntToInt64(v.AuxInt)1230 v.Reset(ssaop.OpLOONG64MOVVconst)1231 v.AuxInt = ssa.Int64ToAuxInt(int64(val))1232 return true1233 }1234}1235func rewriteValue_OpConst64F(v *ssa.Value) bool {1236 // match: (Const64F [val])1237 // result: (MOVDconst [float64(val)])1238 for {1239 val := ssa.AuxIntToFloat64(v.AuxInt)1240 v.Reset(ssaop.OpLOONG64MOVDconst)1241 v.AuxInt = ssa.Float64ToAuxInt(float64(val))1242 return true1243 }1244}1245func rewriteValue_OpConst8(v *ssa.Value) bool {1246 // match: (Const8 [val])1247 // result: (MOVVconst [int64(val)])1248 for {1249 val := ssa.AuxIntToInt8(v.AuxInt)1250 v.Reset(ssaop.OpLOONG64MOVVconst)1251 v.AuxInt = ssa.Int64ToAuxInt(int64(val))1252 return true1253 }1254}1255func rewriteValue_OpConstBool(v *ssa.Value) bool {1256 // match: (ConstBool [t])1257 // result: (MOVVconst [int64(ssa.B2i(t))])1258 for {1259 t := ssa.AuxIntToBool(v.AuxInt)1260 v.Reset(ssaop.OpLOONG64MOVVconst)1261 v.AuxInt = ssa.Int64ToAuxInt(int64(ssa.B2i(t)))1262 return true1263 }1264}1265func rewriteValue_OpConstNil(v *ssa.Value) bool {1266 // match: (ConstNil)1267 // result: (MOVVconst [0])1268 for {1269 v.Reset(ssaop.OpLOONG64MOVVconst)1270 v.AuxInt = ssa.Int64ToAuxInt(0)1271 return true1272 }1273}1274func rewriteValue_OpCtz16(v *ssa.Value) bool {1275 v_0 := v.Args[0]1276 b := v.Block1277 typ := &b.Func.Config.Types1278 // match: (Ctz16 x)1279 // result: (CTZV (OR <typ.UInt64> x (MOVVconst [1<<16])))1280 for {1281 x := v_01282 v.Reset(ssaop.OpLOONG64CTZV)1283 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64OR, typ.UInt64)1284 v1 := b.NewValue0(v.Pos, ssaop.OpLOONG64MOVVconst, typ.UInt64)1285 v1.AuxInt = ssa.Int64ToAuxInt(1 << 16)1286 v0.AddArg2(x, v1)1287 v.AddArg(v0)1288 return true1289 }1290}1291func rewriteValue_OpCtz8(v *ssa.Value) bool {1292 v_0 := v.Args[0]1293 b := v.Block1294 typ := &b.Func.Config.Types1295 // match: (Ctz8 x)1296 // result: (CTZV (OR <typ.UInt64> x (MOVVconst [1<<8])))1297 for {1298 x := v_01299 v.Reset(ssaop.OpLOONG64CTZV)1300 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64OR, typ.UInt64)1301 v1 := b.NewValue0(v.Pos, ssaop.OpLOONG64MOVVconst, typ.UInt64)1302 v1.AuxInt = ssa.Int64ToAuxInt(1 << 8)1303 v0.AddArg2(x, v1)1304 v.AddArg(v0)1305 return true1306 }1307}1308func rewriteValue_OpCvt32Fto32(v *ssa.Value) bool {1309 v_0 := v.Args[0]1310 b := v.Block1311 // match: (Cvt32Fto32 <t> x)1312 // result: (MOVWfpgp (TRUNCFW <t> x))1313 for {1314 t := v.Type1315 x := v_01316 v.Reset(ssaop.OpLOONG64MOVWfpgp)1317 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64TRUNCFW, t)1318 v0.AddArg(x)1319 v.AddArg(v0)1320 return true1321 }1322}1323func rewriteValue_OpCvt32Fto64(v *ssa.Value) bool {1324 v_0 := v.Args[0]1325 b := v.Block1326 // match: (Cvt32Fto64 <t> x)1327 // result: (MOVVfpgp (TRUNCFV <t> x))1328 for {1329 t := v.Type1330 x := v_01331 v.Reset(ssaop.OpLOONG64MOVVfpgp)1332 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64TRUNCFV, t)1333 v0.AddArg(x)1334 v.AddArg(v0)1335 return true1336 }1337}1338func rewriteValue_OpCvt32to32F(v *ssa.Value) bool {1339 v_0 := v.Args[0]1340 b := v.Block1341 // match: (Cvt32to32F <t> x)1342 // result: (MOVWF (MOVWgpfp <t> x))1343 for {1344 t := v.Type1345 x := v_01346 v.Reset(ssaop.OpLOONG64MOVWF)1347 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64MOVWgpfp, t)1348 v0.AddArg(x)1349 v.AddArg(v0)1350 return true1351 }1352}1353func rewriteValue_OpCvt32to64F(v *ssa.Value) bool {1354 v_0 := v.Args[0]1355 b := v.Block1356 // match: (Cvt32to64F <t> x)1357 // result: (MOVWD (MOVWgpfp <t> x))1358 for {1359 t := v.Type1360 x := v_01361 v.Reset(ssaop.OpLOONG64MOVWD)1362 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64MOVWgpfp, t)1363 v0.AddArg(x)1364 v.AddArg(v0)1365 return true1366 }1367}1368func rewriteValue_OpCvt64Fto32(v *ssa.Value) bool {1369 v_0 := v.Args[0]1370 b := v.Block1371 // match: (Cvt64Fto32 <t> x)1372 // result: (MOVWfpgp (TRUNCDW <t> x))1373 for {1374 t := v.Type1375 x := v_01376 v.Reset(ssaop.OpLOONG64MOVWfpgp)1377 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64TRUNCDW, t)1378 v0.AddArg(x)1379 v.AddArg(v0)1380 return true1381 }1382}1383func rewriteValue_OpCvt64Fto64(v *ssa.Value) bool {1384 v_0 := v.Args[0]1385 b := v.Block1386 // match: (Cvt64Fto64 <t> x)1387 // result: (MOVVfpgp (TRUNCDV <t> x))1388 for {1389 t := v.Type1390 x := v_01391 v.Reset(ssaop.OpLOONG64MOVVfpgp)1392 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64TRUNCDV, t)1393 v0.AddArg(x)1394 v.AddArg(v0)1395 return true1396 }1397}1398func rewriteValue_OpCvt64to32F(v *ssa.Value) bool {1399 v_0 := v.Args[0]1400 b := v.Block1401 // match: (Cvt64to32F <t> x)1402 // result: (MOVVF (MOVVgpfp <t> x))1403 for {1404 t := v.Type1405 x := v_01406 v.Reset(ssaop.OpLOONG64MOVVF)1407 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64MOVVgpfp, t)1408 v0.AddArg(x)1409 v.AddArg(v0)1410 return true1411 }1412}1413func rewriteValue_OpCvt64to64F(v *ssa.Value) bool {1414 v_0 := v.Args[0]1415 b := v.Block1416 // match: (Cvt64to64F <t> x)1417 // result: (MOVVD (MOVVgpfp <t> x))1418 for {1419 t := v.Type1420 x := v_01421 v.Reset(ssaop.OpLOONG64MOVVD)1422 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64MOVVgpfp, t)1423 v0.AddArg(x)1424 v.AddArg(v0)1425 return true1426 }1427}1428func rewriteValue_OpDiv16(v *ssa.Value) bool {1429 v_1 := v.Args[1]1430 v_0 := v.Args[0]1431 b := v.Block1432 typ := &b.Func.Config.Types1433 // match: (Div16 x y)1434 // result: (DIVV (SignExt16to64 x) (SignExt16to64 y))1435 for {1436 x := v_01437 y := v_11438 v.Reset(ssaop.OpLOONG64DIVV)1439 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt16to64, typ.Int64)1440 v0.AddArg(x)1441 v1 := b.NewValue0(v.Pos, ssaop.OpSignExt16to64, typ.Int64)1442 v1.AddArg(y)1443 v.AddArg2(v0, v1)1444 return true1445 }1446}1447func rewriteValue_OpDiv16u(v *ssa.Value) bool {1448 v_1 := v.Args[1]1449 v_0 := v.Args[0]1450 b := v.Block1451 typ := &b.Func.Config.Types1452 // match: (Div16u x y)1453 // result: (DIVVU (ZeroExt16to64 x) (ZeroExt16to64 y))1454 for {1455 x := v_01456 y := v_11457 v.Reset(ssaop.OpLOONG64DIVVU)1458 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)1459 v0.AddArg(x)1460 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)1461 v1.AddArg(y)1462 v.AddArg2(v0, v1)1463 return true1464 }1465}1466func rewriteValue_OpDiv32(v *ssa.Value) bool {1467 v_1 := v.Args[1]1468 v_0 := v.Args[0]1469 b := v.Block1470 typ := &b.Func.Config.Types1471 // match: (Div32 x y)1472 // result: (DIVV (SignExt32to64 x) (SignExt32to64 y))1473 for {1474 x := v_01475 y := v_11476 v.Reset(ssaop.OpLOONG64DIVV)1477 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt32to64, typ.Int64)1478 v0.AddArg(x)1479 v1 := b.NewValue0(v.Pos, ssaop.OpSignExt32to64, typ.Int64)1480 v1.AddArg(y)1481 v.AddArg2(v0, v1)1482 return true1483 }1484}1485func rewriteValue_OpDiv32u(v *ssa.Value) bool {1486 v_1 := v.Args[1]1487 v_0 := v.Args[0]1488 b := v.Block1489 typ := &b.Func.Config.Types1490 // match: (Div32u x y)1491 // result: (DIVVU (ZeroExt32to64 x) (ZeroExt32to64 y))1492 for {1493 x := v_01494 y := v_11495 v.Reset(ssaop.OpLOONG64DIVVU)1496 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)1497 v0.AddArg(x)1498 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)1499 v1.AddArg(y)1500 v.AddArg2(v0, v1)1501 return true1502 }1503}1504func rewriteValue_OpDiv64(v *ssa.Value) bool {1505 v_1 := v.Args[1]1506 v_0 := v.Args[0]1507 // match: (Div64 x y)1508 // result: (DIVV x y)1509 for {1510 x := v_01511 y := v_11512 v.Reset(ssaop.OpLOONG64DIVV)1513 v.AddArg2(x, y)1514 return true1515 }1516}1517func rewriteValue_OpDiv8(v *ssa.Value) bool {1518 v_1 := v.Args[1]1519 v_0 := v.Args[0]1520 b := v.Block1521 typ := &b.Func.Config.Types1522 // match: (Div8 x y)1523 // result: (DIVV (SignExt8to64 x) (SignExt8to64 y))1524 for {1525 x := v_01526 y := v_11527 v.Reset(ssaop.OpLOONG64DIVV)1528 v0 := b.NewValue0(v.Pos, ssaop.OpSignExt8to64, typ.Int64)1529 v0.AddArg(x)1530 v1 := b.NewValue0(v.Pos, ssaop.OpSignExt8to64, typ.Int64)1531 v1.AddArg(y)1532 v.AddArg2(v0, v1)1533 return true1534 }1535}1536func rewriteValue_OpDiv8u(v *ssa.Value) bool {1537 v_1 := v.Args[1]1538 v_0 := v.Args[0]1539 b := v.Block1540 typ := &b.Func.Config.Types1541 // match: (Div8u x y)1542 // result: (DIVVU (ZeroExt8to64 x) (ZeroExt8to64 y))1543 for {1544 x := v_01545 y := v_11546 v.Reset(ssaop.OpLOONG64DIVVU)1547 v0 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)1548 v0.AddArg(x)1549 v1 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)1550 v1.AddArg(y)1551 v.AddArg2(v0, v1)1552 return true1553 }1554}1555func rewriteValue_OpEq16(v *ssa.Value) bool {1556 v_1 := v.Args[1]1557 v_0 := v.Args[0]1558 b := v.Block1559 typ := &b.Func.Config.Types1560 // match: (Eq16 x y)1561 // result: (SGTU (MOVVconst [1]) (XOR (ZeroExt16to64 x) (ZeroExt16to64 y)))1562 for {1563 x := v_01564 y := v_11565 v.Reset(ssaop.OpLOONG64SGTU)1566 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64MOVVconst, typ.UInt64)1567 v0.AuxInt = ssa.Int64ToAuxInt(1)1568 v1 := b.NewValue0(v.Pos, ssaop.OpLOONG64XOR, typ.UInt64)1569 v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)1570 v2.AddArg(x)1571 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt16to64, typ.UInt64)1572 v3.AddArg(y)1573 v1.AddArg2(v2, v3)1574 v.AddArg2(v0, v1)1575 return true1576 }1577}1578func rewriteValue_OpEq32(v *ssa.Value) bool {1579 v_1 := v.Args[1]1580 v_0 := v.Args[0]1581 b := v.Block1582 typ := &b.Func.Config.Types1583 // match: (Eq32 x y)1584 // result: (SGTU (MOVVconst [1]) (XOR (ZeroExt32to64 x) (ZeroExt32to64 y)))1585 for {1586 x := v_01587 y := v_11588 v.Reset(ssaop.OpLOONG64SGTU)1589 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64MOVVconst, typ.UInt64)1590 v0.AuxInt = ssa.Int64ToAuxInt(1)1591 v1 := b.NewValue0(v.Pos, ssaop.OpLOONG64XOR, typ.UInt64)1592 v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)1593 v2.AddArg(x)1594 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt32to64, typ.UInt64)1595 v3.AddArg(y)1596 v1.AddArg2(v2, v3)1597 v.AddArg2(v0, v1)1598 return true1599 }1600}1601func rewriteValue_OpEq32F(v *ssa.Value) bool {1602 v_1 := v.Args[1]1603 v_0 := v.Args[0]1604 b := v.Block1605 // match: (Eq32F x y)1606 // result: (FPFlagTrue (CMPEQF x y))1607 for {1608 x := v_01609 y := v_11610 v.Reset(ssaop.OpLOONG64FPFlagTrue)1611 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64CMPEQF, types.TypeFlags)1612 v0.AddArg2(x, y)1613 v.AddArg(v0)1614 return true1615 }1616}1617func rewriteValue_OpEq64(v *ssa.Value) bool {1618 v_1 := v.Args[1]1619 v_0 := v.Args[0]1620 b := v.Block1621 typ := &b.Func.Config.Types1622 // match: (Eq64 x y)1623 // result: (SGTU (MOVVconst [1]) (XOR x y))1624 for {1625 x := v_01626 y := v_11627 v.Reset(ssaop.OpLOONG64SGTU)1628 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64MOVVconst, typ.UInt64)1629 v0.AuxInt = ssa.Int64ToAuxInt(1)1630 v1 := b.NewValue0(v.Pos, ssaop.OpLOONG64XOR, typ.UInt64)1631 v1.AddArg2(x, y)1632 v.AddArg2(v0, v1)1633 return true1634 }1635}1636func rewriteValue_OpEq64F(v *ssa.Value) bool {1637 v_1 := v.Args[1]1638 v_0 := v.Args[0]1639 b := v.Block1640 // match: (Eq64F x y)1641 // result: (FPFlagTrue (CMPEQD x y))1642 for {1643 x := v_01644 y := v_11645 v.Reset(ssaop.OpLOONG64FPFlagTrue)1646 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64CMPEQD, types.TypeFlags)1647 v0.AddArg2(x, y)1648 v.AddArg(v0)1649 return true1650 }1651}1652func rewriteValue_OpEq8(v *ssa.Value) bool {1653 v_1 := v.Args[1]1654 v_0 := v.Args[0]1655 b := v.Block1656 typ := &b.Func.Config.Types1657 // match: (Eq8 x y)1658 // result: (SGTU (MOVVconst [1]) (XOR (ZeroExt8to64 x) (ZeroExt8to64 y)))1659 for {1660 x := v_01661 y := v_11662 v.Reset(ssaop.OpLOONG64SGTU)1663 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64MOVVconst, typ.UInt64)1664 v0.AuxInt = ssa.Int64ToAuxInt(1)1665 v1 := b.NewValue0(v.Pos, ssaop.OpLOONG64XOR, typ.UInt64)1666 v2 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)1667 v2.AddArg(x)1668 v3 := b.NewValue0(v.Pos, ssaop.OpZeroExt8to64, typ.UInt64)1669 v3.AddArg(y)1670 v1.AddArg2(v2, v3)1671 v.AddArg2(v0, v1)1672 return true1673 }1674}1675func rewriteValue_OpEqB(v *ssa.Value) bool {1676 v_1 := v.Args[1]1677 v_0 := v.Args[0]1678 b := v.Block1679 typ := &b.Func.Config.Types1680 // match: (EqB x y)1681 // result: (XOR (MOVVconst [1]) (XOR <typ.Bool> x y))1682 for {1683 x := v_01684 y := v_11685 v.Reset(ssaop.OpLOONG64XOR)1686 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64MOVVconst, typ.UInt64)1687 v0.AuxInt = ssa.Int64ToAuxInt(1)1688 v1 := b.NewValue0(v.Pos, ssaop.OpLOONG64XOR, typ.Bool)1689 v1.AddArg2(x, y)1690 v.AddArg2(v0, v1)1691 return true1692 }1693}1694func rewriteValue_OpEqPtr(v *ssa.Value) bool {1695 v_1 := v.Args[1]1696 v_0 := v.Args[0]1697 b := v.Block1698 typ := &b.Func.Config.Types1699 // match: (EqPtr x y)1700 // result: (SGTU (MOVVconst [1]) (XOR x y))1701 for {1702 x := v_01703 y := v_11704 v.Reset(ssaop.OpLOONG64SGTU)1705 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64MOVVconst, typ.UInt64)1706 v0.AuxInt = ssa.Int64ToAuxInt(1)1707 v1 := b.NewValue0(v.Pos, ssaop.OpLOONG64XOR, typ.UInt64)1708 v1.AddArg2(x, y)1709 v.AddArg2(v0, v1)1710 return true1711 }1712}1713func rewriteValue_OpIsInBounds(v *ssa.Value) bool {1714 v_1 := v.Args[1]1715 v_0 := v.Args[0]1716 // match: (IsInBounds idx len)1717 // result: (SGTU len idx)1718 for {1719 idx := v_01720 len := v_11721 v.Reset(ssaop.OpLOONG64SGTU)1722 v.AddArg2(len, idx)1723 return true1724 }1725}1726func rewriteValue_OpIsNonNil(v *ssa.Value) bool {1727 v_0 := v.Args[0]1728 b := v.Block1729 typ := &b.Func.Config.Types1730 // match: (IsNonNil ptr)1731 // result: (SGTU ptr (MOVVconst [0]))1732 for {1733 ptr := v_01734 v.Reset(ssaop.OpLOONG64SGTU)1735 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64MOVVconst, typ.UInt64)1736 v0.AuxInt = ssa.Int64ToAuxInt(0)1737 v.AddArg2(ptr, v0)1738 return true1739 }1740}1741func rewriteValue_OpIsSliceInBounds(v *ssa.Value) bool {1742 v_1 := v.Args[1]1743 v_0 := v.Args[0]1744 b := v.Block1745 typ := &b.Func.Config.Types1746 // match: (IsSliceInBounds idx len)1747 // result: (XOR (MOVVconst [1]) (SGTU idx len))1748 for {1749 idx := v_01750 len := v_11751 v.Reset(ssaop.OpLOONG64XOR)1752 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64MOVVconst, typ.UInt64)1753 v0.AuxInt = ssa.Int64ToAuxInt(1)1754 v1 := b.NewValue0(v.Pos, ssaop.OpLOONG64SGTU, typ.Bool)1755 v1.AddArg2(idx, len)1756 v.AddArg2(v0, v1)1757 return true1758 }1759}1760func rewriteValue_OpLOONG64ADDD(v *ssa.Value) bool {1761 v_1 := v.Args[1]1762 v_0 := v.Args[0]1763 // match: (ADDD (MULD x y) z)1764 // cond: z.Block.Func.UseFMA(v)1765 // result: (FMADDD x y z)1766 for {1767 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1768 if v_0.Op != ssaop.OpLOONG64MULD {1769 continue1770 }1771 y := v_0.Args[1]1772 x := v_0.Args[0]1773 z := v_11774 if !(z.Block.Func.UseFMA(v)) {1775 continue1776 }1777 v.Reset(ssaop.OpLOONG64FMADDD)1778 v.AddArg3(x, y, z)1779 return true1780 }1781 break1782 }1783 // match: (ADDD z (NEGD (MULD x y)))1784 // cond: z.Block.Func.UseFMA(v)1785 // result: (FNMSUBD x y z)1786 for {1787 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1788 z := v_01789 if v_1.Op != ssaop.OpLOONG64NEGD {1790 continue1791 }1792 v_1_0 := v_1.Args[0]1793 if v_1_0.Op != ssaop.OpLOONG64MULD {1794 continue1795 }1796 y := v_1_0.Args[1]1797 x := v_1_0.Args[0]1798 if !(z.Block.Func.UseFMA(v)) {1799 continue1800 }1801 v.Reset(ssaop.OpLOONG64FNMSUBD)1802 v.AddArg3(x, y, z)1803 return true1804 }1805 break1806 }1807 return false1808}1809func rewriteValue_OpLOONG64ADDF(v *ssa.Value) bool {1810 v_1 := v.Args[1]1811 v_0 := v.Args[0]1812 // match: (ADDF (MULF x y) z)1813 // cond: z.Block.Func.UseFMA(v)1814 // result: (FMADDF x y z)1815 for {1816 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1817 if v_0.Op != ssaop.OpLOONG64MULF {1818 continue1819 }1820 y := v_0.Args[1]1821 x := v_0.Args[0]1822 z := v_11823 if !(z.Block.Func.UseFMA(v)) {1824 continue1825 }1826 v.Reset(ssaop.OpLOONG64FMADDF)1827 v.AddArg3(x, y, z)1828 return true1829 }1830 break1831 }1832 // match: (ADDF z (NEGF (MULF x y)))1833 // cond: z.Block.Func.UseFMA(v)1834 // result: (FNMSUBF x y z)1835 for {1836 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1837 z := v_01838 if v_1.Op != ssaop.OpLOONG64NEGF {1839 continue1840 }1841 v_1_0 := v_1.Args[0]1842 if v_1_0.Op != ssaop.OpLOONG64MULF {1843 continue1844 }1845 y := v_1_0.Args[1]1846 x := v_1_0.Args[0]1847 if !(z.Block.Func.UseFMA(v)) {1848 continue1849 }1850 v.Reset(ssaop.OpLOONG64FNMSUBF)1851 v.AddArg3(x, y, z)1852 return true1853 }1854 break1855 }1856 return false1857}1858func rewriteValue_OpLOONG64ADDV(v *ssa.Value) bool {1859 v_1 := v.Args[1]1860 v_0 := v.Args[0]1861 b := v.Block1862 typ := &b.Func.Config.Types1863 // match: (ADDV <typ.UInt16> (SRLVconst [8] <typ.UInt16> x) (SLLVconst [8] <typ.UInt16> x))1864 // result: (REVB2H x)1865 for {1866 if v.Type != typ.UInt16 {1867 break1868 }1869 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1870 if v_0.Op != ssaop.OpLOONG64SRLVconst || v_0.Type != typ.UInt16 || ssa.AuxIntToInt64(v_0.AuxInt) != 8 {1871 continue1872 }1873 x := v_0.Args[0]1874 if v_1.Op != ssaop.OpLOONG64SLLVconst || v_1.Type != typ.UInt16 || ssa.AuxIntToInt64(v_1.AuxInt) != 8 || x != v_1.Args[0] {1875 continue1876 }1877 v.Reset(ssaop.OpLOONG64REVB2H)1878 v.AddArg(x)1879 return true1880 }1881 break1882 }1883 // match: (ADDV (SRLconst [8] (ANDconst [c1] x)) (SLLconst [8] (ANDconst [c2] x)))1884 // cond: uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff1885 // result: (REVB2H x)1886 for {1887 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1888 if v_0.Op != ssaop.OpLOONG64SRLconst || ssa.AuxIntToInt64(v_0.AuxInt) != 8 {1889 continue1890 }1891 v_0_0 := v_0.Args[0]1892 if v_0_0.Op != ssaop.OpLOONG64ANDconst {1893 continue1894 }1895 c1 := ssa.AuxIntToInt64(v_0_0.AuxInt)1896 x := v_0_0.Args[0]1897 if v_1.Op != ssaop.OpLOONG64SLLconst || ssa.AuxIntToInt64(v_1.AuxInt) != 8 {1898 continue1899 }1900 v_1_0 := v_1.Args[0]1901 if v_1_0.Op != ssaop.OpLOONG64ANDconst {1902 continue1903 }1904 c2 := ssa.AuxIntToInt64(v_1_0.AuxInt)1905 if x != v_1_0.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {1906 continue1907 }1908 v.Reset(ssaop.OpLOONG64REVB2H)1909 v.AddArg(x)1910 return true1911 }1912 break1913 }1914 // match: (ADDV (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (AND (MOVVconst [c2]) x)))1915 // cond: uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff1916 // result: (REVB4H x)1917 for {1918 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1919 if v_0.Op != ssaop.OpLOONG64SRLVconst || ssa.AuxIntToInt64(v_0.AuxInt) != 8 {1920 continue1921 }1922 v_0_0 := v_0.Args[0]1923 if v_0_0.Op != ssaop.OpLOONG64AND {1924 continue1925 }1926 _ = v_0_0.Args[1]1927 v_0_0_0 := v_0_0.Args[0]1928 v_0_0_1 := v_0_0.Args[1]1929 for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {1930 if v_0_0_0.Op != ssaop.OpLOONG64MOVVconst {1931 continue1932 }1933 c1 := ssa.AuxIntToInt64(v_0_0_0.AuxInt)1934 x := v_0_0_11935 if v_1.Op != ssaop.OpLOONG64SLLVconst || ssa.AuxIntToInt64(v_1.AuxInt) != 8 {1936 continue1937 }1938 v_1_0 := v_1.Args[0]1939 if v_1_0.Op != ssaop.OpLOONG64AND {1940 continue1941 }1942 _ = v_1_0.Args[1]1943 v_1_0_0 := v_1_0.Args[0]1944 v_1_0_1 := v_1_0.Args[1]1945 for _i2 := 0; _i2 <= 1; _i2, v_1_0_0, v_1_0_1 = _i2+1, v_1_0_1, v_1_0_0 {1946 if v_1_0_0.Op != ssaop.OpLOONG64MOVVconst {1947 continue1948 }1949 c2 := ssa.AuxIntToInt64(v_1_0_0.AuxInt)1950 if x != v_1_0_1 || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {1951 continue1952 }1953 v.Reset(ssaop.OpLOONG64REVB4H)1954 v.AddArg(x)1955 return true1956 }1957 }1958 }1959 break1960 }1961 // match: (ADDV (SRLVconst [8] (AND (MOVVconst [c1]) x)) (SLLVconst [8] (ANDconst [c2] x)))1962 // cond: uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff1963 // result: (REVB4H (ANDconst <x.Type> [0xffffffff] x))1964 for {1965 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1966 if v_0.Op != ssaop.OpLOONG64SRLVconst || ssa.AuxIntToInt64(v_0.AuxInt) != 8 {1967 continue1968 }1969 v_0_0 := v_0.Args[0]1970 if v_0_0.Op != ssaop.OpLOONG64AND {1971 continue1972 }1973 _ = v_0_0.Args[1]1974 v_0_0_0 := v_0_0.Args[0]1975 v_0_0_1 := v_0_0.Args[1]1976 for _i1 := 0; _i1 <= 1; _i1, v_0_0_0, v_0_0_1 = _i1+1, v_0_0_1, v_0_0_0 {1977 if v_0_0_0.Op != ssaop.OpLOONG64MOVVconst {1978 continue1979 }1980 c1 := ssa.AuxIntToInt64(v_0_0_0.AuxInt)1981 x := v_0_0_11982 if v_1.Op != ssaop.OpLOONG64SLLVconst || ssa.AuxIntToInt64(v_1.AuxInt) != 8 {1983 continue1984 }1985 v_1_0 := v_1.Args[0]1986 if v_1_0.Op != ssaop.OpLOONG64ANDconst {1987 continue1988 }1989 c2 := ssa.AuxIntToInt64(v_1_0.AuxInt)1990 if x != v_1_0.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {1991 continue1992 }1993 v.Reset(ssaop.OpLOONG64REVB4H)1994 v0 := b.NewValue0(v.Pos, ssaop.OpLOONG64ANDconst, x.Type)1995 v0.AuxInt = ssa.Int64ToAuxInt(0xffffffff)1996 v0.AddArg(x)1997 v.AddArg(v0)1998 return true1999 }2000 }
Findings
✓ No findings reported for this file.