1// Code generated from _gen/generic.rules using 'go generate'; DO NOT EDIT.23package generic45import "math"6import "math/bits"7import "cmd/internal/obj"8import "cmd/compile/internal/types"9import "cmd/compile/internal/ir"10import "cmd/compile/internal/ssa/block"11import "cmd/compile/internal/ssa/ssaop"12import "cmd/compile/internal/ssa"1314func RewriteValue(v *ssa.Value) bool {15 switch v.Op {16 case ssaop.OpAdd16:17 return rewriteValue_OpAdd16(v)18 case ssaop.OpAdd32:19 return rewriteValue_OpAdd32(v)20 case ssaop.OpAdd32F:21 return rewriteValue_OpAdd32F(v)22 case ssaop.OpAdd64:23 return rewriteValue_OpAdd64(v)24 case ssaop.OpAdd64F:25 return rewriteValue_OpAdd64F(v)26 case ssaop.OpAdd64carry:27 return rewriteValue_OpAdd64carry(v)28 case ssaop.OpAdd8:29 return rewriteValue_OpAdd8(v)30 case ssaop.OpAddPtr:31 return rewriteValue_OpAddPtr(v)32 case ssaop.OpAnd16:33 return rewriteValue_OpAnd16(v)34 case ssaop.OpAnd32:35 return rewriteValue_OpAnd32(v)36 case ssaop.OpAnd64:37 return rewriteValue_OpAnd64(v)38 case ssaop.OpAnd8:39 return rewriteValue_OpAnd8(v)40 case ssaop.OpAndB:41 return rewriteValue_OpAndB(v)42 case ssaop.OpArraySelect:43 return rewriteValue_OpArraySelect(v)44 case ssaop.OpBitLen16:45 return rewriteValue_OpBitLen16(v)46 case ssaop.OpBitLen32:47 return rewriteValue_OpBitLen32(v)48 case ssaop.OpBitLen64:49 return rewriteValue_OpBitLen64(v)50 case ssaop.OpBitLen8:51 return rewriteValue_OpBitLen8(v)52 case ssaop.OpBitRev16:53 return rewriteValue_OpBitRev16(v)54 case ssaop.OpBitRev32:55 return rewriteValue_OpBitRev32(v)56 case ssaop.OpBitRev64:57 return rewriteValue_OpBitRev64(v)58 case ssaop.OpBitRev8:59 return rewriteValue_OpBitRev8(v)60 case ssaop.OpBswap16:61 return rewriteValue_OpBswap16(v)62 case ssaop.OpBswap32:63 return rewriteValue_OpBswap32(v)64 case ssaop.OpBswap64:65 return rewriteValue_OpBswap64(v)66 case ssaop.OpCeil:67 return rewriteValue_OpCeil(v)68 case ssaop.OpCom16:69 return rewriteValue_OpCom16(v)70 case ssaop.OpCom32:71 return rewriteValue_OpCom32(v)72 case ssaop.OpCom64:73 return rewriteValue_OpCom64(v)74 case ssaop.OpCom8:75 return rewriteValue_OpCom8(v)76 case ssaop.OpCondSelect:77 return rewriteValue_OpCondSelect(v)78 case ssaop.OpConstInterface:79 return rewriteValue_OpConstInterface(v)80 case ssaop.OpConstSlice:81 return rewriteValue_OpConstSlice(v)82 case ssaop.OpConstString:83 return rewriteValue_OpConstString(v)84 case ssaop.OpConvert:85 return rewriteValue_OpConvert(v)86 case ssaop.OpCtz16:87 return rewriteValue_OpCtz16(v)88 case ssaop.OpCtz32:89 return rewriteValue_OpCtz32(v)90 case ssaop.OpCtz64:91 return rewriteValue_OpCtz64(v)92 case ssaop.OpCtz8:93 return rewriteValue_OpCtz8(v)94 case ssaop.OpCvt32Fto32:95 return rewriteValue_OpCvt32Fto32(v)96 case ssaop.OpCvt32Fto64:97 return rewriteValue_OpCvt32Fto64(v)98 case ssaop.OpCvt32Fto64F:99 return rewriteValue_OpCvt32Fto64F(v)100 case ssaop.OpCvt32to32F:101 return rewriteValue_OpCvt32to32F(v)102 case ssaop.OpCvt32to64F:103 return rewriteValue_OpCvt32to64F(v)104 case ssaop.OpCvt64Fto32:105 return rewriteValue_OpCvt64Fto32(v)106 case ssaop.OpCvt64Fto32F:107 return rewriteValue_OpCvt64Fto32F(v)108 case ssaop.OpCvt64Fto64:109 return rewriteValue_OpCvt64Fto64(v)110 case ssaop.OpCvt64to32F:111 return rewriteValue_OpCvt64to32F(v)112 case ssaop.OpCvt64to64F:113 return rewriteValue_OpCvt64to64F(v)114 case ssaop.OpCvtBoolToUint8:115 return rewriteValue_OpCvtBoolToUint8(v)116 case ssaop.OpDiv128u:117 return rewriteValue_OpDiv128u(v)118 case ssaop.OpDiv16:119 return rewriteValue_OpDiv16(v)120 case ssaop.OpDiv16u:121 return rewriteValue_OpDiv16u(v)122 case ssaop.OpDiv32:123 return rewriteValue_OpDiv32(v)124 case ssaop.OpDiv32F:125 return rewriteValue_OpDiv32F(v)126 case ssaop.OpDiv32u:127 return rewriteValue_OpDiv32u(v)128 case ssaop.OpDiv64:129 return rewriteValue_OpDiv64(v)130 case ssaop.OpDiv64F:131 return rewriteValue_OpDiv64F(v)132 case ssaop.OpDiv64u:133 return rewriteValue_OpDiv64u(v)134 case ssaop.OpDiv8:135 return rewriteValue_OpDiv8(v)136 case ssaop.OpDiv8u:137 return rewriteValue_OpDiv8u(v)138 case ssaop.OpEq16:139 return rewriteValue_OpEq16(v)140 case ssaop.OpEq32:141 return rewriteValue_OpEq32(v)142 case ssaop.OpEq32F:143 return rewriteValue_OpEq32F(v)144 case ssaop.OpEq64:145 return rewriteValue_OpEq64(v)146 case ssaop.OpEq64F:147 return rewriteValue_OpEq64F(v)148 case ssaop.OpEq8:149 return rewriteValue_OpEq8(v)150 case ssaop.OpEqB:151 return rewriteValue_OpEqB(v)152 case ssaop.OpEqInter:153 return rewriteValue_OpEqInter(v)154 case ssaop.OpEqPtr:155 return rewriteValue_OpEqPtr(v)156 case ssaop.OpEqSlice:157 return rewriteValue_OpEqSlice(v)158 case ssaop.OpFloor:159 return rewriteValue_OpFloor(v)160 case ssaop.OpIMake:161 return rewriteValue_OpIMake(v)162 case ssaop.OpInterLECall:163 return rewriteValue_OpInterLECall(v)164 case ssaop.OpIsInBounds:165 return rewriteValue_OpIsInBounds(v)166 case ssaop.OpIsNonNil:167 return rewriteValue_OpIsNonNil(v)168 case ssaop.OpIsSliceInBounds:169 return rewriteValue_OpIsSliceInBounds(v)170 case ssaop.OpLeq16:171 return rewriteValue_OpLeq16(v)172 case ssaop.OpLeq16U:173 return rewriteValue_OpLeq16U(v)174 case ssaop.OpLeq32:175 return rewriteValue_OpLeq32(v)176 case ssaop.OpLeq32F:177 return rewriteValue_OpLeq32F(v)178 case ssaop.OpLeq32U:179 return rewriteValue_OpLeq32U(v)180 case ssaop.OpLeq64:181 return rewriteValue_OpLeq64(v)182 case ssaop.OpLeq64F:183 return rewriteValue_OpLeq64F(v)184 case ssaop.OpLeq64U:185 return rewriteValue_OpLeq64U(v)186 case ssaop.OpLeq8:187 return rewriteValue_OpLeq8(v)188 case ssaop.OpLeq8U:189 return rewriteValue_OpLeq8U(v)190 case ssaop.OpLess16:191 return rewriteValue_OpLess16(v)192 case ssaop.OpLess16U:193 return rewriteValue_OpLess16U(v)194 case ssaop.OpLess32:195 return rewriteValue_OpLess32(v)196 case ssaop.OpLess32F:197 return rewriteValue_OpLess32F(v)198 case ssaop.OpLess32U:199 return rewriteValue_OpLess32U(v)200 case ssaop.OpLess64:201 return rewriteValue_OpLess64(v)202 case ssaop.OpLess64F:203 return rewriteValue_OpLess64F(v)204 case ssaop.OpLess64U:205 return rewriteValue_OpLess64U(v)206 case ssaop.OpLess8:207 return rewriteValue_OpLess8(v)208 case ssaop.OpLess8U:209 return rewriteValue_OpLess8U(v)210 case ssaop.OpLoad:211 return rewriteValue_OpLoad(v)212 case ssaop.OpLsh16x16:213 return rewriteValue_OpLsh16x16(v)214 case ssaop.OpLsh16x32:215 return rewriteValue_OpLsh16x32(v)216 case ssaop.OpLsh16x64:217 return rewriteValue_OpLsh16x64(v)218 case ssaop.OpLsh16x8:219 return rewriteValue_OpLsh16x8(v)220 case ssaop.OpLsh32x16:221 return rewriteValue_OpLsh32x16(v)222 case ssaop.OpLsh32x32:223 return rewriteValue_OpLsh32x32(v)224 case ssaop.OpLsh32x64:225 return rewriteValue_OpLsh32x64(v)226 case ssaop.OpLsh32x8:227 return rewriteValue_OpLsh32x8(v)228 case ssaop.OpLsh64x16:229 return rewriteValue_OpLsh64x16(v)230 case ssaop.OpLsh64x32:231 return rewriteValue_OpLsh64x32(v)232 case ssaop.OpLsh64x64:233 return rewriteValue_OpLsh64x64(v)234 case ssaop.OpLsh64x8:235 return rewriteValue_OpLsh64x8(v)236 case ssaop.OpLsh8x16:237 return rewriteValue_OpLsh8x16(v)238 case ssaop.OpLsh8x32:239 return rewriteValue_OpLsh8x32(v)240 case ssaop.OpLsh8x64:241 return rewriteValue_OpLsh8x64(v)242 case ssaop.OpLsh8x8:243 return rewriteValue_OpLsh8x8(v)244 case ssaop.OpMemEq:245 return rewriteValue_OpMemEq(v)246 case ssaop.OpMod16:247 return rewriteValue_OpMod16(v)248 case ssaop.OpMod16u:249 return rewriteValue_OpMod16u(v)250 case ssaop.OpMod32:251 return rewriteValue_OpMod32(v)252 case ssaop.OpMod32u:253 return rewriteValue_OpMod32u(v)254 case ssaop.OpMod64:255 return rewriteValue_OpMod64(v)256 case ssaop.OpMod64u:257 return rewriteValue_OpMod64u(v)258 case ssaop.OpMod8:259 return rewriteValue_OpMod8(v)260 case ssaop.OpMod8u:261 return rewriteValue_OpMod8u(v)262 case ssaop.OpMove:263 return rewriteValue_OpMove(v)264 case ssaop.OpMul16:265 return rewriteValue_OpMul16(v)266 case ssaop.OpMul32:267 return rewriteValue_OpMul32(v)268 case ssaop.OpMul32F:269 return rewriteValue_OpMul32F(v)270 case ssaop.OpMul32uhilo:271 return rewriteValue_OpMul32uhilo(v)272 case ssaop.OpMul32uover:273 return rewriteValue_OpMul32uover(v)274 case ssaop.OpMul64:275 return rewriteValue_OpMul64(v)276 case ssaop.OpMul64F:277 return rewriteValue_OpMul64F(v)278 case ssaop.OpMul64uhilo:279 return rewriteValue_OpMul64uhilo(v)280 case ssaop.OpMul64uover:281 return rewriteValue_OpMul64uover(v)282 case ssaop.OpMul8:283 return rewriteValue_OpMul8(v)284 case ssaop.OpNeg16:285 return rewriteValue_OpNeg16(v)286 case ssaop.OpNeg32:287 return rewriteValue_OpNeg32(v)288 case ssaop.OpNeg32F:289 return rewriteValue_OpNeg32F(v)290 case ssaop.OpNeg64:291 return rewriteValue_OpNeg64(v)292 case ssaop.OpNeg64F:293 return rewriteValue_OpNeg64F(v)294 case ssaop.OpNeg8:295 return rewriteValue_OpNeg8(v)296 case ssaop.OpNeq16:297 return rewriteValue_OpNeq16(v)298 case ssaop.OpNeq32:299 return rewriteValue_OpNeq32(v)300 case ssaop.OpNeq32F:301 return rewriteValue_OpNeq32F(v)302 case ssaop.OpNeq64:303 return rewriteValue_OpNeq64(v)304 case ssaop.OpNeq64F:305 return rewriteValue_OpNeq64F(v)306 case ssaop.OpNeq8:307 return rewriteValue_OpNeq8(v)308 case ssaop.OpNeqB:309 return rewriteValue_OpNeqB(v)310 case ssaop.OpNeqInter:311 return rewriteValue_OpNeqInter(v)312 case ssaop.OpNeqPtr:313 return rewriteValue_OpNeqPtr(v)314 case ssaop.OpNeqSlice:315 return rewriteValue_OpNeqSlice(v)316 case ssaop.OpNilCheck:317 return rewriteValue_OpNilCheck(v)318 case ssaop.OpNot:319 return rewriteValue_OpNot(v)320 case ssaop.OpOffPtr:321 return rewriteValue_OpOffPtr(v)322 case ssaop.OpOr16:323 return rewriteValue_OpOr16(v)324 case ssaop.OpOr32:325 return rewriteValue_OpOr32(v)326 case ssaop.OpOr64:327 return rewriteValue_OpOr64(v)328 case ssaop.OpOr8:329 return rewriteValue_OpOr8(v)330 case ssaop.OpOrB:331 return rewriteValue_OpOrB(v)332 case ssaop.OpPhi:333 return rewriteValue_OpPhi(v)334 case ssaop.OpPopCount16:335 return rewriteValue_OpPopCount16(v)336 case ssaop.OpPopCount32:337 return rewriteValue_OpPopCount32(v)338 case ssaop.OpPopCount64:339 return rewriteValue_OpPopCount64(v)340 case ssaop.OpPopCount8:341 return rewriteValue_OpPopCount8(v)342 case ssaop.OpPtrIndex:343 return rewriteValue_OpPtrIndex(v)344 case ssaop.OpRotateLeft16:345 return rewriteValue_OpRotateLeft16(v)346 case ssaop.OpRotateLeft32:347 return rewriteValue_OpRotateLeft32(v)348 case ssaop.OpRotateLeft64:349 return rewriteValue_OpRotateLeft64(v)350 case ssaop.OpRotateLeft8:351 return rewriteValue_OpRotateLeft8(v)352 case ssaop.OpRound32F:353 return rewriteValue_OpRound32F(v)354 case ssaop.OpRound64F:355 return rewriteValue_OpRound64F(v)356 case ssaop.OpRoundToEven:357 return rewriteValue_OpRoundToEven(v)358 case ssaop.OpRsh16Ux16:359 return rewriteValue_OpRsh16Ux16(v)360 case ssaop.OpRsh16Ux32:361 return rewriteValue_OpRsh16Ux32(v)362 case ssaop.OpRsh16Ux64:363 return rewriteValue_OpRsh16Ux64(v)364 case ssaop.OpRsh16Ux8:365 return rewriteValue_OpRsh16Ux8(v)366 case ssaop.OpRsh16x16:367 return rewriteValue_OpRsh16x16(v)368 case ssaop.OpRsh16x32:369 return rewriteValue_OpRsh16x32(v)370 case ssaop.OpRsh16x64:371 return rewriteValue_OpRsh16x64(v)372 case ssaop.OpRsh16x8:373 return rewriteValue_OpRsh16x8(v)374 case ssaop.OpRsh32Ux16:375 return rewriteValue_OpRsh32Ux16(v)376 case ssaop.OpRsh32Ux32:377 return rewriteValue_OpRsh32Ux32(v)378 case ssaop.OpRsh32Ux64:379 return rewriteValue_OpRsh32Ux64(v)380 case ssaop.OpRsh32Ux8:381 return rewriteValue_OpRsh32Ux8(v)382 case ssaop.OpRsh32x16:383 return rewriteValue_OpRsh32x16(v)384 case ssaop.OpRsh32x32:385 return rewriteValue_OpRsh32x32(v)386 case ssaop.OpRsh32x64:387 return rewriteValue_OpRsh32x64(v)388 case ssaop.OpRsh32x8:389 return rewriteValue_OpRsh32x8(v)390 case ssaop.OpRsh64Ux16:391 return rewriteValue_OpRsh64Ux16(v)392 case ssaop.OpRsh64Ux32:393 return rewriteValue_OpRsh64Ux32(v)394 case ssaop.OpRsh64Ux64:395 return rewriteValue_OpRsh64Ux64(v)396 case ssaop.OpRsh64Ux8:397 return rewriteValue_OpRsh64Ux8(v)398 case ssaop.OpRsh64x16:399 return rewriteValue_OpRsh64x16(v)400 case ssaop.OpRsh64x32:401 return rewriteValue_OpRsh64x32(v)402 case ssaop.OpRsh64x64:403 return rewriteValue_OpRsh64x64(v)404 case ssaop.OpRsh64x8:405 return rewriteValue_OpRsh64x8(v)406 case ssaop.OpRsh8Ux16:407 return rewriteValue_OpRsh8Ux16(v)408 case ssaop.OpRsh8Ux32:409 return rewriteValue_OpRsh8Ux32(v)410 case ssaop.OpRsh8Ux64:411 return rewriteValue_OpRsh8Ux64(v)412 case ssaop.OpRsh8Ux8:413 return rewriteValue_OpRsh8Ux8(v)414 case ssaop.OpRsh8x16:415 return rewriteValue_OpRsh8x16(v)416 case ssaop.OpRsh8x32:417 return rewriteValue_OpRsh8x32(v)418 case ssaop.OpRsh8x64:419 return rewriteValue_OpRsh8x64(v)420 case ssaop.OpRsh8x8:421 return rewriteValue_OpRsh8x8(v)422 case ssaop.OpSelect0:423 return rewriteValue_OpSelect0(v)424 case ssaop.OpSelect1:425 return rewriteValue_OpSelect1(v)426 case ssaop.OpSelectN:427 return rewriteValue_OpSelectN(v)428 case ssaop.OpSignExt16to32:429 return rewriteValue_OpSignExt16to32(v)430 case ssaop.OpSignExt16to64:431 return rewriteValue_OpSignExt16to64(v)432 case ssaop.OpSignExt32to64:433 return rewriteValue_OpSignExt32to64(v)434 case ssaop.OpSignExt8to16:435 return rewriteValue_OpSignExt8to16(v)436 case ssaop.OpSignExt8to32:437 return rewriteValue_OpSignExt8to32(v)438 case ssaop.OpSignExt8to64:439 return rewriteValue_OpSignExt8to64(v)440 case ssaop.OpSliceCap:441 return rewriteValue_OpSliceCap(v)442 case ssaop.OpSliceLen:443 return rewriteValue_OpSliceLen(v)444 case ssaop.OpSliceMake:445 return rewriteValue_OpSliceMake(v)446 case ssaop.OpSlicePtr:447 return rewriteValue_OpSlicePtr(v)448 case ssaop.OpSlicemask:449 return rewriteValue_OpSlicemask(v)450 case ssaop.OpSqrt:451 return rewriteValue_OpSqrt(v)452 case ssaop.OpStaticCall:453 return rewriteValue_OpStaticCall(v)454 case ssaop.OpStaticLECall:455 return rewriteValue_OpStaticLECall(v)456 case ssaop.OpStore:457 return rewriteValue_OpStore(v)458 case ssaop.OpStringLen:459 return rewriteValue_OpStringLen(v)460 case ssaop.OpStringPtr:461 return rewriteValue_OpStringPtr(v)462 case ssaop.OpStructSelect:463 return rewriteValue_OpStructSelect(v)464 case ssaop.OpSub16:465 return rewriteValue_OpSub16(v)466 case ssaop.OpSub32:467 return rewriteValue_OpSub32(v)468 case ssaop.OpSub32F:469 return rewriteValue_OpSub32F(v)470 case ssaop.OpSub64:471 return rewriteValue_OpSub64(v)472 case ssaop.OpSub64F:473 return rewriteValue_OpSub64F(v)474 case ssaop.OpSub64borrow:475 return rewriteValue_OpSub64borrow(v)476 case ssaop.OpSub8:477 return rewriteValue_OpSub8(v)478 case ssaop.OpTrunc:479 return rewriteValue_OpTrunc(v)480 case ssaop.OpTrunc16to8:481 return rewriteValue_OpTrunc16to8(v)482 case ssaop.OpTrunc32to16:483 return rewriteValue_OpTrunc32to16(v)484 case ssaop.OpTrunc32to8:485 return rewriteValue_OpTrunc32to8(v)486 case ssaop.OpTrunc64to16:487 return rewriteValue_OpTrunc64to16(v)488 case ssaop.OpTrunc64to32:489 return rewriteValue_OpTrunc64to32(v)490 case ssaop.OpTrunc64to8:491 return rewriteValue_OpTrunc64to8(v)492 case ssaop.OpXor16:493 return rewriteValue_OpXor16(v)494 case ssaop.OpXor32:495 return rewriteValue_OpXor32(v)496 case ssaop.OpXor64:497 return rewriteValue_OpXor64(v)498 case ssaop.OpXor8:499 return rewriteValue_OpXor8(v)500 case ssaop.OpZero:501 return rewriteValue_OpZero(v)502 case ssaop.OpZeroExt16to32:503 return rewriteValue_OpZeroExt16to32(v)504 case ssaop.OpZeroExt16to64:505 return rewriteValue_OpZeroExt16to64(v)506 case ssaop.OpZeroExt32to64:507 return rewriteValue_OpZeroExt32to64(v)508 case ssaop.OpZeroExt8to16:509 return rewriteValue_OpZeroExt8to16(v)510 case ssaop.OpZeroExt8to32:511 return rewriteValue_OpZeroExt8to32(v)512 case ssaop.OpZeroExt8to64:513 return rewriteValue_OpZeroExt8to64(v)514 }515 return false516}517func rewriteValue_OpAdd16(v *ssa.Value) bool {518 v_1 := v.Args[1]519 v_0 := v.Args[0]520 b := v.Block521 config := b.Func.Config522 // match: (Add16 (Const16 [c]) (Const16 [d]))523 // result: (Const16 [c+d])524 for {525 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {526 if v_0.Op != ssaop.OpConst16 {527 continue528 }529 c := ssa.AuxIntToInt16(v_0.AuxInt)530 if v_1.Op != ssaop.OpConst16 {531 continue532 }533 d := ssa.AuxIntToInt16(v_1.AuxInt)534 v.Reset(ssaop.OpConst16)535 v.AuxInt = ssa.Int16ToAuxInt(c + d)536 return true537 }538 break539 }540 // match: (Add16 <t> (Mul16 x y) (Mul16 x z))541 // result: (Mul16 x (Add16 <t> y z))542 for {543 t := v.Type544 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {545 if v_0.Op != ssaop.OpMul16 {546 continue547 }548 _ = v_0.Args[1]549 v_0_0 := v_0.Args[0]550 v_0_1 := v_0.Args[1]551 for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {552 x := v_0_0553 y := v_0_1554 if v_1.Op != ssaop.OpMul16 {555 continue556 }557 _ = v_1.Args[1]558 v_1_0 := v_1.Args[0]559 v_1_1 := v_1.Args[1]560 for _i2 := 0; _i2 <= 1; _i2, v_1_0, v_1_1 = _i2+1, v_1_1, v_1_0 {561 if x != v_1_0 {562 continue563 }564 z := v_1_1565 v.Reset(ssaop.OpMul16)566 v0 := b.NewValue0(v.Pos, ssaop.OpAdd16, t)567 v0.AddArg2(y, z)568 v.AddArg2(x, v0)569 return true570 }571 }572 }573 break574 }575 // match: (Add16 x x)576 // result: (Lsh16x64 x (Const64 <types.Types[types.TUINT64]> [1]))577 for {578 x := v_0579 if x != v_1 {580 break581 }582 v.Reset(ssaop.OpLsh16x64)583 v0 := b.NewValue0(v.Pos, ssaop.OpConst64, types.Types[types.TUINT64])584 v0.AuxInt = ssa.Int64ToAuxInt(1)585 v.AddArg2(x, v0)586 return true587 }588 // match: (Add16 (Const16 [0]) x)589 // result: x590 for {591 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {592 if v_0.Op != ssaop.OpConst16 || ssa.AuxIntToInt16(v_0.AuxInt) != 0 {593 continue594 }595 x := v_1596 v.CopyOf(x)597 return true598 }599 break600 }601 // match: (Add16 x (Neg16 y))602 // result: (Sub16 x y)603 for {604 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {605 x := v_0606 if v_1.Op != ssaop.OpNeg16 {607 continue608 }609 y := v_1.Args[0]610 v.Reset(ssaop.OpSub16)611 v.AddArg2(x, y)612 return true613 }614 break615 }616 // match: (Add16 (Com16 x) x)617 // result: (Const16 [-1])618 for {619 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {620 if v_0.Op != ssaop.OpCom16 {621 continue622 }623 x := v_0.Args[0]624 if x != v_1 {625 continue626 }627 v.Reset(ssaop.OpConst16)628 v.AuxInt = ssa.Int16ToAuxInt(-1)629 return true630 }631 break632 }633 // match: (Add16 (Sub16 x t) (Add16 t y))634 // result: (Add16 x y)635 for {636 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {637 if v_0.Op != ssaop.OpSub16 {638 continue639 }640 t := v_0.Args[1]641 x := v_0.Args[0]642 if v_1.Op != ssaop.OpAdd16 {643 continue644 }645 _ = v_1.Args[1]646 v_1_0 := v_1.Args[0]647 v_1_1 := v_1.Args[1]648 for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {649 if t != v_1_0 {650 continue651 }652 y := v_1_1653 v.Reset(ssaop.OpAdd16)654 v.AddArg2(x, y)655 return true656 }657 }658 break659 }660 // match: (Add16 (Const16 [1]) (Com16 x))661 // result: (Neg16 x)662 for {663 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {664 if v_0.Op != ssaop.OpConst16 || ssa.AuxIntToInt16(v_0.AuxInt) != 1 || v_1.Op != ssaop.OpCom16 {665 continue666 }667 x := v_1.Args[0]668 v.Reset(ssaop.OpNeg16)669 v.AddArg(x)670 return true671 }672 break673 }674 // match: (Add16 x (Sub16 y x))675 // result: y676 for {677 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {678 x := v_0679 if v_1.Op != ssaop.OpSub16 {680 continue681 }682 _ = v_1.Args[1]683 y := v_1.Args[0]684 if x != v_1.Args[1] {685 continue686 }687 v.CopyOf(y)688 return true689 }690 break691 }692 // match: (Add16 x (Add16 y (Sub16 z x)))693 // result: (Add16 y z)694 for {695 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {696 x := v_0697 if v_1.Op != ssaop.OpAdd16 {698 continue699 }700 _ = v_1.Args[1]701 v_1_0 := v_1.Args[0]702 v_1_1 := v_1.Args[1]703 for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {704 y := v_1_0705 if v_1_1.Op != ssaop.OpSub16 {706 continue707 }708 _ = v_1_1.Args[1]709 z := v_1_1.Args[0]710 if x != v_1_1.Args[1] {711 continue712 }713 v.Reset(ssaop.OpAdd16)714 v.AddArg2(y, z)715 return true716 }717 }718 break719 }720 // match: (Add16 x (Sub16 y (Sub16 x z)))721 // result: (Add16 y z)722 for {723 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {724 x := v_0725 if v_1.Op != ssaop.OpSub16 {726 continue727 }728 _ = v_1.Args[1]729 y := v_1.Args[0]730 v_1_1 := v_1.Args[1]731 if v_1_1.Op != ssaop.OpSub16 {732 continue733 }734 z := v_1_1.Args[1]735 if x != v_1_1.Args[0] {736 continue737 }738 v.Reset(ssaop.OpAdd16)739 v.AddArg2(y, z)740 return true741 }742 break743 }744 // match: (Add16 (Add16 i:(Const16 <t>) z) x)745 // cond: (z.Op != ssaop.OpConst16 && x.Op != ssaop.OpConst16)746 // result: (Add16 i (Add16 <t> z x))747 for {748 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {749 if v_0.Op != ssaop.OpAdd16 {750 continue751 }752 _ = v_0.Args[1]753 v_0_0 := v_0.Args[0]754 v_0_1 := v_0.Args[1]755 for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {756 i := v_0_0757 if i.Op != ssaop.OpConst16 {758 continue759 }760 t := i.Type761 z := v_0_1762 x := v_1763 if !(z.Op != ssaop.OpConst16 && x.Op != ssaop.OpConst16) {764 continue765 }766 v.Reset(ssaop.OpAdd16)767 v0 := b.NewValue0(v.Pos, ssaop.OpAdd16, t)768 v0.AddArg2(z, x)769 v.AddArg2(i, v0)770 return true771 }772 }773 break774 }775 // match: (Add16 (Sub16 i:(Const16 <t>) z) x)776 // cond: (z.Op != ssaop.OpConst16 && x.Op != ssaop.OpConst16)777 // result: (Add16 i (Sub16 <t> x z))778 for {779 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {780 if v_0.Op != ssaop.OpSub16 {781 continue782 }783 z := v_0.Args[1]784 i := v_0.Args[0]785 if i.Op != ssaop.OpConst16 {786 continue787 }788 t := i.Type789 x := v_1790 if !(z.Op != ssaop.OpConst16 && x.Op != ssaop.OpConst16) {791 continue792 }793 v.Reset(ssaop.OpAdd16)794 v0 := b.NewValue0(v.Pos, ssaop.OpSub16, t)795 v0.AddArg2(x, z)796 v.AddArg2(i, v0)797 return true798 }799 break800 }801 // match: (Add16 (Const16 <t> [c]) (Add16 (Const16 <t> [d]) x))802 // result: (Add16 (Const16 <t> [c+d]) x)803 for {804 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {805 if v_0.Op != ssaop.OpConst16 {806 continue807 }808 t := v_0.Type809 c := ssa.AuxIntToInt16(v_0.AuxInt)810 if v_1.Op != ssaop.OpAdd16 {811 continue812 }813 _ = v_1.Args[1]814 v_1_0 := v_1.Args[0]815 v_1_1 := v_1.Args[1]816 for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {817 if v_1_0.Op != ssaop.OpConst16 || v_1_0.Type != t {818 continue819 }820 d := ssa.AuxIntToInt16(v_1_0.AuxInt)821 x := v_1_1822 v.Reset(ssaop.OpAdd16)823 v0 := b.NewValue0(v.Pos, ssaop.OpConst16, t)824 v0.AuxInt = ssa.Int16ToAuxInt(c + d)825 v.AddArg2(v0, x)826 return true827 }828 }829 break830 }831 // match: (Add16 (Const16 <t> [c]) (Sub16 (Const16 <t> [d]) x))832 // result: (Sub16 (Const16 <t> [c+d]) x)833 for {834 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {835 if v_0.Op != ssaop.OpConst16 {836 continue837 }838 t := v_0.Type839 c := ssa.AuxIntToInt16(v_0.AuxInt)840 if v_1.Op != ssaop.OpSub16 {841 continue842 }843 x := v_1.Args[1]844 v_1_0 := v_1.Args[0]845 if v_1_0.Op != ssaop.OpConst16 || v_1_0.Type != t {846 continue847 }848 d := ssa.AuxIntToInt16(v_1_0.AuxInt)849 v.Reset(ssaop.OpSub16)850 v0 := b.NewValue0(v.Pos, ssaop.OpConst16, t)851 v0.AuxInt = ssa.Int16ToAuxInt(c + d)852 v.AddArg2(v0, x)853 return true854 }855 break856 }857 // match: (Add16 (Lsh16x64 x z:(Const64 <t> [c])) (Rsh16Ux64 x (Const64 [d])))858 // cond: c < 16 && d == 16-c && canRotate(config, 16)859 // result: (RotateLeft16 x z)860 for {861 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {862 if v_0.Op != ssaop.OpLsh16x64 {863 continue864 }865 _ = v_0.Args[1]866 x := v_0.Args[0]867 z := v_0.Args[1]868 if z.Op != ssaop.OpConst64 {869 continue870 }871 c := ssa.AuxIntToInt64(z.AuxInt)872 if v_1.Op != ssaop.OpRsh16Ux64 {873 continue874 }875 _ = v_1.Args[1]876 if x != v_1.Args[0] {877 continue878 }879 v_1_1 := v_1.Args[1]880 if v_1_1.Op != ssaop.OpConst64 {881 continue882 }883 d := ssa.AuxIntToInt64(v_1_1.AuxInt)884 if !(c < 16 && d == 16-c && canRotate(config, 16)) {885 continue886 }887 v.Reset(ssaop.OpRotateLeft16)888 v.AddArg2(x, z)889 return true890 }891 break892 }893 // match: (Add16 left:(Lsh16x64 x y) right:(Rsh16Ux64 x (Sub64 (Const64 [16]) y)))894 // cond: (ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 16)895 // result: (RotateLeft16 x y)896 for {897 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {898 left := v_0899 if left.Op != ssaop.OpLsh16x64 {900 continue901 }902 y := left.Args[1]903 x := left.Args[0]904 right := v_1905 if right.Op != ssaop.OpRsh16Ux64 {906 continue907 }908 _ = right.Args[1]909 if x != right.Args[0] {910 continue911 }912 right_1 := right.Args[1]913 if right_1.Op != ssaop.OpSub64 {914 continue915 }916 _ = right_1.Args[1]917 right_1_0 := right_1.Args[0]918 if right_1_0.Op != ssaop.OpConst64 || ssa.AuxIntToInt64(right_1_0.AuxInt) != 16 || y != right_1.Args[1] || !((ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 16)) {919 continue920 }921 v.Reset(ssaop.OpRotateLeft16)922 v.AddArg2(x, y)923 return true924 }925 break926 }927 // match: (Add16 left:(Lsh16x32 x y) right:(Rsh16Ux32 x (Sub32 (Const32 [16]) y)))928 // cond: (ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 16)929 // result: (RotateLeft16 x y)930 for {931 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {932 left := v_0933 if left.Op != ssaop.OpLsh16x32 {934 continue935 }936 y := left.Args[1]937 x := left.Args[0]938 right := v_1939 if right.Op != ssaop.OpRsh16Ux32 {940 continue941 }942 _ = right.Args[1]943 if x != right.Args[0] {944 continue945 }946 right_1 := right.Args[1]947 if right_1.Op != ssaop.OpSub32 {948 continue949 }950 _ = right_1.Args[1]951 right_1_0 := right_1.Args[0]952 if right_1_0.Op != ssaop.OpConst32 || ssa.AuxIntToInt32(right_1_0.AuxInt) != 16 || y != right_1.Args[1] || !((ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 16)) {953 continue954 }955 v.Reset(ssaop.OpRotateLeft16)956 v.AddArg2(x, y)957 return true958 }959 break960 }961 // match: (Add16 left:(Lsh16x16 x y) right:(Rsh16Ux16 x (Sub16 (Const16 [16]) y)))962 // cond: (ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 16)963 // result: (RotateLeft16 x y)964 for {965 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {966 left := v_0967 if left.Op != ssaop.OpLsh16x16 {968 continue969 }970 y := left.Args[1]971 x := left.Args[0]972 right := v_1973 if right.Op != ssaop.OpRsh16Ux16 {974 continue975 }976 _ = right.Args[1]977 if x != right.Args[0] {978 continue979 }980 right_1 := right.Args[1]981 if right_1.Op != ssaop.OpSub16 {982 continue983 }984 _ = right_1.Args[1]985 right_1_0 := right_1.Args[0]986 if right_1_0.Op != ssaop.OpConst16 || ssa.AuxIntToInt16(right_1_0.AuxInt) != 16 || y != right_1.Args[1] || !((ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 16)) {987 continue988 }989 v.Reset(ssaop.OpRotateLeft16)990 v.AddArg2(x, y)991 return true992 }993 break994 }995 // match: (Add16 left:(Lsh16x8 x y) right:(Rsh16Ux8 x (Sub8 (Const8 [16]) y)))996 // cond: (ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 16)997 // result: (RotateLeft16 x y)998 for {999 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1000 left := v_01001 if left.Op != ssaop.OpLsh16x8 {1002 continue1003 }1004 y := left.Args[1]1005 x := left.Args[0]1006 right := v_11007 if right.Op != ssaop.OpRsh16Ux8 {1008 continue1009 }1010 _ = right.Args[1]1011 if x != right.Args[0] {1012 continue1013 }1014 right_1 := right.Args[1]1015 if right_1.Op != ssaop.OpSub8 {1016 continue1017 }1018 _ = right_1.Args[1]1019 right_1_0 := right_1.Args[0]1020 if right_1_0.Op != ssaop.OpConst8 || ssa.AuxIntToInt8(right_1_0.AuxInt) != 16 || y != right_1.Args[1] || !((ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 16)) {1021 continue1022 }1023 v.Reset(ssaop.OpRotateLeft16)1024 v.AddArg2(x, y)1025 return true1026 }1027 break1028 }1029 // match: (Add16 right:(Rsh16Ux64 x y) left:(Lsh16x64 x z:(Sub64 (Const64 [16]) y)))1030 // cond: (ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 16)1031 // result: (RotateLeft16 x z)1032 for {1033 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1034 right := v_01035 if right.Op != ssaop.OpRsh16Ux64 {1036 continue1037 }1038 y := right.Args[1]1039 x := right.Args[0]1040 left := v_11041 if left.Op != ssaop.OpLsh16x64 {1042 continue1043 }1044 _ = left.Args[1]1045 if x != left.Args[0] {1046 continue1047 }1048 z := left.Args[1]1049 if z.Op != ssaop.OpSub64 {1050 continue1051 }1052 _ = z.Args[1]1053 z_0 := z.Args[0]1054 if z_0.Op != ssaop.OpConst64 || ssa.AuxIntToInt64(z_0.AuxInt) != 16 || y != z.Args[1] || !((ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 16)) {1055 continue1056 }1057 v.Reset(ssaop.OpRotateLeft16)1058 v.AddArg2(x, z)1059 return true1060 }1061 break1062 }1063 // match: (Add16 right:(Rsh16Ux32 x y) left:(Lsh16x32 x z:(Sub32 (Const32 [16]) y)))1064 // cond: (ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 16)1065 // result: (RotateLeft16 x z)1066 for {1067 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1068 right := v_01069 if right.Op != ssaop.OpRsh16Ux32 {1070 continue1071 }1072 y := right.Args[1]1073 x := right.Args[0]1074 left := v_11075 if left.Op != ssaop.OpLsh16x32 {1076 continue1077 }1078 _ = left.Args[1]1079 if x != left.Args[0] {1080 continue1081 }1082 z := left.Args[1]1083 if z.Op != ssaop.OpSub32 {1084 continue1085 }1086 _ = z.Args[1]1087 z_0 := z.Args[0]1088 if z_0.Op != ssaop.OpConst32 || ssa.AuxIntToInt32(z_0.AuxInt) != 16 || y != z.Args[1] || !((ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 16)) {1089 continue1090 }1091 v.Reset(ssaop.OpRotateLeft16)1092 v.AddArg2(x, z)1093 return true1094 }1095 break1096 }1097 // match: (Add16 right:(Rsh16Ux16 x y) left:(Lsh16x16 x z:(Sub16 (Const16 [16]) y)))1098 // cond: (ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 16)1099 // result: (RotateLeft16 x z)1100 for {1101 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1102 right := v_01103 if right.Op != ssaop.OpRsh16Ux16 {1104 continue1105 }1106 y := right.Args[1]1107 x := right.Args[0]1108 left := v_11109 if left.Op != ssaop.OpLsh16x16 {1110 continue1111 }1112 _ = left.Args[1]1113 if x != left.Args[0] {1114 continue1115 }1116 z := left.Args[1]1117 if z.Op != ssaop.OpSub16 {1118 continue1119 }1120 _ = z.Args[1]1121 z_0 := z.Args[0]1122 if z_0.Op != ssaop.OpConst16 || ssa.AuxIntToInt16(z_0.AuxInt) != 16 || y != z.Args[1] || !((ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 16)) {1123 continue1124 }1125 v.Reset(ssaop.OpRotateLeft16)1126 v.AddArg2(x, z)1127 return true1128 }1129 break1130 }1131 // match: (Add16 right:(Rsh16Ux8 x y) left:(Lsh16x8 x z:(Sub8 (Const8 [16]) y)))1132 // cond: (ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 16)1133 // result: (RotateLeft16 x z)1134 for {1135 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1136 right := v_01137 if right.Op != ssaop.OpRsh16Ux8 {1138 continue1139 }1140 y := right.Args[1]1141 x := right.Args[0]1142 left := v_11143 if left.Op != ssaop.OpLsh16x8 {1144 continue1145 }1146 _ = left.Args[1]1147 if x != left.Args[0] {1148 continue1149 }1150 z := left.Args[1]1151 if z.Op != ssaop.OpSub8 {1152 continue1153 }1154 _ = z.Args[1]1155 z_0 := z.Args[0]1156 if z_0.Op != ssaop.OpConst8 || ssa.AuxIntToInt8(z_0.AuxInt) != 16 || y != z.Args[1] || !((ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 16)) {1157 continue1158 }1159 v.Reset(ssaop.OpRotateLeft16)1160 v.AddArg2(x, z)1161 return true1162 }1163 break1164 }1165 return false1166}1167func rewriteValue_OpAdd32(v *ssa.Value) bool {1168 v_1 := v.Args[1]1169 v_0 := v.Args[0]1170 b := v.Block1171 config := b.Func.Config1172 // match: (Add32 (Const32 [c]) (Const32 [d]))1173 // result: (Const32 [c+d])1174 for {1175 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1176 if v_0.Op != ssaop.OpConst32 {1177 continue1178 }1179 c := ssa.AuxIntToInt32(v_0.AuxInt)1180 if v_1.Op != ssaop.OpConst32 {1181 continue1182 }1183 d := ssa.AuxIntToInt32(v_1.AuxInt)1184 v.Reset(ssaop.OpConst32)1185 v.AuxInt = ssa.Int32ToAuxInt(c + d)1186 return true1187 }1188 break1189 }1190 // match: (Add32 <t> (Mul32 x y) (Mul32 x z))1191 // result: (Mul32 x (Add32 <t> y z))1192 for {1193 t := v.Type1194 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1195 if v_0.Op != ssaop.OpMul32 {1196 continue1197 }1198 _ = v_0.Args[1]1199 v_0_0 := v_0.Args[0]1200 v_0_1 := v_0.Args[1]1201 for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {1202 x := v_0_01203 y := v_0_11204 if v_1.Op != ssaop.OpMul32 {1205 continue1206 }1207 _ = v_1.Args[1]1208 v_1_0 := v_1.Args[0]1209 v_1_1 := v_1.Args[1]1210 for _i2 := 0; _i2 <= 1; _i2, v_1_0, v_1_1 = _i2+1, v_1_1, v_1_0 {1211 if x != v_1_0 {1212 continue1213 }1214 z := v_1_11215 v.Reset(ssaop.OpMul32)1216 v0 := b.NewValue0(v.Pos, ssaop.OpAdd32, t)1217 v0.AddArg2(y, z)1218 v.AddArg2(x, v0)1219 return true1220 }1221 }1222 }1223 break1224 }1225 // match: (Add32 x x)1226 // result: (Lsh32x64 x (Const64 <types.Types[types.TUINT64]> [1]))1227 for {1228 x := v_01229 if x != v_1 {1230 break1231 }1232 v.Reset(ssaop.OpLsh32x64)1233 v0 := b.NewValue0(v.Pos, ssaop.OpConst64, types.Types[types.TUINT64])1234 v0.AuxInt = ssa.Int64ToAuxInt(1)1235 v.AddArg2(x, v0)1236 return true1237 }1238 // match: (Add32 (Const32 [0]) x)1239 // result: x1240 for {1241 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1242 if v_0.Op != ssaop.OpConst32 || ssa.AuxIntToInt32(v_0.AuxInt) != 0 {1243 continue1244 }1245 x := v_11246 v.CopyOf(x)1247 return true1248 }1249 break1250 }1251 // match: (Add32 x (Neg32 y))1252 // result: (Sub32 x y)1253 for {1254 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1255 x := v_01256 if v_1.Op != ssaop.OpNeg32 {1257 continue1258 }1259 y := v_1.Args[0]1260 v.Reset(ssaop.OpSub32)1261 v.AddArg2(x, y)1262 return true1263 }1264 break1265 }1266 // match: (Add32 (Com32 x) x)1267 // result: (Const32 [-1])1268 for {1269 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1270 if v_0.Op != ssaop.OpCom32 {1271 continue1272 }1273 x := v_0.Args[0]1274 if x != v_1 {1275 continue1276 }1277 v.Reset(ssaop.OpConst32)1278 v.AuxInt = ssa.Int32ToAuxInt(-1)1279 return true1280 }1281 break1282 }1283 // match: (Add32 (Sub32 x t) (Add32 t y))1284 // result: (Add32 x y)1285 for {1286 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1287 if v_0.Op != ssaop.OpSub32 {1288 continue1289 }1290 t := v_0.Args[1]1291 x := v_0.Args[0]1292 if v_1.Op != ssaop.OpAdd32 {1293 continue1294 }1295 _ = v_1.Args[1]1296 v_1_0 := v_1.Args[0]1297 v_1_1 := v_1.Args[1]1298 for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {1299 if t != v_1_0 {1300 continue1301 }1302 y := v_1_11303 v.Reset(ssaop.OpAdd32)1304 v.AddArg2(x, y)1305 return true1306 }1307 }1308 break1309 }1310 // match: (Add32 (Const32 [1]) (Com32 x))1311 // result: (Neg32 x)1312 for {1313 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1314 if v_0.Op != ssaop.OpConst32 || ssa.AuxIntToInt32(v_0.AuxInt) != 1 || v_1.Op != ssaop.OpCom32 {1315 continue1316 }1317 x := v_1.Args[0]1318 v.Reset(ssaop.OpNeg32)1319 v.AddArg(x)1320 return true1321 }1322 break1323 }1324 // match: (Add32 x (Sub32 y x))1325 // result: y1326 for {1327 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1328 x := v_01329 if v_1.Op != ssaop.OpSub32 {1330 continue1331 }1332 _ = v_1.Args[1]1333 y := v_1.Args[0]1334 if x != v_1.Args[1] {1335 continue1336 }1337 v.CopyOf(y)1338 return true1339 }1340 break1341 }1342 // match: (Add32 x (Add32 y (Sub32 z x)))1343 // result: (Add32 y z)1344 for {1345 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1346 x := v_01347 if v_1.Op != ssaop.OpAdd32 {1348 continue1349 }1350 _ = v_1.Args[1]1351 v_1_0 := v_1.Args[0]1352 v_1_1 := v_1.Args[1]1353 for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {1354 y := v_1_01355 if v_1_1.Op != ssaop.OpSub32 {1356 continue1357 }1358 _ = v_1_1.Args[1]1359 z := v_1_1.Args[0]1360 if x != v_1_1.Args[1] {1361 continue1362 }1363 v.Reset(ssaop.OpAdd32)1364 v.AddArg2(y, z)1365 return true1366 }1367 }1368 break1369 }1370 // match: (Add32 x (Sub32 y (Sub32 x z)))1371 // result: (Add32 y z)1372 for {1373 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1374 x := v_01375 if v_1.Op != ssaop.OpSub32 {1376 continue1377 }1378 _ = v_1.Args[1]1379 y := v_1.Args[0]1380 v_1_1 := v_1.Args[1]1381 if v_1_1.Op != ssaop.OpSub32 {1382 continue1383 }1384 z := v_1_1.Args[1]1385 if x != v_1_1.Args[0] {1386 continue1387 }1388 v.Reset(ssaop.OpAdd32)1389 v.AddArg2(y, z)1390 return true1391 }1392 break1393 }1394 // match: (Add32 (Add32 i:(Const32 <t>) z) x)1395 // cond: (z.Op != ssaop.OpConst32 && x.Op != ssaop.OpConst32)1396 // result: (Add32 i (Add32 <t> z x))1397 for {1398 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1399 if v_0.Op != ssaop.OpAdd32 {1400 continue1401 }1402 _ = v_0.Args[1]1403 v_0_0 := v_0.Args[0]1404 v_0_1 := v_0.Args[1]1405 for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {1406 i := v_0_01407 if i.Op != ssaop.OpConst32 {1408 continue1409 }1410 t := i.Type1411 z := v_0_11412 x := v_11413 if !(z.Op != ssaop.OpConst32 && x.Op != ssaop.OpConst32) {1414 continue1415 }1416 v.Reset(ssaop.OpAdd32)1417 v0 := b.NewValue0(v.Pos, ssaop.OpAdd32, t)1418 v0.AddArg2(z, x)1419 v.AddArg2(i, v0)1420 return true1421 }1422 }1423 break1424 }1425 // match: (Add32 (Sub32 i:(Const32 <t>) z) x)1426 // cond: (z.Op != ssaop.OpConst32 && x.Op != ssaop.OpConst32)1427 // result: (Add32 i (Sub32 <t> x z))1428 for {1429 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1430 if v_0.Op != ssaop.OpSub32 {1431 continue1432 }1433 z := v_0.Args[1]1434 i := v_0.Args[0]1435 if i.Op != ssaop.OpConst32 {1436 continue1437 }1438 t := i.Type1439 x := v_11440 if !(z.Op != ssaop.OpConst32 && x.Op != ssaop.OpConst32) {1441 continue1442 }1443 v.Reset(ssaop.OpAdd32)1444 v0 := b.NewValue0(v.Pos, ssaop.OpSub32, t)1445 v0.AddArg2(x, z)1446 v.AddArg2(i, v0)1447 return true1448 }1449 break1450 }1451 // match: (Add32 (Const32 <t> [c]) (Add32 (Const32 <t> [d]) x))1452 // result: (Add32 (Const32 <t> [c+d]) x)1453 for {1454 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1455 if v_0.Op != ssaop.OpConst32 {1456 continue1457 }1458 t := v_0.Type1459 c := ssa.AuxIntToInt32(v_0.AuxInt)1460 if v_1.Op != ssaop.OpAdd32 {1461 continue1462 }1463 _ = v_1.Args[1]1464 v_1_0 := v_1.Args[0]1465 v_1_1 := v_1.Args[1]1466 for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {1467 if v_1_0.Op != ssaop.OpConst32 || v_1_0.Type != t {1468 continue1469 }1470 d := ssa.AuxIntToInt32(v_1_0.AuxInt)1471 x := v_1_11472 v.Reset(ssaop.OpAdd32)1473 v0 := b.NewValue0(v.Pos, ssaop.OpConst32, t)1474 v0.AuxInt = ssa.Int32ToAuxInt(c + d)1475 v.AddArg2(v0, x)1476 return true1477 }1478 }1479 break1480 }1481 // match: (Add32 (Const32 <t> [c]) (Sub32 (Const32 <t> [d]) x))1482 // result: (Sub32 (Const32 <t> [c+d]) x)1483 for {1484 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1485 if v_0.Op != ssaop.OpConst32 {1486 continue1487 }1488 t := v_0.Type1489 c := ssa.AuxIntToInt32(v_0.AuxInt)1490 if v_1.Op != ssaop.OpSub32 {1491 continue1492 }1493 x := v_1.Args[1]1494 v_1_0 := v_1.Args[0]1495 if v_1_0.Op != ssaop.OpConst32 || v_1_0.Type != t {1496 continue1497 }1498 d := ssa.AuxIntToInt32(v_1_0.AuxInt)1499 v.Reset(ssaop.OpSub32)1500 v0 := b.NewValue0(v.Pos, ssaop.OpConst32, t)1501 v0.AuxInt = ssa.Int32ToAuxInt(c + d)1502 v.AddArg2(v0, x)1503 return true1504 }1505 break1506 }1507 // match: (Add32 (Lsh32x64 x z:(Const64 <t> [c])) (Rsh32Ux64 x (Const64 [d])))1508 // cond: c < 32 && d == 32-c && canRotate(config, 32)1509 // result: (RotateLeft32 x z)1510 for {1511 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1512 if v_0.Op != ssaop.OpLsh32x64 {1513 continue1514 }1515 _ = v_0.Args[1]1516 x := v_0.Args[0]1517 z := v_0.Args[1]1518 if z.Op != ssaop.OpConst64 {1519 continue1520 }1521 c := ssa.AuxIntToInt64(z.AuxInt)1522 if v_1.Op != ssaop.OpRsh32Ux64 {1523 continue1524 }1525 _ = v_1.Args[1]1526 if x != v_1.Args[0] {1527 continue1528 }1529 v_1_1 := v_1.Args[1]1530 if v_1_1.Op != ssaop.OpConst64 {1531 continue1532 }1533 d := ssa.AuxIntToInt64(v_1_1.AuxInt)1534 if !(c < 32 && d == 32-c && canRotate(config, 32)) {1535 continue1536 }1537 v.Reset(ssaop.OpRotateLeft32)1538 v.AddArg2(x, z)1539 return true1540 }1541 break1542 }1543 // match: (Add32 left:(Lsh32x64 x y) right:(Rsh32Ux64 x (Sub64 (Const64 [32]) y)))1544 // cond: (ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 32)1545 // result: (RotateLeft32 x y)1546 for {1547 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1548 left := v_01549 if left.Op != ssaop.OpLsh32x64 {1550 continue1551 }1552 y := left.Args[1]1553 x := left.Args[0]1554 right := v_11555 if right.Op != ssaop.OpRsh32Ux64 {1556 continue1557 }1558 _ = right.Args[1]1559 if x != right.Args[0] {1560 continue1561 }1562 right_1 := right.Args[1]1563 if right_1.Op != ssaop.OpSub64 {1564 continue1565 }1566 _ = right_1.Args[1]1567 right_1_0 := right_1.Args[0]1568 if right_1_0.Op != ssaop.OpConst64 || ssa.AuxIntToInt64(right_1_0.AuxInt) != 32 || y != right_1.Args[1] || !((ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 32)) {1569 continue1570 }1571 v.Reset(ssaop.OpRotateLeft32)1572 v.AddArg2(x, y)1573 return true1574 }1575 break1576 }1577 // match: (Add32 left:(Lsh32x32 x y) right:(Rsh32Ux32 x (Sub32 (Const32 [32]) y)))1578 // cond: (ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 32)1579 // result: (RotateLeft32 x y)1580 for {1581 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1582 left := v_01583 if left.Op != ssaop.OpLsh32x32 {1584 continue1585 }1586 y := left.Args[1]1587 x := left.Args[0]1588 right := v_11589 if right.Op != ssaop.OpRsh32Ux32 {1590 continue1591 }1592 _ = right.Args[1]1593 if x != right.Args[0] {1594 continue1595 }1596 right_1 := right.Args[1]1597 if right_1.Op != ssaop.OpSub32 {1598 continue1599 }1600 _ = right_1.Args[1]1601 right_1_0 := right_1.Args[0]1602 if right_1_0.Op != ssaop.OpConst32 || ssa.AuxIntToInt32(right_1_0.AuxInt) != 32 || y != right_1.Args[1] || !((ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 32)) {1603 continue1604 }1605 v.Reset(ssaop.OpRotateLeft32)1606 v.AddArg2(x, y)1607 return true1608 }1609 break1610 }1611 // match: (Add32 left:(Lsh32x16 x y) right:(Rsh32Ux16 x (Sub16 (Const16 [32]) y)))1612 // cond: (ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 32)1613 // result: (RotateLeft32 x y)1614 for {1615 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1616 left := v_01617 if left.Op != ssaop.OpLsh32x16 {1618 continue1619 }1620 y := left.Args[1]1621 x := left.Args[0]1622 right := v_11623 if right.Op != ssaop.OpRsh32Ux16 {1624 continue1625 }1626 _ = right.Args[1]1627 if x != right.Args[0] {1628 continue1629 }1630 right_1 := right.Args[1]1631 if right_1.Op != ssaop.OpSub16 {1632 continue1633 }1634 _ = right_1.Args[1]1635 right_1_0 := right_1.Args[0]1636 if right_1_0.Op != ssaop.OpConst16 || ssa.AuxIntToInt16(right_1_0.AuxInt) != 32 || y != right_1.Args[1] || !((ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 32)) {1637 continue1638 }1639 v.Reset(ssaop.OpRotateLeft32)1640 v.AddArg2(x, y)1641 return true1642 }1643 break1644 }1645 // match: (Add32 left:(Lsh32x8 x y) right:(Rsh32Ux8 x (Sub8 (Const8 [32]) y)))1646 // cond: (ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 32)1647 // result: (RotateLeft32 x y)1648 for {1649 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1650 left := v_01651 if left.Op != ssaop.OpLsh32x8 {1652 continue1653 }1654 y := left.Args[1]1655 x := left.Args[0]1656 right := v_11657 if right.Op != ssaop.OpRsh32Ux8 {1658 continue1659 }1660 _ = right.Args[1]1661 if x != right.Args[0] {1662 continue1663 }1664 right_1 := right.Args[1]1665 if right_1.Op != ssaop.OpSub8 {1666 continue1667 }1668 _ = right_1.Args[1]1669 right_1_0 := right_1.Args[0]1670 if right_1_0.Op != ssaop.OpConst8 || ssa.AuxIntToInt8(right_1_0.AuxInt) != 32 || y != right_1.Args[1] || !((ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 32)) {1671 continue1672 }1673 v.Reset(ssaop.OpRotateLeft32)1674 v.AddArg2(x, y)1675 return true1676 }1677 break1678 }1679 // match: (Add32 right:(Rsh32Ux64 x y) left:(Lsh32x64 x z:(Sub64 (Const64 [32]) y)))1680 // cond: (ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 32)1681 // result: (RotateLeft32 x z)1682 for {1683 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1684 right := v_01685 if right.Op != ssaop.OpRsh32Ux64 {1686 continue1687 }1688 y := right.Args[1]1689 x := right.Args[0]1690 left := v_11691 if left.Op != ssaop.OpLsh32x64 {1692 continue1693 }1694 _ = left.Args[1]1695 if x != left.Args[0] {1696 continue1697 }1698 z := left.Args[1]1699 if z.Op != ssaop.OpSub64 {1700 continue1701 }1702 _ = z.Args[1]1703 z_0 := z.Args[0]1704 if z_0.Op != ssaop.OpConst64 || ssa.AuxIntToInt64(z_0.AuxInt) != 32 || y != z.Args[1] || !((ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 32)) {1705 continue1706 }1707 v.Reset(ssaop.OpRotateLeft32)1708 v.AddArg2(x, z)1709 return true1710 }1711 break1712 }1713 // match: (Add32 right:(Rsh32Ux32 x y) left:(Lsh32x32 x z:(Sub32 (Const32 [32]) y)))1714 // cond: (ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 32)1715 // result: (RotateLeft32 x z)1716 for {1717 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1718 right := v_01719 if right.Op != ssaop.OpRsh32Ux32 {1720 continue1721 }1722 y := right.Args[1]1723 x := right.Args[0]1724 left := v_11725 if left.Op != ssaop.OpLsh32x32 {1726 continue1727 }1728 _ = left.Args[1]1729 if x != left.Args[0] {1730 continue1731 }1732 z := left.Args[1]1733 if z.Op != ssaop.OpSub32 {1734 continue1735 }1736 _ = z.Args[1]1737 z_0 := z.Args[0]1738 if z_0.Op != ssaop.OpConst32 || ssa.AuxIntToInt32(z_0.AuxInt) != 32 || y != z.Args[1] || !((ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 32)) {1739 continue1740 }1741 v.Reset(ssaop.OpRotateLeft32)1742 v.AddArg2(x, z)1743 return true1744 }1745 break1746 }1747 // match: (Add32 right:(Rsh32Ux16 x y) left:(Lsh32x16 x z:(Sub16 (Const16 [32]) y)))1748 // cond: (ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 32)1749 // result: (RotateLeft32 x z)1750 for {1751 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1752 right := v_01753 if right.Op != ssaop.OpRsh32Ux16 {1754 continue1755 }1756 y := right.Args[1]1757 x := right.Args[0]1758 left := v_11759 if left.Op != ssaop.OpLsh32x16 {1760 continue1761 }1762 _ = left.Args[1]1763 if x != left.Args[0] {1764 continue1765 }1766 z := left.Args[1]1767 if z.Op != ssaop.OpSub16 {1768 continue1769 }1770 _ = z.Args[1]1771 z_0 := z.Args[0]1772 if z_0.Op != ssaop.OpConst16 || ssa.AuxIntToInt16(z_0.AuxInt) != 32 || y != z.Args[1] || !((ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 32)) {1773 continue1774 }1775 v.Reset(ssaop.OpRotateLeft32)1776 v.AddArg2(x, z)1777 return true1778 }1779 break1780 }1781 // match: (Add32 right:(Rsh32Ux8 x y) left:(Lsh32x8 x z:(Sub8 (Const8 [32]) y)))1782 // cond: (ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 32)1783 // result: (RotateLeft32 x z)1784 for {1785 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1786 right := v_01787 if right.Op != ssaop.OpRsh32Ux8 {1788 continue1789 }1790 y := right.Args[1]1791 x := right.Args[0]1792 left := v_11793 if left.Op != ssaop.OpLsh32x8 {1794 continue1795 }1796 _ = left.Args[1]1797 if x != left.Args[0] {1798 continue1799 }1800 z := left.Args[1]1801 if z.Op != ssaop.OpSub8 {1802 continue1803 }1804 _ = z.Args[1]1805 z_0 := z.Args[0]1806 if z_0.Op != ssaop.OpConst8 || ssa.AuxIntToInt8(z_0.AuxInt) != 32 || y != z.Args[1] || !((ssa.ShiftIsBounded(left) || ssa.ShiftIsBounded(right)) && canRotate(config, 32)) {1807 continue1808 }1809 v.Reset(ssaop.OpRotateLeft32)1810 v.AddArg2(x, z)1811 return true1812 }1813 break1814 }1815 return false1816}1817func rewriteValue_OpAdd32F(v *ssa.Value) bool {1818 v_1 := v.Args[1]1819 v_0 := v.Args[0]1820 // match: (Add32F (Const32F [c]) (Const32F [d]))1821 // cond: c+d == c+d1822 // result: (Const32F [c+d])1823 for {1824 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1825 if v_0.Op != ssaop.OpConst32F {1826 continue1827 }1828 c := ssa.AuxIntToFloat32(v_0.AuxInt)1829 if v_1.Op != ssaop.OpConst32F {1830 continue1831 }1832 d := ssa.AuxIntToFloat32(v_1.AuxInt)1833 if !(c+d == c+d) {1834 continue1835 }1836 v.Reset(ssaop.OpConst32F)1837 v.AuxInt = ssa.Float32ToAuxInt(c + d)1838 return true1839 }1840 break1841 }1842 return false1843}1844func rewriteValue_OpAdd64(v *ssa.Value) bool {1845 v_1 := v.Args[1]1846 v_0 := v.Args[0]1847 b := v.Block1848 config := b.Func.Config1849 // match: (Add64 (Const64 [c]) (Const64 [d]))1850 // result: (Const64 [c+d])1851 for {1852 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1853 if v_0.Op != ssaop.OpConst64 {1854 continue1855 }1856 c := ssa.AuxIntToInt64(v_0.AuxInt)1857 if v_1.Op != ssaop.OpConst64 {1858 continue1859 }1860 d := ssa.AuxIntToInt64(v_1.AuxInt)1861 v.Reset(ssaop.OpConst64)1862 v.AuxInt = ssa.Int64ToAuxInt(c + d)1863 return true1864 }1865 break1866 }1867 // match: (Add64 <t> (Mul64 x y) (Mul64 x z))1868 // result: (Mul64 x (Add64 <t> y z))1869 for {1870 t := v.Type1871 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1872 if v_0.Op != ssaop.OpMul64 {1873 continue1874 }1875 _ = v_0.Args[1]1876 v_0_0 := v_0.Args[0]1877 v_0_1 := v_0.Args[1]1878 for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {1879 x := v_0_01880 y := v_0_11881 if v_1.Op != ssaop.OpMul64 {1882 continue1883 }1884 _ = v_1.Args[1]1885 v_1_0 := v_1.Args[0]1886 v_1_1 := v_1.Args[1]1887 for _i2 := 0; _i2 <= 1; _i2, v_1_0, v_1_1 = _i2+1, v_1_1, v_1_0 {1888 if x != v_1_0 {1889 continue1890 }1891 z := v_1_11892 v.Reset(ssaop.OpMul64)1893 v0 := b.NewValue0(v.Pos, ssaop.OpAdd64, t)1894 v0.AddArg2(y, z)1895 v.AddArg2(x, v0)1896 return true1897 }1898 }1899 }1900 break1901 }1902 // match: (Add64 x x)1903 // result: (Lsh64x64 x (Const64 <types.Types[types.TUINT64]> [1]))1904 for {1905 x := v_01906 if x != v_1 {1907 break1908 }1909 v.Reset(ssaop.OpLsh64x64)1910 v0 := b.NewValue0(v.Pos, ssaop.OpConst64, types.Types[types.TUINT64])1911 v0.AuxInt = ssa.Int64ToAuxInt(1)1912 v.AddArg2(x, v0)1913 return true1914 }1915 // match: (Add64 (Const64 [0]) x)1916 // result: x1917 for {1918 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1919 if v_0.Op != ssaop.OpConst64 || ssa.AuxIntToInt64(v_0.AuxInt) != 0 {1920 continue1921 }1922 x := v_11923 v.CopyOf(x)1924 return true1925 }1926 break1927 }1928 // match: (Add64 x (Neg64 y))1929 // result: (Sub64 x y)1930 for {1931 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1932 x := v_01933 if v_1.Op != ssaop.OpNeg64 {1934 continue1935 }1936 y := v_1.Args[0]1937 v.Reset(ssaop.OpSub64)1938 v.AddArg2(x, y)1939 return true1940 }1941 break1942 }1943 // match: (Add64 (Com64 x) x)1944 // result: (Const64 [-1])1945 for {1946 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1947 if v_0.Op != ssaop.OpCom64 {1948 continue1949 }1950 x := v_0.Args[0]1951 if x != v_1 {1952 continue1953 }1954 v.Reset(ssaop.OpConst64)1955 v.AuxInt = ssa.Int64ToAuxInt(-1)1956 return true1957 }1958 break1959 }1960 // match: (Add64 (Sub64 x t) (Add64 t y))1961 // result: (Add64 x y)1962 for {1963 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1964 if v_0.Op != ssaop.OpSub64 {1965 continue1966 }1967 t := v_0.Args[1]1968 x := v_0.Args[0]1969 if v_1.Op != ssaop.OpAdd64 {1970 continue1971 }1972 _ = v_1.Args[1]1973 v_1_0 := v_1.Args[0]1974 v_1_1 := v_1.Args[1]1975 for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {1976 if t != v_1_0 {1977 continue1978 }1979 y := v_1_11980 v.Reset(ssaop.OpAdd64)1981 v.AddArg2(x, y)1982 return true1983 }1984 }1985 break1986 }1987 // match: (Add64 (Const64 [1]) (Com64 x))1988 // result: (Neg64 x)1989 for {1990 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {1991 if v_0.Op != ssaop.OpConst64 || ssa.AuxIntToInt64(v_0.AuxInt) != 1 || v_1.Op != ssaop.OpCom64 {1992 continue1993 }1994 x := v_1.Args[0]1995 v.Reset(ssaop.OpNeg64)1996 v.AddArg(x)1997 return true1998 }1999 break2000 }
Findings
✓ No findings reported for this file.