github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/compile/internal/ssa/rewritegeneric.go (about) 1 // Code generated from gen/generic.rules; DO NOT EDIT. 2 // generated with: cd gen; go run *.go 3 4 package ssa 5 6 import "math" 7 import "github.com/gagliardetto/golang-go/cmd/compile/internal/types" 8 9 func rewriteValuegeneric(v *Value) bool { 10 switch v.Op { 11 case OpAdd16: 12 return rewriteValuegeneric_OpAdd16_0(v) || rewriteValuegeneric_OpAdd16_10(v) || rewriteValuegeneric_OpAdd16_20(v) || rewriteValuegeneric_OpAdd16_30(v) 13 case OpAdd32: 14 return rewriteValuegeneric_OpAdd32_0(v) || rewriteValuegeneric_OpAdd32_10(v) || rewriteValuegeneric_OpAdd32_20(v) || rewriteValuegeneric_OpAdd32_30(v) 15 case OpAdd32F: 16 return rewriteValuegeneric_OpAdd32F_0(v) 17 case OpAdd64: 18 return rewriteValuegeneric_OpAdd64_0(v) || rewriteValuegeneric_OpAdd64_10(v) || rewriteValuegeneric_OpAdd64_20(v) || rewriteValuegeneric_OpAdd64_30(v) 19 case OpAdd64F: 20 return rewriteValuegeneric_OpAdd64F_0(v) 21 case OpAdd8: 22 return rewriteValuegeneric_OpAdd8_0(v) || rewriteValuegeneric_OpAdd8_10(v) || rewriteValuegeneric_OpAdd8_20(v) || rewriteValuegeneric_OpAdd8_30(v) 23 case OpAddPtr: 24 return rewriteValuegeneric_OpAddPtr_0(v) 25 case OpAnd16: 26 return rewriteValuegeneric_OpAnd16_0(v) || rewriteValuegeneric_OpAnd16_10(v) || rewriteValuegeneric_OpAnd16_20(v) 27 case OpAnd32: 28 return rewriteValuegeneric_OpAnd32_0(v) || rewriteValuegeneric_OpAnd32_10(v) || rewriteValuegeneric_OpAnd32_20(v) 29 case OpAnd64: 30 return rewriteValuegeneric_OpAnd64_0(v) || rewriteValuegeneric_OpAnd64_10(v) || rewriteValuegeneric_OpAnd64_20(v) 31 case OpAnd8: 32 return rewriteValuegeneric_OpAnd8_0(v) || rewriteValuegeneric_OpAnd8_10(v) || rewriteValuegeneric_OpAnd8_20(v) 33 case OpArraySelect: 34 return rewriteValuegeneric_OpArraySelect_0(v) 35 case OpCom16: 36 return rewriteValuegeneric_OpCom16_0(v) 37 case OpCom32: 38 return rewriteValuegeneric_OpCom32_0(v) 39 case OpCom64: 40 return rewriteValuegeneric_OpCom64_0(v) 41 case OpCom8: 42 return rewriteValuegeneric_OpCom8_0(v) 43 case OpConstInterface: 44 return rewriteValuegeneric_OpConstInterface_0(v) 45 case OpConstSlice: 46 return rewriteValuegeneric_OpConstSlice_0(v) 47 case OpConstString: 48 return rewriteValuegeneric_OpConstString_0(v) 49 case OpConvert: 50 return rewriteValuegeneric_OpConvert_0(v) 51 case OpCvt32Fto32: 52 return rewriteValuegeneric_OpCvt32Fto32_0(v) 53 case OpCvt32Fto64: 54 return rewriteValuegeneric_OpCvt32Fto64_0(v) 55 case OpCvt32Fto64F: 56 return rewriteValuegeneric_OpCvt32Fto64F_0(v) 57 case OpCvt32to32F: 58 return rewriteValuegeneric_OpCvt32to32F_0(v) 59 case OpCvt32to64F: 60 return rewriteValuegeneric_OpCvt32to64F_0(v) 61 case OpCvt64Fto32: 62 return rewriteValuegeneric_OpCvt64Fto32_0(v) 63 case OpCvt64Fto32F: 64 return rewriteValuegeneric_OpCvt64Fto32F_0(v) 65 case OpCvt64Fto64: 66 return rewriteValuegeneric_OpCvt64Fto64_0(v) 67 case OpCvt64to32F: 68 return rewriteValuegeneric_OpCvt64to32F_0(v) 69 case OpCvt64to64F: 70 return rewriteValuegeneric_OpCvt64to64F_0(v) 71 case OpDiv16: 72 return rewriteValuegeneric_OpDiv16_0(v) 73 case OpDiv16u: 74 return rewriteValuegeneric_OpDiv16u_0(v) 75 case OpDiv32: 76 return rewriteValuegeneric_OpDiv32_0(v) 77 case OpDiv32F: 78 return rewriteValuegeneric_OpDiv32F_0(v) 79 case OpDiv32u: 80 return rewriteValuegeneric_OpDiv32u_0(v) 81 case OpDiv64: 82 return rewriteValuegeneric_OpDiv64_0(v) 83 case OpDiv64F: 84 return rewriteValuegeneric_OpDiv64F_0(v) 85 case OpDiv64u: 86 return rewriteValuegeneric_OpDiv64u_0(v) 87 case OpDiv8: 88 return rewriteValuegeneric_OpDiv8_0(v) 89 case OpDiv8u: 90 return rewriteValuegeneric_OpDiv8u_0(v) 91 case OpEq16: 92 return rewriteValuegeneric_OpEq16_0(v) || rewriteValuegeneric_OpEq16_10(v) || rewriteValuegeneric_OpEq16_20(v) || rewriteValuegeneric_OpEq16_30(v) || rewriteValuegeneric_OpEq16_40(v) || rewriteValuegeneric_OpEq16_50(v) || rewriteValuegeneric_OpEq16_60(v) 93 case OpEq32: 94 return rewriteValuegeneric_OpEq32_0(v) || rewriteValuegeneric_OpEq32_10(v) || rewriteValuegeneric_OpEq32_20(v) || rewriteValuegeneric_OpEq32_30(v) || rewriteValuegeneric_OpEq32_40(v) || rewriteValuegeneric_OpEq32_50(v) || rewriteValuegeneric_OpEq32_60(v) || rewriteValuegeneric_OpEq32_70(v) || rewriteValuegeneric_OpEq32_80(v) || rewriteValuegeneric_OpEq32_90(v) 95 case OpEq32F: 96 return rewriteValuegeneric_OpEq32F_0(v) 97 case OpEq64: 98 return rewriteValuegeneric_OpEq64_0(v) || rewriteValuegeneric_OpEq64_10(v) || rewriteValuegeneric_OpEq64_20(v) || rewriteValuegeneric_OpEq64_30(v) || rewriteValuegeneric_OpEq64_40(v) || rewriteValuegeneric_OpEq64_50(v) || rewriteValuegeneric_OpEq64_60(v) 99 case OpEq64F: 100 return rewriteValuegeneric_OpEq64F_0(v) 101 case OpEq8: 102 return rewriteValuegeneric_OpEq8_0(v) || rewriteValuegeneric_OpEq8_10(v) || rewriteValuegeneric_OpEq8_20(v) || rewriteValuegeneric_OpEq8_30(v) 103 case OpEqB: 104 return rewriteValuegeneric_OpEqB_0(v) 105 case OpEqInter: 106 return rewriteValuegeneric_OpEqInter_0(v) 107 case OpEqPtr: 108 return rewriteValuegeneric_OpEqPtr_0(v) || rewriteValuegeneric_OpEqPtr_10(v) || rewriteValuegeneric_OpEqPtr_20(v) || rewriteValuegeneric_OpEqPtr_30(v) 109 case OpEqSlice: 110 return rewriteValuegeneric_OpEqSlice_0(v) 111 case OpGeq16: 112 return rewriteValuegeneric_OpGeq16_0(v) 113 case OpGeq16U: 114 return rewriteValuegeneric_OpGeq16U_0(v) 115 case OpGeq32: 116 return rewriteValuegeneric_OpGeq32_0(v) 117 case OpGeq32F: 118 return rewriteValuegeneric_OpGeq32F_0(v) 119 case OpGeq32U: 120 return rewriteValuegeneric_OpGeq32U_0(v) 121 case OpGeq64: 122 return rewriteValuegeneric_OpGeq64_0(v) 123 case OpGeq64F: 124 return rewriteValuegeneric_OpGeq64F_0(v) 125 case OpGeq64U: 126 return rewriteValuegeneric_OpGeq64U_0(v) 127 case OpGeq8: 128 return rewriteValuegeneric_OpGeq8_0(v) 129 case OpGeq8U: 130 return rewriteValuegeneric_OpGeq8U_0(v) 131 case OpGreater16: 132 return rewriteValuegeneric_OpGreater16_0(v) 133 case OpGreater16U: 134 return rewriteValuegeneric_OpGreater16U_0(v) 135 case OpGreater32: 136 return rewriteValuegeneric_OpGreater32_0(v) 137 case OpGreater32F: 138 return rewriteValuegeneric_OpGreater32F_0(v) 139 case OpGreater32U: 140 return rewriteValuegeneric_OpGreater32U_0(v) 141 case OpGreater64: 142 return rewriteValuegeneric_OpGreater64_0(v) 143 case OpGreater64F: 144 return rewriteValuegeneric_OpGreater64F_0(v) 145 case OpGreater64U: 146 return rewriteValuegeneric_OpGreater64U_0(v) 147 case OpGreater8: 148 return rewriteValuegeneric_OpGreater8_0(v) 149 case OpGreater8U: 150 return rewriteValuegeneric_OpGreater8U_0(v) 151 case OpIMake: 152 return rewriteValuegeneric_OpIMake_0(v) 153 case OpInterCall: 154 return rewriteValuegeneric_OpInterCall_0(v) 155 case OpIsInBounds: 156 return rewriteValuegeneric_OpIsInBounds_0(v) || rewriteValuegeneric_OpIsInBounds_10(v) || rewriteValuegeneric_OpIsInBounds_20(v) || rewriteValuegeneric_OpIsInBounds_30(v) 157 case OpIsNonNil: 158 return rewriteValuegeneric_OpIsNonNil_0(v) 159 case OpIsSliceInBounds: 160 return rewriteValuegeneric_OpIsSliceInBounds_0(v) 161 case OpLeq16: 162 return rewriteValuegeneric_OpLeq16_0(v) 163 case OpLeq16U: 164 return rewriteValuegeneric_OpLeq16U_0(v) 165 case OpLeq32: 166 return rewriteValuegeneric_OpLeq32_0(v) 167 case OpLeq32F: 168 return rewriteValuegeneric_OpLeq32F_0(v) 169 case OpLeq32U: 170 return rewriteValuegeneric_OpLeq32U_0(v) 171 case OpLeq64: 172 return rewriteValuegeneric_OpLeq64_0(v) 173 case OpLeq64F: 174 return rewriteValuegeneric_OpLeq64F_0(v) 175 case OpLeq64U: 176 return rewriteValuegeneric_OpLeq64U_0(v) 177 case OpLeq8: 178 return rewriteValuegeneric_OpLeq8_0(v) 179 case OpLeq8U: 180 return rewriteValuegeneric_OpLeq8U_0(v) 181 case OpLess16: 182 return rewriteValuegeneric_OpLess16_0(v) 183 case OpLess16U: 184 return rewriteValuegeneric_OpLess16U_0(v) 185 case OpLess32: 186 return rewriteValuegeneric_OpLess32_0(v) 187 case OpLess32F: 188 return rewriteValuegeneric_OpLess32F_0(v) 189 case OpLess32U: 190 return rewriteValuegeneric_OpLess32U_0(v) 191 case OpLess64: 192 return rewriteValuegeneric_OpLess64_0(v) 193 case OpLess64F: 194 return rewriteValuegeneric_OpLess64F_0(v) 195 case OpLess64U: 196 return rewriteValuegeneric_OpLess64U_0(v) 197 case OpLess8: 198 return rewriteValuegeneric_OpLess8_0(v) 199 case OpLess8U: 200 return rewriteValuegeneric_OpLess8U_0(v) 201 case OpLoad: 202 return rewriteValuegeneric_OpLoad_0(v) || rewriteValuegeneric_OpLoad_10(v) || rewriteValuegeneric_OpLoad_20(v) 203 case OpLsh16x16: 204 return rewriteValuegeneric_OpLsh16x16_0(v) 205 case OpLsh16x32: 206 return rewriteValuegeneric_OpLsh16x32_0(v) 207 case OpLsh16x64: 208 return rewriteValuegeneric_OpLsh16x64_0(v) 209 case OpLsh16x8: 210 return rewriteValuegeneric_OpLsh16x8_0(v) 211 case OpLsh32x16: 212 return rewriteValuegeneric_OpLsh32x16_0(v) 213 case OpLsh32x32: 214 return rewriteValuegeneric_OpLsh32x32_0(v) 215 case OpLsh32x64: 216 return rewriteValuegeneric_OpLsh32x64_0(v) 217 case OpLsh32x8: 218 return rewriteValuegeneric_OpLsh32x8_0(v) 219 case OpLsh64x16: 220 return rewriteValuegeneric_OpLsh64x16_0(v) 221 case OpLsh64x32: 222 return rewriteValuegeneric_OpLsh64x32_0(v) 223 case OpLsh64x64: 224 return rewriteValuegeneric_OpLsh64x64_0(v) 225 case OpLsh64x8: 226 return rewriteValuegeneric_OpLsh64x8_0(v) 227 case OpLsh8x16: 228 return rewriteValuegeneric_OpLsh8x16_0(v) 229 case OpLsh8x32: 230 return rewriteValuegeneric_OpLsh8x32_0(v) 231 case OpLsh8x64: 232 return rewriteValuegeneric_OpLsh8x64_0(v) 233 case OpLsh8x8: 234 return rewriteValuegeneric_OpLsh8x8_0(v) 235 case OpMod16: 236 return rewriteValuegeneric_OpMod16_0(v) 237 case OpMod16u: 238 return rewriteValuegeneric_OpMod16u_0(v) 239 case OpMod32: 240 return rewriteValuegeneric_OpMod32_0(v) 241 case OpMod32u: 242 return rewriteValuegeneric_OpMod32u_0(v) 243 case OpMod64: 244 return rewriteValuegeneric_OpMod64_0(v) 245 case OpMod64u: 246 return rewriteValuegeneric_OpMod64u_0(v) 247 case OpMod8: 248 return rewriteValuegeneric_OpMod8_0(v) 249 case OpMod8u: 250 return rewriteValuegeneric_OpMod8u_0(v) 251 case OpMove: 252 return rewriteValuegeneric_OpMove_0(v) || rewriteValuegeneric_OpMove_10(v) || rewriteValuegeneric_OpMove_20(v) 253 case OpMul16: 254 return rewriteValuegeneric_OpMul16_0(v) || rewriteValuegeneric_OpMul16_10(v) 255 case OpMul32: 256 return rewriteValuegeneric_OpMul32_0(v) || rewriteValuegeneric_OpMul32_10(v) 257 case OpMul32F: 258 return rewriteValuegeneric_OpMul32F_0(v) 259 case OpMul64: 260 return rewriteValuegeneric_OpMul64_0(v) || rewriteValuegeneric_OpMul64_10(v) 261 case OpMul64F: 262 return rewriteValuegeneric_OpMul64F_0(v) 263 case OpMul8: 264 return rewriteValuegeneric_OpMul8_0(v) || rewriteValuegeneric_OpMul8_10(v) 265 case OpNeg16: 266 return rewriteValuegeneric_OpNeg16_0(v) 267 case OpNeg32: 268 return rewriteValuegeneric_OpNeg32_0(v) 269 case OpNeg32F: 270 return rewriteValuegeneric_OpNeg32F_0(v) 271 case OpNeg64: 272 return rewriteValuegeneric_OpNeg64_0(v) 273 case OpNeg64F: 274 return rewriteValuegeneric_OpNeg64F_0(v) 275 case OpNeg8: 276 return rewriteValuegeneric_OpNeg8_0(v) 277 case OpNeq16: 278 return rewriteValuegeneric_OpNeq16_0(v) || rewriteValuegeneric_OpNeq16_10(v) 279 case OpNeq32: 280 return rewriteValuegeneric_OpNeq32_0(v) || rewriteValuegeneric_OpNeq32_10(v) 281 case OpNeq32F: 282 return rewriteValuegeneric_OpNeq32F_0(v) 283 case OpNeq64: 284 return rewriteValuegeneric_OpNeq64_0(v) || rewriteValuegeneric_OpNeq64_10(v) 285 case OpNeq64F: 286 return rewriteValuegeneric_OpNeq64F_0(v) 287 case OpNeq8: 288 return rewriteValuegeneric_OpNeq8_0(v) || rewriteValuegeneric_OpNeq8_10(v) 289 case OpNeqB: 290 return rewriteValuegeneric_OpNeqB_0(v) 291 case OpNeqInter: 292 return rewriteValuegeneric_OpNeqInter_0(v) 293 case OpNeqPtr: 294 return rewriteValuegeneric_OpNeqPtr_0(v) || rewriteValuegeneric_OpNeqPtr_10(v) || rewriteValuegeneric_OpNeqPtr_20(v) || rewriteValuegeneric_OpNeqPtr_30(v) 295 case OpNeqSlice: 296 return rewriteValuegeneric_OpNeqSlice_0(v) 297 case OpNilCheck: 298 return rewriteValuegeneric_OpNilCheck_0(v) 299 case OpNot: 300 return rewriteValuegeneric_OpNot_0(v) || rewriteValuegeneric_OpNot_10(v) || rewriteValuegeneric_OpNot_20(v) || rewriteValuegeneric_OpNot_30(v) || rewriteValuegeneric_OpNot_40(v) 301 case OpOffPtr: 302 return rewriteValuegeneric_OpOffPtr_0(v) 303 case OpOr16: 304 return rewriteValuegeneric_OpOr16_0(v) || rewriteValuegeneric_OpOr16_10(v) || rewriteValuegeneric_OpOr16_20(v) 305 case OpOr32: 306 return rewriteValuegeneric_OpOr32_0(v) || rewriteValuegeneric_OpOr32_10(v) || rewriteValuegeneric_OpOr32_20(v) 307 case OpOr64: 308 return rewriteValuegeneric_OpOr64_0(v) || rewriteValuegeneric_OpOr64_10(v) || rewriteValuegeneric_OpOr64_20(v) 309 case OpOr8: 310 return rewriteValuegeneric_OpOr8_0(v) || rewriteValuegeneric_OpOr8_10(v) || rewriteValuegeneric_OpOr8_20(v) 311 case OpPhi: 312 return rewriteValuegeneric_OpPhi_0(v) 313 case OpPtrIndex: 314 return rewriteValuegeneric_OpPtrIndex_0(v) 315 case OpRotateLeft16: 316 return rewriteValuegeneric_OpRotateLeft16_0(v) 317 case OpRotateLeft32: 318 return rewriteValuegeneric_OpRotateLeft32_0(v) 319 case OpRotateLeft64: 320 return rewriteValuegeneric_OpRotateLeft64_0(v) 321 case OpRotateLeft8: 322 return rewriteValuegeneric_OpRotateLeft8_0(v) 323 case OpRound32F: 324 return rewriteValuegeneric_OpRound32F_0(v) 325 case OpRound64F: 326 return rewriteValuegeneric_OpRound64F_0(v) 327 case OpRsh16Ux16: 328 return rewriteValuegeneric_OpRsh16Ux16_0(v) 329 case OpRsh16Ux32: 330 return rewriteValuegeneric_OpRsh16Ux32_0(v) 331 case OpRsh16Ux64: 332 return rewriteValuegeneric_OpRsh16Ux64_0(v) 333 case OpRsh16Ux8: 334 return rewriteValuegeneric_OpRsh16Ux8_0(v) 335 case OpRsh16x16: 336 return rewriteValuegeneric_OpRsh16x16_0(v) 337 case OpRsh16x32: 338 return rewriteValuegeneric_OpRsh16x32_0(v) 339 case OpRsh16x64: 340 return rewriteValuegeneric_OpRsh16x64_0(v) 341 case OpRsh16x8: 342 return rewriteValuegeneric_OpRsh16x8_0(v) 343 case OpRsh32Ux16: 344 return rewriteValuegeneric_OpRsh32Ux16_0(v) 345 case OpRsh32Ux32: 346 return rewriteValuegeneric_OpRsh32Ux32_0(v) 347 case OpRsh32Ux64: 348 return rewriteValuegeneric_OpRsh32Ux64_0(v) 349 case OpRsh32Ux8: 350 return rewriteValuegeneric_OpRsh32Ux8_0(v) 351 case OpRsh32x16: 352 return rewriteValuegeneric_OpRsh32x16_0(v) 353 case OpRsh32x32: 354 return rewriteValuegeneric_OpRsh32x32_0(v) 355 case OpRsh32x64: 356 return rewriteValuegeneric_OpRsh32x64_0(v) 357 case OpRsh32x8: 358 return rewriteValuegeneric_OpRsh32x8_0(v) 359 case OpRsh64Ux16: 360 return rewriteValuegeneric_OpRsh64Ux16_0(v) 361 case OpRsh64Ux32: 362 return rewriteValuegeneric_OpRsh64Ux32_0(v) 363 case OpRsh64Ux64: 364 return rewriteValuegeneric_OpRsh64Ux64_0(v) 365 case OpRsh64Ux8: 366 return rewriteValuegeneric_OpRsh64Ux8_0(v) 367 case OpRsh64x16: 368 return rewriteValuegeneric_OpRsh64x16_0(v) 369 case OpRsh64x32: 370 return rewriteValuegeneric_OpRsh64x32_0(v) 371 case OpRsh64x64: 372 return rewriteValuegeneric_OpRsh64x64_0(v) 373 case OpRsh64x8: 374 return rewriteValuegeneric_OpRsh64x8_0(v) 375 case OpRsh8Ux16: 376 return rewriteValuegeneric_OpRsh8Ux16_0(v) 377 case OpRsh8Ux32: 378 return rewriteValuegeneric_OpRsh8Ux32_0(v) 379 case OpRsh8Ux64: 380 return rewriteValuegeneric_OpRsh8Ux64_0(v) 381 case OpRsh8Ux8: 382 return rewriteValuegeneric_OpRsh8Ux8_0(v) 383 case OpRsh8x16: 384 return rewriteValuegeneric_OpRsh8x16_0(v) 385 case OpRsh8x32: 386 return rewriteValuegeneric_OpRsh8x32_0(v) 387 case OpRsh8x64: 388 return rewriteValuegeneric_OpRsh8x64_0(v) 389 case OpRsh8x8: 390 return rewriteValuegeneric_OpRsh8x8_0(v) 391 case OpSelect0: 392 return rewriteValuegeneric_OpSelect0_0(v) 393 case OpSelect1: 394 return rewriteValuegeneric_OpSelect1_0(v) 395 case OpSignExt16to32: 396 return rewriteValuegeneric_OpSignExt16to32_0(v) 397 case OpSignExt16to64: 398 return rewriteValuegeneric_OpSignExt16to64_0(v) 399 case OpSignExt32to64: 400 return rewriteValuegeneric_OpSignExt32to64_0(v) 401 case OpSignExt8to16: 402 return rewriteValuegeneric_OpSignExt8to16_0(v) 403 case OpSignExt8to32: 404 return rewriteValuegeneric_OpSignExt8to32_0(v) 405 case OpSignExt8to64: 406 return rewriteValuegeneric_OpSignExt8to64_0(v) 407 case OpSliceCap: 408 return rewriteValuegeneric_OpSliceCap_0(v) 409 case OpSliceLen: 410 return rewriteValuegeneric_OpSliceLen_0(v) 411 case OpSlicePtr: 412 return rewriteValuegeneric_OpSlicePtr_0(v) 413 case OpSlicemask: 414 return rewriteValuegeneric_OpSlicemask_0(v) 415 case OpSqrt: 416 return rewriteValuegeneric_OpSqrt_0(v) 417 case OpStaticCall: 418 return rewriteValuegeneric_OpStaticCall_0(v) 419 case OpStore: 420 return rewriteValuegeneric_OpStore_0(v) || rewriteValuegeneric_OpStore_10(v) || rewriteValuegeneric_OpStore_20(v) 421 case OpStringLen: 422 return rewriteValuegeneric_OpStringLen_0(v) 423 case OpStringPtr: 424 return rewriteValuegeneric_OpStringPtr_0(v) 425 case OpStructSelect: 426 return rewriteValuegeneric_OpStructSelect_0(v) || rewriteValuegeneric_OpStructSelect_10(v) 427 case OpSub16: 428 return rewriteValuegeneric_OpSub16_0(v) || rewriteValuegeneric_OpSub16_10(v) 429 case OpSub32: 430 return rewriteValuegeneric_OpSub32_0(v) || rewriteValuegeneric_OpSub32_10(v) 431 case OpSub32F: 432 return rewriteValuegeneric_OpSub32F_0(v) 433 case OpSub64: 434 return rewriteValuegeneric_OpSub64_0(v) || rewriteValuegeneric_OpSub64_10(v) 435 case OpSub64F: 436 return rewriteValuegeneric_OpSub64F_0(v) 437 case OpSub8: 438 return rewriteValuegeneric_OpSub8_0(v) || rewriteValuegeneric_OpSub8_10(v) 439 case OpTrunc16to8: 440 return rewriteValuegeneric_OpTrunc16to8_0(v) 441 case OpTrunc32to16: 442 return rewriteValuegeneric_OpTrunc32to16_0(v) 443 case OpTrunc32to8: 444 return rewriteValuegeneric_OpTrunc32to8_0(v) 445 case OpTrunc64to16: 446 return rewriteValuegeneric_OpTrunc64to16_0(v) 447 case OpTrunc64to32: 448 return rewriteValuegeneric_OpTrunc64to32_0(v) 449 case OpTrunc64to8: 450 return rewriteValuegeneric_OpTrunc64to8_0(v) 451 case OpXor16: 452 return rewriteValuegeneric_OpXor16_0(v) || rewriteValuegeneric_OpXor16_10(v) 453 case OpXor32: 454 return rewriteValuegeneric_OpXor32_0(v) || rewriteValuegeneric_OpXor32_10(v) 455 case OpXor64: 456 return rewriteValuegeneric_OpXor64_0(v) || rewriteValuegeneric_OpXor64_10(v) 457 case OpXor8: 458 return rewriteValuegeneric_OpXor8_0(v) || rewriteValuegeneric_OpXor8_10(v) 459 case OpZero: 460 return rewriteValuegeneric_OpZero_0(v) 461 case OpZeroExt16to32: 462 return rewriteValuegeneric_OpZeroExt16to32_0(v) 463 case OpZeroExt16to64: 464 return rewriteValuegeneric_OpZeroExt16to64_0(v) 465 case OpZeroExt32to64: 466 return rewriteValuegeneric_OpZeroExt32to64_0(v) 467 case OpZeroExt8to16: 468 return rewriteValuegeneric_OpZeroExt8to16_0(v) 469 case OpZeroExt8to32: 470 return rewriteValuegeneric_OpZeroExt8to32_0(v) 471 case OpZeroExt8to64: 472 return rewriteValuegeneric_OpZeroExt8to64_0(v) 473 } 474 return false 475 } 476 func rewriteValuegeneric_OpAdd16_0(v *Value) bool { 477 b := v.Block 478 // match: (Add16 (Const16 [c]) (Const16 [d])) 479 // result: (Const16 [int64(int16(c+d))]) 480 for { 481 _ = v.Args[1] 482 v_0 := v.Args[0] 483 if v_0.Op != OpConst16 { 484 break 485 } 486 c := v_0.AuxInt 487 v_1 := v.Args[1] 488 if v_1.Op != OpConst16 { 489 break 490 } 491 d := v_1.AuxInt 492 v.reset(OpConst16) 493 v.AuxInt = int64(int16(c + d)) 494 return true 495 } 496 // match: (Add16 (Const16 [d]) (Const16 [c])) 497 // result: (Const16 [int64(int16(c+d))]) 498 for { 499 _ = v.Args[1] 500 v_0 := v.Args[0] 501 if v_0.Op != OpConst16 { 502 break 503 } 504 d := v_0.AuxInt 505 v_1 := v.Args[1] 506 if v_1.Op != OpConst16 { 507 break 508 } 509 c := v_1.AuxInt 510 v.reset(OpConst16) 511 v.AuxInt = int64(int16(c + d)) 512 return true 513 } 514 // match: (Add16 <t> (Mul16 x y) (Mul16 x z)) 515 // result: (Mul16 x (Add16 <t> y z)) 516 for { 517 t := v.Type 518 _ = v.Args[1] 519 v_0 := v.Args[0] 520 if v_0.Op != OpMul16 { 521 break 522 } 523 y := v_0.Args[1] 524 x := v_0.Args[0] 525 v_1 := v.Args[1] 526 if v_1.Op != OpMul16 { 527 break 528 } 529 z := v_1.Args[1] 530 if x != v_1.Args[0] { 531 break 532 } 533 v.reset(OpMul16) 534 v.AddArg(x) 535 v0 := b.NewValue0(v.Pos, OpAdd16, t) 536 v0.AddArg(y) 537 v0.AddArg(z) 538 v.AddArg(v0) 539 return true 540 } 541 // match: (Add16 <t> (Mul16 y x) (Mul16 x z)) 542 // result: (Mul16 x (Add16 <t> y z)) 543 for { 544 t := v.Type 545 _ = v.Args[1] 546 v_0 := v.Args[0] 547 if v_0.Op != OpMul16 { 548 break 549 } 550 x := v_0.Args[1] 551 y := v_0.Args[0] 552 v_1 := v.Args[1] 553 if v_1.Op != OpMul16 { 554 break 555 } 556 z := v_1.Args[1] 557 if x != v_1.Args[0] { 558 break 559 } 560 v.reset(OpMul16) 561 v.AddArg(x) 562 v0 := b.NewValue0(v.Pos, OpAdd16, t) 563 v0.AddArg(y) 564 v0.AddArg(z) 565 v.AddArg(v0) 566 return true 567 } 568 // match: (Add16 <t> (Mul16 x y) (Mul16 z x)) 569 // result: (Mul16 x (Add16 <t> y z)) 570 for { 571 t := v.Type 572 _ = v.Args[1] 573 v_0 := v.Args[0] 574 if v_0.Op != OpMul16 { 575 break 576 } 577 y := v_0.Args[1] 578 x := v_0.Args[0] 579 v_1 := v.Args[1] 580 if v_1.Op != OpMul16 { 581 break 582 } 583 _ = v_1.Args[1] 584 z := v_1.Args[0] 585 if x != v_1.Args[1] { 586 break 587 } 588 v.reset(OpMul16) 589 v.AddArg(x) 590 v0 := b.NewValue0(v.Pos, OpAdd16, t) 591 v0.AddArg(y) 592 v0.AddArg(z) 593 v.AddArg(v0) 594 return true 595 } 596 // match: (Add16 <t> (Mul16 y x) (Mul16 z x)) 597 // result: (Mul16 x (Add16 <t> y z)) 598 for { 599 t := v.Type 600 _ = v.Args[1] 601 v_0 := v.Args[0] 602 if v_0.Op != OpMul16 { 603 break 604 } 605 x := v_0.Args[1] 606 y := v_0.Args[0] 607 v_1 := v.Args[1] 608 if v_1.Op != OpMul16 { 609 break 610 } 611 _ = v_1.Args[1] 612 z := v_1.Args[0] 613 if x != v_1.Args[1] { 614 break 615 } 616 v.reset(OpMul16) 617 v.AddArg(x) 618 v0 := b.NewValue0(v.Pos, OpAdd16, t) 619 v0.AddArg(y) 620 v0.AddArg(z) 621 v.AddArg(v0) 622 return true 623 } 624 // match: (Add16 <t> (Mul16 x z) (Mul16 x y)) 625 // result: (Mul16 x (Add16 <t> y z)) 626 for { 627 t := v.Type 628 _ = v.Args[1] 629 v_0 := v.Args[0] 630 if v_0.Op != OpMul16 { 631 break 632 } 633 z := v_0.Args[1] 634 x := v_0.Args[0] 635 v_1 := v.Args[1] 636 if v_1.Op != OpMul16 { 637 break 638 } 639 y := v_1.Args[1] 640 if x != v_1.Args[0] { 641 break 642 } 643 v.reset(OpMul16) 644 v.AddArg(x) 645 v0 := b.NewValue0(v.Pos, OpAdd16, t) 646 v0.AddArg(y) 647 v0.AddArg(z) 648 v.AddArg(v0) 649 return true 650 } 651 // match: (Add16 <t> (Mul16 z x) (Mul16 x y)) 652 // result: (Mul16 x (Add16 <t> y z)) 653 for { 654 t := v.Type 655 _ = v.Args[1] 656 v_0 := v.Args[0] 657 if v_0.Op != OpMul16 { 658 break 659 } 660 x := v_0.Args[1] 661 z := v_0.Args[0] 662 v_1 := v.Args[1] 663 if v_1.Op != OpMul16 { 664 break 665 } 666 y := v_1.Args[1] 667 if x != v_1.Args[0] { 668 break 669 } 670 v.reset(OpMul16) 671 v.AddArg(x) 672 v0 := b.NewValue0(v.Pos, OpAdd16, t) 673 v0.AddArg(y) 674 v0.AddArg(z) 675 v.AddArg(v0) 676 return true 677 } 678 // match: (Add16 <t> (Mul16 x z) (Mul16 y x)) 679 // result: (Mul16 x (Add16 <t> y z)) 680 for { 681 t := v.Type 682 _ = v.Args[1] 683 v_0 := v.Args[0] 684 if v_0.Op != OpMul16 { 685 break 686 } 687 z := v_0.Args[1] 688 x := v_0.Args[0] 689 v_1 := v.Args[1] 690 if v_1.Op != OpMul16 { 691 break 692 } 693 _ = v_1.Args[1] 694 y := v_1.Args[0] 695 if x != v_1.Args[1] { 696 break 697 } 698 v.reset(OpMul16) 699 v.AddArg(x) 700 v0 := b.NewValue0(v.Pos, OpAdd16, t) 701 v0.AddArg(y) 702 v0.AddArg(z) 703 v.AddArg(v0) 704 return true 705 } 706 // match: (Add16 <t> (Mul16 z x) (Mul16 y x)) 707 // result: (Mul16 x (Add16 <t> y z)) 708 for { 709 t := v.Type 710 _ = v.Args[1] 711 v_0 := v.Args[0] 712 if v_0.Op != OpMul16 { 713 break 714 } 715 x := v_0.Args[1] 716 z := v_0.Args[0] 717 v_1 := v.Args[1] 718 if v_1.Op != OpMul16 { 719 break 720 } 721 _ = v_1.Args[1] 722 y := v_1.Args[0] 723 if x != v_1.Args[1] { 724 break 725 } 726 v.reset(OpMul16) 727 v.AddArg(x) 728 v0 := b.NewValue0(v.Pos, OpAdd16, t) 729 v0.AddArg(y) 730 v0.AddArg(z) 731 v.AddArg(v0) 732 return true 733 } 734 return false 735 } 736 func rewriteValuegeneric_OpAdd16_10(v *Value) bool { 737 b := v.Block 738 // match: (Add16 (Const16 [0]) x) 739 // result: x 740 for { 741 x := v.Args[1] 742 v_0 := v.Args[0] 743 if v_0.Op != OpConst16 || v_0.AuxInt != 0 { 744 break 745 } 746 v.reset(OpCopy) 747 v.Type = x.Type 748 v.AddArg(x) 749 return true 750 } 751 // match: (Add16 x (Const16 [0])) 752 // result: x 753 for { 754 _ = v.Args[1] 755 x := v.Args[0] 756 v_1 := v.Args[1] 757 if v_1.Op != OpConst16 || v_1.AuxInt != 0 { 758 break 759 } 760 v.reset(OpCopy) 761 v.Type = x.Type 762 v.AddArg(x) 763 return true 764 } 765 // match: (Add16 (Const16 [1]) (Com16 x)) 766 // result: (Neg16 x) 767 for { 768 _ = v.Args[1] 769 v_0 := v.Args[0] 770 if v_0.Op != OpConst16 || v_0.AuxInt != 1 { 771 break 772 } 773 v_1 := v.Args[1] 774 if v_1.Op != OpCom16 { 775 break 776 } 777 x := v_1.Args[0] 778 v.reset(OpNeg16) 779 v.AddArg(x) 780 return true 781 } 782 // match: (Add16 (Com16 x) (Const16 [1])) 783 // result: (Neg16 x) 784 for { 785 _ = v.Args[1] 786 v_0 := v.Args[0] 787 if v_0.Op != OpCom16 { 788 break 789 } 790 x := v_0.Args[0] 791 v_1 := v.Args[1] 792 if v_1.Op != OpConst16 || v_1.AuxInt != 1 { 793 break 794 } 795 v.reset(OpNeg16) 796 v.AddArg(x) 797 return true 798 } 799 // match: (Add16 (Add16 i:(Const16 <t>) z) x) 800 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 801 // result: (Add16 i (Add16 <t> z x)) 802 for { 803 x := v.Args[1] 804 v_0 := v.Args[0] 805 if v_0.Op != OpAdd16 { 806 break 807 } 808 z := v_0.Args[1] 809 i := v_0.Args[0] 810 if i.Op != OpConst16 { 811 break 812 } 813 t := i.Type 814 if !(z.Op != OpConst16 && x.Op != OpConst16) { 815 break 816 } 817 v.reset(OpAdd16) 818 v.AddArg(i) 819 v0 := b.NewValue0(v.Pos, OpAdd16, t) 820 v0.AddArg(z) 821 v0.AddArg(x) 822 v.AddArg(v0) 823 return true 824 } 825 // match: (Add16 (Add16 z i:(Const16 <t>)) x) 826 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 827 // result: (Add16 i (Add16 <t> z x)) 828 for { 829 x := v.Args[1] 830 v_0 := v.Args[0] 831 if v_0.Op != OpAdd16 { 832 break 833 } 834 _ = v_0.Args[1] 835 z := v_0.Args[0] 836 i := v_0.Args[1] 837 if i.Op != OpConst16 { 838 break 839 } 840 t := i.Type 841 if !(z.Op != OpConst16 && x.Op != OpConst16) { 842 break 843 } 844 v.reset(OpAdd16) 845 v.AddArg(i) 846 v0 := b.NewValue0(v.Pos, OpAdd16, t) 847 v0.AddArg(z) 848 v0.AddArg(x) 849 v.AddArg(v0) 850 return true 851 } 852 // match: (Add16 x (Add16 i:(Const16 <t>) z)) 853 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 854 // result: (Add16 i (Add16 <t> z x)) 855 for { 856 _ = v.Args[1] 857 x := v.Args[0] 858 v_1 := v.Args[1] 859 if v_1.Op != OpAdd16 { 860 break 861 } 862 z := v_1.Args[1] 863 i := v_1.Args[0] 864 if i.Op != OpConst16 { 865 break 866 } 867 t := i.Type 868 if !(z.Op != OpConst16 && x.Op != OpConst16) { 869 break 870 } 871 v.reset(OpAdd16) 872 v.AddArg(i) 873 v0 := b.NewValue0(v.Pos, OpAdd16, t) 874 v0.AddArg(z) 875 v0.AddArg(x) 876 v.AddArg(v0) 877 return true 878 } 879 // match: (Add16 x (Add16 z i:(Const16 <t>))) 880 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 881 // result: (Add16 i (Add16 <t> z x)) 882 for { 883 _ = v.Args[1] 884 x := v.Args[0] 885 v_1 := v.Args[1] 886 if v_1.Op != OpAdd16 { 887 break 888 } 889 _ = v_1.Args[1] 890 z := v_1.Args[0] 891 i := v_1.Args[1] 892 if i.Op != OpConst16 { 893 break 894 } 895 t := i.Type 896 if !(z.Op != OpConst16 && x.Op != OpConst16) { 897 break 898 } 899 v.reset(OpAdd16) 900 v.AddArg(i) 901 v0 := b.NewValue0(v.Pos, OpAdd16, t) 902 v0.AddArg(z) 903 v0.AddArg(x) 904 v.AddArg(v0) 905 return true 906 } 907 // match: (Add16 (Sub16 i:(Const16 <t>) z) x) 908 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 909 // result: (Add16 i (Sub16 <t> x z)) 910 for { 911 x := v.Args[1] 912 v_0 := v.Args[0] 913 if v_0.Op != OpSub16 { 914 break 915 } 916 z := v_0.Args[1] 917 i := v_0.Args[0] 918 if i.Op != OpConst16 { 919 break 920 } 921 t := i.Type 922 if !(z.Op != OpConst16 && x.Op != OpConst16) { 923 break 924 } 925 v.reset(OpAdd16) 926 v.AddArg(i) 927 v0 := b.NewValue0(v.Pos, OpSub16, t) 928 v0.AddArg(x) 929 v0.AddArg(z) 930 v.AddArg(v0) 931 return true 932 } 933 // match: (Add16 x (Sub16 i:(Const16 <t>) z)) 934 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 935 // result: (Add16 i (Sub16 <t> x z)) 936 for { 937 _ = v.Args[1] 938 x := v.Args[0] 939 v_1 := v.Args[1] 940 if v_1.Op != OpSub16 { 941 break 942 } 943 z := v_1.Args[1] 944 i := v_1.Args[0] 945 if i.Op != OpConst16 { 946 break 947 } 948 t := i.Type 949 if !(z.Op != OpConst16 && x.Op != OpConst16) { 950 break 951 } 952 v.reset(OpAdd16) 953 v.AddArg(i) 954 v0 := b.NewValue0(v.Pos, OpSub16, t) 955 v0.AddArg(x) 956 v0.AddArg(z) 957 v.AddArg(v0) 958 return true 959 } 960 return false 961 } 962 func rewriteValuegeneric_OpAdd16_20(v *Value) bool { 963 b := v.Block 964 // match: (Add16 x (Sub16 i:(Const16 <t>) z)) 965 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 966 // result: (Add16 i (Sub16 <t> x z)) 967 for { 968 _ = v.Args[1] 969 x := v.Args[0] 970 v_1 := v.Args[1] 971 if v_1.Op != OpSub16 { 972 break 973 } 974 z := v_1.Args[1] 975 i := v_1.Args[0] 976 if i.Op != OpConst16 { 977 break 978 } 979 t := i.Type 980 if !(z.Op != OpConst16 && x.Op != OpConst16) { 981 break 982 } 983 v.reset(OpAdd16) 984 v.AddArg(i) 985 v0 := b.NewValue0(v.Pos, OpSub16, t) 986 v0.AddArg(x) 987 v0.AddArg(z) 988 v.AddArg(v0) 989 return true 990 } 991 // match: (Add16 (Sub16 i:(Const16 <t>) z) x) 992 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 993 // result: (Add16 i (Sub16 <t> x z)) 994 for { 995 x := v.Args[1] 996 v_0 := v.Args[0] 997 if v_0.Op != OpSub16 { 998 break 999 } 1000 z := v_0.Args[1] 1001 i := v_0.Args[0] 1002 if i.Op != OpConst16 { 1003 break 1004 } 1005 t := i.Type 1006 if !(z.Op != OpConst16 && x.Op != OpConst16) { 1007 break 1008 } 1009 v.reset(OpAdd16) 1010 v.AddArg(i) 1011 v0 := b.NewValue0(v.Pos, OpSub16, t) 1012 v0.AddArg(x) 1013 v0.AddArg(z) 1014 v.AddArg(v0) 1015 return true 1016 } 1017 // match: (Add16 (Sub16 z i:(Const16 <t>)) x) 1018 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 1019 // result: (Sub16 (Add16 <t> x z) i) 1020 for { 1021 x := v.Args[1] 1022 v_0 := v.Args[0] 1023 if v_0.Op != OpSub16 { 1024 break 1025 } 1026 _ = v_0.Args[1] 1027 z := v_0.Args[0] 1028 i := v_0.Args[1] 1029 if i.Op != OpConst16 { 1030 break 1031 } 1032 t := i.Type 1033 if !(z.Op != OpConst16 && x.Op != OpConst16) { 1034 break 1035 } 1036 v.reset(OpSub16) 1037 v0 := b.NewValue0(v.Pos, OpAdd16, t) 1038 v0.AddArg(x) 1039 v0.AddArg(z) 1040 v.AddArg(v0) 1041 v.AddArg(i) 1042 return true 1043 } 1044 // match: (Add16 x (Sub16 z i:(Const16 <t>))) 1045 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 1046 // result: (Sub16 (Add16 <t> x z) i) 1047 for { 1048 _ = v.Args[1] 1049 x := v.Args[0] 1050 v_1 := v.Args[1] 1051 if v_1.Op != OpSub16 { 1052 break 1053 } 1054 _ = v_1.Args[1] 1055 z := v_1.Args[0] 1056 i := v_1.Args[1] 1057 if i.Op != OpConst16 { 1058 break 1059 } 1060 t := i.Type 1061 if !(z.Op != OpConst16 && x.Op != OpConst16) { 1062 break 1063 } 1064 v.reset(OpSub16) 1065 v0 := b.NewValue0(v.Pos, OpAdd16, t) 1066 v0.AddArg(x) 1067 v0.AddArg(z) 1068 v.AddArg(v0) 1069 v.AddArg(i) 1070 return true 1071 } 1072 // match: (Add16 x (Sub16 z i:(Const16 <t>))) 1073 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 1074 // result: (Sub16 (Add16 <t> x z) i) 1075 for { 1076 _ = v.Args[1] 1077 x := v.Args[0] 1078 v_1 := v.Args[1] 1079 if v_1.Op != OpSub16 { 1080 break 1081 } 1082 _ = v_1.Args[1] 1083 z := v_1.Args[0] 1084 i := v_1.Args[1] 1085 if i.Op != OpConst16 { 1086 break 1087 } 1088 t := i.Type 1089 if !(z.Op != OpConst16 && x.Op != OpConst16) { 1090 break 1091 } 1092 v.reset(OpSub16) 1093 v0 := b.NewValue0(v.Pos, OpAdd16, t) 1094 v0.AddArg(x) 1095 v0.AddArg(z) 1096 v.AddArg(v0) 1097 v.AddArg(i) 1098 return true 1099 } 1100 // match: (Add16 (Sub16 z i:(Const16 <t>)) x) 1101 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 1102 // result: (Sub16 (Add16 <t> x z) i) 1103 for { 1104 x := v.Args[1] 1105 v_0 := v.Args[0] 1106 if v_0.Op != OpSub16 { 1107 break 1108 } 1109 _ = v_0.Args[1] 1110 z := v_0.Args[0] 1111 i := v_0.Args[1] 1112 if i.Op != OpConst16 { 1113 break 1114 } 1115 t := i.Type 1116 if !(z.Op != OpConst16 && x.Op != OpConst16) { 1117 break 1118 } 1119 v.reset(OpSub16) 1120 v0 := b.NewValue0(v.Pos, OpAdd16, t) 1121 v0.AddArg(x) 1122 v0.AddArg(z) 1123 v.AddArg(v0) 1124 v.AddArg(i) 1125 return true 1126 } 1127 // match: (Add16 (Const16 <t> [c]) (Add16 (Const16 <t> [d]) x)) 1128 // result: (Add16 (Const16 <t> [int64(int16(c+d))]) x) 1129 for { 1130 _ = v.Args[1] 1131 v_0 := v.Args[0] 1132 if v_0.Op != OpConst16 { 1133 break 1134 } 1135 t := v_0.Type 1136 c := v_0.AuxInt 1137 v_1 := v.Args[1] 1138 if v_1.Op != OpAdd16 { 1139 break 1140 } 1141 x := v_1.Args[1] 1142 v_1_0 := v_1.Args[0] 1143 if v_1_0.Op != OpConst16 || v_1_0.Type != t { 1144 break 1145 } 1146 d := v_1_0.AuxInt 1147 v.reset(OpAdd16) 1148 v0 := b.NewValue0(v.Pos, OpConst16, t) 1149 v0.AuxInt = int64(int16(c + d)) 1150 v.AddArg(v0) 1151 v.AddArg(x) 1152 return true 1153 } 1154 // match: (Add16 (Const16 <t> [c]) (Add16 x (Const16 <t> [d]))) 1155 // result: (Add16 (Const16 <t> [int64(int16(c+d))]) x) 1156 for { 1157 _ = v.Args[1] 1158 v_0 := v.Args[0] 1159 if v_0.Op != OpConst16 { 1160 break 1161 } 1162 t := v_0.Type 1163 c := v_0.AuxInt 1164 v_1 := v.Args[1] 1165 if v_1.Op != OpAdd16 { 1166 break 1167 } 1168 _ = v_1.Args[1] 1169 x := v_1.Args[0] 1170 v_1_1 := v_1.Args[1] 1171 if v_1_1.Op != OpConst16 || v_1_1.Type != t { 1172 break 1173 } 1174 d := v_1_1.AuxInt 1175 v.reset(OpAdd16) 1176 v0 := b.NewValue0(v.Pos, OpConst16, t) 1177 v0.AuxInt = int64(int16(c + d)) 1178 v.AddArg(v0) 1179 v.AddArg(x) 1180 return true 1181 } 1182 // match: (Add16 (Add16 (Const16 <t> [d]) x) (Const16 <t> [c])) 1183 // result: (Add16 (Const16 <t> [int64(int16(c+d))]) x) 1184 for { 1185 _ = v.Args[1] 1186 v_0 := v.Args[0] 1187 if v_0.Op != OpAdd16 { 1188 break 1189 } 1190 x := v_0.Args[1] 1191 v_0_0 := v_0.Args[0] 1192 if v_0_0.Op != OpConst16 { 1193 break 1194 } 1195 t := v_0_0.Type 1196 d := v_0_0.AuxInt 1197 v_1 := v.Args[1] 1198 if v_1.Op != OpConst16 || v_1.Type != t { 1199 break 1200 } 1201 c := v_1.AuxInt 1202 v.reset(OpAdd16) 1203 v0 := b.NewValue0(v.Pos, OpConst16, t) 1204 v0.AuxInt = int64(int16(c + d)) 1205 v.AddArg(v0) 1206 v.AddArg(x) 1207 return true 1208 } 1209 // match: (Add16 (Add16 x (Const16 <t> [d])) (Const16 <t> [c])) 1210 // result: (Add16 (Const16 <t> [int64(int16(c+d))]) x) 1211 for { 1212 _ = v.Args[1] 1213 v_0 := v.Args[0] 1214 if v_0.Op != OpAdd16 { 1215 break 1216 } 1217 _ = v_0.Args[1] 1218 x := v_0.Args[0] 1219 v_0_1 := v_0.Args[1] 1220 if v_0_1.Op != OpConst16 { 1221 break 1222 } 1223 t := v_0_1.Type 1224 d := v_0_1.AuxInt 1225 v_1 := v.Args[1] 1226 if v_1.Op != OpConst16 || v_1.Type != t { 1227 break 1228 } 1229 c := v_1.AuxInt 1230 v.reset(OpAdd16) 1231 v0 := b.NewValue0(v.Pos, OpConst16, t) 1232 v0.AuxInt = int64(int16(c + d)) 1233 v.AddArg(v0) 1234 v.AddArg(x) 1235 return true 1236 } 1237 return false 1238 } 1239 func rewriteValuegeneric_OpAdd16_30(v *Value) bool { 1240 b := v.Block 1241 // match: (Add16 (Const16 <t> [c]) (Sub16 (Const16 <t> [d]) x)) 1242 // result: (Sub16 (Const16 <t> [int64(int16(c+d))]) x) 1243 for { 1244 _ = v.Args[1] 1245 v_0 := v.Args[0] 1246 if v_0.Op != OpConst16 { 1247 break 1248 } 1249 t := v_0.Type 1250 c := v_0.AuxInt 1251 v_1 := v.Args[1] 1252 if v_1.Op != OpSub16 { 1253 break 1254 } 1255 x := v_1.Args[1] 1256 v_1_0 := v_1.Args[0] 1257 if v_1_0.Op != OpConst16 || v_1_0.Type != t { 1258 break 1259 } 1260 d := v_1_0.AuxInt 1261 v.reset(OpSub16) 1262 v0 := b.NewValue0(v.Pos, OpConst16, t) 1263 v0.AuxInt = int64(int16(c + d)) 1264 v.AddArg(v0) 1265 v.AddArg(x) 1266 return true 1267 } 1268 // match: (Add16 (Sub16 (Const16 <t> [d]) x) (Const16 <t> [c])) 1269 // result: (Sub16 (Const16 <t> [int64(int16(c+d))]) x) 1270 for { 1271 _ = v.Args[1] 1272 v_0 := v.Args[0] 1273 if v_0.Op != OpSub16 { 1274 break 1275 } 1276 x := v_0.Args[1] 1277 v_0_0 := v_0.Args[0] 1278 if v_0_0.Op != OpConst16 { 1279 break 1280 } 1281 t := v_0_0.Type 1282 d := v_0_0.AuxInt 1283 v_1 := v.Args[1] 1284 if v_1.Op != OpConst16 || v_1.Type != t { 1285 break 1286 } 1287 c := v_1.AuxInt 1288 v.reset(OpSub16) 1289 v0 := b.NewValue0(v.Pos, OpConst16, t) 1290 v0.AuxInt = int64(int16(c + d)) 1291 v.AddArg(v0) 1292 v.AddArg(x) 1293 return true 1294 } 1295 // match: (Add16 (Const16 <t> [c]) (Sub16 x (Const16 <t> [d]))) 1296 // result: (Add16 (Const16 <t> [int64(int16(c-d))]) x) 1297 for { 1298 _ = v.Args[1] 1299 v_0 := v.Args[0] 1300 if v_0.Op != OpConst16 { 1301 break 1302 } 1303 t := v_0.Type 1304 c := v_0.AuxInt 1305 v_1 := v.Args[1] 1306 if v_1.Op != OpSub16 { 1307 break 1308 } 1309 _ = v_1.Args[1] 1310 x := v_1.Args[0] 1311 v_1_1 := v_1.Args[1] 1312 if v_1_1.Op != OpConst16 || v_1_1.Type != t { 1313 break 1314 } 1315 d := v_1_1.AuxInt 1316 v.reset(OpAdd16) 1317 v0 := b.NewValue0(v.Pos, OpConst16, t) 1318 v0.AuxInt = int64(int16(c - d)) 1319 v.AddArg(v0) 1320 v.AddArg(x) 1321 return true 1322 } 1323 // match: (Add16 (Sub16 x (Const16 <t> [d])) (Const16 <t> [c])) 1324 // result: (Add16 (Const16 <t> [int64(int16(c-d))]) x) 1325 for { 1326 _ = v.Args[1] 1327 v_0 := v.Args[0] 1328 if v_0.Op != OpSub16 { 1329 break 1330 } 1331 _ = v_0.Args[1] 1332 x := v_0.Args[0] 1333 v_0_1 := v_0.Args[1] 1334 if v_0_1.Op != OpConst16 { 1335 break 1336 } 1337 t := v_0_1.Type 1338 d := v_0_1.AuxInt 1339 v_1 := v.Args[1] 1340 if v_1.Op != OpConst16 || v_1.Type != t { 1341 break 1342 } 1343 c := v_1.AuxInt 1344 v.reset(OpAdd16) 1345 v0 := b.NewValue0(v.Pos, OpConst16, t) 1346 v0.AuxInt = int64(int16(c - d)) 1347 v.AddArg(v0) 1348 v.AddArg(x) 1349 return true 1350 } 1351 return false 1352 } 1353 func rewriteValuegeneric_OpAdd32_0(v *Value) bool { 1354 b := v.Block 1355 // match: (Add32 (Const32 [c]) (Const32 [d])) 1356 // result: (Const32 [int64(int32(c+d))]) 1357 for { 1358 _ = v.Args[1] 1359 v_0 := v.Args[0] 1360 if v_0.Op != OpConst32 { 1361 break 1362 } 1363 c := v_0.AuxInt 1364 v_1 := v.Args[1] 1365 if v_1.Op != OpConst32 { 1366 break 1367 } 1368 d := v_1.AuxInt 1369 v.reset(OpConst32) 1370 v.AuxInt = int64(int32(c + d)) 1371 return true 1372 } 1373 // match: (Add32 (Const32 [d]) (Const32 [c])) 1374 // result: (Const32 [int64(int32(c+d))]) 1375 for { 1376 _ = v.Args[1] 1377 v_0 := v.Args[0] 1378 if v_0.Op != OpConst32 { 1379 break 1380 } 1381 d := v_0.AuxInt 1382 v_1 := v.Args[1] 1383 if v_1.Op != OpConst32 { 1384 break 1385 } 1386 c := v_1.AuxInt 1387 v.reset(OpConst32) 1388 v.AuxInt = int64(int32(c + d)) 1389 return true 1390 } 1391 // match: (Add32 <t> (Mul32 x y) (Mul32 x z)) 1392 // result: (Mul32 x (Add32 <t> y z)) 1393 for { 1394 t := v.Type 1395 _ = v.Args[1] 1396 v_0 := v.Args[0] 1397 if v_0.Op != OpMul32 { 1398 break 1399 } 1400 y := v_0.Args[1] 1401 x := v_0.Args[0] 1402 v_1 := v.Args[1] 1403 if v_1.Op != OpMul32 { 1404 break 1405 } 1406 z := v_1.Args[1] 1407 if x != v_1.Args[0] { 1408 break 1409 } 1410 v.reset(OpMul32) 1411 v.AddArg(x) 1412 v0 := b.NewValue0(v.Pos, OpAdd32, t) 1413 v0.AddArg(y) 1414 v0.AddArg(z) 1415 v.AddArg(v0) 1416 return true 1417 } 1418 // match: (Add32 <t> (Mul32 y x) (Mul32 x z)) 1419 // result: (Mul32 x (Add32 <t> y z)) 1420 for { 1421 t := v.Type 1422 _ = v.Args[1] 1423 v_0 := v.Args[0] 1424 if v_0.Op != OpMul32 { 1425 break 1426 } 1427 x := v_0.Args[1] 1428 y := v_0.Args[0] 1429 v_1 := v.Args[1] 1430 if v_1.Op != OpMul32 { 1431 break 1432 } 1433 z := v_1.Args[1] 1434 if x != v_1.Args[0] { 1435 break 1436 } 1437 v.reset(OpMul32) 1438 v.AddArg(x) 1439 v0 := b.NewValue0(v.Pos, OpAdd32, t) 1440 v0.AddArg(y) 1441 v0.AddArg(z) 1442 v.AddArg(v0) 1443 return true 1444 } 1445 // match: (Add32 <t> (Mul32 x y) (Mul32 z x)) 1446 // result: (Mul32 x (Add32 <t> y z)) 1447 for { 1448 t := v.Type 1449 _ = v.Args[1] 1450 v_0 := v.Args[0] 1451 if v_0.Op != OpMul32 { 1452 break 1453 } 1454 y := v_0.Args[1] 1455 x := v_0.Args[0] 1456 v_1 := v.Args[1] 1457 if v_1.Op != OpMul32 { 1458 break 1459 } 1460 _ = v_1.Args[1] 1461 z := v_1.Args[0] 1462 if x != v_1.Args[1] { 1463 break 1464 } 1465 v.reset(OpMul32) 1466 v.AddArg(x) 1467 v0 := b.NewValue0(v.Pos, OpAdd32, t) 1468 v0.AddArg(y) 1469 v0.AddArg(z) 1470 v.AddArg(v0) 1471 return true 1472 } 1473 // match: (Add32 <t> (Mul32 y x) (Mul32 z x)) 1474 // result: (Mul32 x (Add32 <t> y z)) 1475 for { 1476 t := v.Type 1477 _ = v.Args[1] 1478 v_0 := v.Args[0] 1479 if v_0.Op != OpMul32 { 1480 break 1481 } 1482 x := v_0.Args[1] 1483 y := v_0.Args[0] 1484 v_1 := v.Args[1] 1485 if v_1.Op != OpMul32 { 1486 break 1487 } 1488 _ = v_1.Args[1] 1489 z := v_1.Args[0] 1490 if x != v_1.Args[1] { 1491 break 1492 } 1493 v.reset(OpMul32) 1494 v.AddArg(x) 1495 v0 := b.NewValue0(v.Pos, OpAdd32, t) 1496 v0.AddArg(y) 1497 v0.AddArg(z) 1498 v.AddArg(v0) 1499 return true 1500 } 1501 // match: (Add32 <t> (Mul32 x z) (Mul32 x y)) 1502 // result: (Mul32 x (Add32 <t> y z)) 1503 for { 1504 t := v.Type 1505 _ = v.Args[1] 1506 v_0 := v.Args[0] 1507 if v_0.Op != OpMul32 { 1508 break 1509 } 1510 z := v_0.Args[1] 1511 x := v_0.Args[0] 1512 v_1 := v.Args[1] 1513 if v_1.Op != OpMul32 { 1514 break 1515 } 1516 y := v_1.Args[1] 1517 if x != v_1.Args[0] { 1518 break 1519 } 1520 v.reset(OpMul32) 1521 v.AddArg(x) 1522 v0 := b.NewValue0(v.Pos, OpAdd32, t) 1523 v0.AddArg(y) 1524 v0.AddArg(z) 1525 v.AddArg(v0) 1526 return true 1527 } 1528 // match: (Add32 <t> (Mul32 z x) (Mul32 x y)) 1529 // result: (Mul32 x (Add32 <t> y z)) 1530 for { 1531 t := v.Type 1532 _ = v.Args[1] 1533 v_0 := v.Args[0] 1534 if v_0.Op != OpMul32 { 1535 break 1536 } 1537 x := v_0.Args[1] 1538 z := v_0.Args[0] 1539 v_1 := v.Args[1] 1540 if v_1.Op != OpMul32 { 1541 break 1542 } 1543 y := v_1.Args[1] 1544 if x != v_1.Args[0] { 1545 break 1546 } 1547 v.reset(OpMul32) 1548 v.AddArg(x) 1549 v0 := b.NewValue0(v.Pos, OpAdd32, t) 1550 v0.AddArg(y) 1551 v0.AddArg(z) 1552 v.AddArg(v0) 1553 return true 1554 } 1555 // match: (Add32 <t> (Mul32 x z) (Mul32 y x)) 1556 // result: (Mul32 x (Add32 <t> y z)) 1557 for { 1558 t := v.Type 1559 _ = v.Args[1] 1560 v_0 := v.Args[0] 1561 if v_0.Op != OpMul32 { 1562 break 1563 } 1564 z := v_0.Args[1] 1565 x := v_0.Args[0] 1566 v_1 := v.Args[1] 1567 if v_1.Op != OpMul32 { 1568 break 1569 } 1570 _ = v_1.Args[1] 1571 y := v_1.Args[0] 1572 if x != v_1.Args[1] { 1573 break 1574 } 1575 v.reset(OpMul32) 1576 v.AddArg(x) 1577 v0 := b.NewValue0(v.Pos, OpAdd32, t) 1578 v0.AddArg(y) 1579 v0.AddArg(z) 1580 v.AddArg(v0) 1581 return true 1582 } 1583 // match: (Add32 <t> (Mul32 z x) (Mul32 y x)) 1584 // result: (Mul32 x (Add32 <t> y z)) 1585 for { 1586 t := v.Type 1587 _ = v.Args[1] 1588 v_0 := v.Args[0] 1589 if v_0.Op != OpMul32 { 1590 break 1591 } 1592 x := v_0.Args[1] 1593 z := v_0.Args[0] 1594 v_1 := v.Args[1] 1595 if v_1.Op != OpMul32 { 1596 break 1597 } 1598 _ = v_1.Args[1] 1599 y := v_1.Args[0] 1600 if x != v_1.Args[1] { 1601 break 1602 } 1603 v.reset(OpMul32) 1604 v.AddArg(x) 1605 v0 := b.NewValue0(v.Pos, OpAdd32, t) 1606 v0.AddArg(y) 1607 v0.AddArg(z) 1608 v.AddArg(v0) 1609 return true 1610 } 1611 return false 1612 } 1613 func rewriteValuegeneric_OpAdd32_10(v *Value) bool { 1614 b := v.Block 1615 // match: (Add32 (Const32 [0]) x) 1616 // result: x 1617 for { 1618 x := v.Args[1] 1619 v_0 := v.Args[0] 1620 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 1621 break 1622 } 1623 v.reset(OpCopy) 1624 v.Type = x.Type 1625 v.AddArg(x) 1626 return true 1627 } 1628 // match: (Add32 x (Const32 [0])) 1629 // result: x 1630 for { 1631 _ = v.Args[1] 1632 x := v.Args[0] 1633 v_1 := v.Args[1] 1634 if v_1.Op != OpConst32 || v_1.AuxInt != 0 { 1635 break 1636 } 1637 v.reset(OpCopy) 1638 v.Type = x.Type 1639 v.AddArg(x) 1640 return true 1641 } 1642 // match: (Add32 (Const32 [1]) (Com32 x)) 1643 // result: (Neg32 x) 1644 for { 1645 _ = v.Args[1] 1646 v_0 := v.Args[0] 1647 if v_0.Op != OpConst32 || v_0.AuxInt != 1 { 1648 break 1649 } 1650 v_1 := v.Args[1] 1651 if v_1.Op != OpCom32 { 1652 break 1653 } 1654 x := v_1.Args[0] 1655 v.reset(OpNeg32) 1656 v.AddArg(x) 1657 return true 1658 } 1659 // match: (Add32 (Com32 x) (Const32 [1])) 1660 // result: (Neg32 x) 1661 for { 1662 _ = v.Args[1] 1663 v_0 := v.Args[0] 1664 if v_0.Op != OpCom32 { 1665 break 1666 } 1667 x := v_0.Args[0] 1668 v_1 := v.Args[1] 1669 if v_1.Op != OpConst32 || v_1.AuxInt != 1 { 1670 break 1671 } 1672 v.reset(OpNeg32) 1673 v.AddArg(x) 1674 return true 1675 } 1676 // match: (Add32 (Add32 i:(Const32 <t>) z) x) 1677 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 1678 // result: (Add32 i (Add32 <t> z x)) 1679 for { 1680 x := v.Args[1] 1681 v_0 := v.Args[0] 1682 if v_0.Op != OpAdd32 { 1683 break 1684 } 1685 z := v_0.Args[1] 1686 i := v_0.Args[0] 1687 if i.Op != OpConst32 { 1688 break 1689 } 1690 t := i.Type 1691 if !(z.Op != OpConst32 && x.Op != OpConst32) { 1692 break 1693 } 1694 v.reset(OpAdd32) 1695 v.AddArg(i) 1696 v0 := b.NewValue0(v.Pos, OpAdd32, t) 1697 v0.AddArg(z) 1698 v0.AddArg(x) 1699 v.AddArg(v0) 1700 return true 1701 } 1702 // match: (Add32 (Add32 z i:(Const32 <t>)) x) 1703 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 1704 // result: (Add32 i (Add32 <t> z x)) 1705 for { 1706 x := v.Args[1] 1707 v_0 := v.Args[0] 1708 if v_0.Op != OpAdd32 { 1709 break 1710 } 1711 _ = v_0.Args[1] 1712 z := v_0.Args[0] 1713 i := v_0.Args[1] 1714 if i.Op != OpConst32 { 1715 break 1716 } 1717 t := i.Type 1718 if !(z.Op != OpConst32 && x.Op != OpConst32) { 1719 break 1720 } 1721 v.reset(OpAdd32) 1722 v.AddArg(i) 1723 v0 := b.NewValue0(v.Pos, OpAdd32, t) 1724 v0.AddArg(z) 1725 v0.AddArg(x) 1726 v.AddArg(v0) 1727 return true 1728 } 1729 // match: (Add32 x (Add32 i:(Const32 <t>) z)) 1730 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 1731 // result: (Add32 i (Add32 <t> z x)) 1732 for { 1733 _ = v.Args[1] 1734 x := v.Args[0] 1735 v_1 := v.Args[1] 1736 if v_1.Op != OpAdd32 { 1737 break 1738 } 1739 z := v_1.Args[1] 1740 i := v_1.Args[0] 1741 if i.Op != OpConst32 { 1742 break 1743 } 1744 t := i.Type 1745 if !(z.Op != OpConst32 && x.Op != OpConst32) { 1746 break 1747 } 1748 v.reset(OpAdd32) 1749 v.AddArg(i) 1750 v0 := b.NewValue0(v.Pos, OpAdd32, t) 1751 v0.AddArg(z) 1752 v0.AddArg(x) 1753 v.AddArg(v0) 1754 return true 1755 } 1756 // match: (Add32 x (Add32 z i:(Const32 <t>))) 1757 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 1758 // result: (Add32 i (Add32 <t> z x)) 1759 for { 1760 _ = v.Args[1] 1761 x := v.Args[0] 1762 v_1 := v.Args[1] 1763 if v_1.Op != OpAdd32 { 1764 break 1765 } 1766 _ = v_1.Args[1] 1767 z := v_1.Args[0] 1768 i := v_1.Args[1] 1769 if i.Op != OpConst32 { 1770 break 1771 } 1772 t := i.Type 1773 if !(z.Op != OpConst32 && x.Op != OpConst32) { 1774 break 1775 } 1776 v.reset(OpAdd32) 1777 v.AddArg(i) 1778 v0 := b.NewValue0(v.Pos, OpAdd32, t) 1779 v0.AddArg(z) 1780 v0.AddArg(x) 1781 v.AddArg(v0) 1782 return true 1783 } 1784 // match: (Add32 (Sub32 i:(Const32 <t>) z) x) 1785 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 1786 // result: (Add32 i (Sub32 <t> x z)) 1787 for { 1788 x := v.Args[1] 1789 v_0 := v.Args[0] 1790 if v_0.Op != OpSub32 { 1791 break 1792 } 1793 z := v_0.Args[1] 1794 i := v_0.Args[0] 1795 if i.Op != OpConst32 { 1796 break 1797 } 1798 t := i.Type 1799 if !(z.Op != OpConst32 && x.Op != OpConst32) { 1800 break 1801 } 1802 v.reset(OpAdd32) 1803 v.AddArg(i) 1804 v0 := b.NewValue0(v.Pos, OpSub32, t) 1805 v0.AddArg(x) 1806 v0.AddArg(z) 1807 v.AddArg(v0) 1808 return true 1809 } 1810 // match: (Add32 x (Sub32 i:(Const32 <t>) z)) 1811 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 1812 // result: (Add32 i (Sub32 <t> x z)) 1813 for { 1814 _ = v.Args[1] 1815 x := v.Args[0] 1816 v_1 := v.Args[1] 1817 if v_1.Op != OpSub32 { 1818 break 1819 } 1820 z := v_1.Args[1] 1821 i := v_1.Args[0] 1822 if i.Op != OpConst32 { 1823 break 1824 } 1825 t := i.Type 1826 if !(z.Op != OpConst32 && x.Op != OpConst32) { 1827 break 1828 } 1829 v.reset(OpAdd32) 1830 v.AddArg(i) 1831 v0 := b.NewValue0(v.Pos, OpSub32, t) 1832 v0.AddArg(x) 1833 v0.AddArg(z) 1834 v.AddArg(v0) 1835 return true 1836 } 1837 return false 1838 } 1839 func rewriteValuegeneric_OpAdd32_20(v *Value) bool { 1840 b := v.Block 1841 // match: (Add32 x (Sub32 i:(Const32 <t>) z)) 1842 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 1843 // result: (Add32 i (Sub32 <t> x z)) 1844 for { 1845 _ = v.Args[1] 1846 x := v.Args[0] 1847 v_1 := v.Args[1] 1848 if v_1.Op != OpSub32 { 1849 break 1850 } 1851 z := v_1.Args[1] 1852 i := v_1.Args[0] 1853 if i.Op != OpConst32 { 1854 break 1855 } 1856 t := i.Type 1857 if !(z.Op != OpConst32 && x.Op != OpConst32) { 1858 break 1859 } 1860 v.reset(OpAdd32) 1861 v.AddArg(i) 1862 v0 := b.NewValue0(v.Pos, OpSub32, t) 1863 v0.AddArg(x) 1864 v0.AddArg(z) 1865 v.AddArg(v0) 1866 return true 1867 } 1868 // match: (Add32 (Sub32 i:(Const32 <t>) z) x) 1869 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 1870 // result: (Add32 i (Sub32 <t> x z)) 1871 for { 1872 x := v.Args[1] 1873 v_0 := v.Args[0] 1874 if v_0.Op != OpSub32 { 1875 break 1876 } 1877 z := v_0.Args[1] 1878 i := v_0.Args[0] 1879 if i.Op != OpConst32 { 1880 break 1881 } 1882 t := i.Type 1883 if !(z.Op != OpConst32 && x.Op != OpConst32) { 1884 break 1885 } 1886 v.reset(OpAdd32) 1887 v.AddArg(i) 1888 v0 := b.NewValue0(v.Pos, OpSub32, t) 1889 v0.AddArg(x) 1890 v0.AddArg(z) 1891 v.AddArg(v0) 1892 return true 1893 } 1894 // match: (Add32 (Sub32 z i:(Const32 <t>)) x) 1895 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 1896 // result: (Sub32 (Add32 <t> x z) i) 1897 for { 1898 x := v.Args[1] 1899 v_0 := v.Args[0] 1900 if v_0.Op != OpSub32 { 1901 break 1902 } 1903 _ = v_0.Args[1] 1904 z := v_0.Args[0] 1905 i := v_0.Args[1] 1906 if i.Op != OpConst32 { 1907 break 1908 } 1909 t := i.Type 1910 if !(z.Op != OpConst32 && x.Op != OpConst32) { 1911 break 1912 } 1913 v.reset(OpSub32) 1914 v0 := b.NewValue0(v.Pos, OpAdd32, t) 1915 v0.AddArg(x) 1916 v0.AddArg(z) 1917 v.AddArg(v0) 1918 v.AddArg(i) 1919 return true 1920 } 1921 // match: (Add32 x (Sub32 z i:(Const32 <t>))) 1922 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 1923 // result: (Sub32 (Add32 <t> x z) i) 1924 for { 1925 _ = v.Args[1] 1926 x := v.Args[0] 1927 v_1 := v.Args[1] 1928 if v_1.Op != OpSub32 { 1929 break 1930 } 1931 _ = v_1.Args[1] 1932 z := v_1.Args[0] 1933 i := v_1.Args[1] 1934 if i.Op != OpConst32 { 1935 break 1936 } 1937 t := i.Type 1938 if !(z.Op != OpConst32 && x.Op != OpConst32) { 1939 break 1940 } 1941 v.reset(OpSub32) 1942 v0 := b.NewValue0(v.Pos, OpAdd32, t) 1943 v0.AddArg(x) 1944 v0.AddArg(z) 1945 v.AddArg(v0) 1946 v.AddArg(i) 1947 return true 1948 } 1949 // match: (Add32 x (Sub32 z i:(Const32 <t>))) 1950 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 1951 // result: (Sub32 (Add32 <t> x z) i) 1952 for { 1953 _ = v.Args[1] 1954 x := v.Args[0] 1955 v_1 := v.Args[1] 1956 if v_1.Op != OpSub32 { 1957 break 1958 } 1959 _ = v_1.Args[1] 1960 z := v_1.Args[0] 1961 i := v_1.Args[1] 1962 if i.Op != OpConst32 { 1963 break 1964 } 1965 t := i.Type 1966 if !(z.Op != OpConst32 && x.Op != OpConst32) { 1967 break 1968 } 1969 v.reset(OpSub32) 1970 v0 := b.NewValue0(v.Pos, OpAdd32, t) 1971 v0.AddArg(x) 1972 v0.AddArg(z) 1973 v.AddArg(v0) 1974 v.AddArg(i) 1975 return true 1976 } 1977 // match: (Add32 (Sub32 z i:(Const32 <t>)) x) 1978 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 1979 // result: (Sub32 (Add32 <t> x z) i) 1980 for { 1981 x := v.Args[1] 1982 v_0 := v.Args[0] 1983 if v_0.Op != OpSub32 { 1984 break 1985 } 1986 _ = v_0.Args[1] 1987 z := v_0.Args[0] 1988 i := v_0.Args[1] 1989 if i.Op != OpConst32 { 1990 break 1991 } 1992 t := i.Type 1993 if !(z.Op != OpConst32 && x.Op != OpConst32) { 1994 break 1995 } 1996 v.reset(OpSub32) 1997 v0 := b.NewValue0(v.Pos, OpAdd32, t) 1998 v0.AddArg(x) 1999 v0.AddArg(z) 2000 v.AddArg(v0) 2001 v.AddArg(i) 2002 return true 2003 } 2004 // match: (Add32 (Const32 <t> [c]) (Add32 (Const32 <t> [d]) x)) 2005 // result: (Add32 (Const32 <t> [int64(int32(c+d))]) x) 2006 for { 2007 _ = v.Args[1] 2008 v_0 := v.Args[0] 2009 if v_0.Op != OpConst32 { 2010 break 2011 } 2012 t := v_0.Type 2013 c := v_0.AuxInt 2014 v_1 := v.Args[1] 2015 if v_1.Op != OpAdd32 { 2016 break 2017 } 2018 x := v_1.Args[1] 2019 v_1_0 := v_1.Args[0] 2020 if v_1_0.Op != OpConst32 || v_1_0.Type != t { 2021 break 2022 } 2023 d := v_1_0.AuxInt 2024 v.reset(OpAdd32) 2025 v0 := b.NewValue0(v.Pos, OpConst32, t) 2026 v0.AuxInt = int64(int32(c + d)) 2027 v.AddArg(v0) 2028 v.AddArg(x) 2029 return true 2030 } 2031 // match: (Add32 (Const32 <t> [c]) (Add32 x (Const32 <t> [d]))) 2032 // result: (Add32 (Const32 <t> [int64(int32(c+d))]) x) 2033 for { 2034 _ = v.Args[1] 2035 v_0 := v.Args[0] 2036 if v_0.Op != OpConst32 { 2037 break 2038 } 2039 t := v_0.Type 2040 c := v_0.AuxInt 2041 v_1 := v.Args[1] 2042 if v_1.Op != OpAdd32 { 2043 break 2044 } 2045 _ = v_1.Args[1] 2046 x := v_1.Args[0] 2047 v_1_1 := v_1.Args[1] 2048 if v_1_1.Op != OpConst32 || v_1_1.Type != t { 2049 break 2050 } 2051 d := v_1_1.AuxInt 2052 v.reset(OpAdd32) 2053 v0 := b.NewValue0(v.Pos, OpConst32, t) 2054 v0.AuxInt = int64(int32(c + d)) 2055 v.AddArg(v0) 2056 v.AddArg(x) 2057 return true 2058 } 2059 // match: (Add32 (Add32 (Const32 <t> [d]) x) (Const32 <t> [c])) 2060 // result: (Add32 (Const32 <t> [int64(int32(c+d))]) x) 2061 for { 2062 _ = v.Args[1] 2063 v_0 := v.Args[0] 2064 if v_0.Op != OpAdd32 { 2065 break 2066 } 2067 x := v_0.Args[1] 2068 v_0_0 := v_0.Args[0] 2069 if v_0_0.Op != OpConst32 { 2070 break 2071 } 2072 t := v_0_0.Type 2073 d := v_0_0.AuxInt 2074 v_1 := v.Args[1] 2075 if v_1.Op != OpConst32 || v_1.Type != t { 2076 break 2077 } 2078 c := v_1.AuxInt 2079 v.reset(OpAdd32) 2080 v0 := b.NewValue0(v.Pos, OpConst32, t) 2081 v0.AuxInt = int64(int32(c + d)) 2082 v.AddArg(v0) 2083 v.AddArg(x) 2084 return true 2085 } 2086 // match: (Add32 (Add32 x (Const32 <t> [d])) (Const32 <t> [c])) 2087 // result: (Add32 (Const32 <t> [int64(int32(c+d))]) x) 2088 for { 2089 _ = v.Args[1] 2090 v_0 := v.Args[0] 2091 if v_0.Op != OpAdd32 { 2092 break 2093 } 2094 _ = v_0.Args[1] 2095 x := v_0.Args[0] 2096 v_0_1 := v_0.Args[1] 2097 if v_0_1.Op != OpConst32 { 2098 break 2099 } 2100 t := v_0_1.Type 2101 d := v_0_1.AuxInt 2102 v_1 := v.Args[1] 2103 if v_1.Op != OpConst32 || v_1.Type != t { 2104 break 2105 } 2106 c := v_1.AuxInt 2107 v.reset(OpAdd32) 2108 v0 := b.NewValue0(v.Pos, OpConst32, t) 2109 v0.AuxInt = int64(int32(c + d)) 2110 v.AddArg(v0) 2111 v.AddArg(x) 2112 return true 2113 } 2114 return false 2115 } 2116 func rewriteValuegeneric_OpAdd32_30(v *Value) bool { 2117 b := v.Block 2118 // match: (Add32 (Const32 <t> [c]) (Sub32 (Const32 <t> [d]) x)) 2119 // result: (Sub32 (Const32 <t> [int64(int32(c+d))]) x) 2120 for { 2121 _ = v.Args[1] 2122 v_0 := v.Args[0] 2123 if v_0.Op != OpConst32 { 2124 break 2125 } 2126 t := v_0.Type 2127 c := v_0.AuxInt 2128 v_1 := v.Args[1] 2129 if v_1.Op != OpSub32 { 2130 break 2131 } 2132 x := v_1.Args[1] 2133 v_1_0 := v_1.Args[0] 2134 if v_1_0.Op != OpConst32 || v_1_0.Type != t { 2135 break 2136 } 2137 d := v_1_0.AuxInt 2138 v.reset(OpSub32) 2139 v0 := b.NewValue0(v.Pos, OpConst32, t) 2140 v0.AuxInt = int64(int32(c + d)) 2141 v.AddArg(v0) 2142 v.AddArg(x) 2143 return true 2144 } 2145 // match: (Add32 (Sub32 (Const32 <t> [d]) x) (Const32 <t> [c])) 2146 // result: (Sub32 (Const32 <t> [int64(int32(c+d))]) x) 2147 for { 2148 _ = v.Args[1] 2149 v_0 := v.Args[0] 2150 if v_0.Op != OpSub32 { 2151 break 2152 } 2153 x := v_0.Args[1] 2154 v_0_0 := v_0.Args[0] 2155 if v_0_0.Op != OpConst32 { 2156 break 2157 } 2158 t := v_0_0.Type 2159 d := v_0_0.AuxInt 2160 v_1 := v.Args[1] 2161 if v_1.Op != OpConst32 || v_1.Type != t { 2162 break 2163 } 2164 c := v_1.AuxInt 2165 v.reset(OpSub32) 2166 v0 := b.NewValue0(v.Pos, OpConst32, t) 2167 v0.AuxInt = int64(int32(c + d)) 2168 v.AddArg(v0) 2169 v.AddArg(x) 2170 return true 2171 } 2172 // match: (Add32 (Const32 <t> [c]) (Sub32 x (Const32 <t> [d]))) 2173 // result: (Add32 (Const32 <t> [int64(int32(c-d))]) x) 2174 for { 2175 _ = v.Args[1] 2176 v_0 := v.Args[0] 2177 if v_0.Op != OpConst32 { 2178 break 2179 } 2180 t := v_0.Type 2181 c := v_0.AuxInt 2182 v_1 := v.Args[1] 2183 if v_1.Op != OpSub32 { 2184 break 2185 } 2186 _ = v_1.Args[1] 2187 x := v_1.Args[0] 2188 v_1_1 := v_1.Args[1] 2189 if v_1_1.Op != OpConst32 || v_1_1.Type != t { 2190 break 2191 } 2192 d := v_1_1.AuxInt 2193 v.reset(OpAdd32) 2194 v0 := b.NewValue0(v.Pos, OpConst32, t) 2195 v0.AuxInt = int64(int32(c - d)) 2196 v.AddArg(v0) 2197 v.AddArg(x) 2198 return true 2199 } 2200 // match: (Add32 (Sub32 x (Const32 <t> [d])) (Const32 <t> [c])) 2201 // result: (Add32 (Const32 <t> [int64(int32(c-d))]) x) 2202 for { 2203 _ = v.Args[1] 2204 v_0 := v.Args[0] 2205 if v_0.Op != OpSub32 { 2206 break 2207 } 2208 _ = v_0.Args[1] 2209 x := v_0.Args[0] 2210 v_0_1 := v_0.Args[1] 2211 if v_0_1.Op != OpConst32 { 2212 break 2213 } 2214 t := v_0_1.Type 2215 d := v_0_1.AuxInt 2216 v_1 := v.Args[1] 2217 if v_1.Op != OpConst32 || v_1.Type != t { 2218 break 2219 } 2220 c := v_1.AuxInt 2221 v.reset(OpAdd32) 2222 v0 := b.NewValue0(v.Pos, OpConst32, t) 2223 v0.AuxInt = int64(int32(c - d)) 2224 v.AddArg(v0) 2225 v.AddArg(x) 2226 return true 2227 } 2228 return false 2229 } 2230 func rewriteValuegeneric_OpAdd32F_0(v *Value) bool { 2231 // match: (Add32F (Const32F [c]) (Const32F [d])) 2232 // result: (Const32F [auxFrom32F(auxTo32F(c) + auxTo32F(d))]) 2233 for { 2234 _ = v.Args[1] 2235 v_0 := v.Args[0] 2236 if v_0.Op != OpConst32F { 2237 break 2238 } 2239 c := v_0.AuxInt 2240 v_1 := v.Args[1] 2241 if v_1.Op != OpConst32F { 2242 break 2243 } 2244 d := v_1.AuxInt 2245 v.reset(OpConst32F) 2246 v.AuxInt = auxFrom32F(auxTo32F(c) + auxTo32F(d)) 2247 return true 2248 } 2249 // match: (Add32F (Const32F [d]) (Const32F [c])) 2250 // result: (Const32F [auxFrom32F(auxTo32F(c) + auxTo32F(d))]) 2251 for { 2252 _ = v.Args[1] 2253 v_0 := v.Args[0] 2254 if v_0.Op != OpConst32F { 2255 break 2256 } 2257 d := v_0.AuxInt 2258 v_1 := v.Args[1] 2259 if v_1.Op != OpConst32F { 2260 break 2261 } 2262 c := v_1.AuxInt 2263 v.reset(OpConst32F) 2264 v.AuxInt = auxFrom32F(auxTo32F(c) + auxTo32F(d)) 2265 return true 2266 } 2267 return false 2268 } 2269 func rewriteValuegeneric_OpAdd64_0(v *Value) bool { 2270 b := v.Block 2271 // match: (Add64 (Const64 [c]) (Const64 [d])) 2272 // result: (Const64 [c+d]) 2273 for { 2274 _ = v.Args[1] 2275 v_0 := v.Args[0] 2276 if v_0.Op != OpConst64 { 2277 break 2278 } 2279 c := v_0.AuxInt 2280 v_1 := v.Args[1] 2281 if v_1.Op != OpConst64 { 2282 break 2283 } 2284 d := v_1.AuxInt 2285 v.reset(OpConst64) 2286 v.AuxInt = c + d 2287 return true 2288 } 2289 // match: (Add64 (Const64 [d]) (Const64 [c])) 2290 // result: (Const64 [c+d]) 2291 for { 2292 _ = v.Args[1] 2293 v_0 := v.Args[0] 2294 if v_0.Op != OpConst64 { 2295 break 2296 } 2297 d := v_0.AuxInt 2298 v_1 := v.Args[1] 2299 if v_1.Op != OpConst64 { 2300 break 2301 } 2302 c := v_1.AuxInt 2303 v.reset(OpConst64) 2304 v.AuxInt = c + d 2305 return true 2306 } 2307 // match: (Add64 <t> (Mul64 x y) (Mul64 x z)) 2308 // result: (Mul64 x (Add64 <t> y z)) 2309 for { 2310 t := v.Type 2311 _ = v.Args[1] 2312 v_0 := v.Args[0] 2313 if v_0.Op != OpMul64 { 2314 break 2315 } 2316 y := v_0.Args[1] 2317 x := v_0.Args[0] 2318 v_1 := v.Args[1] 2319 if v_1.Op != OpMul64 { 2320 break 2321 } 2322 z := v_1.Args[1] 2323 if x != v_1.Args[0] { 2324 break 2325 } 2326 v.reset(OpMul64) 2327 v.AddArg(x) 2328 v0 := b.NewValue0(v.Pos, OpAdd64, t) 2329 v0.AddArg(y) 2330 v0.AddArg(z) 2331 v.AddArg(v0) 2332 return true 2333 } 2334 // match: (Add64 <t> (Mul64 y x) (Mul64 x z)) 2335 // result: (Mul64 x (Add64 <t> y z)) 2336 for { 2337 t := v.Type 2338 _ = v.Args[1] 2339 v_0 := v.Args[0] 2340 if v_0.Op != OpMul64 { 2341 break 2342 } 2343 x := v_0.Args[1] 2344 y := v_0.Args[0] 2345 v_1 := v.Args[1] 2346 if v_1.Op != OpMul64 { 2347 break 2348 } 2349 z := v_1.Args[1] 2350 if x != v_1.Args[0] { 2351 break 2352 } 2353 v.reset(OpMul64) 2354 v.AddArg(x) 2355 v0 := b.NewValue0(v.Pos, OpAdd64, t) 2356 v0.AddArg(y) 2357 v0.AddArg(z) 2358 v.AddArg(v0) 2359 return true 2360 } 2361 // match: (Add64 <t> (Mul64 x y) (Mul64 z x)) 2362 // result: (Mul64 x (Add64 <t> y z)) 2363 for { 2364 t := v.Type 2365 _ = v.Args[1] 2366 v_0 := v.Args[0] 2367 if v_0.Op != OpMul64 { 2368 break 2369 } 2370 y := v_0.Args[1] 2371 x := v_0.Args[0] 2372 v_1 := v.Args[1] 2373 if v_1.Op != OpMul64 { 2374 break 2375 } 2376 _ = v_1.Args[1] 2377 z := v_1.Args[0] 2378 if x != v_1.Args[1] { 2379 break 2380 } 2381 v.reset(OpMul64) 2382 v.AddArg(x) 2383 v0 := b.NewValue0(v.Pos, OpAdd64, t) 2384 v0.AddArg(y) 2385 v0.AddArg(z) 2386 v.AddArg(v0) 2387 return true 2388 } 2389 // match: (Add64 <t> (Mul64 y x) (Mul64 z x)) 2390 // result: (Mul64 x (Add64 <t> y z)) 2391 for { 2392 t := v.Type 2393 _ = v.Args[1] 2394 v_0 := v.Args[0] 2395 if v_0.Op != OpMul64 { 2396 break 2397 } 2398 x := v_0.Args[1] 2399 y := v_0.Args[0] 2400 v_1 := v.Args[1] 2401 if v_1.Op != OpMul64 { 2402 break 2403 } 2404 _ = v_1.Args[1] 2405 z := v_1.Args[0] 2406 if x != v_1.Args[1] { 2407 break 2408 } 2409 v.reset(OpMul64) 2410 v.AddArg(x) 2411 v0 := b.NewValue0(v.Pos, OpAdd64, t) 2412 v0.AddArg(y) 2413 v0.AddArg(z) 2414 v.AddArg(v0) 2415 return true 2416 } 2417 // match: (Add64 <t> (Mul64 x z) (Mul64 x y)) 2418 // result: (Mul64 x (Add64 <t> y z)) 2419 for { 2420 t := v.Type 2421 _ = v.Args[1] 2422 v_0 := v.Args[0] 2423 if v_0.Op != OpMul64 { 2424 break 2425 } 2426 z := v_0.Args[1] 2427 x := v_0.Args[0] 2428 v_1 := v.Args[1] 2429 if v_1.Op != OpMul64 { 2430 break 2431 } 2432 y := v_1.Args[1] 2433 if x != v_1.Args[0] { 2434 break 2435 } 2436 v.reset(OpMul64) 2437 v.AddArg(x) 2438 v0 := b.NewValue0(v.Pos, OpAdd64, t) 2439 v0.AddArg(y) 2440 v0.AddArg(z) 2441 v.AddArg(v0) 2442 return true 2443 } 2444 // match: (Add64 <t> (Mul64 z x) (Mul64 x y)) 2445 // result: (Mul64 x (Add64 <t> y z)) 2446 for { 2447 t := v.Type 2448 _ = v.Args[1] 2449 v_0 := v.Args[0] 2450 if v_0.Op != OpMul64 { 2451 break 2452 } 2453 x := v_0.Args[1] 2454 z := v_0.Args[0] 2455 v_1 := v.Args[1] 2456 if v_1.Op != OpMul64 { 2457 break 2458 } 2459 y := v_1.Args[1] 2460 if x != v_1.Args[0] { 2461 break 2462 } 2463 v.reset(OpMul64) 2464 v.AddArg(x) 2465 v0 := b.NewValue0(v.Pos, OpAdd64, t) 2466 v0.AddArg(y) 2467 v0.AddArg(z) 2468 v.AddArg(v0) 2469 return true 2470 } 2471 // match: (Add64 <t> (Mul64 x z) (Mul64 y x)) 2472 // result: (Mul64 x (Add64 <t> y z)) 2473 for { 2474 t := v.Type 2475 _ = v.Args[1] 2476 v_0 := v.Args[0] 2477 if v_0.Op != OpMul64 { 2478 break 2479 } 2480 z := v_0.Args[1] 2481 x := v_0.Args[0] 2482 v_1 := v.Args[1] 2483 if v_1.Op != OpMul64 { 2484 break 2485 } 2486 _ = v_1.Args[1] 2487 y := v_1.Args[0] 2488 if x != v_1.Args[1] { 2489 break 2490 } 2491 v.reset(OpMul64) 2492 v.AddArg(x) 2493 v0 := b.NewValue0(v.Pos, OpAdd64, t) 2494 v0.AddArg(y) 2495 v0.AddArg(z) 2496 v.AddArg(v0) 2497 return true 2498 } 2499 // match: (Add64 <t> (Mul64 z x) (Mul64 y x)) 2500 // result: (Mul64 x (Add64 <t> y z)) 2501 for { 2502 t := v.Type 2503 _ = v.Args[1] 2504 v_0 := v.Args[0] 2505 if v_0.Op != OpMul64 { 2506 break 2507 } 2508 x := v_0.Args[1] 2509 z := v_0.Args[0] 2510 v_1 := v.Args[1] 2511 if v_1.Op != OpMul64 { 2512 break 2513 } 2514 _ = v_1.Args[1] 2515 y := v_1.Args[0] 2516 if x != v_1.Args[1] { 2517 break 2518 } 2519 v.reset(OpMul64) 2520 v.AddArg(x) 2521 v0 := b.NewValue0(v.Pos, OpAdd64, t) 2522 v0.AddArg(y) 2523 v0.AddArg(z) 2524 v.AddArg(v0) 2525 return true 2526 } 2527 return false 2528 } 2529 func rewriteValuegeneric_OpAdd64_10(v *Value) bool { 2530 b := v.Block 2531 // match: (Add64 (Const64 [0]) x) 2532 // result: x 2533 for { 2534 x := v.Args[1] 2535 v_0 := v.Args[0] 2536 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 2537 break 2538 } 2539 v.reset(OpCopy) 2540 v.Type = x.Type 2541 v.AddArg(x) 2542 return true 2543 } 2544 // match: (Add64 x (Const64 [0])) 2545 // result: x 2546 for { 2547 _ = v.Args[1] 2548 x := v.Args[0] 2549 v_1 := v.Args[1] 2550 if v_1.Op != OpConst64 || v_1.AuxInt != 0 { 2551 break 2552 } 2553 v.reset(OpCopy) 2554 v.Type = x.Type 2555 v.AddArg(x) 2556 return true 2557 } 2558 // match: (Add64 (Const64 [1]) (Com64 x)) 2559 // result: (Neg64 x) 2560 for { 2561 _ = v.Args[1] 2562 v_0 := v.Args[0] 2563 if v_0.Op != OpConst64 || v_0.AuxInt != 1 { 2564 break 2565 } 2566 v_1 := v.Args[1] 2567 if v_1.Op != OpCom64 { 2568 break 2569 } 2570 x := v_1.Args[0] 2571 v.reset(OpNeg64) 2572 v.AddArg(x) 2573 return true 2574 } 2575 // match: (Add64 (Com64 x) (Const64 [1])) 2576 // result: (Neg64 x) 2577 for { 2578 _ = v.Args[1] 2579 v_0 := v.Args[0] 2580 if v_0.Op != OpCom64 { 2581 break 2582 } 2583 x := v_0.Args[0] 2584 v_1 := v.Args[1] 2585 if v_1.Op != OpConst64 || v_1.AuxInt != 1 { 2586 break 2587 } 2588 v.reset(OpNeg64) 2589 v.AddArg(x) 2590 return true 2591 } 2592 // match: (Add64 (Add64 i:(Const64 <t>) z) x) 2593 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 2594 // result: (Add64 i (Add64 <t> z x)) 2595 for { 2596 x := v.Args[1] 2597 v_0 := v.Args[0] 2598 if v_0.Op != OpAdd64 { 2599 break 2600 } 2601 z := v_0.Args[1] 2602 i := v_0.Args[0] 2603 if i.Op != OpConst64 { 2604 break 2605 } 2606 t := i.Type 2607 if !(z.Op != OpConst64 && x.Op != OpConst64) { 2608 break 2609 } 2610 v.reset(OpAdd64) 2611 v.AddArg(i) 2612 v0 := b.NewValue0(v.Pos, OpAdd64, t) 2613 v0.AddArg(z) 2614 v0.AddArg(x) 2615 v.AddArg(v0) 2616 return true 2617 } 2618 // match: (Add64 (Add64 z i:(Const64 <t>)) x) 2619 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 2620 // result: (Add64 i (Add64 <t> z x)) 2621 for { 2622 x := v.Args[1] 2623 v_0 := v.Args[0] 2624 if v_0.Op != OpAdd64 { 2625 break 2626 } 2627 _ = v_0.Args[1] 2628 z := v_0.Args[0] 2629 i := v_0.Args[1] 2630 if i.Op != OpConst64 { 2631 break 2632 } 2633 t := i.Type 2634 if !(z.Op != OpConst64 && x.Op != OpConst64) { 2635 break 2636 } 2637 v.reset(OpAdd64) 2638 v.AddArg(i) 2639 v0 := b.NewValue0(v.Pos, OpAdd64, t) 2640 v0.AddArg(z) 2641 v0.AddArg(x) 2642 v.AddArg(v0) 2643 return true 2644 } 2645 // match: (Add64 x (Add64 i:(Const64 <t>) z)) 2646 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 2647 // result: (Add64 i (Add64 <t> z x)) 2648 for { 2649 _ = v.Args[1] 2650 x := v.Args[0] 2651 v_1 := v.Args[1] 2652 if v_1.Op != OpAdd64 { 2653 break 2654 } 2655 z := v_1.Args[1] 2656 i := v_1.Args[0] 2657 if i.Op != OpConst64 { 2658 break 2659 } 2660 t := i.Type 2661 if !(z.Op != OpConst64 && x.Op != OpConst64) { 2662 break 2663 } 2664 v.reset(OpAdd64) 2665 v.AddArg(i) 2666 v0 := b.NewValue0(v.Pos, OpAdd64, t) 2667 v0.AddArg(z) 2668 v0.AddArg(x) 2669 v.AddArg(v0) 2670 return true 2671 } 2672 // match: (Add64 x (Add64 z i:(Const64 <t>))) 2673 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 2674 // result: (Add64 i (Add64 <t> z x)) 2675 for { 2676 _ = v.Args[1] 2677 x := v.Args[0] 2678 v_1 := v.Args[1] 2679 if v_1.Op != OpAdd64 { 2680 break 2681 } 2682 _ = v_1.Args[1] 2683 z := v_1.Args[0] 2684 i := v_1.Args[1] 2685 if i.Op != OpConst64 { 2686 break 2687 } 2688 t := i.Type 2689 if !(z.Op != OpConst64 && x.Op != OpConst64) { 2690 break 2691 } 2692 v.reset(OpAdd64) 2693 v.AddArg(i) 2694 v0 := b.NewValue0(v.Pos, OpAdd64, t) 2695 v0.AddArg(z) 2696 v0.AddArg(x) 2697 v.AddArg(v0) 2698 return true 2699 } 2700 // match: (Add64 (Sub64 i:(Const64 <t>) z) x) 2701 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 2702 // result: (Add64 i (Sub64 <t> x z)) 2703 for { 2704 x := v.Args[1] 2705 v_0 := v.Args[0] 2706 if v_0.Op != OpSub64 { 2707 break 2708 } 2709 z := v_0.Args[1] 2710 i := v_0.Args[0] 2711 if i.Op != OpConst64 { 2712 break 2713 } 2714 t := i.Type 2715 if !(z.Op != OpConst64 && x.Op != OpConst64) { 2716 break 2717 } 2718 v.reset(OpAdd64) 2719 v.AddArg(i) 2720 v0 := b.NewValue0(v.Pos, OpSub64, t) 2721 v0.AddArg(x) 2722 v0.AddArg(z) 2723 v.AddArg(v0) 2724 return true 2725 } 2726 // match: (Add64 x (Sub64 i:(Const64 <t>) z)) 2727 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 2728 // result: (Add64 i (Sub64 <t> x z)) 2729 for { 2730 _ = v.Args[1] 2731 x := v.Args[0] 2732 v_1 := v.Args[1] 2733 if v_1.Op != OpSub64 { 2734 break 2735 } 2736 z := v_1.Args[1] 2737 i := v_1.Args[0] 2738 if i.Op != OpConst64 { 2739 break 2740 } 2741 t := i.Type 2742 if !(z.Op != OpConst64 && x.Op != OpConst64) { 2743 break 2744 } 2745 v.reset(OpAdd64) 2746 v.AddArg(i) 2747 v0 := b.NewValue0(v.Pos, OpSub64, t) 2748 v0.AddArg(x) 2749 v0.AddArg(z) 2750 v.AddArg(v0) 2751 return true 2752 } 2753 return false 2754 } 2755 func rewriteValuegeneric_OpAdd64_20(v *Value) bool { 2756 b := v.Block 2757 // match: (Add64 x (Sub64 i:(Const64 <t>) z)) 2758 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 2759 // result: (Add64 i (Sub64 <t> x z)) 2760 for { 2761 _ = v.Args[1] 2762 x := v.Args[0] 2763 v_1 := v.Args[1] 2764 if v_1.Op != OpSub64 { 2765 break 2766 } 2767 z := v_1.Args[1] 2768 i := v_1.Args[0] 2769 if i.Op != OpConst64 { 2770 break 2771 } 2772 t := i.Type 2773 if !(z.Op != OpConst64 && x.Op != OpConst64) { 2774 break 2775 } 2776 v.reset(OpAdd64) 2777 v.AddArg(i) 2778 v0 := b.NewValue0(v.Pos, OpSub64, t) 2779 v0.AddArg(x) 2780 v0.AddArg(z) 2781 v.AddArg(v0) 2782 return true 2783 } 2784 // match: (Add64 (Sub64 i:(Const64 <t>) z) x) 2785 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 2786 // result: (Add64 i (Sub64 <t> x z)) 2787 for { 2788 x := v.Args[1] 2789 v_0 := v.Args[0] 2790 if v_0.Op != OpSub64 { 2791 break 2792 } 2793 z := v_0.Args[1] 2794 i := v_0.Args[0] 2795 if i.Op != OpConst64 { 2796 break 2797 } 2798 t := i.Type 2799 if !(z.Op != OpConst64 && x.Op != OpConst64) { 2800 break 2801 } 2802 v.reset(OpAdd64) 2803 v.AddArg(i) 2804 v0 := b.NewValue0(v.Pos, OpSub64, t) 2805 v0.AddArg(x) 2806 v0.AddArg(z) 2807 v.AddArg(v0) 2808 return true 2809 } 2810 // match: (Add64 (Sub64 z i:(Const64 <t>)) x) 2811 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 2812 // result: (Sub64 (Add64 <t> x z) i) 2813 for { 2814 x := v.Args[1] 2815 v_0 := v.Args[0] 2816 if v_0.Op != OpSub64 { 2817 break 2818 } 2819 _ = v_0.Args[1] 2820 z := v_0.Args[0] 2821 i := v_0.Args[1] 2822 if i.Op != OpConst64 { 2823 break 2824 } 2825 t := i.Type 2826 if !(z.Op != OpConst64 && x.Op != OpConst64) { 2827 break 2828 } 2829 v.reset(OpSub64) 2830 v0 := b.NewValue0(v.Pos, OpAdd64, t) 2831 v0.AddArg(x) 2832 v0.AddArg(z) 2833 v.AddArg(v0) 2834 v.AddArg(i) 2835 return true 2836 } 2837 // match: (Add64 x (Sub64 z i:(Const64 <t>))) 2838 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 2839 // result: (Sub64 (Add64 <t> x z) i) 2840 for { 2841 _ = v.Args[1] 2842 x := v.Args[0] 2843 v_1 := v.Args[1] 2844 if v_1.Op != OpSub64 { 2845 break 2846 } 2847 _ = v_1.Args[1] 2848 z := v_1.Args[0] 2849 i := v_1.Args[1] 2850 if i.Op != OpConst64 { 2851 break 2852 } 2853 t := i.Type 2854 if !(z.Op != OpConst64 && x.Op != OpConst64) { 2855 break 2856 } 2857 v.reset(OpSub64) 2858 v0 := b.NewValue0(v.Pos, OpAdd64, t) 2859 v0.AddArg(x) 2860 v0.AddArg(z) 2861 v.AddArg(v0) 2862 v.AddArg(i) 2863 return true 2864 } 2865 // match: (Add64 x (Sub64 z i:(Const64 <t>))) 2866 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 2867 // result: (Sub64 (Add64 <t> x z) i) 2868 for { 2869 _ = v.Args[1] 2870 x := v.Args[0] 2871 v_1 := v.Args[1] 2872 if v_1.Op != OpSub64 { 2873 break 2874 } 2875 _ = v_1.Args[1] 2876 z := v_1.Args[0] 2877 i := v_1.Args[1] 2878 if i.Op != OpConst64 { 2879 break 2880 } 2881 t := i.Type 2882 if !(z.Op != OpConst64 && x.Op != OpConst64) { 2883 break 2884 } 2885 v.reset(OpSub64) 2886 v0 := b.NewValue0(v.Pos, OpAdd64, t) 2887 v0.AddArg(x) 2888 v0.AddArg(z) 2889 v.AddArg(v0) 2890 v.AddArg(i) 2891 return true 2892 } 2893 // match: (Add64 (Sub64 z i:(Const64 <t>)) x) 2894 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 2895 // result: (Sub64 (Add64 <t> x z) i) 2896 for { 2897 x := v.Args[1] 2898 v_0 := v.Args[0] 2899 if v_0.Op != OpSub64 { 2900 break 2901 } 2902 _ = v_0.Args[1] 2903 z := v_0.Args[0] 2904 i := v_0.Args[1] 2905 if i.Op != OpConst64 { 2906 break 2907 } 2908 t := i.Type 2909 if !(z.Op != OpConst64 && x.Op != OpConst64) { 2910 break 2911 } 2912 v.reset(OpSub64) 2913 v0 := b.NewValue0(v.Pos, OpAdd64, t) 2914 v0.AddArg(x) 2915 v0.AddArg(z) 2916 v.AddArg(v0) 2917 v.AddArg(i) 2918 return true 2919 } 2920 // match: (Add64 (Const64 <t> [c]) (Add64 (Const64 <t> [d]) x)) 2921 // result: (Add64 (Const64 <t> [c+d]) x) 2922 for { 2923 _ = v.Args[1] 2924 v_0 := v.Args[0] 2925 if v_0.Op != OpConst64 { 2926 break 2927 } 2928 t := v_0.Type 2929 c := v_0.AuxInt 2930 v_1 := v.Args[1] 2931 if v_1.Op != OpAdd64 { 2932 break 2933 } 2934 x := v_1.Args[1] 2935 v_1_0 := v_1.Args[0] 2936 if v_1_0.Op != OpConst64 || v_1_0.Type != t { 2937 break 2938 } 2939 d := v_1_0.AuxInt 2940 v.reset(OpAdd64) 2941 v0 := b.NewValue0(v.Pos, OpConst64, t) 2942 v0.AuxInt = c + d 2943 v.AddArg(v0) 2944 v.AddArg(x) 2945 return true 2946 } 2947 // match: (Add64 (Const64 <t> [c]) (Add64 x (Const64 <t> [d]))) 2948 // result: (Add64 (Const64 <t> [c+d]) x) 2949 for { 2950 _ = v.Args[1] 2951 v_0 := v.Args[0] 2952 if v_0.Op != OpConst64 { 2953 break 2954 } 2955 t := v_0.Type 2956 c := v_0.AuxInt 2957 v_1 := v.Args[1] 2958 if v_1.Op != OpAdd64 { 2959 break 2960 } 2961 _ = v_1.Args[1] 2962 x := v_1.Args[0] 2963 v_1_1 := v_1.Args[1] 2964 if v_1_1.Op != OpConst64 || v_1_1.Type != t { 2965 break 2966 } 2967 d := v_1_1.AuxInt 2968 v.reset(OpAdd64) 2969 v0 := b.NewValue0(v.Pos, OpConst64, t) 2970 v0.AuxInt = c + d 2971 v.AddArg(v0) 2972 v.AddArg(x) 2973 return true 2974 } 2975 // match: (Add64 (Add64 (Const64 <t> [d]) x) (Const64 <t> [c])) 2976 // result: (Add64 (Const64 <t> [c+d]) x) 2977 for { 2978 _ = v.Args[1] 2979 v_0 := v.Args[0] 2980 if v_0.Op != OpAdd64 { 2981 break 2982 } 2983 x := v_0.Args[1] 2984 v_0_0 := v_0.Args[0] 2985 if v_0_0.Op != OpConst64 { 2986 break 2987 } 2988 t := v_0_0.Type 2989 d := v_0_0.AuxInt 2990 v_1 := v.Args[1] 2991 if v_1.Op != OpConst64 || v_1.Type != t { 2992 break 2993 } 2994 c := v_1.AuxInt 2995 v.reset(OpAdd64) 2996 v0 := b.NewValue0(v.Pos, OpConst64, t) 2997 v0.AuxInt = c + d 2998 v.AddArg(v0) 2999 v.AddArg(x) 3000 return true 3001 } 3002 // match: (Add64 (Add64 x (Const64 <t> [d])) (Const64 <t> [c])) 3003 // result: (Add64 (Const64 <t> [c+d]) x) 3004 for { 3005 _ = v.Args[1] 3006 v_0 := v.Args[0] 3007 if v_0.Op != OpAdd64 { 3008 break 3009 } 3010 _ = v_0.Args[1] 3011 x := v_0.Args[0] 3012 v_0_1 := v_0.Args[1] 3013 if v_0_1.Op != OpConst64 { 3014 break 3015 } 3016 t := v_0_1.Type 3017 d := v_0_1.AuxInt 3018 v_1 := v.Args[1] 3019 if v_1.Op != OpConst64 || v_1.Type != t { 3020 break 3021 } 3022 c := v_1.AuxInt 3023 v.reset(OpAdd64) 3024 v0 := b.NewValue0(v.Pos, OpConst64, t) 3025 v0.AuxInt = c + d 3026 v.AddArg(v0) 3027 v.AddArg(x) 3028 return true 3029 } 3030 return false 3031 } 3032 func rewriteValuegeneric_OpAdd64_30(v *Value) bool { 3033 b := v.Block 3034 // match: (Add64 (Const64 <t> [c]) (Sub64 (Const64 <t> [d]) x)) 3035 // result: (Sub64 (Const64 <t> [c+d]) x) 3036 for { 3037 _ = v.Args[1] 3038 v_0 := v.Args[0] 3039 if v_0.Op != OpConst64 { 3040 break 3041 } 3042 t := v_0.Type 3043 c := v_0.AuxInt 3044 v_1 := v.Args[1] 3045 if v_1.Op != OpSub64 { 3046 break 3047 } 3048 x := v_1.Args[1] 3049 v_1_0 := v_1.Args[0] 3050 if v_1_0.Op != OpConst64 || v_1_0.Type != t { 3051 break 3052 } 3053 d := v_1_0.AuxInt 3054 v.reset(OpSub64) 3055 v0 := b.NewValue0(v.Pos, OpConst64, t) 3056 v0.AuxInt = c + d 3057 v.AddArg(v0) 3058 v.AddArg(x) 3059 return true 3060 } 3061 // match: (Add64 (Sub64 (Const64 <t> [d]) x) (Const64 <t> [c])) 3062 // result: (Sub64 (Const64 <t> [c+d]) x) 3063 for { 3064 _ = v.Args[1] 3065 v_0 := v.Args[0] 3066 if v_0.Op != OpSub64 { 3067 break 3068 } 3069 x := v_0.Args[1] 3070 v_0_0 := v_0.Args[0] 3071 if v_0_0.Op != OpConst64 { 3072 break 3073 } 3074 t := v_0_0.Type 3075 d := v_0_0.AuxInt 3076 v_1 := v.Args[1] 3077 if v_1.Op != OpConst64 || v_1.Type != t { 3078 break 3079 } 3080 c := v_1.AuxInt 3081 v.reset(OpSub64) 3082 v0 := b.NewValue0(v.Pos, OpConst64, t) 3083 v0.AuxInt = c + d 3084 v.AddArg(v0) 3085 v.AddArg(x) 3086 return true 3087 } 3088 // match: (Add64 (Const64 <t> [c]) (Sub64 x (Const64 <t> [d]))) 3089 // result: (Add64 (Const64 <t> [c-d]) x) 3090 for { 3091 _ = v.Args[1] 3092 v_0 := v.Args[0] 3093 if v_0.Op != OpConst64 { 3094 break 3095 } 3096 t := v_0.Type 3097 c := v_0.AuxInt 3098 v_1 := v.Args[1] 3099 if v_1.Op != OpSub64 { 3100 break 3101 } 3102 _ = v_1.Args[1] 3103 x := v_1.Args[0] 3104 v_1_1 := v_1.Args[1] 3105 if v_1_1.Op != OpConst64 || v_1_1.Type != t { 3106 break 3107 } 3108 d := v_1_1.AuxInt 3109 v.reset(OpAdd64) 3110 v0 := b.NewValue0(v.Pos, OpConst64, t) 3111 v0.AuxInt = c - d 3112 v.AddArg(v0) 3113 v.AddArg(x) 3114 return true 3115 } 3116 // match: (Add64 (Sub64 x (Const64 <t> [d])) (Const64 <t> [c])) 3117 // result: (Add64 (Const64 <t> [c-d]) x) 3118 for { 3119 _ = v.Args[1] 3120 v_0 := v.Args[0] 3121 if v_0.Op != OpSub64 { 3122 break 3123 } 3124 _ = v_0.Args[1] 3125 x := v_0.Args[0] 3126 v_0_1 := v_0.Args[1] 3127 if v_0_1.Op != OpConst64 { 3128 break 3129 } 3130 t := v_0_1.Type 3131 d := v_0_1.AuxInt 3132 v_1 := v.Args[1] 3133 if v_1.Op != OpConst64 || v_1.Type != t { 3134 break 3135 } 3136 c := v_1.AuxInt 3137 v.reset(OpAdd64) 3138 v0 := b.NewValue0(v.Pos, OpConst64, t) 3139 v0.AuxInt = c - d 3140 v.AddArg(v0) 3141 v.AddArg(x) 3142 return true 3143 } 3144 return false 3145 } 3146 func rewriteValuegeneric_OpAdd64F_0(v *Value) bool { 3147 // match: (Add64F (Const64F [c]) (Const64F [d])) 3148 // result: (Const64F [auxFrom64F(auxTo64F(c) + auxTo64F(d))]) 3149 for { 3150 _ = v.Args[1] 3151 v_0 := v.Args[0] 3152 if v_0.Op != OpConst64F { 3153 break 3154 } 3155 c := v_0.AuxInt 3156 v_1 := v.Args[1] 3157 if v_1.Op != OpConst64F { 3158 break 3159 } 3160 d := v_1.AuxInt 3161 v.reset(OpConst64F) 3162 v.AuxInt = auxFrom64F(auxTo64F(c) + auxTo64F(d)) 3163 return true 3164 } 3165 // match: (Add64F (Const64F [d]) (Const64F [c])) 3166 // result: (Const64F [auxFrom64F(auxTo64F(c) + auxTo64F(d))]) 3167 for { 3168 _ = v.Args[1] 3169 v_0 := v.Args[0] 3170 if v_0.Op != OpConst64F { 3171 break 3172 } 3173 d := v_0.AuxInt 3174 v_1 := v.Args[1] 3175 if v_1.Op != OpConst64F { 3176 break 3177 } 3178 c := v_1.AuxInt 3179 v.reset(OpConst64F) 3180 v.AuxInt = auxFrom64F(auxTo64F(c) + auxTo64F(d)) 3181 return true 3182 } 3183 return false 3184 } 3185 func rewriteValuegeneric_OpAdd8_0(v *Value) bool { 3186 b := v.Block 3187 // match: (Add8 (Const8 [c]) (Const8 [d])) 3188 // result: (Const8 [int64(int8(c+d))]) 3189 for { 3190 _ = v.Args[1] 3191 v_0 := v.Args[0] 3192 if v_0.Op != OpConst8 { 3193 break 3194 } 3195 c := v_0.AuxInt 3196 v_1 := v.Args[1] 3197 if v_1.Op != OpConst8 { 3198 break 3199 } 3200 d := v_1.AuxInt 3201 v.reset(OpConst8) 3202 v.AuxInt = int64(int8(c + d)) 3203 return true 3204 } 3205 // match: (Add8 (Const8 [d]) (Const8 [c])) 3206 // result: (Const8 [int64(int8(c+d))]) 3207 for { 3208 _ = v.Args[1] 3209 v_0 := v.Args[0] 3210 if v_0.Op != OpConst8 { 3211 break 3212 } 3213 d := v_0.AuxInt 3214 v_1 := v.Args[1] 3215 if v_1.Op != OpConst8 { 3216 break 3217 } 3218 c := v_1.AuxInt 3219 v.reset(OpConst8) 3220 v.AuxInt = int64(int8(c + d)) 3221 return true 3222 } 3223 // match: (Add8 <t> (Mul8 x y) (Mul8 x z)) 3224 // result: (Mul8 x (Add8 <t> y z)) 3225 for { 3226 t := v.Type 3227 _ = v.Args[1] 3228 v_0 := v.Args[0] 3229 if v_0.Op != OpMul8 { 3230 break 3231 } 3232 y := v_0.Args[1] 3233 x := v_0.Args[0] 3234 v_1 := v.Args[1] 3235 if v_1.Op != OpMul8 { 3236 break 3237 } 3238 z := v_1.Args[1] 3239 if x != v_1.Args[0] { 3240 break 3241 } 3242 v.reset(OpMul8) 3243 v.AddArg(x) 3244 v0 := b.NewValue0(v.Pos, OpAdd8, t) 3245 v0.AddArg(y) 3246 v0.AddArg(z) 3247 v.AddArg(v0) 3248 return true 3249 } 3250 // match: (Add8 <t> (Mul8 y x) (Mul8 x z)) 3251 // result: (Mul8 x (Add8 <t> y z)) 3252 for { 3253 t := v.Type 3254 _ = v.Args[1] 3255 v_0 := v.Args[0] 3256 if v_0.Op != OpMul8 { 3257 break 3258 } 3259 x := v_0.Args[1] 3260 y := v_0.Args[0] 3261 v_1 := v.Args[1] 3262 if v_1.Op != OpMul8 { 3263 break 3264 } 3265 z := v_1.Args[1] 3266 if x != v_1.Args[0] { 3267 break 3268 } 3269 v.reset(OpMul8) 3270 v.AddArg(x) 3271 v0 := b.NewValue0(v.Pos, OpAdd8, t) 3272 v0.AddArg(y) 3273 v0.AddArg(z) 3274 v.AddArg(v0) 3275 return true 3276 } 3277 // match: (Add8 <t> (Mul8 x y) (Mul8 z x)) 3278 // result: (Mul8 x (Add8 <t> y z)) 3279 for { 3280 t := v.Type 3281 _ = v.Args[1] 3282 v_0 := v.Args[0] 3283 if v_0.Op != OpMul8 { 3284 break 3285 } 3286 y := v_0.Args[1] 3287 x := v_0.Args[0] 3288 v_1 := v.Args[1] 3289 if v_1.Op != OpMul8 { 3290 break 3291 } 3292 _ = v_1.Args[1] 3293 z := v_1.Args[0] 3294 if x != v_1.Args[1] { 3295 break 3296 } 3297 v.reset(OpMul8) 3298 v.AddArg(x) 3299 v0 := b.NewValue0(v.Pos, OpAdd8, t) 3300 v0.AddArg(y) 3301 v0.AddArg(z) 3302 v.AddArg(v0) 3303 return true 3304 } 3305 // match: (Add8 <t> (Mul8 y x) (Mul8 z x)) 3306 // result: (Mul8 x (Add8 <t> y z)) 3307 for { 3308 t := v.Type 3309 _ = v.Args[1] 3310 v_0 := v.Args[0] 3311 if v_0.Op != OpMul8 { 3312 break 3313 } 3314 x := v_0.Args[1] 3315 y := v_0.Args[0] 3316 v_1 := v.Args[1] 3317 if v_1.Op != OpMul8 { 3318 break 3319 } 3320 _ = v_1.Args[1] 3321 z := v_1.Args[0] 3322 if x != v_1.Args[1] { 3323 break 3324 } 3325 v.reset(OpMul8) 3326 v.AddArg(x) 3327 v0 := b.NewValue0(v.Pos, OpAdd8, t) 3328 v0.AddArg(y) 3329 v0.AddArg(z) 3330 v.AddArg(v0) 3331 return true 3332 } 3333 // match: (Add8 <t> (Mul8 x z) (Mul8 x y)) 3334 // result: (Mul8 x (Add8 <t> y z)) 3335 for { 3336 t := v.Type 3337 _ = v.Args[1] 3338 v_0 := v.Args[0] 3339 if v_0.Op != OpMul8 { 3340 break 3341 } 3342 z := v_0.Args[1] 3343 x := v_0.Args[0] 3344 v_1 := v.Args[1] 3345 if v_1.Op != OpMul8 { 3346 break 3347 } 3348 y := v_1.Args[1] 3349 if x != v_1.Args[0] { 3350 break 3351 } 3352 v.reset(OpMul8) 3353 v.AddArg(x) 3354 v0 := b.NewValue0(v.Pos, OpAdd8, t) 3355 v0.AddArg(y) 3356 v0.AddArg(z) 3357 v.AddArg(v0) 3358 return true 3359 } 3360 // match: (Add8 <t> (Mul8 z x) (Mul8 x y)) 3361 // result: (Mul8 x (Add8 <t> y z)) 3362 for { 3363 t := v.Type 3364 _ = v.Args[1] 3365 v_0 := v.Args[0] 3366 if v_0.Op != OpMul8 { 3367 break 3368 } 3369 x := v_0.Args[1] 3370 z := v_0.Args[0] 3371 v_1 := v.Args[1] 3372 if v_1.Op != OpMul8 { 3373 break 3374 } 3375 y := v_1.Args[1] 3376 if x != v_1.Args[0] { 3377 break 3378 } 3379 v.reset(OpMul8) 3380 v.AddArg(x) 3381 v0 := b.NewValue0(v.Pos, OpAdd8, t) 3382 v0.AddArg(y) 3383 v0.AddArg(z) 3384 v.AddArg(v0) 3385 return true 3386 } 3387 // match: (Add8 <t> (Mul8 x z) (Mul8 y x)) 3388 // result: (Mul8 x (Add8 <t> y z)) 3389 for { 3390 t := v.Type 3391 _ = v.Args[1] 3392 v_0 := v.Args[0] 3393 if v_0.Op != OpMul8 { 3394 break 3395 } 3396 z := v_0.Args[1] 3397 x := v_0.Args[0] 3398 v_1 := v.Args[1] 3399 if v_1.Op != OpMul8 { 3400 break 3401 } 3402 _ = v_1.Args[1] 3403 y := v_1.Args[0] 3404 if x != v_1.Args[1] { 3405 break 3406 } 3407 v.reset(OpMul8) 3408 v.AddArg(x) 3409 v0 := b.NewValue0(v.Pos, OpAdd8, t) 3410 v0.AddArg(y) 3411 v0.AddArg(z) 3412 v.AddArg(v0) 3413 return true 3414 } 3415 // match: (Add8 <t> (Mul8 z x) (Mul8 y x)) 3416 // result: (Mul8 x (Add8 <t> y z)) 3417 for { 3418 t := v.Type 3419 _ = v.Args[1] 3420 v_0 := v.Args[0] 3421 if v_0.Op != OpMul8 { 3422 break 3423 } 3424 x := v_0.Args[1] 3425 z := v_0.Args[0] 3426 v_1 := v.Args[1] 3427 if v_1.Op != OpMul8 { 3428 break 3429 } 3430 _ = v_1.Args[1] 3431 y := v_1.Args[0] 3432 if x != v_1.Args[1] { 3433 break 3434 } 3435 v.reset(OpMul8) 3436 v.AddArg(x) 3437 v0 := b.NewValue0(v.Pos, OpAdd8, t) 3438 v0.AddArg(y) 3439 v0.AddArg(z) 3440 v.AddArg(v0) 3441 return true 3442 } 3443 return false 3444 } 3445 func rewriteValuegeneric_OpAdd8_10(v *Value) bool { 3446 b := v.Block 3447 // match: (Add8 (Const8 [0]) x) 3448 // result: x 3449 for { 3450 x := v.Args[1] 3451 v_0 := v.Args[0] 3452 if v_0.Op != OpConst8 || v_0.AuxInt != 0 { 3453 break 3454 } 3455 v.reset(OpCopy) 3456 v.Type = x.Type 3457 v.AddArg(x) 3458 return true 3459 } 3460 // match: (Add8 x (Const8 [0])) 3461 // result: x 3462 for { 3463 _ = v.Args[1] 3464 x := v.Args[0] 3465 v_1 := v.Args[1] 3466 if v_1.Op != OpConst8 || v_1.AuxInt != 0 { 3467 break 3468 } 3469 v.reset(OpCopy) 3470 v.Type = x.Type 3471 v.AddArg(x) 3472 return true 3473 } 3474 // match: (Add8 (Const8 [1]) (Com8 x)) 3475 // result: (Neg8 x) 3476 for { 3477 _ = v.Args[1] 3478 v_0 := v.Args[0] 3479 if v_0.Op != OpConst8 || v_0.AuxInt != 1 { 3480 break 3481 } 3482 v_1 := v.Args[1] 3483 if v_1.Op != OpCom8 { 3484 break 3485 } 3486 x := v_1.Args[0] 3487 v.reset(OpNeg8) 3488 v.AddArg(x) 3489 return true 3490 } 3491 // match: (Add8 (Com8 x) (Const8 [1])) 3492 // result: (Neg8 x) 3493 for { 3494 _ = v.Args[1] 3495 v_0 := v.Args[0] 3496 if v_0.Op != OpCom8 { 3497 break 3498 } 3499 x := v_0.Args[0] 3500 v_1 := v.Args[1] 3501 if v_1.Op != OpConst8 || v_1.AuxInt != 1 { 3502 break 3503 } 3504 v.reset(OpNeg8) 3505 v.AddArg(x) 3506 return true 3507 } 3508 // match: (Add8 (Add8 i:(Const8 <t>) z) x) 3509 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 3510 // result: (Add8 i (Add8 <t> z x)) 3511 for { 3512 x := v.Args[1] 3513 v_0 := v.Args[0] 3514 if v_0.Op != OpAdd8 { 3515 break 3516 } 3517 z := v_0.Args[1] 3518 i := v_0.Args[0] 3519 if i.Op != OpConst8 { 3520 break 3521 } 3522 t := i.Type 3523 if !(z.Op != OpConst8 && x.Op != OpConst8) { 3524 break 3525 } 3526 v.reset(OpAdd8) 3527 v.AddArg(i) 3528 v0 := b.NewValue0(v.Pos, OpAdd8, t) 3529 v0.AddArg(z) 3530 v0.AddArg(x) 3531 v.AddArg(v0) 3532 return true 3533 } 3534 // match: (Add8 (Add8 z i:(Const8 <t>)) x) 3535 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 3536 // result: (Add8 i (Add8 <t> z x)) 3537 for { 3538 x := v.Args[1] 3539 v_0 := v.Args[0] 3540 if v_0.Op != OpAdd8 { 3541 break 3542 } 3543 _ = v_0.Args[1] 3544 z := v_0.Args[0] 3545 i := v_0.Args[1] 3546 if i.Op != OpConst8 { 3547 break 3548 } 3549 t := i.Type 3550 if !(z.Op != OpConst8 && x.Op != OpConst8) { 3551 break 3552 } 3553 v.reset(OpAdd8) 3554 v.AddArg(i) 3555 v0 := b.NewValue0(v.Pos, OpAdd8, t) 3556 v0.AddArg(z) 3557 v0.AddArg(x) 3558 v.AddArg(v0) 3559 return true 3560 } 3561 // match: (Add8 x (Add8 i:(Const8 <t>) z)) 3562 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 3563 // result: (Add8 i (Add8 <t> z x)) 3564 for { 3565 _ = v.Args[1] 3566 x := v.Args[0] 3567 v_1 := v.Args[1] 3568 if v_1.Op != OpAdd8 { 3569 break 3570 } 3571 z := v_1.Args[1] 3572 i := v_1.Args[0] 3573 if i.Op != OpConst8 { 3574 break 3575 } 3576 t := i.Type 3577 if !(z.Op != OpConst8 && x.Op != OpConst8) { 3578 break 3579 } 3580 v.reset(OpAdd8) 3581 v.AddArg(i) 3582 v0 := b.NewValue0(v.Pos, OpAdd8, t) 3583 v0.AddArg(z) 3584 v0.AddArg(x) 3585 v.AddArg(v0) 3586 return true 3587 } 3588 // match: (Add8 x (Add8 z i:(Const8 <t>))) 3589 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 3590 // result: (Add8 i (Add8 <t> z x)) 3591 for { 3592 _ = v.Args[1] 3593 x := v.Args[0] 3594 v_1 := v.Args[1] 3595 if v_1.Op != OpAdd8 { 3596 break 3597 } 3598 _ = v_1.Args[1] 3599 z := v_1.Args[0] 3600 i := v_1.Args[1] 3601 if i.Op != OpConst8 { 3602 break 3603 } 3604 t := i.Type 3605 if !(z.Op != OpConst8 && x.Op != OpConst8) { 3606 break 3607 } 3608 v.reset(OpAdd8) 3609 v.AddArg(i) 3610 v0 := b.NewValue0(v.Pos, OpAdd8, t) 3611 v0.AddArg(z) 3612 v0.AddArg(x) 3613 v.AddArg(v0) 3614 return true 3615 } 3616 // match: (Add8 (Sub8 i:(Const8 <t>) z) x) 3617 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 3618 // result: (Add8 i (Sub8 <t> x z)) 3619 for { 3620 x := v.Args[1] 3621 v_0 := v.Args[0] 3622 if v_0.Op != OpSub8 { 3623 break 3624 } 3625 z := v_0.Args[1] 3626 i := v_0.Args[0] 3627 if i.Op != OpConst8 { 3628 break 3629 } 3630 t := i.Type 3631 if !(z.Op != OpConst8 && x.Op != OpConst8) { 3632 break 3633 } 3634 v.reset(OpAdd8) 3635 v.AddArg(i) 3636 v0 := b.NewValue0(v.Pos, OpSub8, t) 3637 v0.AddArg(x) 3638 v0.AddArg(z) 3639 v.AddArg(v0) 3640 return true 3641 } 3642 // match: (Add8 x (Sub8 i:(Const8 <t>) z)) 3643 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 3644 // result: (Add8 i (Sub8 <t> x z)) 3645 for { 3646 _ = v.Args[1] 3647 x := v.Args[0] 3648 v_1 := v.Args[1] 3649 if v_1.Op != OpSub8 { 3650 break 3651 } 3652 z := v_1.Args[1] 3653 i := v_1.Args[0] 3654 if i.Op != OpConst8 { 3655 break 3656 } 3657 t := i.Type 3658 if !(z.Op != OpConst8 && x.Op != OpConst8) { 3659 break 3660 } 3661 v.reset(OpAdd8) 3662 v.AddArg(i) 3663 v0 := b.NewValue0(v.Pos, OpSub8, t) 3664 v0.AddArg(x) 3665 v0.AddArg(z) 3666 v.AddArg(v0) 3667 return true 3668 } 3669 return false 3670 } 3671 func rewriteValuegeneric_OpAdd8_20(v *Value) bool { 3672 b := v.Block 3673 // match: (Add8 x (Sub8 i:(Const8 <t>) z)) 3674 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 3675 // result: (Add8 i (Sub8 <t> x z)) 3676 for { 3677 _ = v.Args[1] 3678 x := v.Args[0] 3679 v_1 := v.Args[1] 3680 if v_1.Op != OpSub8 { 3681 break 3682 } 3683 z := v_1.Args[1] 3684 i := v_1.Args[0] 3685 if i.Op != OpConst8 { 3686 break 3687 } 3688 t := i.Type 3689 if !(z.Op != OpConst8 && x.Op != OpConst8) { 3690 break 3691 } 3692 v.reset(OpAdd8) 3693 v.AddArg(i) 3694 v0 := b.NewValue0(v.Pos, OpSub8, t) 3695 v0.AddArg(x) 3696 v0.AddArg(z) 3697 v.AddArg(v0) 3698 return true 3699 } 3700 // match: (Add8 (Sub8 i:(Const8 <t>) z) x) 3701 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 3702 // result: (Add8 i (Sub8 <t> x z)) 3703 for { 3704 x := v.Args[1] 3705 v_0 := v.Args[0] 3706 if v_0.Op != OpSub8 { 3707 break 3708 } 3709 z := v_0.Args[1] 3710 i := v_0.Args[0] 3711 if i.Op != OpConst8 { 3712 break 3713 } 3714 t := i.Type 3715 if !(z.Op != OpConst8 && x.Op != OpConst8) { 3716 break 3717 } 3718 v.reset(OpAdd8) 3719 v.AddArg(i) 3720 v0 := b.NewValue0(v.Pos, OpSub8, t) 3721 v0.AddArg(x) 3722 v0.AddArg(z) 3723 v.AddArg(v0) 3724 return true 3725 } 3726 // match: (Add8 (Sub8 z i:(Const8 <t>)) x) 3727 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 3728 // result: (Sub8 (Add8 <t> x z) i) 3729 for { 3730 x := v.Args[1] 3731 v_0 := v.Args[0] 3732 if v_0.Op != OpSub8 { 3733 break 3734 } 3735 _ = v_0.Args[1] 3736 z := v_0.Args[0] 3737 i := v_0.Args[1] 3738 if i.Op != OpConst8 { 3739 break 3740 } 3741 t := i.Type 3742 if !(z.Op != OpConst8 && x.Op != OpConst8) { 3743 break 3744 } 3745 v.reset(OpSub8) 3746 v0 := b.NewValue0(v.Pos, OpAdd8, t) 3747 v0.AddArg(x) 3748 v0.AddArg(z) 3749 v.AddArg(v0) 3750 v.AddArg(i) 3751 return true 3752 } 3753 // match: (Add8 x (Sub8 z i:(Const8 <t>))) 3754 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 3755 // result: (Sub8 (Add8 <t> x z) i) 3756 for { 3757 _ = v.Args[1] 3758 x := v.Args[0] 3759 v_1 := v.Args[1] 3760 if v_1.Op != OpSub8 { 3761 break 3762 } 3763 _ = v_1.Args[1] 3764 z := v_1.Args[0] 3765 i := v_1.Args[1] 3766 if i.Op != OpConst8 { 3767 break 3768 } 3769 t := i.Type 3770 if !(z.Op != OpConst8 && x.Op != OpConst8) { 3771 break 3772 } 3773 v.reset(OpSub8) 3774 v0 := b.NewValue0(v.Pos, OpAdd8, t) 3775 v0.AddArg(x) 3776 v0.AddArg(z) 3777 v.AddArg(v0) 3778 v.AddArg(i) 3779 return true 3780 } 3781 // match: (Add8 x (Sub8 z i:(Const8 <t>))) 3782 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 3783 // result: (Sub8 (Add8 <t> x z) i) 3784 for { 3785 _ = v.Args[1] 3786 x := v.Args[0] 3787 v_1 := v.Args[1] 3788 if v_1.Op != OpSub8 { 3789 break 3790 } 3791 _ = v_1.Args[1] 3792 z := v_1.Args[0] 3793 i := v_1.Args[1] 3794 if i.Op != OpConst8 { 3795 break 3796 } 3797 t := i.Type 3798 if !(z.Op != OpConst8 && x.Op != OpConst8) { 3799 break 3800 } 3801 v.reset(OpSub8) 3802 v0 := b.NewValue0(v.Pos, OpAdd8, t) 3803 v0.AddArg(x) 3804 v0.AddArg(z) 3805 v.AddArg(v0) 3806 v.AddArg(i) 3807 return true 3808 } 3809 // match: (Add8 (Sub8 z i:(Const8 <t>)) x) 3810 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 3811 // result: (Sub8 (Add8 <t> x z) i) 3812 for { 3813 x := v.Args[1] 3814 v_0 := v.Args[0] 3815 if v_0.Op != OpSub8 { 3816 break 3817 } 3818 _ = v_0.Args[1] 3819 z := v_0.Args[0] 3820 i := v_0.Args[1] 3821 if i.Op != OpConst8 { 3822 break 3823 } 3824 t := i.Type 3825 if !(z.Op != OpConst8 && x.Op != OpConst8) { 3826 break 3827 } 3828 v.reset(OpSub8) 3829 v0 := b.NewValue0(v.Pos, OpAdd8, t) 3830 v0.AddArg(x) 3831 v0.AddArg(z) 3832 v.AddArg(v0) 3833 v.AddArg(i) 3834 return true 3835 } 3836 // match: (Add8 (Const8 <t> [c]) (Add8 (Const8 <t> [d]) x)) 3837 // result: (Add8 (Const8 <t> [int64(int8(c+d))]) x) 3838 for { 3839 _ = v.Args[1] 3840 v_0 := v.Args[0] 3841 if v_0.Op != OpConst8 { 3842 break 3843 } 3844 t := v_0.Type 3845 c := v_0.AuxInt 3846 v_1 := v.Args[1] 3847 if v_1.Op != OpAdd8 { 3848 break 3849 } 3850 x := v_1.Args[1] 3851 v_1_0 := v_1.Args[0] 3852 if v_1_0.Op != OpConst8 || v_1_0.Type != t { 3853 break 3854 } 3855 d := v_1_0.AuxInt 3856 v.reset(OpAdd8) 3857 v0 := b.NewValue0(v.Pos, OpConst8, t) 3858 v0.AuxInt = int64(int8(c + d)) 3859 v.AddArg(v0) 3860 v.AddArg(x) 3861 return true 3862 } 3863 // match: (Add8 (Const8 <t> [c]) (Add8 x (Const8 <t> [d]))) 3864 // result: (Add8 (Const8 <t> [int64(int8(c+d))]) x) 3865 for { 3866 _ = v.Args[1] 3867 v_0 := v.Args[0] 3868 if v_0.Op != OpConst8 { 3869 break 3870 } 3871 t := v_0.Type 3872 c := v_0.AuxInt 3873 v_1 := v.Args[1] 3874 if v_1.Op != OpAdd8 { 3875 break 3876 } 3877 _ = v_1.Args[1] 3878 x := v_1.Args[0] 3879 v_1_1 := v_1.Args[1] 3880 if v_1_1.Op != OpConst8 || v_1_1.Type != t { 3881 break 3882 } 3883 d := v_1_1.AuxInt 3884 v.reset(OpAdd8) 3885 v0 := b.NewValue0(v.Pos, OpConst8, t) 3886 v0.AuxInt = int64(int8(c + d)) 3887 v.AddArg(v0) 3888 v.AddArg(x) 3889 return true 3890 } 3891 // match: (Add8 (Add8 (Const8 <t> [d]) x) (Const8 <t> [c])) 3892 // result: (Add8 (Const8 <t> [int64(int8(c+d))]) x) 3893 for { 3894 _ = v.Args[1] 3895 v_0 := v.Args[0] 3896 if v_0.Op != OpAdd8 { 3897 break 3898 } 3899 x := v_0.Args[1] 3900 v_0_0 := v_0.Args[0] 3901 if v_0_0.Op != OpConst8 { 3902 break 3903 } 3904 t := v_0_0.Type 3905 d := v_0_0.AuxInt 3906 v_1 := v.Args[1] 3907 if v_1.Op != OpConst8 || v_1.Type != t { 3908 break 3909 } 3910 c := v_1.AuxInt 3911 v.reset(OpAdd8) 3912 v0 := b.NewValue0(v.Pos, OpConst8, t) 3913 v0.AuxInt = int64(int8(c + d)) 3914 v.AddArg(v0) 3915 v.AddArg(x) 3916 return true 3917 } 3918 // match: (Add8 (Add8 x (Const8 <t> [d])) (Const8 <t> [c])) 3919 // result: (Add8 (Const8 <t> [int64(int8(c+d))]) x) 3920 for { 3921 _ = v.Args[1] 3922 v_0 := v.Args[0] 3923 if v_0.Op != OpAdd8 { 3924 break 3925 } 3926 _ = v_0.Args[1] 3927 x := v_0.Args[0] 3928 v_0_1 := v_0.Args[1] 3929 if v_0_1.Op != OpConst8 { 3930 break 3931 } 3932 t := v_0_1.Type 3933 d := v_0_1.AuxInt 3934 v_1 := v.Args[1] 3935 if v_1.Op != OpConst8 || v_1.Type != t { 3936 break 3937 } 3938 c := v_1.AuxInt 3939 v.reset(OpAdd8) 3940 v0 := b.NewValue0(v.Pos, OpConst8, t) 3941 v0.AuxInt = int64(int8(c + d)) 3942 v.AddArg(v0) 3943 v.AddArg(x) 3944 return true 3945 } 3946 return false 3947 } 3948 func rewriteValuegeneric_OpAdd8_30(v *Value) bool { 3949 b := v.Block 3950 // match: (Add8 (Const8 <t> [c]) (Sub8 (Const8 <t> [d]) x)) 3951 // result: (Sub8 (Const8 <t> [int64(int8(c+d))]) x) 3952 for { 3953 _ = v.Args[1] 3954 v_0 := v.Args[0] 3955 if v_0.Op != OpConst8 { 3956 break 3957 } 3958 t := v_0.Type 3959 c := v_0.AuxInt 3960 v_1 := v.Args[1] 3961 if v_1.Op != OpSub8 { 3962 break 3963 } 3964 x := v_1.Args[1] 3965 v_1_0 := v_1.Args[0] 3966 if v_1_0.Op != OpConst8 || v_1_0.Type != t { 3967 break 3968 } 3969 d := v_1_0.AuxInt 3970 v.reset(OpSub8) 3971 v0 := b.NewValue0(v.Pos, OpConst8, t) 3972 v0.AuxInt = int64(int8(c + d)) 3973 v.AddArg(v0) 3974 v.AddArg(x) 3975 return true 3976 } 3977 // match: (Add8 (Sub8 (Const8 <t> [d]) x) (Const8 <t> [c])) 3978 // result: (Sub8 (Const8 <t> [int64(int8(c+d))]) x) 3979 for { 3980 _ = v.Args[1] 3981 v_0 := v.Args[0] 3982 if v_0.Op != OpSub8 { 3983 break 3984 } 3985 x := v_0.Args[1] 3986 v_0_0 := v_0.Args[0] 3987 if v_0_0.Op != OpConst8 { 3988 break 3989 } 3990 t := v_0_0.Type 3991 d := v_0_0.AuxInt 3992 v_1 := v.Args[1] 3993 if v_1.Op != OpConst8 || v_1.Type != t { 3994 break 3995 } 3996 c := v_1.AuxInt 3997 v.reset(OpSub8) 3998 v0 := b.NewValue0(v.Pos, OpConst8, t) 3999 v0.AuxInt = int64(int8(c + d)) 4000 v.AddArg(v0) 4001 v.AddArg(x) 4002 return true 4003 } 4004 // match: (Add8 (Const8 <t> [c]) (Sub8 x (Const8 <t> [d]))) 4005 // result: (Add8 (Const8 <t> [int64(int8(c-d))]) x) 4006 for { 4007 _ = v.Args[1] 4008 v_0 := v.Args[0] 4009 if v_0.Op != OpConst8 { 4010 break 4011 } 4012 t := v_0.Type 4013 c := v_0.AuxInt 4014 v_1 := v.Args[1] 4015 if v_1.Op != OpSub8 { 4016 break 4017 } 4018 _ = v_1.Args[1] 4019 x := v_1.Args[0] 4020 v_1_1 := v_1.Args[1] 4021 if v_1_1.Op != OpConst8 || v_1_1.Type != t { 4022 break 4023 } 4024 d := v_1_1.AuxInt 4025 v.reset(OpAdd8) 4026 v0 := b.NewValue0(v.Pos, OpConst8, t) 4027 v0.AuxInt = int64(int8(c - d)) 4028 v.AddArg(v0) 4029 v.AddArg(x) 4030 return true 4031 } 4032 // match: (Add8 (Sub8 x (Const8 <t> [d])) (Const8 <t> [c])) 4033 // result: (Add8 (Const8 <t> [int64(int8(c-d))]) x) 4034 for { 4035 _ = v.Args[1] 4036 v_0 := v.Args[0] 4037 if v_0.Op != OpSub8 { 4038 break 4039 } 4040 _ = v_0.Args[1] 4041 x := v_0.Args[0] 4042 v_0_1 := v_0.Args[1] 4043 if v_0_1.Op != OpConst8 { 4044 break 4045 } 4046 t := v_0_1.Type 4047 d := v_0_1.AuxInt 4048 v_1 := v.Args[1] 4049 if v_1.Op != OpConst8 || v_1.Type != t { 4050 break 4051 } 4052 c := v_1.AuxInt 4053 v.reset(OpAdd8) 4054 v0 := b.NewValue0(v.Pos, OpConst8, t) 4055 v0.AuxInt = int64(int8(c - d)) 4056 v.AddArg(v0) 4057 v.AddArg(x) 4058 return true 4059 } 4060 return false 4061 } 4062 func rewriteValuegeneric_OpAddPtr_0(v *Value) bool { 4063 // match: (AddPtr <t> x (Const64 [c])) 4064 // result: (OffPtr <t> x [c]) 4065 for { 4066 t := v.Type 4067 _ = v.Args[1] 4068 x := v.Args[0] 4069 v_1 := v.Args[1] 4070 if v_1.Op != OpConst64 { 4071 break 4072 } 4073 c := v_1.AuxInt 4074 v.reset(OpOffPtr) 4075 v.Type = t 4076 v.AuxInt = c 4077 v.AddArg(x) 4078 return true 4079 } 4080 // match: (AddPtr <t> x (Const32 [c])) 4081 // result: (OffPtr <t> x [c]) 4082 for { 4083 t := v.Type 4084 _ = v.Args[1] 4085 x := v.Args[0] 4086 v_1 := v.Args[1] 4087 if v_1.Op != OpConst32 { 4088 break 4089 } 4090 c := v_1.AuxInt 4091 v.reset(OpOffPtr) 4092 v.Type = t 4093 v.AuxInt = c 4094 v.AddArg(x) 4095 return true 4096 } 4097 return false 4098 } 4099 func rewriteValuegeneric_OpAnd16_0(v *Value) bool { 4100 // match: (And16 (Const16 [c]) (Const16 [d])) 4101 // result: (Const16 [int64(int16(c&d))]) 4102 for { 4103 _ = v.Args[1] 4104 v_0 := v.Args[0] 4105 if v_0.Op != OpConst16 { 4106 break 4107 } 4108 c := v_0.AuxInt 4109 v_1 := v.Args[1] 4110 if v_1.Op != OpConst16 { 4111 break 4112 } 4113 d := v_1.AuxInt 4114 v.reset(OpConst16) 4115 v.AuxInt = int64(int16(c & d)) 4116 return true 4117 } 4118 // match: (And16 (Const16 [d]) (Const16 [c])) 4119 // result: (Const16 [int64(int16(c&d))]) 4120 for { 4121 _ = v.Args[1] 4122 v_0 := v.Args[0] 4123 if v_0.Op != OpConst16 { 4124 break 4125 } 4126 d := v_0.AuxInt 4127 v_1 := v.Args[1] 4128 if v_1.Op != OpConst16 { 4129 break 4130 } 4131 c := v_1.AuxInt 4132 v.reset(OpConst16) 4133 v.AuxInt = int64(int16(c & d)) 4134 return true 4135 } 4136 // match: (And16 (Const16 [m]) (Rsh16Ux64 _ (Const64 [c]))) 4137 // cond: c >= 64-ntz(m) 4138 // result: (Const16 [0]) 4139 for { 4140 _ = v.Args[1] 4141 v_0 := v.Args[0] 4142 if v_0.Op != OpConst16 { 4143 break 4144 } 4145 m := v_0.AuxInt 4146 v_1 := v.Args[1] 4147 if v_1.Op != OpRsh16Ux64 { 4148 break 4149 } 4150 _ = v_1.Args[1] 4151 v_1_1 := v_1.Args[1] 4152 if v_1_1.Op != OpConst64 { 4153 break 4154 } 4155 c := v_1_1.AuxInt 4156 if !(c >= 64-ntz(m)) { 4157 break 4158 } 4159 v.reset(OpConst16) 4160 v.AuxInt = 0 4161 return true 4162 } 4163 // match: (And16 (Rsh16Ux64 _ (Const64 [c])) (Const16 [m])) 4164 // cond: c >= 64-ntz(m) 4165 // result: (Const16 [0]) 4166 for { 4167 _ = v.Args[1] 4168 v_0 := v.Args[0] 4169 if v_0.Op != OpRsh16Ux64 { 4170 break 4171 } 4172 _ = v_0.Args[1] 4173 v_0_1 := v_0.Args[1] 4174 if v_0_1.Op != OpConst64 { 4175 break 4176 } 4177 c := v_0_1.AuxInt 4178 v_1 := v.Args[1] 4179 if v_1.Op != OpConst16 { 4180 break 4181 } 4182 m := v_1.AuxInt 4183 if !(c >= 64-ntz(m)) { 4184 break 4185 } 4186 v.reset(OpConst16) 4187 v.AuxInt = 0 4188 return true 4189 } 4190 // match: (And16 (Const16 [m]) (Lsh16x64 _ (Const64 [c]))) 4191 // cond: c >= 64-nlz(m) 4192 // result: (Const16 [0]) 4193 for { 4194 _ = v.Args[1] 4195 v_0 := v.Args[0] 4196 if v_0.Op != OpConst16 { 4197 break 4198 } 4199 m := v_0.AuxInt 4200 v_1 := v.Args[1] 4201 if v_1.Op != OpLsh16x64 { 4202 break 4203 } 4204 _ = v_1.Args[1] 4205 v_1_1 := v_1.Args[1] 4206 if v_1_1.Op != OpConst64 { 4207 break 4208 } 4209 c := v_1_1.AuxInt 4210 if !(c >= 64-nlz(m)) { 4211 break 4212 } 4213 v.reset(OpConst16) 4214 v.AuxInt = 0 4215 return true 4216 } 4217 // match: (And16 (Lsh16x64 _ (Const64 [c])) (Const16 [m])) 4218 // cond: c >= 64-nlz(m) 4219 // result: (Const16 [0]) 4220 for { 4221 _ = v.Args[1] 4222 v_0 := v.Args[0] 4223 if v_0.Op != OpLsh16x64 { 4224 break 4225 } 4226 _ = v_0.Args[1] 4227 v_0_1 := v_0.Args[1] 4228 if v_0_1.Op != OpConst64 { 4229 break 4230 } 4231 c := v_0_1.AuxInt 4232 v_1 := v.Args[1] 4233 if v_1.Op != OpConst16 { 4234 break 4235 } 4236 m := v_1.AuxInt 4237 if !(c >= 64-nlz(m)) { 4238 break 4239 } 4240 v.reset(OpConst16) 4241 v.AuxInt = 0 4242 return true 4243 } 4244 // match: (And16 x x) 4245 // result: x 4246 for { 4247 x := v.Args[1] 4248 if x != v.Args[0] { 4249 break 4250 } 4251 v.reset(OpCopy) 4252 v.Type = x.Type 4253 v.AddArg(x) 4254 return true 4255 } 4256 // match: (And16 (Const16 [-1]) x) 4257 // result: x 4258 for { 4259 x := v.Args[1] 4260 v_0 := v.Args[0] 4261 if v_0.Op != OpConst16 || v_0.AuxInt != -1 { 4262 break 4263 } 4264 v.reset(OpCopy) 4265 v.Type = x.Type 4266 v.AddArg(x) 4267 return true 4268 } 4269 // match: (And16 x (Const16 [-1])) 4270 // result: x 4271 for { 4272 _ = v.Args[1] 4273 x := v.Args[0] 4274 v_1 := v.Args[1] 4275 if v_1.Op != OpConst16 || v_1.AuxInt != -1 { 4276 break 4277 } 4278 v.reset(OpCopy) 4279 v.Type = x.Type 4280 v.AddArg(x) 4281 return true 4282 } 4283 // match: (And16 (Const16 [0]) _) 4284 // result: (Const16 [0]) 4285 for { 4286 _ = v.Args[1] 4287 v_0 := v.Args[0] 4288 if v_0.Op != OpConst16 || v_0.AuxInt != 0 { 4289 break 4290 } 4291 v.reset(OpConst16) 4292 v.AuxInt = 0 4293 return true 4294 } 4295 return false 4296 } 4297 func rewriteValuegeneric_OpAnd16_10(v *Value) bool { 4298 b := v.Block 4299 // match: (And16 _ (Const16 [0])) 4300 // result: (Const16 [0]) 4301 for { 4302 _ = v.Args[1] 4303 v_1 := v.Args[1] 4304 if v_1.Op != OpConst16 || v_1.AuxInt != 0 { 4305 break 4306 } 4307 v.reset(OpConst16) 4308 v.AuxInt = 0 4309 return true 4310 } 4311 // match: (And16 x (And16 x y)) 4312 // result: (And16 x y) 4313 for { 4314 _ = v.Args[1] 4315 x := v.Args[0] 4316 v_1 := v.Args[1] 4317 if v_1.Op != OpAnd16 { 4318 break 4319 } 4320 y := v_1.Args[1] 4321 if x != v_1.Args[0] { 4322 break 4323 } 4324 v.reset(OpAnd16) 4325 v.AddArg(x) 4326 v.AddArg(y) 4327 return true 4328 } 4329 // match: (And16 x (And16 y x)) 4330 // result: (And16 x y) 4331 for { 4332 _ = v.Args[1] 4333 x := v.Args[0] 4334 v_1 := v.Args[1] 4335 if v_1.Op != OpAnd16 { 4336 break 4337 } 4338 _ = v_1.Args[1] 4339 y := v_1.Args[0] 4340 if x != v_1.Args[1] { 4341 break 4342 } 4343 v.reset(OpAnd16) 4344 v.AddArg(x) 4345 v.AddArg(y) 4346 return true 4347 } 4348 // match: (And16 (And16 x y) x) 4349 // result: (And16 x y) 4350 for { 4351 x := v.Args[1] 4352 v_0 := v.Args[0] 4353 if v_0.Op != OpAnd16 { 4354 break 4355 } 4356 y := v_0.Args[1] 4357 if x != v_0.Args[0] { 4358 break 4359 } 4360 v.reset(OpAnd16) 4361 v.AddArg(x) 4362 v.AddArg(y) 4363 return true 4364 } 4365 // match: (And16 (And16 y x) x) 4366 // result: (And16 x y) 4367 for { 4368 x := v.Args[1] 4369 v_0 := v.Args[0] 4370 if v_0.Op != OpAnd16 { 4371 break 4372 } 4373 _ = v_0.Args[1] 4374 y := v_0.Args[0] 4375 if x != v_0.Args[1] { 4376 break 4377 } 4378 v.reset(OpAnd16) 4379 v.AddArg(x) 4380 v.AddArg(y) 4381 return true 4382 } 4383 // match: (And16 (And16 i:(Const16 <t>) z) x) 4384 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 4385 // result: (And16 i (And16 <t> z x)) 4386 for { 4387 x := v.Args[1] 4388 v_0 := v.Args[0] 4389 if v_0.Op != OpAnd16 { 4390 break 4391 } 4392 z := v_0.Args[1] 4393 i := v_0.Args[0] 4394 if i.Op != OpConst16 { 4395 break 4396 } 4397 t := i.Type 4398 if !(z.Op != OpConst16 && x.Op != OpConst16) { 4399 break 4400 } 4401 v.reset(OpAnd16) 4402 v.AddArg(i) 4403 v0 := b.NewValue0(v.Pos, OpAnd16, t) 4404 v0.AddArg(z) 4405 v0.AddArg(x) 4406 v.AddArg(v0) 4407 return true 4408 } 4409 // match: (And16 (And16 z i:(Const16 <t>)) x) 4410 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 4411 // result: (And16 i (And16 <t> z x)) 4412 for { 4413 x := v.Args[1] 4414 v_0 := v.Args[0] 4415 if v_0.Op != OpAnd16 { 4416 break 4417 } 4418 _ = v_0.Args[1] 4419 z := v_0.Args[0] 4420 i := v_0.Args[1] 4421 if i.Op != OpConst16 { 4422 break 4423 } 4424 t := i.Type 4425 if !(z.Op != OpConst16 && x.Op != OpConst16) { 4426 break 4427 } 4428 v.reset(OpAnd16) 4429 v.AddArg(i) 4430 v0 := b.NewValue0(v.Pos, OpAnd16, t) 4431 v0.AddArg(z) 4432 v0.AddArg(x) 4433 v.AddArg(v0) 4434 return true 4435 } 4436 // match: (And16 x (And16 i:(Const16 <t>) z)) 4437 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 4438 // result: (And16 i (And16 <t> z x)) 4439 for { 4440 _ = v.Args[1] 4441 x := v.Args[0] 4442 v_1 := v.Args[1] 4443 if v_1.Op != OpAnd16 { 4444 break 4445 } 4446 z := v_1.Args[1] 4447 i := v_1.Args[0] 4448 if i.Op != OpConst16 { 4449 break 4450 } 4451 t := i.Type 4452 if !(z.Op != OpConst16 && x.Op != OpConst16) { 4453 break 4454 } 4455 v.reset(OpAnd16) 4456 v.AddArg(i) 4457 v0 := b.NewValue0(v.Pos, OpAnd16, t) 4458 v0.AddArg(z) 4459 v0.AddArg(x) 4460 v.AddArg(v0) 4461 return true 4462 } 4463 // match: (And16 x (And16 z i:(Const16 <t>))) 4464 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 4465 // result: (And16 i (And16 <t> z x)) 4466 for { 4467 _ = v.Args[1] 4468 x := v.Args[0] 4469 v_1 := v.Args[1] 4470 if v_1.Op != OpAnd16 { 4471 break 4472 } 4473 _ = v_1.Args[1] 4474 z := v_1.Args[0] 4475 i := v_1.Args[1] 4476 if i.Op != OpConst16 { 4477 break 4478 } 4479 t := i.Type 4480 if !(z.Op != OpConst16 && x.Op != OpConst16) { 4481 break 4482 } 4483 v.reset(OpAnd16) 4484 v.AddArg(i) 4485 v0 := b.NewValue0(v.Pos, OpAnd16, t) 4486 v0.AddArg(z) 4487 v0.AddArg(x) 4488 v.AddArg(v0) 4489 return true 4490 } 4491 // match: (And16 (Const16 <t> [c]) (And16 (Const16 <t> [d]) x)) 4492 // result: (And16 (Const16 <t> [int64(int16(c&d))]) x) 4493 for { 4494 _ = v.Args[1] 4495 v_0 := v.Args[0] 4496 if v_0.Op != OpConst16 { 4497 break 4498 } 4499 t := v_0.Type 4500 c := v_0.AuxInt 4501 v_1 := v.Args[1] 4502 if v_1.Op != OpAnd16 { 4503 break 4504 } 4505 x := v_1.Args[1] 4506 v_1_0 := v_1.Args[0] 4507 if v_1_0.Op != OpConst16 || v_1_0.Type != t { 4508 break 4509 } 4510 d := v_1_0.AuxInt 4511 v.reset(OpAnd16) 4512 v0 := b.NewValue0(v.Pos, OpConst16, t) 4513 v0.AuxInt = int64(int16(c & d)) 4514 v.AddArg(v0) 4515 v.AddArg(x) 4516 return true 4517 } 4518 return false 4519 } 4520 func rewriteValuegeneric_OpAnd16_20(v *Value) bool { 4521 b := v.Block 4522 // match: (And16 (Const16 <t> [c]) (And16 x (Const16 <t> [d]))) 4523 // result: (And16 (Const16 <t> [int64(int16(c&d))]) x) 4524 for { 4525 _ = v.Args[1] 4526 v_0 := v.Args[0] 4527 if v_0.Op != OpConst16 { 4528 break 4529 } 4530 t := v_0.Type 4531 c := v_0.AuxInt 4532 v_1 := v.Args[1] 4533 if v_1.Op != OpAnd16 { 4534 break 4535 } 4536 _ = v_1.Args[1] 4537 x := v_1.Args[0] 4538 v_1_1 := v_1.Args[1] 4539 if v_1_1.Op != OpConst16 || v_1_1.Type != t { 4540 break 4541 } 4542 d := v_1_1.AuxInt 4543 v.reset(OpAnd16) 4544 v0 := b.NewValue0(v.Pos, OpConst16, t) 4545 v0.AuxInt = int64(int16(c & d)) 4546 v.AddArg(v0) 4547 v.AddArg(x) 4548 return true 4549 } 4550 // match: (And16 (And16 (Const16 <t> [d]) x) (Const16 <t> [c])) 4551 // result: (And16 (Const16 <t> [int64(int16(c&d))]) x) 4552 for { 4553 _ = v.Args[1] 4554 v_0 := v.Args[0] 4555 if v_0.Op != OpAnd16 { 4556 break 4557 } 4558 x := v_0.Args[1] 4559 v_0_0 := v_0.Args[0] 4560 if v_0_0.Op != OpConst16 { 4561 break 4562 } 4563 t := v_0_0.Type 4564 d := v_0_0.AuxInt 4565 v_1 := v.Args[1] 4566 if v_1.Op != OpConst16 || v_1.Type != t { 4567 break 4568 } 4569 c := v_1.AuxInt 4570 v.reset(OpAnd16) 4571 v0 := b.NewValue0(v.Pos, OpConst16, t) 4572 v0.AuxInt = int64(int16(c & d)) 4573 v.AddArg(v0) 4574 v.AddArg(x) 4575 return true 4576 } 4577 // match: (And16 (And16 x (Const16 <t> [d])) (Const16 <t> [c])) 4578 // result: (And16 (Const16 <t> [int64(int16(c&d))]) x) 4579 for { 4580 _ = v.Args[1] 4581 v_0 := v.Args[0] 4582 if v_0.Op != OpAnd16 { 4583 break 4584 } 4585 _ = v_0.Args[1] 4586 x := v_0.Args[0] 4587 v_0_1 := v_0.Args[1] 4588 if v_0_1.Op != OpConst16 { 4589 break 4590 } 4591 t := v_0_1.Type 4592 d := v_0_1.AuxInt 4593 v_1 := v.Args[1] 4594 if v_1.Op != OpConst16 || v_1.Type != t { 4595 break 4596 } 4597 c := v_1.AuxInt 4598 v.reset(OpAnd16) 4599 v0 := b.NewValue0(v.Pos, OpConst16, t) 4600 v0.AuxInt = int64(int16(c & d)) 4601 v.AddArg(v0) 4602 v.AddArg(x) 4603 return true 4604 } 4605 return false 4606 } 4607 func rewriteValuegeneric_OpAnd32_0(v *Value) bool { 4608 // match: (And32 (Const32 [c]) (Const32 [d])) 4609 // result: (Const32 [int64(int32(c&d))]) 4610 for { 4611 _ = v.Args[1] 4612 v_0 := v.Args[0] 4613 if v_0.Op != OpConst32 { 4614 break 4615 } 4616 c := v_0.AuxInt 4617 v_1 := v.Args[1] 4618 if v_1.Op != OpConst32 { 4619 break 4620 } 4621 d := v_1.AuxInt 4622 v.reset(OpConst32) 4623 v.AuxInt = int64(int32(c & d)) 4624 return true 4625 } 4626 // match: (And32 (Const32 [d]) (Const32 [c])) 4627 // result: (Const32 [int64(int32(c&d))]) 4628 for { 4629 _ = v.Args[1] 4630 v_0 := v.Args[0] 4631 if v_0.Op != OpConst32 { 4632 break 4633 } 4634 d := v_0.AuxInt 4635 v_1 := v.Args[1] 4636 if v_1.Op != OpConst32 { 4637 break 4638 } 4639 c := v_1.AuxInt 4640 v.reset(OpConst32) 4641 v.AuxInt = int64(int32(c & d)) 4642 return true 4643 } 4644 // match: (And32 (Const32 [m]) (Rsh32Ux64 _ (Const64 [c]))) 4645 // cond: c >= 64-ntz(m) 4646 // result: (Const32 [0]) 4647 for { 4648 _ = v.Args[1] 4649 v_0 := v.Args[0] 4650 if v_0.Op != OpConst32 { 4651 break 4652 } 4653 m := v_0.AuxInt 4654 v_1 := v.Args[1] 4655 if v_1.Op != OpRsh32Ux64 { 4656 break 4657 } 4658 _ = v_1.Args[1] 4659 v_1_1 := v_1.Args[1] 4660 if v_1_1.Op != OpConst64 { 4661 break 4662 } 4663 c := v_1_1.AuxInt 4664 if !(c >= 64-ntz(m)) { 4665 break 4666 } 4667 v.reset(OpConst32) 4668 v.AuxInt = 0 4669 return true 4670 } 4671 // match: (And32 (Rsh32Ux64 _ (Const64 [c])) (Const32 [m])) 4672 // cond: c >= 64-ntz(m) 4673 // result: (Const32 [0]) 4674 for { 4675 _ = v.Args[1] 4676 v_0 := v.Args[0] 4677 if v_0.Op != OpRsh32Ux64 { 4678 break 4679 } 4680 _ = v_0.Args[1] 4681 v_0_1 := v_0.Args[1] 4682 if v_0_1.Op != OpConst64 { 4683 break 4684 } 4685 c := v_0_1.AuxInt 4686 v_1 := v.Args[1] 4687 if v_1.Op != OpConst32 { 4688 break 4689 } 4690 m := v_1.AuxInt 4691 if !(c >= 64-ntz(m)) { 4692 break 4693 } 4694 v.reset(OpConst32) 4695 v.AuxInt = 0 4696 return true 4697 } 4698 // match: (And32 (Const32 [m]) (Lsh32x64 _ (Const64 [c]))) 4699 // cond: c >= 64-nlz(m) 4700 // result: (Const32 [0]) 4701 for { 4702 _ = v.Args[1] 4703 v_0 := v.Args[0] 4704 if v_0.Op != OpConst32 { 4705 break 4706 } 4707 m := v_0.AuxInt 4708 v_1 := v.Args[1] 4709 if v_1.Op != OpLsh32x64 { 4710 break 4711 } 4712 _ = v_1.Args[1] 4713 v_1_1 := v_1.Args[1] 4714 if v_1_1.Op != OpConst64 { 4715 break 4716 } 4717 c := v_1_1.AuxInt 4718 if !(c >= 64-nlz(m)) { 4719 break 4720 } 4721 v.reset(OpConst32) 4722 v.AuxInt = 0 4723 return true 4724 } 4725 // match: (And32 (Lsh32x64 _ (Const64 [c])) (Const32 [m])) 4726 // cond: c >= 64-nlz(m) 4727 // result: (Const32 [0]) 4728 for { 4729 _ = v.Args[1] 4730 v_0 := v.Args[0] 4731 if v_0.Op != OpLsh32x64 { 4732 break 4733 } 4734 _ = v_0.Args[1] 4735 v_0_1 := v_0.Args[1] 4736 if v_0_1.Op != OpConst64 { 4737 break 4738 } 4739 c := v_0_1.AuxInt 4740 v_1 := v.Args[1] 4741 if v_1.Op != OpConst32 { 4742 break 4743 } 4744 m := v_1.AuxInt 4745 if !(c >= 64-nlz(m)) { 4746 break 4747 } 4748 v.reset(OpConst32) 4749 v.AuxInt = 0 4750 return true 4751 } 4752 // match: (And32 x x) 4753 // result: x 4754 for { 4755 x := v.Args[1] 4756 if x != v.Args[0] { 4757 break 4758 } 4759 v.reset(OpCopy) 4760 v.Type = x.Type 4761 v.AddArg(x) 4762 return true 4763 } 4764 // match: (And32 (Const32 [-1]) x) 4765 // result: x 4766 for { 4767 x := v.Args[1] 4768 v_0 := v.Args[0] 4769 if v_0.Op != OpConst32 || v_0.AuxInt != -1 { 4770 break 4771 } 4772 v.reset(OpCopy) 4773 v.Type = x.Type 4774 v.AddArg(x) 4775 return true 4776 } 4777 // match: (And32 x (Const32 [-1])) 4778 // result: x 4779 for { 4780 _ = v.Args[1] 4781 x := v.Args[0] 4782 v_1 := v.Args[1] 4783 if v_1.Op != OpConst32 || v_1.AuxInt != -1 { 4784 break 4785 } 4786 v.reset(OpCopy) 4787 v.Type = x.Type 4788 v.AddArg(x) 4789 return true 4790 } 4791 // match: (And32 (Const32 [0]) _) 4792 // result: (Const32 [0]) 4793 for { 4794 _ = v.Args[1] 4795 v_0 := v.Args[0] 4796 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 4797 break 4798 } 4799 v.reset(OpConst32) 4800 v.AuxInt = 0 4801 return true 4802 } 4803 return false 4804 } 4805 func rewriteValuegeneric_OpAnd32_10(v *Value) bool { 4806 b := v.Block 4807 // match: (And32 _ (Const32 [0])) 4808 // result: (Const32 [0]) 4809 for { 4810 _ = v.Args[1] 4811 v_1 := v.Args[1] 4812 if v_1.Op != OpConst32 || v_1.AuxInt != 0 { 4813 break 4814 } 4815 v.reset(OpConst32) 4816 v.AuxInt = 0 4817 return true 4818 } 4819 // match: (And32 x (And32 x y)) 4820 // result: (And32 x y) 4821 for { 4822 _ = v.Args[1] 4823 x := v.Args[0] 4824 v_1 := v.Args[1] 4825 if v_1.Op != OpAnd32 { 4826 break 4827 } 4828 y := v_1.Args[1] 4829 if x != v_1.Args[0] { 4830 break 4831 } 4832 v.reset(OpAnd32) 4833 v.AddArg(x) 4834 v.AddArg(y) 4835 return true 4836 } 4837 // match: (And32 x (And32 y x)) 4838 // result: (And32 x y) 4839 for { 4840 _ = v.Args[1] 4841 x := v.Args[0] 4842 v_1 := v.Args[1] 4843 if v_1.Op != OpAnd32 { 4844 break 4845 } 4846 _ = v_1.Args[1] 4847 y := v_1.Args[0] 4848 if x != v_1.Args[1] { 4849 break 4850 } 4851 v.reset(OpAnd32) 4852 v.AddArg(x) 4853 v.AddArg(y) 4854 return true 4855 } 4856 // match: (And32 (And32 x y) x) 4857 // result: (And32 x y) 4858 for { 4859 x := v.Args[1] 4860 v_0 := v.Args[0] 4861 if v_0.Op != OpAnd32 { 4862 break 4863 } 4864 y := v_0.Args[1] 4865 if x != v_0.Args[0] { 4866 break 4867 } 4868 v.reset(OpAnd32) 4869 v.AddArg(x) 4870 v.AddArg(y) 4871 return true 4872 } 4873 // match: (And32 (And32 y x) x) 4874 // result: (And32 x y) 4875 for { 4876 x := v.Args[1] 4877 v_0 := v.Args[0] 4878 if v_0.Op != OpAnd32 { 4879 break 4880 } 4881 _ = v_0.Args[1] 4882 y := v_0.Args[0] 4883 if x != v_0.Args[1] { 4884 break 4885 } 4886 v.reset(OpAnd32) 4887 v.AddArg(x) 4888 v.AddArg(y) 4889 return true 4890 } 4891 // match: (And32 (And32 i:(Const32 <t>) z) x) 4892 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 4893 // result: (And32 i (And32 <t> z x)) 4894 for { 4895 x := v.Args[1] 4896 v_0 := v.Args[0] 4897 if v_0.Op != OpAnd32 { 4898 break 4899 } 4900 z := v_0.Args[1] 4901 i := v_0.Args[0] 4902 if i.Op != OpConst32 { 4903 break 4904 } 4905 t := i.Type 4906 if !(z.Op != OpConst32 && x.Op != OpConst32) { 4907 break 4908 } 4909 v.reset(OpAnd32) 4910 v.AddArg(i) 4911 v0 := b.NewValue0(v.Pos, OpAnd32, t) 4912 v0.AddArg(z) 4913 v0.AddArg(x) 4914 v.AddArg(v0) 4915 return true 4916 } 4917 // match: (And32 (And32 z i:(Const32 <t>)) x) 4918 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 4919 // result: (And32 i (And32 <t> z x)) 4920 for { 4921 x := v.Args[1] 4922 v_0 := v.Args[0] 4923 if v_0.Op != OpAnd32 { 4924 break 4925 } 4926 _ = v_0.Args[1] 4927 z := v_0.Args[0] 4928 i := v_0.Args[1] 4929 if i.Op != OpConst32 { 4930 break 4931 } 4932 t := i.Type 4933 if !(z.Op != OpConst32 && x.Op != OpConst32) { 4934 break 4935 } 4936 v.reset(OpAnd32) 4937 v.AddArg(i) 4938 v0 := b.NewValue0(v.Pos, OpAnd32, t) 4939 v0.AddArg(z) 4940 v0.AddArg(x) 4941 v.AddArg(v0) 4942 return true 4943 } 4944 // match: (And32 x (And32 i:(Const32 <t>) z)) 4945 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 4946 // result: (And32 i (And32 <t> z x)) 4947 for { 4948 _ = v.Args[1] 4949 x := v.Args[0] 4950 v_1 := v.Args[1] 4951 if v_1.Op != OpAnd32 { 4952 break 4953 } 4954 z := v_1.Args[1] 4955 i := v_1.Args[0] 4956 if i.Op != OpConst32 { 4957 break 4958 } 4959 t := i.Type 4960 if !(z.Op != OpConst32 && x.Op != OpConst32) { 4961 break 4962 } 4963 v.reset(OpAnd32) 4964 v.AddArg(i) 4965 v0 := b.NewValue0(v.Pos, OpAnd32, t) 4966 v0.AddArg(z) 4967 v0.AddArg(x) 4968 v.AddArg(v0) 4969 return true 4970 } 4971 // match: (And32 x (And32 z i:(Const32 <t>))) 4972 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 4973 // result: (And32 i (And32 <t> z x)) 4974 for { 4975 _ = v.Args[1] 4976 x := v.Args[0] 4977 v_1 := v.Args[1] 4978 if v_1.Op != OpAnd32 { 4979 break 4980 } 4981 _ = v_1.Args[1] 4982 z := v_1.Args[0] 4983 i := v_1.Args[1] 4984 if i.Op != OpConst32 { 4985 break 4986 } 4987 t := i.Type 4988 if !(z.Op != OpConst32 && x.Op != OpConst32) { 4989 break 4990 } 4991 v.reset(OpAnd32) 4992 v.AddArg(i) 4993 v0 := b.NewValue0(v.Pos, OpAnd32, t) 4994 v0.AddArg(z) 4995 v0.AddArg(x) 4996 v.AddArg(v0) 4997 return true 4998 } 4999 // match: (And32 (Const32 <t> [c]) (And32 (Const32 <t> [d]) x)) 5000 // result: (And32 (Const32 <t> [int64(int32(c&d))]) x) 5001 for { 5002 _ = v.Args[1] 5003 v_0 := v.Args[0] 5004 if v_0.Op != OpConst32 { 5005 break 5006 } 5007 t := v_0.Type 5008 c := v_0.AuxInt 5009 v_1 := v.Args[1] 5010 if v_1.Op != OpAnd32 { 5011 break 5012 } 5013 x := v_1.Args[1] 5014 v_1_0 := v_1.Args[0] 5015 if v_1_0.Op != OpConst32 || v_1_0.Type != t { 5016 break 5017 } 5018 d := v_1_0.AuxInt 5019 v.reset(OpAnd32) 5020 v0 := b.NewValue0(v.Pos, OpConst32, t) 5021 v0.AuxInt = int64(int32(c & d)) 5022 v.AddArg(v0) 5023 v.AddArg(x) 5024 return true 5025 } 5026 return false 5027 } 5028 func rewriteValuegeneric_OpAnd32_20(v *Value) bool { 5029 b := v.Block 5030 // match: (And32 (Const32 <t> [c]) (And32 x (Const32 <t> [d]))) 5031 // result: (And32 (Const32 <t> [int64(int32(c&d))]) x) 5032 for { 5033 _ = v.Args[1] 5034 v_0 := v.Args[0] 5035 if v_0.Op != OpConst32 { 5036 break 5037 } 5038 t := v_0.Type 5039 c := v_0.AuxInt 5040 v_1 := v.Args[1] 5041 if v_1.Op != OpAnd32 { 5042 break 5043 } 5044 _ = v_1.Args[1] 5045 x := v_1.Args[0] 5046 v_1_1 := v_1.Args[1] 5047 if v_1_1.Op != OpConst32 || v_1_1.Type != t { 5048 break 5049 } 5050 d := v_1_1.AuxInt 5051 v.reset(OpAnd32) 5052 v0 := b.NewValue0(v.Pos, OpConst32, t) 5053 v0.AuxInt = int64(int32(c & d)) 5054 v.AddArg(v0) 5055 v.AddArg(x) 5056 return true 5057 } 5058 // match: (And32 (And32 (Const32 <t> [d]) x) (Const32 <t> [c])) 5059 // result: (And32 (Const32 <t> [int64(int32(c&d))]) x) 5060 for { 5061 _ = v.Args[1] 5062 v_0 := v.Args[0] 5063 if v_0.Op != OpAnd32 { 5064 break 5065 } 5066 x := v_0.Args[1] 5067 v_0_0 := v_0.Args[0] 5068 if v_0_0.Op != OpConst32 { 5069 break 5070 } 5071 t := v_0_0.Type 5072 d := v_0_0.AuxInt 5073 v_1 := v.Args[1] 5074 if v_1.Op != OpConst32 || v_1.Type != t { 5075 break 5076 } 5077 c := v_1.AuxInt 5078 v.reset(OpAnd32) 5079 v0 := b.NewValue0(v.Pos, OpConst32, t) 5080 v0.AuxInt = int64(int32(c & d)) 5081 v.AddArg(v0) 5082 v.AddArg(x) 5083 return true 5084 } 5085 // match: (And32 (And32 x (Const32 <t> [d])) (Const32 <t> [c])) 5086 // result: (And32 (Const32 <t> [int64(int32(c&d))]) x) 5087 for { 5088 _ = v.Args[1] 5089 v_0 := v.Args[0] 5090 if v_0.Op != OpAnd32 { 5091 break 5092 } 5093 _ = v_0.Args[1] 5094 x := v_0.Args[0] 5095 v_0_1 := v_0.Args[1] 5096 if v_0_1.Op != OpConst32 { 5097 break 5098 } 5099 t := v_0_1.Type 5100 d := v_0_1.AuxInt 5101 v_1 := v.Args[1] 5102 if v_1.Op != OpConst32 || v_1.Type != t { 5103 break 5104 } 5105 c := v_1.AuxInt 5106 v.reset(OpAnd32) 5107 v0 := b.NewValue0(v.Pos, OpConst32, t) 5108 v0.AuxInt = int64(int32(c & d)) 5109 v.AddArg(v0) 5110 v.AddArg(x) 5111 return true 5112 } 5113 return false 5114 } 5115 func rewriteValuegeneric_OpAnd64_0(v *Value) bool { 5116 // match: (And64 (Const64 [c]) (Const64 [d])) 5117 // result: (Const64 [c&d]) 5118 for { 5119 _ = v.Args[1] 5120 v_0 := v.Args[0] 5121 if v_0.Op != OpConst64 { 5122 break 5123 } 5124 c := v_0.AuxInt 5125 v_1 := v.Args[1] 5126 if v_1.Op != OpConst64 { 5127 break 5128 } 5129 d := v_1.AuxInt 5130 v.reset(OpConst64) 5131 v.AuxInt = c & d 5132 return true 5133 } 5134 // match: (And64 (Const64 [d]) (Const64 [c])) 5135 // result: (Const64 [c&d]) 5136 for { 5137 _ = v.Args[1] 5138 v_0 := v.Args[0] 5139 if v_0.Op != OpConst64 { 5140 break 5141 } 5142 d := v_0.AuxInt 5143 v_1 := v.Args[1] 5144 if v_1.Op != OpConst64 { 5145 break 5146 } 5147 c := v_1.AuxInt 5148 v.reset(OpConst64) 5149 v.AuxInt = c & d 5150 return true 5151 } 5152 // match: (And64 (Const64 [m]) (Rsh64Ux64 _ (Const64 [c]))) 5153 // cond: c >= 64-ntz(m) 5154 // result: (Const64 [0]) 5155 for { 5156 _ = v.Args[1] 5157 v_0 := v.Args[0] 5158 if v_0.Op != OpConst64 { 5159 break 5160 } 5161 m := v_0.AuxInt 5162 v_1 := v.Args[1] 5163 if v_1.Op != OpRsh64Ux64 { 5164 break 5165 } 5166 _ = v_1.Args[1] 5167 v_1_1 := v_1.Args[1] 5168 if v_1_1.Op != OpConst64 { 5169 break 5170 } 5171 c := v_1_1.AuxInt 5172 if !(c >= 64-ntz(m)) { 5173 break 5174 } 5175 v.reset(OpConst64) 5176 v.AuxInt = 0 5177 return true 5178 } 5179 // match: (And64 (Rsh64Ux64 _ (Const64 [c])) (Const64 [m])) 5180 // cond: c >= 64-ntz(m) 5181 // result: (Const64 [0]) 5182 for { 5183 _ = v.Args[1] 5184 v_0 := v.Args[0] 5185 if v_0.Op != OpRsh64Ux64 { 5186 break 5187 } 5188 _ = v_0.Args[1] 5189 v_0_1 := v_0.Args[1] 5190 if v_0_1.Op != OpConst64 { 5191 break 5192 } 5193 c := v_0_1.AuxInt 5194 v_1 := v.Args[1] 5195 if v_1.Op != OpConst64 { 5196 break 5197 } 5198 m := v_1.AuxInt 5199 if !(c >= 64-ntz(m)) { 5200 break 5201 } 5202 v.reset(OpConst64) 5203 v.AuxInt = 0 5204 return true 5205 } 5206 // match: (And64 (Const64 [m]) (Lsh64x64 _ (Const64 [c]))) 5207 // cond: c >= 64-nlz(m) 5208 // result: (Const64 [0]) 5209 for { 5210 _ = v.Args[1] 5211 v_0 := v.Args[0] 5212 if v_0.Op != OpConst64 { 5213 break 5214 } 5215 m := v_0.AuxInt 5216 v_1 := v.Args[1] 5217 if v_1.Op != OpLsh64x64 { 5218 break 5219 } 5220 _ = v_1.Args[1] 5221 v_1_1 := v_1.Args[1] 5222 if v_1_1.Op != OpConst64 { 5223 break 5224 } 5225 c := v_1_1.AuxInt 5226 if !(c >= 64-nlz(m)) { 5227 break 5228 } 5229 v.reset(OpConst64) 5230 v.AuxInt = 0 5231 return true 5232 } 5233 // match: (And64 (Lsh64x64 _ (Const64 [c])) (Const64 [m])) 5234 // cond: c >= 64-nlz(m) 5235 // result: (Const64 [0]) 5236 for { 5237 _ = v.Args[1] 5238 v_0 := v.Args[0] 5239 if v_0.Op != OpLsh64x64 { 5240 break 5241 } 5242 _ = v_0.Args[1] 5243 v_0_1 := v_0.Args[1] 5244 if v_0_1.Op != OpConst64 { 5245 break 5246 } 5247 c := v_0_1.AuxInt 5248 v_1 := v.Args[1] 5249 if v_1.Op != OpConst64 { 5250 break 5251 } 5252 m := v_1.AuxInt 5253 if !(c >= 64-nlz(m)) { 5254 break 5255 } 5256 v.reset(OpConst64) 5257 v.AuxInt = 0 5258 return true 5259 } 5260 // match: (And64 x x) 5261 // result: x 5262 for { 5263 x := v.Args[1] 5264 if x != v.Args[0] { 5265 break 5266 } 5267 v.reset(OpCopy) 5268 v.Type = x.Type 5269 v.AddArg(x) 5270 return true 5271 } 5272 // match: (And64 (Const64 [-1]) x) 5273 // result: x 5274 for { 5275 x := v.Args[1] 5276 v_0 := v.Args[0] 5277 if v_0.Op != OpConst64 || v_0.AuxInt != -1 { 5278 break 5279 } 5280 v.reset(OpCopy) 5281 v.Type = x.Type 5282 v.AddArg(x) 5283 return true 5284 } 5285 // match: (And64 x (Const64 [-1])) 5286 // result: x 5287 for { 5288 _ = v.Args[1] 5289 x := v.Args[0] 5290 v_1 := v.Args[1] 5291 if v_1.Op != OpConst64 || v_1.AuxInt != -1 { 5292 break 5293 } 5294 v.reset(OpCopy) 5295 v.Type = x.Type 5296 v.AddArg(x) 5297 return true 5298 } 5299 // match: (And64 (Const64 [0]) _) 5300 // result: (Const64 [0]) 5301 for { 5302 _ = v.Args[1] 5303 v_0 := v.Args[0] 5304 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 5305 break 5306 } 5307 v.reset(OpConst64) 5308 v.AuxInt = 0 5309 return true 5310 } 5311 return false 5312 } 5313 func rewriteValuegeneric_OpAnd64_10(v *Value) bool { 5314 b := v.Block 5315 // match: (And64 _ (Const64 [0])) 5316 // result: (Const64 [0]) 5317 for { 5318 _ = v.Args[1] 5319 v_1 := v.Args[1] 5320 if v_1.Op != OpConst64 || v_1.AuxInt != 0 { 5321 break 5322 } 5323 v.reset(OpConst64) 5324 v.AuxInt = 0 5325 return true 5326 } 5327 // match: (And64 x (And64 x y)) 5328 // result: (And64 x y) 5329 for { 5330 _ = v.Args[1] 5331 x := v.Args[0] 5332 v_1 := v.Args[1] 5333 if v_1.Op != OpAnd64 { 5334 break 5335 } 5336 y := v_1.Args[1] 5337 if x != v_1.Args[0] { 5338 break 5339 } 5340 v.reset(OpAnd64) 5341 v.AddArg(x) 5342 v.AddArg(y) 5343 return true 5344 } 5345 // match: (And64 x (And64 y x)) 5346 // result: (And64 x y) 5347 for { 5348 _ = v.Args[1] 5349 x := v.Args[0] 5350 v_1 := v.Args[1] 5351 if v_1.Op != OpAnd64 { 5352 break 5353 } 5354 _ = v_1.Args[1] 5355 y := v_1.Args[0] 5356 if x != v_1.Args[1] { 5357 break 5358 } 5359 v.reset(OpAnd64) 5360 v.AddArg(x) 5361 v.AddArg(y) 5362 return true 5363 } 5364 // match: (And64 (And64 x y) x) 5365 // result: (And64 x y) 5366 for { 5367 x := v.Args[1] 5368 v_0 := v.Args[0] 5369 if v_0.Op != OpAnd64 { 5370 break 5371 } 5372 y := v_0.Args[1] 5373 if x != v_0.Args[0] { 5374 break 5375 } 5376 v.reset(OpAnd64) 5377 v.AddArg(x) 5378 v.AddArg(y) 5379 return true 5380 } 5381 // match: (And64 (And64 y x) x) 5382 // result: (And64 x y) 5383 for { 5384 x := v.Args[1] 5385 v_0 := v.Args[0] 5386 if v_0.Op != OpAnd64 { 5387 break 5388 } 5389 _ = v_0.Args[1] 5390 y := v_0.Args[0] 5391 if x != v_0.Args[1] { 5392 break 5393 } 5394 v.reset(OpAnd64) 5395 v.AddArg(x) 5396 v.AddArg(y) 5397 return true 5398 } 5399 // match: (And64 (And64 i:(Const64 <t>) z) x) 5400 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 5401 // result: (And64 i (And64 <t> z x)) 5402 for { 5403 x := v.Args[1] 5404 v_0 := v.Args[0] 5405 if v_0.Op != OpAnd64 { 5406 break 5407 } 5408 z := v_0.Args[1] 5409 i := v_0.Args[0] 5410 if i.Op != OpConst64 { 5411 break 5412 } 5413 t := i.Type 5414 if !(z.Op != OpConst64 && x.Op != OpConst64) { 5415 break 5416 } 5417 v.reset(OpAnd64) 5418 v.AddArg(i) 5419 v0 := b.NewValue0(v.Pos, OpAnd64, t) 5420 v0.AddArg(z) 5421 v0.AddArg(x) 5422 v.AddArg(v0) 5423 return true 5424 } 5425 // match: (And64 (And64 z i:(Const64 <t>)) x) 5426 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 5427 // result: (And64 i (And64 <t> z x)) 5428 for { 5429 x := v.Args[1] 5430 v_0 := v.Args[0] 5431 if v_0.Op != OpAnd64 { 5432 break 5433 } 5434 _ = v_0.Args[1] 5435 z := v_0.Args[0] 5436 i := v_0.Args[1] 5437 if i.Op != OpConst64 { 5438 break 5439 } 5440 t := i.Type 5441 if !(z.Op != OpConst64 && x.Op != OpConst64) { 5442 break 5443 } 5444 v.reset(OpAnd64) 5445 v.AddArg(i) 5446 v0 := b.NewValue0(v.Pos, OpAnd64, t) 5447 v0.AddArg(z) 5448 v0.AddArg(x) 5449 v.AddArg(v0) 5450 return true 5451 } 5452 // match: (And64 x (And64 i:(Const64 <t>) z)) 5453 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 5454 // result: (And64 i (And64 <t> z x)) 5455 for { 5456 _ = v.Args[1] 5457 x := v.Args[0] 5458 v_1 := v.Args[1] 5459 if v_1.Op != OpAnd64 { 5460 break 5461 } 5462 z := v_1.Args[1] 5463 i := v_1.Args[0] 5464 if i.Op != OpConst64 { 5465 break 5466 } 5467 t := i.Type 5468 if !(z.Op != OpConst64 && x.Op != OpConst64) { 5469 break 5470 } 5471 v.reset(OpAnd64) 5472 v.AddArg(i) 5473 v0 := b.NewValue0(v.Pos, OpAnd64, t) 5474 v0.AddArg(z) 5475 v0.AddArg(x) 5476 v.AddArg(v0) 5477 return true 5478 } 5479 // match: (And64 x (And64 z i:(Const64 <t>))) 5480 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 5481 // result: (And64 i (And64 <t> z x)) 5482 for { 5483 _ = v.Args[1] 5484 x := v.Args[0] 5485 v_1 := v.Args[1] 5486 if v_1.Op != OpAnd64 { 5487 break 5488 } 5489 _ = v_1.Args[1] 5490 z := v_1.Args[0] 5491 i := v_1.Args[1] 5492 if i.Op != OpConst64 { 5493 break 5494 } 5495 t := i.Type 5496 if !(z.Op != OpConst64 && x.Op != OpConst64) { 5497 break 5498 } 5499 v.reset(OpAnd64) 5500 v.AddArg(i) 5501 v0 := b.NewValue0(v.Pos, OpAnd64, t) 5502 v0.AddArg(z) 5503 v0.AddArg(x) 5504 v.AddArg(v0) 5505 return true 5506 } 5507 // match: (And64 (Const64 <t> [c]) (And64 (Const64 <t> [d]) x)) 5508 // result: (And64 (Const64 <t> [c&d]) x) 5509 for { 5510 _ = v.Args[1] 5511 v_0 := v.Args[0] 5512 if v_0.Op != OpConst64 { 5513 break 5514 } 5515 t := v_0.Type 5516 c := v_0.AuxInt 5517 v_1 := v.Args[1] 5518 if v_1.Op != OpAnd64 { 5519 break 5520 } 5521 x := v_1.Args[1] 5522 v_1_0 := v_1.Args[0] 5523 if v_1_0.Op != OpConst64 || v_1_0.Type != t { 5524 break 5525 } 5526 d := v_1_0.AuxInt 5527 v.reset(OpAnd64) 5528 v0 := b.NewValue0(v.Pos, OpConst64, t) 5529 v0.AuxInt = c & d 5530 v.AddArg(v0) 5531 v.AddArg(x) 5532 return true 5533 } 5534 return false 5535 } 5536 func rewriteValuegeneric_OpAnd64_20(v *Value) bool { 5537 b := v.Block 5538 // match: (And64 (Const64 <t> [c]) (And64 x (Const64 <t> [d]))) 5539 // result: (And64 (Const64 <t> [c&d]) x) 5540 for { 5541 _ = v.Args[1] 5542 v_0 := v.Args[0] 5543 if v_0.Op != OpConst64 { 5544 break 5545 } 5546 t := v_0.Type 5547 c := v_0.AuxInt 5548 v_1 := v.Args[1] 5549 if v_1.Op != OpAnd64 { 5550 break 5551 } 5552 _ = v_1.Args[1] 5553 x := v_1.Args[0] 5554 v_1_1 := v_1.Args[1] 5555 if v_1_1.Op != OpConst64 || v_1_1.Type != t { 5556 break 5557 } 5558 d := v_1_1.AuxInt 5559 v.reset(OpAnd64) 5560 v0 := b.NewValue0(v.Pos, OpConst64, t) 5561 v0.AuxInt = c & d 5562 v.AddArg(v0) 5563 v.AddArg(x) 5564 return true 5565 } 5566 // match: (And64 (And64 (Const64 <t> [d]) x) (Const64 <t> [c])) 5567 // result: (And64 (Const64 <t> [c&d]) x) 5568 for { 5569 _ = v.Args[1] 5570 v_0 := v.Args[0] 5571 if v_0.Op != OpAnd64 { 5572 break 5573 } 5574 x := v_0.Args[1] 5575 v_0_0 := v_0.Args[0] 5576 if v_0_0.Op != OpConst64 { 5577 break 5578 } 5579 t := v_0_0.Type 5580 d := v_0_0.AuxInt 5581 v_1 := v.Args[1] 5582 if v_1.Op != OpConst64 || v_1.Type != t { 5583 break 5584 } 5585 c := v_1.AuxInt 5586 v.reset(OpAnd64) 5587 v0 := b.NewValue0(v.Pos, OpConst64, t) 5588 v0.AuxInt = c & d 5589 v.AddArg(v0) 5590 v.AddArg(x) 5591 return true 5592 } 5593 // match: (And64 (And64 x (Const64 <t> [d])) (Const64 <t> [c])) 5594 // result: (And64 (Const64 <t> [c&d]) x) 5595 for { 5596 _ = v.Args[1] 5597 v_0 := v.Args[0] 5598 if v_0.Op != OpAnd64 { 5599 break 5600 } 5601 _ = v_0.Args[1] 5602 x := v_0.Args[0] 5603 v_0_1 := v_0.Args[1] 5604 if v_0_1.Op != OpConst64 { 5605 break 5606 } 5607 t := v_0_1.Type 5608 d := v_0_1.AuxInt 5609 v_1 := v.Args[1] 5610 if v_1.Op != OpConst64 || v_1.Type != t { 5611 break 5612 } 5613 c := v_1.AuxInt 5614 v.reset(OpAnd64) 5615 v0 := b.NewValue0(v.Pos, OpConst64, t) 5616 v0.AuxInt = c & d 5617 v.AddArg(v0) 5618 v.AddArg(x) 5619 return true 5620 } 5621 return false 5622 } 5623 func rewriteValuegeneric_OpAnd8_0(v *Value) bool { 5624 // match: (And8 (Const8 [c]) (Const8 [d])) 5625 // result: (Const8 [int64(int8(c&d))]) 5626 for { 5627 _ = v.Args[1] 5628 v_0 := v.Args[0] 5629 if v_0.Op != OpConst8 { 5630 break 5631 } 5632 c := v_0.AuxInt 5633 v_1 := v.Args[1] 5634 if v_1.Op != OpConst8 { 5635 break 5636 } 5637 d := v_1.AuxInt 5638 v.reset(OpConst8) 5639 v.AuxInt = int64(int8(c & d)) 5640 return true 5641 } 5642 // match: (And8 (Const8 [d]) (Const8 [c])) 5643 // result: (Const8 [int64(int8(c&d))]) 5644 for { 5645 _ = v.Args[1] 5646 v_0 := v.Args[0] 5647 if v_0.Op != OpConst8 { 5648 break 5649 } 5650 d := v_0.AuxInt 5651 v_1 := v.Args[1] 5652 if v_1.Op != OpConst8 { 5653 break 5654 } 5655 c := v_1.AuxInt 5656 v.reset(OpConst8) 5657 v.AuxInt = int64(int8(c & d)) 5658 return true 5659 } 5660 // match: (And8 (Const8 [m]) (Rsh8Ux64 _ (Const64 [c]))) 5661 // cond: c >= 64-ntz(m) 5662 // result: (Const8 [0]) 5663 for { 5664 _ = v.Args[1] 5665 v_0 := v.Args[0] 5666 if v_0.Op != OpConst8 { 5667 break 5668 } 5669 m := v_0.AuxInt 5670 v_1 := v.Args[1] 5671 if v_1.Op != OpRsh8Ux64 { 5672 break 5673 } 5674 _ = v_1.Args[1] 5675 v_1_1 := v_1.Args[1] 5676 if v_1_1.Op != OpConst64 { 5677 break 5678 } 5679 c := v_1_1.AuxInt 5680 if !(c >= 64-ntz(m)) { 5681 break 5682 } 5683 v.reset(OpConst8) 5684 v.AuxInt = 0 5685 return true 5686 } 5687 // match: (And8 (Rsh8Ux64 _ (Const64 [c])) (Const8 [m])) 5688 // cond: c >= 64-ntz(m) 5689 // result: (Const8 [0]) 5690 for { 5691 _ = v.Args[1] 5692 v_0 := v.Args[0] 5693 if v_0.Op != OpRsh8Ux64 { 5694 break 5695 } 5696 _ = v_0.Args[1] 5697 v_0_1 := v_0.Args[1] 5698 if v_0_1.Op != OpConst64 { 5699 break 5700 } 5701 c := v_0_1.AuxInt 5702 v_1 := v.Args[1] 5703 if v_1.Op != OpConst8 { 5704 break 5705 } 5706 m := v_1.AuxInt 5707 if !(c >= 64-ntz(m)) { 5708 break 5709 } 5710 v.reset(OpConst8) 5711 v.AuxInt = 0 5712 return true 5713 } 5714 // match: (And8 (Const8 [m]) (Lsh8x64 _ (Const64 [c]))) 5715 // cond: c >= 64-nlz(m) 5716 // result: (Const8 [0]) 5717 for { 5718 _ = v.Args[1] 5719 v_0 := v.Args[0] 5720 if v_0.Op != OpConst8 { 5721 break 5722 } 5723 m := v_0.AuxInt 5724 v_1 := v.Args[1] 5725 if v_1.Op != OpLsh8x64 { 5726 break 5727 } 5728 _ = v_1.Args[1] 5729 v_1_1 := v_1.Args[1] 5730 if v_1_1.Op != OpConst64 { 5731 break 5732 } 5733 c := v_1_1.AuxInt 5734 if !(c >= 64-nlz(m)) { 5735 break 5736 } 5737 v.reset(OpConst8) 5738 v.AuxInt = 0 5739 return true 5740 } 5741 // match: (And8 (Lsh8x64 _ (Const64 [c])) (Const8 [m])) 5742 // cond: c >= 64-nlz(m) 5743 // result: (Const8 [0]) 5744 for { 5745 _ = v.Args[1] 5746 v_0 := v.Args[0] 5747 if v_0.Op != OpLsh8x64 { 5748 break 5749 } 5750 _ = v_0.Args[1] 5751 v_0_1 := v_0.Args[1] 5752 if v_0_1.Op != OpConst64 { 5753 break 5754 } 5755 c := v_0_1.AuxInt 5756 v_1 := v.Args[1] 5757 if v_1.Op != OpConst8 { 5758 break 5759 } 5760 m := v_1.AuxInt 5761 if !(c >= 64-nlz(m)) { 5762 break 5763 } 5764 v.reset(OpConst8) 5765 v.AuxInt = 0 5766 return true 5767 } 5768 // match: (And8 x x) 5769 // result: x 5770 for { 5771 x := v.Args[1] 5772 if x != v.Args[0] { 5773 break 5774 } 5775 v.reset(OpCopy) 5776 v.Type = x.Type 5777 v.AddArg(x) 5778 return true 5779 } 5780 // match: (And8 (Const8 [-1]) x) 5781 // result: x 5782 for { 5783 x := v.Args[1] 5784 v_0 := v.Args[0] 5785 if v_0.Op != OpConst8 || v_0.AuxInt != -1 { 5786 break 5787 } 5788 v.reset(OpCopy) 5789 v.Type = x.Type 5790 v.AddArg(x) 5791 return true 5792 } 5793 // match: (And8 x (Const8 [-1])) 5794 // result: x 5795 for { 5796 _ = v.Args[1] 5797 x := v.Args[0] 5798 v_1 := v.Args[1] 5799 if v_1.Op != OpConst8 || v_1.AuxInt != -1 { 5800 break 5801 } 5802 v.reset(OpCopy) 5803 v.Type = x.Type 5804 v.AddArg(x) 5805 return true 5806 } 5807 // match: (And8 (Const8 [0]) _) 5808 // result: (Const8 [0]) 5809 for { 5810 _ = v.Args[1] 5811 v_0 := v.Args[0] 5812 if v_0.Op != OpConst8 || v_0.AuxInt != 0 { 5813 break 5814 } 5815 v.reset(OpConst8) 5816 v.AuxInt = 0 5817 return true 5818 } 5819 return false 5820 } 5821 func rewriteValuegeneric_OpAnd8_10(v *Value) bool { 5822 b := v.Block 5823 // match: (And8 _ (Const8 [0])) 5824 // result: (Const8 [0]) 5825 for { 5826 _ = v.Args[1] 5827 v_1 := v.Args[1] 5828 if v_1.Op != OpConst8 || v_1.AuxInt != 0 { 5829 break 5830 } 5831 v.reset(OpConst8) 5832 v.AuxInt = 0 5833 return true 5834 } 5835 // match: (And8 x (And8 x y)) 5836 // result: (And8 x y) 5837 for { 5838 _ = v.Args[1] 5839 x := v.Args[0] 5840 v_1 := v.Args[1] 5841 if v_1.Op != OpAnd8 { 5842 break 5843 } 5844 y := v_1.Args[1] 5845 if x != v_1.Args[0] { 5846 break 5847 } 5848 v.reset(OpAnd8) 5849 v.AddArg(x) 5850 v.AddArg(y) 5851 return true 5852 } 5853 // match: (And8 x (And8 y x)) 5854 // result: (And8 x y) 5855 for { 5856 _ = v.Args[1] 5857 x := v.Args[0] 5858 v_1 := v.Args[1] 5859 if v_1.Op != OpAnd8 { 5860 break 5861 } 5862 _ = v_1.Args[1] 5863 y := v_1.Args[0] 5864 if x != v_1.Args[1] { 5865 break 5866 } 5867 v.reset(OpAnd8) 5868 v.AddArg(x) 5869 v.AddArg(y) 5870 return true 5871 } 5872 // match: (And8 (And8 x y) x) 5873 // result: (And8 x y) 5874 for { 5875 x := v.Args[1] 5876 v_0 := v.Args[0] 5877 if v_0.Op != OpAnd8 { 5878 break 5879 } 5880 y := v_0.Args[1] 5881 if x != v_0.Args[0] { 5882 break 5883 } 5884 v.reset(OpAnd8) 5885 v.AddArg(x) 5886 v.AddArg(y) 5887 return true 5888 } 5889 // match: (And8 (And8 y x) x) 5890 // result: (And8 x y) 5891 for { 5892 x := v.Args[1] 5893 v_0 := v.Args[0] 5894 if v_0.Op != OpAnd8 { 5895 break 5896 } 5897 _ = v_0.Args[1] 5898 y := v_0.Args[0] 5899 if x != v_0.Args[1] { 5900 break 5901 } 5902 v.reset(OpAnd8) 5903 v.AddArg(x) 5904 v.AddArg(y) 5905 return true 5906 } 5907 // match: (And8 (And8 i:(Const8 <t>) z) x) 5908 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 5909 // result: (And8 i (And8 <t> z x)) 5910 for { 5911 x := v.Args[1] 5912 v_0 := v.Args[0] 5913 if v_0.Op != OpAnd8 { 5914 break 5915 } 5916 z := v_0.Args[1] 5917 i := v_0.Args[0] 5918 if i.Op != OpConst8 { 5919 break 5920 } 5921 t := i.Type 5922 if !(z.Op != OpConst8 && x.Op != OpConst8) { 5923 break 5924 } 5925 v.reset(OpAnd8) 5926 v.AddArg(i) 5927 v0 := b.NewValue0(v.Pos, OpAnd8, t) 5928 v0.AddArg(z) 5929 v0.AddArg(x) 5930 v.AddArg(v0) 5931 return true 5932 } 5933 // match: (And8 (And8 z i:(Const8 <t>)) x) 5934 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 5935 // result: (And8 i (And8 <t> z x)) 5936 for { 5937 x := v.Args[1] 5938 v_0 := v.Args[0] 5939 if v_0.Op != OpAnd8 { 5940 break 5941 } 5942 _ = v_0.Args[1] 5943 z := v_0.Args[0] 5944 i := v_0.Args[1] 5945 if i.Op != OpConst8 { 5946 break 5947 } 5948 t := i.Type 5949 if !(z.Op != OpConst8 && x.Op != OpConst8) { 5950 break 5951 } 5952 v.reset(OpAnd8) 5953 v.AddArg(i) 5954 v0 := b.NewValue0(v.Pos, OpAnd8, t) 5955 v0.AddArg(z) 5956 v0.AddArg(x) 5957 v.AddArg(v0) 5958 return true 5959 } 5960 // match: (And8 x (And8 i:(Const8 <t>) z)) 5961 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 5962 // result: (And8 i (And8 <t> z x)) 5963 for { 5964 _ = v.Args[1] 5965 x := v.Args[0] 5966 v_1 := v.Args[1] 5967 if v_1.Op != OpAnd8 { 5968 break 5969 } 5970 z := v_1.Args[1] 5971 i := v_1.Args[0] 5972 if i.Op != OpConst8 { 5973 break 5974 } 5975 t := i.Type 5976 if !(z.Op != OpConst8 && x.Op != OpConst8) { 5977 break 5978 } 5979 v.reset(OpAnd8) 5980 v.AddArg(i) 5981 v0 := b.NewValue0(v.Pos, OpAnd8, t) 5982 v0.AddArg(z) 5983 v0.AddArg(x) 5984 v.AddArg(v0) 5985 return true 5986 } 5987 // match: (And8 x (And8 z i:(Const8 <t>))) 5988 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 5989 // result: (And8 i (And8 <t> z x)) 5990 for { 5991 _ = v.Args[1] 5992 x := v.Args[0] 5993 v_1 := v.Args[1] 5994 if v_1.Op != OpAnd8 { 5995 break 5996 } 5997 _ = v_1.Args[1] 5998 z := v_1.Args[0] 5999 i := v_1.Args[1] 6000 if i.Op != OpConst8 { 6001 break 6002 } 6003 t := i.Type 6004 if !(z.Op != OpConst8 && x.Op != OpConst8) { 6005 break 6006 } 6007 v.reset(OpAnd8) 6008 v.AddArg(i) 6009 v0 := b.NewValue0(v.Pos, OpAnd8, t) 6010 v0.AddArg(z) 6011 v0.AddArg(x) 6012 v.AddArg(v0) 6013 return true 6014 } 6015 // match: (And8 (Const8 <t> [c]) (And8 (Const8 <t> [d]) x)) 6016 // result: (And8 (Const8 <t> [int64(int8(c&d))]) x) 6017 for { 6018 _ = v.Args[1] 6019 v_0 := v.Args[0] 6020 if v_0.Op != OpConst8 { 6021 break 6022 } 6023 t := v_0.Type 6024 c := v_0.AuxInt 6025 v_1 := v.Args[1] 6026 if v_1.Op != OpAnd8 { 6027 break 6028 } 6029 x := v_1.Args[1] 6030 v_1_0 := v_1.Args[0] 6031 if v_1_0.Op != OpConst8 || v_1_0.Type != t { 6032 break 6033 } 6034 d := v_1_0.AuxInt 6035 v.reset(OpAnd8) 6036 v0 := b.NewValue0(v.Pos, OpConst8, t) 6037 v0.AuxInt = int64(int8(c & d)) 6038 v.AddArg(v0) 6039 v.AddArg(x) 6040 return true 6041 } 6042 return false 6043 } 6044 func rewriteValuegeneric_OpAnd8_20(v *Value) bool { 6045 b := v.Block 6046 // match: (And8 (Const8 <t> [c]) (And8 x (Const8 <t> [d]))) 6047 // result: (And8 (Const8 <t> [int64(int8(c&d))]) x) 6048 for { 6049 _ = v.Args[1] 6050 v_0 := v.Args[0] 6051 if v_0.Op != OpConst8 { 6052 break 6053 } 6054 t := v_0.Type 6055 c := v_0.AuxInt 6056 v_1 := v.Args[1] 6057 if v_1.Op != OpAnd8 { 6058 break 6059 } 6060 _ = v_1.Args[1] 6061 x := v_1.Args[0] 6062 v_1_1 := v_1.Args[1] 6063 if v_1_1.Op != OpConst8 || v_1_1.Type != t { 6064 break 6065 } 6066 d := v_1_1.AuxInt 6067 v.reset(OpAnd8) 6068 v0 := b.NewValue0(v.Pos, OpConst8, t) 6069 v0.AuxInt = int64(int8(c & d)) 6070 v.AddArg(v0) 6071 v.AddArg(x) 6072 return true 6073 } 6074 // match: (And8 (And8 (Const8 <t> [d]) x) (Const8 <t> [c])) 6075 // result: (And8 (Const8 <t> [int64(int8(c&d))]) x) 6076 for { 6077 _ = v.Args[1] 6078 v_0 := v.Args[0] 6079 if v_0.Op != OpAnd8 { 6080 break 6081 } 6082 x := v_0.Args[1] 6083 v_0_0 := v_0.Args[0] 6084 if v_0_0.Op != OpConst8 { 6085 break 6086 } 6087 t := v_0_0.Type 6088 d := v_0_0.AuxInt 6089 v_1 := v.Args[1] 6090 if v_1.Op != OpConst8 || v_1.Type != t { 6091 break 6092 } 6093 c := v_1.AuxInt 6094 v.reset(OpAnd8) 6095 v0 := b.NewValue0(v.Pos, OpConst8, t) 6096 v0.AuxInt = int64(int8(c & d)) 6097 v.AddArg(v0) 6098 v.AddArg(x) 6099 return true 6100 } 6101 // match: (And8 (And8 x (Const8 <t> [d])) (Const8 <t> [c])) 6102 // result: (And8 (Const8 <t> [int64(int8(c&d))]) x) 6103 for { 6104 _ = v.Args[1] 6105 v_0 := v.Args[0] 6106 if v_0.Op != OpAnd8 { 6107 break 6108 } 6109 _ = v_0.Args[1] 6110 x := v_0.Args[0] 6111 v_0_1 := v_0.Args[1] 6112 if v_0_1.Op != OpConst8 { 6113 break 6114 } 6115 t := v_0_1.Type 6116 d := v_0_1.AuxInt 6117 v_1 := v.Args[1] 6118 if v_1.Op != OpConst8 || v_1.Type != t { 6119 break 6120 } 6121 c := v_1.AuxInt 6122 v.reset(OpAnd8) 6123 v0 := b.NewValue0(v.Pos, OpConst8, t) 6124 v0.AuxInt = int64(int8(c & d)) 6125 v.AddArg(v0) 6126 v.AddArg(x) 6127 return true 6128 } 6129 return false 6130 } 6131 func rewriteValuegeneric_OpArraySelect_0(v *Value) bool { 6132 // match: (ArraySelect (ArrayMake1 x)) 6133 // result: x 6134 for { 6135 v_0 := v.Args[0] 6136 if v_0.Op != OpArrayMake1 { 6137 break 6138 } 6139 x := v_0.Args[0] 6140 v.reset(OpCopy) 6141 v.Type = x.Type 6142 v.AddArg(x) 6143 return true 6144 } 6145 // match: (ArraySelect [0] (IData x)) 6146 // result: (IData x) 6147 for { 6148 if v.AuxInt != 0 { 6149 break 6150 } 6151 v_0 := v.Args[0] 6152 if v_0.Op != OpIData { 6153 break 6154 } 6155 x := v_0.Args[0] 6156 v.reset(OpIData) 6157 v.AddArg(x) 6158 return true 6159 } 6160 return false 6161 } 6162 func rewriteValuegeneric_OpCom16_0(v *Value) bool { 6163 // match: (Com16 (Com16 x)) 6164 // result: x 6165 for { 6166 v_0 := v.Args[0] 6167 if v_0.Op != OpCom16 { 6168 break 6169 } 6170 x := v_0.Args[0] 6171 v.reset(OpCopy) 6172 v.Type = x.Type 6173 v.AddArg(x) 6174 return true 6175 } 6176 // match: (Com16 (Const16 [c])) 6177 // result: (Const16 [^c]) 6178 for { 6179 v_0 := v.Args[0] 6180 if v_0.Op != OpConst16 { 6181 break 6182 } 6183 c := v_0.AuxInt 6184 v.reset(OpConst16) 6185 v.AuxInt = ^c 6186 return true 6187 } 6188 // match: (Com16 (Add16 (Const16 [-1]) x)) 6189 // result: (Neg16 x) 6190 for { 6191 v_0 := v.Args[0] 6192 if v_0.Op != OpAdd16 { 6193 break 6194 } 6195 x := v_0.Args[1] 6196 v_0_0 := v_0.Args[0] 6197 if v_0_0.Op != OpConst16 || v_0_0.AuxInt != -1 { 6198 break 6199 } 6200 v.reset(OpNeg16) 6201 v.AddArg(x) 6202 return true 6203 } 6204 // match: (Com16 (Add16 x (Const16 [-1]))) 6205 // result: (Neg16 x) 6206 for { 6207 v_0 := v.Args[0] 6208 if v_0.Op != OpAdd16 { 6209 break 6210 } 6211 _ = v_0.Args[1] 6212 x := v_0.Args[0] 6213 v_0_1 := v_0.Args[1] 6214 if v_0_1.Op != OpConst16 || v_0_1.AuxInt != -1 { 6215 break 6216 } 6217 v.reset(OpNeg16) 6218 v.AddArg(x) 6219 return true 6220 } 6221 return false 6222 } 6223 func rewriteValuegeneric_OpCom32_0(v *Value) bool { 6224 // match: (Com32 (Com32 x)) 6225 // result: x 6226 for { 6227 v_0 := v.Args[0] 6228 if v_0.Op != OpCom32 { 6229 break 6230 } 6231 x := v_0.Args[0] 6232 v.reset(OpCopy) 6233 v.Type = x.Type 6234 v.AddArg(x) 6235 return true 6236 } 6237 // match: (Com32 (Const32 [c])) 6238 // result: (Const32 [^c]) 6239 for { 6240 v_0 := v.Args[0] 6241 if v_0.Op != OpConst32 { 6242 break 6243 } 6244 c := v_0.AuxInt 6245 v.reset(OpConst32) 6246 v.AuxInt = ^c 6247 return true 6248 } 6249 // match: (Com32 (Add32 (Const32 [-1]) x)) 6250 // result: (Neg32 x) 6251 for { 6252 v_0 := v.Args[0] 6253 if v_0.Op != OpAdd32 { 6254 break 6255 } 6256 x := v_0.Args[1] 6257 v_0_0 := v_0.Args[0] 6258 if v_0_0.Op != OpConst32 || v_0_0.AuxInt != -1 { 6259 break 6260 } 6261 v.reset(OpNeg32) 6262 v.AddArg(x) 6263 return true 6264 } 6265 // match: (Com32 (Add32 x (Const32 [-1]))) 6266 // result: (Neg32 x) 6267 for { 6268 v_0 := v.Args[0] 6269 if v_0.Op != OpAdd32 { 6270 break 6271 } 6272 _ = v_0.Args[1] 6273 x := v_0.Args[0] 6274 v_0_1 := v_0.Args[1] 6275 if v_0_1.Op != OpConst32 || v_0_1.AuxInt != -1 { 6276 break 6277 } 6278 v.reset(OpNeg32) 6279 v.AddArg(x) 6280 return true 6281 } 6282 return false 6283 } 6284 func rewriteValuegeneric_OpCom64_0(v *Value) bool { 6285 // match: (Com64 (Com64 x)) 6286 // result: x 6287 for { 6288 v_0 := v.Args[0] 6289 if v_0.Op != OpCom64 { 6290 break 6291 } 6292 x := v_0.Args[0] 6293 v.reset(OpCopy) 6294 v.Type = x.Type 6295 v.AddArg(x) 6296 return true 6297 } 6298 // match: (Com64 (Const64 [c])) 6299 // result: (Const64 [^c]) 6300 for { 6301 v_0 := v.Args[0] 6302 if v_0.Op != OpConst64 { 6303 break 6304 } 6305 c := v_0.AuxInt 6306 v.reset(OpConst64) 6307 v.AuxInt = ^c 6308 return true 6309 } 6310 // match: (Com64 (Add64 (Const64 [-1]) x)) 6311 // result: (Neg64 x) 6312 for { 6313 v_0 := v.Args[0] 6314 if v_0.Op != OpAdd64 { 6315 break 6316 } 6317 x := v_0.Args[1] 6318 v_0_0 := v_0.Args[0] 6319 if v_0_0.Op != OpConst64 || v_0_0.AuxInt != -1 { 6320 break 6321 } 6322 v.reset(OpNeg64) 6323 v.AddArg(x) 6324 return true 6325 } 6326 // match: (Com64 (Add64 x (Const64 [-1]))) 6327 // result: (Neg64 x) 6328 for { 6329 v_0 := v.Args[0] 6330 if v_0.Op != OpAdd64 { 6331 break 6332 } 6333 _ = v_0.Args[1] 6334 x := v_0.Args[0] 6335 v_0_1 := v_0.Args[1] 6336 if v_0_1.Op != OpConst64 || v_0_1.AuxInt != -1 { 6337 break 6338 } 6339 v.reset(OpNeg64) 6340 v.AddArg(x) 6341 return true 6342 } 6343 return false 6344 } 6345 func rewriteValuegeneric_OpCom8_0(v *Value) bool { 6346 // match: (Com8 (Com8 x)) 6347 // result: x 6348 for { 6349 v_0 := v.Args[0] 6350 if v_0.Op != OpCom8 { 6351 break 6352 } 6353 x := v_0.Args[0] 6354 v.reset(OpCopy) 6355 v.Type = x.Type 6356 v.AddArg(x) 6357 return true 6358 } 6359 // match: (Com8 (Const8 [c])) 6360 // result: (Const8 [^c]) 6361 for { 6362 v_0 := v.Args[0] 6363 if v_0.Op != OpConst8 { 6364 break 6365 } 6366 c := v_0.AuxInt 6367 v.reset(OpConst8) 6368 v.AuxInt = ^c 6369 return true 6370 } 6371 // match: (Com8 (Add8 (Const8 [-1]) x)) 6372 // result: (Neg8 x) 6373 for { 6374 v_0 := v.Args[0] 6375 if v_0.Op != OpAdd8 { 6376 break 6377 } 6378 x := v_0.Args[1] 6379 v_0_0 := v_0.Args[0] 6380 if v_0_0.Op != OpConst8 || v_0_0.AuxInt != -1 { 6381 break 6382 } 6383 v.reset(OpNeg8) 6384 v.AddArg(x) 6385 return true 6386 } 6387 // match: (Com8 (Add8 x (Const8 [-1]))) 6388 // result: (Neg8 x) 6389 for { 6390 v_0 := v.Args[0] 6391 if v_0.Op != OpAdd8 { 6392 break 6393 } 6394 _ = v_0.Args[1] 6395 x := v_0.Args[0] 6396 v_0_1 := v_0.Args[1] 6397 if v_0_1.Op != OpConst8 || v_0_1.AuxInt != -1 { 6398 break 6399 } 6400 v.reset(OpNeg8) 6401 v.AddArg(x) 6402 return true 6403 } 6404 return false 6405 } 6406 func rewriteValuegeneric_OpConstInterface_0(v *Value) bool { 6407 b := v.Block 6408 typ := &b.Func.Config.Types 6409 // match: (ConstInterface) 6410 // result: (IMake (ConstNil <typ.Uintptr>) (ConstNil <typ.BytePtr>)) 6411 for { 6412 v.reset(OpIMake) 6413 v0 := b.NewValue0(v.Pos, OpConstNil, typ.Uintptr) 6414 v.AddArg(v0) 6415 v1 := b.NewValue0(v.Pos, OpConstNil, typ.BytePtr) 6416 v.AddArg(v1) 6417 return true 6418 } 6419 } 6420 func rewriteValuegeneric_OpConstSlice_0(v *Value) bool { 6421 b := v.Block 6422 config := b.Func.Config 6423 typ := &b.Func.Config.Types 6424 // match: (ConstSlice) 6425 // cond: config.PtrSize == 4 6426 // result: (SliceMake (ConstNil <v.Type.Elem().PtrTo()>) (Const32 <typ.Int> [0]) (Const32 <typ.Int> [0])) 6427 for { 6428 if !(config.PtrSize == 4) { 6429 break 6430 } 6431 v.reset(OpSliceMake) 6432 v0 := b.NewValue0(v.Pos, OpConstNil, v.Type.Elem().PtrTo()) 6433 v.AddArg(v0) 6434 v1 := b.NewValue0(v.Pos, OpConst32, typ.Int) 6435 v1.AuxInt = 0 6436 v.AddArg(v1) 6437 v2 := b.NewValue0(v.Pos, OpConst32, typ.Int) 6438 v2.AuxInt = 0 6439 v.AddArg(v2) 6440 return true 6441 } 6442 // match: (ConstSlice) 6443 // cond: config.PtrSize == 8 6444 // result: (SliceMake (ConstNil <v.Type.Elem().PtrTo()>) (Const64 <typ.Int> [0]) (Const64 <typ.Int> [0])) 6445 for { 6446 if !(config.PtrSize == 8) { 6447 break 6448 } 6449 v.reset(OpSliceMake) 6450 v0 := b.NewValue0(v.Pos, OpConstNil, v.Type.Elem().PtrTo()) 6451 v.AddArg(v0) 6452 v1 := b.NewValue0(v.Pos, OpConst64, typ.Int) 6453 v1.AuxInt = 0 6454 v.AddArg(v1) 6455 v2 := b.NewValue0(v.Pos, OpConst64, typ.Int) 6456 v2.AuxInt = 0 6457 v.AddArg(v2) 6458 return true 6459 } 6460 return false 6461 } 6462 func rewriteValuegeneric_OpConstString_0(v *Value) bool { 6463 b := v.Block 6464 config := b.Func.Config 6465 fe := b.Func.fe 6466 typ := &b.Func.Config.Types 6467 // match: (ConstString {s}) 6468 // cond: config.PtrSize == 4 && s.(string) == "" 6469 // result: (StringMake (ConstNil) (Const32 <typ.Int> [0])) 6470 for { 6471 s := v.Aux 6472 if !(config.PtrSize == 4 && s.(string) == "") { 6473 break 6474 } 6475 v.reset(OpStringMake) 6476 v0 := b.NewValue0(v.Pos, OpConstNil, typ.BytePtr) 6477 v.AddArg(v0) 6478 v1 := b.NewValue0(v.Pos, OpConst32, typ.Int) 6479 v1.AuxInt = 0 6480 v.AddArg(v1) 6481 return true 6482 } 6483 // match: (ConstString {s}) 6484 // cond: config.PtrSize == 8 && s.(string) == "" 6485 // result: (StringMake (ConstNil) (Const64 <typ.Int> [0])) 6486 for { 6487 s := v.Aux 6488 if !(config.PtrSize == 8 && s.(string) == "") { 6489 break 6490 } 6491 v.reset(OpStringMake) 6492 v0 := b.NewValue0(v.Pos, OpConstNil, typ.BytePtr) 6493 v.AddArg(v0) 6494 v1 := b.NewValue0(v.Pos, OpConst64, typ.Int) 6495 v1.AuxInt = 0 6496 v.AddArg(v1) 6497 return true 6498 } 6499 // match: (ConstString {s}) 6500 // cond: config.PtrSize == 4 && s.(string) != "" 6501 // result: (StringMake (Addr <typ.BytePtr> {fe.StringData(s.(string))} (SB)) (Const32 <typ.Int> [int64(len(s.(string)))])) 6502 for { 6503 s := v.Aux 6504 if !(config.PtrSize == 4 && s.(string) != "") { 6505 break 6506 } 6507 v.reset(OpStringMake) 6508 v0 := b.NewValue0(v.Pos, OpAddr, typ.BytePtr) 6509 v0.Aux = fe.StringData(s.(string)) 6510 v1 := b.NewValue0(v.Pos, OpSB, typ.Uintptr) 6511 v0.AddArg(v1) 6512 v.AddArg(v0) 6513 v2 := b.NewValue0(v.Pos, OpConst32, typ.Int) 6514 v2.AuxInt = int64(len(s.(string))) 6515 v.AddArg(v2) 6516 return true 6517 } 6518 // match: (ConstString {s}) 6519 // cond: config.PtrSize == 8 && s.(string) != "" 6520 // result: (StringMake (Addr <typ.BytePtr> {fe.StringData(s.(string))} (SB)) (Const64 <typ.Int> [int64(len(s.(string)))])) 6521 for { 6522 s := v.Aux 6523 if !(config.PtrSize == 8 && s.(string) != "") { 6524 break 6525 } 6526 v.reset(OpStringMake) 6527 v0 := b.NewValue0(v.Pos, OpAddr, typ.BytePtr) 6528 v0.Aux = fe.StringData(s.(string)) 6529 v1 := b.NewValue0(v.Pos, OpSB, typ.Uintptr) 6530 v0.AddArg(v1) 6531 v.AddArg(v0) 6532 v2 := b.NewValue0(v.Pos, OpConst64, typ.Int) 6533 v2.AuxInt = int64(len(s.(string))) 6534 v.AddArg(v2) 6535 return true 6536 } 6537 return false 6538 } 6539 func rewriteValuegeneric_OpConvert_0(v *Value) bool { 6540 // match: (Convert (Add64 (Convert ptr mem) off) mem) 6541 // result: (Add64 ptr off) 6542 for { 6543 mem := v.Args[1] 6544 v_0 := v.Args[0] 6545 if v_0.Op != OpAdd64 { 6546 break 6547 } 6548 off := v_0.Args[1] 6549 v_0_0 := v_0.Args[0] 6550 if v_0_0.Op != OpConvert { 6551 break 6552 } 6553 _ = v_0_0.Args[1] 6554 ptr := v_0_0.Args[0] 6555 if mem != v_0_0.Args[1] { 6556 break 6557 } 6558 v.reset(OpAdd64) 6559 v.AddArg(ptr) 6560 v.AddArg(off) 6561 return true 6562 } 6563 // match: (Convert (Add64 off (Convert ptr mem)) mem) 6564 // result: (Add64 ptr off) 6565 for { 6566 mem := v.Args[1] 6567 v_0 := v.Args[0] 6568 if v_0.Op != OpAdd64 { 6569 break 6570 } 6571 _ = v_0.Args[1] 6572 off := v_0.Args[0] 6573 v_0_1 := v_0.Args[1] 6574 if v_0_1.Op != OpConvert { 6575 break 6576 } 6577 _ = v_0_1.Args[1] 6578 ptr := v_0_1.Args[0] 6579 if mem != v_0_1.Args[1] { 6580 break 6581 } 6582 v.reset(OpAdd64) 6583 v.AddArg(ptr) 6584 v.AddArg(off) 6585 return true 6586 } 6587 // match: (Convert (Add32 (Convert ptr mem) off) mem) 6588 // result: (Add32 ptr off) 6589 for { 6590 mem := v.Args[1] 6591 v_0 := v.Args[0] 6592 if v_0.Op != OpAdd32 { 6593 break 6594 } 6595 off := v_0.Args[1] 6596 v_0_0 := v_0.Args[0] 6597 if v_0_0.Op != OpConvert { 6598 break 6599 } 6600 _ = v_0_0.Args[1] 6601 ptr := v_0_0.Args[0] 6602 if mem != v_0_0.Args[1] { 6603 break 6604 } 6605 v.reset(OpAdd32) 6606 v.AddArg(ptr) 6607 v.AddArg(off) 6608 return true 6609 } 6610 // match: (Convert (Add32 off (Convert ptr mem)) mem) 6611 // result: (Add32 ptr off) 6612 for { 6613 mem := v.Args[1] 6614 v_0 := v.Args[0] 6615 if v_0.Op != OpAdd32 { 6616 break 6617 } 6618 _ = v_0.Args[1] 6619 off := v_0.Args[0] 6620 v_0_1 := v_0.Args[1] 6621 if v_0_1.Op != OpConvert { 6622 break 6623 } 6624 _ = v_0_1.Args[1] 6625 ptr := v_0_1.Args[0] 6626 if mem != v_0_1.Args[1] { 6627 break 6628 } 6629 v.reset(OpAdd32) 6630 v.AddArg(ptr) 6631 v.AddArg(off) 6632 return true 6633 } 6634 // match: (Convert (Convert ptr mem) mem) 6635 // result: ptr 6636 for { 6637 mem := v.Args[1] 6638 v_0 := v.Args[0] 6639 if v_0.Op != OpConvert { 6640 break 6641 } 6642 _ = v_0.Args[1] 6643 ptr := v_0.Args[0] 6644 if mem != v_0.Args[1] { 6645 break 6646 } 6647 v.reset(OpCopy) 6648 v.Type = ptr.Type 6649 v.AddArg(ptr) 6650 return true 6651 } 6652 return false 6653 } 6654 func rewriteValuegeneric_OpCvt32Fto32_0(v *Value) bool { 6655 // match: (Cvt32Fto32 (Const32F [c])) 6656 // result: (Const32 [int64(int32(auxTo32F(c)))]) 6657 for { 6658 v_0 := v.Args[0] 6659 if v_0.Op != OpConst32F { 6660 break 6661 } 6662 c := v_0.AuxInt 6663 v.reset(OpConst32) 6664 v.AuxInt = int64(int32(auxTo32F(c))) 6665 return true 6666 } 6667 return false 6668 } 6669 func rewriteValuegeneric_OpCvt32Fto64_0(v *Value) bool { 6670 // match: (Cvt32Fto64 (Const32F [c])) 6671 // result: (Const64 [int64(auxTo32F(c))]) 6672 for { 6673 v_0 := v.Args[0] 6674 if v_0.Op != OpConst32F { 6675 break 6676 } 6677 c := v_0.AuxInt 6678 v.reset(OpConst64) 6679 v.AuxInt = int64(auxTo32F(c)) 6680 return true 6681 } 6682 return false 6683 } 6684 func rewriteValuegeneric_OpCvt32Fto64F_0(v *Value) bool { 6685 // match: (Cvt32Fto64F (Const32F [c])) 6686 // result: (Const64F [c]) 6687 for { 6688 v_0 := v.Args[0] 6689 if v_0.Op != OpConst32F { 6690 break 6691 } 6692 c := v_0.AuxInt 6693 v.reset(OpConst64F) 6694 v.AuxInt = c 6695 return true 6696 } 6697 return false 6698 } 6699 func rewriteValuegeneric_OpCvt32to32F_0(v *Value) bool { 6700 // match: (Cvt32to32F (Const32 [c])) 6701 // result: (Const32F [auxFrom32F(float32(int32(c)))]) 6702 for { 6703 v_0 := v.Args[0] 6704 if v_0.Op != OpConst32 { 6705 break 6706 } 6707 c := v_0.AuxInt 6708 v.reset(OpConst32F) 6709 v.AuxInt = auxFrom32F(float32(int32(c))) 6710 return true 6711 } 6712 return false 6713 } 6714 func rewriteValuegeneric_OpCvt32to64F_0(v *Value) bool { 6715 // match: (Cvt32to64F (Const32 [c])) 6716 // result: (Const64F [auxFrom64F(float64(int32(c)))]) 6717 for { 6718 v_0 := v.Args[0] 6719 if v_0.Op != OpConst32 { 6720 break 6721 } 6722 c := v_0.AuxInt 6723 v.reset(OpConst64F) 6724 v.AuxInt = auxFrom64F(float64(int32(c))) 6725 return true 6726 } 6727 return false 6728 } 6729 func rewriteValuegeneric_OpCvt64Fto32_0(v *Value) bool { 6730 // match: (Cvt64Fto32 (Const64F [c])) 6731 // result: (Const32 [int64(int32(auxTo64F(c)))]) 6732 for { 6733 v_0 := v.Args[0] 6734 if v_0.Op != OpConst64F { 6735 break 6736 } 6737 c := v_0.AuxInt 6738 v.reset(OpConst32) 6739 v.AuxInt = int64(int32(auxTo64F(c))) 6740 return true 6741 } 6742 return false 6743 } 6744 func rewriteValuegeneric_OpCvt64Fto32F_0(v *Value) bool { 6745 // match: (Cvt64Fto32F (Const64F [c])) 6746 // result: (Const32F [auxFrom32F(float32(auxTo64F(c)))]) 6747 for { 6748 v_0 := v.Args[0] 6749 if v_0.Op != OpConst64F { 6750 break 6751 } 6752 c := v_0.AuxInt 6753 v.reset(OpConst32F) 6754 v.AuxInt = auxFrom32F(float32(auxTo64F(c))) 6755 return true 6756 } 6757 return false 6758 } 6759 func rewriteValuegeneric_OpCvt64Fto64_0(v *Value) bool { 6760 // match: (Cvt64Fto64 (Const64F [c])) 6761 // result: (Const64 [int64(auxTo64F(c))]) 6762 for { 6763 v_0 := v.Args[0] 6764 if v_0.Op != OpConst64F { 6765 break 6766 } 6767 c := v_0.AuxInt 6768 v.reset(OpConst64) 6769 v.AuxInt = int64(auxTo64F(c)) 6770 return true 6771 } 6772 return false 6773 } 6774 func rewriteValuegeneric_OpCvt64to32F_0(v *Value) bool { 6775 // match: (Cvt64to32F (Const64 [c])) 6776 // result: (Const32F [auxFrom32F(float32(c))]) 6777 for { 6778 v_0 := v.Args[0] 6779 if v_0.Op != OpConst64 { 6780 break 6781 } 6782 c := v_0.AuxInt 6783 v.reset(OpConst32F) 6784 v.AuxInt = auxFrom32F(float32(c)) 6785 return true 6786 } 6787 return false 6788 } 6789 func rewriteValuegeneric_OpCvt64to64F_0(v *Value) bool { 6790 // match: (Cvt64to64F (Const64 [c])) 6791 // result: (Const64F [auxFrom64F(float64(c))]) 6792 for { 6793 v_0 := v.Args[0] 6794 if v_0.Op != OpConst64 { 6795 break 6796 } 6797 c := v_0.AuxInt 6798 v.reset(OpConst64F) 6799 v.AuxInt = auxFrom64F(float64(c)) 6800 return true 6801 } 6802 return false 6803 } 6804 func rewriteValuegeneric_OpDiv16_0(v *Value) bool { 6805 b := v.Block 6806 typ := &b.Func.Config.Types 6807 // match: (Div16 (Const16 [c]) (Const16 [d])) 6808 // cond: d != 0 6809 // result: (Const16 [int64(int16(c)/int16(d))]) 6810 for { 6811 _ = v.Args[1] 6812 v_0 := v.Args[0] 6813 if v_0.Op != OpConst16 { 6814 break 6815 } 6816 c := v_0.AuxInt 6817 v_1 := v.Args[1] 6818 if v_1.Op != OpConst16 { 6819 break 6820 } 6821 d := v_1.AuxInt 6822 if !(d != 0) { 6823 break 6824 } 6825 v.reset(OpConst16) 6826 v.AuxInt = int64(int16(c) / int16(d)) 6827 return true 6828 } 6829 // match: (Div16 n (Const16 [c])) 6830 // cond: isNonNegative(n) && isPowerOfTwo(c&0xffff) 6831 // result: (Rsh16Ux64 n (Const64 <typ.UInt64> [log2(c&0xffff)])) 6832 for { 6833 _ = v.Args[1] 6834 n := v.Args[0] 6835 v_1 := v.Args[1] 6836 if v_1.Op != OpConst16 { 6837 break 6838 } 6839 c := v_1.AuxInt 6840 if !(isNonNegative(n) && isPowerOfTwo(c&0xffff)) { 6841 break 6842 } 6843 v.reset(OpRsh16Ux64) 6844 v.AddArg(n) 6845 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 6846 v0.AuxInt = log2(c & 0xffff) 6847 v.AddArg(v0) 6848 return true 6849 } 6850 // match: (Div16 <t> n (Const16 [c])) 6851 // cond: c < 0 && c != -1<<15 6852 // result: (Neg16 (Div16 <t> n (Const16 <t> [-c]))) 6853 for { 6854 t := v.Type 6855 _ = v.Args[1] 6856 n := v.Args[0] 6857 v_1 := v.Args[1] 6858 if v_1.Op != OpConst16 { 6859 break 6860 } 6861 c := v_1.AuxInt 6862 if !(c < 0 && c != -1<<15) { 6863 break 6864 } 6865 v.reset(OpNeg16) 6866 v0 := b.NewValue0(v.Pos, OpDiv16, t) 6867 v0.AddArg(n) 6868 v1 := b.NewValue0(v.Pos, OpConst16, t) 6869 v1.AuxInt = -c 6870 v0.AddArg(v1) 6871 v.AddArg(v0) 6872 return true 6873 } 6874 // match: (Div16 <t> x (Const16 [-1<<15])) 6875 // result: (Rsh16Ux64 (And16 <t> x (Neg16 <t> x)) (Const64 <typ.UInt64> [15])) 6876 for { 6877 t := v.Type 6878 _ = v.Args[1] 6879 x := v.Args[0] 6880 v_1 := v.Args[1] 6881 if v_1.Op != OpConst16 || v_1.AuxInt != -1<<15 { 6882 break 6883 } 6884 v.reset(OpRsh16Ux64) 6885 v0 := b.NewValue0(v.Pos, OpAnd16, t) 6886 v0.AddArg(x) 6887 v1 := b.NewValue0(v.Pos, OpNeg16, t) 6888 v1.AddArg(x) 6889 v0.AddArg(v1) 6890 v.AddArg(v0) 6891 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 6892 v2.AuxInt = 15 6893 v.AddArg(v2) 6894 return true 6895 } 6896 // match: (Div16 <t> n (Const16 [c])) 6897 // cond: isPowerOfTwo(c) 6898 // result: (Rsh16x64 (Add16 <t> n (Rsh16Ux64 <t> (Rsh16x64 <t> n (Const64 <typ.UInt64> [15])) (Const64 <typ.UInt64> [16-log2(c)]))) (Const64 <typ.UInt64> [log2(c)])) 6899 for { 6900 t := v.Type 6901 _ = v.Args[1] 6902 n := v.Args[0] 6903 v_1 := v.Args[1] 6904 if v_1.Op != OpConst16 { 6905 break 6906 } 6907 c := v_1.AuxInt 6908 if !(isPowerOfTwo(c)) { 6909 break 6910 } 6911 v.reset(OpRsh16x64) 6912 v0 := b.NewValue0(v.Pos, OpAdd16, t) 6913 v0.AddArg(n) 6914 v1 := b.NewValue0(v.Pos, OpRsh16Ux64, t) 6915 v2 := b.NewValue0(v.Pos, OpRsh16x64, t) 6916 v2.AddArg(n) 6917 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 6918 v3.AuxInt = 15 6919 v2.AddArg(v3) 6920 v1.AddArg(v2) 6921 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 6922 v4.AuxInt = 16 - log2(c) 6923 v1.AddArg(v4) 6924 v0.AddArg(v1) 6925 v.AddArg(v0) 6926 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 6927 v5.AuxInt = log2(c) 6928 v.AddArg(v5) 6929 return true 6930 } 6931 // match: (Div16 <t> x (Const16 [c])) 6932 // cond: smagicOK(16,c) 6933 // result: (Sub16 <t> (Rsh32x64 <t> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(smagic(16,c).m)]) (SignExt16to32 x)) (Const64 <typ.UInt64> [16+smagic(16,c).s])) (Rsh32x64 <t> (SignExt16to32 x) (Const64 <typ.UInt64> [31]))) 6934 for { 6935 t := v.Type 6936 _ = v.Args[1] 6937 x := v.Args[0] 6938 v_1 := v.Args[1] 6939 if v_1.Op != OpConst16 { 6940 break 6941 } 6942 c := v_1.AuxInt 6943 if !(smagicOK(16, c)) { 6944 break 6945 } 6946 v.reset(OpSub16) 6947 v.Type = t 6948 v0 := b.NewValue0(v.Pos, OpRsh32x64, t) 6949 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 6950 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 6951 v2.AuxInt = int64(smagic(16, c).m) 6952 v1.AddArg(v2) 6953 v3 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 6954 v3.AddArg(x) 6955 v1.AddArg(v3) 6956 v0.AddArg(v1) 6957 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 6958 v4.AuxInt = 16 + smagic(16, c).s 6959 v0.AddArg(v4) 6960 v.AddArg(v0) 6961 v5 := b.NewValue0(v.Pos, OpRsh32x64, t) 6962 v6 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 6963 v6.AddArg(x) 6964 v5.AddArg(v6) 6965 v7 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 6966 v7.AuxInt = 31 6967 v5.AddArg(v7) 6968 v.AddArg(v5) 6969 return true 6970 } 6971 return false 6972 } 6973 func rewriteValuegeneric_OpDiv16u_0(v *Value) bool { 6974 b := v.Block 6975 config := b.Func.Config 6976 typ := &b.Func.Config.Types 6977 // match: (Div16u (Const16 [c]) (Const16 [d])) 6978 // cond: d != 0 6979 // result: (Const16 [int64(int16(uint16(c)/uint16(d)))]) 6980 for { 6981 _ = v.Args[1] 6982 v_0 := v.Args[0] 6983 if v_0.Op != OpConst16 { 6984 break 6985 } 6986 c := v_0.AuxInt 6987 v_1 := v.Args[1] 6988 if v_1.Op != OpConst16 { 6989 break 6990 } 6991 d := v_1.AuxInt 6992 if !(d != 0) { 6993 break 6994 } 6995 v.reset(OpConst16) 6996 v.AuxInt = int64(int16(uint16(c) / uint16(d))) 6997 return true 6998 } 6999 // match: (Div16u n (Const16 [c])) 7000 // cond: isPowerOfTwo(c&0xffff) 7001 // result: (Rsh16Ux64 n (Const64 <typ.UInt64> [log2(c&0xffff)])) 7002 for { 7003 _ = v.Args[1] 7004 n := v.Args[0] 7005 v_1 := v.Args[1] 7006 if v_1.Op != OpConst16 { 7007 break 7008 } 7009 c := v_1.AuxInt 7010 if !(isPowerOfTwo(c & 0xffff)) { 7011 break 7012 } 7013 v.reset(OpRsh16Ux64) 7014 v.AddArg(n) 7015 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7016 v0.AuxInt = log2(c & 0xffff) 7017 v.AddArg(v0) 7018 return true 7019 } 7020 // match: (Div16u x (Const16 [c])) 7021 // cond: umagicOK(16, c) && config.RegSize == 8 7022 // result: (Trunc64to16 (Rsh64Ux64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(1<<16+umagic(16,c).m)]) (ZeroExt16to64 x)) (Const64 <typ.UInt64> [16+umagic(16,c).s]))) 7023 for { 7024 _ = v.Args[1] 7025 x := v.Args[0] 7026 v_1 := v.Args[1] 7027 if v_1.Op != OpConst16 { 7028 break 7029 } 7030 c := v_1.AuxInt 7031 if !(umagicOK(16, c) && config.RegSize == 8) { 7032 break 7033 } 7034 v.reset(OpTrunc64to16) 7035 v0 := b.NewValue0(v.Pos, OpRsh64Ux64, typ.UInt64) 7036 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 7037 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7038 v2.AuxInt = int64(1<<16 + umagic(16, c).m) 7039 v1.AddArg(v2) 7040 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 7041 v3.AddArg(x) 7042 v1.AddArg(v3) 7043 v0.AddArg(v1) 7044 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7045 v4.AuxInt = 16 + umagic(16, c).s 7046 v0.AddArg(v4) 7047 v.AddArg(v0) 7048 return true 7049 } 7050 // match: (Div16u x (Const16 [c])) 7051 // cond: umagicOK(16, c) && config.RegSize == 4 && umagic(16,c).m&1 == 0 7052 // result: (Trunc32to16 (Rsh32Ux64 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(1<<15+umagic(16,c).m/2)]) (ZeroExt16to32 x)) (Const64 <typ.UInt64> [16+umagic(16,c).s-1]))) 7053 for { 7054 _ = v.Args[1] 7055 x := v.Args[0] 7056 v_1 := v.Args[1] 7057 if v_1.Op != OpConst16 { 7058 break 7059 } 7060 c := v_1.AuxInt 7061 if !(umagicOK(16, c) && config.RegSize == 4 && umagic(16, c).m&1 == 0) { 7062 break 7063 } 7064 v.reset(OpTrunc32to16) 7065 v0 := b.NewValue0(v.Pos, OpRsh32Ux64, typ.UInt32) 7066 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 7067 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 7068 v2.AuxInt = int64(1<<15 + umagic(16, c).m/2) 7069 v1.AddArg(v2) 7070 v3 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 7071 v3.AddArg(x) 7072 v1.AddArg(v3) 7073 v0.AddArg(v1) 7074 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7075 v4.AuxInt = 16 + umagic(16, c).s - 1 7076 v0.AddArg(v4) 7077 v.AddArg(v0) 7078 return true 7079 } 7080 // match: (Div16u x (Const16 [c])) 7081 // cond: umagicOK(16, c) && config.RegSize == 4 && c&1 == 0 7082 // result: (Trunc32to16 (Rsh32Ux64 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(1<<15+(umagic(16,c).m+1)/2)]) (Rsh32Ux64 <typ.UInt32> (ZeroExt16to32 x) (Const64 <typ.UInt64> [1]))) (Const64 <typ.UInt64> [16+umagic(16,c).s-2]))) 7083 for { 7084 _ = v.Args[1] 7085 x := v.Args[0] 7086 v_1 := v.Args[1] 7087 if v_1.Op != OpConst16 { 7088 break 7089 } 7090 c := v_1.AuxInt 7091 if !(umagicOK(16, c) && config.RegSize == 4 && c&1 == 0) { 7092 break 7093 } 7094 v.reset(OpTrunc32to16) 7095 v0 := b.NewValue0(v.Pos, OpRsh32Ux64, typ.UInt32) 7096 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 7097 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 7098 v2.AuxInt = int64(1<<15 + (umagic(16, c).m+1)/2) 7099 v1.AddArg(v2) 7100 v3 := b.NewValue0(v.Pos, OpRsh32Ux64, typ.UInt32) 7101 v4 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 7102 v4.AddArg(x) 7103 v3.AddArg(v4) 7104 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7105 v5.AuxInt = 1 7106 v3.AddArg(v5) 7107 v1.AddArg(v3) 7108 v0.AddArg(v1) 7109 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7110 v6.AuxInt = 16 + umagic(16, c).s - 2 7111 v0.AddArg(v6) 7112 v.AddArg(v0) 7113 return true 7114 } 7115 // match: (Div16u x (Const16 [c])) 7116 // cond: umagicOK(16, c) && config.RegSize == 4 && config.useAvg 7117 // result: (Trunc32to16 (Rsh32Ux64 <typ.UInt32> (Avg32u (Lsh32x64 <typ.UInt32> (ZeroExt16to32 x) (Const64 <typ.UInt64> [16])) (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(umagic(16,c).m)]) (ZeroExt16to32 x))) (Const64 <typ.UInt64> [16+umagic(16,c).s-1]))) 7118 for { 7119 _ = v.Args[1] 7120 x := v.Args[0] 7121 v_1 := v.Args[1] 7122 if v_1.Op != OpConst16 { 7123 break 7124 } 7125 c := v_1.AuxInt 7126 if !(umagicOK(16, c) && config.RegSize == 4 && config.useAvg) { 7127 break 7128 } 7129 v.reset(OpTrunc32to16) 7130 v0 := b.NewValue0(v.Pos, OpRsh32Ux64, typ.UInt32) 7131 v1 := b.NewValue0(v.Pos, OpAvg32u, typ.UInt32) 7132 v2 := b.NewValue0(v.Pos, OpLsh32x64, typ.UInt32) 7133 v3 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 7134 v3.AddArg(x) 7135 v2.AddArg(v3) 7136 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7137 v4.AuxInt = 16 7138 v2.AddArg(v4) 7139 v1.AddArg(v2) 7140 v5 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 7141 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 7142 v6.AuxInt = int64(umagic(16, c).m) 7143 v5.AddArg(v6) 7144 v7 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 7145 v7.AddArg(x) 7146 v5.AddArg(v7) 7147 v1.AddArg(v5) 7148 v0.AddArg(v1) 7149 v8 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7150 v8.AuxInt = 16 + umagic(16, c).s - 1 7151 v0.AddArg(v8) 7152 v.AddArg(v0) 7153 return true 7154 } 7155 return false 7156 } 7157 func rewriteValuegeneric_OpDiv32_0(v *Value) bool { 7158 b := v.Block 7159 config := b.Func.Config 7160 typ := &b.Func.Config.Types 7161 // match: (Div32 (Const32 [c]) (Const32 [d])) 7162 // cond: d != 0 7163 // result: (Const32 [int64(int32(c)/int32(d))]) 7164 for { 7165 _ = v.Args[1] 7166 v_0 := v.Args[0] 7167 if v_0.Op != OpConst32 { 7168 break 7169 } 7170 c := v_0.AuxInt 7171 v_1 := v.Args[1] 7172 if v_1.Op != OpConst32 { 7173 break 7174 } 7175 d := v_1.AuxInt 7176 if !(d != 0) { 7177 break 7178 } 7179 v.reset(OpConst32) 7180 v.AuxInt = int64(int32(c) / int32(d)) 7181 return true 7182 } 7183 // match: (Div32 n (Const32 [c])) 7184 // cond: isNonNegative(n) && isPowerOfTwo(c&0xffffffff) 7185 // result: (Rsh32Ux64 n (Const64 <typ.UInt64> [log2(c&0xffffffff)])) 7186 for { 7187 _ = v.Args[1] 7188 n := v.Args[0] 7189 v_1 := v.Args[1] 7190 if v_1.Op != OpConst32 { 7191 break 7192 } 7193 c := v_1.AuxInt 7194 if !(isNonNegative(n) && isPowerOfTwo(c&0xffffffff)) { 7195 break 7196 } 7197 v.reset(OpRsh32Ux64) 7198 v.AddArg(n) 7199 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7200 v0.AuxInt = log2(c & 0xffffffff) 7201 v.AddArg(v0) 7202 return true 7203 } 7204 // match: (Div32 <t> n (Const32 [c])) 7205 // cond: c < 0 && c != -1<<31 7206 // result: (Neg32 (Div32 <t> n (Const32 <t> [-c]))) 7207 for { 7208 t := v.Type 7209 _ = v.Args[1] 7210 n := v.Args[0] 7211 v_1 := v.Args[1] 7212 if v_1.Op != OpConst32 { 7213 break 7214 } 7215 c := v_1.AuxInt 7216 if !(c < 0 && c != -1<<31) { 7217 break 7218 } 7219 v.reset(OpNeg32) 7220 v0 := b.NewValue0(v.Pos, OpDiv32, t) 7221 v0.AddArg(n) 7222 v1 := b.NewValue0(v.Pos, OpConst32, t) 7223 v1.AuxInt = -c 7224 v0.AddArg(v1) 7225 v.AddArg(v0) 7226 return true 7227 } 7228 // match: (Div32 <t> x (Const32 [-1<<31])) 7229 // result: (Rsh32Ux64 (And32 <t> x (Neg32 <t> x)) (Const64 <typ.UInt64> [31])) 7230 for { 7231 t := v.Type 7232 _ = v.Args[1] 7233 x := v.Args[0] 7234 v_1 := v.Args[1] 7235 if v_1.Op != OpConst32 || v_1.AuxInt != -1<<31 { 7236 break 7237 } 7238 v.reset(OpRsh32Ux64) 7239 v0 := b.NewValue0(v.Pos, OpAnd32, t) 7240 v0.AddArg(x) 7241 v1 := b.NewValue0(v.Pos, OpNeg32, t) 7242 v1.AddArg(x) 7243 v0.AddArg(v1) 7244 v.AddArg(v0) 7245 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7246 v2.AuxInt = 31 7247 v.AddArg(v2) 7248 return true 7249 } 7250 // match: (Div32 <t> n (Const32 [c])) 7251 // cond: isPowerOfTwo(c) 7252 // result: (Rsh32x64 (Add32 <t> n (Rsh32Ux64 <t> (Rsh32x64 <t> n (Const64 <typ.UInt64> [31])) (Const64 <typ.UInt64> [32-log2(c)]))) (Const64 <typ.UInt64> [log2(c)])) 7253 for { 7254 t := v.Type 7255 _ = v.Args[1] 7256 n := v.Args[0] 7257 v_1 := v.Args[1] 7258 if v_1.Op != OpConst32 { 7259 break 7260 } 7261 c := v_1.AuxInt 7262 if !(isPowerOfTwo(c)) { 7263 break 7264 } 7265 v.reset(OpRsh32x64) 7266 v0 := b.NewValue0(v.Pos, OpAdd32, t) 7267 v0.AddArg(n) 7268 v1 := b.NewValue0(v.Pos, OpRsh32Ux64, t) 7269 v2 := b.NewValue0(v.Pos, OpRsh32x64, t) 7270 v2.AddArg(n) 7271 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7272 v3.AuxInt = 31 7273 v2.AddArg(v3) 7274 v1.AddArg(v2) 7275 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7276 v4.AuxInt = 32 - log2(c) 7277 v1.AddArg(v4) 7278 v0.AddArg(v1) 7279 v.AddArg(v0) 7280 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7281 v5.AuxInt = log2(c) 7282 v.AddArg(v5) 7283 return true 7284 } 7285 // match: (Div32 <t> x (Const32 [c])) 7286 // cond: smagicOK(32,c) && config.RegSize == 8 7287 // result: (Sub32 <t> (Rsh64x64 <t> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(smagic(32,c).m)]) (SignExt32to64 x)) (Const64 <typ.UInt64> [32+smagic(32,c).s])) (Rsh64x64 <t> (SignExt32to64 x) (Const64 <typ.UInt64> [63]))) 7288 for { 7289 t := v.Type 7290 _ = v.Args[1] 7291 x := v.Args[0] 7292 v_1 := v.Args[1] 7293 if v_1.Op != OpConst32 { 7294 break 7295 } 7296 c := v_1.AuxInt 7297 if !(smagicOK(32, c) && config.RegSize == 8) { 7298 break 7299 } 7300 v.reset(OpSub32) 7301 v.Type = t 7302 v0 := b.NewValue0(v.Pos, OpRsh64x64, t) 7303 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 7304 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7305 v2.AuxInt = int64(smagic(32, c).m) 7306 v1.AddArg(v2) 7307 v3 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 7308 v3.AddArg(x) 7309 v1.AddArg(v3) 7310 v0.AddArg(v1) 7311 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7312 v4.AuxInt = 32 + smagic(32, c).s 7313 v0.AddArg(v4) 7314 v.AddArg(v0) 7315 v5 := b.NewValue0(v.Pos, OpRsh64x64, t) 7316 v6 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 7317 v6.AddArg(x) 7318 v5.AddArg(v6) 7319 v7 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7320 v7.AuxInt = 63 7321 v5.AddArg(v7) 7322 v.AddArg(v5) 7323 return true 7324 } 7325 // match: (Div32 <t> x (Const32 [c])) 7326 // cond: smagicOK(32,c) && config.RegSize == 4 && smagic(32,c).m&1 == 0 && config.useHmul 7327 // result: (Sub32 <t> (Rsh32x64 <t> (Hmul32 <t> (Const32 <typ.UInt32> [int64(int32(smagic(32,c).m/2))]) x) (Const64 <typ.UInt64> [smagic(32,c).s-1])) (Rsh32x64 <t> x (Const64 <typ.UInt64> [31]))) 7328 for { 7329 t := v.Type 7330 _ = v.Args[1] 7331 x := v.Args[0] 7332 v_1 := v.Args[1] 7333 if v_1.Op != OpConst32 { 7334 break 7335 } 7336 c := v_1.AuxInt 7337 if !(smagicOK(32, c) && config.RegSize == 4 && smagic(32, c).m&1 == 0 && config.useHmul) { 7338 break 7339 } 7340 v.reset(OpSub32) 7341 v.Type = t 7342 v0 := b.NewValue0(v.Pos, OpRsh32x64, t) 7343 v1 := b.NewValue0(v.Pos, OpHmul32, t) 7344 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 7345 v2.AuxInt = int64(int32(smagic(32, c).m / 2)) 7346 v1.AddArg(v2) 7347 v1.AddArg(x) 7348 v0.AddArg(v1) 7349 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7350 v3.AuxInt = smagic(32, c).s - 1 7351 v0.AddArg(v3) 7352 v.AddArg(v0) 7353 v4 := b.NewValue0(v.Pos, OpRsh32x64, t) 7354 v4.AddArg(x) 7355 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7356 v5.AuxInt = 31 7357 v4.AddArg(v5) 7358 v.AddArg(v4) 7359 return true 7360 } 7361 // match: (Div32 <t> x (Const32 [c])) 7362 // cond: smagicOK(32,c) && config.RegSize == 4 && smagic(32,c).m&1 != 0 && config.useHmul 7363 // result: (Sub32 <t> (Rsh32x64 <t> (Add32 <t> (Hmul32 <t> (Const32 <typ.UInt32> [int64(int32(smagic(32,c).m))]) x) x) (Const64 <typ.UInt64> [smagic(32,c).s])) (Rsh32x64 <t> x (Const64 <typ.UInt64> [31]))) 7364 for { 7365 t := v.Type 7366 _ = v.Args[1] 7367 x := v.Args[0] 7368 v_1 := v.Args[1] 7369 if v_1.Op != OpConst32 { 7370 break 7371 } 7372 c := v_1.AuxInt 7373 if !(smagicOK(32, c) && config.RegSize == 4 && smagic(32, c).m&1 != 0 && config.useHmul) { 7374 break 7375 } 7376 v.reset(OpSub32) 7377 v.Type = t 7378 v0 := b.NewValue0(v.Pos, OpRsh32x64, t) 7379 v1 := b.NewValue0(v.Pos, OpAdd32, t) 7380 v2 := b.NewValue0(v.Pos, OpHmul32, t) 7381 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 7382 v3.AuxInt = int64(int32(smagic(32, c).m)) 7383 v2.AddArg(v3) 7384 v2.AddArg(x) 7385 v1.AddArg(v2) 7386 v1.AddArg(x) 7387 v0.AddArg(v1) 7388 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7389 v4.AuxInt = smagic(32, c).s 7390 v0.AddArg(v4) 7391 v.AddArg(v0) 7392 v5 := b.NewValue0(v.Pos, OpRsh32x64, t) 7393 v5.AddArg(x) 7394 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7395 v6.AuxInt = 31 7396 v5.AddArg(v6) 7397 v.AddArg(v5) 7398 return true 7399 } 7400 return false 7401 } 7402 func rewriteValuegeneric_OpDiv32F_0(v *Value) bool { 7403 b := v.Block 7404 // match: (Div32F (Const32F [c]) (Const32F [d])) 7405 // result: (Const32F [auxFrom32F(auxTo32F(c) / auxTo32F(d))]) 7406 for { 7407 _ = v.Args[1] 7408 v_0 := v.Args[0] 7409 if v_0.Op != OpConst32F { 7410 break 7411 } 7412 c := v_0.AuxInt 7413 v_1 := v.Args[1] 7414 if v_1.Op != OpConst32F { 7415 break 7416 } 7417 d := v_1.AuxInt 7418 v.reset(OpConst32F) 7419 v.AuxInt = auxFrom32F(auxTo32F(c) / auxTo32F(d)) 7420 return true 7421 } 7422 // match: (Div32F x (Const32F <t> [c])) 7423 // cond: reciprocalExact32(auxTo32F(c)) 7424 // result: (Mul32F x (Const32F <t> [auxFrom32F(1/auxTo32F(c))])) 7425 for { 7426 _ = v.Args[1] 7427 x := v.Args[0] 7428 v_1 := v.Args[1] 7429 if v_1.Op != OpConst32F { 7430 break 7431 } 7432 t := v_1.Type 7433 c := v_1.AuxInt 7434 if !(reciprocalExact32(auxTo32F(c))) { 7435 break 7436 } 7437 v.reset(OpMul32F) 7438 v.AddArg(x) 7439 v0 := b.NewValue0(v.Pos, OpConst32F, t) 7440 v0.AuxInt = auxFrom32F(1 / auxTo32F(c)) 7441 v.AddArg(v0) 7442 return true 7443 } 7444 return false 7445 } 7446 func rewriteValuegeneric_OpDiv32u_0(v *Value) bool { 7447 b := v.Block 7448 config := b.Func.Config 7449 typ := &b.Func.Config.Types 7450 // match: (Div32u (Const32 [c]) (Const32 [d])) 7451 // cond: d != 0 7452 // result: (Const32 [int64(int32(uint32(c)/uint32(d)))]) 7453 for { 7454 _ = v.Args[1] 7455 v_0 := v.Args[0] 7456 if v_0.Op != OpConst32 { 7457 break 7458 } 7459 c := v_0.AuxInt 7460 v_1 := v.Args[1] 7461 if v_1.Op != OpConst32 { 7462 break 7463 } 7464 d := v_1.AuxInt 7465 if !(d != 0) { 7466 break 7467 } 7468 v.reset(OpConst32) 7469 v.AuxInt = int64(int32(uint32(c) / uint32(d))) 7470 return true 7471 } 7472 // match: (Div32u n (Const32 [c])) 7473 // cond: isPowerOfTwo(c&0xffffffff) 7474 // result: (Rsh32Ux64 n (Const64 <typ.UInt64> [log2(c&0xffffffff)])) 7475 for { 7476 _ = v.Args[1] 7477 n := v.Args[0] 7478 v_1 := v.Args[1] 7479 if v_1.Op != OpConst32 { 7480 break 7481 } 7482 c := v_1.AuxInt 7483 if !(isPowerOfTwo(c & 0xffffffff)) { 7484 break 7485 } 7486 v.reset(OpRsh32Ux64) 7487 v.AddArg(n) 7488 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7489 v0.AuxInt = log2(c & 0xffffffff) 7490 v.AddArg(v0) 7491 return true 7492 } 7493 // match: (Div32u x (Const32 [c])) 7494 // cond: umagicOK(32, c) && config.RegSize == 4 && umagic(32,c).m&1 == 0 && config.useHmul 7495 // result: (Rsh32Ux64 <typ.UInt32> (Hmul32u <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(1<<31+umagic(32,c).m/2))]) x) (Const64 <typ.UInt64> [umagic(32,c).s-1])) 7496 for { 7497 _ = v.Args[1] 7498 x := v.Args[0] 7499 v_1 := v.Args[1] 7500 if v_1.Op != OpConst32 { 7501 break 7502 } 7503 c := v_1.AuxInt 7504 if !(umagicOK(32, c) && config.RegSize == 4 && umagic(32, c).m&1 == 0 && config.useHmul) { 7505 break 7506 } 7507 v.reset(OpRsh32Ux64) 7508 v.Type = typ.UInt32 7509 v0 := b.NewValue0(v.Pos, OpHmul32u, typ.UInt32) 7510 v1 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 7511 v1.AuxInt = int64(int32(1<<31 + umagic(32, c).m/2)) 7512 v0.AddArg(v1) 7513 v0.AddArg(x) 7514 v.AddArg(v0) 7515 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7516 v2.AuxInt = umagic(32, c).s - 1 7517 v.AddArg(v2) 7518 return true 7519 } 7520 // match: (Div32u x (Const32 [c])) 7521 // cond: umagicOK(32, c) && config.RegSize == 4 && c&1 == 0 && config.useHmul 7522 // result: (Rsh32Ux64 <typ.UInt32> (Hmul32u <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(1<<31+(umagic(32,c).m+1)/2))]) (Rsh32Ux64 <typ.UInt32> x (Const64 <typ.UInt64> [1]))) (Const64 <typ.UInt64> [umagic(32,c).s-2])) 7523 for { 7524 _ = v.Args[1] 7525 x := v.Args[0] 7526 v_1 := v.Args[1] 7527 if v_1.Op != OpConst32 { 7528 break 7529 } 7530 c := v_1.AuxInt 7531 if !(umagicOK(32, c) && config.RegSize == 4 && c&1 == 0 && config.useHmul) { 7532 break 7533 } 7534 v.reset(OpRsh32Ux64) 7535 v.Type = typ.UInt32 7536 v0 := b.NewValue0(v.Pos, OpHmul32u, typ.UInt32) 7537 v1 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 7538 v1.AuxInt = int64(int32(1<<31 + (umagic(32, c).m+1)/2)) 7539 v0.AddArg(v1) 7540 v2 := b.NewValue0(v.Pos, OpRsh32Ux64, typ.UInt32) 7541 v2.AddArg(x) 7542 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7543 v3.AuxInt = 1 7544 v2.AddArg(v3) 7545 v0.AddArg(v2) 7546 v.AddArg(v0) 7547 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7548 v4.AuxInt = umagic(32, c).s - 2 7549 v.AddArg(v4) 7550 return true 7551 } 7552 // match: (Div32u x (Const32 [c])) 7553 // cond: umagicOK(32, c) && config.RegSize == 4 && config.useAvg && config.useHmul 7554 // result: (Rsh32Ux64 <typ.UInt32> (Avg32u x (Hmul32u <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(umagic(32,c).m))]) x)) (Const64 <typ.UInt64> [umagic(32,c).s-1])) 7555 for { 7556 _ = v.Args[1] 7557 x := v.Args[0] 7558 v_1 := v.Args[1] 7559 if v_1.Op != OpConst32 { 7560 break 7561 } 7562 c := v_1.AuxInt 7563 if !(umagicOK(32, c) && config.RegSize == 4 && config.useAvg && config.useHmul) { 7564 break 7565 } 7566 v.reset(OpRsh32Ux64) 7567 v.Type = typ.UInt32 7568 v0 := b.NewValue0(v.Pos, OpAvg32u, typ.UInt32) 7569 v0.AddArg(x) 7570 v1 := b.NewValue0(v.Pos, OpHmul32u, typ.UInt32) 7571 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 7572 v2.AuxInt = int64(int32(umagic(32, c).m)) 7573 v1.AddArg(v2) 7574 v1.AddArg(x) 7575 v0.AddArg(v1) 7576 v.AddArg(v0) 7577 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7578 v3.AuxInt = umagic(32, c).s - 1 7579 v.AddArg(v3) 7580 return true 7581 } 7582 // match: (Div32u x (Const32 [c])) 7583 // cond: umagicOK(32, c) && config.RegSize == 8 && umagic(32,c).m&1 == 0 7584 // result: (Trunc64to32 (Rsh64Ux64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(1<<31+umagic(32,c).m/2)]) (ZeroExt32to64 x)) (Const64 <typ.UInt64> [32+umagic(32,c).s-1]))) 7585 for { 7586 _ = v.Args[1] 7587 x := v.Args[0] 7588 v_1 := v.Args[1] 7589 if v_1.Op != OpConst32 { 7590 break 7591 } 7592 c := v_1.AuxInt 7593 if !(umagicOK(32, c) && config.RegSize == 8 && umagic(32, c).m&1 == 0) { 7594 break 7595 } 7596 v.reset(OpTrunc64to32) 7597 v0 := b.NewValue0(v.Pos, OpRsh64Ux64, typ.UInt64) 7598 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 7599 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7600 v2.AuxInt = int64(1<<31 + umagic(32, c).m/2) 7601 v1.AddArg(v2) 7602 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 7603 v3.AddArg(x) 7604 v1.AddArg(v3) 7605 v0.AddArg(v1) 7606 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7607 v4.AuxInt = 32 + umagic(32, c).s - 1 7608 v0.AddArg(v4) 7609 v.AddArg(v0) 7610 return true 7611 } 7612 // match: (Div32u x (Const32 [c])) 7613 // cond: umagicOK(32, c) && config.RegSize == 8 && c&1 == 0 7614 // result: (Trunc64to32 (Rsh64Ux64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(1<<31+(umagic(32,c).m+1)/2)]) (Rsh64Ux64 <typ.UInt64> (ZeroExt32to64 x) (Const64 <typ.UInt64> [1]))) (Const64 <typ.UInt64> [32+umagic(32,c).s-2]))) 7615 for { 7616 _ = v.Args[1] 7617 x := v.Args[0] 7618 v_1 := v.Args[1] 7619 if v_1.Op != OpConst32 { 7620 break 7621 } 7622 c := v_1.AuxInt 7623 if !(umagicOK(32, c) && config.RegSize == 8 && c&1 == 0) { 7624 break 7625 } 7626 v.reset(OpTrunc64to32) 7627 v0 := b.NewValue0(v.Pos, OpRsh64Ux64, typ.UInt64) 7628 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 7629 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7630 v2.AuxInt = int64(1<<31 + (umagic(32, c).m+1)/2) 7631 v1.AddArg(v2) 7632 v3 := b.NewValue0(v.Pos, OpRsh64Ux64, typ.UInt64) 7633 v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 7634 v4.AddArg(x) 7635 v3.AddArg(v4) 7636 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7637 v5.AuxInt = 1 7638 v3.AddArg(v5) 7639 v1.AddArg(v3) 7640 v0.AddArg(v1) 7641 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7642 v6.AuxInt = 32 + umagic(32, c).s - 2 7643 v0.AddArg(v6) 7644 v.AddArg(v0) 7645 return true 7646 } 7647 // match: (Div32u x (Const32 [c])) 7648 // cond: umagicOK(32, c) && config.RegSize == 8 && config.useAvg 7649 // result: (Trunc64to32 (Rsh64Ux64 <typ.UInt64> (Avg64u (Lsh64x64 <typ.UInt64> (ZeroExt32to64 x) (Const64 <typ.UInt64> [32])) (Mul64 <typ.UInt64> (Const64 <typ.UInt32> [int64(umagic(32,c).m)]) (ZeroExt32to64 x))) (Const64 <typ.UInt64> [32+umagic(32,c).s-1]))) 7650 for { 7651 _ = v.Args[1] 7652 x := v.Args[0] 7653 v_1 := v.Args[1] 7654 if v_1.Op != OpConst32 { 7655 break 7656 } 7657 c := v_1.AuxInt 7658 if !(umagicOK(32, c) && config.RegSize == 8 && config.useAvg) { 7659 break 7660 } 7661 v.reset(OpTrunc64to32) 7662 v0 := b.NewValue0(v.Pos, OpRsh64Ux64, typ.UInt64) 7663 v1 := b.NewValue0(v.Pos, OpAvg64u, typ.UInt64) 7664 v2 := b.NewValue0(v.Pos, OpLsh64x64, typ.UInt64) 7665 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 7666 v3.AddArg(x) 7667 v2.AddArg(v3) 7668 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7669 v4.AuxInt = 32 7670 v2.AddArg(v4) 7671 v1.AddArg(v2) 7672 v5 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 7673 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt32) 7674 v6.AuxInt = int64(umagic(32, c).m) 7675 v5.AddArg(v6) 7676 v7 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 7677 v7.AddArg(x) 7678 v5.AddArg(v7) 7679 v1.AddArg(v5) 7680 v0.AddArg(v1) 7681 v8 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7682 v8.AuxInt = 32 + umagic(32, c).s - 1 7683 v0.AddArg(v8) 7684 v.AddArg(v0) 7685 return true 7686 } 7687 return false 7688 } 7689 func rewriteValuegeneric_OpDiv64_0(v *Value) bool { 7690 b := v.Block 7691 config := b.Func.Config 7692 typ := &b.Func.Config.Types 7693 // match: (Div64 (Const64 [c]) (Const64 [d])) 7694 // cond: d != 0 7695 // result: (Const64 [c/d]) 7696 for { 7697 _ = v.Args[1] 7698 v_0 := v.Args[0] 7699 if v_0.Op != OpConst64 { 7700 break 7701 } 7702 c := v_0.AuxInt 7703 v_1 := v.Args[1] 7704 if v_1.Op != OpConst64 { 7705 break 7706 } 7707 d := v_1.AuxInt 7708 if !(d != 0) { 7709 break 7710 } 7711 v.reset(OpConst64) 7712 v.AuxInt = c / d 7713 return true 7714 } 7715 // match: (Div64 n (Const64 [c])) 7716 // cond: isNonNegative(n) && isPowerOfTwo(c) 7717 // result: (Rsh64Ux64 n (Const64 <typ.UInt64> [log2(c)])) 7718 for { 7719 _ = v.Args[1] 7720 n := v.Args[0] 7721 v_1 := v.Args[1] 7722 if v_1.Op != OpConst64 { 7723 break 7724 } 7725 c := v_1.AuxInt 7726 if !(isNonNegative(n) && isPowerOfTwo(c)) { 7727 break 7728 } 7729 v.reset(OpRsh64Ux64) 7730 v.AddArg(n) 7731 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7732 v0.AuxInt = log2(c) 7733 v.AddArg(v0) 7734 return true 7735 } 7736 // match: (Div64 n (Const64 [-1<<63])) 7737 // cond: isNonNegative(n) 7738 // result: (Const64 [0]) 7739 for { 7740 _ = v.Args[1] 7741 n := v.Args[0] 7742 v_1 := v.Args[1] 7743 if v_1.Op != OpConst64 || v_1.AuxInt != -1<<63 || !(isNonNegative(n)) { 7744 break 7745 } 7746 v.reset(OpConst64) 7747 v.AuxInt = 0 7748 return true 7749 } 7750 // match: (Div64 <t> n (Const64 [c])) 7751 // cond: c < 0 && c != -1<<63 7752 // result: (Neg64 (Div64 <t> n (Const64 <t> [-c]))) 7753 for { 7754 t := v.Type 7755 _ = v.Args[1] 7756 n := v.Args[0] 7757 v_1 := v.Args[1] 7758 if v_1.Op != OpConst64 { 7759 break 7760 } 7761 c := v_1.AuxInt 7762 if !(c < 0 && c != -1<<63) { 7763 break 7764 } 7765 v.reset(OpNeg64) 7766 v0 := b.NewValue0(v.Pos, OpDiv64, t) 7767 v0.AddArg(n) 7768 v1 := b.NewValue0(v.Pos, OpConst64, t) 7769 v1.AuxInt = -c 7770 v0.AddArg(v1) 7771 v.AddArg(v0) 7772 return true 7773 } 7774 // match: (Div64 <t> x (Const64 [-1<<63])) 7775 // result: (Rsh64Ux64 (And64 <t> x (Neg64 <t> x)) (Const64 <typ.UInt64> [63])) 7776 for { 7777 t := v.Type 7778 _ = v.Args[1] 7779 x := v.Args[0] 7780 v_1 := v.Args[1] 7781 if v_1.Op != OpConst64 || v_1.AuxInt != -1<<63 { 7782 break 7783 } 7784 v.reset(OpRsh64Ux64) 7785 v0 := b.NewValue0(v.Pos, OpAnd64, t) 7786 v0.AddArg(x) 7787 v1 := b.NewValue0(v.Pos, OpNeg64, t) 7788 v1.AddArg(x) 7789 v0.AddArg(v1) 7790 v.AddArg(v0) 7791 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7792 v2.AuxInt = 63 7793 v.AddArg(v2) 7794 return true 7795 } 7796 // match: (Div64 <t> n (Const64 [c])) 7797 // cond: isPowerOfTwo(c) 7798 // result: (Rsh64x64 (Add64 <t> n (Rsh64Ux64 <t> (Rsh64x64 <t> n (Const64 <typ.UInt64> [63])) (Const64 <typ.UInt64> [64-log2(c)]))) (Const64 <typ.UInt64> [log2(c)])) 7799 for { 7800 t := v.Type 7801 _ = v.Args[1] 7802 n := v.Args[0] 7803 v_1 := v.Args[1] 7804 if v_1.Op != OpConst64 { 7805 break 7806 } 7807 c := v_1.AuxInt 7808 if !(isPowerOfTwo(c)) { 7809 break 7810 } 7811 v.reset(OpRsh64x64) 7812 v0 := b.NewValue0(v.Pos, OpAdd64, t) 7813 v0.AddArg(n) 7814 v1 := b.NewValue0(v.Pos, OpRsh64Ux64, t) 7815 v2 := b.NewValue0(v.Pos, OpRsh64x64, t) 7816 v2.AddArg(n) 7817 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7818 v3.AuxInt = 63 7819 v2.AddArg(v3) 7820 v1.AddArg(v2) 7821 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7822 v4.AuxInt = 64 - log2(c) 7823 v1.AddArg(v4) 7824 v0.AddArg(v1) 7825 v.AddArg(v0) 7826 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7827 v5.AuxInt = log2(c) 7828 v.AddArg(v5) 7829 return true 7830 } 7831 // match: (Div64 <t> x (Const64 [c])) 7832 // cond: smagicOK(64,c) && smagic(64,c).m&1 == 0 && config.useHmul 7833 // result: (Sub64 <t> (Rsh64x64 <t> (Hmul64 <t> (Const64 <typ.UInt64> [int64(smagic(64,c).m/2)]) x) (Const64 <typ.UInt64> [smagic(64,c).s-1])) (Rsh64x64 <t> x (Const64 <typ.UInt64> [63]))) 7834 for { 7835 t := v.Type 7836 _ = v.Args[1] 7837 x := v.Args[0] 7838 v_1 := v.Args[1] 7839 if v_1.Op != OpConst64 { 7840 break 7841 } 7842 c := v_1.AuxInt 7843 if !(smagicOK(64, c) && smagic(64, c).m&1 == 0 && config.useHmul) { 7844 break 7845 } 7846 v.reset(OpSub64) 7847 v.Type = t 7848 v0 := b.NewValue0(v.Pos, OpRsh64x64, t) 7849 v1 := b.NewValue0(v.Pos, OpHmul64, t) 7850 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7851 v2.AuxInt = int64(smagic(64, c).m / 2) 7852 v1.AddArg(v2) 7853 v1.AddArg(x) 7854 v0.AddArg(v1) 7855 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7856 v3.AuxInt = smagic(64, c).s - 1 7857 v0.AddArg(v3) 7858 v.AddArg(v0) 7859 v4 := b.NewValue0(v.Pos, OpRsh64x64, t) 7860 v4.AddArg(x) 7861 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7862 v5.AuxInt = 63 7863 v4.AddArg(v5) 7864 v.AddArg(v4) 7865 return true 7866 } 7867 // match: (Div64 <t> x (Const64 [c])) 7868 // cond: smagicOK(64,c) && smagic(64,c).m&1 != 0 && config.useHmul 7869 // result: (Sub64 <t> (Rsh64x64 <t> (Add64 <t> (Hmul64 <t> (Const64 <typ.UInt64> [int64(smagic(64,c).m)]) x) x) (Const64 <typ.UInt64> [smagic(64,c).s])) (Rsh64x64 <t> x (Const64 <typ.UInt64> [63]))) 7870 for { 7871 t := v.Type 7872 _ = v.Args[1] 7873 x := v.Args[0] 7874 v_1 := v.Args[1] 7875 if v_1.Op != OpConst64 { 7876 break 7877 } 7878 c := v_1.AuxInt 7879 if !(smagicOK(64, c) && smagic(64, c).m&1 != 0 && config.useHmul) { 7880 break 7881 } 7882 v.reset(OpSub64) 7883 v.Type = t 7884 v0 := b.NewValue0(v.Pos, OpRsh64x64, t) 7885 v1 := b.NewValue0(v.Pos, OpAdd64, t) 7886 v2 := b.NewValue0(v.Pos, OpHmul64, t) 7887 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7888 v3.AuxInt = int64(smagic(64, c).m) 7889 v2.AddArg(v3) 7890 v2.AddArg(x) 7891 v1.AddArg(v2) 7892 v1.AddArg(x) 7893 v0.AddArg(v1) 7894 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7895 v4.AuxInt = smagic(64, c).s 7896 v0.AddArg(v4) 7897 v.AddArg(v0) 7898 v5 := b.NewValue0(v.Pos, OpRsh64x64, t) 7899 v5.AddArg(x) 7900 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7901 v6.AuxInt = 63 7902 v5.AddArg(v6) 7903 v.AddArg(v5) 7904 return true 7905 } 7906 return false 7907 } 7908 func rewriteValuegeneric_OpDiv64F_0(v *Value) bool { 7909 b := v.Block 7910 // match: (Div64F (Const64F [c]) (Const64F [d])) 7911 // result: (Const64F [auxFrom64F(auxTo64F(c) / auxTo64F(d))]) 7912 for { 7913 _ = v.Args[1] 7914 v_0 := v.Args[0] 7915 if v_0.Op != OpConst64F { 7916 break 7917 } 7918 c := v_0.AuxInt 7919 v_1 := v.Args[1] 7920 if v_1.Op != OpConst64F { 7921 break 7922 } 7923 d := v_1.AuxInt 7924 v.reset(OpConst64F) 7925 v.AuxInt = auxFrom64F(auxTo64F(c) / auxTo64F(d)) 7926 return true 7927 } 7928 // match: (Div64F x (Const64F <t> [c])) 7929 // cond: reciprocalExact64(auxTo64F(c)) 7930 // result: (Mul64F x (Const64F <t> [auxFrom64F(1/auxTo64F(c))])) 7931 for { 7932 _ = v.Args[1] 7933 x := v.Args[0] 7934 v_1 := v.Args[1] 7935 if v_1.Op != OpConst64F { 7936 break 7937 } 7938 t := v_1.Type 7939 c := v_1.AuxInt 7940 if !(reciprocalExact64(auxTo64F(c))) { 7941 break 7942 } 7943 v.reset(OpMul64F) 7944 v.AddArg(x) 7945 v0 := b.NewValue0(v.Pos, OpConst64F, t) 7946 v0.AuxInt = auxFrom64F(1 / auxTo64F(c)) 7947 v.AddArg(v0) 7948 return true 7949 } 7950 return false 7951 } 7952 func rewriteValuegeneric_OpDiv64u_0(v *Value) bool { 7953 b := v.Block 7954 config := b.Func.Config 7955 typ := &b.Func.Config.Types 7956 // match: (Div64u (Const64 [c]) (Const64 [d])) 7957 // cond: d != 0 7958 // result: (Const64 [int64(uint64(c)/uint64(d))]) 7959 for { 7960 _ = v.Args[1] 7961 v_0 := v.Args[0] 7962 if v_0.Op != OpConst64 { 7963 break 7964 } 7965 c := v_0.AuxInt 7966 v_1 := v.Args[1] 7967 if v_1.Op != OpConst64 { 7968 break 7969 } 7970 d := v_1.AuxInt 7971 if !(d != 0) { 7972 break 7973 } 7974 v.reset(OpConst64) 7975 v.AuxInt = int64(uint64(c) / uint64(d)) 7976 return true 7977 } 7978 // match: (Div64u n (Const64 [c])) 7979 // cond: isPowerOfTwo(c) 7980 // result: (Rsh64Ux64 n (Const64 <typ.UInt64> [log2(c)])) 7981 for { 7982 _ = v.Args[1] 7983 n := v.Args[0] 7984 v_1 := v.Args[1] 7985 if v_1.Op != OpConst64 { 7986 break 7987 } 7988 c := v_1.AuxInt 7989 if !(isPowerOfTwo(c)) { 7990 break 7991 } 7992 v.reset(OpRsh64Ux64) 7993 v.AddArg(n) 7994 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 7995 v0.AuxInt = log2(c) 7996 v.AddArg(v0) 7997 return true 7998 } 7999 // match: (Div64u n (Const64 [-1<<63])) 8000 // result: (Rsh64Ux64 n (Const64 <typ.UInt64> [63])) 8001 for { 8002 _ = v.Args[1] 8003 n := v.Args[0] 8004 v_1 := v.Args[1] 8005 if v_1.Op != OpConst64 || v_1.AuxInt != -1<<63 { 8006 break 8007 } 8008 v.reset(OpRsh64Ux64) 8009 v.AddArg(n) 8010 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 8011 v0.AuxInt = 63 8012 v.AddArg(v0) 8013 return true 8014 } 8015 // match: (Div64u x (Const64 [c])) 8016 // cond: umagicOK(64, c) && config.RegSize == 8 && umagic(64,c).m&1 == 0 && config.useHmul 8017 // result: (Rsh64Ux64 <typ.UInt64> (Hmul64u <typ.UInt64> (Const64 <typ.UInt64> [int64(1<<63+umagic(64,c).m/2)]) x) (Const64 <typ.UInt64> [umagic(64,c).s-1])) 8018 for { 8019 _ = v.Args[1] 8020 x := v.Args[0] 8021 v_1 := v.Args[1] 8022 if v_1.Op != OpConst64 { 8023 break 8024 } 8025 c := v_1.AuxInt 8026 if !(umagicOK(64, c) && config.RegSize == 8 && umagic(64, c).m&1 == 0 && config.useHmul) { 8027 break 8028 } 8029 v.reset(OpRsh64Ux64) 8030 v.Type = typ.UInt64 8031 v0 := b.NewValue0(v.Pos, OpHmul64u, typ.UInt64) 8032 v1 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 8033 v1.AuxInt = int64(1<<63 + umagic(64, c).m/2) 8034 v0.AddArg(v1) 8035 v0.AddArg(x) 8036 v.AddArg(v0) 8037 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 8038 v2.AuxInt = umagic(64, c).s - 1 8039 v.AddArg(v2) 8040 return true 8041 } 8042 // match: (Div64u x (Const64 [c])) 8043 // cond: umagicOK(64, c) && config.RegSize == 8 && c&1 == 0 && config.useHmul 8044 // result: (Rsh64Ux64 <typ.UInt64> (Hmul64u <typ.UInt64> (Const64 <typ.UInt64> [int64(1<<63+(umagic(64,c).m+1)/2)]) (Rsh64Ux64 <typ.UInt64> x (Const64 <typ.UInt64> [1]))) (Const64 <typ.UInt64> [umagic(64,c).s-2])) 8045 for { 8046 _ = v.Args[1] 8047 x := v.Args[0] 8048 v_1 := v.Args[1] 8049 if v_1.Op != OpConst64 { 8050 break 8051 } 8052 c := v_1.AuxInt 8053 if !(umagicOK(64, c) && config.RegSize == 8 && c&1 == 0 && config.useHmul) { 8054 break 8055 } 8056 v.reset(OpRsh64Ux64) 8057 v.Type = typ.UInt64 8058 v0 := b.NewValue0(v.Pos, OpHmul64u, typ.UInt64) 8059 v1 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 8060 v1.AuxInt = int64(1<<63 + (umagic(64, c).m+1)/2) 8061 v0.AddArg(v1) 8062 v2 := b.NewValue0(v.Pos, OpRsh64Ux64, typ.UInt64) 8063 v2.AddArg(x) 8064 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 8065 v3.AuxInt = 1 8066 v2.AddArg(v3) 8067 v0.AddArg(v2) 8068 v.AddArg(v0) 8069 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 8070 v4.AuxInt = umagic(64, c).s - 2 8071 v.AddArg(v4) 8072 return true 8073 } 8074 // match: (Div64u x (Const64 [c])) 8075 // cond: umagicOK(64, c) && config.RegSize == 8 && config.useAvg && config.useHmul 8076 // result: (Rsh64Ux64 <typ.UInt64> (Avg64u x (Hmul64u <typ.UInt64> (Const64 <typ.UInt64> [int64(umagic(64,c).m)]) x)) (Const64 <typ.UInt64> [umagic(64,c).s-1])) 8077 for { 8078 _ = v.Args[1] 8079 x := v.Args[0] 8080 v_1 := v.Args[1] 8081 if v_1.Op != OpConst64 { 8082 break 8083 } 8084 c := v_1.AuxInt 8085 if !(umagicOK(64, c) && config.RegSize == 8 && config.useAvg && config.useHmul) { 8086 break 8087 } 8088 v.reset(OpRsh64Ux64) 8089 v.Type = typ.UInt64 8090 v0 := b.NewValue0(v.Pos, OpAvg64u, typ.UInt64) 8091 v0.AddArg(x) 8092 v1 := b.NewValue0(v.Pos, OpHmul64u, typ.UInt64) 8093 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 8094 v2.AuxInt = int64(umagic(64, c).m) 8095 v1.AddArg(v2) 8096 v1.AddArg(x) 8097 v0.AddArg(v1) 8098 v.AddArg(v0) 8099 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 8100 v3.AuxInt = umagic(64, c).s - 1 8101 v.AddArg(v3) 8102 return true 8103 } 8104 return false 8105 } 8106 func rewriteValuegeneric_OpDiv8_0(v *Value) bool { 8107 b := v.Block 8108 typ := &b.Func.Config.Types 8109 // match: (Div8 (Const8 [c]) (Const8 [d])) 8110 // cond: d != 0 8111 // result: (Const8 [int64(int8(c)/int8(d))]) 8112 for { 8113 _ = v.Args[1] 8114 v_0 := v.Args[0] 8115 if v_0.Op != OpConst8 { 8116 break 8117 } 8118 c := v_0.AuxInt 8119 v_1 := v.Args[1] 8120 if v_1.Op != OpConst8 { 8121 break 8122 } 8123 d := v_1.AuxInt 8124 if !(d != 0) { 8125 break 8126 } 8127 v.reset(OpConst8) 8128 v.AuxInt = int64(int8(c) / int8(d)) 8129 return true 8130 } 8131 // match: (Div8 n (Const8 [c])) 8132 // cond: isNonNegative(n) && isPowerOfTwo(c&0xff) 8133 // result: (Rsh8Ux64 n (Const64 <typ.UInt64> [log2(c&0xff)])) 8134 for { 8135 _ = v.Args[1] 8136 n := v.Args[0] 8137 v_1 := v.Args[1] 8138 if v_1.Op != OpConst8 { 8139 break 8140 } 8141 c := v_1.AuxInt 8142 if !(isNonNegative(n) && isPowerOfTwo(c&0xff)) { 8143 break 8144 } 8145 v.reset(OpRsh8Ux64) 8146 v.AddArg(n) 8147 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 8148 v0.AuxInt = log2(c & 0xff) 8149 v.AddArg(v0) 8150 return true 8151 } 8152 // match: (Div8 <t> n (Const8 [c])) 8153 // cond: c < 0 && c != -1<<7 8154 // result: (Neg8 (Div8 <t> n (Const8 <t> [-c]))) 8155 for { 8156 t := v.Type 8157 _ = v.Args[1] 8158 n := v.Args[0] 8159 v_1 := v.Args[1] 8160 if v_1.Op != OpConst8 { 8161 break 8162 } 8163 c := v_1.AuxInt 8164 if !(c < 0 && c != -1<<7) { 8165 break 8166 } 8167 v.reset(OpNeg8) 8168 v0 := b.NewValue0(v.Pos, OpDiv8, t) 8169 v0.AddArg(n) 8170 v1 := b.NewValue0(v.Pos, OpConst8, t) 8171 v1.AuxInt = -c 8172 v0.AddArg(v1) 8173 v.AddArg(v0) 8174 return true 8175 } 8176 // match: (Div8 <t> x (Const8 [-1<<7 ])) 8177 // result: (Rsh8Ux64 (And8 <t> x (Neg8 <t> x)) (Const64 <typ.UInt64> [7 ])) 8178 for { 8179 t := v.Type 8180 _ = v.Args[1] 8181 x := v.Args[0] 8182 v_1 := v.Args[1] 8183 if v_1.Op != OpConst8 || v_1.AuxInt != -1<<7 { 8184 break 8185 } 8186 v.reset(OpRsh8Ux64) 8187 v0 := b.NewValue0(v.Pos, OpAnd8, t) 8188 v0.AddArg(x) 8189 v1 := b.NewValue0(v.Pos, OpNeg8, t) 8190 v1.AddArg(x) 8191 v0.AddArg(v1) 8192 v.AddArg(v0) 8193 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 8194 v2.AuxInt = 7 8195 v.AddArg(v2) 8196 return true 8197 } 8198 // match: (Div8 <t> n (Const8 [c])) 8199 // cond: isPowerOfTwo(c) 8200 // result: (Rsh8x64 (Add8 <t> n (Rsh8Ux64 <t> (Rsh8x64 <t> n (Const64 <typ.UInt64> [ 7])) (Const64 <typ.UInt64> [ 8-log2(c)]))) (Const64 <typ.UInt64> [log2(c)])) 8201 for { 8202 t := v.Type 8203 _ = v.Args[1] 8204 n := v.Args[0] 8205 v_1 := v.Args[1] 8206 if v_1.Op != OpConst8 { 8207 break 8208 } 8209 c := v_1.AuxInt 8210 if !(isPowerOfTwo(c)) { 8211 break 8212 } 8213 v.reset(OpRsh8x64) 8214 v0 := b.NewValue0(v.Pos, OpAdd8, t) 8215 v0.AddArg(n) 8216 v1 := b.NewValue0(v.Pos, OpRsh8Ux64, t) 8217 v2 := b.NewValue0(v.Pos, OpRsh8x64, t) 8218 v2.AddArg(n) 8219 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 8220 v3.AuxInt = 7 8221 v2.AddArg(v3) 8222 v1.AddArg(v2) 8223 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 8224 v4.AuxInt = 8 - log2(c) 8225 v1.AddArg(v4) 8226 v0.AddArg(v1) 8227 v.AddArg(v0) 8228 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 8229 v5.AuxInt = log2(c) 8230 v.AddArg(v5) 8231 return true 8232 } 8233 // match: (Div8 <t> x (Const8 [c])) 8234 // cond: smagicOK(8,c) 8235 // result: (Sub8 <t> (Rsh32x64 <t> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(smagic(8,c).m)]) (SignExt8to32 x)) (Const64 <typ.UInt64> [8+smagic(8,c).s])) (Rsh32x64 <t> (SignExt8to32 x) (Const64 <typ.UInt64> [31]))) 8236 for { 8237 t := v.Type 8238 _ = v.Args[1] 8239 x := v.Args[0] 8240 v_1 := v.Args[1] 8241 if v_1.Op != OpConst8 { 8242 break 8243 } 8244 c := v_1.AuxInt 8245 if !(smagicOK(8, c)) { 8246 break 8247 } 8248 v.reset(OpSub8) 8249 v.Type = t 8250 v0 := b.NewValue0(v.Pos, OpRsh32x64, t) 8251 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 8252 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 8253 v2.AuxInt = int64(smagic(8, c).m) 8254 v1.AddArg(v2) 8255 v3 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 8256 v3.AddArg(x) 8257 v1.AddArg(v3) 8258 v0.AddArg(v1) 8259 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 8260 v4.AuxInt = 8 + smagic(8, c).s 8261 v0.AddArg(v4) 8262 v.AddArg(v0) 8263 v5 := b.NewValue0(v.Pos, OpRsh32x64, t) 8264 v6 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 8265 v6.AddArg(x) 8266 v5.AddArg(v6) 8267 v7 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 8268 v7.AuxInt = 31 8269 v5.AddArg(v7) 8270 v.AddArg(v5) 8271 return true 8272 } 8273 return false 8274 } 8275 func rewriteValuegeneric_OpDiv8u_0(v *Value) bool { 8276 b := v.Block 8277 typ := &b.Func.Config.Types 8278 // match: (Div8u (Const8 [c]) (Const8 [d])) 8279 // cond: d != 0 8280 // result: (Const8 [int64(int8(uint8(c)/uint8(d)))]) 8281 for { 8282 _ = v.Args[1] 8283 v_0 := v.Args[0] 8284 if v_0.Op != OpConst8 { 8285 break 8286 } 8287 c := v_0.AuxInt 8288 v_1 := v.Args[1] 8289 if v_1.Op != OpConst8 { 8290 break 8291 } 8292 d := v_1.AuxInt 8293 if !(d != 0) { 8294 break 8295 } 8296 v.reset(OpConst8) 8297 v.AuxInt = int64(int8(uint8(c) / uint8(d))) 8298 return true 8299 } 8300 // match: (Div8u n (Const8 [c])) 8301 // cond: isPowerOfTwo(c&0xff) 8302 // result: (Rsh8Ux64 n (Const64 <typ.UInt64> [log2(c&0xff)])) 8303 for { 8304 _ = v.Args[1] 8305 n := v.Args[0] 8306 v_1 := v.Args[1] 8307 if v_1.Op != OpConst8 { 8308 break 8309 } 8310 c := v_1.AuxInt 8311 if !(isPowerOfTwo(c & 0xff)) { 8312 break 8313 } 8314 v.reset(OpRsh8Ux64) 8315 v.AddArg(n) 8316 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 8317 v0.AuxInt = log2(c & 0xff) 8318 v.AddArg(v0) 8319 return true 8320 } 8321 // match: (Div8u x (Const8 [c])) 8322 // cond: umagicOK(8, c) 8323 // result: (Trunc32to8 (Rsh32Ux64 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(1<<8+umagic(8,c).m)]) (ZeroExt8to32 x)) (Const64 <typ.UInt64> [8+umagic(8,c).s]))) 8324 for { 8325 _ = v.Args[1] 8326 x := v.Args[0] 8327 v_1 := v.Args[1] 8328 if v_1.Op != OpConst8 { 8329 break 8330 } 8331 c := v_1.AuxInt 8332 if !(umagicOK(8, c)) { 8333 break 8334 } 8335 v.reset(OpTrunc32to8) 8336 v0 := b.NewValue0(v.Pos, OpRsh32Ux64, typ.UInt32) 8337 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 8338 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 8339 v2.AuxInt = int64(1<<8 + umagic(8, c).m) 8340 v1.AddArg(v2) 8341 v3 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 8342 v3.AddArg(x) 8343 v1.AddArg(v3) 8344 v0.AddArg(v1) 8345 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 8346 v4.AuxInt = 8 + umagic(8, c).s 8347 v0.AddArg(v4) 8348 v.AddArg(v0) 8349 return true 8350 } 8351 return false 8352 } 8353 func rewriteValuegeneric_OpEq16_0(v *Value) bool { 8354 b := v.Block 8355 config := b.Func.Config 8356 typ := &b.Func.Config.Types 8357 // match: (Eq16 x x) 8358 // result: (ConstBool [1]) 8359 for { 8360 x := v.Args[1] 8361 if x != v.Args[0] { 8362 break 8363 } 8364 v.reset(OpConstBool) 8365 v.AuxInt = 1 8366 return true 8367 } 8368 // match: (Eq16 (Const16 <t> [c]) (Add16 (Const16 <t> [d]) x)) 8369 // result: (Eq16 (Const16 <t> [int64(int16(c-d))]) x) 8370 for { 8371 _ = v.Args[1] 8372 v_0 := v.Args[0] 8373 if v_0.Op != OpConst16 { 8374 break 8375 } 8376 t := v_0.Type 8377 c := v_0.AuxInt 8378 v_1 := v.Args[1] 8379 if v_1.Op != OpAdd16 { 8380 break 8381 } 8382 x := v_1.Args[1] 8383 v_1_0 := v_1.Args[0] 8384 if v_1_0.Op != OpConst16 || v_1_0.Type != t { 8385 break 8386 } 8387 d := v_1_0.AuxInt 8388 v.reset(OpEq16) 8389 v0 := b.NewValue0(v.Pos, OpConst16, t) 8390 v0.AuxInt = int64(int16(c - d)) 8391 v.AddArg(v0) 8392 v.AddArg(x) 8393 return true 8394 } 8395 // match: (Eq16 (Const16 <t> [c]) (Add16 x (Const16 <t> [d]))) 8396 // result: (Eq16 (Const16 <t> [int64(int16(c-d))]) x) 8397 for { 8398 _ = v.Args[1] 8399 v_0 := v.Args[0] 8400 if v_0.Op != OpConst16 { 8401 break 8402 } 8403 t := v_0.Type 8404 c := v_0.AuxInt 8405 v_1 := v.Args[1] 8406 if v_1.Op != OpAdd16 { 8407 break 8408 } 8409 _ = v_1.Args[1] 8410 x := v_1.Args[0] 8411 v_1_1 := v_1.Args[1] 8412 if v_1_1.Op != OpConst16 || v_1_1.Type != t { 8413 break 8414 } 8415 d := v_1_1.AuxInt 8416 v.reset(OpEq16) 8417 v0 := b.NewValue0(v.Pos, OpConst16, t) 8418 v0.AuxInt = int64(int16(c - d)) 8419 v.AddArg(v0) 8420 v.AddArg(x) 8421 return true 8422 } 8423 // match: (Eq16 (Add16 (Const16 <t> [d]) x) (Const16 <t> [c])) 8424 // result: (Eq16 (Const16 <t> [int64(int16(c-d))]) x) 8425 for { 8426 _ = v.Args[1] 8427 v_0 := v.Args[0] 8428 if v_0.Op != OpAdd16 { 8429 break 8430 } 8431 x := v_0.Args[1] 8432 v_0_0 := v_0.Args[0] 8433 if v_0_0.Op != OpConst16 { 8434 break 8435 } 8436 t := v_0_0.Type 8437 d := v_0_0.AuxInt 8438 v_1 := v.Args[1] 8439 if v_1.Op != OpConst16 || v_1.Type != t { 8440 break 8441 } 8442 c := v_1.AuxInt 8443 v.reset(OpEq16) 8444 v0 := b.NewValue0(v.Pos, OpConst16, t) 8445 v0.AuxInt = int64(int16(c - d)) 8446 v.AddArg(v0) 8447 v.AddArg(x) 8448 return true 8449 } 8450 // match: (Eq16 (Add16 x (Const16 <t> [d])) (Const16 <t> [c])) 8451 // result: (Eq16 (Const16 <t> [int64(int16(c-d))]) x) 8452 for { 8453 _ = v.Args[1] 8454 v_0 := v.Args[0] 8455 if v_0.Op != OpAdd16 { 8456 break 8457 } 8458 _ = v_0.Args[1] 8459 x := v_0.Args[0] 8460 v_0_1 := v_0.Args[1] 8461 if v_0_1.Op != OpConst16 { 8462 break 8463 } 8464 t := v_0_1.Type 8465 d := v_0_1.AuxInt 8466 v_1 := v.Args[1] 8467 if v_1.Op != OpConst16 || v_1.Type != t { 8468 break 8469 } 8470 c := v_1.AuxInt 8471 v.reset(OpEq16) 8472 v0 := b.NewValue0(v.Pos, OpConst16, t) 8473 v0.AuxInt = int64(int16(c - d)) 8474 v.AddArg(v0) 8475 v.AddArg(x) 8476 return true 8477 } 8478 // match: (Eq16 (Const16 [c]) (Const16 [d])) 8479 // result: (ConstBool [b2i(c == d)]) 8480 for { 8481 _ = v.Args[1] 8482 v_0 := v.Args[0] 8483 if v_0.Op != OpConst16 { 8484 break 8485 } 8486 c := v_0.AuxInt 8487 v_1 := v.Args[1] 8488 if v_1.Op != OpConst16 { 8489 break 8490 } 8491 d := v_1.AuxInt 8492 v.reset(OpConstBool) 8493 v.AuxInt = b2i(c == d) 8494 return true 8495 } 8496 // match: (Eq16 (Const16 [d]) (Const16 [c])) 8497 // result: (ConstBool [b2i(c == d)]) 8498 for { 8499 _ = v.Args[1] 8500 v_0 := v.Args[0] 8501 if v_0.Op != OpConst16 { 8502 break 8503 } 8504 d := v_0.AuxInt 8505 v_1 := v.Args[1] 8506 if v_1.Op != OpConst16 { 8507 break 8508 } 8509 c := v_1.AuxInt 8510 v.reset(OpConstBool) 8511 v.AuxInt = b2i(c == d) 8512 return true 8513 } 8514 // match: (Eq16 (Mod16u x (Const16 [c])) (Const16 [0])) 8515 // cond: x.Op != OpConst16 && udivisibleOK(16,c) && !hasSmallRotate(config) 8516 // result: (Eq32 (Mod32u <typ.UInt32> (ZeroExt16to32 <typ.UInt32> x) (Const32 <typ.UInt32> [c&0xffff])) (Const32 <typ.UInt32> [0])) 8517 for { 8518 _ = v.Args[1] 8519 v_0 := v.Args[0] 8520 if v_0.Op != OpMod16u { 8521 break 8522 } 8523 _ = v_0.Args[1] 8524 x := v_0.Args[0] 8525 v_0_1 := v_0.Args[1] 8526 if v_0_1.Op != OpConst16 { 8527 break 8528 } 8529 c := v_0_1.AuxInt 8530 v_1 := v.Args[1] 8531 if v_1.Op != OpConst16 || v_1.AuxInt != 0 || !(x.Op != OpConst16 && udivisibleOK(16, c) && !hasSmallRotate(config)) { 8532 break 8533 } 8534 v.reset(OpEq32) 8535 v0 := b.NewValue0(v.Pos, OpMod32u, typ.UInt32) 8536 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 8537 v1.AddArg(x) 8538 v0.AddArg(v1) 8539 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 8540 v2.AuxInt = c & 0xffff 8541 v0.AddArg(v2) 8542 v.AddArg(v0) 8543 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 8544 v3.AuxInt = 0 8545 v.AddArg(v3) 8546 return true 8547 } 8548 // match: (Eq16 (Const16 [0]) (Mod16u x (Const16 [c]))) 8549 // cond: x.Op != OpConst16 && udivisibleOK(16,c) && !hasSmallRotate(config) 8550 // result: (Eq32 (Mod32u <typ.UInt32> (ZeroExt16to32 <typ.UInt32> x) (Const32 <typ.UInt32> [c&0xffff])) (Const32 <typ.UInt32> [0])) 8551 for { 8552 _ = v.Args[1] 8553 v_0 := v.Args[0] 8554 if v_0.Op != OpConst16 || v_0.AuxInt != 0 { 8555 break 8556 } 8557 v_1 := v.Args[1] 8558 if v_1.Op != OpMod16u { 8559 break 8560 } 8561 _ = v_1.Args[1] 8562 x := v_1.Args[0] 8563 v_1_1 := v_1.Args[1] 8564 if v_1_1.Op != OpConst16 { 8565 break 8566 } 8567 c := v_1_1.AuxInt 8568 if !(x.Op != OpConst16 && udivisibleOK(16, c) && !hasSmallRotate(config)) { 8569 break 8570 } 8571 v.reset(OpEq32) 8572 v0 := b.NewValue0(v.Pos, OpMod32u, typ.UInt32) 8573 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 8574 v1.AddArg(x) 8575 v0.AddArg(v1) 8576 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 8577 v2.AuxInt = c & 0xffff 8578 v0.AddArg(v2) 8579 v.AddArg(v0) 8580 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 8581 v3.AuxInt = 0 8582 v.AddArg(v3) 8583 return true 8584 } 8585 // match: (Eq16 (Mod16 x (Const16 [c])) (Const16 [0])) 8586 // cond: x.Op != OpConst16 && sdivisibleOK(16,c) && !hasSmallRotate(config) 8587 // result: (Eq32 (Mod32 <typ.Int32> (SignExt16to32 <typ.Int32> x) (Const32 <typ.Int32> [c])) (Const32 <typ.Int32> [0])) 8588 for { 8589 _ = v.Args[1] 8590 v_0 := v.Args[0] 8591 if v_0.Op != OpMod16 { 8592 break 8593 } 8594 _ = v_0.Args[1] 8595 x := v_0.Args[0] 8596 v_0_1 := v_0.Args[1] 8597 if v_0_1.Op != OpConst16 { 8598 break 8599 } 8600 c := v_0_1.AuxInt 8601 v_1 := v.Args[1] 8602 if v_1.Op != OpConst16 || v_1.AuxInt != 0 || !(x.Op != OpConst16 && sdivisibleOK(16, c) && !hasSmallRotate(config)) { 8603 break 8604 } 8605 v.reset(OpEq32) 8606 v0 := b.NewValue0(v.Pos, OpMod32, typ.Int32) 8607 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 8608 v1.AddArg(x) 8609 v0.AddArg(v1) 8610 v2 := b.NewValue0(v.Pos, OpConst32, typ.Int32) 8611 v2.AuxInt = c 8612 v0.AddArg(v2) 8613 v.AddArg(v0) 8614 v3 := b.NewValue0(v.Pos, OpConst32, typ.Int32) 8615 v3.AuxInt = 0 8616 v.AddArg(v3) 8617 return true 8618 } 8619 return false 8620 } 8621 func rewriteValuegeneric_OpEq16_10(v *Value) bool { 8622 b := v.Block 8623 config := b.Func.Config 8624 typ := &b.Func.Config.Types 8625 // match: (Eq16 (Const16 [0]) (Mod16 x (Const16 [c]))) 8626 // cond: x.Op != OpConst16 && sdivisibleOK(16,c) && !hasSmallRotate(config) 8627 // result: (Eq32 (Mod32 <typ.Int32> (SignExt16to32 <typ.Int32> x) (Const32 <typ.Int32> [c])) (Const32 <typ.Int32> [0])) 8628 for { 8629 _ = v.Args[1] 8630 v_0 := v.Args[0] 8631 if v_0.Op != OpConst16 || v_0.AuxInt != 0 { 8632 break 8633 } 8634 v_1 := v.Args[1] 8635 if v_1.Op != OpMod16 { 8636 break 8637 } 8638 _ = v_1.Args[1] 8639 x := v_1.Args[0] 8640 v_1_1 := v_1.Args[1] 8641 if v_1_1.Op != OpConst16 { 8642 break 8643 } 8644 c := v_1_1.AuxInt 8645 if !(x.Op != OpConst16 && sdivisibleOK(16, c) && !hasSmallRotate(config)) { 8646 break 8647 } 8648 v.reset(OpEq32) 8649 v0 := b.NewValue0(v.Pos, OpMod32, typ.Int32) 8650 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 8651 v1.AddArg(x) 8652 v0.AddArg(v1) 8653 v2 := b.NewValue0(v.Pos, OpConst32, typ.Int32) 8654 v2.AuxInt = c 8655 v0.AddArg(v2) 8656 v.AddArg(v0) 8657 v3 := b.NewValue0(v.Pos, OpConst32, typ.Int32) 8658 v3.AuxInt = 0 8659 v.AddArg(v3) 8660 return true 8661 } 8662 // match: (Eq16 x (Mul16 (Const16 [c]) (Trunc64to16 (Rsh64Ux64 mul:(Mul64 (Const64 [m]) (ZeroExt16to64 x)) (Const64 [s]))))) 8663 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<16+umagic(16,c).m) && s == 16+umagic(16,c).s && x.Op != OpConst16 && udivisibleOK(16,c) 8664 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 8665 for { 8666 _ = v.Args[1] 8667 x := v.Args[0] 8668 v_1 := v.Args[1] 8669 if v_1.Op != OpMul16 { 8670 break 8671 } 8672 _ = v_1.Args[1] 8673 v_1_0 := v_1.Args[0] 8674 if v_1_0.Op != OpConst16 { 8675 break 8676 } 8677 c := v_1_0.AuxInt 8678 v_1_1 := v_1.Args[1] 8679 if v_1_1.Op != OpTrunc64to16 { 8680 break 8681 } 8682 v_1_1_0 := v_1_1.Args[0] 8683 if v_1_1_0.Op != OpRsh64Ux64 { 8684 break 8685 } 8686 _ = v_1_1_0.Args[1] 8687 mul := v_1_1_0.Args[0] 8688 if mul.Op != OpMul64 { 8689 break 8690 } 8691 _ = mul.Args[1] 8692 mul_0 := mul.Args[0] 8693 if mul_0.Op != OpConst64 { 8694 break 8695 } 8696 m := mul_0.AuxInt 8697 mul_1 := mul.Args[1] 8698 if mul_1.Op != OpZeroExt16to64 || x != mul_1.Args[0] { 8699 break 8700 } 8701 v_1_1_0_1 := v_1_1_0.Args[1] 8702 if v_1_1_0_1.Op != OpConst64 { 8703 break 8704 } 8705 s := v_1_1_0_1.AuxInt 8706 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<16+umagic(16, c).m) && s == 16+umagic(16, c).s && x.Op != OpConst16 && udivisibleOK(16, c)) { 8707 break 8708 } 8709 v.reset(OpLeq16U) 8710 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 8711 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 8712 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 8713 v2.AuxInt = int64(int16(udivisible(16, c).m)) 8714 v1.AddArg(v2) 8715 v1.AddArg(x) 8716 v0.AddArg(v1) 8717 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 8718 v3.AuxInt = int64(16 - udivisible(16, c).k) 8719 v0.AddArg(v3) 8720 v.AddArg(v0) 8721 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 8722 v4.AuxInt = int64(int16(udivisible(16, c).max)) 8723 v.AddArg(v4) 8724 return true 8725 } 8726 // match: (Eq16 x (Mul16 (Const16 [c]) (Trunc64to16 (Rsh64Ux64 mul:(Mul64 (ZeroExt16to64 x) (Const64 [m])) (Const64 [s]))))) 8727 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<16+umagic(16,c).m) && s == 16+umagic(16,c).s && x.Op != OpConst16 && udivisibleOK(16,c) 8728 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 8729 for { 8730 _ = v.Args[1] 8731 x := v.Args[0] 8732 v_1 := v.Args[1] 8733 if v_1.Op != OpMul16 { 8734 break 8735 } 8736 _ = v_1.Args[1] 8737 v_1_0 := v_1.Args[0] 8738 if v_1_0.Op != OpConst16 { 8739 break 8740 } 8741 c := v_1_0.AuxInt 8742 v_1_1 := v_1.Args[1] 8743 if v_1_1.Op != OpTrunc64to16 { 8744 break 8745 } 8746 v_1_1_0 := v_1_1.Args[0] 8747 if v_1_1_0.Op != OpRsh64Ux64 { 8748 break 8749 } 8750 _ = v_1_1_0.Args[1] 8751 mul := v_1_1_0.Args[0] 8752 if mul.Op != OpMul64 { 8753 break 8754 } 8755 _ = mul.Args[1] 8756 mul_0 := mul.Args[0] 8757 if mul_0.Op != OpZeroExt16to64 || x != mul_0.Args[0] { 8758 break 8759 } 8760 mul_1 := mul.Args[1] 8761 if mul_1.Op != OpConst64 { 8762 break 8763 } 8764 m := mul_1.AuxInt 8765 v_1_1_0_1 := v_1_1_0.Args[1] 8766 if v_1_1_0_1.Op != OpConst64 { 8767 break 8768 } 8769 s := v_1_1_0_1.AuxInt 8770 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<16+umagic(16, c).m) && s == 16+umagic(16, c).s && x.Op != OpConst16 && udivisibleOK(16, c)) { 8771 break 8772 } 8773 v.reset(OpLeq16U) 8774 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 8775 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 8776 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 8777 v2.AuxInt = int64(int16(udivisible(16, c).m)) 8778 v1.AddArg(v2) 8779 v1.AddArg(x) 8780 v0.AddArg(v1) 8781 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 8782 v3.AuxInt = int64(16 - udivisible(16, c).k) 8783 v0.AddArg(v3) 8784 v.AddArg(v0) 8785 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 8786 v4.AuxInt = int64(int16(udivisible(16, c).max)) 8787 v.AddArg(v4) 8788 return true 8789 } 8790 // match: (Eq16 x (Mul16 (Trunc64to16 (Rsh64Ux64 mul:(Mul64 (Const64 [m]) (ZeroExt16to64 x)) (Const64 [s]))) (Const16 [c]))) 8791 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<16+umagic(16,c).m) && s == 16+umagic(16,c).s && x.Op != OpConst16 && udivisibleOK(16,c) 8792 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 8793 for { 8794 _ = v.Args[1] 8795 x := v.Args[0] 8796 v_1 := v.Args[1] 8797 if v_1.Op != OpMul16 { 8798 break 8799 } 8800 _ = v_1.Args[1] 8801 v_1_0 := v_1.Args[0] 8802 if v_1_0.Op != OpTrunc64to16 { 8803 break 8804 } 8805 v_1_0_0 := v_1_0.Args[0] 8806 if v_1_0_0.Op != OpRsh64Ux64 { 8807 break 8808 } 8809 _ = v_1_0_0.Args[1] 8810 mul := v_1_0_0.Args[0] 8811 if mul.Op != OpMul64 { 8812 break 8813 } 8814 _ = mul.Args[1] 8815 mul_0 := mul.Args[0] 8816 if mul_0.Op != OpConst64 { 8817 break 8818 } 8819 m := mul_0.AuxInt 8820 mul_1 := mul.Args[1] 8821 if mul_1.Op != OpZeroExt16to64 || x != mul_1.Args[0] { 8822 break 8823 } 8824 v_1_0_0_1 := v_1_0_0.Args[1] 8825 if v_1_0_0_1.Op != OpConst64 { 8826 break 8827 } 8828 s := v_1_0_0_1.AuxInt 8829 v_1_1 := v_1.Args[1] 8830 if v_1_1.Op != OpConst16 { 8831 break 8832 } 8833 c := v_1_1.AuxInt 8834 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<16+umagic(16, c).m) && s == 16+umagic(16, c).s && x.Op != OpConst16 && udivisibleOK(16, c)) { 8835 break 8836 } 8837 v.reset(OpLeq16U) 8838 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 8839 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 8840 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 8841 v2.AuxInt = int64(int16(udivisible(16, c).m)) 8842 v1.AddArg(v2) 8843 v1.AddArg(x) 8844 v0.AddArg(v1) 8845 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 8846 v3.AuxInt = int64(16 - udivisible(16, c).k) 8847 v0.AddArg(v3) 8848 v.AddArg(v0) 8849 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 8850 v4.AuxInt = int64(int16(udivisible(16, c).max)) 8851 v.AddArg(v4) 8852 return true 8853 } 8854 // match: (Eq16 x (Mul16 (Trunc64to16 (Rsh64Ux64 mul:(Mul64 (ZeroExt16to64 x) (Const64 [m])) (Const64 [s]))) (Const16 [c]))) 8855 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<16+umagic(16,c).m) && s == 16+umagic(16,c).s && x.Op != OpConst16 && udivisibleOK(16,c) 8856 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 8857 for { 8858 _ = v.Args[1] 8859 x := v.Args[0] 8860 v_1 := v.Args[1] 8861 if v_1.Op != OpMul16 { 8862 break 8863 } 8864 _ = v_1.Args[1] 8865 v_1_0 := v_1.Args[0] 8866 if v_1_0.Op != OpTrunc64to16 { 8867 break 8868 } 8869 v_1_0_0 := v_1_0.Args[0] 8870 if v_1_0_0.Op != OpRsh64Ux64 { 8871 break 8872 } 8873 _ = v_1_0_0.Args[1] 8874 mul := v_1_0_0.Args[0] 8875 if mul.Op != OpMul64 { 8876 break 8877 } 8878 _ = mul.Args[1] 8879 mul_0 := mul.Args[0] 8880 if mul_0.Op != OpZeroExt16to64 || x != mul_0.Args[0] { 8881 break 8882 } 8883 mul_1 := mul.Args[1] 8884 if mul_1.Op != OpConst64 { 8885 break 8886 } 8887 m := mul_1.AuxInt 8888 v_1_0_0_1 := v_1_0_0.Args[1] 8889 if v_1_0_0_1.Op != OpConst64 { 8890 break 8891 } 8892 s := v_1_0_0_1.AuxInt 8893 v_1_1 := v_1.Args[1] 8894 if v_1_1.Op != OpConst16 { 8895 break 8896 } 8897 c := v_1_1.AuxInt 8898 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<16+umagic(16, c).m) && s == 16+umagic(16, c).s && x.Op != OpConst16 && udivisibleOK(16, c)) { 8899 break 8900 } 8901 v.reset(OpLeq16U) 8902 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 8903 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 8904 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 8905 v2.AuxInt = int64(int16(udivisible(16, c).m)) 8906 v1.AddArg(v2) 8907 v1.AddArg(x) 8908 v0.AddArg(v1) 8909 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 8910 v3.AuxInt = int64(16 - udivisible(16, c).k) 8911 v0.AddArg(v3) 8912 v.AddArg(v0) 8913 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 8914 v4.AuxInt = int64(int16(udivisible(16, c).max)) 8915 v.AddArg(v4) 8916 return true 8917 } 8918 // match: (Eq16 (Mul16 (Const16 [c]) (Trunc64to16 (Rsh64Ux64 mul:(Mul64 (Const64 [m]) (ZeroExt16to64 x)) (Const64 [s])))) x) 8919 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<16+umagic(16,c).m) && s == 16+umagic(16,c).s && x.Op != OpConst16 && udivisibleOK(16,c) 8920 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 8921 for { 8922 x := v.Args[1] 8923 v_0 := v.Args[0] 8924 if v_0.Op != OpMul16 { 8925 break 8926 } 8927 _ = v_0.Args[1] 8928 v_0_0 := v_0.Args[0] 8929 if v_0_0.Op != OpConst16 { 8930 break 8931 } 8932 c := v_0_0.AuxInt 8933 v_0_1 := v_0.Args[1] 8934 if v_0_1.Op != OpTrunc64to16 { 8935 break 8936 } 8937 v_0_1_0 := v_0_1.Args[0] 8938 if v_0_1_0.Op != OpRsh64Ux64 { 8939 break 8940 } 8941 _ = v_0_1_0.Args[1] 8942 mul := v_0_1_0.Args[0] 8943 if mul.Op != OpMul64 { 8944 break 8945 } 8946 _ = mul.Args[1] 8947 mul_0 := mul.Args[0] 8948 if mul_0.Op != OpConst64 { 8949 break 8950 } 8951 m := mul_0.AuxInt 8952 mul_1 := mul.Args[1] 8953 if mul_1.Op != OpZeroExt16to64 || x != mul_1.Args[0] { 8954 break 8955 } 8956 v_0_1_0_1 := v_0_1_0.Args[1] 8957 if v_0_1_0_1.Op != OpConst64 { 8958 break 8959 } 8960 s := v_0_1_0_1.AuxInt 8961 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<16+umagic(16, c).m) && s == 16+umagic(16, c).s && x.Op != OpConst16 && udivisibleOK(16, c)) { 8962 break 8963 } 8964 v.reset(OpLeq16U) 8965 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 8966 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 8967 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 8968 v2.AuxInt = int64(int16(udivisible(16, c).m)) 8969 v1.AddArg(v2) 8970 v1.AddArg(x) 8971 v0.AddArg(v1) 8972 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 8973 v3.AuxInt = int64(16 - udivisible(16, c).k) 8974 v0.AddArg(v3) 8975 v.AddArg(v0) 8976 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 8977 v4.AuxInt = int64(int16(udivisible(16, c).max)) 8978 v.AddArg(v4) 8979 return true 8980 } 8981 // match: (Eq16 (Mul16 (Const16 [c]) (Trunc64to16 (Rsh64Ux64 mul:(Mul64 (ZeroExt16to64 x) (Const64 [m])) (Const64 [s])))) x) 8982 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<16+umagic(16,c).m) && s == 16+umagic(16,c).s && x.Op != OpConst16 && udivisibleOK(16,c) 8983 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 8984 for { 8985 x := v.Args[1] 8986 v_0 := v.Args[0] 8987 if v_0.Op != OpMul16 { 8988 break 8989 } 8990 _ = v_0.Args[1] 8991 v_0_0 := v_0.Args[0] 8992 if v_0_0.Op != OpConst16 { 8993 break 8994 } 8995 c := v_0_0.AuxInt 8996 v_0_1 := v_0.Args[1] 8997 if v_0_1.Op != OpTrunc64to16 { 8998 break 8999 } 9000 v_0_1_0 := v_0_1.Args[0] 9001 if v_0_1_0.Op != OpRsh64Ux64 { 9002 break 9003 } 9004 _ = v_0_1_0.Args[1] 9005 mul := v_0_1_0.Args[0] 9006 if mul.Op != OpMul64 { 9007 break 9008 } 9009 _ = mul.Args[1] 9010 mul_0 := mul.Args[0] 9011 if mul_0.Op != OpZeroExt16to64 || x != mul_0.Args[0] { 9012 break 9013 } 9014 mul_1 := mul.Args[1] 9015 if mul_1.Op != OpConst64 { 9016 break 9017 } 9018 m := mul_1.AuxInt 9019 v_0_1_0_1 := v_0_1_0.Args[1] 9020 if v_0_1_0_1.Op != OpConst64 { 9021 break 9022 } 9023 s := v_0_1_0_1.AuxInt 9024 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<16+umagic(16, c).m) && s == 16+umagic(16, c).s && x.Op != OpConst16 && udivisibleOK(16, c)) { 9025 break 9026 } 9027 v.reset(OpLeq16U) 9028 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 9029 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 9030 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9031 v2.AuxInt = int64(int16(udivisible(16, c).m)) 9032 v1.AddArg(v2) 9033 v1.AddArg(x) 9034 v0.AddArg(v1) 9035 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9036 v3.AuxInt = int64(16 - udivisible(16, c).k) 9037 v0.AddArg(v3) 9038 v.AddArg(v0) 9039 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9040 v4.AuxInt = int64(int16(udivisible(16, c).max)) 9041 v.AddArg(v4) 9042 return true 9043 } 9044 // match: (Eq16 (Mul16 (Trunc64to16 (Rsh64Ux64 mul:(Mul64 (Const64 [m]) (ZeroExt16to64 x)) (Const64 [s]))) (Const16 [c])) x) 9045 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<16+umagic(16,c).m) && s == 16+umagic(16,c).s && x.Op != OpConst16 && udivisibleOK(16,c) 9046 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 9047 for { 9048 x := v.Args[1] 9049 v_0 := v.Args[0] 9050 if v_0.Op != OpMul16 { 9051 break 9052 } 9053 _ = v_0.Args[1] 9054 v_0_0 := v_0.Args[0] 9055 if v_0_0.Op != OpTrunc64to16 { 9056 break 9057 } 9058 v_0_0_0 := v_0_0.Args[0] 9059 if v_0_0_0.Op != OpRsh64Ux64 { 9060 break 9061 } 9062 _ = v_0_0_0.Args[1] 9063 mul := v_0_0_0.Args[0] 9064 if mul.Op != OpMul64 { 9065 break 9066 } 9067 _ = mul.Args[1] 9068 mul_0 := mul.Args[0] 9069 if mul_0.Op != OpConst64 { 9070 break 9071 } 9072 m := mul_0.AuxInt 9073 mul_1 := mul.Args[1] 9074 if mul_1.Op != OpZeroExt16to64 || x != mul_1.Args[0] { 9075 break 9076 } 9077 v_0_0_0_1 := v_0_0_0.Args[1] 9078 if v_0_0_0_1.Op != OpConst64 { 9079 break 9080 } 9081 s := v_0_0_0_1.AuxInt 9082 v_0_1 := v_0.Args[1] 9083 if v_0_1.Op != OpConst16 { 9084 break 9085 } 9086 c := v_0_1.AuxInt 9087 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<16+umagic(16, c).m) && s == 16+umagic(16, c).s && x.Op != OpConst16 && udivisibleOK(16, c)) { 9088 break 9089 } 9090 v.reset(OpLeq16U) 9091 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 9092 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 9093 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9094 v2.AuxInt = int64(int16(udivisible(16, c).m)) 9095 v1.AddArg(v2) 9096 v1.AddArg(x) 9097 v0.AddArg(v1) 9098 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9099 v3.AuxInt = int64(16 - udivisible(16, c).k) 9100 v0.AddArg(v3) 9101 v.AddArg(v0) 9102 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9103 v4.AuxInt = int64(int16(udivisible(16, c).max)) 9104 v.AddArg(v4) 9105 return true 9106 } 9107 // match: (Eq16 (Mul16 (Trunc64to16 (Rsh64Ux64 mul:(Mul64 (ZeroExt16to64 x) (Const64 [m])) (Const64 [s]))) (Const16 [c])) x) 9108 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<16+umagic(16,c).m) && s == 16+umagic(16,c).s && x.Op != OpConst16 && udivisibleOK(16,c) 9109 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 9110 for { 9111 x := v.Args[1] 9112 v_0 := v.Args[0] 9113 if v_0.Op != OpMul16 { 9114 break 9115 } 9116 _ = v_0.Args[1] 9117 v_0_0 := v_0.Args[0] 9118 if v_0_0.Op != OpTrunc64to16 { 9119 break 9120 } 9121 v_0_0_0 := v_0_0.Args[0] 9122 if v_0_0_0.Op != OpRsh64Ux64 { 9123 break 9124 } 9125 _ = v_0_0_0.Args[1] 9126 mul := v_0_0_0.Args[0] 9127 if mul.Op != OpMul64 { 9128 break 9129 } 9130 _ = mul.Args[1] 9131 mul_0 := mul.Args[0] 9132 if mul_0.Op != OpZeroExt16to64 || x != mul_0.Args[0] { 9133 break 9134 } 9135 mul_1 := mul.Args[1] 9136 if mul_1.Op != OpConst64 { 9137 break 9138 } 9139 m := mul_1.AuxInt 9140 v_0_0_0_1 := v_0_0_0.Args[1] 9141 if v_0_0_0_1.Op != OpConst64 { 9142 break 9143 } 9144 s := v_0_0_0_1.AuxInt 9145 v_0_1 := v_0.Args[1] 9146 if v_0_1.Op != OpConst16 { 9147 break 9148 } 9149 c := v_0_1.AuxInt 9150 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<16+umagic(16, c).m) && s == 16+umagic(16, c).s && x.Op != OpConst16 && udivisibleOK(16, c)) { 9151 break 9152 } 9153 v.reset(OpLeq16U) 9154 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 9155 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 9156 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9157 v2.AuxInt = int64(int16(udivisible(16, c).m)) 9158 v1.AddArg(v2) 9159 v1.AddArg(x) 9160 v0.AddArg(v1) 9161 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9162 v3.AuxInt = int64(16 - udivisible(16, c).k) 9163 v0.AddArg(v3) 9164 v.AddArg(v0) 9165 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9166 v4.AuxInt = int64(int16(udivisible(16, c).max)) 9167 v.AddArg(v4) 9168 return true 9169 } 9170 // match: (Eq16 x (Mul16 (Const16 [c]) (Trunc32to16 (Rsh32Ux64 mul:(Mul32 (Const32 [m]) (ZeroExt16to32 x)) (Const64 [s]))))) 9171 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+umagic(16,c).m/2) && s == 16+umagic(16,c).s-1 && x.Op != OpConst16 && udivisibleOK(16,c) 9172 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 9173 for { 9174 _ = v.Args[1] 9175 x := v.Args[0] 9176 v_1 := v.Args[1] 9177 if v_1.Op != OpMul16 { 9178 break 9179 } 9180 _ = v_1.Args[1] 9181 v_1_0 := v_1.Args[0] 9182 if v_1_0.Op != OpConst16 { 9183 break 9184 } 9185 c := v_1_0.AuxInt 9186 v_1_1 := v_1.Args[1] 9187 if v_1_1.Op != OpTrunc32to16 { 9188 break 9189 } 9190 v_1_1_0 := v_1_1.Args[0] 9191 if v_1_1_0.Op != OpRsh32Ux64 { 9192 break 9193 } 9194 _ = v_1_1_0.Args[1] 9195 mul := v_1_1_0.Args[0] 9196 if mul.Op != OpMul32 { 9197 break 9198 } 9199 _ = mul.Args[1] 9200 mul_0 := mul.Args[0] 9201 if mul_0.Op != OpConst32 { 9202 break 9203 } 9204 m := mul_0.AuxInt 9205 mul_1 := mul.Args[1] 9206 if mul_1.Op != OpZeroExt16to32 || x != mul_1.Args[0] { 9207 break 9208 } 9209 v_1_1_0_1 := v_1_1_0.Args[1] 9210 if v_1_1_0_1.Op != OpConst64 { 9211 break 9212 } 9213 s := v_1_1_0_1.AuxInt 9214 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+umagic(16, c).m/2) && s == 16+umagic(16, c).s-1 && x.Op != OpConst16 && udivisibleOK(16, c)) { 9215 break 9216 } 9217 v.reset(OpLeq16U) 9218 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 9219 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 9220 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9221 v2.AuxInt = int64(int16(udivisible(16, c).m)) 9222 v1.AddArg(v2) 9223 v1.AddArg(x) 9224 v0.AddArg(v1) 9225 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9226 v3.AuxInt = int64(16 - udivisible(16, c).k) 9227 v0.AddArg(v3) 9228 v.AddArg(v0) 9229 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9230 v4.AuxInt = int64(int16(udivisible(16, c).max)) 9231 v.AddArg(v4) 9232 return true 9233 } 9234 return false 9235 } 9236 func rewriteValuegeneric_OpEq16_20(v *Value) bool { 9237 b := v.Block 9238 typ := &b.Func.Config.Types 9239 // match: (Eq16 x (Mul16 (Const16 [c]) (Trunc32to16 (Rsh32Ux64 mul:(Mul32 (ZeroExt16to32 x) (Const32 [m])) (Const64 [s]))))) 9240 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+umagic(16,c).m/2) && s == 16+umagic(16,c).s-1 && x.Op != OpConst16 && udivisibleOK(16,c) 9241 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 9242 for { 9243 _ = v.Args[1] 9244 x := v.Args[0] 9245 v_1 := v.Args[1] 9246 if v_1.Op != OpMul16 { 9247 break 9248 } 9249 _ = v_1.Args[1] 9250 v_1_0 := v_1.Args[0] 9251 if v_1_0.Op != OpConst16 { 9252 break 9253 } 9254 c := v_1_0.AuxInt 9255 v_1_1 := v_1.Args[1] 9256 if v_1_1.Op != OpTrunc32to16 { 9257 break 9258 } 9259 v_1_1_0 := v_1_1.Args[0] 9260 if v_1_1_0.Op != OpRsh32Ux64 { 9261 break 9262 } 9263 _ = v_1_1_0.Args[1] 9264 mul := v_1_1_0.Args[0] 9265 if mul.Op != OpMul32 { 9266 break 9267 } 9268 _ = mul.Args[1] 9269 mul_0 := mul.Args[0] 9270 if mul_0.Op != OpZeroExt16to32 || x != mul_0.Args[0] { 9271 break 9272 } 9273 mul_1 := mul.Args[1] 9274 if mul_1.Op != OpConst32 { 9275 break 9276 } 9277 m := mul_1.AuxInt 9278 v_1_1_0_1 := v_1_1_0.Args[1] 9279 if v_1_1_0_1.Op != OpConst64 { 9280 break 9281 } 9282 s := v_1_1_0_1.AuxInt 9283 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+umagic(16, c).m/2) && s == 16+umagic(16, c).s-1 && x.Op != OpConst16 && udivisibleOK(16, c)) { 9284 break 9285 } 9286 v.reset(OpLeq16U) 9287 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 9288 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 9289 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9290 v2.AuxInt = int64(int16(udivisible(16, c).m)) 9291 v1.AddArg(v2) 9292 v1.AddArg(x) 9293 v0.AddArg(v1) 9294 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9295 v3.AuxInt = int64(16 - udivisible(16, c).k) 9296 v0.AddArg(v3) 9297 v.AddArg(v0) 9298 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9299 v4.AuxInt = int64(int16(udivisible(16, c).max)) 9300 v.AddArg(v4) 9301 return true 9302 } 9303 // match: (Eq16 x (Mul16 (Trunc32to16 (Rsh32Ux64 mul:(Mul32 (Const32 [m]) (ZeroExt16to32 x)) (Const64 [s]))) (Const16 [c]))) 9304 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+umagic(16,c).m/2) && s == 16+umagic(16,c).s-1 && x.Op != OpConst16 && udivisibleOK(16,c) 9305 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 9306 for { 9307 _ = v.Args[1] 9308 x := v.Args[0] 9309 v_1 := v.Args[1] 9310 if v_1.Op != OpMul16 { 9311 break 9312 } 9313 _ = v_1.Args[1] 9314 v_1_0 := v_1.Args[0] 9315 if v_1_0.Op != OpTrunc32to16 { 9316 break 9317 } 9318 v_1_0_0 := v_1_0.Args[0] 9319 if v_1_0_0.Op != OpRsh32Ux64 { 9320 break 9321 } 9322 _ = v_1_0_0.Args[1] 9323 mul := v_1_0_0.Args[0] 9324 if mul.Op != OpMul32 { 9325 break 9326 } 9327 _ = mul.Args[1] 9328 mul_0 := mul.Args[0] 9329 if mul_0.Op != OpConst32 { 9330 break 9331 } 9332 m := mul_0.AuxInt 9333 mul_1 := mul.Args[1] 9334 if mul_1.Op != OpZeroExt16to32 || x != mul_1.Args[0] { 9335 break 9336 } 9337 v_1_0_0_1 := v_1_0_0.Args[1] 9338 if v_1_0_0_1.Op != OpConst64 { 9339 break 9340 } 9341 s := v_1_0_0_1.AuxInt 9342 v_1_1 := v_1.Args[1] 9343 if v_1_1.Op != OpConst16 { 9344 break 9345 } 9346 c := v_1_1.AuxInt 9347 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+umagic(16, c).m/2) && s == 16+umagic(16, c).s-1 && x.Op != OpConst16 && udivisibleOK(16, c)) { 9348 break 9349 } 9350 v.reset(OpLeq16U) 9351 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 9352 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 9353 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9354 v2.AuxInt = int64(int16(udivisible(16, c).m)) 9355 v1.AddArg(v2) 9356 v1.AddArg(x) 9357 v0.AddArg(v1) 9358 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9359 v3.AuxInt = int64(16 - udivisible(16, c).k) 9360 v0.AddArg(v3) 9361 v.AddArg(v0) 9362 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9363 v4.AuxInt = int64(int16(udivisible(16, c).max)) 9364 v.AddArg(v4) 9365 return true 9366 } 9367 // match: (Eq16 x (Mul16 (Trunc32to16 (Rsh32Ux64 mul:(Mul32 (ZeroExt16to32 x) (Const32 [m])) (Const64 [s]))) (Const16 [c]))) 9368 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+umagic(16,c).m/2) && s == 16+umagic(16,c).s-1 && x.Op != OpConst16 && udivisibleOK(16,c) 9369 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 9370 for { 9371 _ = v.Args[1] 9372 x := v.Args[0] 9373 v_1 := v.Args[1] 9374 if v_1.Op != OpMul16 { 9375 break 9376 } 9377 _ = v_1.Args[1] 9378 v_1_0 := v_1.Args[0] 9379 if v_1_0.Op != OpTrunc32to16 { 9380 break 9381 } 9382 v_1_0_0 := v_1_0.Args[0] 9383 if v_1_0_0.Op != OpRsh32Ux64 { 9384 break 9385 } 9386 _ = v_1_0_0.Args[1] 9387 mul := v_1_0_0.Args[0] 9388 if mul.Op != OpMul32 { 9389 break 9390 } 9391 _ = mul.Args[1] 9392 mul_0 := mul.Args[0] 9393 if mul_0.Op != OpZeroExt16to32 || x != mul_0.Args[0] { 9394 break 9395 } 9396 mul_1 := mul.Args[1] 9397 if mul_1.Op != OpConst32 { 9398 break 9399 } 9400 m := mul_1.AuxInt 9401 v_1_0_0_1 := v_1_0_0.Args[1] 9402 if v_1_0_0_1.Op != OpConst64 { 9403 break 9404 } 9405 s := v_1_0_0_1.AuxInt 9406 v_1_1 := v_1.Args[1] 9407 if v_1_1.Op != OpConst16 { 9408 break 9409 } 9410 c := v_1_1.AuxInt 9411 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+umagic(16, c).m/2) && s == 16+umagic(16, c).s-1 && x.Op != OpConst16 && udivisibleOK(16, c)) { 9412 break 9413 } 9414 v.reset(OpLeq16U) 9415 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 9416 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 9417 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9418 v2.AuxInt = int64(int16(udivisible(16, c).m)) 9419 v1.AddArg(v2) 9420 v1.AddArg(x) 9421 v0.AddArg(v1) 9422 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9423 v3.AuxInt = int64(16 - udivisible(16, c).k) 9424 v0.AddArg(v3) 9425 v.AddArg(v0) 9426 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9427 v4.AuxInt = int64(int16(udivisible(16, c).max)) 9428 v.AddArg(v4) 9429 return true 9430 } 9431 // match: (Eq16 (Mul16 (Const16 [c]) (Trunc32to16 (Rsh32Ux64 mul:(Mul32 (Const32 [m]) (ZeroExt16to32 x)) (Const64 [s])))) x) 9432 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+umagic(16,c).m/2) && s == 16+umagic(16,c).s-1 && x.Op != OpConst16 && udivisibleOK(16,c) 9433 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 9434 for { 9435 x := v.Args[1] 9436 v_0 := v.Args[0] 9437 if v_0.Op != OpMul16 { 9438 break 9439 } 9440 _ = v_0.Args[1] 9441 v_0_0 := v_0.Args[0] 9442 if v_0_0.Op != OpConst16 { 9443 break 9444 } 9445 c := v_0_0.AuxInt 9446 v_0_1 := v_0.Args[1] 9447 if v_0_1.Op != OpTrunc32to16 { 9448 break 9449 } 9450 v_0_1_0 := v_0_1.Args[0] 9451 if v_0_1_0.Op != OpRsh32Ux64 { 9452 break 9453 } 9454 _ = v_0_1_0.Args[1] 9455 mul := v_0_1_0.Args[0] 9456 if mul.Op != OpMul32 { 9457 break 9458 } 9459 _ = mul.Args[1] 9460 mul_0 := mul.Args[0] 9461 if mul_0.Op != OpConst32 { 9462 break 9463 } 9464 m := mul_0.AuxInt 9465 mul_1 := mul.Args[1] 9466 if mul_1.Op != OpZeroExt16to32 || x != mul_1.Args[0] { 9467 break 9468 } 9469 v_0_1_0_1 := v_0_1_0.Args[1] 9470 if v_0_1_0_1.Op != OpConst64 { 9471 break 9472 } 9473 s := v_0_1_0_1.AuxInt 9474 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+umagic(16, c).m/2) && s == 16+umagic(16, c).s-1 && x.Op != OpConst16 && udivisibleOK(16, c)) { 9475 break 9476 } 9477 v.reset(OpLeq16U) 9478 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 9479 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 9480 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9481 v2.AuxInt = int64(int16(udivisible(16, c).m)) 9482 v1.AddArg(v2) 9483 v1.AddArg(x) 9484 v0.AddArg(v1) 9485 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9486 v3.AuxInt = int64(16 - udivisible(16, c).k) 9487 v0.AddArg(v3) 9488 v.AddArg(v0) 9489 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9490 v4.AuxInt = int64(int16(udivisible(16, c).max)) 9491 v.AddArg(v4) 9492 return true 9493 } 9494 // match: (Eq16 (Mul16 (Const16 [c]) (Trunc32to16 (Rsh32Ux64 mul:(Mul32 (ZeroExt16to32 x) (Const32 [m])) (Const64 [s])))) x) 9495 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+umagic(16,c).m/2) && s == 16+umagic(16,c).s-1 && x.Op != OpConst16 && udivisibleOK(16,c) 9496 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 9497 for { 9498 x := v.Args[1] 9499 v_0 := v.Args[0] 9500 if v_0.Op != OpMul16 { 9501 break 9502 } 9503 _ = v_0.Args[1] 9504 v_0_0 := v_0.Args[0] 9505 if v_0_0.Op != OpConst16 { 9506 break 9507 } 9508 c := v_0_0.AuxInt 9509 v_0_1 := v_0.Args[1] 9510 if v_0_1.Op != OpTrunc32to16 { 9511 break 9512 } 9513 v_0_1_0 := v_0_1.Args[0] 9514 if v_0_1_0.Op != OpRsh32Ux64 { 9515 break 9516 } 9517 _ = v_0_1_0.Args[1] 9518 mul := v_0_1_0.Args[0] 9519 if mul.Op != OpMul32 { 9520 break 9521 } 9522 _ = mul.Args[1] 9523 mul_0 := mul.Args[0] 9524 if mul_0.Op != OpZeroExt16to32 || x != mul_0.Args[0] { 9525 break 9526 } 9527 mul_1 := mul.Args[1] 9528 if mul_1.Op != OpConst32 { 9529 break 9530 } 9531 m := mul_1.AuxInt 9532 v_0_1_0_1 := v_0_1_0.Args[1] 9533 if v_0_1_0_1.Op != OpConst64 { 9534 break 9535 } 9536 s := v_0_1_0_1.AuxInt 9537 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+umagic(16, c).m/2) && s == 16+umagic(16, c).s-1 && x.Op != OpConst16 && udivisibleOK(16, c)) { 9538 break 9539 } 9540 v.reset(OpLeq16U) 9541 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 9542 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 9543 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9544 v2.AuxInt = int64(int16(udivisible(16, c).m)) 9545 v1.AddArg(v2) 9546 v1.AddArg(x) 9547 v0.AddArg(v1) 9548 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9549 v3.AuxInt = int64(16 - udivisible(16, c).k) 9550 v0.AddArg(v3) 9551 v.AddArg(v0) 9552 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9553 v4.AuxInt = int64(int16(udivisible(16, c).max)) 9554 v.AddArg(v4) 9555 return true 9556 } 9557 // match: (Eq16 (Mul16 (Trunc32to16 (Rsh32Ux64 mul:(Mul32 (Const32 [m]) (ZeroExt16to32 x)) (Const64 [s]))) (Const16 [c])) x) 9558 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+umagic(16,c).m/2) && s == 16+umagic(16,c).s-1 && x.Op != OpConst16 && udivisibleOK(16,c) 9559 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 9560 for { 9561 x := v.Args[1] 9562 v_0 := v.Args[0] 9563 if v_0.Op != OpMul16 { 9564 break 9565 } 9566 _ = v_0.Args[1] 9567 v_0_0 := v_0.Args[0] 9568 if v_0_0.Op != OpTrunc32to16 { 9569 break 9570 } 9571 v_0_0_0 := v_0_0.Args[0] 9572 if v_0_0_0.Op != OpRsh32Ux64 { 9573 break 9574 } 9575 _ = v_0_0_0.Args[1] 9576 mul := v_0_0_0.Args[0] 9577 if mul.Op != OpMul32 { 9578 break 9579 } 9580 _ = mul.Args[1] 9581 mul_0 := mul.Args[0] 9582 if mul_0.Op != OpConst32 { 9583 break 9584 } 9585 m := mul_0.AuxInt 9586 mul_1 := mul.Args[1] 9587 if mul_1.Op != OpZeroExt16to32 || x != mul_1.Args[0] { 9588 break 9589 } 9590 v_0_0_0_1 := v_0_0_0.Args[1] 9591 if v_0_0_0_1.Op != OpConst64 { 9592 break 9593 } 9594 s := v_0_0_0_1.AuxInt 9595 v_0_1 := v_0.Args[1] 9596 if v_0_1.Op != OpConst16 { 9597 break 9598 } 9599 c := v_0_1.AuxInt 9600 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+umagic(16, c).m/2) && s == 16+umagic(16, c).s-1 && x.Op != OpConst16 && udivisibleOK(16, c)) { 9601 break 9602 } 9603 v.reset(OpLeq16U) 9604 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 9605 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 9606 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9607 v2.AuxInt = int64(int16(udivisible(16, c).m)) 9608 v1.AddArg(v2) 9609 v1.AddArg(x) 9610 v0.AddArg(v1) 9611 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9612 v3.AuxInt = int64(16 - udivisible(16, c).k) 9613 v0.AddArg(v3) 9614 v.AddArg(v0) 9615 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9616 v4.AuxInt = int64(int16(udivisible(16, c).max)) 9617 v.AddArg(v4) 9618 return true 9619 } 9620 // match: (Eq16 (Mul16 (Trunc32to16 (Rsh32Ux64 mul:(Mul32 (ZeroExt16to32 x) (Const32 [m])) (Const64 [s]))) (Const16 [c])) x) 9621 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+umagic(16,c).m/2) && s == 16+umagic(16,c).s-1 && x.Op != OpConst16 && udivisibleOK(16,c) 9622 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 9623 for { 9624 x := v.Args[1] 9625 v_0 := v.Args[0] 9626 if v_0.Op != OpMul16 { 9627 break 9628 } 9629 _ = v_0.Args[1] 9630 v_0_0 := v_0.Args[0] 9631 if v_0_0.Op != OpTrunc32to16 { 9632 break 9633 } 9634 v_0_0_0 := v_0_0.Args[0] 9635 if v_0_0_0.Op != OpRsh32Ux64 { 9636 break 9637 } 9638 _ = v_0_0_0.Args[1] 9639 mul := v_0_0_0.Args[0] 9640 if mul.Op != OpMul32 { 9641 break 9642 } 9643 _ = mul.Args[1] 9644 mul_0 := mul.Args[0] 9645 if mul_0.Op != OpZeroExt16to32 || x != mul_0.Args[0] { 9646 break 9647 } 9648 mul_1 := mul.Args[1] 9649 if mul_1.Op != OpConst32 { 9650 break 9651 } 9652 m := mul_1.AuxInt 9653 v_0_0_0_1 := v_0_0_0.Args[1] 9654 if v_0_0_0_1.Op != OpConst64 { 9655 break 9656 } 9657 s := v_0_0_0_1.AuxInt 9658 v_0_1 := v_0.Args[1] 9659 if v_0_1.Op != OpConst16 { 9660 break 9661 } 9662 c := v_0_1.AuxInt 9663 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+umagic(16, c).m/2) && s == 16+umagic(16, c).s-1 && x.Op != OpConst16 && udivisibleOK(16, c)) { 9664 break 9665 } 9666 v.reset(OpLeq16U) 9667 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 9668 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 9669 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9670 v2.AuxInt = int64(int16(udivisible(16, c).m)) 9671 v1.AddArg(v2) 9672 v1.AddArg(x) 9673 v0.AddArg(v1) 9674 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9675 v3.AuxInt = int64(16 - udivisible(16, c).k) 9676 v0.AddArg(v3) 9677 v.AddArg(v0) 9678 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9679 v4.AuxInt = int64(int16(udivisible(16, c).max)) 9680 v.AddArg(v4) 9681 return true 9682 } 9683 // match: (Eq16 x (Mul16 (Const16 [c]) (Trunc32to16 (Rsh32Ux64 mul:(Mul32 (Const32 [m]) (Rsh32Ux64 (ZeroExt16to32 x) (Const64 [1]))) (Const64 [s]))))) 9684 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+(umagic(16,c).m+1)/2) && s == 16+umagic(16,c).s-2 && x.Op != OpConst16 && udivisibleOK(16,c) 9685 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 9686 for { 9687 _ = v.Args[1] 9688 x := v.Args[0] 9689 v_1 := v.Args[1] 9690 if v_1.Op != OpMul16 { 9691 break 9692 } 9693 _ = v_1.Args[1] 9694 v_1_0 := v_1.Args[0] 9695 if v_1_0.Op != OpConst16 { 9696 break 9697 } 9698 c := v_1_0.AuxInt 9699 v_1_1 := v_1.Args[1] 9700 if v_1_1.Op != OpTrunc32to16 { 9701 break 9702 } 9703 v_1_1_0 := v_1_1.Args[0] 9704 if v_1_1_0.Op != OpRsh32Ux64 { 9705 break 9706 } 9707 _ = v_1_1_0.Args[1] 9708 mul := v_1_1_0.Args[0] 9709 if mul.Op != OpMul32 { 9710 break 9711 } 9712 _ = mul.Args[1] 9713 mul_0 := mul.Args[0] 9714 if mul_0.Op != OpConst32 { 9715 break 9716 } 9717 m := mul_0.AuxInt 9718 mul_1 := mul.Args[1] 9719 if mul_1.Op != OpRsh32Ux64 { 9720 break 9721 } 9722 _ = mul_1.Args[1] 9723 mul_1_0 := mul_1.Args[0] 9724 if mul_1_0.Op != OpZeroExt16to32 || x != mul_1_0.Args[0] { 9725 break 9726 } 9727 mul_1_1 := mul_1.Args[1] 9728 if mul_1_1.Op != OpConst64 || mul_1_1.AuxInt != 1 { 9729 break 9730 } 9731 v_1_1_0_1 := v_1_1_0.Args[1] 9732 if v_1_1_0_1.Op != OpConst64 { 9733 break 9734 } 9735 s := v_1_1_0_1.AuxInt 9736 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+(umagic(16, c).m+1)/2) && s == 16+umagic(16, c).s-2 && x.Op != OpConst16 && udivisibleOK(16, c)) { 9737 break 9738 } 9739 v.reset(OpLeq16U) 9740 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 9741 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 9742 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9743 v2.AuxInt = int64(int16(udivisible(16, c).m)) 9744 v1.AddArg(v2) 9745 v1.AddArg(x) 9746 v0.AddArg(v1) 9747 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9748 v3.AuxInt = int64(16 - udivisible(16, c).k) 9749 v0.AddArg(v3) 9750 v.AddArg(v0) 9751 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9752 v4.AuxInt = int64(int16(udivisible(16, c).max)) 9753 v.AddArg(v4) 9754 return true 9755 } 9756 // match: (Eq16 x (Mul16 (Const16 [c]) (Trunc32to16 (Rsh32Ux64 mul:(Mul32 (Rsh32Ux64 (ZeroExt16to32 x) (Const64 [1])) (Const32 [m])) (Const64 [s]))))) 9757 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+(umagic(16,c).m+1)/2) && s == 16+umagic(16,c).s-2 && x.Op != OpConst16 && udivisibleOK(16,c) 9758 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 9759 for { 9760 _ = v.Args[1] 9761 x := v.Args[0] 9762 v_1 := v.Args[1] 9763 if v_1.Op != OpMul16 { 9764 break 9765 } 9766 _ = v_1.Args[1] 9767 v_1_0 := v_1.Args[0] 9768 if v_1_0.Op != OpConst16 { 9769 break 9770 } 9771 c := v_1_0.AuxInt 9772 v_1_1 := v_1.Args[1] 9773 if v_1_1.Op != OpTrunc32to16 { 9774 break 9775 } 9776 v_1_1_0 := v_1_1.Args[0] 9777 if v_1_1_0.Op != OpRsh32Ux64 { 9778 break 9779 } 9780 _ = v_1_1_0.Args[1] 9781 mul := v_1_1_0.Args[0] 9782 if mul.Op != OpMul32 { 9783 break 9784 } 9785 _ = mul.Args[1] 9786 mul_0 := mul.Args[0] 9787 if mul_0.Op != OpRsh32Ux64 { 9788 break 9789 } 9790 _ = mul_0.Args[1] 9791 mul_0_0 := mul_0.Args[0] 9792 if mul_0_0.Op != OpZeroExt16to32 || x != mul_0_0.Args[0] { 9793 break 9794 } 9795 mul_0_1 := mul_0.Args[1] 9796 if mul_0_1.Op != OpConst64 || mul_0_1.AuxInt != 1 { 9797 break 9798 } 9799 mul_1 := mul.Args[1] 9800 if mul_1.Op != OpConst32 { 9801 break 9802 } 9803 m := mul_1.AuxInt 9804 v_1_1_0_1 := v_1_1_0.Args[1] 9805 if v_1_1_0_1.Op != OpConst64 { 9806 break 9807 } 9808 s := v_1_1_0_1.AuxInt 9809 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+(umagic(16, c).m+1)/2) && s == 16+umagic(16, c).s-2 && x.Op != OpConst16 && udivisibleOK(16, c)) { 9810 break 9811 } 9812 v.reset(OpLeq16U) 9813 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 9814 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 9815 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9816 v2.AuxInt = int64(int16(udivisible(16, c).m)) 9817 v1.AddArg(v2) 9818 v1.AddArg(x) 9819 v0.AddArg(v1) 9820 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9821 v3.AuxInt = int64(16 - udivisible(16, c).k) 9822 v0.AddArg(v3) 9823 v.AddArg(v0) 9824 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9825 v4.AuxInt = int64(int16(udivisible(16, c).max)) 9826 v.AddArg(v4) 9827 return true 9828 } 9829 // match: (Eq16 x (Mul16 (Trunc32to16 (Rsh32Ux64 mul:(Mul32 (Const32 [m]) (Rsh32Ux64 (ZeroExt16to32 x) (Const64 [1]))) (Const64 [s]))) (Const16 [c]))) 9830 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+(umagic(16,c).m+1)/2) && s == 16+umagic(16,c).s-2 && x.Op != OpConst16 && udivisibleOK(16,c) 9831 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 9832 for { 9833 _ = v.Args[1] 9834 x := v.Args[0] 9835 v_1 := v.Args[1] 9836 if v_1.Op != OpMul16 { 9837 break 9838 } 9839 _ = v_1.Args[1] 9840 v_1_0 := v_1.Args[0] 9841 if v_1_0.Op != OpTrunc32to16 { 9842 break 9843 } 9844 v_1_0_0 := v_1_0.Args[0] 9845 if v_1_0_0.Op != OpRsh32Ux64 { 9846 break 9847 } 9848 _ = v_1_0_0.Args[1] 9849 mul := v_1_0_0.Args[0] 9850 if mul.Op != OpMul32 { 9851 break 9852 } 9853 _ = mul.Args[1] 9854 mul_0 := mul.Args[0] 9855 if mul_0.Op != OpConst32 { 9856 break 9857 } 9858 m := mul_0.AuxInt 9859 mul_1 := mul.Args[1] 9860 if mul_1.Op != OpRsh32Ux64 { 9861 break 9862 } 9863 _ = mul_1.Args[1] 9864 mul_1_0 := mul_1.Args[0] 9865 if mul_1_0.Op != OpZeroExt16to32 || x != mul_1_0.Args[0] { 9866 break 9867 } 9868 mul_1_1 := mul_1.Args[1] 9869 if mul_1_1.Op != OpConst64 || mul_1_1.AuxInt != 1 { 9870 break 9871 } 9872 v_1_0_0_1 := v_1_0_0.Args[1] 9873 if v_1_0_0_1.Op != OpConst64 { 9874 break 9875 } 9876 s := v_1_0_0_1.AuxInt 9877 v_1_1 := v_1.Args[1] 9878 if v_1_1.Op != OpConst16 { 9879 break 9880 } 9881 c := v_1_1.AuxInt 9882 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+(umagic(16, c).m+1)/2) && s == 16+umagic(16, c).s-2 && x.Op != OpConst16 && udivisibleOK(16, c)) { 9883 break 9884 } 9885 v.reset(OpLeq16U) 9886 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 9887 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 9888 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9889 v2.AuxInt = int64(int16(udivisible(16, c).m)) 9890 v1.AddArg(v2) 9891 v1.AddArg(x) 9892 v0.AddArg(v1) 9893 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9894 v3.AuxInt = int64(16 - udivisible(16, c).k) 9895 v0.AddArg(v3) 9896 v.AddArg(v0) 9897 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9898 v4.AuxInt = int64(int16(udivisible(16, c).max)) 9899 v.AddArg(v4) 9900 return true 9901 } 9902 return false 9903 } 9904 func rewriteValuegeneric_OpEq16_30(v *Value) bool { 9905 b := v.Block 9906 typ := &b.Func.Config.Types 9907 // match: (Eq16 x (Mul16 (Trunc32to16 (Rsh32Ux64 mul:(Mul32 (Rsh32Ux64 (ZeroExt16to32 x) (Const64 [1])) (Const32 [m])) (Const64 [s]))) (Const16 [c]))) 9908 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+(umagic(16,c).m+1)/2) && s == 16+umagic(16,c).s-2 && x.Op != OpConst16 && udivisibleOK(16,c) 9909 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 9910 for { 9911 _ = v.Args[1] 9912 x := v.Args[0] 9913 v_1 := v.Args[1] 9914 if v_1.Op != OpMul16 { 9915 break 9916 } 9917 _ = v_1.Args[1] 9918 v_1_0 := v_1.Args[0] 9919 if v_1_0.Op != OpTrunc32to16 { 9920 break 9921 } 9922 v_1_0_0 := v_1_0.Args[0] 9923 if v_1_0_0.Op != OpRsh32Ux64 { 9924 break 9925 } 9926 _ = v_1_0_0.Args[1] 9927 mul := v_1_0_0.Args[0] 9928 if mul.Op != OpMul32 { 9929 break 9930 } 9931 _ = mul.Args[1] 9932 mul_0 := mul.Args[0] 9933 if mul_0.Op != OpRsh32Ux64 { 9934 break 9935 } 9936 _ = mul_0.Args[1] 9937 mul_0_0 := mul_0.Args[0] 9938 if mul_0_0.Op != OpZeroExt16to32 || x != mul_0_0.Args[0] { 9939 break 9940 } 9941 mul_0_1 := mul_0.Args[1] 9942 if mul_0_1.Op != OpConst64 || mul_0_1.AuxInt != 1 { 9943 break 9944 } 9945 mul_1 := mul.Args[1] 9946 if mul_1.Op != OpConst32 { 9947 break 9948 } 9949 m := mul_1.AuxInt 9950 v_1_0_0_1 := v_1_0_0.Args[1] 9951 if v_1_0_0_1.Op != OpConst64 { 9952 break 9953 } 9954 s := v_1_0_0_1.AuxInt 9955 v_1_1 := v_1.Args[1] 9956 if v_1_1.Op != OpConst16 { 9957 break 9958 } 9959 c := v_1_1.AuxInt 9960 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+(umagic(16, c).m+1)/2) && s == 16+umagic(16, c).s-2 && x.Op != OpConst16 && udivisibleOK(16, c)) { 9961 break 9962 } 9963 v.reset(OpLeq16U) 9964 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 9965 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 9966 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9967 v2.AuxInt = int64(int16(udivisible(16, c).m)) 9968 v1.AddArg(v2) 9969 v1.AddArg(x) 9970 v0.AddArg(v1) 9971 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9972 v3.AuxInt = int64(16 - udivisible(16, c).k) 9973 v0.AddArg(v3) 9974 v.AddArg(v0) 9975 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 9976 v4.AuxInt = int64(int16(udivisible(16, c).max)) 9977 v.AddArg(v4) 9978 return true 9979 } 9980 // match: (Eq16 (Mul16 (Const16 [c]) (Trunc32to16 (Rsh32Ux64 mul:(Mul32 (Const32 [m]) (Rsh32Ux64 (ZeroExt16to32 x) (Const64 [1]))) (Const64 [s])))) x) 9981 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+(umagic(16,c).m+1)/2) && s == 16+umagic(16,c).s-2 && x.Op != OpConst16 && udivisibleOK(16,c) 9982 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 9983 for { 9984 x := v.Args[1] 9985 v_0 := v.Args[0] 9986 if v_0.Op != OpMul16 { 9987 break 9988 } 9989 _ = v_0.Args[1] 9990 v_0_0 := v_0.Args[0] 9991 if v_0_0.Op != OpConst16 { 9992 break 9993 } 9994 c := v_0_0.AuxInt 9995 v_0_1 := v_0.Args[1] 9996 if v_0_1.Op != OpTrunc32to16 { 9997 break 9998 } 9999 v_0_1_0 := v_0_1.Args[0] 10000 if v_0_1_0.Op != OpRsh32Ux64 { 10001 break 10002 } 10003 _ = v_0_1_0.Args[1] 10004 mul := v_0_1_0.Args[0] 10005 if mul.Op != OpMul32 { 10006 break 10007 } 10008 _ = mul.Args[1] 10009 mul_0 := mul.Args[0] 10010 if mul_0.Op != OpConst32 { 10011 break 10012 } 10013 m := mul_0.AuxInt 10014 mul_1 := mul.Args[1] 10015 if mul_1.Op != OpRsh32Ux64 { 10016 break 10017 } 10018 _ = mul_1.Args[1] 10019 mul_1_0 := mul_1.Args[0] 10020 if mul_1_0.Op != OpZeroExt16to32 || x != mul_1_0.Args[0] { 10021 break 10022 } 10023 mul_1_1 := mul_1.Args[1] 10024 if mul_1_1.Op != OpConst64 || mul_1_1.AuxInt != 1 { 10025 break 10026 } 10027 v_0_1_0_1 := v_0_1_0.Args[1] 10028 if v_0_1_0_1.Op != OpConst64 { 10029 break 10030 } 10031 s := v_0_1_0_1.AuxInt 10032 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+(umagic(16, c).m+1)/2) && s == 16+umagic(16, c).s-2 && x.Op != OpConst16 && udivisibleOK(16, c)) { 10033 break 10034 } 10035 v.reset(OpLeq16U) 10036 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 10037 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 10038 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10039 v2.AuxInt = int64(int16(udivisible(16, c).m)) 10040 v1.AddArg(v2) 10041 v1.AddArg(x) 10042 v0.AddArg(v1) 10043 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10044 v3.AuxInt = int64(16 - udivisible(16, c).k) 10045 v0.AddArg(v3) 10046 v.AddArg(v0) 10047 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10048 v4.AuxInt = int64(int16(udivisible(16, c).max)) 10049 v.AddArg(v4) 10050 return true 10051 } 10052 // match: (Eq16 (Mul16 (Const16 [c]) (Trunc32to16 (Rsh32Ux64 mul:(Mul32 (Rsh32Ux64 (ZeroExt16to32 x) (Const64 [1])) (Const32 [m])) (Const64 [s])))) x) 10053 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+(umagic(16,c).m+1)/2) && s == 16+umagic(16,c).s-2 && x.Op != OpConst16 && udivisibleOK(16,c) 10054 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 10055 for { 10056 x := v.Args[1] 10057 v_0 := v.Args[0] 10058 if v_0.Op != OpMul16 { 10059 break 10060 } 10061 _ = v_0.Args[1] 10062 v_0_0 := v_0.Args[0] 10063 if v_0_0.Op != OpConst16 { 10064 break 10065 } 10066 c := v_0_0.AuxInt 10067 v_0_1 := v_0.Args[1] 10068 if v_0_1.Op != OpTrunc32to16 { 10069 break 10070 } 10071 v_0_1_0 := v_0_1.Args[0] 10072 if v_0_1_0.Op != OpRsh32Ux64 { 10073 break 10074 } 10075 _ = v_0_1_0.Args[1] 10076 mul := v_0_1_0.Args[0] 10077 if mul.Op != OpMul32 { 10078 break 10079 } 10080 _ = mul.Args[1] 10081 mul_0 := mul.Args[0] 10082 if mul_0.Op != OpRsh32Ux64 { 10083 break 10084 } 10085 _ = mul_0.Args[1] 10086 mul_0_0 := mul_0.Args[0] 10087 if mul_0_0.Op != OpZeroExt16to32 || x != mul_0_0.Args[0] { 10088 break 10089 } 10090 mul_0_1 := mul_0.Args[1] 10091 if mul_0_1.Op != OpConst64 || mul_0_1.AuxInt != 1 { 10092 break 10093 } 10094 mul_1 := mul.Args[1] 10095 if mul_1.Op != OpConst32 { 10096 break 10097 } 10098 m := mul_1.AuxInt 10099 v_0_1_0_1 := v_0_1_0.Args[1] 10100 if v_0_1_0_1.Op != OpConst64 { 10101 break 10102 } 10103 s := v_0_1_0_1.AuxInt 10104 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+(umagic(16, c).m+1)/2) && s == 16+umagic(16, c).s-2 && x.Op != OpConst16 && udivisibleOK(16, c)) { 10105 break 10106 } 10107 v.reset(OpLeq16U) 10108 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 10109 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 10110 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10111 v2.AuxInt = int64(int16(udivisible(16, c).m)) 10112 v1.AddArg(v2) 10113 v1.AddArg(x) 10114 v0.AddArg(v1) 10115 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10116 v3.AuxInt = int64(16 - udivisible(16, c).k) 10117 v0.AddArg(v3) 10118 v.AddArg(v0) 10119 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10120 v4.AuxInt = int64(int16(udivisible(16, c).max)) 10121 v.AddArg(v4) 10122 return true 10123 } 10124 // match: (Eq16 (Mul16 (Trunc32to16 (Rsh32Ux64 mul:(Mul32 (Const32 [m]) (Rsh32Ux64 (ZeroExt16to32 x) (Const64 [1]))) (Const64 [s]))) (Const16 [c])) x) 10125 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+(umagic(16,c).m+1)/2) && s == 16+umagic(16,c).s-2 && x.Op != OpConst16 && udivisibleOK(16,c) 10126 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 10127 for { 10128 x := v.Args[1] 10129 v_0 := v.Args[0] 10130 if v_0.Op != OpMul16 { 10131 break 10132 } 10133 _ = v_0.Args[1] 10134 v_0_0 := v_0.Args[0] 10135 if v_0_0.Op != OpTrunc32to16 { 10136 break 10137 } 10138 v_0_0_0 := v_0_0.Args[0] 10139 if v_0_0_0.Op != OpRsh32Ux64 { 10140 break 10141 } 10142 _ = v_0_0_0.Args[1] 10143 mul := v_0_0_0.Args[0] 10144 if mul.Op != OpMul32 { 10145 break 10146 } 10147 _ = mul.Args[1] 10148 mul_0 := mul.Args[0] 10149 if mul_0.Op != OpConst32 { 10150 break 10151 } 10152 m := mul_0.AuxInt 10153 mul_1 := mul.Args[1] 10154 if mul_1.Op != OpRsh32Ux64 { 10155 break 10156 } 10157 _ = mul_1.Args[1] 10158 mul_1_0 := mul_1.Args[0] 10159 if mul_1_0.Op != OpZeroExt16to32 || x != mul_1_0.Args[0] { 10160 break 10161 } 10162 mul_1_1 := mul_1.Args[1] 10163 if mul_1_1.Op != OpConst64 || mul_1_1.AuxInt != 1 { 10164 break 10165 } 10166 v_0_0_0_1 := v_0_0_0.Args[1] 10167 if v_0_0_0_1.Op != OpConst64 { 10168 break 10169 } 10170 s := v_0_0_0_1.AuxInt 10171 v_0_1 := v_0.Args[1] 10172 if v_0_1.Op != OpConst16 { 10173 break 10174 } 10175 c := v_0_1.AuxInt 10176 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+(umagic(16, c).m+1)/2) && s == 16+umagic(16, c).s-2 && x.Op != OpConst16 && udivisibleOK(16, c)) { 10177 break 10178 } 10179 v.reset(OpLeq16U) 10180 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 10181 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 10182 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10183 v2.AuxInt = int64(int16(udivisible(16, c).m)) 10184 v1.AddArg(v2) 10185 v1.AddArg(x) 10186 v0.AddArg(v1) 10187 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10188 v3.AuxInt = int64(16 - udivisible(16, c).k) 10189 v0.AddArg(v3) 10190 v.AddArg(v0) 10191 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10192 v4.AuxInt = int64(int16(udivisible(16, c).max)) 10193 v.AddArg(v4) 10194 return true 10195 } 10196 // match: (Eq16 (Mul16 (Trunc32to16 (Rsh32Ux64 mul:(Mul32 (Rsh32Ux64 (ZeroExt16to32 x) (Const64 [1])) (Const32 [m])) (Const64 [s]))) (Const16 [c])) x) 10197 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+(umagic(16,c).m+1)/2) && s == 16+umagic(16,c).s-2 && x.Op != OpConst16 && udivisibleOK(16,c) 10198 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 10199 for { 10200 x := v.Args[1] 10201 v_0 := v.Args[0] 10202 if v_0.Op != OpMul16 { 10203 break 10204 } 10205 _ = v_0.Args[1] 10206 v_0_0 := v_0.Args[0] 10207 if v_0_0.Op != OpTrunc32to16 { 10208 break 10209 } 10210 v_0_0_0 := v_0_0.Args[0] 10211 if v_0_0_0.Op != OpRsh32Ux64 { 10212 break 10213 } 10214 _ = v_0_0_0.Args[1] 10215 mul := v_0_0_0.Args[0] 10216 if mul.Op != OpMul32 { 10217 break 10218 } 10219 _ = mul.Args[1] 10220 mul_0 := mul.Args[0] 10221 if mul_0.Op != OpRsh32Ux64 { 10222 break 10223 } 10224 _ = mul_0.Args[1] 10225 mul_0_0 := mul_0.Args[0] 10226 if mul_0_0.Op != OpZeroExt16to32 || x != mul_0_0.Args[0] { 10227 break 10228 } 10229 mul_0_1 := mul_0.Args[1] 10230 if mul_0_1.Op != OpConst64 || mul_0_1.AuxInt != 1 { 10231 break 10232 } 10233 mul_1 := mul.Args[1] 10234 if mul_1.Op != OpConst32 { 10235 break 10236 } 10237 m := mul_1.AuxInt 10238 v_0_0_0_1 := v_0_0_0.Args[1] 10239 if v_0_0_0_1.Op != OpConst64 { 10240 break 10241 } 10242 s := v_0_0_0_1.AuxInt 10243 v_0_1 := v_0.Args[1] 10244 if v_0_1.Op != OpConst16 { 10245 break 10246 } 10247 c := v_0_1.AuxInt 10248 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<15+(umagic(16, c).m+1)/2) && s == 16+umagic(16, c).s-2 && x.Op != OpConst16 && udivisibleOK(16, c)) { 10249 break 10250 } 10251 v.reset(OpLeq16U) 10252 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 10253 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 10254 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10255 v2.AuxInt = int64(int16(udivisible(16, c).m)) 10256 v1.AddArg(v2) 10257 v1.AddArg(x) 10258 v0.AddArg(v1) 10259 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10260 v3.AuxInt = int64(16 - udivisible(16, c).k) 10261 v0.AddArg(v3) 10262 v.AddArg(v0) 10263 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10264 v4.AuxInt = int64(int16(udivisible(16, c).max)) 10265 v.AddArg(v4) 10266 return true 10267 } 10268 // match: (Eq16 x (Mul16 (Const16 [c]) (Trunc32to16 (Rsh32Ux64 (Avg32u (Lsh32x64 (ZeroExt16to32 x) (Const64 [16])) mul:(Mul32 (Const32 [m]) (ZeroExt16to32 x))) (Const64 [s]))))) 10269 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(16,c).m) && s == 16+umagic(16,c).s-1 && x.Op != OpConst16 && udivisibleOK(16,c) 10270 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 10271 for { 10272 _ = v.Args[1] 10273 x := v.Args[0] 10274 v_1 := v.Args[1] 10275 if v_1.Op != OpMul16 { 10276 break 10277 } 10278 _ = v_1.Args[1] 10279 v_1_0 := v_1.Args[0] 10280 if v_1_0.Op != OpConst16 { 10281 break 10282 } 10283 c := v_1_0.AuxInt 10284 v_1_1 := v_1.Args[1] 10285 if v_1_1.Op != OpTrunc32to16 { 10286 break 10287 } 10288 v_1_1_0 := v_1_1.Args[0] 10289 if v_1_1_0.Op != OpRsh32Ux64 { 10290 break 10291 } 10292 _ = v_1_1_0.Args[1] 10293 v_1_1_0_0 := v_1_1_0.Args[0] 10294 if v_1_1_0_0.Op != OpAvg32u { 10295 break 10296 } 10297 _ = v_1_1_0_0.Args[1] 10298 v_1_1_0_0_0 := v_1_1_0_0.Args[0] 10299 if v_1_1_0_0_0.Op != OpLsh32x64 { 10300 break 10301 } 10302 _ = v_1_1_0_0_0.Args[1] 10303 v_1_1_0_0_0_0 := v_1_1_0_0_0.Args[0] 10304 if v_1_1_0_0_0_0.Op != OpZeroExt16to32 || x != v_1_1_0_0_0_0.Args[0] { 10305 break 10306 } 10307 v_1_1_0_0_0_1 := v_1_1_0_0_0.Args[1] 10308 if v_1_1_0_0_0_1.Op != OpConst64 || v_1_1_0_0_0_1.AuxInt != 16 { 10309 break 10310 } 10311 mul := v_1_1_0_0.Args[1] 10312 if mul.Op != OpMul32 { 10313 break 10314 } 10315 _ = mul.Args[1] 10316 mul_0 := mul.Args[0] 10317 if mul_0.Op != OpConst32 { 10318 break 10319 } 10320 m := mul_0.AuxInt 10321 mul_1 := mul.Args[1] 10322 if mul_1.Op != OpZeroExt16to32 || x != mul_1.Args[0] { 10323 break 10324 } 10325 v_1_1_0_1 := v_1_1_0.Args[1] 10326 if v_1_1_0_1.Op != OpConst64 { 10327 break 10328 } 10329 s := v_1_1_0_1.AuxInt 10330 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(16, c).m) && s == 16+umagic(16, c).s-1 && x.Op != OpConst16 && udivisibleOK(16, c)) { 10331 break 10332 } 10333 v.reset(OpLeq16U) 10334 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 10335 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 10336 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10337 v2.AuxInt = int64(int16(udivisible(16, c).m)) 10338 v1.AddArg(v2) 10339 v1.AddArg(x) 10340 v0.AddArg(v1) 10341 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10342 v3.AuxInt = int64(16 - udivisible(16, c).k) 10343 v0.AddArg(v3) 10344 v.AddArg(v0) 10345 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10346 v4.AuxInt = int64(int16(udivisible(16, c).max)) 10347 v.AddArg(v4) 10348 return true 10349 } 10350 // match: (Eq16 x (Mul16 (Const16 [c]) (Trunc32to16 (Rsh32Ux64 (Avg32u (Lsh32x64 (ZeroExt16to32 x) (Const64 [16])) mul:(Mul32 (ZeroExt16to32 x) (Const32 [m]))) (Const64 [s]))))) 10351 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(16,c).m) && s == 16+umagic(16,c).s-1 && x.Op != OpConst16 && udivisibleOK(16,c) 10352 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 10353 for { 10354 _ = v.Args[1] 10355 x := v.Args[0] 10356 v_1 := v.Args[1] 10357 if v_1.Op != OpMul16 { 10358 break 10359 } 10360 _ = v_1.Args[1] 10361 v_1_0 := v_1.Args[0] 10362 if v_1_0.Op != OpConst16 { 10363 break 10364 } 10365 c := v_1_0.AuxInt 10366 v_1_1 := v_1.Args[1] 10367 if v_1_1.Op != OpTrunc32to16 { 10368 break 10369 } 10370 v_1_1_0 := v_1_1.Args[0] 10371 if v_1_1_0.Op != OpRsh32Ux64 { 10372 break 10373 } 10374 _ = v_1_1_0.Args[1] 10375 v_1_1_0_0 := v_1_1_0.Args[0] 10376 if v_1_1_0_0.Op != OpAvg32u { 10377 break 10378 } 10379 _ = v_1_1_0_0.Args[1] 10380 v_1_1_0_0_0 := v_1_1_0_0.Args[0] 10381 if v_1_1_0_0_0.Op != OpLsh32x64 { 10382 break 10383 } 10384 _ = v_1_1_0_0_0.Args[1] 10385 v_1_1_0_0_0_0 := v_1_1_0_0_0.Args[0] 10386 if v_1_1_0_0_0_0.Op != OpZeroExt16to32 || x != v_1_1_0_0_0_0.Args[0] { 10387 break 10388 } 10389 v_1_1_0_0_0_1 := v_1_1_0_0_0.Args[1] 10390 if v_1_1_0_0_0_1.Op != OpConst64 || v_1_1_0_0_0_1.AuxInt != 16 { 10391 break 10392 } 10393 mul := v_1_1_0_0.Args[1] 10394 if mul.Op != OpMul32 { 10395 break 10396 } 10397 _ = mul.Args[1] 10398 mul_0 := mul.Args[0] 10399 if mul_0.Op != OpZeroExt16to32 || x != mul_0.Args[0] { 10400 break 10401 } 10402 mul_1 := mul.Args[1] 10403 if mul_1.Op != OpConst32 { 10404 break 10405 } 10406 m := mul_1.AuxInt 10407 v_1_1_0_1 := v_1_1_0.Args[1] 10408 if v_1_1_0_1.Op != OpConst64 { 10409 break 10410 } 10411 s := v_1_1_0_1.AuxInt 10412 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(16, c).m) && s == 16+umagic(16, c).s-1 && x.Op != OpConst16 && udivisibleOK(16, c)) { 10413 break 10414 } 10415 v.reset(OpLeq16U) 10416 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 10417 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 10418 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10419 v2.AuxInt = int64(int16(udivisible(16, c).m)) 10420 v1.AddArg(v2) 10421 v1.AddArg(x) 10422 v0.AddArg(v1) 10423 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10424 v3.AuxInt = int64(16 - udivisible(16, c).k) 10425 v0.AddArg(v3) 10426 v.AddArg(v0) 10427 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10428 v4.AuxInt = int64(int16(udivisible(16, c).max)) 10429 v.AddArg(v4) 10430 return true 10431 } 10432 // match: (Eq16 x (Mul16 (Trunc32to16 (Rsh32Ux64 (Avg32u (Lsh32x64 (ZeroExt16to32 x) (Const64 [16])) mul:(Mul32 (Const32 [m]) (ZeroExt16to32 x))) (Const64 [s]))) (Const16 [c]))) 10433 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(16,c).m) && s == 16+umagic(16,c).s-1 && x.Op != OpConst16 && udivisibleOK(16,c) 10434 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 10435 for { 10436 _ = v.Args[1] 10437 x := v.Args[0] 10438 v_1 := v.Args[1] 10439 if v_1.Op != OpMul16 { 10440 break 10441 } 10442 _ = v_1.Args[1] 10443 v_1_0 := v_1.Args[0] 10444 if v_1_0.Op != OpTrunc32to16 { 10445 break 10446 } 10447 v_1_0_0 := v_1_0.Args[0] 10448 if v_1_0_0.Op != OpRsh32Ux64 { 10449 break 10450 } 10451 _ = v_1_0_0.Args[1] 10452 v_1_0_0_0 := v_1_0_0.Args[0] 10453 if v_1_0_0_0.Op != OpAvg32u { 10454 break 10455 } 10456 _ = v_1_0_0_0.Args[1] 10457 v_1_0_0_0_0 := v_1_0_0_0.Args[0] 10458 if v_1_0_0_0_0.Op != OpLsh32x64 { 10459 break 10460 } 10461 _ = v_1_0_0_0_0.Args[1] 10462 v_1_0_0_0_0_0 := v_1_0_0_0_0.Args[0] 10463 if v_1_0_0_0_0_0.Op != OpZeroExt16to32 || x != v_1_0_0_0_0_0.Args[0] { 10464 break 10465 } 10466 v_1_0_0_0_0_1 := v_1_0_0_0_0.Args[1] 10467 if v_1_0_0_0_0_1.Op != OpConst64 || v_1_0_0_0_0_1.AuxInt != 16 { 10468 break 10469 } 10470 mul := v_1_0_0_0.Args[1] 10471 if mul.Op != OpMul32 { 10472 break 10473 } 10474 _ = mul.Args[1] 10475 mul_0 := mul.Args[0] 10476 if mul_0.Op != OpConst32 { 10477 break 10478 } 10479 m := mul_0.AuxInt 10480 mul_1 := mul.Args[1] 10481 if mul_1.Op != OpZeroExt16to32 || x != mul_1.Args[0] { 10482 break 10483 } 10484 v_1_0_0_1 := v_1_0_0.Args[1] 10485 if v_1_0_0_1.Op != OpConst64 { 10486 break 10487 } 10488 s := v_1_0_0_1.AuxInt 10489 v_1_1 := v_1.Args[1] 10490 if v_1_1.Op != OpConst16 { 10491 break 10492 } 10493 c := v_1_1.AuxInt 10494 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(16, c).m) && s == 16+umagic(16, c).s-1 && x.Op != OpConst16 && udivisibleOK(16, c)) { 10495 break 10496 } 10497 v.reset(OpLeq16U) 10498 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 10499 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 10500 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10501 v2.AuxInt = int64(int16(udivisible(16, c).m)) 10502 v1.AddArg(v2) 10503 v1.AddArg(x) 10504 v0.AddArg(v1) 10505 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10506 v3.AuxInt = int64(16 - udivisible(16, c).k) 10507 v0.AddArg(v3) 10508 v.AddArg(v0) 10509 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10510 v4.AuxInt = int64(int16(udivisible(16, c).max)) 10511 v.AddArg(v4) 10512 return true 10513 } 10514 // match: (Eq16 x (Mul16 (Trunc32to16 (Rsh32Ux64 (Avg32u (Lsh32x64 (ZeroExt16to32 x) (Const64 [16])) mul:(Mul32 (ZeroExt16to32 x) (Const32 [m]))) (Const64 [s]))) (Const16 [c]))) 10515 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(16,c).m) && s == 16+umagic(16,c).s-1 && x.Op != OpConst16 && udivisibleOK(16,c) 10516 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 10517 for { 10518 _ = v.Args[1] 10519 x := v.Args[0] 10520 v_1 := v.Args[1] 10521 if v_1.Op != OpMul16 { 10522 break 10523 } 10524 _ = v_1.Args[1] 10525 v_1_0 := v_1.Args[0] 10526 if v_1_0.Op != OpTrunc32to16 { 10527 break 10528 } 10529 v_1_0_0 := v_1_0.Args[0] 10530 if v_1_0_0.Op != OpRsh32Ux64 { 10531 break 10532 } 10533 _ = v_1_0_0.Args[1] 10534 v_1_0_0_0 := v_1_0_0.Args[0] 10535 if v_1_0_0_0.Op != OpAvg32u { 10536 break 10537 } 10538 _ = v_1_0_0_0.Args[1] 10539 v_1_0_0_0_0 := v_1_0_0_0.Args[0] 10540 if v_1_0_0_0_0.Op != OpLsh32x64 { 10541 break 10542 } 10543 _ = v_1_0_0_0_0.Args[1] 10544 v_1_0_0_0_0_0 := v_1_0_0_0_0.Args[0] 10545 if v_1_0_0_0_0_0.Op != OpZeroExt16to32 || x != v_1_0_0_0_0_0.Args[0] { 10546 break 10547 } 10548 v_1_0_0_0_0_1 := v_1_0_0_0_0.Args[1] 10549 if v_1_0_0_0_0_1.Op != OpConst64 || v_1_0_0_0_0_1.AuxInt != 16 { 10550 break 10551 } 10552 mul := v_1_0_0_0.Args[1] 10553 if mul.Op != OpMul32 { 10554 break 10555 } 10556 _ = mul.Args[1] 10557 mul_0 := mul.Args[0] 10558 if mul_0.Op != OpZeroExt16to32 || x != mul_0.Args[0] { 10559 break 10560 } 10561 mul_1 := mul.Args[1] 10562 if mul_1.Op != OpConst32 { 10563 break 10564 } 10565 m := mul_1.AuxInt 10566 v_1_0_0_1 := v_1_0_0.Args[1] 10567 if v_1_0_0_1.Op != OpConst64 { 10568 break 10569 } 10570 s := v_1_0_0_1.AuxInt 10571 v_1_1 := v_1.Args[1] 10572 if v_1_1.Op != OpConst16 { 10573 break 10574 } 10575 c := v_1_1.AuxInt 10576 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(16, c).m) && s == 16+umagic(16, c).s-1 && x.Op != OpConst16 && udivisibleOK(16, c)) { 10577 break 10578 } 10579 v.reset(OpLeq16U) 10580 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 10581 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 10582 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10583 v2.AuxInt = int64(int16(udivisible(16, c).m)) 10584 v1.AddArg(v2) 10585 v1.AddArg(x) 10586 v0.AddArg(v1) 10587 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10588 v3.AuxInt = int64(16 - udivisible(16, c).k) 10589 v0.AddArg(v3) 10590 v.AddArg(v0) 10591 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10592 v4.AuxInt = int64(int16(udivisible(16, c).max)) 10593 v.AddArg(v4) 10594 return true 10595 } 10596 // match: (Eq16 (Mul16 (Const16 [c]) (Trunc32to16 (Rsh32Ux64 (Avg32u (Lsh32x64 (ZeroExt16to32 x) (Const64 [16])) mul:(Mul32 (Const32 [m]) (ZeroExt16to32 x))) (Const64 [s])))) x) 10597 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(16,c).m) && s == 16+umagic(16,c).s-1 && x.Op != OpConst16 && udivisibleOK(16,c) 10598 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 10599 for { 10600 x := v.Args[1] 10601 v_0 := v.Args[0] 10602 if v_0.Op != OpMul16 { 10603 break 10604 } 10605 _ = v_0.Args[1] 10606 v_0_0 := v_0.Args[0] 10607 if v_0_0.Op != OpConst16 { 10608 break 10609 } 10610 c := v_0_0.AuxInt 10611 v_0_1 := v_0.Args[1] 10612 if v_0_1.Op != OpTrunc32to16 { 10613 break 10614 } 10615 v_0_1_0 := v_0_1.Args[0] 10616 if v_0_1_0.Op != OpRsh32Ux64 { 10617 break 10618 } 10619 _ = v_0_1_0.Args[1] 10620 v_0_1_0_0 := v_0_1_0.Args[0] 10621 if v_0_1_0_0.Op != OpAvg32u { 10622 break 10623 } 10624 _ = v_0_1_0_0.Args[1] 10625 v_0_1_0_0_0 := v_0_1_0_0.Args[0] 10626 if v_0_1_0_0_0.Op != OpLsh32x64 { 10627 break 10628 } 10629 _ = v_0_1_0_0_0.Args[1] 10630 v_0_1_0_0_0_0 := v_0_1_0_0_0.Args[0] 10631 if v_0_1_0_0_0_0.Op != OpZeroExt16to32 || x != v_0_1_0_0_0_0.Args[0] { 10632 break 10633 } 10634 v_0_1_0_0_0_1 := v_0_1_0_0_0.Args[1] 10635 if v_0_1_0_0_0_1.Op != OpConst64 || v_0_1_0_0_0_1.AuxInt != 16 { 10636 break 10637 } 10638 mul := v_0_1_0_0.Args[1] 10639 if mul.Op != OpMul32 { 10640 break 10641 } 10642 _ = mul.Args[1] 10643 mul_0 := mul.Args[0] 10644 if mul_0.Op != OpConst32 { 10645 break 10646 } 10647 m := mul_0.AuxInt 10648 mul_1 := mul.Args[1] 10649 if mul_1.Op != OpZeroExt16to32 || x != mul_1.Args[0] { 10650 break 10651 } 10652 v_0_1_0_1 := v_0_1_0.Args[1] 10653 if v_0_1_0_1.Op != OpConst64 { 10654 break 10655 } 10656 s := v_0_1_0_1.AuxInt 10657 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(16, c).m) && s == 16+umagic(16, c).s-1 && x.Op != OpConst16 && udivisibleOK(16, c)) { 10658 break 10659 } 10660 v.reset(OpLeq16U) 10661 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 10662 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 10663 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10664 v2.AuxInt = int64(int16(udivisible(16, c).m)) 10665 v1.AddArg(v2) 10666 v1.AddArg(x) 10667 v0.AddArg(v1) 10668 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10669 v3.AuxInt = int64(16 - udivisible(16, c).k) 10670 v0.AddArg(v3) 10671 v.AddArg(v0) 10672 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10673 v4.AuxInt = int64(int16(udivisible(16, c).max)) 10674 v.AddArg(v4) 10675 return true 10676 } 10677 return false 10678 } 10679 func rewriteValuegeneric_OpEq16_40(v *Value) bool { 10680 b := v.Block 10681 typ := &b.Func.Config.Types 10682 // match: (Eq16 (Mul16 (Const16 [c]) (Trunc32to16 (Rsh32Ux64 (Avg32u (Lsh32x64 (ZeroExt16to32 x) (Const64 [16])) mul:(Mul32 (ZeroExt16to32 x) (Const32 [m]))) (Const64 [s])))) x) 10683 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(16,c).m) && s == 16+umagic(16,c).s-1 && x.Op != OpConst16 && udivisibleOK(16,c) 10684 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 10685 for { 10686 x := v.Args[1] 10687 v_0 := v.Args[0] 10688 if v_0.Op != OpMul16 { 10689 break 10690 } 10691 _ = v_0.Args[1] 10692 v_0_0 := v_0.Args[0] 10693 if v_0_0.Op != OpConst16 { 10694 break 10695 } 10696 c := v_0_0.AuxInt 10697 v_0_1 := v_0.Args[1] 10698 if v_0_1.Op != OpTrunc32to16 { 10699 break 10700 } 10701 v_0_1_0 := v_0_1.Args[0] 10702 if v_0_1_0.Op != OpRsh32Ux64 { 10703 break 10704 } 10705 _ = v_0_1_0.Args[1] 10706 v_0_1_0_0 := v_0_1_0.Args[0] 10707 if v_0_1_0_0.Op != OpAvg32u { 10708 break 10709 } 10710 _ = v_0_1_0_0.Args[1] 10711 v_0_1_0_0_0 := v_0_1_0_0.Args[0] 10712 if v_0_1_0_0_0.Op != OpLsh32x64 { 10713 break 10714 } 10715 _ = v_0_1_0_0_0.Args[1] 10716 v_0_1_0_0_0_0 := v_0_1_0_0_0.Args[0] 10717 if v_0_1_0_0_0_0.Op != OpZeroExt16to32 || x != v_0_1_0_0_0_0.Args[0] { 10718 break 10719 } 10720 v_0_1_0_0_0_1 := v_0_1_0_0_0.Args[1] 10721 if v_0_1_0_0_0_1.Op != OpConst64 || v_0_1_0_0_0_1.AuxInt != 16 { 10722 break 10723 } 10724 mul := v_0_1_0_0.Args[1] 10725 if mul.Op != OpMul32 { 10726 break 10727 } 10728 _ = mul.Args[1] 10729 mul_0 := mul.Args[0] 10730 if mul_0.Op != OpZeroExt16to32 || x != mul_0.Args[0] { 10731 break 10732 } 10733 mul_1 := mul.Args[1] 10734 if mul_1.Op != OpConst32 { 10735 break 10736 } 10737 m := mul_1.AuxInt 10738 v_0_1_0_1 := v_0_1_0.Args[1] 10739 if v_0_1_0_1.Op != OpConst64 { 10740 break 10741 } 10742 s := v_0_1_0_1.AuxInt 10743 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(16, c).m) && s == 16+umagic(16, c).s-1 && x.Op != OpConst16 && udivisibleOK(16, c)) { 10744 break 10745 } 10746 v.reset(OpLeq16U) 10747 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 10748 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 10749 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10750 v2.AuxInt = int64(int16(udivisible(16, c).m)) 10751 v1.AddArg(v2) 10752 v1.AddArg(x) 10753 v0.AddArg(v1) 10754 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10755 v3.AuxInt = int64(16 - udivisible(16, c).k) 10756 v0.AddArg(v3) 10757 v.AddArg(v0) 10758 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10759 v4.AuxInt = int64(int16(udivisible(16, c).max)) 10760 v.AddArg(v4) 10761 return true 10762 } 10763 // match: (Eq16 (Mul16 (Trunc32to16 (Rsh32Ux64 (Avg32u (Lsh32x64 (ZeroExt16to32 x) (Const64 [16])) mul:(Mul32 (Const32 [m]) (ZeroExt16to32 x))) (Const64 [s]))) (Const16 [c])) x) 10764 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(16,c).m) && s == 16+umagic(16,c).s-1 && x.Op != OpConst16 && udivisibleOK(16,c) 10765 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 10766 for { 10767 x := v.Args[1] 10768 v_0 := v.Args[0] 10769 if v_0.Op != OpMul16 { 10770 break 10771 } 10772 _ = v_0.Args[1] 10773 v_0_0 := v_0.Args[0] 10774 if v_0_0.Op != OpTrunc32to16 { 10775 break 10776 } 10777 v_0_0_0 := v_0_0.Args[0] 10778 if v_0_0_0.Op != OpRsh32Ux64 { 10779 break 10780 } 10781 _ = v_0_0_0.Args[1] 10782 v_0_0_0_0 := v_0_0_0.Args[0] 10783 if v_0_0_0_0.Op != OpAvg32u { 10784 break 10785 } 10786 _ = v_0_0_0_0.Args[1] 10787 v_0_0_0_0_0 := v_0_0_0_0.Args[0] 10788 if v_0_0_0_0_0.Op != OpLsh32x64 { 10789 break 10790 } 10791 _ = v_0_0_0_0_0.Args[1] 10792 v_0_0_0_0_0_0 := v_0_0_0_0_0.Args[0] 10793 if v_0_0_0_0_0_0.Op != OpZeroExt16to32 || x != v_0_0_0_0_0_0.Args[0] { 10794 break 10795 } 10796 v_0_0_0_0_0_1 := v_0_0_0_0_0.Args[1] 10797 if v_0_0_0_0_0_1.Op != OpConst64 || v_0_0_0_0_0_1.AuxInt != 16 { 10798 break 10799 } 10800 mul := v_0_0_0_0.Args[1] 10801 if mul.Op != OpMul32 { 10802 break 10803 } 10804 _ = mul.Args[1] 10805 mul_0 := mul.Args[0] 10806 if mul_0.Op != OpConst32 { 10807 break 10808 } 10809 m := mul_0.AuxInt 10810 mul_1 := mul.Args[1] 10811 if mul_1.Op != OpZeroExt16to32 || x != mul_1.Args[0] { 10812 break 10813 } 10814 v_0_0_0_1 := v_0_0_0.Args[1] 10815 if v_0_0_0_1.Op != OpConst64 { 10816 break 10817 } 10818 s := v_0_0_0_1.AuxInt 10819 v_0_1 := v_0.Args[1] 10820 if v_0_1.Op != OpConst16 { 10821 break 10822 } 10823 c := v_0_1.AuxInt 10824 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(16, c).m) && s == 16+umagic(16, c).s-1 && x.Op != OpConst16 && udivisibleOK(16, c)) { 10825 break 10826 } 10827 v.reset(OpLeq16U) 10828 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 10829 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 10830 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10831 v2.AuxInt = int64(int16(udivisible(16, c).m)) 10832 v1.AddArg(v2) 10833 v1.AddArg(x) 10834 v0.AddArg(v1) 10835 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10836 v3.AuxInt = int64(16 - udivisible(16, c).k) 10837 v0.AddArg(v3) 10838 v.AddArg(v0) 10839 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10840 v4.AuxInt = int64(int16(udivisible(16, c).max)) 10841 v.AddArg(v4) 10842 return true 10843 } 10844 // match: (Eq16 (Mul16 (Trunc32to16 (Rsh32Ux64 (Avg32u (Lsh32x64 (ZeroExt16to32 x) (Const64 [16])) mul:(Mul32 (ZeroExt16to32 x) (Const32 [m]))) (Const64 [s]))) (Const16 [c])) x) 10845 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(16,c).m) && s == 16+umagic(16,c).s-1 && x.Op != OpConst16 && udivisibleOK(16,c) 10846 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(16-udivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(udivisible(16,c).max))]) ) 10847 for { 10848 x := v.Args[1] 10849 v_0 := v.Args[0] 10850 if v_0.Op != OpMul16 { 10851 break 10852 } 10853 _ = v_0.Args[1] 10854 v_0_0 := v_0.Args[0] 10855 if v_0_0.Op != OpTrunc32to16 { 10856 break 10857 } 10858 v_0_0_0 := v_0_0.Args[0] 10859 if v_0_0_0.Op != OpRsh32Ux64 { 10860 break 10861 } 10862 _ = v_0_0_0.Args[1] 10863 v_0_0_0_0 := v_0_0_0.Args[0] 10864 if v_0_0_0_0.Op != OpAvg32u { 10865 break 10866 } 10867 _ = v_0_0_0_0.Args[1] 10868 v_0_0_0_0_0 := v_0_0_0_0.Args[0] 10869 if v_0_0_0_0_0.Op != OpLsh32x64 { 10870 break 10871 } 10872 _ = v_0_0_0_0_0.Args[1] 10873 v_0_0_0_0_0_0 := v_0_0_0_0_0.Args[0] 10874 if v_0_0_0_0_0_0.Op != OpZeroExt16to32 || x != v_0_0_0_0_0_0.Args[0] { 10875 break 10876 } 10877 v_0_0_0_0_0_1 := v_0_0_0_0_0.Args[1] 10878 if v_0_0_0_0_0_1.Op != OpConst64 || v_0_0_0_0_0_1.AuxInt != 16 { 10879 break 10880 } 10881 mul := v_0_0_0_0.Args[1] 10882 if mul.Op != OpMul32 { 10883 break 10884 } 10885 _ = mul.Args[1] 10886 mul_0 := mul.Args[0] 10887 if mul_0.Op != OpZeroExt16to32 || x != mul_0.Args[0] { 10888 break 10889 } 10890 mul_1 := mul.Args[1] 10891 if mul_1.Op != OpConst32 { 10892 break 10893 } 10894 m := mul_1.AuxInt 10895 v_0_0_0_1 := v_0_0_0.Args[1] 10896 if v_0_0_0_1.Op != OpConst64 { 10897 break 10898 } 10899 s := v_0_0_0_1.AuxInt 10900 v_0_1 := v_0.Args[1] 10901 if v_0_1.Op != OpConst16 { 10902 break 10903 } 10904 c := v_0_1.AuxInt 10905 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(16, c).m) && s == 16+umagic(16, c).s-1 && x.Op != OpConst16 && udivisibleOK(16, c)) { 10906 break 10907 } 10908 v.reset(OpLeq16U) 10909 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 10910 v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 10911 v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10912 v2.AuxInt = int64(int16(udivisible(16, c).m)) 10913 v1.AddArg(v2) 10914 v1.AddArg(x) 10915 v0.AddArg(v1) 10916 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10917 v3.AuxInt = int64(16 - udivisible(16, c).k) 10918 v0.AddArg(v3) 10919 v.AddArg(v0) 10920 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10921 v4.AuxInt = int64(int16(udivisible(16, c).max)) 10922 v.AddArg(v4) 10923 return true 10924 } 10925 // match: (Eq16 x (Mul16 (Const16 [c]) (Sub16 (Rsh32x64 mul:(Mul32 (Const32 [m]) (SignExt16to32 x)) (Const64 [s])) (Rsh32x64 (SignExt16to32 x) (Const64 [31]))))) 10926 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(16,c).m) && s == 16+smagic(16,c).s && x.Op != OpConst16 && sdivisibleOK(16,c) 10927 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Add16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).a))]) ) (Const16 <typ.UInt16> [int64(16-sdivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).max))]) ) 10928 for { 10929 _ = v.Args[1] 10930 x := v.Args[0] 10931 v_1 := v.Args[1] 10932 if v_1.Op != OpMul16 { 10933 break 10934 } 10935 _ = v_1.Args[1] 10936 v_1_0 := v_1.Args[0] 10937 if v_1_0.Op != OpConst16 { 10938 break 10939 } 10940 c := v_1_0.AuxInt 10941 v_1_1 := v_1.Args[1] 10942 if v_1_1.Op != OpSub16 { 10943 break 10944 } 10945 _ = v_1_1.Args[1] 10946 v_1_1_0 := v_1_1.Args[0] 10947 if v_1_1_0.Op != OpRsh32x64 { 10948 break 10949 } 10950 _ = v_1_1_0.Args[1] 10951 mul := v_1_1_0.Args[0] 10952 if mul.Op != OpMul32 { 10953 break 10954 } 10955 _ = mul.Args[1] 10956 mul_0 := mul.Args[0] 10957 if mul_0.Op != OpConst32 { 10958 break 10959 } 10960 m := mul_0.AuxInt 10961 mul_1 := mul.Args[1] 10962 if mul_1.Op != OpSignExt16to32 || x != mul_1.Args[0] { 10963 break 10964 } 10965 v_1_1_0_1 := v_1_1_0.Args[1] 10966 if v_1_1_0_1.Op != OpConst64 { 10967 break 10968 } 10969 s := v_1_1_0_1.AuxInt 10970 v_1_1_1 := v_1_1.Args[1] 10971 if v_1_1_1.Op != OpRsh32x64 { 10972 break 10973 } 10974 _ = v_1_1_1.Args[1] 10975 v_1_1_1_0 := v_1_1_1.Args[0] 10976 if v_1_1_1_0.Op != OpSignExt16to32 || x != v_1_1_1_0.Args[0] { 10977 break 10978 } 10979 v_1_1_1_1 := v_1_1_1.Args[1] 10980 if v_1_1_1_1.Op != OpConst64 || v_1_1_1_1.AuxInt != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(16, c).m) && s == 16+smagic(16, c).s && x.Op != OpConst16 && sdivisibleOK(16, c)) { 10981 break 10982 } 10983 v.reset(OpLeq16U) 10984 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 10985 v1 := b.NewValue0(v.Pos, OpAdd16, typ.UInt16) 10986 v2 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 10987 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10988 v3.AuxInt = int64(int16(sdivisible(16, c).m)) 10989 v2.AddArg(v3) 10990 v2.AddArg(x) 10991 v1.AddArg(v2) 10992 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10993 v4.AuxInt = int64(int16(sdivisible(16, c).a)) 10994 v1.AddArg(v4) 10995 v0.AddArg(v1) 10996 v5 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 10997 v5.AuxInt = int64(16 - sdivisible(16, c).k) 10998 v0.AddArg(v5) 10999 v.AddArg(v0) 11000 v6 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11001 v6.AuxInt = int64(int16(sdivisible(16, c).max)) 11002 v.AddArg(v6) 11003 return true 11004 } 11005 // match: (Eq16 x (Mul16 (Const16 [c]) (Sub16 (Rsh32x64 mul:(Mul32 (SignExt16to32 x) (Const32 [m])) (Const64 [s])) (Rsh32x64 (SignExt16to32 x) (Const64 [31]))))) 11006 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(16,c).m) && s == 16+smagic(16,c).s && x.Op != OpConst16 && sdivisibleOK(16,c) 11007 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Add16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).a))]) ) (Const16 <typ.UInt16> [int64(16-sdivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).max))]) ) 11008 for { 11009 _ = v.Args[1] 11010 x := v.Args[0] 11011 v_1 := v.Args[1] 11012 if v_1.Op != OpMul16 { 11013 break 11014 } 11015 _ = v_1.Args[1] 11016 v_1_0 := v_1.Args[0] 11017 if v_1_0.Op != OpConst16 { 11018 break 11019 } 11020 c := v_1_0.AuxInt 11021 v_1_1 := v_1.Args[1] 11022 if v_1_1.Op != OpSub16 { 11023 break 11024 } 11025 _ = v_1_1.Args[1] 11026 v_1_1_0 := v_1_1.Args[0] 11027 if v_1_1_0.Op != OpRsh32x64 { 11028 break 11029 } 11030 _ = v_1_1_0.Args[1] 11031 mul := v_1_1_0.Args[0] 11032 if mul.Op != OpMul32 { 11033 break 11034 } 11035 _ = mul.Args[1] 11036 mul_0 := mul.Args[0] 11037 if mul_0.Op != OpSignExt16to32 || x != mul_0.Args[0] { 11038 break 11039 } 11040 mul_1 := mul.Args[1] 11041 if mul_1.Op != OpConst32 { 11042 break 11043 } 11044 m := mul_1.AuxInt 11045 v_1_1_0_1 := v_1_1_0.Args[1] 11046 if v_1_1_0_1.Op != OpConst64 { 11047 break 11048 } 11049 s := v_1_1_0_1.AuxInt 11050 v_1_1_1 := v_1_1.Args[1] 11051 if v_1_1_1.Op != OpRsh32x64 { 11052 break 11053 } 11054 _ = v_1_1_1.Args[1] 11055 v_1_1_1_0 := v_1_1_1.Args[0] 11056 if v_1_1_1_0.Op != OpSignExt16to32 || x != v_1_1_1_0.Args[0] { 11057 break 11058 } 11059 v_1_1_1_1 := v_1_1_1.Args[1] 11060 if v_1_1_1_1.Op != OpConst64 || v_1_1_1_1.AuxInt != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(16, c).m) && s == 16+smagic(16, c).s && x.Op != OpConst16 && sdivisibleOK(16, c)) { 11061 break 11062 } 11063 v.reset(OpLeq16U) 11064 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 11065 v1 := b.NewValue0(v.Pos, OpAdd16, typ.UInt16) 11066 v2 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 11067 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11068 v3.AuxInt = int64(int16(sdivisible(16, c).m)) 11069 v2.AddArg(v3) 11070 v2.AddArg(x) 11071 v1.AddArg(v2) 11072 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11073 v4.AuxInt = int64(int16(sdivisible(16, c).a)) 11074 v1.AddArg(v4) 11075 v0.AddArg(v1) 11076 v5 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11077 v5.AuxInt = int64(16 - sdivisible(16, c).k) 11078 v0.AddArg(v5) 11079 v.AddArg(v0) 11080 v6 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11081 v6.AuxInt = int64(int16(sdivisible(16, c).max)) 11082 v.AddArg(v6) 11083 return true 11084 } 11085 // match: (Eq16 x (Mul16 (Sub16 (Rsh32x64 mul:(Mul32 (Const32 [m]) (SignExt16to32 x)) (Const64 [s])) (Rsh32x64 (SignExt16to32 x) (Const64 [31]))) (Const16 [c]))) 11086 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(16,c).m) && s == 16+smagic(16,c).s && x.Op != OpConst16 && sdivisibleOK(16,c) 11087 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Add16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).a))]) ) (Const16 <typ.UInt16> [int64(16-sdivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).max))]) ) 11088 for { 11089 _ = v.Args[1] 11090 x := v.Args[0] 11091 v_1 := v.Args[1] 11092 if v_1.Op != OpMul16 { 11093 break 11094 } 11095 _ = v_1.Args[1] 11096 v_1_0 := v_1.Args[0] 11097 if v_1_0.Op != OpSub16 { 11098 break 11099 } 11100 _ = v_1_0.Args[1] 11101 v_1_0_0 := v_1_0.Args[0] 11102 if v_1_0_0.Op != OpRsh32x64 { 11103 break 11104 } 11105 _ = v_1_0_0.Args[1] 11106 mul := v_1_0_0.Args[0] 11107 if mul.Op != OpMul32 { 11108 break 11109 } 11110 _ = mul.Args[1] 11111 mul_0 := mul.Args[0] 11112 if mul_0.Op != OpConst32 { 11113 break 11114 } 11115 m := mul_0.AuxInt 11116 mul_1 := mul.Args[1] 11117 if mul_1.Op != OpSignExt16to32 || x != mul_1.Args[0] { 11118 break 11119 } 11120 v_1_0_0_1 := v_1_0_0.Args[1] 11121 if v_1_0_0_1.Op != OpConst64 { 11122 break 11123 } 11124 s := v_1_0_0_1.AuxInt 11125 v_1_0_1 := v_1_0.Args[1] 11126 if v_1_0_1.Op != OpRsh32x64 { 11127 break 11128 } 11129 _ = v_1_0_1.Args[1] 11130 v_1_0_1_0 := v_1_0_1.Args[0] 11131 if v_1_0_1_0.Op != OpSignExt16to32 || x != v_1_0_1_0.Args[0] { 11132 break 11133 } 11134 v_1_0_1_1 := v_1_0_1.Args[1] 11135 if v_1_0_1_1.Op != OpConst64 || v_1_0_1_1.AuxInt != 31 { 11136 break 11137 } 11138 v_1_1 := v_1.Args[1] 11139 if v_1_1.Op != OpConst16 { 11140 break 11141 } 11142 c := v_1_1.AuxInt 11143 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(16, c).m) && s == 16+smagic(16, c).s && x.Op != OpConst16 && sdivisibleOK(16, c)) { 11144 break 11145 } 11146 v.reset(OpLeq16U) 11147 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 11148 v1 := b.NewValue0(v.Pos, OpAdd16, typ.UInt16) 11149 v2 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 11150 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11151 v3.AuxInt = int64(int16(sdivisible(16, c).m)) 11152 v2.AddArg(v3) 11153 v2.AddArg(x) 11154 v1.AddArg(v2) 11155 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11156 v4.AuxInt = int64(int16(sdivisible(16, c).a)) 11157 v1.AddArg(v4) 11158 v0.AddArg(v1) 11159 v5 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11160 v5.AuxInt = int64(16 - sdivisible(16, c).k) 11161 v0.AddArg(v5) 11162 v.AddArg(v0) 11163 v6 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11164 v6.AuxInt = int64(int16(sdivisible(16, c).max)) 11165 v.AddArg(v6) 11166 return true 11167 } 11168 // match: (Eq16 x (Mul16 (Sub16 (Rsh32x64 mul:(Mul32 (SignExt16to32 x) (Const32 [m])) (Const64 [s])) (Rsh32x64 (SignExt16to32 x) (Const64 [31]))) (Const16 [c]))) 11169 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(16,c).m) && s == 16+smagic(16,c).s && x.Op != OpConst16 && sdivisibleOK(16,c) 11170 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Add16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).a))]) ) (Const16 <typ.UInt16> [int64(16-sdivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).max))]) ) 11171 for { 11172 _ = v.Args[1] 11173 x := v.Args[0] 11174 v_1 := v.Args[1] 11175 if v_1.Op != OpMul16 { 11176 break 11177 } 11178 _ = v_1.Args[1] 11179 v_1_0 := v_1.Args[0] 11180 if v_1_0.Op != OpSub16 { 11181 break 11182 } 11183 _ = v_1_0.Args[1] 11184 v_1_0_0 := v_1_0.Args[0] 11185 if v_1_0_0.Op != OpRsh32x64 { 11186 break 11187 } 11188 _ = v_1_0_0.Args[1] 11189 mul := v_1_0_0.Args[0] 11190 if mul.Op != OpMul32 { 11191 break 11192 } 11193 _ = mul.Args[1] 11194 mul_0 := mul.Args[0] 11195 if mul_0.Op != OpSignExt16to32 || x != mul_0.Args[0] { 11196 break 11197 } 11198 mul_1 := mul.Args[1] 11199 if mul_1.Op != OpConst32 { 11200 break 11201 } 11202 m := mul_1.AuxInt 11203 v_1_0_0_1 := v_1_0_0.Args[1] 11204 if v_1_0_0_1.Op != OpConst64 { 11205 break 11206 } 11207 s := v_1_0_0_1.AuxInt 11208 v_1_0_1 := v_1_0.Args[1] 11209 if v_1_0_1.Op != OpRsh32x64 { 11210 break 11211 } 11212 _ = v_1_0_1.Args[1] 11213 v_1_0_1_0 := v_1_0_1.Args[0] 11214 if v_1_0_1_0.Op != OpSignExt16to32 || x != v_1_0_1_0.Args[0] { 11215 break 11216 } 11217 v_1_0_1_1 := v_1_0_1.Args[1] 11218 if v_1_0_1_1.Op != OpConst64 || v_1_0_1_1.AuxInt != 31 { 11219 break 11220 } 11221 v_1_1 := v_1.Args[1] 11222 if v_1_1.Op != OpConst16 { 11223 break 11224 } 11225 c := v_1_1.AuxInt 11226 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(16, c).m) && s == 16+smagic(16, c).s && x.Op != OpConst16 && sdivisibleOK(16, c)) { 11227 break 11228 } 11229 v.reset(OpLeq16U) 11230 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 11231 v1 := b.NewValue0(v.Pos, OpAdd16, typ.UInt16) 11232 v2 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 11233 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11234 v3.AuxInt = int64(int16(sdivisible(16, c).m)) 11235 v2.AddArg(v3) 11236 v2.AddArg(x) 11237 v1.AddArg(v2) 11238 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11239 v4.AuxInt = int64(int16(sdivisible(16, c).a)) 11240 v1.AddArg(v4) 11241 v0.AddArg(v1) 11242 v5 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11243 v5.AuxInt = int64(16 - sdivisible(16, c).k) 11244 v0.AddArg(v5) 11245 v.AddArg(v0) 11246 v6 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11247 v6.AuxInt = int64(int16(sdivisible(16, c).max)) 11248 v.AddArg(v6) 11249 return true 11250 } 11251 // match: (Eq16 (Mul16 (Const16 [c]) (Sub16 (Rsh32x64 mul:(Mul32 (Const32 [m]) (SignExt16to32 x)) (Const64 [s])) (Rsh32x64 (SignExt16to32 x) (Const64 [31])))) x) 11252 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(16,c).m) && s == 16+smagic(16,c).s && x.Op != OpConst16 && sdivisibleOK(16,c) 11253 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Add16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).a))]) ) (Const16 <typ.UInt16> [int64(16-sdivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).max))]) ) 11254 for { 11255 x := v.Args[1] 11256 v_0 := v.Args[0] 11257 if v_0.Op != OpMul16 { 11258 break 11259 } 11260 _ = v_0.Args[1] 11261 v_0_0 := v_0.Args[0] 11262 if v_0_0.Op != OpConst16 { 11263 break 11264 } 11265 c := v_0_0.AuxInt 11266 v_0_1 := v_0.Args[1] 11267 if v_0_1.Op != OpSub16 { 11268 break 11269 } 11270 _ = v_0_1.Args[1] 11271 v_0_1_0 := v_0_1.Args[0] 11272 if v_0_1_0.Op != OpRsh32x64 { 11273 break 11274 } 11275 _ = v_0_1_0.Args[1] 11276 mul := v_0_1_0.Args[0] 11277 if mul.Op != OpMul32 { 11278 break 11279 } 11280 _ = mul.Args[1] 11281 mul_0 := mul.Args[0] 11282 if mul_0.Op != OpConst32 { 11283 break 11284 } 11285 m := mul_0.AuxInt 11286 mul_1 := mul.Args[1] 11287 if mul_1.Op != OpSignExt16to32 || x != mul_1.Args[0] { 11288 break 11289 } 11290 v_0_1_0_1 := v_0_1_0.Args[1] 11291 if v_0_1_0_1.Op != OpConst64 { 11292 break 11293 } 11294 s := v_0_1_0_1.AuxInt 11295 v_0_1_1 := v_0_1.Args[1] 11296 if v_0_1_1.Op != OpRsh32x64 { 11297 break 11298 } 11299 _ = v_0_1_1.Args[1] 11300 v_0_1_1_0 := v_0_1_1.Args[0] 11301 if v_0_1_1_0.Op != OpSignExt16to32 || x != v_0_1_1_0.Args[0] { 11302 break 11303 } 11304 v_0_1_1_1 := v_0_1_1.Args[1] 11305 if v_0_1_1_1.Op != OpConst64 || v_0_1_1_1.AuxInt != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(16, c).m) && s == 16+smagic(16, c).s && x.Op != OpConst16 && sdivisibleOK(16, c)) { 11306 break 11307 } 11308 v.reset(OpLeq16U) 11309 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 11310 v1 := b.NewValue0(v.Pos, OpAdd16, typ.UInt16) 11311 v2 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 11312 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11313 v3.AuxInt = int64(int16(sdivisible(16, c).m)) 11314 v2.AddArg(v3) 11315 v2.AddArg(x) 11316 v1.AddArg(v2) 11317 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11318 v4.AuxInt = int64(int16(sdivisible(16, c).a)) 11319 v1.AddArg(v4) 11320 v0.AddArg(v1) 11321 v5 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11322 v5.AuxInt = int64(16 - sdivisible(16, c).k) 11323 v0.AddArg(v5) 11324 v.AddArg(v0) 11325 v6 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11326 v6.AuxInt = int64(int16(sdivisible(16, c).max)) 11327 v.AddArg(v6) 11328 return true 11329 } 11330 // match: (Eq16 (Mul16 (Const16 [c]) (Sub16 (Rsh32x64 mul:(Mul32 (SignExt16to32 x) (Const32 [m])) (Const64 [s])) (Rsh32x64 (SignExt16to32 x) (Const64 [31])))) x) 11331 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(16,c).m) && s == 16+smagic(16,c).s && x.Op != OpConst16 && sdivisibleOK(16,c) 11332 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Add16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).a))]) ) (Const16 <typ.UInt16> [int64(16-sdivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).max))]) ) 11333 for { 11334 x := v.Args[1] 11335 v_0 := v.Args[0] 11336 if v_0.Op != OpMul16 { 11337 break 11338 } 11339 _ = v_0.Args[1] 11340 v_0_0 := v_0.Args[0] 11341 if v_0_0.Op != OpConst16 { 11342 break 11343 } 11344 c := v_0_0.AuxInt 11345 v_0_1 := v_0.Args[1] 11346 if v_0_1.Op != OpSub16 { 11347 break 11348 } 11349 _ = v_0_1.Args[1] 11350 v_0_1_0 := v_0_1.Args[0] 11351 if v_0_1_0.Op != OpRsh32x64 { 11352 break 11353 } 11354 _ = v_0_1_0.Args[1] 11355 mul := v_0_1_0.Args[0] 11356 if mul.Op != OpMul32 { 11357 break 11358 } 11359 _ = mul.Args[1] 11360 mul_0 := mul.Args[0] 11361 if mul_0.Op != OpSignExt16to32 || x != mul_0.Args[0] { 11362 break 11363 } 11364 mul_1 := mul.Args[1] 11365 if mul_1.Op != OpConst32 { 11366 break 11367 } 11368 m := mul_1.AuxInt 11369 v_0_1_0_1 := v_0_1_0.Args[1] 11370 if v_0_1_0_1.Op != OpConst64 { 11371 break 11372 } 11373 s := v_0_1_0_1.AuxInt 11374 v_0_1_1 := v_0_1.Args[1] 11375 if v_0_1_1.Op != OpRsh32x64 { 11376 break 11377 } 11378 _ = v_0_1_1.Args[1] 11379 v_0_1_1_0 := v_0_1_1.Args[0] 11380 if v_0_1_1_0.Op != OpSignExt16to32 || x != v_0_1_1_0.Args[0] { 11381 break 11382 } 11383 v_0_1_1_1 := v_0_1_1.Args[1] 11384 if v_0_1_1_1.Op != OpConst64 || v_0_1_1_1.AuxInt != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(16, c).m) && s == 16+smagic(16, c).s && x.Op != OpConst16 && sdivisibleOK(16, c)) { 11385 break 11386 } 11387 v.reset(OpLeq16U) 11388 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 11389 v1 := b.NewValue0(v.Pos, OpAdd16, typ.UInt16) 11390 v2 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 11391 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11392 v3.AuxInt = int64(int16(sdivisible(16, c).m)) 11393 v2.AddArg(v3) 11394 v2.AddArg(x) 11395 v1.AddArg(v2) 11396 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11397 v4.AuxInt = int64(int16(sdivisible(16, c).a)) 11398 v1.AddArg(v4) 11399 v0.AddArg(v1) 11400 v5 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11401 v5.AuxInt = int64(16 - sdivisible(16, c).k) 11402 v0.AddArg(v5) 11403 v.AddArg(v0) 11404 v6 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11405 v6.AuxInt = int64(int16(sdivisible(16, c).max)) 11406 v.AddArg(v6) 11407 return true 11408 } 11409 // match: (Eq16 (Mul16 (Sub16 (Rsh32x64 mul:(Mul32 (Const32 [m]) (SignExt16to32 x)) (Const64 [s])) (Rsh32x64 (SignExt16to32 x) (Const64 [31]))) (Const16 [c])) x) 11410 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(16,c).m) && s == 16+smagic(16,c).s && x.Op != OpConst16 && sdivisibleOK(16,c) 11411 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Add16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).a))]) ) (Const16 <typ.UInt16> [int64(16-sdivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).max))]) ) 11412 for { 11413 x := v.Args[1] 11414 v_0 := v.Args[0] 11415 if v_0.Op != OpMul16 { 11416 break 11417 } 11418 _ = v_0.Args[1] 11419 v_0_0 := v_0.Args[0] 11420 if v_0_0.Op != OpSub16 { 11421 break 11422 } 11423 _ = v_0_0.Args[1] 11424 v_0_0_0 := v_0_0.Args[0] 11425 if v_0_0_0.Op != OpRsh32x64 { 11426 break 11427 } 11428 _ = v_0_0_0.Args[1] 11429 mul := v_0_0_0.Args[0] 11430 if mul.Op != OpMul32 { 11431 break 11432 } 11433 _ = mul.Args[1] 11434 mul_0 := mul.Args[0] 11435 if mul_0.Op != OpConst32 { 11436 break 11437 } 11438 m := mul_0.AuxInt 11439 mul_1 := mul.Args[1] 11440 if mul_1.Op != OpSignExt16to32 || x != mul_1.Args[0] { 11441 break 11442 } 11443 v_0_0_0_1 := v_0_0_0.Args[1] 11444 if v_0_0_0_1.Op != OpConst64 { 11445 break 11446 } 11447 s := v_0_0_0_1.AuxInt 11448 v_0_0_1 := v_0_0.Args[1] 11449 if v_0_0_1.Op != OpRsh32x64 { 11450 break 11451 } 11452 _ = v_0_0_1.Args[1] 11453 v_0_0_1_0 := v_0_0_1.Args[0] 11454 if v_0_0_1_0.Op != OpSignExt16to32 || x != v_0_0_1_0.Args[0] { 11455 break 11456 } 11457 v_0_0_1_1 := v_0_0_1.Args[1] 11458 if v_0_0_1_1.Op != OpConst64 || v_0_0_1_1.AuxInt != 31 { 11459 break 11460 } 11461 v_0_1 := v_0.Args[1] 11462 if v_0_1.Op != OpConst16 { 11463 break 11464 } 11465 c := v_0_1.AuxInt 11466 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(16, c).m) && s == 16+smagic(16, c).s && x.Op != OpConst16 && sdivisibleOK(16, c)) { 11467 break 11468 } 11469 v.reset(OpLeq16U) 11470 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 11471 v1 := b.NewValue0(v.Pos, OpAdd16, typ.UInt16) 11472 v2 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 11473 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11474 v3.AuxInt = int64(int16(sdivisible(16, c).m)) 11475 v2.AddArg(v3) 11476 v2.AddArg(x) 11477 v1.AddArg(v2) 11478 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11479 v4.AuxInt = int64(int16(sdivisible(16, c).a)) 11480 v1.AddArg(v4) 11481 v0.AddArg(v1) 11482 v5 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11483 v5.AuxInt = int64(16 - sdivisible(16, c).k) 11484 v0.AddArg(v5) 11485 v.AddArg(v0) 11486 v6 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11487 v6.AuxInt = int64(int16(sdivisible(16, c).max)) 11488 v.AddArg(v6) 11489 return true 11490 } 11491 return false 11492 } 11493 func rewriteValuegeneric_OpEq16_50(v *Value) bool { 11494 b := v.Block 11495 typ := &b.Func.Config.Types 11496 // match: (Eq16 (Mul16 (Sub16 (Rsh32x64 mul:(Mul32 (SignExt16to32 x) (Const32 [m])) (Const64 [s])) (Rsh32x64 (SignExt16to32 x) (Const64 [31]))) (Const16 [c])) x) 11497 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(16,c).m) && s == 16+smagic(16,c).s && x.Op != OpConst16 && sdivisibleOK(16,c) 11498 // result: (Leq16U (RotateLeft16 <typ.UInt16> (Add16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).m))]) x) (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).a))]) ) (Const16 <typ.UInt16> [int64(16-sdivisible(16,c).k)]) ) (Const16 <typ.UInt16> [int64(int16(sdivisible(16,c).max))]) ) 11499 for { 11500 x := v.Args[1] 11501 v_0 := v.Args[0] 11502 if v_0.Op != OpMul16 { 11503 break 11504 } 11505 _ = v_0.Args[1] 11506 v_0_0 := v_0.Args[0] 11507 if v_0_0.Op != OpSub16 { 11508 break 11509 } 11510 _ = v_0_0.Args[1] 11511 v_0_0_0 := v_0_0.Args[0] 11512 if v_0_0_0.Op != OpRsh32x64 { 11513 break 11514 } 11515 _ = v_0_0_0.Args[1] 11516 mul := v_0_0_0.Args[0] 11517 if mul.Op != OpMul32 { 11518 break 11519 } 11520 _ = mul.Args[1] 11521 mul_0 := mul.Args[0] 11522 if mul_0.Op != OpSignExt16to32 || x != mul_0.Args[0] { 11523 break 11524 } 11525 mul_1 := mul.Args[1] 11526 if mul_1.Op != OpConst32 { 11527 break 11528 } 11529 m := mul_1.AuxInt 11530 v_0_0_0_1 := v_0_0_0.Args[1] 11531 if v_0_0_0_1.Op != OpConst64 { 11532 break 11533 } 11534 s := v_0_0_0_1.AuxInt 11535 v_0_0_1 := v_0_0.Args[1] 11536 if v_0_0_1.Op != OpRsh32x64 { 11537 break 11538 } 11539 _ = v_0_0_1.Args[1] 11540 v_0_0_1_0 := v_0_0_1.Args[0] 11541 if v_0_0_1_0.Op != OpSignExt16to32 || x != v_0_0_1_0.Args[0] { 11542 break 11543 } 11544 v_0_0_1_1 := v_0_0_1.Args[1] 11545 if v_0_0_1_1.Op != OpConst64 || v_0_0_1_1.AuxInt != 31 { 11546 break 11547 } 11548 v_0_1 := v_0.Args[1] 11549 if v_0_1.Op != OpConst16 { 11550 break 11551 } 11552 c := v_0_1.AuxInt 11553 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(16, c).m) && s == 16+smagic(16, c).s && x.Op != OpConst16 && sdivisibleOK(16, c)) { 11554 break 11555 } 11556 v.reset(OpLeq16U) 11557 v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16) 11558 v1 := b.NewValue0(v.Pos, OpAdd16, typ.UInt16) 11559 v2 := b.NewValue0(v.Pos, OpMul16, typ.UInt16) 11560 v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11561 v3.AuxInt = int64(int16(sdivisible(16, c).m)) 11562 v2.AddArg(v3) 11563 v2.AddArg(x) 11564 v1.AddArg(v2) 11565 v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11566 v4.AuxInt = int64(int16(sdivisible(16, c).a)) 11567 v1.AddArg(v4) 11568 v0.AddArg(v1) 11569 v5 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11570 v5.AuxInt = int64(16 - sdivisible(16, c).k) 11571 v0.AddArg(v5) 11572 v.AddArg(v0) 11573 v6 := b.NewValue0(v.Pos, OpConst16, typ.UInt16) 11574 v6.AuxInt = int64(int16(sdivisible(16, c).max)) 11575 v.AddArg(v6) 11576 return true 11577 } 11578 // match: (Eq16 n (Lsh16x64 (Rsh16x64 (Add16 <t> n (Rsh16Ux64 <t> (Rsh16x64 <t> n (Const64 <typ.UInt64> [15])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k]))) 11579 // cond: k > 0 && k < 15 && kbar == 16 - k 11580 // result: (Eq16 (And16 <t> n (Const16 <t> [int64(1<<uint(k)-1)])) (Const16 <t> [0])) 11581 for { 11582 _ = v.Args[1] 11583 n := v.Args[0] 11584 v_1 := v.Args[1] 11585 if v_1.Op != OpLsh16x64 { 11586 break 11587 } 11588 _ = v_1.Args[1] 11589 v_1_0 := v_1.Args[0] 11590 if v_1_0.Op != OpRsh16x64 { 11591 break 11592 } 11593 _ = v_1_0.Args[1] 11594 v_1_0_0 := v_1_0.Args[0] 11595 if v_1_0_0.Op != OpAdd16 { 11596 break 11597 } 11598 t := v_1_0_0.Type 11599 _ = v_1_0_0.Args[1] 11600 if n != v_1_0_0.Args[0] { 11601 break 11602 } 11603 v_1_0_0_1 := v_1_0_0.Args[1] 11604 if v_1_0_0_1.Op != OpRsh16Ux64 || v_1_0_0_1.Type != t { 11605 break 11606 } 11607 _ = v_1_0_0_1.Args[1] 11608 v_1_0_0_1_0 := v_1_0_0_1.Args[0] 11609 if v_1_0_0_1_0.Op != OpRsh16x64 || v_1_0_0_1_0.Type != t { 11610 break 11611 } 11612 _ = v_1_0_0_1_0.Args[1] 11613 if n != v_1_0_0_1_0.Args[0] { 11614 break 11615 } 11616 v_1_0_0_1_0_1 := v_1_0_0_1_0.Args[1] 11617 if v_1_0_0_1_0_1.Op != OpConst64 || v_1_0_0_1_0_1.Type != typ.UInt64 || v_1_0_0_1_0_1.AuxInt != 15 { 11618 break 11619 } 11620 v_1_0_0_1_1 := v_1_0_0_1.Args[1] 11621 if v_1_0_0_1_1.Op != OpConst64 || v_1_0_0_1_1.Type != typ.UInt64 { 11622 break 11623 } 11624 kbar := v_1_0_0_1_1.AuxInt 11625 v_1_0_1 := v_1_0.Args[1] 11626 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 { 11627 break 11628 } 11629 k := v_1_0_1.AuxInt 11630 v_1_1 := v_1.Args[1] 11631 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || v_1_1.AuxInt != k || !(k > 0 && k < 15 && kbar == 16-k) { 11632 break 11633 } 11634 v.reset(OpEq16) 11635 v0 := b.NewValue0(v.Pos, OpAnd16, t) 11636 v0.AddArg(n) 11637 v1 := b.NewValue0(v.Pos, OpConst16, t) 11638 v1.AuxInt = int64(1<<uint(k) - 1) 11639 v0.AddArg(v1) 11640 v.AddArg(v0) 11641 v2 := b.NewValue0(v.Pos, OpConst16, t) 11642 v2.AuxInt = 0 11643 v.AddArg(v2) 11644 return true 11645 } 11646 // match: (Eq16 n (Lsh16x64 (Rsh16x64 (Add16 <t> (Rsh16Ux64 <t> (Rsh16x64 <t> n (Const64 <typ.UInt64> [15])) (Const64 <typ.UInt64> [kbar])) n) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k]))) 11647 // cond: k > 0 && k < 15 && kbar == 16 - k 11648 // result: (Eq16 (And16 <t> n (Const16 <t> [int64(1<<uint(k)-1)])) (Const16 <t> [0])) 11649 for { 11650 _ = v.Args[1] 11651 n := v.Args[0] 11652 v_1 := v.Args[1] 11653 if v_1.Op != OpLsh16x64 { 11654 break 11655 } 11656 _ = v_1.Args[1] 11657 v_1_0 := v_1.Args[0] 11658 if v_1_0.Op != OpRsh16x64 { 11659 break 11660 } 11661 _ = v_1_0.Args[1] 11662 v_1_0_0 := v_1_0.Args[0] 11663 if v_1_0_0.Op != OpAdd16 { 11664 break 11665 } 11666 t := v_1_0_0.Type 11667 _ = v_1_0_0.Args[1] 11668 v_1_0_0_0 := v_1_0_0.Args[0] 11669 if v_1_0_0_0.Op != OpRsh16Ux64 || v_1_0_0_0.Type != t { 11670 break 11671 } 11672 _ = v_1_0_0_0.Args[1] 11673 v_1_0_0_0_0 := v_1_0_0_0.Args[0] 11674 if v_1_0_0_0_0.Op != OpRsh16x64 || v_1_0_0_0_0.Type != t { 11675 break 11676 } 11677 _ = v_1_0_0_0_0.Args[1] 11678 if n != v_1_0_0_0_0.Args[0] { 11679 break 11680 } 11681 v_1_0_0_0_0_1 := v_1_0_0_0_0.Args[1] 11682 if v_1_0_0_0_0_1.Op != OpConst64 || v_1_0_0_0_0_1.Type != typ.UInt64 || v_1_0_0_0_0_1.AuxInt != 15 { 11683 break 11684 } 11685 v_1_0_0_0_1 := v_1_0_0_0.Args[1] 11686 if v_1_0_0_0_1.Op != OpConst64 || v_1_0_0_0_1.Type != typ.UInt64 { 11687 break 11688 } 11689 kbar := v_1_0_0_0_1.AuxInt 11690 if n != v_1_0_0.Args[1] { 11691 break 11692 } 11693 v_1_0_1 := v_1_0.Args[1] 11694 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 { 11695 break 11696 } 11697 k := v_1_0_1.AuxInt 11698 v_1_1 := v_1.Args[1] 11699 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || v_1_1.AuxInt != k || !(k > 0 && k < 15 && kbar == 16-k) { 11700 break 11701 } 11702 v.reset(OpEq16) 11703 v0 := b.NewValue0(v.Pos, OpAnd16, t) 11704 v0.AddArg(n) 11705 v1 := b.NewValue0(v.Pos, OpConst16, t) 11706 v1.AuxInt = int64(1<<uint(k) - 1) 11707 v0.AddArg(v1) 11708 v.AddArg(v0) 11709 v2 := b.NewValue0(v.Pos, OpConst16, t) 11710 v2.AuxInt = 0 11711 v.AddArg(v2) 11712 return true 11713 } 11714 // match: (Eq16 (Lsh16x64 (Rsh16x64 (Add16 <t> n (Rsh16Ux64 <t> (Rsh16x64 <t> n (Const64 <typ.UInt64> [15])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) n) 11715 // cond: k > 0 && k < 15 && kbar == 16 - k 11716 // result: (Eq16 (And16 <t> n (Const16 <t> [int64(1<<uint(k)-1)])) (Const16 <t> [0])) 11717 for { 11718 n := v.Args[1] 11719 v_0 := v.Args[0] 11720 if v_0.Op != OpLsh16x64 { 11721 break 11722 } 11723 _ = v_0.Args[1] 11724 v_0_0 := v_0.Args[0] 11725 if v_0_0.Op != OpRsh16x64 { 11726 break 11727 } 11728 _ = v_0_0.Args[1] 11729 v_0_0_0 := v_0_0.Args[0] 11730 if v_0_0_0.Op != OpAdd16 { 11731 break 11732 } 11733 t := v_0_0_0.Type 11734 _ = v_0_0_0.Args[1] 11735 if n != v_0_0_0.Args[0] { 11736 break 11737 } 11738 v_0_0_0_1 := v_0_0_0.Args[1] 11739 if v_0_0_0_1.Op != OpRsh16Ux64 || v_0_0_0_1.Type != t { 11740 break 11741 } 11742 _ = v_0_0_0_1.Args[1] 11743 v_0_0_0_1_0 := v_0_0_0_1.Args[0] 11744 if v_0_0_0_1_0.Op != OpRsh16x64 || v_0_0_0_1_0.Type != t { 11745 break 11746 } 11747 _ = v_0_0_0_1_0.Args[1] 11748 if n != v_0_0_0_1_0.Args[0] { 11749 break 11750 } 11751 v_0_0_0_1_0_1 := v_0_0_0_1_0.Args[1] 11752 if v_0_0_0_1_0_1.Op != OpConst64 || v_0_0_0_1_0_1.Type != typ.UInt64 || v_0_0_0_1_0_1.AuxInt != 15 { 11753 break 11754 } 11755 v_0_0_0_1_1 := v_0_0_0_1.Args[1] 11756 if v_0_0_0_1_1.Op != OpConst64 || v_0_0_0_1_1.Type != typ.UInt64 { 11757 break 11758 } 11759 kbar := v_0_0_0_1_1.AuxInt 11760 v_0_0_1 := v_0_0.Args[1] 11761 if v_0_0_1.Op != OpConst64 || v_0_0_1.Type != typ.UInt64 { 11762 break 11763 } 11764 k := v_0_0_1.AuxInt 11765 v_0_1 := v_0.Args[1] 11766 if v_0_1.Op != OpConst64 || v_0_1.Type != typ.UInt64 || v_0_1.AuxInt != k || !(k > 0 && k < 15 && kbar == 16-k) { 11767 break 11768 } 11769 v.reset(OpEq16) 11770 v0 := b.NewValue0(v.Pos, OpAnd16, t) 11771 v0.AddArg(n) 11772 v1 := b.NewValue0(v.Pos, OpConst16, t) 11773 v1.AuxInt = int64(1<<uint(k) - 1) 11774 v0.AddArg(v1) 11775 v.AddArg(v0) 11776 v2 := b.NewValue0(v.Pos, OpConst16, t) 11777 v2.AuxInt = 0 11778 v.AddArg(v2) 11779 return true 11780 } 11781 // match: (Eq16 (Lsh16x64 (Rsh16x64 (Add16 <t> (Rsh16Ux64 <t> (Rsh16x64 <t> n (Const64 <typ.UInt64> [15])) (Const64 <typ.UInt64> [kbar])) n) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) n) 11782 // cond: k > 0 && k < 15 && kbar == 16 - k 11783 // result: (Eq16 (And16 <t> n (Const16 <t> [int64(1<<uint(k)-1)])) (Const16 <t> [0])) 11784 for { 11785 n := v.Args[1] 11786 v_0 := v.Args[0] 11787 if v_0.Op != OpLsh16x64 { 11788 break 11789 } 11790 _ = v_0.Args[1] 11791 v_0_0 := v_0.Args[0] 11792 if v_0_0.Op != OpRsh16x64 { 11793 break 11794 } 11795 _ = v_0_0.Args[1] 11796 v_0_0_0 := v_0_0.Args[0] 11797 if v_0_0_0.Op != OpAdd16 { 11798 break 11799 } 11800 t := v_0_0_0.Type 11801 _ = v_0_0_0.Args[1] 11802 v_0_0_0_0 := v_0_0_0.Args[0] 11803 if v_0_0_0_0.Op != OpRsh16Ux64 || v_0_0_0_0.Type != t { 11804 break 11805 } 11806 _ = v_0_0_0_0.Args[1] 11807 v_0_0_0_0_0 := v_0_0_0_0.Args[0] 11808 if v_0_0_0_0_0.Op != OpRsh16x64 || v_0_0_0_0_0.Type != t { 11809 break 11810 } 11811 _ = v_0_0_0_0_0.Args[1] 11812 if n != v_0_0_0_0_0.Args[0] { 11813 break 11814 } 11815 v_0_0_0_0_0_1 := v_0_0_0_0_0.Args[1] 11816 if v_0_0_0_0_0_1.Op != OpConst64 || v_0_0_0_0_0_1.Type != typ.UInt64 || v_0_0_0_0_0_1.AuxInt != 15 { 11817 break 11818 } 11819 v_0_0_0_0_1 := v_0_0_0_0.Args[1] 11820 if v_0_0_0_0_1.Op != OpConst64 || v_0_0_0_0_1.Type != typ.UInt64 { 11821 break 11822 } 11823 kbar := v_0_0_0_0_1.AuxInt 11824 if n != v_0_0_0.Args[1] { 11825 break 11826 } 11827 v_0_0_1 := v_0_0.Args[1] 11828 if v_0_0_1.Op != OpConst64 || v_0_0_1.Type != typ.UInt64 { 11829 break 11830 } 11831 k := v_0_0_1.AuxInt 11832 v_0_1 := v_0.Args[1] 11833 if v_0_1.Op != OpConst64 || v_0_1.Type != typ.UInt64 || v_0_1.AuxInt != k || !(k > 0 && k < 15 && kbar == 16-k) { 11834 break 11835 } 11836 v.reset(OpEq16) 11837 v0 := b.NewValue0(v.Pos, OpAnd16, t) 11838 v0.AddArg(n) 11839 v1 := b.NewValue0(v.Pos, OpConst16, t) 11840 v1.AuxInt = int64(1<<uint(k) - 1) 11841 v0.AddArg(v1) 11842 v.AddArg(v0) 11843 v2 := b.NewValue0(v.Pos, OpConst16, t) 11844 v2.AuxInt = 0 11845 v.AddArg(v2) 11846 return true 11847 } 11848 // match: (Eq16 s:(Sub16 x y) (Const16 [0])) 11849 // cond: s.Uses == 1 11850 // result: (Eq16 x y) 11851 for { 11852 _ = v.Args[1] 11853 s := v.Args[0] 11854 if s.Op != OpSub16 { 11855 break 11856 } 11857 y := s.Args[1] 11858 x := s.Args[0] 11859 v_1 := v.Args[1] 11860 if v_1.Op != OpConst16 || v_1.AuxInt != 0 || !(s.Uses == 1) { 11861 break 11862 } 11863 v.reset(OpEq16) 11864 v.AddArg(x) 11865 v.AddArg(y) 11866 return true 11867 } 11868 // match: (Eq16 (Const16 [0]) s:(Sub16 x y)) 11869 // cond: s.Uses == 1 11870 // result: (Eq16 x y) 11871 for { 11872 _ = v.Args[1] 11873 v_0 := v.Args[0] 11874 if v_0.Op != OpConst16 || v_0.AuxInt != 0 { 11875 break 11876 } 11877 s := v.Args[1] 11878 if s.Op != OpSub16 { 11879 break 11880 } 11881 y := s.Args[1] 11882 x := s.Args[0] 11883 if !(s.Uses == 1) { 11884 break 11885 } 11886 v.reset(OpEq16) 11887 v.AddArg(x) 11888 v.AddArg(y) 11889 return true 11890 } 11891 // match: (Eq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [y])) 11892 // cond: isPowerOfTwo(y) 11893 // result: (Neq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [0])) 11894 for { 11895 _ = v.Args[1] 11896 v_0 := v.Args[0] 11897 if v_0.Op != OpAnd16 { 11898 break 11899 } 11900 t := v_0.Type 11901 _ = v_0.Args[1] 11902 x := v_0.Args[0] 11903 v_0_1 := v_0.Args[1] 11904 if v_0_1.Op != OpConst16 || v_0_1.Type != t { 11905 break 11906 } 11907 y := v_0_1.AuxInt 11908 v_1 := v.Args[1] 11909 if v_1.Op != OpConst16 || v_1.Type != t || v_1.AuxInt != y || !(isPowerOfTwo(y)) { 11910 break 11911 } 11912 v.reset(OpNeq16) 11913 v0 := b.NewValue0(v.Pos, OpAnd16, t) 11914 v0.AddArg(x) 11915 v1 := b.NewValue0(v.Pos, OpConst16, t) 11916 v1.AuxInt = y 11917 v0.AddArg(v1) 11918 v.AddArg(v0) 11919 v2 := b.NewValue0(v.Pos, OpConst16, t) 11920 v2.AuxInt = 0 11921 v.AddArg(v2) 11922 return true 11923 } 11924 // match: (Eq16 (And16 <t> (Const16 <t> [y]) x) (Const16 <t> [y])) 11925 // cond: isPowerOfTwo(y) 11926 // result: (Neq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [0])) 11927 for { 11928 _ = v.Args[1] 11929 v_0 := v.Args[0] 11930 if v_0.Op != OpAnd16 { 11931 break 11932 } 11933 t := v_0.Type 11934 x := v_0.Args[1] 11935 v_0_0 := v_0.Args[0] 11936 if v_0_0.Op != OpConst16 || v_0_0.Type != t { 11937 break 11938 } 11939 y := v_0_0.AuxInt 11940 v_1 := v.Args[1] 11941 if v_1.Op != OpConst16 || v_1.Type != t || v_1.AuxInt != y || !(isPowerOfTwo(y)) { 11942 break 11943 } 11944 v.reset(OpNeq16) 11945 v0 := b.NewValue0(v.Pos, OpAnd16, t) 11946 v0.AddArg(x) 11947 v1 := b.NewValue0(v.Pos, OpConst16, t) 11948 v1.AuxInt = y 11949 v0.AddArg(v1) 11950 v.AddArg(v0) 11951 v2 := b.NewValue0(v.Pos, OpConst16, t) 11952 v2.AuxInt = 0 11953 v.AddArg(v2) 11954 return true 11955 } 11956 // match: (Eq16 (Const16 <t> [y]) (And16 <t> x (Const16 <t> [y]))) 11957 // cond: isPowerOfTwo(y) 11958 // result: (Neq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [0])) 11959 for { 11960 _ = v.Args[1] 11961 v_0 := v.Args[0] 11962 if v_0.Op != OpConst16 { 11963 break 11964 } 11965 t := v_0.Type 11966 y := v_0.AuxInt 11967 v_1 := v.Args[1] 11968 if v_1.Op != OpAnd16 || v_1.Type != t { 11969 break 11970 } 11971 _ = v_1.Args[1] 11972 x := v_1.Args[0] 11973 v_1_1 := v_1.Args[1] 11974 if v_1_1.Op != OpConst16 || v_1_1.Type != t || v_1_1.AuxInt != y || !(isPowerOfTwo(y)) { 11975 break 11976 } 11977 v.reset(OpNeq16) 11978 v0 := b.NewValue0(v.Pos, OpAnd16, t) 11979 v0.AddArg(x) 11980 v1 := b.NewValue0(v.Pos, OpConst16, t) 11981 v1.AuxInt = y 11982 v0.AddArg(v1) 11983 v.AddArg(v0) 11984 v2 := b.NewValue0(v.Pos, OpConst16, t) 11985 v2.AuxInt = 0 11986 v.AddArg(v2) 11987 return true 11988 } 11989 return false 11990 } 11991 func rewriteValuegeneric_OpEq16_60(v *Value) bool { 11992 b := v.Block 11993 // match: (Eq16 (Const16 <t> [y]) (And16 <t> (Const16 <t> [y]) x)) 11994 // cond: isPowerOfTwo(y) 11995 // result: (Neq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [0])) 11996 for { 11997 _ = v.Args[1] 11998 v_0 := v.Args[0] 11999 if v_0.Op != OpConst16 { 12000 break 12001 } 12002 t := v_0.Type 12003 y := v_0.AuxInt 12004 v_1 := v.Args[1] 12005 if v_1.Op != OpAnd16 || v_1.Type != t { 12006 break 12007 } 12008 x := v_1.Args[1] 12009 v_1_0 := v_1.Args[0] 12010 if v_1_0.Op != OpConst16 || v_1_0.Type != t || v_1_0.AuxInt != y || !(isPowerOfTwo(y)) { 12011 break 12012 } 12013 v.reset(OpNeq16) 12014 v0 := b.NewValue0(v.Pos, OpAnd16, t) 12015 v0.AddArg(x) 12016 v1 := b.NewValue0(v.Pos, OpConst16, t) 12017 v1.AuxInt = y 12018 v0.AddArg(v1) 12019 v.AddArg(v0) 12020 v2 := b.NewValue0(v.Pos, OpConst16, t) 12021 v2.AuxInt = 0 12022 v.AddArg(v2) 12023 return true 12024 } 12025 return false 12026 } 12027 func rewriteValuegeneric_OpEq32_0(v *Value) bool { 12028 b := v.Block 12029 typ := &b.Func.Config.Types 12030 // match: (Eq32 x x) 12031 // result: (ConstBool [1]) 12032 for { 12033 x := v.Args[1] 12034 if x != v.Args[0] { 12035 break 12036 } 12037 v.reset(OpConstBool) 12038 v.AuxInt = 1 12039 return true 12040 } 12041 // match: (Eq32 (Const32 <t> [c]) (Add32 (Const32 <t> [d]) x)) 12042 // result: (Eq32 (Const32 <t> [int64(int32(c-d))]) x) 12043 for { 12044 _ = v.Args[1] 12045 v_0 := v.Args[0] 12046 if v_0.Op != OpConst32 { 12047 break 12048 } 12049 t := v_0.Type 12050 c := v_0.AuxInt 12051 v_1 := v.Args[1] 12052 if v_1.Op != OpAdd32 { 12053 break 12054 } 12055 x := v_1.Args[1] 12056 v_1_0 := v_1.Args[0] 12057 if v_1_0.Op != OpConst32 || v_1_0.Type != t { 12058 break 12059 } 12060 d := v_1_0.AuxInt 12061 v.reset(OpEq32) 12062 v0 := b.NewValue0(v.Pos, OpConst32, t) 12063 v0.AuxInt = int64(int32(c - d)) 12064 v.AddArg(v0) 12065 v.AddArg(x) 12066 return true 12067 } 12068 // match: (Eq32 (Const32 <t> [c]) (Add32 x (Const32 <t> [d]))) 12069 // result: (Eq32 (Const32 <t> [int64(int32(c-d))]) x) 12070 for { 12071 _ = v.Args[1] 12072 v_0 := v.Args[0] 12073 if v_0.Op != OpConst32 { 12074 break 12075 } 12076 t := v_0.Type 12077 c := v_0.AuxInt 12078 v_1 := v.Args[1] 12079 if v_1.Op != OpAdd32 { 12080 break 12081 } 12082 _ = v_1.Args[1] 12083 x := v_1.Args[0] 12084 v_1_1 := v_1.Args[1] 12085 if v_1_1.Op != OpConst32 || v_1_1.Type != t { 12086 break 12087 } 12088 d := v_1_1.AuxInt 12089 v.reset(OpEq32) 12090 v0 := b.NewValue0(v.Pos, OpConst32, t) 12091 v0.AuxInt = int64(int32(c - d)) 12092 v.AddArg(v0) 12093 v.AddArg(x) 12094 return true 12095 } 12096 // match: (Eq32 (Add32 (Const32 <t> [d]) x) (Const32 <t> [c])) 12097 // result: (Eq32 (Const32 <t> [int64(int32(c-d))]) x) 12098 for { 12099 _ = v.Args[1] 12100 v_0 := v.Args[0] 12101 if v_0.Op != OpAdd32 { 12102 break 12103 } 12104 x := v_0.Args[1] 12105 v_0_0 := v_0.Args[0] 12106 if v_0_0.Op != OpConst32 { 12107 break 12108 } 12109 t := v_0_0.Type 12110 d := v_0_0.AuxInt 12111 v_1 := v.Args[1] 12112 if v_1.Op != OpConst32 || v_1.Type != t { 12113 break 12114 } 12115 c := v_1.AuxInt 12116 v.reset(OpEq32) 12117 v0 := b.NewValue0(v.Pos, OpConst32, t) 12118 v0.AuxInt = int64(int32(c - d)) 12119 v.AddArg(v0) 12120 v.AddArg(x) 12121 return true 12122 } 12123 // match: (Eq32 (Add32 x (Const32 <t> [d])) (Const32 <t> [c])) 12124 // result: (Eq32 (Const32 <t> [int64(int32(c-d))]) x) 12125 for { 12126 _ = v.Args[1] 12127 v_0 := v.Args[0] 12128 if v_0.Op != OpAdd32 { 12129 break 12130 } 12131 _ = v_0.Args[1] 12132 x := v_0.Args[0] 12133 v_0_1 := v_0.Args[1] 12134 if v_0_1.Op != OpConst32 { 12135 break 12136 } 12137 t := v_0_1.Type 12138 d := v_0_1.AuxInt 12139 v_1 := v.Args[1] 12140 if v_1.Op != OpConst32 || v_1.Type != t { 12141 break 12142 } 12143 c := v_1.AuxInt 12144 v.reset(OpEq32) 12145 v0 := b.NewValue0(v.Pos, OpConst32, t) 12146 v0.AuxInt = int64(int32(c - d)) 12147 v.AddArg(v0) 12148 v.AddArg(x) 12149 return true 12150 } 12151 // match: (Eq32 (Const32 [c]) (Const32 [d])) 12152 // result: (ConstBool [b2i(c == d)]) 12153 for { 12154 _ = v.Args[1] 12155 v_0 := v.Args[0] 12156 if v_0.Op != OpConst32 { 12157 break 12158 } 12159 c := v_0.AuxInt 12160 v_1 := v.Args[1] 12161 if v_1.Op != OpConst32 { 12162 break 12163 } 12164 d := v_1.AuxInt 12165 v.reset(OpConstBool) 12166 v.AuxInt = b2i(c == d) 12167 return true 12168 } 12169 // match: (Eq32 (Const32 [d]) (Const32 [c])) 12170 // result: (ConstBool [b2i(c == d)]) 12171 for { 12172 _ = v.Args[1] 12173 v_0 := v.Args[0] 12174 if v_0.Op != OpConst32 { 12175 break 12176 } 12177 d := v_0.AuxInt 12178 v_1 := v.Args[1] 12179 if v_1.Op != OpConst32 { 12180 break 12181 } 12182 c := v_1.AuxInt 12183 v.reset(OpConstBool) 12184 v.AuxInt = b2i(c == d) 12185 return true 12186 } 12187 // match: (Eq32 x (Mul32 (Const32 [c]) (Rsh32Ux64 mul:(Hmul32u (Const32 [m]) x) (Const64 [s])))) 12188 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+umagic(32,c).m/2)) && s == umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 12189 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 12190 for { 12191 _ = v.Args[1] 12192 x := v.Args[0] 12193 v_1 := v.Args[1] 12194 if v_1.Op != OpMul32 { 12195 break 12196 } 12197 _ = v_1.Args[1] 12198 v_1_0 := v_1.Args[0] 12199 if v_1_0.Op != OpConst32 { 12200 break 12201 } 12202 c := v_1_0.AuxInt 12203 v_1_1 := v_1.Args[1] 12204 if v_1_1.Op != OpRsh32Ux64 { 12205 break 12206 } 12207 _ = v_1_1.Args[1] 12208 mul := v_1_1.Args[0] 12209 if mul.Op != OpHmul32u { 12210 break 12211 } 12212 _ = mul.Args[1] 12213 mul_0 := mul.Args[0] 12214 if mul_0.Op != OpConst32 { 12215 break 12216 } 12217 m := mul_0.AuxInt 12218 if x != mul.Args[1] { 12219 break 12220 } 12221 v_1_1_1 := v_1_1.Args[1] 12222 if v_1_1_1.Op != OpConst64 { 12223 break 12224 } 12225 s := v_1_1_1.AuxInt 12226 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+umagic(32, c).m/2)) && s == umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 12227 break 12228 } 12229 v.reset(OpLeq32U) 12230 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 12231 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 12232 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12233 v2.AuxInt = int64(int32(udivisible(32, c).m)) 12234 v1.AddArg(v2) 12235 v1.AddArg(x) 12236 v0.AddArg(v1) 12237 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12238 v3.AuxInt = int64(32 - udivisible(32, c).k) 12239 v0.AddArg(v3) 12240 v.AddArg(v0) 12241 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12242 v4.AuxInt = int64(int32(udivisible(32, c).max)) 12243 v.AddArg(v4) 12244 return true 12245 } 12246 // match: (Eq32 x (Mul32 (Const32 [c]) (Rsh32Ux64 mul:(Hmul32u x (Const32 [m])) (Const64 [s])))) 12247 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+umagic(32,c).m/2)) && s == umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 12248 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 12249 for { 12250 _ = v.Args[1] 12251 x := v.Args[0] 12252 v_1 := v.Args[1] 12253 if v_1.Op != OpMul32 { 12254 break 12255 } 12256 _ = v_1.Args[1] 12257 v_1_0 := v_1.Args[0] 12258 if v_1_0.Op != OpConst32 { 12259 break 12260 } 12261 c := v_1_0.AuxInt 12262 v_1_1 := v_1.Args[1] 12263 if v_1_1.Op != OpRsh32Ux64 { 12264 break 12265 } 12266 _ = v_1_1.Args[1] 12267 mul := v_1_1.Args[0] 12268 if mul.Op != OpHmul32u { 12269 break 12270 } 12271 _ = mul.Args[1] 12272 if x != mul.Args[0] { 12273 break 12274 } 12275 mul_1 := mul.Args[1] 12276 if mul_1.Op != OpConst32 { 12277 break 12278 } 12279 m := mul_1.AuxInt 12280 v_1_1_1 := v_1_1.Args[1] 12281 if v_1_1_1.Op != OpConst64 { 12282 break 12283 } 12284 s := v_1_1_1.AuxInt 12285 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+umagic(32, c).m/2)) && s == umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 12286 break 12287 } 12288 v.reset(OpLeq32U) 12289 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 12290 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 12291 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12292 v2.AuxInt = int64(int32(udivisible(32, c).m)) 12293 v1.AddArg(v2) 12294 v1.AddArg(x) 12295 v0.AddArg(v1) 12296 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12297 v3.AuxInt = int64(32 - udivisible(32, c).k) 12298 v0.AddArg(v3) 12299 v.AddArg(v0) 12300 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12301 v4.AuxInt = int64(int32(udivisible(32, c).max)) 12302 v.AddArg(v4) 12303 return true 12304 } 12305 // match: (Eq32 x (Mul32 (Rsh32Ux64 mul:(Hmul32u (Const32 [m]) x) (Const64 [s])) (Const32 [c]))) 12306 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+umagic(32,c).m/2)) && s == umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 12307 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 12308 for { 12309 _ = v.Args[1] 12310 x := v.Args[0] 12311 v_1 := v.Args[1] 12312 if v_1.Op != OpMul32 { 12313 break 12314 } 12315 _ = v_1.Args[1] 12316 v_1_0 := v_1.Args[0] 12317 if v_1_0.Op != OpRsh32Ux64 { 12318 break 12319 } 12320 _ = v_1_0.Args[1] 12321 mul := v_1_0.Args[0] 12322 if mul.Op != OpHmul32u { 12323 break 12324 } 12325 _ = mul.Args[1] 12326 mul_0 := mul.Args[0] 12327 if mul_0.Op != OpConst32 { 12328 break 12329 } 12330 m := mul_0.AuxInt 12331 if x != mul.Args[1] { 12332 break 12333 } 12334 v_1_0_1 := v_1_0.Args[1] 12335 if v_1_0_1.Op != OpConst64 { 12336 break 12337 } 12338 s := v_1_0_1.AuxInt 12339 v_1_1 := v_1.Args[1] 12340 if v_1_1.Op != OpConst32 { 12341 break 12342 } 12343 c := v_1_1.AuxInt 12344 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+umagic(32, c).m/2)) && s == umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 12345 break 12346 } 12347 v.reset(OpLeq32U) 12348 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 12349 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 12350 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12351 v2.AuxInt = int64(int32(udivisible(32, c).m)) 12352 v1.AddArg(v2) 12353 v1.AddArg(x) 12354 v0.AddArg(v1) 12355 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12356 v3.AuxInt = int64(32 - udivisible(32, c).k) 12357 v0.AddArg(v3) 12358 v.AddArg(v0) 12359 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12360 v4.AuxInt = int64(int32(udivisible(32, c).max)) 12361 v.AddArg(v4) 12362 return true 12363 } 12364 return false 12365 } 12366 func rewriteValuegeneric_OpEq32_10(v *Value) bool { 12367 b := v.Block 12368 typ := &b.Func.Config.Types 12369 // match: (Eq32 x (Mul32 (Rsh32Ux64 mul:(Hmul32u x (Const32 [m])) (Const64 [s])) (Const32 [c]))) 12370 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+umagic(32,c).m/2)) && s == umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 12371 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 12372 for { 12373 _ = v.Args[1] 12374 x := v.Args[0] 12375 v_1 := v.Args[1] 12376 if v_1.Op != OpMul32 { 12377 break 12378 } 12379 _ = v_1.Args[1] 12380 v_1_0 := v_1.Args[0] 12381 if v_1_0.Op != OpRsh32Ux64 { 12382 break 12383 } 12384 _ = v_1_0.Args[1] 12385 mul := v_1_0.Args[0] 12386 if mul.Op != OpHmul32u { 12387 break 12388 } 12389 _ = mul.Args[1] 12390 if x != mul.Args[0] { 12391 break 12392 } 12393 mul_1 := mul.Args[1] 12394 if mul_1.Op != OpConst32 { 12395 break 12396 } 12397 m := mul_1.AuxInt 12398 v_1_0_1 := v_1_0.Args[1] 12399 if v_1_0_1.Op != OpConst64 { 12400 break 12401 } 12402 s := v_1_0_1.AuxInt 12403 v_1_1 := v_1.Args[1] 12404 if v_1_1.Op != OpConst32 { 12405 break 12406 } 12407 c := v_1_1.AuxInt 12408 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+umagic(32, c).m/2)) && s == umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 12409 break 12410 } 12411 v.reset(OpLeq32U) 12412 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 12413 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 12414 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12415 v2.AuxInt = int64(int32(udivisible(32, c).m)) 12416 v1.AddArg(v2) 12417 v1.AddArg(x) 12418 v0.AddArg(v1) 12419 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12420 v3.AuxInt = int64(32 - udivisible(32, c).k) 12421 v0.AddArg(v3) 12422 v.AddArg(v0) 12423 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12424 v4.AuxInt = int64(int32(udivisible(32, c).max)) 12425 v.AddArg(v4) 12426 return true 12427 } 12428 // match: (Eq32 (Mul32 (Const32 [c]) (Rsh32Ux64 mul:(Hmul32u (Const32 [m]) x) (Const64 [s]))) x) 12429 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+umagic(32,c).m/2)) && s == umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 12430 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 12431 for { 12432 x := v.Args[1] 12433 v_0 := v.Args[0] 12434 if v_0.Op != OpMul32 { 12435 break 12436 } 12437 _ = v_0.Args[1] 12438 v_0_0 := v_0.Args[0] 12439 if v_0_0.Op != OpConst32 { 12440 break 12441 } 12442 c := v_0_0.AuxInt 12443 v_0_1 := v_0.Args[1] 12444 if v_0_1.Op != OpRsh32Ux64 { 12445 break 12446 } 12447 _ = v_0_1.Args[1] 12448 mul := v_0_1.Args[0] 12449 if mul.Op != OpHmul32u { 12450 break 12451 } 12452 _ = mul.Args[1] 12453 mul_0 := mul.Args[0] 12454 if mul_0.Op != OpConst32 { 12455 break 12456 } 12457 m := mul_0.AuxInt 12458 if x != mul.Args[1] { 12459 break 12460 } 12461 v_0_1_1 := v_0_1.Args[1] 12462 if v_0_1_1.Op != OpConst64 { 12463 break 12464 } 12465 s := v_0_1_1.AuxInt 12466 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+umagic(32, c).m/2)) && s == umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 12467 break 12468 } 12469 v.reset(OpLeq32U) 12470 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 12471 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 12472 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12473 v2.AuxInt = int64(int32(udivisible(32, c).m)) 12474 v1.AddArg(v2) 12475 v1.AddArg(x) 12476 v0.AddArg(v1) 12477 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12478 v3.AuxInt = int64(32 - udivisible(32, c).k) 12479 v0.AddArg(v3) 12480 v.AddArg(v0) 12481 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12482 v4.AuxInt = int64(int32(udivisible(32, c).max)) 12483 v.AddArg(v4) 12484 return true 12485 } 12486 // match: (Eq32 (Mul32 (Const32 [c]) (Rsh32Ux64 mul:(Hmul32u x (Const32 [m])) (Const64 [s]))) x) 12487 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+umagic(32,c).m/2)) && s == umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 12488 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 12489 for { 12490 x := v.Args[1] 12491 v_0 := v.Args[0] 12492 if v_0.Op != OpMul32 { 12493 break 12494 } 12495 _ = v_0.Args[1] 12496 v_0_0 := v_0.Args[0] 12497 if v_0_0.Op != OpConst32 { 12498 break 12499 } 12500 c := v_0_0.AuxInt 12501 v_0_1 := v_0.Args[1] 12502 if v_0_1.Op != OpRsh32Ux64 { 12503 break 12504 } 12505 _ = v_0_1.Args[1] 12506 mul := v_0_1.Args[0] 12507 if mul.Op != OpHmul32u { 12508 break 12509 } 12510 _ = mul.Args[1] 12511 if x != mul.Args[0] { 12512 break 12513 } 12514 mul_1 := mul.Args[1] 12515 if mul_1.Op != OpConst32 { 12516 break 12517 } 12518 m := mul_1.AuxInt 12519 v_0_1_1 := v_0_1.Args[1] 12520 if v_0_1_1.Op != OpConst64 { 12521 break 12522 } 12523 s := v_0_1_1.AuxInt 12524 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+umagic(32, c).m/2)) && s == umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 12525 break 12526 } 12527 v.reset(OpLeq32U) 12528 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 12529 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 12530 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12531 v2.AuxInt = int64(int32(udivisible(32, c).m)) 12532 v1.AddArg(v2) 12533 v1.AddArg(x) 12534 v0.AddArg(v1) 12535 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12536 v3.AuxInt = int64(32 - udivisible(32, c).k) 12537 v0.AddArg(v3) 12538 v.AddArg(v0) 12539 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12540 v4.AuxInt = int64(int32(udivisible(32, c).max)) 12541 v.AddArg(v4) 12542 return true 12543 } 12544 // match: (Eq32 (Mul32 (Rsh32Ux64 mul:(Hmul32u (Const32 [m]) x) (Const64 [s])) (Const32 [c])) x) 12545 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+umagic(32,c).m/2)) && s == umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 12546 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 12547 for { 12548 x := v.Args[1] 12549 v_0 := v.Args[0] 12550 if v_0.Op != OpMul32 { 12551 break 12552 } 12553 _ = v_0.Args[1] 12554 v_0_0 := v_0.Args[0] 12555 if v_0_0.Op != OpRsh32Ux64 { 12556 break 12557 } 12558 _ = v_0_0.Args[1] 12559 mul := v_0_0.Args[0] 12560 if mul.Op != OpHmul32u { 12561 break 12562 } 12563 _ = mul.Args[1] 12564 mul_0 := mul.Args[0] 12565 if mul_0.Op != OpConst32 { 12566 break 12567 } 12568 m := mul_0.AuxInt 12569 if x != mul.Args[1] { 12570 break 12571 } 12572 v_0_0_1 := v_0_0.Args[1] 12573 if v_0_0_1.Op != OpConst64 { 12574 break 12575 } 12576 s := v_0_0_1.AuxInt 12577 v_0_1 := v_0.Args[1] 12578 if v_0_1.Op != OpConst32 { 12579 break 12580 } 12581 c := v_0_1.AuxInt 12582 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+umagic(32, c).m/2)) && s == umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 12583 break 12584 } 12585 v.reset(OpLeq32U) 12586 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 12587 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 12588 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12589 v2.AuxInt = int64(int32(udivisible(32, c).m)) 12590 v1.AddArg(v2) 12591 v1.AddArg(x) 12592 v0.AddArg(v1) 12593 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12594 v3.AuxInt = int64(32 - udivisible(32, c).k) 12595 v0.AddArg(v3) 12596 v.AddArg(v0) 12597 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12598 v4.AuxInt = int64(int32(udivisible(32, c).max)) 12599 v.AddArg(v4) 12600 return true 12601 } 12602 // match: (Eq32 (Mul32 (Rsh32Ux64 mul:(Hmul32u x (Const32 [m])) (Const64 [s])) (Const32 [c])) x) 12603 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+umagic(32,c).m/2)) && s == umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 12604 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 12605 for { 12606 x := v.Args[1] 12607 v_0 := v.Args[0] 12608 if v_0.Op != OpMul32 { 12609 break 12610 } 12611 _ = v_0.Args[1] 12612 v_0_0 := v_0.Args[0] 12613 if v_0_0.Op != OpRsh32Ux64 { 12614 break 12615 } 12616 _ = v_0_0.Args[1] 12617 mul := v_0_0.Args[0] 12618 if mul.Op != OpHmul32u { 12619 break 12620 } 12621 _ = mul.Args[1] 12622 if x != mul.Args[0] { 12623 break 12624 } 12625 mul_1 := mul.Args[1] 12626 if mul_1.Op != OpConst32 { 12627 break 12628 } 12629 m := mul_1.AuxInt 12630 v_0_0_1 := v_0_0.Args[1] 12631 if v_0_0_1.Op != OpConst64 { 12632 break 12633 } 12634 s := v_0_0_1.AuxInt 12635 v_0_1 := v_0.Args[1] 12636 if v_0_1.Op != OpConst32 { 12637 break 12638 } 12639 c := v_0_1.AuxInt 12640 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+umagic(32, c).m/2)) && s == umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 12641 break 12642 } 12643 v.reset(OpLeq32U) 12644 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 12645 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 12646 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12647 v2.AuxInt = int64(int32(udivisible(32, c).m)) 12648 v1.AddArg(v2) 12649 v1.AddArg(x) 12650 v0.AddArg(v1) 12651 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12652 v3.AuxInt = int64(32 - udivisible(32, c).k) 12653 v0.AddArg(v3) 12654 v.AddArg(v0) 12655 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12656 v4.AuxInt = int64(int32(udivisible(32, c).max)) 12657 v.AddArg(v4) 12658 return true 12659 } 12660 // match: (Eq32 x (Mul32 (Const32 [c]) (Rsh32Ux64 mul:(Hmul32u (Const32 <typ.UInt32> [m]) (Rsh32Ux64 x (Const64 [1]))) (Const64 [s])))) 12661 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+(umagic(32,c).m+1)/2)) && s == umagic(32,c).s-2 && x.Op != OpConst32 && udivisibleOK(32,c) 12662 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 12663 for { 12664 _ = v.Args[1] 12665 x := v.Args[0] 12666 v_1 := v.Args[1] 12667 if v_1.Op != OpMul32 { 12668 break 12669 } 12670 _ = v_1.Args[1] 12671 v_1_0 := v_1.Args[0] 12672 if v_1_0.Op != OpConst32 { 12673 break 12674 } 12675 c := v_1_0.AuxInt 12676 v_1_1 := v_1.Args[1] 12677 if v_1_1.Op != OpRsh32Ux64 { 12678 break 12679 } 12680 _ = v_1_1.Args[1] 12681 mul := v_1_1.Args[0] 12682 if mul.Op != OpHmul32u { 12683 break 12684 } 12685 _ = mul.Args[1] 12686 mul_0 := mul.Args[0] 12687 if mul_0.Op != OpConst32 || mul_0.Type != typ.UInt32 { 12688 break 12689 } 12690 m := mul_0.AuxInt 12691 mul_1 := mul.Args[1] 12692 if mul_1.Op != OpRsh32Ux64 { 12693 break 12694 } 12695 _ = mul_1.Args[1] 12696 if x != mul_1.Args[0] { 12697 break 12698 } 12699 mul_1_1 := mul_1.Args[1] 12700 if mul_1_1.Op != OpConst64 || mul_1_1.AuxInt != 1 { 12701 break 12702 } 12703 v_1_1_1 := v_1_1.Args[1] 12704 if v_1_1_1.Op != OpConst64 { 12705 break 12706 } 12707 s := v_1_1_1.AuxInt 12708 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+(umagic(32, c).m+1)/2)) && s == umagic(32, c).s-2 && x.Op != OpConst32 && udivisibleOK(32, c)) { 12709 break 12710 } 12711 v.reset(OpLeq32U) 12712 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 12713 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 12714 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12715 v2.AuxInt = int64(int32(udivisible(32, c).m)) 12716 v1.AddArg(v2) 12717 v1.AddArg(x) 12718 v0.AddArg(v1) 12719 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12720 v3.AuxInt = int64(32 - udivisible(32, c).k) 12721 v0.AddArg(v3) 12722 v.AddArg(v0) 12723 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12724 v4.AuxInt = int64(int32(udivisible(32, c).max)) 12725 v.AddArg(v4) 12726 return true 12727 } 12728 // match: (Eq32 x (Mul32 (Const32 [c]) (Rsh32Ux64 mul:(Hmul32u (Rsh32Ux64 x (Const64 [1])) (Const32 <typ.UInt32> [m])) (Const64 [s])))) 12729 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+(umagic(32,c).m+1)/2)) && s == umagic(32,c).s-2 && x.Op != OpConst32 && udivisibleOK(32,c) 12730 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 12731 for { 12732 _ = v.Args[1] 12733 x := v.Args[0] 12734 v_1 := v.Args[1] 12735 if v_1.Op != OpMul32 { 12736 break 12737 } 12738 _ = v_1.Args[1] 12739 v_1_0 := v_1.Args[0] 12740 if v_1_0.Op != OpConst32 { 12741 break 12742 } 12743 c := v_1_0.AuxInt 12744 v_1_1 := v_1.Args[1] 12745 if v_1_1.Op != OpRsh32Ux64 { 12746 break 12747 } 12748 _ = v_1_1.Args[1] 12749 mul := v_1_1.Args[0] 12750 if mul.Op != OpHmul32u { 12751 break 12752 } 12753 _ = mul.Args[1] 12754 mul_0 := mul.Args[0] 12755 if mul_0.Op != OpRsh32Ux64 { 12756 break 12757 } 12758 _ = mul_0.Args[1] 12759 if x != mul_0.Args[0] { 12760 break 12761 } 12762 mul_0_1 := mul_0.Args[1] 12763 if mul_0_1.Op != OpConst64 || mul_0_1.AuxInt != 1 { 12764 break 12765 } 12766 mul_1 := mul.Args[1] 12767 if mul_1.Op != OpConst32 || mul_1.Type != typ.UInt32 { 12768 break 12769 } 12770 m := mul_1.AuxInt 12771 v_1_1_1 := v_1_1.Args[1] 12772 if v_1_1_1.Op != OpConst64 { 12773 break 12774 } 12775 s := v_1_1_1.AuxInt 12776 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+(umagic(32, c).m+1)/2)) && s == umagic(32, c).s-2 && x.Op != OpConst32 && udivisibleOK(32, c)) { 12777 break 12778 } 12779 v.reset(OpLeq32U) 12780 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 12781 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 12782 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12783 v2.AuxInt = int64(int32(udivisible(32, c).m)) 12784 v1.AddArg(v2) 12785 v1.AddArg(x) 12786 v0.AddArg(v1) 12787 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12788 v3.AuxInt = int64(32 - udivisible(32, c).k) 12789 v0.AddArg(v3) 12790 v.AddArg(v0) 12791 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12792 v4.AuxInt = int64(int32(udivisible(32, c).max)) 12793 v.AddArg(v4) 12794 return true 12795 } 12796 // match: (Eq32 x (Mul32 (Rsh32Ux64 mul:(Hmul32u (Const32 <typ.UInt32> [m]) (Rsh32Ux64 x (Const64 [1]))) (Const64 [s])) (Const32 [c]))) 12797 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+(umagic(32,c).m+1)/2)) && s == umagic(32,c).s-2 && x.Op != OpConst32 && udivisibleOK(32,c) 12798 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 12799 for { 12800 _ = v.Args[1] 12801 x := v.Args[0] 12802 v_1 := v.Args[1] 12803 if v_1.Op != OpMul32 { 12804 break 12805 } 12806 _ = v_1.Args[1] 12807 v_1_0 := v_1.Args[0] 12808 if v_1_0.Op != OpRsh32Ux64 { 12809 break 12810 } 12811 _ = v_1_0.Args[1] 12812 mul := v_1_0.Args[0] 12813 if mul.Op != OpHmul32u { 12814 break 12815 } 12816 _ = mul.Args[1] 12817 mul_0 := mul.Args[0] 12818 if mul_0.Op != OpConst32 || mul_0.Type != typ.UInt32 { 12819 break 12820 } 12821 m := mul_0.AuxInt 12822 mul_1 := mul.Args[1] 12823 if mul_1.Op != OpRsh32Ux64 { 12824 break 12825 } 12826 _ = mul_1.Args[1] 12827 if x != mul_1.Args[0] { 12828 break 12829 } 12830 mul_1_1 := mul_1.Args[1] 12831 if mul_1_1.Op != OpConst64 || mul_1_1.AuxInt != 1 { 12832 break 12833 } 12834 v_1_0_1 := v_1_0.Args[1] 12835 if v_1_0_1.Op != OpConst64 { 12836 break 12837 } 12838 s := v_1_0_1.AuxInt 12839 v_1_1 := v_1.Args[1] 12840 if v_1_1.Op != OpConst32 { 12841 break 12842 } 12843 c := v_1_1.AuxInt 12844 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+(umagic(32, c).m+1)/2)) && s == umagic(32, c).s-2 && x.Op != OpConst32 && udivisibleOK(32, c)) { 12845 break 12846 } 12847 v.reset(OpLeq32U) 12848 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 12849 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 12850 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12851 v2.AuxInt = int64(int32(udivisible(32, c).m)) 12852 v1.AddArg(v2) 12853 v1.AddArg(x) 12854 v0.AddArg(v1) 12855 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12856 v3.AuxInt = int64(32 - udivisible(32, c).k) 12857 v0.AddArg(v3) 12858 v.AddArg(v0) 12859 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12860 v4.AuxInt = int64(int32(udivisible(32, c).max)) 12861 v.AddArg(v4) 12862 return true 12863 } 12864 // match: (Eq32 x (Mul32 (Rsh32Ux64 mul:(Hmul32u (Rsh32Ux64 x (Const64 [1])) (Const32 <typ.UInt32> [m])) (Const64 [s])) (Const32 [c]))) 12865 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+(umagic(32,c).m+1)/2)) && s == umagic(32,c).s-2 && x.Op != OpConst32 && udivisibleOK(32,c) 12866 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 12867 for { 12868 _ = v.Args[1] 12869 x := v.Args[0] 12870 v_1 := v.Args[1] 12871 if v_1.Op != OpMul32 { 12872 break 12873 } 12874 _ = v_1.Args[1] 12875 v_1_0 := v_1.Args[0] 12876 if v_1_0.Op != OpRsh32Ux64 { 12877 break 12878 } 12879 _ = v_1_0.Args[1] 12880 mul := v_1_0.Args[0] 12881 if mul.Op != OpHmul32u { 12882 break 12883 } 12884 _ = mul.Args[1] 12885 mul_0 := mul.Args[0] 12886 if mul_0.Op != OpRsh32Ux64 { 12887 break 12888 } 12889 _ = mul_0.Args[1] 12890 if x != mul_0.Args[0] { 12891 break 12892 } 12893 mul_0_1 := mul_0.Args[1] 12894 if mul_0_1.Op != OpConst64 || mul_0_1.AuxInt != 1 { 12895 break 12896 } 12897 mul_1 := mul.Args[1] 12898 if mul_1.Op != OpConst32 || mul_1.Type != typ.UInt32 { 12899 break 12900 } 12901 m := mul_1.AuxInt 12902 v_1_0_1 := v_1_0.Args[1] 12903 if v_1_0_1.Op != OpConst64 { 12904 break 12905 } 12906 s := v_1_0_1.AuxInt 12907 v_1_1 := v_1.Args[1] 12908 if v_1_1.Op != OpConst32 { 12909 break 12910 } 12911 c := v_1_1.AuxInt 12912 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+(umagic(32, c).m+1)/2)) && s == umagic(32, c).s-2 && x.Op != OpConst32 && udivisibleOK(32, c)) { 12913 break 12914 } 12915 v.reset(OpLeq32U) 12916 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 12917 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 12918 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12919 v2.AuxInt = int64(int32(udivisible(32, c).m)) 12920 v1.AddArg(v2) 12921 v1.AddArg(x) 12922 v0.AddArg(v1) 12923 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12924 v3.AuxInt = int64(32 - udivisible(32, c).k) 12925 v0.AddArg(v3) 12926 v.AddArg(v0) 12927 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12928 v4.AuxInt = int64(int32(udivisible(32, c).max)) 12929 v.AddArg(v4) 12930 return true 12931 } 12932 // match: (Eq32 (Mul32 (Const32 [c]) (Rsh32Ux64 mul:(Hmul32u (Const32 <typ.UInt32> [m]) (Rsh32Ux64 x (Const64 [1]))) (Const64 [s]))) x) 12933 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+(umagic(32,c).m+1)/2)) && s == umagic(32,c).s-2 && x.Op != OpConst32 && udivisibleOK(32,c) 12934 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 12935 for { 12936 x := v.Args[1] 12937 v_0 := v.Args[0] 12938 if v_0.Op != OpMul32 { 12939 break 12940 } 12941 _ = v_0.Args[1] 12942 v_0_0 := v_0.Args[0] 12943 if v_0_0.Op != OpConst32 { 12944 break 12945 } 12946 c := v_0_0.AuxInt 12947 v_0_1 := v_0.Args[1] 12948 if v_0_1.Op != OpRsh32Ux64 { 12949 break 12950 } 12951 _ = v_0_1.Args[1] 12952 mul := v_0_1.Args[0] 12953 if mul.Op != OpHmul32u { 12954 break 12955 } 12956 _ = mul.Args[1] 12957 mul_0 := mul.Args[0] 12958 if mul_0.Op != OpConst32 || mul_0.Type != typ.UInt32 { 12959 break 12960 } 12961 m := mul_0.AuxInt 12962 mul_1 := mul.Args[1] 12963 if mul_1.Op != OpRsh32Ux64 { 12964 break 12965 } 12966 _ = mul_1.Args[1] 12967 if x != mul_1.Args[0] { 12968 break 12969 } 12970 mul_1_1 := mul_1.Args[1] 12971 if mul_1_1.Op != OpConst64 || mul_1_1.AuxInt != 1 { 12972 break 12973 } 12974 v_0_1_1 := v_0_1.Args[1] 12975 if v_0_1_1.Op != OpConst64 { 12976 break 12977 } 12978 s := v_0_1_1.AuxInt 12979 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+(umagic(32, c).m+1)/2)) && s == umagic(32, c).s-2 && x.Op != OpConst32 && udivisibleOK(32, c)) { 12980 break 12981 } 12982 v.reset(OpLeq32U) 12983 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 12984 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 12985 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12986 v2.AuxInt = int64(int32(udivisible(32, c).m)) 12987 v1.AddArg(v2) 12988 v1.AddArg(x) 12989 v0.AddArg(v1) 12990 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12991 v3.AuxInt = int64(32 - udivisible(32, c).k) 12992 v0.AddArg(v3) 12993 v.AddArg(v0) 12994 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 12995 v4.AuxInt = int64(int32(udivisible(32, c).max)) 12996 v.AddArg(v4) 12997 return true 12998 } 12999 return false 13000 } 13001 func rewriteValuegeneric_OpEq32_20(v *Value) bool { 13002 b := v.Block 13003 typ := &b.Func.Config.Types 13004 // match: (Eq32 (Mul32 (Const32 [c]) (Rsh32Ux64 mul:(Hmul32u (Rsh32Ux64 x (Const64 [1])) (Const32 <typ.UInt32> [m])) (Const64 [s]))) x) 13005 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+(umagic(32,c).m+1)/2)) && s == umagic(32,c).s-2 && x.Op != OpConst32 && udivisibleOK(32,c) 13006 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 13007 for { 13008 x := v.Args[1] 13009 v_0 := v.Args[0] 13010 if v_0.Op != OpMul32 { 13011 break 13012 } 13013 _ = v_0.Args[1] 13014 v_0_0 := v_0.Args[0] 13015 if v_0_0.Op != OpConst32 { 13016 break 13017 } 13018 c := v_0_0.AuxInt 13019 v_0_1 := v_0.Args[1] 13020 if v_0_1.Op != OpRsh32Ux64 { 13021 break 13022 } 13023 _ = v_0_1.Args[1] 13024 mul := v_0_1.Args[0] 13025 if mul.Op != OpHmul32u { 13026 break 13027 } 13028 _ = mul.Args[1] 13029 mul_0 := mul.Args[0] 13030 if mul_0.Op != OpRsh32Ux64 { 13031 break 13032 } 13033 _ = mul_0.Args[1] 13034 if x != mul_0.Args[0] { 13035 break 13036 } 13037 mul_0_1 := mul_0.Args[1] 13038 if mul_0_1.Op != OpConst64 || mul_0_1.AuxInt != 1 { 13039 break 13040 } 13041 mul_1 := mul.Args[1] 13042 if mul_1.Op != OpConst32 || mul_1.Type != typ.UInt32 { 13043 break 13044 } 13045 m := mul_1.AuxInt 13046 v_0_1_1 := v_0_1.Args[1] 13047 if v_0_1_1.Op != OpConst64 { 13048 break 13049 } 13050 s := v_0_1_1.AuxInt 13051 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+(umagic(32, c).m+1)/2)) && s == umagic(32, c).s-2 && x.Op != OpConst32 && udivisibleOK(32, c)) { 13052 break 13053 } 13054 v.reset(OpLeq32U) 13055 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 13056 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 13057 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13058 v2.AuxInt = int64(int32(udivisible(32, c).m)) 13059 v1.AddArg(v2) 13060 v1.AddArg(x) 13061 v0.AddArg(v1) 13062 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13063 v3.AuxInt = int64(32 - udivisible(32, c).k) 13064 v0.AddArg(v3) 13065 v.AddArg(v0) 13066 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13067 v4.AuxInt = int64(int32(udivisible(32, c).max)) 13068 v.AddArg(v4) 13069 return true 13070 } 13071 // match: (Eq32 (Mul32 (Rsh32Ux64 mul:(Hmul32u (Const32 <typ.UInt32> [m]) (Rsh32Ux64 x (Const64 [1]))) (Const64 [s])) (Const32 [c])) x) 13072 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+(umagic(32,c).m+1)/2)) && s == umagic(32,c).s-2 && x.Op != OpConst32 && udivisibleOK(32,c) 13073 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 13074 for { 13075 x := v.Args[1] 13076 v_0 := v.Args[0] 13077 if v_0.Op != OpMul32 { 13078 break 13079 } 13080 _ = v_0.Args[1] 13081 v_0_0 := v_0.Args[0] 13082 if v_0_0.Op != OpRsh32Ux64 { 13083 break 13084 } 13085 _ = v_0_0.Args[1] 13086 mul := v_0_0.Args[0] 13087 if mul.Op != OpHmul32u { 13088 break 13089 } 13090 _ = mul.Args[1] 13091 mul_0 := mul.Args[0] 13092 if mul_0.Op != OpConst32 || mul_0.Type != typ.UInt32 { 13093 break 13094 } 13095 m := mul_0.AuxInt 13096 mul_1 := mul.Args[1] 13097 if mul_1.Op != OpRsh32Ux64 { 13098 break 13099 } 13100 _ = mul_1.Args[1] 13101 if x != mul_1.Args[0] { 13102 break 13103 } 13104 mul_1_1 := mul_1.Args[1] 13105 if mul_1_1.Op != OpConst64 || mul_1_1.AuxInt != 1 { 13106 break 13107 } 13108 v_0_0_1 := v_0_0.Args[1] 13109 if v_0_0_1.Op != OpConst64 { 13110 break 13111 } 13112 s := v_0_0_1.AuxInt 13113 v_0_1 := v_0.Args[1] 13114 if v_0_1.Op != OpConst32 { 13115 break 13116 } 13117 c := v_0_1.AuxInt 13118 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+(umagic(32, c).m+1)/2)) && s == umagic(32, c).s-2 && x.Op != OpConst32 && udivisibleOK(32, c)) { 13119 break 13120 } 13121 v.reset(OpLeq32U) 13122 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 13123 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 13124 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13125 v2.AuxInt = int64(int32(udivisible(32, c).m)) 13126 v1.AddArg(v2) 13127 v1.AddArg(x) 13128 v0.AddArg(v1) 13129 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13130 v3.AuxInt = int64(32 - udivisible(32, c).k) 13131 v0.AddArg(v3) 13132 v.AddArg(v0) 13133 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13134 v4.AuxInt = int64(int32(udivisible(32, c).max)) 13135 v.AddArg(v4) 13136 return true 13137 } 13138 // match: (Eq32 (Mul32 (Rsh32Ux64 mul:(Hmul32u (Rsh32Ux64 x (Const64 [1])) (Const32 <typ.UInt32> [m])) (Const64 [s])) (Const32 [c])) x) 13139 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+(umagic(32,c).m+1)/2)) && s == umagic(32,c).s-2 && x.Op != OpConst32 && udivisibleOK(32,c) 13140 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 13141 for { 13142 x := v.Args[1] 13143 v_0 := v.Args[0] 13144 if v_0.Op != OpMul32 { 13145 break 13146 } 13147 _ = v_0.Args[1] 13148 v_0_0 := v_0.Args[0] 13149 if v_0_0.Op != OpRsh32Ux64 { 13150 break 13151 } 13152 _ = v_0_0.Args[1] 13153 mul := v_0_0.Args[0] 13154 if mul.Op != OpHmul32u { 13155 break 13156 } 13157 _ = mul.Args[1] 13158 mul_0 := mul.Args[0] 13159 if mul_0.Op != OpRsh32Ux64 { 13160 break 13161 } 13162 _ = mul_0.Args[1] 13163 if x != mul_0.Args[0] { 13164 break 13165 } 13166 mul_0_1 := mul_0.Args[1] 13167 if mul_0_1.Op != OpConst64 || mul_0_1.AuxInt != 1 { 13168 break 13169 } 13170 mul_1 := mul.Args[1] 13171 if mul_1.Op != OpConst32 || mul_1.Type != typ.UInt32 { 13172 break 13173 } 13174 m := mul_1.AuxInt 13175 v_0_0_1 := v_0_0.Args[1] 13176 if v_0_0_1.Op != OpConst64 { 13177 break 13178 } 13179 s := v_0_0_1.AuxInt 13180 v_0_1 := v_0.Args[1] 13181 if v_0_1.Op != OpConst32 { 13182 break 13183 } 13184 c := v_0_1.AuxInt 13185 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(1<<31+(umagic(32, c).m+1)/2)) && s == umagic(32, c).s-2 && x.Op != OpConst32 && udivisibleOK(32, c)) { 13186 break 13187 } 13188 v.reset(OpLeq32U) 13189 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 13190 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 13191 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13192 v2.AuxInt = int64(int32(udivisible(32, c).m)) 13193 v1.AddArg(v2) 13194 v1.AddArg(x) 13195 v0.AddArg(v1) 13196 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13197 v3.AuxInt = int64(32 - udivisible(32, c).k) 13198 v0.AddArg(v3) 13199 v.AddArg(v0) 13200 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13201 v4.AuxInt = int64(int32(udivisible(32, c).max)) 13202 v.AddArg(v4) 13203 return true 13204 } 13205 // match: (Eq32 x (Mul32 (Const32 [c]) (Rsh32Ux64 (Avg32u x mul:(Hmul32u (Const32 [m]) x)) (Const64 [s])))) 13206 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(umagic(32,c).m)) && s == umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 13207 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 13208 for { 13209 _ = v.Args[1] 13210 x := v.Args[0] 13211 v_1 := v.Args[1] 13212 if v_1.Op != OpMul32 { 13213 break 13214 } 13215 _ = v_1.Args[1] 13216 v_1_0 := v_1.Args[0] 13217 if v_1_0.Op != OpConst32 { 13218 break 13219 } 13220 c := v_1_0.AuxInt 13221 v_1_1 := v_1.Args[1] 13222 if v_1_1.Op != OpRsh32Ux64 { 13223 break 13224 } 13225 _ = v_1_1.Args[1] 13226 v_1_1_0 := v_1_1.Args[0] 13227 if v_1_1_0.Op != OpAvg32u { 13228 break 13229 } 13230 _ = v_1_1_0.Args[1] 13231 if x != v_1_1_0.Args[0] { 13232 break 13233 } 13234 mul := v_1_1_0.Args[1] 13235 if mul.Op != OpHmul32u { 13236 break 13237 } 13238 _ = mul.Args[1] 13239 mul_0 := mul.Args[0] 13240 if mul_0.Op != OpConst32 { 13241 break 13242 } 13243 m := mul_0.AuxInt 13244 if x != mul.Args[1] { 13245 break 13246 } 13247 v_1_1_1 := v_1_1.Args[1] 13248 if v_1_1_1.Op != OpConst64 { 13249 break 13250 } 13251 s := v_1_1_1.AuxInt 13252 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(umagic(32, c).m)) && s == umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 13253 break 13254 } 13255 v.reset(OpLeq32U) 13256 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 13257 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 13258 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13259 v2.AuxInt = int64(int32(udivisible(32, c).m)) 13260 v1.AddArg(v2) 13261 v1.AddArg(x) 13262 v0.AddArg(v1) 13263 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13264 v3.AuxInt = int64(32 - udivisible(32, c).k) 13265 v0.AddArg(v3) 13266 v.AddArg(v0) 13267 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13268 v4.AuxInt = int64(int32(udivisible(32, c).max)) 13269 v.AddArg(v4) 13270 return true 13271 } 13272 // match: (Eq32 x (Mul32 (Const32 [c]) (Rsh32Ux64 (Avg32u x mul:(Hmul32u x (Const32 [m]))) (Const64 [s])))) 13273 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(umagic(32,c).m)) && s == umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 13274 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 13275 for { 13276 _ = v.Args[1] 13277 x := v.Args[0] 13278 v_1 := v.Args[1] 13279 if v_1.Op != OpMul32 { 13280 break 13281 } 13282 _ = v_1.Args[1] 13283 v_1_0 := v_1.Args[0] 13284 if v_1_0.Op != OpConst32 { 13285 break 13286 } 13287 c := v_1_0.AuxInt 13288 v_1_1 := v_1.Args[1] 13289 if v_1_1.Op != OpRsh32Ux64 { 13290 break 13291 } 13292 _ = v_1_1.Args[1] 13293 v_1_1_0 := v_1_1.Args[0] 13294 if v_1_1_0.Op != OpAvg32u { 13295 break 13296 } 13297 _ = v_1_1_0.Args[1] 13298 if x != v_1_1_0.Args[0] { 13299 break 13300 } 13301 mul := v_1_1_0.Args[1] 13302 if mul.Op != OpHmul32u { 13303 break 13304 } 13305 _ = mul.Args[1] 13306 if x != mul.Args[0] { 13307 break 13308 } 13309 mul_1 := mul.Args[1] 13310 if mul_1.Op != OpConst32 { 13311 break 13312 } 13313 m := mul_1.AuxInt 13314 v_1_1_1 := v_1_1.Args[1] 13315 if v_1_1_1.Op != OpConst64 { 13316 break 13317 } 13318 s := v_1_1_1.AuxInt 13319 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(umagic(32, c).m)) && s == umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 13320 break 13321 } 13322 v.reset(OpLeq32U) 13323 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 13324 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 13325 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13326 v2.AuxInt = int64(int32(udivisible(32, c).m)) 13327 v1.AddArg(v2) 13328 v1.AddArg(x) 13329 v0.AddArg(v1) 13330 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13331 v3.AuxInt = int64(32 - udivisible(32, c).k) 13332 v0.AddArg(v3) 13333 v.AddArg(v0) 13334 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13335 v4.AuxInt = int64(int32(udivisible(32, c).max)) 13336 v.AddArg(v4) 13337 return true 13338 } 13339 // match: (Eq32 x (Mul32 (Rsh32Ux64 (Avg32u x mul:(Hmul32u (Const32 [m]) x)) (Const64 [s])) (Const32 [c]))) 13340 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(umagic(32,c).m)) && s == umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 13341 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 13342 for { 13343 _ = v.Args[1] 13344 x := v.Args[0] 13345 v_1 := v.Args[1] 13346 if v_1.Op != OpMul32 { 13347 break 13348 } 13349 _ = v_1.Args[1] 13350 v_1_0 := v_1.Args[0] 13351 if v_1_0.Op != OpRsh32Ux64 { 13352 break 13353 } 13354 _ = v_1_0.Args[1] 13355 v_1_0_0 := v_1_0.Args[0] 13356 if v_1_0_0.Op != OpAvg32u { 13357 break 13358 } 13359 _ = v_1_0_0.Args[1] 13360 if x != v_1_0_0.Args[0] { 13361 break 13362 } 13363 mul := v_1_0_0.Args[1] 13364 if mul.Op != OpHmul32u { 13365 break 13366 } 13367 _ = mul.Args[1] 13368 mul_0 := mul.Args[0] 13369 if mul_0.Op != OpConst32 { 13370 break 13371 } 13372 m := mul_0.AuxInt 13373 if x != mul.Args[1] { 13374 break 13375 } 13376 v_1_0_1 := v_1_0.Args[1] 13377 if v_1_0_1.Op != OpConst64 { 13378 break 13379 } 13380 s := v_1_0_1.AuxInt 13381 v_1_1 := v_1.Args[1] 13382 if v_1_1.Op != OpConst32 { 13383 break 13384 } 13385 c := v_1_1.AuxInt 13386 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(umagic(32, c).m)) && s == umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 13387 break 13388 } 13389 v.reset(OpLeq32U) 13390 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 13391 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 13392 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13393 v2.AuxInt = int64(int32(udivisible(32, c).m)) 13394 v1.AddArg(v2) 13395 v1.AddArg(x) 13396 v0.AddArg(v1) 13397 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13398 v3.AuxInt = int64(32 - udivisible(32, c).k) 13399 v0.AddArg(v3) 13400 v.AddArg(v0) 13401 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13402 v4.AuxInt = int64(int32(udivisible(32, c).max)) 13403 v.AddArg(v4) 13404 return true 13405 } 13406 // match: (Eq32 x (Mul32 (Rsh32Ux64 (Avg32u x mul:(Hmul32u x (Const32 [m]))) (Const64 [s])) (Const32 [c]))) 13407 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(umagic(32,c).m)) && s == umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 13408 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 13409 for { 13410 _ = v.Args[1] 13411 x := v.Args[0] 13412 v_1 := v.Args[1] 13413 if v_1.Op != OpMul32 { 13414 break 13415 } 13416 _ = v_1.Args[1] 13417 v_1_0 := v_1.Args[0] 13418 if v_1_0.Op != OpRsh32Ux64 { 13419 break 13420 } 13421 _ = v_1_0.Args[1] 13422 v_1_0_0 := v_1_0.Args[0] 13423 if v_1_0_0.Op != OpAvg32u { 13424 break 13425 } 13426 _ = v_1_0_0.Args[1] 13427 if x != v_1_0_0.Args[0] { 13428 break 13429 } 13430 mul := v_1_0_0.Args[1] 13431 if mul.Op != OpHmul32u { 13432 break 13433 } 13434 _ = mul.Args[1] 13435 if x != mul.Args[0] { 13436 break 13437 } 13438 mul_1 := mul.Args[1] 13439 if mul_1.Op != OpConst32 { 13440 break 13441 } 13442 m := mul_1.AuxInt 13443 v_1_0_1 := v_1_0.Args[1] 13444 if v_1_0_1.Op != OpConst64 { 13445 break 13446 } 13447 s := v_1_0_1.AuxInt 13448 v_1_1 := v_1.Args[1] 13449 if v_1_1.Op != OpConst32 { 13450 break 13451 } 13452 c := v_1_1.AuxInt 13453 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(umagic(32, c).m)) && s == umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 13454 break 13455 } 13456 v.reset(OpLeq32U) 13457 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 13458 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 13459 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13460 v2.AuxInt = int64(int32(udivisible(32, c).m)) 13461 v1.AddArg(v2) 13462 v1.AddArg(x) 13463 v0.AddArg(v1) 13464 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13465 v3.AuxInt = int64(32 - udivisible(32, c).k) 13466 v0.AddArg(v3) 13467 v.AddArg(v0) 13468 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13469 v4.AuxInt = int64(int32(udivisible(32, c).max)) 13470 v.AddArg(v4) 13471 return true 13472 } 13473 // match: (Eq32 (Mul32 (Const32 [c]) (Rsh32Ux64 (Avg32u x mul:(Hmul32u (Const32 [m]) x)) (Const64 [s]))) x) 13474 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(umagic(32,c).m)) && s == umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 13475 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 13476 for { 13477 x := v.Args[1] 13478 v_0 := v.Args[0] 13479 if v_0.Op != OpMul32 { 13480 break 13481 } 13482 _ = v_0.Args[1] 13483 v_0_0 := v_0.Args[0] 13484 if v_0_0.Op != OpConst32 { 13485 break 13486 } 13487 c := v_0_0.AuxInt 13488 v_0_1 := v_0.Args[1] 13489 if v_0_1.Op != OpRsh32Ux64 { 13490 break 13491 } 13492 _ = v_0_1.Args[1] 13493 v_0_1_0 := v_0_1.Args[0] 13494 if v_0_1_0.Op != OpAvg32u { 13495 break 13496 } 13497 _ = v_0_1_0.Args[1] 13498 if x != v_0_1_0.Args[0] { 13499 break 13500 } 13501 mul := v_0_1_0.Args[1] 13502 if mul.Op != OpHmul32u { 13503 break 13504 } 13505 _ = mul.Args[1] 13506 mul_0 := mul.Args[0] 13507 if mul_0.Op != OpConst32 { 13508 break 13509 } 13510 m := mul_0.AuxInt 13511 if x != mul.Args[1] { 13512 break 13513 } 13514 v_0_1_1 := v_0_1.Args[1] 13515 if v_0_1_1.Op != OpConst64 { 13516 break 13517 } 13518 s := v_0_1_1.AuxInt 13519 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(umagic(32, c).m)) && s == umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 13520 break 13521 } 13522 v.reset(OpLeq32U) 13523 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 13524 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 13525 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13526 v2.AuxInt = int64(int32(udivisible(32, c).m)) 13527 v1.AddArg(v2) 13528 v1.AddArg(x) 13529 v0.AddArg(v1) 13530 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13531 v3.AuxInt = int64(32 - udivisible(32, c).k) 13532 v0.AddArg(v3) 13533 v.AddArg(v0) 13534 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13535 v4.AuxInt = int64(int32(udivisible(32, c).max)) 13536 v.AddArg(v4) 13537 return true 13538 } 13539 // match: (Eq32 (Mul32 (Const32 [c]) (Rsh32Ux64 (Avg32u x mul:(Hmul32u x (Const32 [m]))) (Const64 [s]))) x) 13540 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(umagic(32,c).m)) && s == umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 13541 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 13542 for { 13543 x := v.Args[1] 13544 v_0 := v.Args[0] 13545 if v_0.Op != OpMul32 { 13546 break 13547 } 13548 _ = v_0.Args[1] 13549 v_0_0 := v_0.Args[0] 13550 if v_0_0.Op != OpConst32 { 13551 break 13552 } 13553 c := v_0_0.AuxInt 13554 v_0_1 := v_0.Args[1] 13555 if v_0_1.Op != OpRsh32Ux64 { 13556 break 13557 } 13558 _ = v_0_1.Args[1] 13559 v_0_1_0 := v_0_1.Args[0] 13560 if v_0_1_0.Op != OpAvg32u { 13561 break 13562 } 13563 _ = v_0_1_0.Args[1] 13564 if x != v_0_1_0.Args[0] { 13565 break 13566 } 13567 mul := v_0_1_0.Args[1] 13568 if mul.Op != OpHmul32u { 13569 break 13570 } 13571 _ = mul.Args[1] 13572 if x != mul.Args[0] { 13573 break 13574 } 13575 mul_1 := mul.Args[1] 13576 if mul_1.Op != OpConst32 { 13577 break 13578 } 13579 m := mul_1.AuxInt 13580 v_0_1_1 := v_0_1.Args[1] 13581 if v_0_1_1.Op != OpConst64 { 13582 break 13583 } 13584 s := v_0_1_1.AuxInt 13585 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(umagic(32, c).m)) && s == umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 13586 break 13587 } 13588 v.reset(OpLeq32U) 13589 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 13590 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 13591 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13592 v2.AuxInt = int64(int32(udivisible(32, c).m)) 13593 v1.AddArg(v2) 13594 v1.AddArg(x) 13595 v0.AddArg(v1) 13596 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13597 v3.AuxInt = int64(32 - udivisible(32, c).k) 13598 v0.AddArg(v3) 13599 v.AddArg(v0) 13600 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13601 v4.AuxInt = int64(int32(udivisible(32, c).max)) 13602 v.AddArg(v4) 13603 return true 13604 } 13605 // match: (Eq32 (Mul32 (Rsh32Ux64 (Avg32u x mul:(Hmul32u (Const32 [m]) x)) (Const64 [s])) (Const32 [c])) x) 13606 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(umagic(32,c).m)) && s == umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 13607 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 13608 for { 13609 x := v.Args[1] 13610 v_0 := v.Args[0] 13611 if v_0.Op != OpMul32 { 13612 break 13613 } 13614 _ = v_0.Args[1] 13615 v_0_0 := v_0.Args[0] 13616 if v_0_0.Op != OpRsh32Ux64 { 13617 break 13618 } 13619 _ = v_0_0.Args[1] 13620 v_0_0_0 := v_0_0.Args[0] 13621 if v_0_0_0.Op != OpAvg32u { 13622 break 13623 } 13624 _ = v_0_0_0.Args[1] 13625 if x != v_0_0_0.Args[0] { 13626 break 13627 } 13628 mul := v_0_0_0.Args[1] 13629 if mul.Op != OpHmul32u { 13630 break 13631 } 13632 _ = mul.Args[1] 13633 mul_0 := mul.Args[0] 13634 if mul_0.Op != OpConst32 { 13635 break 13636 } 13637 m := mul_0.AuxInt 13638 if x != mul.Args[1] { 13639 break 13640 } 13641 v_0_0_1 := v_0_0.Args[1] 13642 if v_0_0_1.Op != OpConst64 { 13643 break 13644 } 13645 s := v_0_0_1.AuxInt 13646 v_0_1 := v_0.Args[1] 13647 if v_0_1.Op != OpConst32 { 13648 break 13649 } 13650 c := v_0_1.AuxInt 13651 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(umagic(32, c).m)) && s == umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 13652 break 13653 } 13654 v.reset(OpLeq32U) 13655 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 13656 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 13657 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13658 v2.AuxInt = int64(int32(udivisible(32, c).m)) 13659 v1.AddArg(v2) 13660 v1.AddArg(x) 13661 v0.AddArg(v1) 13662 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13663 v3.AuxInt = int64(32 - udivisible(32, c).k) 13664 v0.AddArg(v3) 13665 v.AddArg(v0) 13666 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13667 v4.AuxInt = int64(int32(udivisible(32, c).max)) 13668 v.AddArg(v4) 13669 return true 13670 } 13671 return false 13672 } 13673 func rewriteValuegeneric_OpEq32_30(v *Value) bool { 13674 b := v.Block 13675 typ := &b.Func.Config.Types 13676 // match: (Eq32 (Mul32 (Rsh32Ux64 (Avg32u x mul:(Hmul32u x (Const32 [m]))) (Const64 [s])) (Const32 [c])) x) 13677 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(umagic(32,c).m)) && s == umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 13678 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 13679 for { 13680 x := v.Args[1] 13681 v_0 := v.Args[0] 13682 if v_0.Op != OpMul32 { 13683 break 13684 } 13685 _ = v_0.Args[1] 13686 v_0_0 := v_0.Args[0] 13687 if v_0_0.Op != OpRsh32Ux64 { 13688 break 13689 } 13690 _ = v_0_0.Args[1] 13691 v_0_0_0 := v_0_0.Args[0] 13692 if v_0_0_0.Op != OpAvg32u { 13693 break 13694 } 13695 _ = v_0_0_0.Args[1] 13696 if x != v_0_0_0.Args[0] { 13697 break 13698 } 13699 mul := v_0_0_0.Args[1] 13700 if mul.Op != OpHmul32u { 13701 break 13702 } 13703 _ = mul.Args[1] 13704 if x != mul.Args[0] { 13705 break 13706 } 13707 mul_1 := mul.Args[1] 13708 if mul_1.Op != OpConst32 { 13709 break 13710 } 13711 m := mul_1.AuxInt 13712 v_0_0_1 := v_0_0.Args[1] 13713 if v_0_0_1.Op != OpConst64 { 13714 break 13715 } 13716 s := v_0_0_1.AuxInt 13717 v_0_1 := v_0.Args[1] 13718 if v_0_1.Op != OpConst32 { 13719 break 13720 } 13721 c := v_0_1.AuxInt 13722 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(umagic(32, c).m)) && s == umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 13723 break 13724 } 13725 v.reset(OpLeq32U) 13726 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 13727 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 13728 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13729 v2.AuxInt = int64(int32(udivisible(32, c).m)) 13730 v1.AddArg(v2) 13731 v1.AddArg(x) 13732 v0.AddArg(v1) 13733 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13734 v3.AuxInt = int64(32 - udivisible(32, c).k) 13735 v0.AddArg(v3) 13736 v.AddArg(v0) 13737 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13738 v4.AuxInt = int64(int32(udivisible(32, c).max)) 13739 v.AddArg(v4) 13740 return true 13741 } 13742 // match: (Eq32 x (Mul32 (Const32 [c]) (Trunc64to32 (Rsh64Ux64 mul:(Mul64 (Const64 [m]) (ZeroExt32to64 x)) (Const64 [s]))))) 13743 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+umagic(32,c).m/2) && s == 32+umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 13744 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 13745 for { 13746 _ = v.Args[1] 13747 x := v.Args[0] 13748 v_1 := v.Args[1] 13749 if v_1.Op != OpMul32 { 13750 break 13751 } 13752 _ = v_1.Args[1] 13753 v_1_0 := v_1.Args[0] 13754 if v_1_0.Op != OpConst32 { 13755 break 13756 } 13757 c := v_1_0.AuxInt 13758 v_1_1 := v_1.Args[1] 13759 if v_1_1.Op != OpTrunc64to32 { 13760 break 13761 } 13762 v_1_1_0 := v_1_1.Args[0] 13763 if v_1_1_0.Op != OpRsh64Ux64 { 13764 break 13765 } 13766 _ = v_1_1_0.Args[1] 13767 mul := v_1_1_0.Args[0] 13768 if mul.Op != OpMul64 { 13769 break 13770 } 13771 _ = mul.Args[1] 13772 mul_0 := mul.Args[0] 13773 if mul_0.Op != OpConst64 { 13774 break 13775 } 13776 m := mul_0.AuxInt 13777 mul_1 := mul.Args[1] 13778 if mul_1.Op != OpZeroExt32to64 || x != mul_1.Args[0] { 13779 break 13780 } 13781 v_1_1_0_1 := v_1_1_0.Args[1] 13782 if v_1_1_0_1.Op != OpConst64 { 13783 break 13784 } 13785 s := v_1_1_0_1.AuxInt 13786 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+umagic(32, c).m/2) && s == 32+umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 13787 break 13788 } 13789 v.reset(OpLeq32U) 13790 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 13791 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 13792 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13793 v2.AuxInt = int64(int32(udivisible(32, c).m)) 13794 v1.AddArg(v2) 13795 v1.AddArg(x) 13796 v0.AddArg(v1) 13797 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13798 v3.AuxInt = int64(32 - udivisible(32, c).k) 13799 v0.AddArg(v3) 13800 v.AddArg(v0) 13801 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13802 v4.AuxInt = int64(int32(udivisible(32, c).max)) 13803 v.AddArg(v4) 13804 return true 13805 } 13806 // match: (Eq32 x (Mul32 (Const32 [c]) (Trunc64to32 (Rsh64Ux64 mul:(Mul64 (ZeroExt32to64 x) (Const64 [m])) (Const64 [s]))))) 13807 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+umagic(32,c).m/2) && s == 32+umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 13808 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 13809 for { 13810 _ = v.Args[1] 13811 x := v.Args[0] 13812 v_1 := v.Args[1] 13813 if v_1.Op != OpMul32 { 13814 break 13815 } 13816 _ = v_1.Args[1] 13817 v_1_0 := v_1.Args[0] 13818 if v_1_0.Op != OpConst32 { 13819 break 13820 } 13821 c := v_1_0.AuxInt 13822 v_1_1 := v_1.Args[1] 13823 if v_1_1.Op != OpTrunc64to32 { 13824 break 13825 } 13826 v_1_1_0 := v_1_1.Args[0] 13827 if v_1_1_0.Op != OpRsh64Ux64 { 13828 break 13829 } 13830 _ = v_1_1_0.Args[1] 13831 mul := v_1_1_0.Args[0] 13832 if mul.Op != OpMul64 { 13833 break 13834 } 13835 _ = mul.Args[1] 13836 mul_0 := mul.Args[0] 13837 if mul_0.Op != OpZeroExt32to64 || x != mul_0.Args[0] { 13838 break 13839 } 13840 mul_1 := mul.Args[1] 13841 if mul_1.Op != OpConst64 { 13842 break 13843 } 13844 m := mul_1.AuxInt 13845 v_1_1_0_1 := v_1_1_0.Args[1] 13846 if v_1_1_0_1.Op != OpConst64 { 13847 break 13848 } 13849 s := v_1_1_0_1.AuxInt 13850 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+umagic(32, c).m/2) && s == 32+umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 13851 break 13852 } 13853 v.reset(OpLeq32U) 13854 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 13855 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 13856 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13857 v2.AuxInt = int64(int32(udivisible(32, c).m)) 13858 v1.AddArg(v2) 13859 v1.AddArg(x) 13860 v0.AddArg(v1) 13861 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13862 v3.AuxInt = int64(32 - udivisible(32, c).k) 13863 v0.AddArg(v3) 13864 v.AddArg(v0) 13865 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13866 v4.AuxInt = int64(int32(udivisible(32, c).max)) 13867 v.AddArg(v4) 13868 return true 13869 } 13870 // match: (Eq32 x (Mul32 (Trunc64to32 (Rsh64Ux64 mul:(Mul64 (Const64 [m]) (ZeroExt32to64 x)) (Const64 [s]))) (Const32 [c]))) 13871 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+umagic(32,c).m/2) && s == 32+umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 13872 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 13873 for { 13874 _ = v.Args[1] 13875 x := v.Args[0] 13876 v_1 := v.Args[1] 13877 if v_1.Op != OpMul32 { 13878 break 13879 } 13880 _ = v_1.Args[1] 13881 v_1_0 := v_1.Args[0] 13882 if v_1_0.Op != OpTrunc64to32 { 13883 break 13884 } 13885 v_1_0_0 := v_1_0.Args[0] 13886 if v_1_0_0.Op != OpRsh64Ux64 { 13887 break 13888 } 13889 _ = v_1_0_0.Args[1] 13890 mul := v_1_0_0.Args[0] 13891 if mul.Op != OpMul64 { 13892 break 13893 } 13894 _ = mul.Args[1] 13895 mul_0 := mul.Args[0] 13896 if mul_0.Op != OpConst64 { 13897 break 13898 } 13899 m := mul_0.AuxInt 13900 mul_1 := mul.Args[1] 13901 if mul_1.Op != OpZeroExt32to64 || x != mul_1.Args[0] { 13902 break 13903 } 13904 v_1_0_0_1 := v_1_0_0.Args[1] 13905 if v_1_0_0_1.Op != OpConst64 { 13906 break 13907 } 13908 s := v_1_0_0_1.AuxInt 13909 v_1_1 := v_1.Args[1] 13910 if v_1_1.Op != OpConst32 { 13911 break 13912 } 13913 c := v_1_1.AuxInt 13914 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+umagic(32, c).m/2) && s == 32+umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 13915 break 13916 } 13917 v.reset(OpLeq32U) 13918 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 13919 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 13920 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13921 v2.AuxInt = int64(int32(udivisible(32, c).m)) 13922 v1.AddArg(v2) 13923 v1.AddArg(x) 13924 v0.AddArg(v1) 13925 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13926 v3.AuxInt = int64(32 - udivisible(32, c).k) 13927 v0.AddArg(v3) 13928 v.AddArg(v0) 13929 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13930 v4.AuxInt = int64(int32(udivisible(32, c).max)) 13931 v.AddArg(v4) 13932 return true 13933 } 13934 // match: (Eq32 x (Mul32 (Trunc64to32 (Rsh64Ux64 mul:(Mul64 (ZeroExt32to64 x) (Const64 [m])) (Const64 [s]))) (Const32 [c]))) 13935 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+umagic(32,c).m/2) && s == 32+umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 13936 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 13937 for { 13938 _ = v.Args[1] 13939 x := v.Args[0] 13940 v_1 := v.Args[1] 13941 if v_1.Op != OpMul32 { 13942 break 13943 } 13944 _ = v_1.Args[1] 13945 v_1_0 := v_1.Args[0] 13946 if v_1_0.Op != OpTrunc64to32 { 13947 break 13948 } 13949 v_1_0_0 := v_1_0.Args[0] 13950 if v_1_0_0.Op != OpRsh64Ux64 { 13951 break 13952 } 13953 _ = v_1_0_0.Args[1] 13954 mul := v_1_0_0.Args[0] 13955 if mul.Op != OpMul64 { 13956 break 13957 } 13958 _ = mul.Args[1] 13959 mul_0 := mul.Args[0] 13960 if mul_0.Op != OpZeroExt32to64 || x != mul_0.Args[0] { 13961 break 13962 } 13963 mul_1 := mul.Args[1] 13964 if mul_1.Op != OpConst64 { 13965 break 13966 } 13967 m := mul_1.AuxInt 13968 v_1_0_0_1 := v_1_0_0.Args[1] 13969 if v_1_0_0_1.Op != OpConst64 { 13970 break 13971 } 13972 s := v_1_0_0_1.AuxInt 13973 v_1_1 := v_1.Args[1] 13974 if v_1_1.Op != OpConst32 { 13975 break 13976 } 13977 c := v_1_1.AuxInt 13978 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+umagic(32, c).m/2) && s == 32+umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 13979 break 13980 } 13981 v.reset(OpLeq32U) 13982 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 13983 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 13984 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13985 v2.AuxInt = int64(int32(udivisible(32, c).m)) 13986 v1.AddArg(v2) 13987 v1.AddArg(x) 13988 v0.AddArg(v1) 13989 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13990 v3.AuxInt = int64(32 - udivisible(32, c).k) 13991 v0.AddArg(v3) 13992 v.AddArg(v0) 13993 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 13994 v4.AuxInt = int64(int32(udivisible(32, c).max)) 13995 v.AddArg(v4) 13996 return true 13997 } 13998 // match: (Eq32 (Mul32 (Const32 [c]) (Trunc64to32 (Rsh64Ux64 mul:(Mul64 (Const64 [m]) (ZeroExt32to64 x)) (Const64 [s])))) x) 13999 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+umagic(32,c).m/2) && s == 32+umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 14000 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 14001 for { 14002 x := v.Args[1] 14003 v_0 := v.Args[0] 14004 if v_0.Op != OpMul32 { 14005 break 14006 } 14007 _ = v_0.Args[1] 14008 v_0_0 := v_0.Args[0] 14009 if v_0_0.Op != OpConst32 { 14010 break 14011 } 14012 c := v_0_0.AuxInt 14013 v_0_1 := v_0.Args[1] 14014 if v_0_1.Op != OpTrunc64to32 { 14015 break 14016 } 14017 v_0_1_0 := v_0_1.Args[0] 14018 if v_0_1_0.Op != OpRsh64Ux64 { 14019 break 14020 } 14021 _ = v_0_1_0.Args[1] 14022 mul := v_0_1_0.Args[0] 14023 if mul.Op != OpMul64 { 14024 break 14025 } 14026 _ = mul.Args[1] 14027 mul_0 := mul.Args[0] 14028 if mul_0.Op != OpConst64 { 14029 break 14030 } 14031 m := mul_0.AuxInt 14032 mul_1 := mul.Args[1] 14033 if mul_1.Op != OpZeroExt32to64 || x != mul_1.Args[0] { 14034 break 14035 } 14036 v_0_1_0_1 := v_0_1_0.Args[1] 14037 if v_0_1_0_1.Op != OpConst64 { 14038 break 14039 } 14040 s := v_0_1_0_1.AuxInt 14041 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+umagic(32, c).m/2) && s == 32+umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 14042 break 14043 } 14044 v.reset(OpLeq32U) 14045 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 14046 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 14047 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14048 v2.AuxInt = int64(int32(udivisible(32, c).m)) 14049 v1.AddArg(v2) 14050 v1.AddArg(x) 14051 v0.AddArg(v1) 14052 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14053 v3.AuxInt = int64(32 - udivisible(32, c).k) 14054 v0.AddArg(v3) 14055 v.AddArg(v0) 14056 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14057 v4.AuxInt = int64(int32(udivisible(32, c).max)) 14058 v.AddArg(v4) 14059 return true 14060 } 14061 // match: (Eq32 (Mul32 (Const32 [c]) (Trunc64to32 (Rsh64Ux64 mul:(Mul64 (ZeroExt32to64 x) (Const64 [m])) (Const64 [s])))) x) 14062 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+umagic(32,c).m/2) && s == 32+umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 14063 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 14064 for { 14065 x := v.Args[1] 14066 v_0 := v.Args[0] 14067 if v_0.Op != OpMul32 { 14068 break 14069 } 14070 _ = v_0.Args[1] 14071 v_0_0 := v_0.Args[0] 14072 if v_0_0.Op != OpConst32 { 14073 break 14074 } 14075 c := v_0_0.AuxInt 14076 v_0_1 := v_0.Args[1] 14077 if v_0_1.Op != OpTrunc64to32 { 14078 break 14079 } 14080 v_0_1_0 := v_0_1.Args[0] 14081 if v_0_1_0.Op != OpRsh64Ux64 { 14082 break 14083 } 14084 _ = v_0_1_0.Args[1] 14085 mul := v_0_1_0.Args[0] 14086 if mul.Op != OpMul64 { 14087 break 14088 } 14089 _ = mul.Args[1] 14090 mul_0 := mul.Args[0] 14091 if mul_0.Op != OpZeroExt32to64 || x != mul_0.Args[0] { 14092 break 14093 } 14094 mul_1 := mul.Args[1] 14095 if mul_1.Op != OpConst64 { 14096 break 14097 } 14098 m := mul_1.AuxInt 14099 v_0_1_0_1 := v_0_1_0.Args[1] 14100 if v_0_1_0_1.Op != OpConst64 { 14101 break 14102 } 14103 s := v_0_1_0_1.AuxInt 14104 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+umagic(32, c).m/2) && s == 32+umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 14105 break 14106 } 14107 v.reset(OpLeq32U) 14108 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 14109 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 14110 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14111 v2.AuxInt = int64(int32(udivisible(32, c).m)) 14112 v1.AddArg(v2) 14113 v1.AddArg(x) 14114 v0.AddArg(v1) 14115 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14116 v3.AuxInt = int64(32 - udivisible(32, c).k) 14117 v0.AddArg(v3) 14118 v.AddArg(v0) 14119 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14120 v4.AuxInt = int64(int32(udivisible(32, c).max)) 14121 v.AddArg(v4) 14122 return true 14123 } 14124 // match: (Eq32 (Mul32 (Trunc64to32 (Rsh64Ux64 mul:(Mul64 (Const64 [m]) (ZeroExt32to64 x)) (Const64 [s]))) (Const32 [c])) x) 14125 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+umagic(32,c).m/2) && s == 32+umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 14126 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 14127 for { 14128 x := v.Args[1] 14129 v_0 := v.Args[0] 14130 if v_0.Op != OpMul32 { 14131 break 14132 } 14133 _ = v_0.Args[1] 14134 v_0_0 := v_0.Args[0] 14135 if v_0_0.Op != OpTrunc64to32 { 14136 break 14137 } 14138 v_0_0_0 := v_0_0.Args[0] 14139 if v_0_0_0.Op != OpRsh64Ux64 { 14140 break 14141 } 14142 _ = v_0_0_0.Args[1] 14143 mul := v_0_0_0.Args[0] 14144 if mul.Op != OpMul64 { 14145 break 14146 } 14147 _ = mul.Args[1] 14148 mul_0 := mul.Args[0] 14149 if mul_0.Op != OpConst64 { 14150 break 14151 } 14152 m := mul_0.AuxInt 14153 mul_1 := mul.Args[1] 14154 if mul_1.Op != OpZeroExt32to64 || x != mul_1.Args[0] { 14155 break 14156 } 14157 v_0_0_0_1 := v_0_0_0.Args[1] 14158 if v_0_0_0_1.Op != OpConst64 { 14159 break 14160 } 14161 s := v_0_0_0_1.AuxInt 14162 v_0_1 := v_0.Args[1] 14163 if v_0_1.Op != OpConst32 { 14164 break 14165 } 14166 c := v_0_1.AuxInt 14167 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+umagic(32, c).m/2) && s == 32+umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 14168 break 14169 } 14170 v.reset(OpLeq32U) 14171 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 14172 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 14173 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14174 v2.AuxInt = int64(int32(udivisible(32, c).m)) 14175 v1.AddArg(v2) 14176 v1.AddArg(x) 14177 v0.AddArg(v1) 14178 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14179 v3.AuxInt = int64(32 - udivisible(32, c).k) 14180 v0.AddArg(v3) 14181 v.AddArg(v0) 14182 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14183 v4.AuxInt = int64(int32(udivisible(32, c).max)) 14184 v.AddArg(v4) 14185 return true 14186 } 14187 // match: (Eq32 (Mul32 (Trunc64to32 (Rsh64Ux64 mul:(Mul64 (ZeroExt32to64 x) (Const64 [m])) (Const64 [s]))) (Const32 [c])) x) 14188 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+umagic(32,c).m/2) && s == 32+umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 14189 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 14190 for { 14191 x := v.Args[1] 14192 v_0 := v.Args[0] 14193 if v_0.Op != OpMul32 { 14194 break 14195 } 14196 _ = v_0.Args[1] 14197 v_0_0 := v_0.Args[0] 14198 if v_0_0.Op != OpTrunc64to32 { 14199 break 14200 } 14201 v_0_0_0 := v_0_0.Args[0] 14202 if v_0_0_0.Op != OpRsh64Ux64 { 14203 break 14204 } 14205 _ = v_0_0_0.Args[1] 14206 mul := v_0_0_0.Args[0] 14207 if mul.Op != OpMul64 { 14208 break 14209 } 14210 _ = mul.Args[1] 14211 mul_0 := mul.Args[0] 14212 if mul_0.Op != OpZeroExt32to64 || x != mul_0.Args[0] { 14213 break 14214 } 14215 mul_1 := mul.Args[1] 14216 if mul_1.Op != OpConst64 { 14217 break 14218 } 14219 m := mul_1.AuxInt 14220 v_0_0_0_1 := v_0_0_0.Args[1] 14221 if v_0_0_0_1.Op != OpConst64 { 14222 break 14223 } 14224 s := v_0_0_0_1.AuxInt 14225 v_0_1 := v_0.Args[1] 14226 if v_0_1.Op != OpConst32 { 14227 break 14228 } 14229 c := v_0_1.AuxInt 14230 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+umagic(32, c).m/2) && s == 32+umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 14231 break 14232 } 14233 v.reset(OpLeq32U) 14234 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 14235 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 14236 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14237 v2.AuxInt = int64(int32(udivisible(32, c).m)) 14238 v1.AddArg(v2) 14239 v1.AddArg(x) 14240 v0.AddArg(v1) 14241 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14242 v3.AuxInt = int64(32 - udivisible(32, c).k) 14243 v0.AddArg(v3) 14244 v.AddArg(v0) 14245 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14246 v4.AuxInt = int64(int32(udivisible(32, c).max)) 14247 v.AddArg(v4) 14248 return true 14249 } 14250 // match: (Eq32 x (Mul32 (Const32 [c]) (Trunc64to32 (Rsh64Ux64 mul:(Mul64 (Const64 [m]) (Rsh64Ux64 (ZeroExt32to64 x) (Const64 [1]))) (Const64 [s]))))) 14251 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+(umagic(32,c).m+1)/2) && s == 32+umagic(32,c).s-2 && x.Op != OpConst32 && udivisibleOK(32,c) 14252 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 14253 for { 14254 _ = v.Args[1] 14255 x := v.Args[0] 14256 v_1 := v.Args[1] 14257 if v_1.Op != OpMul32 { 14258 break 14259 } 14260 _ = v_1.Args[1] 14261 v_1_0 := v_1.Args[0] 14262 if v_1_0.Op != OpConst32 { 14263 break 14264 } 14265 c := v_1_0.AuxInt 14266 v_1_1 := v_1.Args[1] 14267 if v_1_1.Op != OpTrunc64to32 { 14268 break 14269 } 14270 v_1_1_0 := v_1_1.Args[0] 14271 if v_1_1_0.Op != OpRsh64Ux64 { 14272 break 14273 } 14274 _ = v_1_1_0.Args[1] 14275 mul := v_1_1_0.Args[0] 14276 if mul.Op != OpMul64 { 14277 break 14278 } 14279 _ = mul.Args[1] 14280 mul_0 := mul.Args[0] 14281 if mul_0.Op != OpConst64 { 14282 break 14283 } 14284 m := mul_0.AuxInt 14285 mul_1 := mul.Args[1] 14286 if mul_1.Op != OpRsh64Ux64 { 14287 break 14288 } 14289 _ = mul_1.Args[1] 14290 mul_1_0 := mul_1.Args[0] 14291 if mul_1_0.Op != OpZeroExt32to64 || x != mul_1_0.Args[0] { 14292 break 14293 } 14294 mul_1_1 := mul_1.Args[1] 14295 if mul_1_1.Op != OpConst64 || mul_1_1.AuxInt != 1 { 14296 break 14297 } 14298 v_1_1_0_1 := v_1_1_0.Args[1] 14299 if v_1_1_0_1.Op != OpConst64 { 14300 break 14301 } 14302 s := v_1_1_0_1.AuxInt 14303 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+(umagic(32, c).m+1)/2) && s == 32+umagic(32, c).s-2 && x.Op != OpConst32 && udivisibleOK(32, c)) { 14304 break 14305 } 14306 v.reset(OpLeq32U) 14307 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 14308 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 14309 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14310 v2.AuxInt = int64(int32(udivisible(32, c).m)) 14311 v1.AddArg(v2) 14312 v1.AddArg(x) 14313 v0.AddArg(v1) 14314 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14315 v3.AuxInt = int64(32 - udivisible(32, c).k) 14316 v0.AddArg(v3) 14317 v.AddArg(v0) 14318 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14319 v4.AuxInt = int64(int32(udivisible(32, c).max)) 14320 v.AddArg(v4) 14321 return true 14322 } 14323 return false 14324 } 14325 func rewriteValuegeneric_OpEq32_40(v *Value) bool { 14326 b := v.Block 14327 typ := &b.Func.Config.Types 14328 // match: (Eq32 x (Mul32 (Const32 [c]) (Trunc64to32 (Rsh64Ux64 mul:(Mul64 (Rsh64Ux64 (ZeroExt32to64 x) (Const64 [1])) (Const64 [m])) (Const64 [s]))))) 14329 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+(umagic(32,c).m+1)/2) && s == 32+umagic(32,c).s-2 && x.Op != OpConst32 && udivisibleOK(32,c) 14330 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 14331 for { 14332 _ = v.Args[1] 14333 x := v.Args[0] 14334 v_1 := v.Args[1] 14335 if v_1.Op != OpMul32 { 14336 break 14337 } 14338 _ = v_1.Args[1] 14339 v_1_0 := v_1.Args[0] 14340 if v_1_0.Op != OpConst32 { 14341 break 14342 } 14343 c := v_1_0.AuxInt 14344 v_1_1 := v_1.Args[1] 14345 if v_1_1.Op != OpTrunc64to32 { 14346 break 14347 } 14348 v_1_1_0 := v_1_1.Args[0] 14349 if v_1_1_0.Op != OpRsh64Ux64 { 14350 break 14351 } 14352 _ = v_1_1_0.Args[1] 14353 mul := v_1_1_0.Args[0] 14354 if mul.Op != OpMul64 { 14355 break 14356 } 14357 _ = mul.Args[1] 14358 mul_0 := mul.Args[0] 14359 if mul_0.Op != OpRsh64Ux64 { 14360 break 14361 } 14362 _ = mul_0.Args[1] 14363 mul_0_0 := mul_0.Args[0] 14364 if mul_0_0.Op != OpZeroExt32to64 || x != mul_0_0.Args[0] { 14365 break 14366 } 14367 mul_0_1 := mul_0.Args[1] 14368 if mul_0_1.Op != OpConst64 || mul_0_1.AuxInt != 1 { 14369 break 14370 } 14371 mul_1 := mul.Args[1] 14372 if mul_1.Op != OpConst64 { 14373 break 14374 } 14375 m := mul_1.AuxInt 14376 v_1_1_0_1 := v_1_1_0.Args[1] 14377 if v_1_1_0_1.Op != OpConst64 { 14378 break 14379 } 14380 s := v_1_1_0_1.AuxInt 14381 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+(umagic(32, c).m+1)/2) && s == 32+umagic(32, c).s-2 && x.Op != OpConst32 && udivisibleOK(32, c)) { 14382 break 14383 } 14384 v.reset(OpLeq32U) 14385 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 14386 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 14387 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14388 v2.AuxInt = int64(int32(udivisible(32, c).m)) 14389 v1.AddArg(v2) 14390 v1.AddArg(x) 14391 v0.AddArg(v1) 14392 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14393 v3.AuxInt = int64(32 - udivisible(32, c).k) 14394 v0.AddArg(v3) 14395 v.AddArg(v0) 14396 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14397 v4.AuxInt = int64(int32(udivisible(32, c).max)) 14398 v.AddArg(v4) 14399 return true 14400 } 14401 // match: (Eq32 x (Mul32 (Trunc64to32 (Rsh64Ux64 mul:(Mul64 (Const64 [m]) (Rsh64Ux64 (ZeroExt32to64 x) (Const64 [1]))) (Const64 [s]))) (Const32 [c]))) 14402 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+(umagic(32,c).m+1)/2) && s == 32+umagic(32,c).s-2 && x.Op != OpConst32 && udivisibleOK(32,c) 14403 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 14404 for { 14405 _ = v.Args[1] 14406 x := v.Args[0] 14407 v_1 := v.Args[1] 14408 if v_1.Op != OpMul32 { 14409 break 14410 } 14411 _ = v_1.Args[1] 14412 v_1_0 := v_1.Args[0] 14413 if v_1_0.Op != OpTrunc64to32 { 14414 break 14415 } 14416 v_1_0_0 := v_1_0.Args[0] 14417 if v_1_0_0.Op != OpRsh64Ux64 { 14418 break 14419 } 14420 _ = v_1_0_0.Args[1] 14421 mul := v_1_0_0.Args[0] 14422 if mul.Op != OpMul64 { 14423 break 14424 } 14425 _ = mul.Args[1] 14426 mul_0 := mul.Args[0] 14427 if mul_0.Op != OpConst64 { 14428 break 14429 } 14430 m := mul_0.AuxInt 14431 mul_1 := mul.Args[1] 14432 if mul_1.Op != OpRsh64Ux64 { 14433 break 14434 } 14435 _ = mul_1.Args[1] 14436 mul_1_0 := mul_1.Args[0] 14437 if mul_1_0.Op != OpZeroExt32to64 || x != mul_1_0.Args[0] { 14438 break 14439 } 14440 mul_1_1 := mul_1.Args[1] 14441 if mul_1_1.Op != OpConst64 || mul_1_1.AuxInt != 1 { 14442 break 14443 } 14444 v_1_0_0_1 := v_1_0_0.Args[1] 14445 if v_1_0_0_1.Op != OpConst64 { 14446 break 14447 } 14448 s := v_1_0_0_1.AuxInt 14449 v_1_1 := v_1.Args[1] 14450 if v_1_1.Op != OpConst32 { 14451 break 14452 } 14453 c := v_1_1.AuxInt 14454 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+(umagic(32, c).m+1)/2) && s == 32+umagic(32, c).s-2 && x.Op != OpConst32 && udivisibleOK(32, c)) { 14455 break 14456 } 14457 v.reset(OpLeq32U) 14458 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 14459 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 14460 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14461 v2.AuxInt = int64(int32(udivisible(32, c).m)) 14462 v1.AddArg(v2) 14463 v1.AddArg(x) 14464 v0.AddArg(v1) 14465 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14466 v3.AuxInt = int64(32 - udivisible(32, c).k) 14467 v0.AddArg(v3) 14468 v.AddArg(v0) 14469 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14470 v4.AuxInt = int64(int32(udivisible(32, c).max)) 14471 v.AddArg(v4) 14472 return true 14473 } 14474 // match: (Eq32 x (Mul32 (Trunc64to32 (Rsh64Ux64 mul:(Mul64 (Rsh64Ux64 (ZeroExt32to64 x) (Const64 [1])) (Const64 [m])) (Const64 [s]))) (Const32 [c]))) 14475 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+(umagic(32,c).m+1)/2) && s == 32+umagic(32,c).s-2 && x.Op != OpConst32 && udivisibleOK(32,c) 14476 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 14477 for { 14478 _ = v.Args[1] 14479 x := v.Args[0] 14480 v_1 := v.Args[1] 14481 if v_1.Op != OpMul32 { 14482 break 14483 } 14484 _ = v_1.Args[1] 14485 v_1_0 := v_1.Args[0] 14486 if v_1_0.Op != OpTrunc64to32 { 14487 break 14488 } 14489 v_1_0_0 := v_1_0.Args[0] 14490 if v_1_0_0.Op != OpRsh64Ux64 { 14491 break 14492 } 14493 _ = v_1_0_0.Args[1] 14494 mul := v_1_0_0.Args[0] 14495 if mul.Op != OpMul64 { 14496 break 14497 } 14498 _ = mul.Args[1] 14499 mul_0 := mul.Args[0] 14500 if mul_0.Op != OpRsh64Ux64 { 14501 break 14502 } 14503 _ = mul_0.Args[1] 14504 mul_0_0 := mul_0.Args[0] 14505 if mul_0_0.Op != OpZeroExt32to64 || x != mul_0_0.Args[0] { 14506 break 14507 } 14508 mul_0_1 := mul_0.Args[1] 14509 if mul_0_1.Op != OpConst64 || mul_0_1.AuxInt != 1 { 14510 break 14511 } 14512 mul_1 := mul.Args[1] 14513 if mul_1.Op != OpConst64 { 14514 break 14515 } 14516 m := mul_1.AuxInt 14517 v_1_0_0_1 := v_1_0_0.Args[1] 14518 if v_1_0_0_1.Op != OpConst64 { 14519 break 14520 } 14521 s := v_1_0_0_1.AuxInt 14522 v_1_1 := v_1.Args[1] 14523 if v_1_1.Op != OpConst32 { 14524 break 14525 } 14526 c := v_1_1.AuxInt 14527 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+(umagic(32, c).m+1)/2) && s == 32+umagic(32, c).s-2 && x.Op != OpConst32 && udivisibleOK(32, c)) { 14528 break 14529 } 14530 v.reset(OpLeq32U) 14531 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 14532 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 14533 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14534 v2.AuxInt = int64(int32(udivisible(32, c).m)) 14535 v1.AddArg(v2) 14536 v1.AddArg(x) 14537 v0.AddArg(v1) 14538 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14539 v3.AuxInt = int64(32 - udivisible(32, c).k) 14540 v0.AddArg(v3) 14541 v.AddArg(v0) 14542 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14543 v4.AuxInt = int64(int32(udivisible(32, c).max)) 14544 v.AddArg(v4) 14545 return true 14546 } 14547 // match: (Eq32 (Mul32 (Const32 [c]) (Trunc64to32 (Rsh64Ux64 mul:(Mul64 (Const64 [m]) (Rsh64Ux64 (ZeroExt32to64 x) (Const64 [1]))) (Const64 [s])))) x) 14548 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+(umagic(32,c).m+1)/2) && s == 32+umagic(32,c).s-2 && x.Op != OpConst32 && udivisibleOK(32,c) 14549 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 14550 for { 14551 x := v.Args[1] 14552 v_0 := v.Args[0] 14553 if v_0.Op != OpMul32 { 14554 break 14555 } 14556 _ = v_0.Args[1] 14557 v_0_0 := v_0.Args[0] 14558 if v_0_0.Op != OpConst32 { 14559 break 14560 } 14561 c := v_0_0.AuxInt 14562 v_0_1 := v_0.Args[1] 14563 if v_0_1.Op != OpTrunc64to32 { 14564 break 14565 } 14566 v_0_1_0 := v_0_1.Args[0] 14567 if v_0_1_0.Op != OpRsh64Ux64 { 14568 break 14569 } 14570 _ = v_0_1_0.Args[1] 14571 mul := v_0_1_0.Args[0] 14572 if mul.Op != OpMul64 { 14573 break 14574 } 14575 _ = mul.Args[1] 14576 mul_0 := mul.Args[0] 14577 if mul_0.Op != OpConst64 { 14578 break 14579 } 14580 m := mul_0.AuxInt 14581 mul_1 := mul.Args[1] 14582 if mul_1.Op != OpRsh64Ux64 { 14583 break 14584 } 14585 _ = mul_1.Args[1] 14586 mul_1_0 := mul_1.Args[0] 14587 if mul_1_0.Op != OpZeroExt32to64 || x != mul_1_0.Args[0] { 14588 break 14589 } 14590 mul_1_1 := mul_1.Args[1] 14591 if mul_1_1.Op != OpConst64 || mul_1_1.AuxInt != 1 { 14592 break 14593 } 14594 v_0_1_0_1 := v_0_1_0.Args[1] 14595 if v_0_1_0_1.Op != OpConst64 { 14596 break 14597 } 14598 s := v_0_1_0_1.AuxInt 14599 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+(umagic(32, c).m+1)/2) && s == 32+umagic(32, c).s-2 && x.Op != OpConst32 && udivisibleOK(32, c)) { 14600 break 14601 } 14602 v.reset(OpLeq32U) 14603 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 14604 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 14605 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14606 v2.AuxInt = int64(int32(udivisible(32, c).m)) 14607 v1.AddArg(v2) 14608 v1.AddArg(x) 14609 v0.AddArg(v1) 14610 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14611 v3.AuxInt = int64(32 - udivisible(32, c).k) 14612 v0.AddArg(v3) 14613 v.AddArg(v0) 14614 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14615 v4.AuxInt = int64(int32(udivisible(32, c).max)) 14616 v.AddArg(v4) 14617 return true 14618 } 14619 // match: (Eq32 (Mul32 (Const32 [c]) (Trunc64to32 (Rsh64Ux64 mul:(Mul64 (Rsh64Ux64 (ZeroExt32to64 x) (Const64 [1])) (Const64 [m])) (Const64 [s])))) x) 14620 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+(umagic(32,c).m+1)/2) && s == 32+umagic(32,c).s-2 && x.Op != OpConst32 && udivisibleOK(32,c) 14621 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 14622 for { 14623 x := v.Args[1] 14624 v_0 := v.Args[0] 14625 if v_0.Op != OpMul32 { 14626 break 14627 } 14628 _ = v_0.Args[1] 14629 v_0_0 := v_0.Args[0] 14630 if v_0_0.Op != OpConst32 { 14631 break 14632 } 14633 c := v_0_0.AuxInt 14634 v_0_1 := v_0.Args[1] 14635 if v_0_1.Op != OpTrunc64to32 { 14636 break 14637 } 14638 v_0_1_0 := v_0_1.Args[0] 14639 if v_0_1_0.Op != OpRsh64Ux64 { 14640 break 14641 } 14642 _ = v_0_1_0.Args[1] 14643 mul := v_0_1_0.Args[0] 14644 if mul.Op != OpMul64 { 14645 break 14646 } 14647 _ = mul.Args[1] 14648 mul_0 := mul.Args[0] 14649 if mul_0.Op != OpRsh64Ux64 { 14650 break 14651 } 14652 _ = mul_0.Args[1] 14653 mul_0_0 := mul_0.Args[0] 14654 if mul_0_0.Op != OpZeroExt32to64 || x != mul_0_0.Args[0] { 14655 break 14656 } 14657 mul_0_1 := mul_0.Args[1] 14658 if mul_0_1.Op != OpConst64 || mul_0_1.AuxInt != 1 { 14659 break 14660 } 14661 mul_1 := mul.Args[1] 14662 if mul_1.Op != OpConst64 { 14663 break 14664 } 14665 m := mul_1.AuxInt 14666 v_0_1_0_1 := v_0_1_0.Args[1] 14667 if v_0_1_0_1.Op != OpConst64 { 14668 break 14669 } 14670 s := v_0_1_0_1.AuxInt 14671 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+(umagic(32, c).m+1)/2) && s == 32+umagic(32, c).s-2 && x.Op != OpConst32 && udivisibleOK(32, c)) { 14672 break 14673 } 14674 v.reset(OpLeq32U) 14675 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 14676 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 14677 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14678 v2.AuxInt = int64(int32(udivisible(32, c).m)) 14679 v1.AddArg(v2) 14680 v1.AddArg(x) 14681 v0.AddArg(v1) 14682 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14683 v3.AuxInt = int64(32 - udivisible(32, c).k) 14684 v0.AddArg(v3) 14685 v.AddArg(v0) 14686 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14687 v4.AuxInt = int64(int32(udivisible(32, c).max)) 14688 v.AddArg(v4) 14689 return true 14690 } 14691 // match: (Eq32 (Mul32 (Trunc64to32 (Rsh64Ux64 mul:(Mul64 (Const64 [m]) (Rsh64Ux64 (ZeroExt32to64 x) (Const64 [1]))) (Const64 [s]))) (Const32 [c])) x) 14692 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+(umagic(32,c).m+1)/2) && s == 32+umagic(32,c).s-2 && x.Op != OpConst32 && udivisibleOK(32,c) 14693 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 14694 for { 14695 x := v.Args[1] 14696 v_0 := v.Args[0] 14697 if v_0.Op != OpMul32 { 14698 break 14699 } 14700 _ = v_0.Args[1] 14701 v_0_0 := v_0.Args[0] 14702 if v_0_0.Op != OpTrunc64to32 { 14703 break 14704 } 14705 v_0_0_0 := v_0_0.Args[0] 14706 if v_0_0_0.Op != OpRsh64Ux64 { 14707 break 14708 } 14709 _ = v_0_0_0.Args[1] 14710 mul := v_0_0_0.Args[0] 14711 if mul.Op != OpMul64 { 14712 break 14713 } 14714 _ = mul.Args[1] 14715 mul_0 := mul.Args[0] 14716 if mul_0.Op != OpConst64 { 14717 break 14718 } 14719 m := mul_0.AuxInt 14720 mul_1 := mul.Args[1] 14721 if mul_1.Op != OpRsh64Ux64 { 14722 break 14723 } 14724 _ = mul_1.Args[1] 14725 mul_1_0 := mul_1.Args[0] 14726 if mul_1_0.Op != OpZeroExt32to64 || x != mul_1_0.Args[0] { 14727 break 14728 } 14729 mul_1_1 := mul_1.Args[1] 14730 if mul_1_1.Op != OpConst64 || mul_1_1.AuxInt != 1 { 14731 break 14732 } 14733 v_0_0_0_1 := v_0_0_0.Args[1] 14734 if v_0_0_0_1.Op != OpConst64 { 14735 break 14736 } 14737 s := v_0_0_0_1.AuxInt 14738 v_0_1 := v_0.Args[1] 14739 if v_0_1.Op != OpConst32 { 14740 break 14741 } 14742 c := v_0_1.AuxInt 14743 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+(umagic(32, c).m+1)/2) && s == 32+umagic(32, c).s-2 && x.Op != OpConst32 && udivisibleOK(32, c)) { 14744 break 14745 } 14746 v.reset(OpLeq32U) 14747 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 14748 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 14749 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14750 v2.AuxInt = int64(int32(udivisible(32, c).m)) 14751 v1.AddArg(v2) 14752 v1.AddArg(x) 14753 v0.AddArg(v1) 14754 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14755 v3.AuxInt = int64(32 - udivisible(32, c).k) 14756 v0.AddArg(v3) 14757 v.AddArg(v0) 14758 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14759 v4.AuxInt = int64(int32(udivisible(32, c).max)) 14760 v.AddArg(v4) 14761 return true 14762 } 14763 // match: (Eq32 (Mul32 (Trunc64to32 (Rsh64Ux64 mul:(Mul64 (Rsh64Ux64 (ZeroExt32to64 x) (Const64 [1])) (Const64 [m])) (Const64 [s]))) (Const32 [c])) x) 14764 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+(umagic(32,c).m+1)/2) && s == 32+umagic(32,c).s-2 && x.Op != OpConst32 && udivisibleOK(32,c) 14765 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 14766 for { 14767 x := v.Args[1] 14768 v_0 := v.Args[0] 14769 if v_0.Op != OpMul32 { 14770 break 14771 } 14772 _ = v_0.Args[1] 14773 v_0_0 := v_0.Args[0] 14774 if v_0_0.Op != OpTrunc64to32 { 14775 break 14776 } 14777 v_0_0_0 := v_0_0.Args[0] 14778 if v_0_0_0.Op != OpRsh64Ux64 { 14779 break 14780 } 14781 _ = v_0_0_0.Args[1] 14782 mul := v_0_0_0.Args[0] 14783 if mul.Op != OpMul64 { 14784 break 14785 } 14786 _ = mul.Args[1] 14787 mul_0 := mul.Args[0] 14788 if mul_0.Op != OpRsh64Ux64 { 14789 break 14790 } 14791 _ = mul_0.Args[1] 14792 mul_0_0 := mul_0.Args[0] 14793 if mul_0_0.Op != OpZeroExt32to64 || x != mul_0_0.Args[0] { 14794 break 14795 } 14796 mul_0_1 := mul_0.Args[1] 14797 if mul_0_1.Op != OpConst64 || mul_0_1.AuxInt != 1 { 14798 break 14799 } 14800 mul_1 := mul.Args[1] 14801 if mul_1.Op != OpConst64 { 14802 break 14803 } 14804 m := mul_1.AuxInt 14805 v_0_0_0_1 := v_0_0_0.Args[1] 14806 if v_0_0_0_1.Op != OpConst64 { 14807 break 14808 } 14809 s := v_0_0_0_1.AuxInt 14810 v_0_1 := v_0.Args[1] 14811 if v_0_1.Op != OpConst32 { 14812 break 14813 } 14814 c := v_0_1.AuxInt 14815 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+(umagic(32, c).m+1)/2) && s == 32+umagic(32, c).s-2 && x.Op != OpConst32 && udivisibleOK(32, c)) { 14816 break 14817 } 14818 v.reset(OpLeq32U) 14819 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 14820 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 14821 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14822 v2.AuxInt = int64(int32(udivisible(32, c).m)) 14823 v1.AddArg(v2) 14824 v1.AddArg(x) 14825 v0.AddArg(v1) 14826 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14827 v3.AuxInt = int64(32 - udivisible(32, c).k) 14828 v0.AddArg(v3) 14829 v.AddArg(v0) 14830 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14831 v4.AuxInt = int64(int32(udivisible(32, c).max)) 14832 v.AddArg(v4) 14833 return true 14834 } 14835 // match: (Eq32 x (Mul32 (Const32 [c]) (Trunc64to32 (Rsh64Ux64 (Avg64u (Lsh64x64 (ZeroExt32to64 x) (Const64 [32])) mul:(Mul64 (Const64 [m]) (ZeroExt32to64 x))) (Const64 [s]))))) 14836 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(32,c).m) && s == 32+umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 14837 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 14838 for { 14839 _ = v.Args[1] 14840 x := v.Args[0] 14841 v_1 := v.Args[1] 14842 if v_1.Op != OpMul32 { 14843 break 14844 } 14845 _ = v_1.Args[1] 14846 v_1_0 := v_1.Args[0] 14847 if v_1_0.Op != OpConst32 { 14848 break 14849 } 14850 c := v_1_0.AuxInt 14851 v_1_1 := v_1.Args[1] 14852 if v_1_1.Op != OpTrunc64to32 { 14853 break 14854 } 14855 v_1_1_0 := v_1_1.Args[0] 14856 if v_1_1_0.Op != OpRsh64Ux64 { 14857 break 14858 } 14859 _ = v_1_1_0.Args[1] 14860 v_1_1_0_0 := v_1_1_0.Args[0] 14861 if v_1_1_0_0.Op != OpAvg64u { 14862 break 14863 } 14864 _ = v_1_1_0_0.Args[1] 14865 v_1_1_0_0_0 := v_1_1_0_0.Args[0] 14866 if v_1_1_0_0_0.Op != OpLsh64x64 { 14867 break 14868 } 14869 _ = v_1_1_0_0_0.Args[1] 14870 v_1_1_0_0_0_0 := v_1_1_0_0_0.Args[0] 14871 if v_1_1_0_0_0_0.Op != OpZeroExt32to64 || x != v_1_1_0_0_0_0.Args[0] { 14872 break 14873 } 14874 v_1_1_0_0_0_1 := v_1_1_0_0_0.Args[1] 14875 if v_1_1_0_0_0_1.Op != OpConst64 || v_1_1_0_0_0_1.AuxInt != 32 { 14876 break 14877 } 14878 mul := v_1_1_0_0.Args[1] 14879 if mul.Op != OpMul64 { 14880 break 14881 } 14882 _ = mul.Args[1] 14883 mul_0 := mul.Args[0] 14884 if mul_0.Op != OpConst64 { 14885 break 14886 } 14887 m := mul_0.AuxInt 14888 mul_1 := mul.Args[1] 14889 if mul_1.Op != OpZeroExt32to64 || x != mul_1.Args[0] { 14890 break 14891 } 14892 v_1_1_0_1 := v_1_1_0.Args[1] 14893 if v_1_1_0_1.Op != OpConst64 { 14894 break 14895 } 14896 s := v_1_1_0_1.AuxInt 14897 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(32, c).m) && s == 32+umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 14898 break 14899 } 14900 v.reset(OpLeq32U) 14901 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 14902 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 14903 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14904 v2.AuxInt = int64(int32(udivisible(32, c).m)) 14905 v1.AddArg(v2) 14906 v1.AddArg(x) 14907 v0.AddArg(v1) 14908 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14909 v3.AuxInt = int64(32 - udivisible(32, c).k) 14910 v0.AddArg(v3) 14911 v.AddArg(v0) 14912 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14913 v4.AuxInt = int64(int32(udivisible(32, c).max)) 14914 v.AddArg(v4) 14915 return true 14916 } 14917 // match: (Eq32 x (Mul32 (Const32 [c]) (Trunc64to32 (Rsh64Ux64 (Avg64u (Lsh64x64 (ZeroExt32to64 x) (Const64 [32])) mul:(Mul64 (ZeroExt32to64 x) (Const64 [m]))) (Const64 [s]))))) 14918 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(32,c).m) && s == 32+umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 14919 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 14920 for { 14921 _ = v.Args[1] 14922 x := v.Args[0] 14923 v_1 := v.Args[1] 14924 if v_1.Op != OpMul32 { 14925 break 14926 } 14927 _ = v_1.Args[1] 14928 v_1_0 := v_1.Args[0] 14929 if v_1_0.Op != OpConst32 { 14930 break 14931 } 14932 c := v_1_0.AuxInt 14933 v_1_1 := v_1.Args[1] 14934 if v_1_1.Op != OpTrunc64to32 { 14935 break 14936 } 14937 v_1_1_0 := v_1_1.Args[0] 14938 if v_1_1_0.Op != OpRsh64Ux64 { 14939 break 14940 } 14941 _ = v_1_1_0.Args[1] 14942 v_1_1_0_0 := v_1_1_0.Args[0] 14943 if v_1_1_0_0.Op != OpAvg64u { 14944 break 14945 } 14946 _ = v_1_1_0_0.Args[1] 14947 v_1_1_0_0_0 := v_1_1_0_0.Args[0] 14948 if v_1_1_0_0_0.Op != OpLsh64x64 { 14949 break 14950 } 14951 _ = v_1_1_0_0_0.Args[1] 14952 v_1_1_0_0_0_0 := v_1_1_0_0_0.Args[0] 14953 if v_1_1_0_0_0_0.Op != OpZeroExt32to64 || x != v_1_1_0_0_0_0.Args[0] { 14954 break 14955 } 14956 v_1_1_0_0_0_1 := v_1_1_0_0_0.Args[1] 14957 if v_1_1_0_0_0_1.Op != OpConst64 || v_1_1_0_0_0_1.AuxInt != 32 { 14958 break 14959 } 14960 mul := v_1_1_0_0.Args[1] 14961 if mul.Op != OpMul64 { 14962 break 14963 } 14964 _ = mul.Args[1] 14965 mul_0 := mul.Args[0] 14966 if mul_0.Op != OpZeroExt32to64 || x != mul_0.Args[0] { 14967 break 14968 } 14969 mul_1 := mul.Args[1] 14970 if mul_1.Op != OpConst64 { 14971 break 14972 } 14973 m := mul_1.AuxInt 14974 v_1_1_0_1 := v_1_1_0.Args[1] 14975 if v_1_1_0_1.Op != OpConst64 { 14976 break 14977 } 14978 s := v_1_1_0_1.AuxInt 14979 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(32, c).m) && s == 32+umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 14980 break 14981 } 14982 v.reset(OpLeq32U) 14983 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 14984 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 14985 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14986 v2.AuxInt = int64(int32(udivisible(32, c).m)) 14987 v1.AddArg(v2) 14988 v1.AddArg(x) 14989 v0.AddArg(v1) 14990 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14991 v3.AuxInt = int64(32 - udivisible(32, c).k) 14992 v0.AddArg(v3) 14993 v.AddArg(v0) 14994 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 14995 v4.AuxInt = int64(int32(udivisible(32, c).max)) 14996 v.AddArg(v4) 14997 return true 14998 } 14999 // match: (Eq32 x (Mul32 (Trunc64to32 (Rsh64Ux64 (Avg64u (Lsh64x64 (ZeroExt32to64 x) (Const64 [32])) mul:(Mul64 (Const64 [m]) (ZeroExt32to64 x))) (Const64 [s]))) (Const32 [c]))) 15000 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(32,c).m) && s == 32+umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 15001 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 15002 for { 15003 _ = v.Args[1] 15004 x := v.Args[0] 15005 v_1 := v.Args[1] 15006 if v_1.Op != OpMul32 { 15007 break 15008 } 15009 _ = v_1.Args[1] 15010 v_1_0 := v_1.Args[0] 15011 if v_1_0.Op != OpTrunc64to32 { 15012 break 15013 } 15014 v_1_0_0 := v_1_0.Args[0] 15015 if v_1_0_0.Op != OpRsh64Ux64 { 15016 break 15017 } 15018 _ = v_1_0_0.Args[1] 15019 v_1_0_0_0 := v_1_0_0.Args[0] 15020 if v_1_0_0_0.Op != OpAvg64u { 15021 break 15022 } 15023 _ = v_1_0_0_0.Args[1] 15024 v_1_0_0_0_0 := v_1_0_0_0.Args[0] 15025 if v_1_0_0_0_0.Op != OpLsh64x64 { 15026 break 15027 } 15028 _ = v_1_0_0_0_0.Args[1] 15029 v_1_0_0_0_0_0 := v_1_0_0_0_0.Args[0] 15030 if v_1_0_0_0_0_0.Op != OpZeroExt32to64 || x != v_1_0_0_0_0_0.Args[0] { 15031 break 15032 } 15033 v_1_0_0_0_0_1 := v_1_0_0_0_0.Args[1] 15034 if v_1_0_0_0_0_1.Op != OpConst64 || v_1_0_0_0_0_1.AuxInt != 32 { 15035 break 15036 } 15037 mul := v_1_0_0_0.Args[1] 15038 if mul.Op != OpMul64 { 15039 break 15040 } 15041 _ = mul.Args[1] 15042 mul_0 := mul.Args[0] 15043 if mul_0.Op != OpConst64 { 15044 break 15045 } 15046 m := mul_0.AuxInt 15047 mul_1 := mul.Args[1] 15048 if mul_1.Op != OpZeroExt32to64 || x != mul_1.Args[0] { 15049 break 15050 } 15051 v_1_0_0_1 := v_1_0_0.Args[1] 15052 if v_1_0_0_1.Op != OpConst64 { 15053 break 15054 } 15055 s := v_1_0_0_1.AuxInt 15056 v_1_1 := v_1.Args[1] 15057 if v_1_1.Op != OpConst32 { 15058 break 15059 } 15060 c := v_1_1.AuxInt 15061 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(32, c).m) && s == 32+umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 15062 break 15063 } 15064 v.reset(OpLeq32U) 15065 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 15066 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 15067 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15068 v2.AuxInt = int64(int32(udivisible(32, c).m)) 15069 v1.AddArg(v2) 15070 v1.AddArg(x) 15071 v0.AddArg(v1) 15072 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15073 v3.AuxInt = int64(32 - udivisible(32, c).k) 15074 v0.AddArg(v3) 15075 v.AddArg(v0) 15076 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15077 v4.AuxInt = int64(int32(udivisible(32, c).max)) 15078 v.AddArg(v4) 15079 return true 15080 } 15081 return false 15082 } 15083 func rewriteValuegeneric_OpEq32_50(v *Value) bool { 15084 b := v.Block 15085 typ := &b.Func.Config.Types 15086 // match: (Eq32 x (Mul32 (Trunc64to32 (Rsh64Ux64 (Avg64u (Lsh64x64 (ZeroExt32to64 x) (Const64 [32])) mul:(Mul64 (ZeroExt32to64 x) (Const64 [m]))) (Const64 [s]))) (Const32 [c]))) 15087 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(32,c).m) && s == 32+umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 15088 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 15089 for { 15090 _ = v.Args[1] 15091 x := v.Args[0] 15092 v_1 := v.Args[1] 15093 if v_1.Op != OpMul32 { 15094 break 15095 } 15096 _ = v_1.Args[1] 15097 v_1_0 := v_1.Args[0] 15098 if v_1_0.Op != OpTrunc64to32 { 15099 break 15100 } 15101 v_1_0_0 := v_1_0.Args[0] 15102 if v_1_0_0.Op != OpRsh64Ux64 { 15103 break 15104 } 15105 _ = v_1_0_0.Args[1] 15106 v_1_0_0_0 := v_1_0_0.Args[0] 15107 if v_1_0_0_0.Op != OpAvg64u { 15108 break 15109 } 15110 _ = v_1_0_0_0.Args[1] 15111 v_1_0_0_0_0 := v_1_0_0_0.Args[0] 15112 if v_1_0_0_0_0.Op != OpLsh64x64 { 15113 break 15114 } 15115 _ = v_1_0_0_0_0.Args[1] 15116 v_1_0_0_0_0_0 := v_1_0_0_0_0.Args[0] 15117 if v_1_0_0_0_0_0.Op != OpZeroExt32to64 || x != v_1_0_0_0_0_0.Args[0] { 15118 break 15119 } 15120 v_1_0_0_0_0_1 := v_1_0_0_0_0.Args[1] 15121 if v_1_0_0_0_0_1.Op != OpConst64 || v_1_0_0_0_0_1.AuxInt != 32 { 15122 break 15123 } 15124 mul := v_1_0_0_0.Args[1] 15125 if mul.Op != OpMul64 { 15126 break 15127 } 15128 _ = mul.Args[1] 15129 mul_0 := mul.Args[0] 15130 if mul_0.Op != OpZeroExt32to64 || x != mul_0.Args[0] { 15131 break 15132 } 15133 mul_1 := mul.Args[1] 15134 if mul_1.Op != OpConst64 { 15135 break 15136 } 15137 m := mul_1.AuxInt 15138 v_1_0_0_1 := v_1_0_0.Args[1] 15139 if v_1_0_0_1.Op != OpConst64 { 15140 break 15141 } 15142 s := v_1_0_0_1.AuxInt 15143 v_1_1 := v_1.Args[1] 15144 if v_1_1.Op != OpConst32 { 15145 break 15146 } 15147 c := v_1_1.AuxInt 15148 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(32, c).m) && s == 32+umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 15149 break 15150 } 15151 v.reset(OpLeq32U) 15152 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 15153 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 15154 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15155 v2.AuxInt = int64(int32(udivisible(32, c).m)) 15156 v1.AddArg(v2) 15157 v1.AddArg(x) 15158 v0.AddArg(v1) 15159 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15160 v3.AuxInt = int64(32 - udivisible(32, c).k) 15161 v0.AddArg(v3) 15162 v.AddArg(v0) 15163 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15164 v4.AuxInt = int64(int32(udivisible(32, c).max)) 15165 v.AddArg(v4) 15166 return true 15167 } 15168 // match: (Eq32 (Mul32 (Const32 [c]) (Trunc64to32 (Rsh64Ux64 (Avg64u (Lsh64x64 (ZeroExt32to64 x) (Const64 [32])) mul:(Mul64 (Const64 [m]) (ZeroExt32to64 x))) (Const64 [s])))) x) 15169 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(32,c).m) && s == 32+umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 15170 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 15171 for { 15172 x := v.Args[1] 15173 v_0 := v.Args[0] 15174 if v_0.Op != OpMul32 { 15175 break 15176 } 15177 _ = v_0.Args[1] 15178 v_0_0 := v_0.Args[0] 15179 if v_0_0.Op != OpConst32 { 15180 break 15181 } 15182 c := v_0_0.AuxInt 15183 v_0_1 := v_0.Args[1] 15184 if v_0_1.Op != OpTrunc64to32 { 15185 break 15186 } 15187 v_0_1_0 := v_0_1.Args[0] 15188 if v_0_1_0.Op != OpRsh64Ux64 { 15189 break 15190 } 15191 _ = v_0_1_0.Args[1] 15192 v_0_1_0_0 := v_0_1_0.Args[0] 15193 if v_0_1_0_0.Op != OpAvg64u { 15194 break 15195 } 15196 _ = v_0_1_0_0.Args[1] 15197 v_0_1_0_0_0 := v_0_1_0_0.Args[0] 15198 if v_0_1_0_0_0.Op != OpLsh64x64 { 15199 break 15200 } 15201 _ = v_0_1_0_0_0.Args[1] 15202 v_0_1_0_0_0_0 := v_0_1_0_0_0.Args[0] 15203 if v_0_1_0_0_0_0.Op != OpZeroExt32to64 || x != v_0_1_0_0_0_0.Args[0] { 15204 break 15205 } 15206 v_0_1_0_0_0_1 := v_0_1_0_0_0.Args[1] 15207 if v_0_1_0_0_0_1.Op != OpConst64 || v_0_1_0_0_0_1.AuxInt != 32 { 15208 break 15209 } 15210 mul := v_0_1_0_0.Args[1] 15211 if mul.Op != OpMul64 { 15212 break 15213 } 15214 _ = mul.Args[1] 15215 mul_0 := mul.Args[0] 15216 if mul_0.Op != OpConst64 { 15217 break 15218 } 15219 m := mul_0.AuxInt 15220 mul_1 := mul.Args[1] 15221 if mul_1.Op != OpZeroExt32to64 || x != mul_1.Args[0] { 15222 break 15223 } 15224 v_0_1_0_1 := v_0_1_0.Args[1] 15225 if v_0_1_0_1.Op != OpConst64 { 15226 break 15227 } 15228 s := v_0_1_0_1.AuxInt 15229 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(32, c).m) && s == 32+umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 15230 break 15231 } 15232 v.reset(OpLeq32U) 15233 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 15234 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 15235 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15236 v2.AuxInt = int64(int32(udivisible(32, c).m)) 15237 v1.AddArg(v2) 15238 v1.AddArg(x) 15239 v0.AddArg(v1) 15240 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15241 v3.AuxInt = int64(32 - udivisible(32, c).k) 15242 v0.AddArg(v3) 15243 v.AddArg(v0) 15244 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15245 v4.AuxInt = int64(int32(udivisible(32, c).max)) 15246 v.AddArg(v4) 15247 return true 15248 } 15249 // match: (Eq32 (Mul32 (Const32 [c]) (Trunc64to32 (Rsh64Ux64 (Avg64u (Lsh64x64 (ZeroExt32to64 x) (Const64 [32])) mul:(Mul64 (ZeroExt32to64 x) (Const64 [m]))) (Const64 [s])))) x) 15250 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(32,c).m) && s == 32+umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 15251 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 15252 for { 15253 x := v.Args[1] 15254 v_0 := v.Args[0] 15255 if v_0.Op != OpMul32 { 15256 break 15257 } 15258 _ = v_0.Args[1] 15259 v_0_0 := v_0.Args[0] 15260 if v_0_0.Op != OpConst32 { 15261 break 15262 } 15263 c := v_0_0.AuxInt 15264 v_0_1 := v_0.Args[1] 15265 if v_0_1.Op != OpTrunc64to32 { 15266 break 15267 } 15268 v_0_1_0 := v_0_1.Args[0] 15269 if v_0_1_0.Op != OpRsh64Ux64 { 15270 break 15271 } 15272 _ = v_0_1_0.Args[1] 15273 v_0_1_0_0 := v_0_1_0.Args[0] 15274 if v_0_1_0_0.Op != OpAvg64u { 15275 break 15276 } 15277 _ = v_0_1_0_0.Args[1] 15278 v_0_1_0_0_0 := v_0_1_0_0.Args[0] 15279 if v_0_1_0_0_0.Op != OpLsh64x64 { 15280 break 15281 } 15282 _ = v_0_1_0_0_0.Args[1] 15283 v_0_1_0_0_0_0 := v_0_1_0_0_0.Args[0] 15284 if v_0_1_0_0_0_0.Op != OpZeroExt32to64 || x != v_0_1_0_0_0_0.Args[0] { 15285 break 15286 } 15287 v_0_1_0_0_0_1 := v_0_1_0_0_0.Args[1] 15288 if v_0_1_0_0_0_1.Op != OpConst64 || v_0_1_0_0_0_1.AuxInt != 32 { 15289 break 15290 } 15291 mul := v_0_1_0_0.Args[1] 15292 if mul.Op != OpMul64 { 15293 break 15294 } 15295 _ = mul.Args[1] 15296 mul_0 := mul.Args[0] 15297 if mul_0.Op != OpZeroExt32to64 || x != mul_0.Args[0] { 15298 break 15299 } 15300 mul_1 := mul.Args[1] 15301 if mul_1.Op != OpConst64 { 15302 break 15303 } 15304 m := mul_1.AuxInt 15305 v_0_1_0_1 := v_0_1_0.Args[1] 15306 if v_0_1_0_1.Op != OpConst64 { 15307 break 15308 } 15309 s := v_0_1_0_1.AuxInt 15310 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(32, c).m) && s == 32+umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 15311 break 15312 } 15313 v.reset(OpLeq32U) 15314 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 15315 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 15316 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15317 v2.AuxInt = int64(int32(udivisible(32, c).m)) 15318 v1.AddArg(v2) 15319 v1.AddArg(x) 15320 v0.AddArg(v1) 15321 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15322 v3.AuxInt = int64(32 - udivisible(32, c).k) 15323 v0.AddArg(v3) 15324 v.AddArg(v0) 15325 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15326 v4.AuxInt = int64(int32(udivisible(32, c).max)) 15327 v.AddArg(v4) 15328 return true 15329 } 15330 // match: (Eq32 (Mul32 (Trunc64to32 (Rsh64Ux64 (Avg64u (Lsh64x64 (ZeroExt32to64 x) (Const64 [32])) mul:(Mul64 (Const64 [m]) (ZeroExt32to64 x))) (Const64 [s]))) (Const32 [c])) x) 15331 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(32,c).m) && s == 32+umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 15332 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 15333 for { 15334 x := v.Args[1] 15335 v_0 := v.Args[0] 15336 if v_0.Op != OpMul32 { 15337 break 15338 } 15339 _ = v_0.Args[1] 15340 v_0_0 := v_0.Args[0] 15341 if v_0_0.Op != OpTrunc64to32 { 15342 break 15343 } 15344 v_0_0_0 := v_0_0.Args[0] 15345 if v_0_0_0.Op != OpRsh64Ux64 { 15346 break 15347 } 15348 _ = v_0_0_0.Args[1] 15349 v_0_0_0_0 := v_0_0_0.Args[0] 15350 if v_0_0_0_0.Op != OpAvg64u { 15351 break 15352 } 15353 _ = v_0_0_0_0.Args[1] 15354 v_0_0_0_0_0 := v_0_0_0_0.Args[0] 15355 if v_0_0_0_0_0.Op != OpLsh64x64 { 15356 break 15357 } 15358 _ = v_0_0_0_0_0.Args[1] 15359 v_0_0_0_0_0_0 := v_0_0_0_0_0.Args[0] 15360 if v_0_0_0_0_0_0.Op != OpZeroExt32to64 || x != v_0_0_0_0_0_0.Args[0] { 15361 break 15362 } 15363 v_0_0_0_0_0_1 := v_0_0_0_0_0.Args[1] 15364 if v_0_0_0_0_0_1.Op != OpConst64 || v_0_0_0_0_0_1.AuxInt != 32 { 15365 break 15366 } 15367 mul := v_0_0_0_0.Args[1] 15368 if mul.Op != OpMul64 { 15369 break 15370 } 15371 _ = mul.Args[1] 15372 mul_0 := mul.Args[0] 15373 if mul_0.Op != OpConst64 { 15374 break 15375 } 15376 m := mul_0.AuxInt 15377 mul_1 := mul.Args[1] 15378 if mul_1.Op != OpZeroExt32to64 || x != mul_1.Args[0] { 15379 break 15380 } 15381 v_0_0_0_1 := v_0_0_0.Args[1] 15382 if v_0_0_0_1.Op != OpConst64 { 15383 break 15384 } 15385 s := v_0_0_0_1.AuxInt 15386 v_0_1 := v_0.Args[1] 15387 if v_0_1.Op != OpConst32 { 15388 break 15389 } 15390 c := v_0_1.AuxInt 15391 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(32, c).m) && s == 32+umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 15392 break 15393 } 15394 v.reset(OpLeq32U) 15395 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 15396 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 15397 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15398 v2.AuxInt = int64(int32(udivisible(32, c).m)) 15399 v1.AddArg(v2) 15400 v1.AddArg(x) 15401 v0.AddArg(v1) 15402 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15403 v3.AuxInt = int64(32 - udivisible(32, c).k) 15404 v0.AddArg(v3) 15405 v.AddArg(v0) 15406 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15407 v4.AuxInt = int64(int32(udivisible(32, c).max)) 15408 v.AddArg(v4) 15409 return true 15410 } 15411 // match: (Eq32 (Mul32 (Trunc64to32 (Rsh64Ux64 (Avg64u (Lsh64x64 (ZeroExt32to64 x) (Const64 [32])) mul:(Mul64 (ZeroExt32to64 x) (Const64 [m]))) (Const64 [s]))) (Const32 [c])) x) 15412 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(32,c).m) && s == 32+umagic(32,c).s-1 && x.Op != OpConst32 && udivisibleOK(32,c) 15413 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(32-udivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(udivisible(32,c).max))]) ) 15414 for { 15415 x := v.Args[1] 15416 v_0 := v.Args[0] 15417 if v_0.Op != OpMul32 { 15418 break 15419 } 15420 _ = v_0.Args[1] 15421 v_0_0 := v_0.Args[0] 15422 if v_0_0.Op != OpTrunc64to32 { 15423 break 15424 } 15425 v_0_0_0 := v_0_0.Args[0] 15426 if v_0_0_0.Op != OpRsh64Ux64 { 15427 break 15428 } 15429 _ = v_0_0_0.Args[1] 15430 v_0_0_0_0 := v_0_0_0.Args[0] 15431 if v_0_0_0_0.Op != OpAvg64u { 15432 break 15433 } 15434 _ = v_0_0_0_0.Args[1] 15435 v_0_0_0_0_0 := v_0_0_0_0.Args[0] 15436 if v_0_0_0_0_0.Op != OpLsh64x64 { 15437 break 15438 } 15439 _ = v_0_0_0_0_0.Args[1] 15440 v_0_0_0_0_0_0 := v_0_0_0_0_0.Args[0] 15441 if v_0_0_0_0_0_0.Op != OpZeroExt32to64 || x != v_0_0_0_0_0_0.Args[0] { 15442 break 15443 } 15444 v_0_0_0_0_0_1 := v_0_0_0_0_0.Args[1] 15445 if v_0_0_0_0_0_1.Op != OpConst64 || v_0_0_0_0_0_1.AuxInt != 32 { 15446 break 15447 } 15448 mul := v_0_0_0_0.Args[1] 15449 if mul.Op != OpMul64 { 15450 break 15451 } 15452 _ = mul.Args[1] 15453 mul_0 := mul.Args[0] 15454 if mul_0.Op != OpZeroExt32to64 || x != mul_0.Args[0] { 15455 break 15456 } 15457 mul_1 := mul.Args[1] 15458 if mul_1.Op != OpConst64 { 15459 break 15460 } 15461 m := mul_1.AuxInt 15462 v_0_0_0_1 := v_0_0_0.Args[1] 15463 if v_0_0_0_1.Op != OpConst64 { 15464 break 15465 } 15466 s := v_0_0_0_1.AuxInt 15467 v_0_1 := v_0.Args[1] 15468 if v_0_1.Op != OpConst32 { 15469 break 15470 } 15471 c := v_0_1.AuxInt 15472 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(32, c).m) && s == 32+umagic(32, c).s-1 && x.Op != OpConst32 && udivisibleOK(32, c)) { 15473 break 15474 } 15475 v.reset(OpLeq32U) 15476 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 15477 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 15478 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15479 v2.AuxInt = int64(int32(udivisible(32, c).m)) 15480 v1.AddArg(v2) 15481 v1.AddArg(x) 15482 v0.AddArg(v1) 15483 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15484 v3.AuxInt = int64(32 - udivisible(32, c).k) 15485 v0.AddArg(v3) 15486 v.AddArg(v0) 15487 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15488 v4.AuxInt = int64(int32(udivisible(32, c).max)) 15489 v.AddArg(v4) 15490 return true 15491 } 15492 // match: (Eq32 x (Mul32 (Const32 [c]) (Sub32 (Rsh64x64 mul:(Mul64 (Const64 [m]) (SignExt32to64 x)) (Const64 [s])) (Rsh64x64 (SignExt32to64 x) (Const64 [63]))))) 15493 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(32,c).m) && s == 32+smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 15494 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 15495 for { 15496 _ = v.Args[1] 15497 x := v.Args[0] 15498 v_1 := v.Args[1] 15499 if v_1.Op != OpMul32 { 15500 break 15501 } 15502 _ = v_1.Args[1] 15503 v_1_0 := v_1.Args[0] 15504 if v_1_0.Op != OpConst32 { 15505 break 15506 } 15507 c := v_1_0.AuxInt 15508 v_1_1 := v_1.Args[1] 15509 if v_1_1.Op != OpSub32 { 15510 break 15511 } 15512 _ = v_1_1.Args[1] 15513 v_1_1_0 := v_1_1.Args[0] 15514 if v_1_1_0.Op != OpRsh64x64 { 15515 break 15516 } 15517 _ = v_1_1_0.Args[1] 15518 mul := v_1_1_0.Args[0] 15519 if mul.Op != OpMul64 { 15520 break 15521 } 15522 _ = mul.Args[1] 15523 mul_0 := mul.Args[0] 15524 if mul_0.Op != OpConst64 { 15525 break 15526 } 15527 m := mul_0.AuxInt 15528 mul_1 := mul.Args[1] 15529 if mul_1.Op != OpSignExt32to64 || x != mul_1.Args[0] { 15530 break 15531 } 15532 v_1_1_0_1 := v_1_1_0.Args[1] 15533 if v_1_1_0_1.Op != OpConst64 { 15534 break 15535 } 15536 s := v_1_1_0_1.AuxInt 15537 v_1_1_1 := v_1_1.Args[1] 15538 if v_1_1_1.Op != OpRsh64x64 { 15539 break 15540 } 15541 _ = v_1_1_1.Args[1] 15542 v_1_1_1_0 := v_1_1_1.Args[0] 15543 if v_1_1_1_0.Op != OpSignExt32to64 || x != v_1_1_1_0.Args[0] { 15544 break 15545 } 15546 v_1_1_1_1 := v_1_1_1.Args[1] 15547 if v_1_1_1_1.Op != OpConst64 || v_1_1_1_1.AuxInt != 63 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(32, c).m) && s == 32+smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 15548 break 15549 } 15550 v.reset(OpLeq32U) 15551 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 15552 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 15553 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 15554 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15555 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 15556 v2.AddArg(v3) 15557 v2.AddArg(x) 15558 v1.AddArg(v2) 15559 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15560 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 15561 v1.AddArg(v4) 15562 v0.AddArg(v1) 15563 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15564 v5.AuxInt = int64(32 - sdivisible(32, c).k) 15565 v0.AddArg(v5) 15566 v.AddArg(v0) 15567 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15568 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 15569 v.AddArg(v6) 15570 return true 15571 } 15572 // match: (Eq32 x (Mul32 (Const32 [c]) (Sub32 (Rsh64x64 mul:(Mul64 (SignExt32to64 x) (Const64 [m])) (Const64 [s])) (Rsh64x64 (SignExt32to64 x) (Const64 [63]))))) 15573 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(32,c).m) && s == 32+smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 15574 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 15575 for { 15576 _ = v.Args[1] 15577 x := v.Args[0] 15578 v_1 := v.Args[1] 15579 if v_1.Op != OpMul32 { 15580 break 15581 } 15582 _ = v_1.Args[1] 15583 v_1_0 := v_1.Args[0] 15584 if v_1_0.Op != OpConst32 { 15585 break 15586 } 15587 c := v_1_0.AuxInt 15588 v_1_1 := v_1.Args[1] 15589 if v_1_1.Op != OpSub32 { 15590 break 15591 } 15592 _ = v_1_1.Args[1] 15593 v_1_1_0 := v_1_1.Args[0] 15594 if v_1_1_0.Op != OpRsh64x64 { 15595 break 15596 } 15597 _ = v_1_1_0.Args[1] 15598 mul := v_1_1_0.Args[0] 15599 if mul.Op != OpMul64 { 15600 break 15601 } 15602 _ = mul.Args[1] 15603 mul_0 := mul.Args[0] 15604 if mul_0.Op != OpSignExt32to64 || x != mul_0.Args[0] { 15605 break 15606 } 15607 mul_1 := mul.Args[1] 15608 if mul_1.Op != OpConst64 { 15609 break 15610 } 15611 m := mul_1.AuxInt 15612 v_1_1_0_1 := v_1_1_0.Args[1] 15613 if v_1_1_0_1.Op != OpConst64 { 15614 break 15615 } 15616 s := v_1_1_0_1.AuxInt 15617 v_1_1_1 := v_1_1.Args[1] 15618 if v_1_1_1.Op != OpRsh64x64 { 15619 break 15620 } 15621 _ = v_1_1_1.Args[1] 15622 v_1_1_1_0 := v_1_1_1.Args[0] 15623 if v_1_1_1_0.Op != OpSignExt32to64 || x != v_1_1_1_0.Args[0] { 15624 break 15625 } 15626 v_1_1_1_1 := v_1_1_1.Args[1] 15627 if v_1_1_1_1.Op != OpConst64 || v_1_1_1_1.AuxInt != 63 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(32, c).m) && s == 32+smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 15628 break 15629 } 15630 v.reset(OpLeq32U) 15631 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 15632 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 15633 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 15634 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15635 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 15636 v2.AddArg(v3) 15637 v2.AddArg(x) 15638 v1.AddArg(v2) 15639 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15640 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 15641 v1.AddArg(v4) 15642 v0.AddArg(v1) 15643 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15644 v5.AuxInt = int64(32 - sdivisible(32, c).k) 15645 v0.AddArg(v5) 15646 v.AddArg(v0) 15647 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15648 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 15649 v.AddArg(v6) 15650 return true 15651 } 15652 // match: (Eq32 x (Mul32 (Sub32 (Rsh64x64 mul:(Mul64 (Const64 [m]) (SignExt32to64 x)) (Const64 [s])) (Rsh64x64 (SignExt32to64 x) (Const64 [63]))) (Const32 [c]))) 15653 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(32,c).m) && s == 32+smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 15654 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 15655 for { 15656 _ = v.Args[1] 15657 x := v.Args[0] 15658 v_1 := v.Args[1] 15659 if v_1.Op != OpMul32 { 15660 break 15661 } 15662 _ = v_1.Args[1] 15663 v_1_0 := v_1.Args[0] 15664 if v_1_0.Op != OpSub32 { 15665 break 15666 } 15667 _ = v_1_0.Args[1] 15668 v_1_0_0 := v_1_0.Args[0] 15669 if v_1_0_0.Op != OpRsh64x64 { 15670 break 15671 } 15672 _ = v_1_0_0.Args[1] 15673 mul := v_1_0_0.Args[0] 15674 if mul.Op != OpMul64 { 15675 break 15676 } 15677 _ = mul.Args[1] 15678 mul_0 := mul.Args[0] 15679 if mul_0.Op != OpConst64 { 15680 break 15681 } 15682 m := mul_0.AuxInt 15683 mul_1 := mul.Args[1] 15684 if mul_1.Op != OpSignExt32to64 || x != mul_1.Args[0] { 15685 break 15686 } 15687 v_1_0_0_1 := v_1_0_0.Args[1] 15688 if v_1_0_0_1.Op != OpConst64 { 15689 break 15690 } 15691 s := v_1_0_0_1.AuxInt 15692 v_1_0_1 := v_1_0.Args[1] 15693 if v_1_0_1.Op != OpRsh64x64 { 15694 break 15695 } 15696 _ = v_1_0_1.Args[1] 15697 v_1_0_1_0 := v_1_0_1.Args[0] 15698 if v_1_0_1_0.Op != OpSignExt32to64 || x != v_1_0_1_0.Args[0] { 15699 break 15700 } 15701 v_1_0_1_1 := v_1_0_1.Args[1] 15702 if v_1_0_1_1.Op != OpConst64 || v_1_0_1_1.AuxInt != 63 { 15703 break 15704 } 15705 v_1_1 := v_1.Args[1] 15706 if v_1_1.Op != OpConst32 { 15707 break 15708 } 15709 c := v_1_1.AuxInt 15710 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(32, c).m) && s == 32+smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 15711 break 15712 } 15713 v.reset(OpLeq32U) 15714 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 15715 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 15716 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 15717 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15718 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 15719 v2.AddArg(v3) 15720 v2.AddArg(x) 15721 v1.AddArg(v2) 15722 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15723 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 15724 v1.AddArg(v4) 15725 v0.AddArg(v1) 15726 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15727 v5.AuxInt = int64(32 - sdivisible(32, c).k) 15728 v0.AddArg(v5) 15729 v.AddArg(v0) 15730 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15731 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 15732 v.AddArg(v6) 15733 return true 15734 } 15735 // match: (Eq32 x (Mul32 (Sub32 (Rsh64x64 mul:(Mul64 (SignExt32to64 x) (Const64 [m])) (Const64 [s])) (Rsh64x64 (SignExt32to64 x) (Const64 [63]))) (Const32 [c]))) 15736 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(32,c).m) && s == 32+smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 15737 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 15738 for { 15739 _ = v.Args[1] 15740 x := v.Args[0] 15741 v_1 := v.Args[1] 15742 if v_1.Op != OpMul32 { 15743 break 15744 } 15745 _ = v_1.Args[1] 15746 v_1_0 := v_1.Args[0] 15747 if v_1_0.Op != OpSub32 { 15748 break 15749 } 15750 _ = v_1_0.Args[1] 15751 v_1_0_0 := v_1_0.Args[0] 15752 if v_1_0_0.Op != OpRsh64x64 { 15753 break 15754 } 15755 _ = v_1_0_0.Args[1] 15756 mul := v_1_0_0.Args[0] 15757 if mul.Op != OpMul64 { 15758 break 15759 } 15760 _ = mul.Args[1] 15761 mul_0 := mul.Args[0] 15762 if mul_0.Op != OpSignExt32to64 || x != mul_0.Args[0] { 15763 break 15764 } 15765 mul_1 := mul.Args[1] 15766 if mul_1.Op != OpConst64 { 15767 break 15768 } 15769 m := mul_1.AuxInt 15770 v_1_0_0_1 := v_1_0_0.Args[1] 15771 if v_1_0_0_1.Op != OpConst64 { 15772 break 15773 } 15774 s := v_1_0_0_1.AuxInt 15775 v_1_0_1 := v_1_0.Args[1] 15776 if v_1_0_1.Op != OpRsh64x64 { 15777 break 15778 } 15779 _ = v_1_0_1.Args[1] 15780 v_1_0_1_0 := v_1_0_1.Args[0] 15781 if v_1_0_1_0.Op != OpSignExt32to64 || x != v_1_0_1_0.Args[0] { 15782 break 15783 } 15784 v_1_0_1_1 := v_1_0_1.Args[1] 15785 if v_1_0_1_1.Op != OpConst64 || v_1_0_1_1.AuxInt != 63 { 15786 break 15787 } 15788 v_1_1 := v_1.Args[1] 15789 if v_1_1.Op != OpConst32 { 15790 break 15791 } 15792 c := v_1_1.AuxInt 15793 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(32, c).m) && s == 32+smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 15794 break 15795 } 15796 v.reset(OpLeq32U) 15797 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 15798 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 15799 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 15800 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15801 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 15802 v2.AddArg(v3) 15803 v2.AddArg(x) 15804 v1.AddArg(v2) 15805 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15806 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 15807 v1.AddArg(v4) 15808 v0.AddArg(v1) 15809 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15810 v5.AuxInt = int64(32 - sdivisible(32, c).k) 15811 v0.AddArg(v5) 15812 v.AddArg(v0) 15813 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15814 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 15815 v.AddArg(v6) 15816 return true 15817 } 15818 // match: (Eq32 (Mul32 (Const32 [c]) (Sub32 (Rsh64x64 mul:(Mul64 (Const64 [m]) (SignExt32to64 x)) (Const64 [s])) (Rsh64x64 (SignExt32to64 x) (Const64 [63])))) x) 15819 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(32,c).m) && s == 32+smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 15820 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 15821 for { 15822 x := v.Args[1] 15823 v_0 := v.Args[0] 15824 if v_0.Op != OpMul32 { 15825 break 15826 } 15827 _ = v_0.Args[1] 15828 v_0_0 := v_0.Args[0] 15829 if v_0_0.Op != OpConst32 { 15830 break 15831 } 15832 c := v_0_0.AuxInt 15833 v_0_1 := v_0.Args[1] 15834 if v_0_1.Op != OpSub32 { 15835 break 15836 } 15837 _ = v_0_1.Args[1] 15838 v_0_1_0 := v_0_1.Args[0] 15839 if v_0_1_0.Op != OpRsh64x64 { 15840 break 15841 } 15842 _ = v_0_1_0.Args[1] 15843 mul := v_0_1_0.Args[0] 15844 if mul.Op != OpMul64 { 15845 break 15846 } 15847 _ = mul.Args[1] 15848 mul_0 := mul.Args[0] 15849 if mul_0.Op != OpConst64 { 15850 break 15851 } 15852 m := mul_0.AuxInt 15853 mul_1 := mul.Args[1] 15854 if mul_1.Op != OpSignExt32to64 || x != mul_1.Args[0] { 15855 break 15856 } 15857 v_0_1_0_1 := v_0_1_0.Args[1] 15858 if v_0_1_0_1.Op != OpConst64 { 15859 break 15860 } 15861 s := v_0_1_0_1.AuxInt 15862 v_0_1_1 := v_0_1.Args[1] 15863 if v_0_1_1.Op != OpRsh64x64 { 15864 break 15865 } 15866 _ = v_0_1_1.Args[1] 15867 v_0_1_1_0 := v_0_1_1.Args[0] 15868 if v_0_1_1_0.Op != OpSignExt32to64 || x != v_0_1_1_0.Args[0] { 15869 break 15870 } 15871 v_0_1_1_1 := v_0_1_1.Args[1] 15872 if v_0_1_1_1.Op != OpConst64 || v_0_1_1_1.AuxInt != 63 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(32, c).m) && s == 32+smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 15873 break 15874 } 15875 v.reset(OpLeq32U) 15876 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 15877 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 15878 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 15879 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15880 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 15881 v2.AddArg(v3) 15882 v2.AddArg(x) 15883 v1.AddArg(v2) 15884 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15885 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 15886 v1.AddArg(v4) 15887 v0.AddArg(v1) 15888 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15889 v5.AuxInt = int64(32 - sdivisible(32, c).k) 15890 v0.AddArg(v5) 15891 v.AddArg(v0) 15892 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15893 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 15894 v.AddArg(v6) 15895 return true 15896 } 15897 return false 15898 } 15899 func rewriteValuegeneric_OpEq32_60(v *Value) bool { 15900 b := v.Block 15901 typ := &b.Func.Config.Types 15902 // match: (Eq32 (Mul32 (Const32 [c]) (Sub32 (Rsh64x64 mul:(Mul64 (SignExt32to64 x) (Const64 [m])) (Const64 [s])) (Rsh64x64 (SignExt32to64 x) (Const64 [63])))) x) 15903 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(32,c).m) && s == 32+smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 15904 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 15905 for { 15906 x := v.Args[1] 15907 v_0 := v.Args[0] 15908 if v_0.Op != OpMul32 { 15909 break 15910 } 15911 _ = v_0.Args[1] 15912 v_0_0 := v_0.Args[0] 15913 if v_0_0.Op != OpConst32 { 15914 break 15915 } 15916 c := v_0_0.AuxInt 15917 v_0_1 := v_0.Args[1] 15918 if v_0_1.Op != OpSub32 { 15919 break 15920 } 15921 _ = v_0_1.Args[1] 15922 v_0_1_0 := v_0_1.Args[0] 15923 if v_0_1_0.Op != OpRsh64x64 { 15924 break 15925 } 15926 _ = v_0_1_0.Args[1] 15927 mul := v_0_1_0.Args[0] 15928 if mul.Op != OpMul64 { 15929 break 15930 } 15931 _ = mul.Args[1] 15932 mul_0 := mul.Args[0] 15933 if mul_0.Op != OpSignExt32to64 || x != mul_0.Args[0] { 15934 break 15935 } 15936 mul_1 := mul.Args[1] 15937 if mul_1.Op != OpConst64 { 15938 break 15939 } 15940 m := mul_1.AuxInt 15941 v_0_1_0_1 := v_0_1_0.Args[1] 15942 if v_0_1_0_1.Op != OpConst64 { 15943 break 15944 } 15945 s := v_0_1_0_1.AuxInt 15946 v_0_1_1 := v_0_1.Args[1] 15947 if v_0_1_1.Op != OpRsh64x64 { 15948 break 15949 } 15950 _ = v_0_1_1.Args[1] 15951 v_0_1_1_0 := v_0_1_1.Args[0] 15952 if v_0_1_1_0.Op != OpSignExt32to64 || x != v_0_1_1_0.Args[0] { 15953 break 15954 } 15955 v_0_1_1_1 := v_0_1_1.Args[1] 15956 if v_0_1_1_1.Op != OpConst64 || v_0_1_1_1.AuxInt != 63 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(32, c).m) && s == 32+smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 15957 break 15958 } 15959 v.reset(OpLeq32U) 15960 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 15961 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 15962 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 15963 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15964 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 15965 v2.AddArg(v3) 15966 v2.AddArg(x) 15967 v1.AddArg(v2) 15968 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15969 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 15970 v1.AddArg(v4) 15971 v0.AddArg(v1) 15972 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15973 v5.AuxInt = int64(32 - sdivisible(32, c).k) 15974 v0.AddArg(v5) 15975 v.AddArg(v0) 15976 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 15977 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 15978 v.AddArg(v6) 15979 return true 15980 } 15981 // match: (Eq32 (Mul32 (Sub32 (Rsh64x64 mul:(Mul64 (Const64 [m]) (SignExt32to64 x)) (Const64 [s])) (Rsh64x64 (SignExt32to64 x) (Const64 [63]))) (Const32 [c])) x) 15982 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(32,c).m) && s == 32+smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 15983 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 15984 for { 15985 x := v.Args[1] 15986 v_0 := v.Args[0] 15987 if v_0.Op != OpMul32 { 15988 break 15989 } 15990 _ = v_0.Args[1] 15991 v_0_0 := v_0.Args[0] 15992 if v_0_0.Op != OpSub32 { 15993 break 15994 } 15995 _ = v_0_0.Args[1] 15996 v_0_0_0 := v_0_0.Args[0] 15997 if v_0_0_0.Op != OpRsh64x64 { 15998 break 15999 } 16000 _ = v_0_0_0.Args[1] 16001 mul := v_0_0_0.Args[0] 16002 if mul.Op != OpMul64 { 16003 break 16004 } 16005 _ = mul.Args[1] 16006 mul_0 := mul.Args[0] 16007 if mul_0.Op != OpConst64 { 16008 break 16009 } 16010 m := mul_0.AuxInt 16011 mul_1 := mul.Args[1] 16012 if mul_1.Op != OpSignExt32to64 || x != mul_1.Args[0] { 16013 break 16014 } 16015 v_0_0_0_1 := v_0_0_0.Args[1] 16016 if v_0_0_0_1.Op != OpConst64 { 16017 break 16018 } 16019 s := v_0_0_0_1.AuxInt 16020 v_0_0_1 := v_0_0.Args[1] 16021 if v_0_0_1.Op != OpRsh64x64 { 16022 break 16023 } 16024 _ = v_0_0_1.Args[1] 16025 v_0_0_1_0 := v_0_0_1.Args[0] 16026 if v_0_0_1_0.Op != OpSignExt32to64 || x != v_0_0_1_0.Args[0] { 16027 break 16028 } 16029 v_0_0_1_1 := v_0_0_1.Args[1] 16030 if v_0_0_1_1.Op != OpConst64 || v_0_0_1_1.AuxInt != 63 { 16031 break 16032 } 16033 v_0_1 := v_0.Args[1] 16034 if v_0_1.Op != OpConst32 { 16035 break 16036 } 16037 c := v_0_1.AuxInt 16038 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(32, c).m) && s == 32+smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 16039 break 16040 } 16041 v.reset(OpLeq32U) 16042 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 16043 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 16044 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 16045 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16046 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 16047 v2.AddArg(v3) 16048 v2.AddArg(x) 16049 v1.AddArg(v2) 16050 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16051 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 16052 v1.AddArg(v4) 16053 v0.AddArg(v1) 16054 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16055 v5.AuxInt = int64(32 - sdivisible(32, c).k) 16056 v0.AddArg(v5) 16057 v.AddArg(v0) 16058 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16059 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 16060 v.AddArg(v6) 16061 return true 16062 } 16063 // match: (Eq32 (Mul32 (Sub32 (Rsh64x64 mul:(Mul64 (SignExt32to64 x) (Const64 [m])) (Const64 [s])) (Rsh64x64 (SignExt32to64 x) (Const64 [63]))) (Const32 [c])) x) 16064 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(32,c).m) && s == 32+smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 16065 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 16066 for { 16067 x := v.Args[1] 16068 v_0 := v.Args[0] 16069 if v_0.Op != OpMul32 { 16070 break 16071 } 16072 _ = v_0.Args[1] 16073 v_0_0 := v_0.Args[0] 16074 if v_0_0.Op != OpSub32 { 16075 break 16076 } 16077 _ = v_0_0.Args[1] 16078 v_0_0_0 := v_0_0.Args[0] 16079 if v_0_0_0.Op != OpRsh64x64 { 16080 break 16081 } 16082 _ = v_0_0_0.Args[1] 16083 mul := v_0_0_0.Args[0] 16084 if mul.Op != OpMul64 { 16085 break 16086 } 16087 _ = mul.Args[1] 16088 mul_0 := mul.Args[0] 16089 if mul_0.Op != OpSignExt32to64 || x != mul_0.Args[0] { 16090 break 16091 } 16092 mul_1 := mul.Args[1] 16093 if mul_1.Op != OpConst64 { 16094 break 16095 } 16096 m := mul_1.AuxInt 16097 v_0_0_0_1 := v_0_0_0.Args[1] 16098 if v_0_0_0_1.Op != OpConst64 { 16099 break 16100 } 16101 s := v_0_0_0_1.AuxInt 16102 v_0_0_1 := v_0_0.Args[1] 16103 if v_0_0_1.Op != OpRsh64x64 { 16104 break 16105 } 16106 _ = v_0_0_1.Args[1] 16107 v_0_0_1_0 := v_0_0_1.Args[0] 16108 if v_0_0_1_0.Op != OpSignExt32to64 || x != v_0_0_1_0.Args[0] { 16109 break 16110 } 16111 v_0_0_1_1 := v_0_0_1.Args[1] 16112 if v_0_0_1_1.Op != OpConst64 || v_0_0_1_1.AuxInt != 63 { 16113 break 16114 } 16115 v_0_1 := v_0.Args[1] 16116 if v_0_1.Op != OpConst32 { 16117 break 16118 } 16119 c := v_0_1.AuxInt 16120 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(32, c).m) && s == 32+smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 16121 break 16122 } 16123 v.reset(OpLeq32U) 16124 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 16125 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 16126 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 16127 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16128 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 16129 v2.AddArg(v3) 16130 v2.AddArg(x) 16131 v1.AddArg(v2) 16132 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16133 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 16134 v1.AddArg(v4) 16135 v0.AddArg(v1) 16136 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16137 v5.AuxInt = int64(32 - sdivisible(32, c).k) 16138 v0.AddArg(v5) 16139 v.AddArg(v0) 16140 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16141 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 16142 v.AddArg(v6) 16143 return true 16144 } 16145 // match: (Eq32 x (Mul32 (Const32 [c]) (Sub32 (Rsh32x64 mul:(Hmul32 (Const32 [m]) x) (Const64 [s])) (Rsh32x64 x (Const64 [31]))))) 16146 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m/2)) && s == smagic(32,c).s-1 && x.Op != OpConst32 && sdivisibleOK(32,c) 16147 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 16148 for { 16149 _ = v.Args[1] 16150 x := v.Args[0] 16151 v_1 := v.Args[1] 16152 if v_1.Op != OpMul32 { 16153 break 16154 } 16155 _ = v_1.Args[1] 16156 v_1_0 := v_1.Args[0] 16157 if v_1_0.Op != OpConst32 { 16158 break 16159 } 16160 c := v_1_0.AuxInt 16161 v_1_1 := v_1.Args[1] 16162 if v_1_1.Op != OpSub32 { 16163 break 16164 } 16165 _ = v_1_1.Args[1] 16166 v_1_1_0 := v_1_1.Args[0] 16167 if v_1_1_0.Op != OpRsh32x64 { 16168 break 16169 } 16170 _ = v_1_1_0.Args[1] 16171 mul := v_1_1_0.Args[0] 16172 if mul.Op != OpHmul32 { 16173 break 16174 } 16175 _ = mul.Args[1] 16176 mul_0 := mul.Args[0] 16177 if mul_0.Op != OpConst32 { 16178 break 16179 } 16180 m := mul_0.AuxInt 16181 if x != mul.Args[1] { 16182 break 16183 } 16184 v_1_1_0_1 := v_1_1_0.Args[1] 16185 if v_1_1_0_1.Op != OpConst64 { 16186 break 16187 } 16188 s := v_1_1_0_1.AuxInt 16189 v_1_1_1 := v_1_1.Args[1] 16190 if v_1_1_1.Op != OpRsh32x64 { 16191 break 16192 } 16193 _ = v_1_1_1.Args[1] 16194 if x != v_1_1_1.Args[0] { 16195 break 16196 } 16197 v_1_1_1_1 := v_1_1_1.Args[1] 16198 if v_1_1_1_1.Op != OpConst64 || v_1_1_1_1.AuxInt != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m/2)) && s == smagic(32, c).s-1 && x.Op != OpConst32 && sdivisibleOK(32, c)) { 16199 break 16200 } 16201 v.reset(OpLeq32U) 16202 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 16203 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 16204 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 16205 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16206 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 16207 v2.AddArg(v3) 16208 v2.AddArg(x) 16209 v1.AddArg(v2) 16210 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16211 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 16212 v1.AddArg(v4) 16213 v0.AddArg(v1) 16214 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16215 v5.AuxInt = int64(32 - sdivisible(32, c).k) 16216 v0.AddArg(v5) 16217 v.AddArg(v0) 16218 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16219 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 16220 v.AddArg(v6) 16221 return true 16222 } 16223 // match: (Eq32 x (Mul32 (Const32 [c]) (Sub32 (Rsh32x64 mul:(Hmul32 x (Const32 [m])) (Const64 [s])) (Rsh32x64 x (Const64 [31]))))) 16224 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m/2)) && s == smagic(32,c).s-1 && x.Op != OpConst32 && sdivisibleOK(32,c) 16225 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 16226 for { 16227 _ = v.Args[1] 16228 x := v.Args[0] 16229 v_1 := v.Args[1] 16230 if v_1.Op != OpMul32 { 16231 break 16232 } 16233 _ = v_1.Args[1] 16234 v_1_0 := v_1.Args[0] 16235 if v_1_0.Op != OpConst32 { 16236 break 16237 } 16238 c := v_1_0.AuxInt 16239 v_1_1 := v_1.Args[1] 16240 if v_1_1.Op != OpSub32 { 16241 break 16242 } 16243 _ = v_1_1.Args[1] 16244 v_1_1_0 := v_1_1.Args[0] 16245 if v_1_1_0.Op != OpRsh32x64 { 16246 break 16247 } 16248 _ = v_1_1_0.Args[1] 16249 mul := v_1_1_0.Args[0] 16250 if mul.Op != OpHmul32 { 16251 break 16252 } 16253 _ = mul.Args[1] 16254 if x != mul.Args[0] { 16255 break 16256 } 16257 mul_1 := mul.Args[1] 16258 if mul_1.Op != OpConst32 { 16259 break 16260 } 16261 m := mul_1.AuxInt 16262 v_1_1_0_1 := v_1_1_0.Args[1] 16263 if v_1_1_0_1.Op != OpConst64 { 16264 break 16265 } 16266 s := v_1_1_0_1.AuxInt 16267 v_1_1_1 := v_1_1.Args[1] 16268 if v_1_1_1.Op != OpRsh32x64 { 16269 break 16270 } 16271 _ = v_1_1_1.Args[1] 16272 if x != v_1_1_1.Args[0] { 16273 break 16274 } 16275 v_1_1_1_1 := v_1_1_1.Args[1] 16276 if v_1_1_1_1.Op != OpConst64 || v_1_1_1_1.AuxInt != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m/2)) && s == smagic(32, c).s-1 && x.Op != OpConst32 && sdivisibleOK(32, c)) { 16277 break 16278 } 16279 v.reset(OpLeq32U) 16280 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 16281 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 16282 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 16283 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16284 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 16285 v2.AddArg(v3) 16286 v2.AddArg(x) 16287 v1.AddArg(v2) 16288 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16289 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 16290 v1.AddArg(v4) 16291 v0.AddArg(v1) 16292 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16293 v5.AuxInt = int64(32 - sdivisible(32, c).k) 16294 v0.AddArg(v5) 16295 v.AddArg(v0) 16296 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16297 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 16298 v.AddArg(v6) 16299 return true 16300 } 16301 // match: (Eq32 x (Mul32 (Sub32 (Rsh32x64 mul:(Hmul32 (Const32 [m]) x) (Const64 [s])) (Rsh32x64 x (Const64 [31]))) (Const32 [c]))) 16302 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m/2)) && s == smagic(32,c).s-1 && x.Op != OpConst32 && sdivisibleOK(32,c) 16303 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 16304 for { 16305 _ = v.Args[1] 16306 x := v.Args[0] 16307 v_1 := v.Args[1] 16308 if v_1.Op != OpMul32 { 16309 break 16310 } 16311 _ = v_1.Args[1] 16312 v_1_0 := v_1.Args[0] 16313 if v_1_0.Op != OpSub32 { 16314 break 16315 } 16316 _ = v_1_0.Args[1] 16317 v_1_0_0 := v_1_0.Args[0] 16318 if v_1_0_0.Op != OpRsh32x64 { 16319 break 16320 } 16321 _ = v_1_0_0.Args[1] 16322 mul := v_1_0_0.Args[0] 16323 if mul.Op != OpHmul32 { 16324 break 16325 } 16326 _ = mul.Args[1] 16327 mul_0 := mul.Args[0] 16328 if mul_0.Op != OpConst32 { 16329 break 16330 } 16331 m := mul_0.AuxInt 16332 if x != mul.Args[1] { 16333 break 16334 } 16335 v_1_0_0_1 := v_1_0_0.Args[1] 16336 if v_1_0_0_1.Op != OpConst64 { 16337 break 16338 } 16339 s := v_1_0_0_1.AuxInt 16340 v_1_0_1 := v_1_0.Args[1] 16341 if v_1_0_1.Op != OpRsh32x64 { 16342 break 16343 } 16344 _ = v_1_0_1.Args[1] 16345 if x != v_1_0_1.Args[0] { 16346 break 16347 } 16348 v_1_0_1_1 := v_1_0_1.Args[1] 16349 if v_1_0_1_1.Op != OpConst64 || v_1_0_1_1.AuxInt != 31 { 16350 break 16351 } 16352 v_1_1 := v_1.Args[1] 16353 if v_1_1.Op != OpConst32 { 16354 break 16355 } 16356 c := v_1_1.AuxInt 16357 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m/2)) && s == smagic(32, c).s-1 && x.Op != OpConst32 && sdivisibleOK(32, c)) { 16358 break 16359 } 16360 v.reset(OpLeq32U) 16361 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 16362 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 16363 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 16364 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16365 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 16366 v2.AddArg(v3) 16367 v2.AddArg(x) 16368 v1.AddArg(v2) 16369 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16370 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 16371 v1.AddArg(v4) 16372 v0.AddArg(v1) 16373 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16374 v5.AuxInt = int64(32 - sdivisible(32, c).k) 16375 v0.AddArg(v5) 16376 v.AddArg(v0) 16377 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16378 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 16379 v.AddArg(v6) 16380 return true 16381 } 16382 // match: (Eq32 x (Mul32 (Sub32 (Rsh32x64 mul:(Hmul32 x (Const32 [m])) (Const64 [s])) (Rsh32x64 x (Const64 [31]))) (Const32 [c]))) 16383 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m/2)) && s == smagic(32,c).s-1 && x.Op != OpConst32 && sdivisibleOK(32,c) 16384 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 16385 for { 16386 _ = v.Args[1] 16387 x := v.Args[0] 16388 v_1 := v.Args[1] 16389 if v_1.Op != OpMul32 { 16390 break 16391 } 16392 _ = v_1.Args[1] 16393 v_1_0 := v_1.Args[0] 16394 if v_1_0.Op != OpSub32 { 16395 break 16396 } 16397 _ = v_1_0.Args[1] 16398 v_1_0_0 := v_1_0.Args[0] 16399 if v_1_0_0.Op != OpRsh32x64 { 16400 break 16401 } 16402 _ = v_1_0_0.Args[1] 16403 mul := v_1_0_0.Args[0] 16404 if mul.Op != OpHmul32 { 16405 break 16406 } 16407 _ = mul.Args[1] 16408 if x != mul.Args[0] { 16409 break 16410 } 16411 mul_1 := mul.Args[1] 16412 if mul_1.Op != OpConst32 { 16413 break 16414 } 16415 m := mul_1.AuxInt 16416 v_1_0_0_1 := v_1_0_0.Args[1] 16417 if v_1_0_0_1.Op != OpConst64 { 16418 break 16419 } 16420 s := v_1_0_0_1.AuxInt 16421 v_1_0_1 := v_1_0.Args[1] 16422 if v_1_0_1.Op != OpRsh32x64 { 16423 break 16424 } 16425 _ = v_1_0_1.Args[1] 16426 if x != v_1_0_1.Args[0] { 16427 break 16428 } 16429 v_1_0_1_1 := v_1_0_1.Args[1] 16430 if v_1_0_1_1.Op != OpConst64 || v_1_0_1_1.AuxInt != 31 { 16431 break 16432 } 16433 v_1_1 := v_1.Args[1] 16434 if v_1_1.Op != OpConst32 { 16435 break 16436 } 16437 c := v_1_1.AuxInt 16438 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m/2)) && s == smagic(32, c).s-1 && x.Op != OpConst32 && sdivisibleOK(32, c)) { 16439 break 16440 } 16441 v.reset(OpLeq32U) 16442 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 16443 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 16444 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 16445 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16446 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 16447 v2.AddArg(v3) 16448 v2.AddArg(x) 16449 v1.AddArg(v2) 16450 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16451 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 16452 v1.AddArg(v4) 16453 v0.AddArg(v1) 16454 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16455 v5.AuxInt = int64(32 - sdivisible(32, c).k) 16456 v0.AddArg(v5) 16457 v.AddArg(v0) 16458 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16459 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 16460 v.AddArg(v6) 16461 return true 16462 } 16463 // match: (Eq32 (Mul32 (Const32 [c]) (Sub32 (Rsh32x64 mul:(Hmul32 (Const32 [m]) x) (Const64 [s])) (Rsh32x64 x (Const64 [31])))) x) 16464 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m/2)) && s == smagic(32,c).s-1 && x.Op != OpConst32 && sdivisibleOK(32,c) 16465 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 16466 for { 16467 x := v.Args[1] 16468 v_0 := v.Args[0] 16469 if v_0.Op != OpMul32 { 16470 break 16471 } 16472 _ = v_0.Args[1] 16473 v_0_0 := v_0.Args[0] 16474 if v_0_0.Op != OpConst32 { 16475 break 16476 } 16477 c := v_0_0.AuxInt 16478 v_0_1 := v_0.Args[1] 16479 if v_0_1.Op != OpSub32 { 16480 break 16481 } 16482 _ = v_0_1.Args[1] 16483 v_0_1_0 := v_0_1.Args[0] 16484 if v_0_1_0.Op != OpRsh32x64 { 16485 break 16486 } 16487 _ = v_0_1_0.Args[1] 16488 mul := v_0_1_0.Args[0] 16489 if mul.Op != OpHmul32 { 16490 break 16491 } 16492 _ = mul.Args[1] 16493 mul_0 := mul.Args[0] 16494 if mul_0.Op != OpConst32 { 16495 break 16496 } 16497 m := mul_0.AuxInt 16498 if x != mul.Args[1] { 16499 break 16500 } 16501 v_0_1_0_1 := v_0_1_0.Args[1] 16502 if v_0_1_0_1.Op != OpConst64 { 16503 break 16504 } 16505 s := v_0_1_0_1.AuxInt 16506 v_0_1_1 := v_0_1.Args[1] 16507 if v_0_1_1.Op != OpRsh32x64 { 16508 break 16509 } 16510 _ = v_0_1_1.Args[1] 16511 if x != v_0_1_1.Args[0] { 16512 break 16513 } 16514 v_0_1_1_1 := v_0_1_1.Args[1] 16515 if v_0_1_1_1.Op != OpConst64 || v_0_1_1_1.AuxInt != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m/2)) && s == smagic(32, c).s-1 && x.Op != OpConst32 && sdivisibleOK(32, c)) { 16516 break 16517 } 16518 v.reset(OpLeq32U) 16519 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 16520 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 16521 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 16522 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16523 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 16524 v2.AddArg(v3) 16525 v2.AddArg(x) 16526 v1.AddArg(v2) 16527 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16528 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 16529 v1.AddArg(v4) 16530 v0.AddArg(v1) 16531 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16532 v5.AuxInt = int64(32 - sdivisible(32, c).k) 16533 v0.AddArg(v5) 16534 v.AddArg(v0) 16535 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16536 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 16537 v.AddArg(v6) 16538 return true 16539 } 16540 // match: (Eq32 (Mul32 (Const32 [c]) (Sub32 (Rsh32x64 mul:(Hmul32 x (Const32 [m])) (Const64 [s])) (Rsh32x64 x (Const64 [31])))) x) 16541 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m/2)) && s == smagic(32,c).s-1 && x.Op != OpConst32 && sdivisibleOK(32,c) 16542 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 16543 for { 16544 x := v.Args[1] 16545 v_0 := v.Args[0] 16546 if v_0.Op != OpMul32 { 16547 break 16548 } 16549 _ = v_0.Args[1] 16550 v_0_0 := v_0.Args[0] 16551 if v_0_0.Op != OpConst32 { 16552 break 16553 } 16554 c := v_0_0.AuxInt 16555 v_0_1 := v_0.Args[1] 16556 if v_0_1.Op != OpSub32 { 16557 break 16558 } 16559 _ = v_0_1.Args[1] 16560 v_0_1_0 := v_0_1.Args[0] 16561 if v_0_1_0.Op != OpRsh32x64 { 16562 break 16563 } 16564 _ = v_0_1_0.Args[1] 16565 mul := v_0_1_0.Args[0] 16566 if mul.Op != OpHmul32 { 16567 break 16568 } 16569 _ = mul.Args[1] 16570 if x != mul.Args[0] { 16571 break 16572 } 16573 mul_1 := mul.Args[1] 16574 if mul_1.Op != OpConst32 { 16575 break 16576 } 16577 m := mul_1.AuxInt 16578 v_0_1_0_1 := v_0_1_0.Args[1] 16579 if v_0_1_0_1.Op != OpConst64 { 16580 break 16581 } 16582 s := v_0_1_0_1.AuxInt 16583 v_0_1_1 := v_0_1.Args[1] 16584 if v_0_1_1.Op != OpRsh32x64 { 16585 break 16586 } 16587 _ = v_0_1_1.Args[1] 16588 if x != v_0_1_1.Args[0] { 16589 break 16590 } 16591 v_0_1_1_1 := v_0_1_1.Args[1] 16592 if v_0_1_1_1.Op != OpConst64 || v_0_1_1_1.AuxInt != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m/2)) && s == smagic(32, c).s-1 && x.Op != OpConst32 && sdivisibleOK(32, c)) { 16593 break 16594 } 16595 v.reset(OpLeq32U) 16596 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 16597 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 16598 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 16599 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16600 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 16601 v2.AddArg(v3) 16602 v2.AddArg(x) 16603 v1.AddArg(v2) 16604 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16605 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 16606 v1.AddArg(v4) 16607 v0.AddArg(v1) 16608 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16609 v5.AuxInt = int64(32 - sdivisible(32, c).k) 16610 v0.AddArg(v5) 16611 v.AddArg(v0) 16612 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16613 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 16614 v.AddArg(v6) 16615 return true 16616 } 16617 // match: (Eq32 (Mul32 (Sub32 (Rsh32x64 mul:(Hmul32 (Const32 [m]) x) (Const64 [s])) (Rsh32x64 x (Const64 [31]))) (Const32 [c])) x) 16618 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m/2)) && s == smagic(32,c).s-1 && x.Op != OpConst32 && sdivisibleOK(32,c) 16619 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 16620 for { 16621 x := v.Args[1] 16622 v_0 := v.Args[0] 16623 if v_0.Op != OpMul32 { 16624 break 16625 } 16626 _ = v_0.Args[1] 16627 v_0_0 := v_0.Args[0] 16628 if v_0_0.Op != OpSub32 { 16629 break 16630 } 16631 _ = v_0_0.Args[1] 16632 v_0_0_0 := v_0_0.Args[0] 16633 if v_0_0_0.Op != OpRsh32x64 { 16634 break 16635 } 16636 _ = v_0_0_0.Args[1] 16637 mul := v_0_0_0.Args[0] 16638 if mul.Op != OpHmul32 { 16639 break 16640 } 16641 _ = mul.Args[1] 16642 mul_0 := mul.Args[0] 16643 if mul_0.Op != OpConst32 { 16644 break 16645 } 16646 m := mul_0.AuxInt 16647 if x != mul.Args[1] { 16648 break 16649 } 16650 v_0_0_0_1 := v_0_0_0.Args[1] 16651 if v_0_0_0_1.Op != OpConst64 { 16652 break 16653 } 16654 s := v_0_0_0_1.AuxInt 16655 v_0_0_1 := v_0_0.Args[1] 16656 if v_0_0_1.Op != OpRsh32x64 { 16657 break 16658 } 16659 _ = v_0_0_1.Args[1] 16660 if x != v_0_0_1.Args[0] { 16661 break 16662 } 16663 v_0_0_1_1 := v_0_0_1.Args[1] 16664 if v_0_0_1_1.Op != OpConst64 || v_0_0_1_1.AuxInt != 31 { 16665 break 16666 } 16667 v_0_1 := v_0.Args[1] 16668 if v_0_1.Op != OpConst32 { 16669 break 16670 } 16671 c := v_0_1.AuxInt 16672 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m/2)) && s == smagic(32, c).s-1 && x.Op != OpConst32 && sdivisibleOK(32, c)) { 16673 break 16674 } 16675 v.reset(OpLeq32U) 16676 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 16677 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 16678 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 16679 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16680 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 16681 v2.AddArg(v3) 16682 v2.AddArg(x) 16683 v1.AddArg(v2) 16684 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16685 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 16686 v1.AddArg(v4) 16687 v0.AddArg(v1) 16688 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16689 v5.AuxInt = int64(32 - sdivisible(32, c).k) 16690 v0.AddArg(v5) 16691 v.AddArg(v0) 16692 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16693 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 16694 v.AddArg(v6) 16695 return true 16696 } 16697 return false 16698 } 16699 func rewriteValuegeneric_OpEq32_70(v *Value) bool { 16700 b := v.Block 16701 typ := &b.Func.Config.Types 16702 // match: (Eq32 (Mul32 (Sub32 (Rsh32x64 mul:(Hmul32 x (Const32 [m])) (Const64 [s])) (Rsh32x64 x (Const64 [31]))) (Const32 [c])) x) 16703 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m/2)) && s == smagic(32,c).s-1 && x.Op != OpConst32 && sdivisibleOK(32,c) 16704 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 16705 for { 16706 x := v.Args[1] 16707 v_0 := v.Args[0] 16708 if v_0.Op != OpMul32 { 16709 break 16710 } 16711 _ = v_0.Args[1] 16712 v_0_0 := v_0.Args[0] 16713 if v_0_0.Op != OpSub32 { 16714 break 16715 } 16716 _ = v_0_0.Args[1] 16717 v_0_0_0 := v_0_0.Args[0] 16718 if v_0_0_0.Op != OpRsh32x64 { 16719 break 16720 } 16721 _ = v_0_0_0.Args[1] 16722 mul := v_0_0_0.Args[0] 16723 if mul.Op != OpHmul32 { 16724 break 16725 } 16726 _ = mul.Args[1] 16727 if x != mul.Args[0] { 16728 break 16729 } 16730 mul_1 := mul.Args[1] 16731 if mul_1.Op != OpConst32 { 16732 break 16733 } 16734 m := mul_1.AuxInt 16735 v_0_0_0_1 := v_0_0_0.Args[1] 16736 if v_0_0_0_1.Op != OpConst64 { 16737 break 16738 } 16739 s := v_0_0_0_1.AuxInt 16740 v_0_0_1 := v_0_0.Args[1] 16741 if v_0_0_1.Op != OpRsh32x64 { 16742 break 16743 } 16744 _ = v_0_0_1.Args[1] 16745 if x != v_0_0_1.Args[0] { 16746 break 16747 } 16748 v_0_0_1_1 := v_0_0_1.Args[1] 16749 if v_0_0_1_1.Op != OpConst64 || v_0_0_1_1.AuxInt != 31 { 16750 break 16751 } 16752 v_0_1 := v_0.Args[1] 16753 if v_0_1.Op != OpConst32 { 16754 break 16755 } 16756 c := v_0_1.AuxInt 16757 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m/2)) && s == smagic(32, c).s-1 && x.Op != OpConst32 && sdivisibleOK(32, c)) { 16758 break 16759 } 16760 v.reset(OpLeq32U) 16761 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 16762 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 16763 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 16764 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16765 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 16766 v2.AddArg(v3) 16767 v2.AddArg(x) 16768 v1.AddArg(v2) 16769 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16770 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 16771 v1.AddArg(v4) 16772 v0.AddArg(v1) 16773 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16774 v5.AuxInt = int64(32 - sdivisible(32, c).k) 16775 v0.AddArg(v5) 16776 v.AddArg(v0) 16777 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16778 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 16779 v.AddArg(v6) 16780 return true 16781 } 16782 // match: (Eq32 x (Mul32 (Const32 [c]) (Sub32 (Rsh32x64 (Add32 mul:(Hmul32 (Const32 [m]) x) x) (Const64 [s])) (Rsh32x64 x (Const64 [31]))))) 16783 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m)) && s == smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 16784 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 16785 for { 16786 _ = v.Args[1] 16787 x := v.Args[0] 16788 v_1 := v.Args[1] 16789 if v_1.Op != OpMul32 { 16790 break 16791 } 16792 _ = v_1.Args[1] 16793 v_1_0 := v_1.Args[0] 16794 if v_1_0.Op != OpConst32 { 16795 break 16796 } 16797 c := v_1_0.AuxInt 16798 v_1_1 := v_1.Args[1] 16799 if v_1_1.Op != OpSub32 { 16800 break 16801 } 16802 _ = v_1_1.Args[1] 16803 v_1_1_0 := v_1_1.Args[0] 16804 if v_1_1_0.Op != OpRsh32x64 { 16805 break 16806 } 16807 _ = v_1_1_0.Args[1] 16808 v_1_1_0_0 := v_1_1_0.Args[0] 16809 if v_1_1_0_0.Op != OpAdd32 { 16810 break 16811 } 16812 _ = v_1_1_0_0.Args[1] 16813 mul := v_1_1_0_0.Args[0] 16814 if mul.Op != OpHmul32 { 16815 break 16816 } 16817 _ = mul.Args[1] 16818 mul_0 := mul.Args[0] 16819 if mul_0.Op != OpConst32 { 16820 break 16821 } 16822 m := mul_0.AuxInt 16823 if x != mul.Args[1] || x != v_1_1_0_0.Args[1] { 16824 break 16825 } 16826 v_1_1_0_1 := v_1_1_0.Args[1] 16827 if v_1_1_0_1.Op != OpConst64 { 16828 break 16829 } 16830 s := v_1_1_0_1.AuxInt 16831 v_1_1_1 := v_1_1.Args[1] 16832 if v_1_1_1.Op != OpRsh32x64 { 16833 break 16834 } 16835 _ = v_1_1_1.Args[1] 16836 if x != v_1_1_1.Args[0] { 16837 break 16838 } 16839 v_1_1_1_1 := v_1_1_1.Args[1] 16840 if v_1_1_1_1.Op != OpConst64 || v_1_1_1_1.AuxInt != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m)) && s == smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 16841 break 16842 } 16843 v.reset(OpLeq32U) 16844 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 16845 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 16846 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 16847 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16848 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 16849 v2.AddArg(v3) 16850 v2.AddArg(x) 16851 v1.AddArg(v2) 16852 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16853 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 16854 v1.AddArg(v4) 16855 v0.AddArg(v1) 16856 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16857 v5.AuxInt = int64(32 - sdivisible(32, c).k) 16858 v0.AddArg(v5) 16859 v.AddArg(v0) 16860 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16861 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 16862 v.AddArg(v6) 16863 return true 16864 } 16865 // match: (Eq32 x (Mul32 (Const32 [c]) (Sub32 (Rsh32x64 (Add32 mul:(Hmul32 x (Const32 [m])) x) (Const64 [s])) (Rsh32x64 x (Const64 [31]))))) 16866 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m)) && s == smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 16867 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 16868 for { 16869 _ = v.Args[1] 16870 x := v.Args[0] 16871 v_1 := v.Args[1] 16872 if v_1.Op != OpMul32 { 16873 break 16874 } 16875 _ = v_1.Args[1] 16876 v_1_0 := v_1.Args[0] 16877 if v_1_0.Op != OpConst32 { 16878 break 16879 } 16880 c := v_1_0.AuxInt 16881 v_1_1 := v_1.Args[1] 16882 if v_1_1.Op != OpSub32 { 16883 break 16884 } 16885 _ = v_1_1.Args[1] 16886 v_1_1_0 := v_1_1.Args[0] 16887 if v_1_1_0.Op != OpRsh32x64 { 16888 break 16889 } 16890 _ = v_1_1_0.Args[1] 16891 v_1_1_0_0 := v_1_1_0.Args[0] 16892 if v_1_1_0_0.Op != OpAdd32 { 16893 break 16894 } 16895 _ = v_1_1_0_0.Args[1] 16896 mul := v_1_1_0_0.Args[0] 16897 if mul.Op != OpHmul32 { 16898 break 16899 } 16900 _ = mul.Args[1] 16901 if x != mul.Args[0] { 16902 break 16903 } 16904 mul_1 := mul.Args[1] 16905 if mul_1.Op != OpConst32 { 16906 break 16907 } 16908 m := mul_1.AuxInt 16909 if x != v_1_1_0_0.Args[1] { 16910 break 16911 } 16912 v_1_1_0_1 := v_1_1_0.Args[1] 16913 if v_1_1_0_1.Op != OpConst64 { 16914 break 16915 } 16916 s := v_1_1_0_1.AuxInt 16917 v_1_1_1 := v_1_1.Args[1] 16918 if v_1_1_1.Op != OpRsh32x64 { 16919 break 16920 } 16921 _ = v_1_1_1.Args[1] 16922 if x != v_1_1_1.Args[0] { 16923 break 16924 } 16925 v_1_1_1_1 := v_1_1_1.Args[1] 16926 if v_1_1_1_1.Op != OpConst64 || v_1_1_1_1.AuxInt != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m)) && s == smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 16927 break 16928 } 16929 v.reset(OpLeq32U) 16930 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 16931 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 16932 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 16933 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16934 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 16935 v2.AddArg(v3) 16936 v2.AddArg(x) 16937 v1.AddArg(v2) 16938 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16939 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 16940 v1.AddArg(v4) 16941 v0.AddArg(v1) 16942 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16943 v5.AuxInt = int64(32 - sdivisible(32, c).k) 16944 v0.AddArg(v5) 16945 v.AddArg(v0) 16946 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 16947 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 16948 v.AddArg(v6) 16949 return true 16950 } 16951 // match: (Eq32 x (Mul32 (Const32 [c]) (Sub32 (Rsh32x64 (Add32 x mul:(Hmul32 (Const32 [m]) x)) (Const64 [s])) (Rsh32x64 x (Const64 [31]))))) 16952 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m)) && s == smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 16953 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 16954 for { 16955 _ = v.Args[1] 16956 x := v.Args[0] 16957 v_1 := v.Args[1] 16958 if v_1.Op != OpMul32 { 16959 break 16960 } 16961 _ = v_1.Args[1] 16962 v_1_0 := v_1.Args[0] 16963 if v_1_0.Op != OpConst32 { 16964 break 16965 } 16966 c := v_1_0.AuxInt 16967 v_1_1 := v_1.Args[1] 16968 if v_1_1.Op != OpSub32 { 16969 break 16970 } 16971 _ = v_1_1.Args[1] 16972 v_1_1_0 := v_1_1.Args[0] 16973 if v_1_1_0.Op != OpRsh32x64 { 16974 break 16975 } 16976 _ = v_1_1_0.Args[1] 16977 v_1_1_0_0 := v_1_1_0.Args[0] 16978 if v_1_1_0_0.Op != OpAdd32 { 16979 break 16980 } 16981 _ = v_1_1_0_0.Args[1] 16982 if x != v_1_1_0_0.Args[0] { 16983 break 16984 } 16985 mul := v_1_1_0_0.Args[1] 16986 if mul.Op != OpHmul32 { 16987 break 16988 } 16989 _ = mul.Args[1] 16990 mul_0 := mul.Args[0] 16991 if mul_0.Op != OpConst32 { 16992 break 16993 } 16994 m := mul_0.AuxInt 16995 if x != mul.Args[1] { 16996 break 16997 } 16998 v_1_1_0_1 := v_1_1_0.Args[1] 16999 if v_1_1_0_1.Op != OpConst64 { 17000 break 17001 } 17002 s := v_1_1_0_1.AuxInt 17003 v_1_1_1 := v_1_1.Args[1] 17004 if v_1_1_1.Op != OpRsh32x64 { 17005 break 17006 } 17007 _ = v_1_1_1.Args[1] 17008 if x != v_1_1_1.Args[0] { 17009 break 17010 } 17011 v_1_1_1_1 := v_1_1_1.Args[1] 17012 if v_1_1_1_1.Op != OpConst64 || v_1_1_1_1.AuxInt != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m)) && s == smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 17013 break 17014 } 17015 v.reset(OpLeq32U) 17016 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 17017 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 17018 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 17019 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17020 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 17021 v2.AddArg(v3) 17022 v2.AddArg(x) 17023 v1.AddArg(v2) 17024 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17025 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 17026 v1.AddArg(v4) 17027 v0.AddArg(v1) 17028 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17029 v5.AuxInt = int64(32 - sdivisible(32, c).k) 17030 v0.AddArg(v5) 17031 v.AddArg(v0) 17032 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17033 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 17034 v.AddArg(v6) 17035 return true 17036 } 17037 // match: (Eq32 x (Mul32 (Const32 [c]) (Sub32 (Rsh32x64 (Add32 x mul:(Hmul32 x (Const32 [m]))) (Const64 [s])) (Rsh32x64 x (Const64 [31]))))) 17038 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m)) && s == smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 17039 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 17040 for { 17041 _ = v.Args[1] 17042 x := v.Args[0] 17043 v_1 := v.Args[1] 17044 if v_1.Op != OpMul32 { 17045 break 17046 } 17047 _ = v_1.Args[1] 17048 v_1_0 := v_1.Args[0] 17049 if v_1_0.Op != OpConst32 { 17050 break 17051 } 17052 c := v_1_0.AuxInt 17053 v_1_1 := v_1.Args[1] 17054 if v_1_1.Op != OpSub32 { 17055 break 17056 } 17057 _ = v_1_1.Args[1] 17058 v_1_1_0 := v_1_1.Args[0] 17059 if v_1_1_0.Op != OpRsh32x64 { 17060 break 17061 } 17062 _ = v_1_1_0.Args[1] 17063 v_1_1_0_0 := v_1_1_0.Args[0] 17064 if v_1_1_0_0.Op != OpAdd32 { 17065 break 17066 } 17067 _ = v_1_1_0_0.Args[1] 17068 if x != v_1_1_0_0.Args[0] { 17069 break 17070 } 17071 mul := v_1_1_0_0.Args[1] 17072 if mul.Op != OpHmul32 { 17073 break 17074 } 17075 _ = mul.Args[1] 17076 if x != mul.Args[0] { 17077 break 17078 } 17079 mul_1 := mul.Args[1] 17080 if mul_1.Op != OpConst32 { 17081 break 17082 } 17083 m := mul_1.AuxInt 17084 v_1_1_0_1 := v_1_1_0.Args[1] 17085 if v_1_1_0_1.Op != OpConst64 { 17086 break 17087 } 17088 s := v_1_1_0_1.AuxInt 17089 v_1_1_1 := v_1_1.Args[1] 17090 if v_1_1_1.Op != OpRsh32x64 { 17091 break 17092 } 17093 _ = v_1_1_1.Args[1] 17094 if x != v_1_1_1.Args[0] { 17095 break 17096 } 17097 v_1_1_1_1 := v_1_1_1.Args[1] 17098 if v_1_1_1_1.Op != OpConst64 || v_1_1_1_1.AuxInt != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m)) && s == smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 17099 break 17100 } 17101 v.reset(OpLeq32U) 17102 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 17103 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 17104 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 17105 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17106 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 17107 v2.AddArg(v3) 17108 v2.AddArg(x) 17109 v1.AddArg(v2) 17110 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17111 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 17112 v1.AddArg(v4) 17113 v0.AddArg(v1) 17114 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17115 v5.AuxInt = int64(32 - sdivisible(32, c).k) 17116 v0.AddArg(v5) 17117 v.AddArg(v0) 17118 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17119 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 17120 v.AddArg(v6) 17121 return true 17122 } 17123 // match: (Eq32 x (Mul32 (Sub32 (Rsh32x64 (Add32 mul:(Hmul32 (Const32 [m]) x) x) (Const64 [s])) (Rsh32x64 x (Const64 [31]))) (Const32 [c]))) 17124 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m)) && s == smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 17125 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 17126 for { 17127 _ = v.Args[1] 17128 x := v.Args[0] 17129 v_1 := v.Args[1] 17130 if v_1.Op != OpMul32 { 17131 break 17132 } 17133 _ = v_1.Args[1] 17134 v_1_0 := v_1.Args[0] 17135 if v_1_0.Op != OpSub32 { 17136 break 17137 } 17138 _ = v_1_0.Args[1] 17139 v_1_0_0 := v_1_0.Args[0] 17140 if v_1_0_0.Op != OpRsh32x64 { 17141 break 17142 } 17143 _ = v_1_0_0.Args[1] 17144 v_1_0_0_0 := v_1_0_0.Args[0] 17145 if v_1_0_0_0.Op != OpAdd32 { 17146 break 17147 } 17148 _ = v_1_0_0_0.Args[1] 17149 mul := v_1_0_0_0.Args[0] 17150 if mul.Op != OpHmul32 { 17151 break 17152 } 17153 _ = mul.Args[1] 17154 mul_0 := mul.Args[0] 17155 if mul_0.Op != OpConst32 { 17156 break 17157 } 17158 m := mul_0.AuxInt 17159 if x != mul.Args[1] || x != v_1_0_0_0.Args[1] { 17160 break 17161 } 17162 v_1_0_0_1 := v_1_0_0.Args[1] 17163 if v_1_0_0_1.Op != OpConst64 { 17164 break 17165 } 17166 s := v_1_0_0_1.AuxInt 17167 v_1_0_1 := v_1_0.Args[1] 17168 if v_1_0_1.Op != OpRsh32x64 { 17169 break 17170 } 17171 _ = v_1_0_1.Args[1] 17172 if x != v_1_0_1.Args[0] { 17173 break 17174 } 17175 v_1_0_1_1 := v_1_0_1.Args[1] 17176 if v_1_0_1_1.Op != OpConst64 || v_1_0_1_1.AuxInt != 31 { 17177 break 17178 } 17179 v_1_1 := v_1.Args[1] 17180 if v_1_1.Op != OpConst32 { 17181 break 17182 } 17183 c := v_1_1.AuxInt 17184 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m)) && s == smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 17185 break 17186 } 17187 v.reset(OpLeq32U) 17188 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 17189 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 17190 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 17191 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17192 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 17193 v2.AddArg(v3) 17194 v2.AddArg(x) 17195 v1.AddArg(v2) 17196 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17197 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 17198 v1.AddArg(v4) 17199 v0.AddArg(v1) 17200 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17201 v5.AuxInt = int64(32 - sdivisible(32, c).k) 17202 v0.AddArg(v5) 17203 v.AddArg(v0) 17204 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17205 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 17206 v.AddArg(v6) 17207 return true 17208 } 17209 // match: (Eq32 x (Mul32 (Sub32 (Rsh32x64 (Add32 mul:(Hmul32 x (Const32 [m])) x) (Const64 [s])) (Rsh32x64 x (Const64 [31]))) (Const32 [c]))) 17210 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m)) && s == smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 17211 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 17212 for { 17213 _ = v.Args[1] 17214 x := v.Args[0] 17215 v_1 := v.Args[1] 17216 if v_1.Op != OpMul32 { 17217 break 17218 } 17219 _ = v_1.Args[1] 17220 v_1_0 := v_1.Args[0] 17221 if v_1_0.Op != OpSub32 { 17222 break 17223 } 17224 _ = v_1_0.Args[1] 17225 v_1_0_0 := v_1_0.Args[0] 17226 if v_1_0_0.Op != OpRsh32x64 { 17227 break 17228 } 17229 _ = v_1_0_0.Args[1] 17230 v_1_0_0_0 := v_1_0_0.Args[0] 17231 if v_1_0_0_0.Op != OpAdd32 { 17232 break 17233 } 17234 _ = v_1_0_0_0.Args[1] 17235 mul := v_1_0_0_0.Args[0] 17236 if mul.Op != OpHmul32 { 17237 break 17238 } 17239 _ = mul.Args[1] 17240 if x != mul.Args[0] { 17241 break 17242 } 17243 mul_1 := mul.Args[1] 17244 if mul_1.Op != OpConst32 { 17245 break 17246 } 17247 m := mul_1.AuxInt 17248 if x != v_1_0_0_0.Args[1] { 17249 break 17250 } 17251 v_1_0_0_1 := v_1_0_0.Args[1] 17252 if v_1_0_0_1.Op != OpConst64 { 17253 break 17254 } 17255 s := v_1_0_0_1.AuxInt 17256 v_1_0_1 := v_1_0.Args[1] 17257 if v_1_0_1.Op != OpRsh32x64 { 17258 break 17259 } 17260 _ = v_1_0_1.Args[1] 17261 if x != v_1_0_1.Args[0] { 17262 break 17263 } 17264 v_1_0_1_1 := v_1_0_1.Args[1] 17265 if v_1_0_1_1.Op != OpConst64 || v_1_0_1_1.AuxInt != 31 { 17266 break 17267 } 17268 v_1_1 := v_1.Args[1] 17269 if v_1_1.Op != OpConst32 { 17270 break 17271 } 17272 c := v_1_1.AuxInt 17273 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m)) && s == smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 17274 break 17275 } 17276 v.reset(OpLeq32U) 17277 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 17278 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 17279 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 17280 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17281 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 17282 v2.AddArg(v3) 17283 v2.AddArg(x) 17284 v1.AddArg(v2) 17285 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17286 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 17287 v1.AddArg(v4) 17288 v0.AddArg(v1) 17289 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17290 v5.AuxInt = int64(32 - sdivisible(32, c).k) 17291 v0.AddArg(v5) 17292 v.AddArg(v0) 17293 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17294 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 17295 v.AddArg(v6) 17296 return true 17297 } 17298 // match: (Eq32 x (Mul32 (Sub32 (Rsh32x64 (Add32 x mul:(Hmul32 (Const32 [m]) x)) (Const64 [s])) (Rsh32x64 x (Const64 [31]))) (Const32 [c]))) 17299 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m)) && s == smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 17300 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 17301 for { 17302 _ = v.Args[1] 17303 x := v.Args[0] 17304 v_1 := v.Args[1] 17305 if v_1.Op != OpMul32 { 17306 break 17307 } 17308 _ = v_1.Args[1] 17309 v_1_0 := v_1.Args[0] 17310 if v_1_0.Op != OpSub32 { 17311 break 17312 } 17313 _ = v_1_0.Args[1] 17314 v_1_0_0 := v_1_0.Args[0] 17315 if v_1_0_0.Op != OpRsh32x64 { 17316 break 17317 } 17318 _ = v_1_0_0.Args[1] 17319 v_1_0_0_0 := v_1_0_0.Args[0] 17320 if v_1_0_0_0.Op != OpAdd32 { 17321 break 17322 } 17323 _ = v_1_0_0_0.Args[1] 17324 if x != v_1_0_0_0.Args[0] { 17325 break 17326 } 17327 mul := v_1_0_0_0.Args[1] 17328 if mul.Op != OpHmul32 { 17329 break 17330 } 17331 _ = mul.Args[1] 17332 mul_0 := mul.Args[0] 17333 if mul_0.Op != OpConst32 { 17334 break 17335 } 17336 m := mul_0.AuxInt 17337 if x != mul.Args[1] { 17338 break 17339 } 17340 v_1_0_0_1 := v_1_0_0.Args[1] 17341 if v_1_0_0_1.Op != OpConst64 { 17342 break 17343 } 17344 s := v_1_0_0_1.AuxInt 17345 v_1_0_1 := v_1_0.Args[1] 17346 if v_1_0_1.Op != OpRsh32x64 { 17347 break 17348 } 17349 _ = v_1_0_1.Args[1] 17350 if x != v_1_0_1.Args[0] { 17351 break 17352 } 17353 v_1_0_1_1 := v_1_0_1.Args[1] 17354 if v_1_0_1_1.Op != OpConst64 || v_1_0_1_1.AuxInt != 31 { 17355 break 17356 } 17357 v_1_1 := v_1.Args[1] 17358 if v_1_1.Op != OpConst32 { 17359 break 17360 } 17361 c := v_1_1.AuxInt 17362 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m)) && s == smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 17363 break 17364 } 17365 v.reset(OpLeq32U) 17366 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 17367 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 17368 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 17369 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17370 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 17371 v2.AddArg(v3) 17372 v2.AddArg(x) 17373 v1.AddArg(v2) 17374 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17375 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 17376 v1.AddArg(v4) 17377 v0.AddArg(v1) 17378 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17379 v5.AuxInt = int64(32 - sdivisible(32, c).k) 17380 v0.AddArg(v5) 17381 v.AddArg(v0) 17382 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17383 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 17384 v.AddArg(v6) 17385 return true 17386 } 17387 // match: (Eq32 x (Mul32 (Sub32 (Rsh32x64 (Add32 x mul:(Hmul32 x (Const32 [m]))) (Const64 [s])) (Rsh32x64 x (Const64 [31]))) (Const32 [c]))) 17388 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m)) && s == smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 17389 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 17390 for { 17391 _ = v.Args[1] 17392 x := v.Args[0] 17393 v_1 := v.Args[1] 17394 if v_1.Op != OpMul32 { 17395 break 17396 } 17397 _ = v_1.Args[1] 17398 v_1_0 := v_1.Args[0] 17399 if v_1_0.Op != OpSub32 { 17400 break 17401 } 17402 _ = v_1_0.Args[1] 17403 v_1_0_0 := v_1_0.Args[0] 17404 if v_1_0_0.Op != OpRsh32x64 { 17405 break 17406 } 17407 _ = v_1_0_0.Args[1] 17408 v_1_0_0_0 := v_1_0_0.Args[0] 17409 if v_1_0_0_0.Op != OpAdd32 { 17410 break 17411 } 17412 _ = v_1_0_0_0.Args[1] 17413 if x != v_1_0_0_0.Args[0] { 17414 break 17415 } 17416 mul := v_1_0_0_0.Args[1] 17417 if mul.Op != OpHmul32 { 17418 break 17419 } 17420 _ = mul.Args[1] 17421 if x != mul.Args[0] { 17422 break 17423 } 17424 mul_1 := mul.Args[1] 17425 if mul_1.Op != OpConst32 { 17426 break 17427 } 17428 m := mul_1.AuxInt 17429 v_1_0_0_1 := v_1_0_0.Args[1] 17430 if v_1_0_0_1.Op != OpConst64 { 17431 break 17432 } 17433 s := v_1_0_0_1.AuxInt 17434 v_1_0_1 := v_1_0.Args[1] 17435 if v_1_0_1.Op != OpRsh32x64 { 17436 break 17437 } 17438 _ = v_1_0_1.Args[1] 17439 if x != v_1_0_1.Args[0] { 17440 break 17441 } 17442 v_1_0_1_1 := v_1_0_1.Args[1] 17443 if v_1_0_1_1.Op != OpConst64 || v_1_0_1_1.AuxInt != 31 { 17444 break 17445 } 17446 v_1_1 := v_1.Args[1] 17447 if v_1_1.Op != OpConst32 { 17448 break 17449 } 17450 c := v_1_1.AuxInt 17451 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m)) && s == smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 17452 break 17453 } 17454 v.reset(OpLeq32U) 17455 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 17456 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 17457 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 17458 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17459 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 17460 v2.AddArg(v3) 17461 v2.AddArg(x) 17462 v1.AddArg(v2) 17463 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17464 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 17465 v1.AddArg(v4) 17466 v0.AddArg(v1) 17467 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17468 v5.AuxInt = int64(32 - sdivisible(32, c).k) 17469 v0.AddArg(v5) 17470 v.AddArg(v0) 17471 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17472 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 17473 v.AddArg(v6) 17474 return true 17475 } 17476 // match: (Eq32 (Mul32 (Const32 [c]) (Sub32 (Rsh32x64 (Add32 mul:(Hmul32 (Const32 [m]) x) x) (Const64 [s])) (Rsh32x64 x (Const64 [31])))) x) 17477 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m)) && s == smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 17478 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 17479 for { 17480 x := v.Args[1] 17481 v_0 := v.Args[0] 17482 if v_0.Op != OpMul32 { 17483 break 17484 } 17485 _ = v_0.Args[1] 17486 v_0_0 := v_0.Args[0] 17487 if v_0_0.Op != OpConst32 { 17488 break 17489 } 17490 c := v_0_0.AuxInt 17491 v_0_1 := v_0.Args[1] 17492 if v_0_1.Op != OpSub32 { 17493 break 17494 } 17495 _ = v_0_1.Args[1] 17496 v_0_1_0 := v_0_1.Args[0] 17497 if v_0_1_0.Op != OpRsh32x64 { 17498 break 17499 } 17500 _ = v_0_1_0.Args[1] 17501 v_0_1_0_0 := v_0_1_0.Args[0] 17502 if v_0_1_0_0.Op != OpAdd32 { 17503 break 17504 } 17505 _ = v_0_1_0_0.Args[1] 17506 mul := v_0_1_0_0.Args[0] 17507 if mul.Op != OpHmul32 { 17508 break 17509 } 17510 _ = mul.Args[1] 17511 mul_0 := mul.Args[0] 17512 if mul_0.Op != OpConst32 { 17513 break 17514 } 17515 m := mul_0.AuxInt 17516 if x != mul.Args[1] || x != v_0_1_0_0.Args[1] { 17517 break 17518 } 17519 v_0_1_0_1 := v_0_1_0.Args[1] 17520 if v_0_1_0_1.Op != OpConst64 { 17521 break 17522 } 17523 s := v_0_1_0_1.AuxInt 17524 v_0_1_1 := v_0_1.Args[1] 17525 if v_0_1_1.Op != OpRsh32x64 { 17526 break 17527 } 17528 _ = v_0_1_1.Args[1] 17529 if x != v_0_1_1.Args[0] { 17530 break 17531 } 17532 v_0_1_1_1 := v_0_1_1.Args[1] 17533 if v_0_1_1_1.Op != OpConst64 || v_0_1_1_1.AuxInt != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m)) && s == smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 17534 break 17535 } 17536 v.reset(OpLeq32U) 17537 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 17538 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 17539 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 17540 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17541 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 17542 v2.AddArg(v3) 17543 v2.AddArg(x) 17544 v1.AddArg(v2) 17545 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17546 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 17547 v1.AddArg(v4) 17548 v0.AddArg(v1) 17549 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17550 v5.AuxInt = int64(32 - sdivisible(32, c).k) 17551 v0.AddArg(v5) 17552 v.AddArg(v0) 17553 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17554 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 17555 v.AddArg(v6) 17556 return true 17557 } 17558 return false 17559 } 17560 func rewriteValuegeneric_OpEq32_80(v *Value) bool { 17561 b := v.Block 17562 typ := &b.Func.Config.Types 17563 // match: (Eq32 (Mul32 (Const32 [c]) (Sub32 (Rsh32x64 (Add32 mul:(Hmul32 x (Const32 [m])) x) (Const64 [s])) (Rsh32x64 x (Const64 [31])))) x) 17564 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m)) && s == smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 17565 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 17566 for { 17567 x := v.Args[1] 17568 v_0 := v.Args[0] 17569 if v_0.Op != OpMul32 { 17570 break 17571 } 17572 _ = v_0.Args[1] 17573 v_0_0 := v_0.Args[0] 17574 if v_0_0.Op != OpConst32 { 17575 break 17576 } 17577 c := v_0_0.AuxInt 17578 v_0_1 := v_0.Args[1] 17579 if v_0_1.Op != OpSub32 { 17580 break 17581 } 17582 _ = v_0_1.Args[1] 17583 v_0_1_0 := v_0_1.Args[0] 17584 if v_0_1_0.Op != OpRsh32x64 { 17585 break 17586 } 17587 _ = v_0_1_0.Args[1] 17588 v_0_1_0_0 := v_0_1_0.Args[0] 17589 if v_0_1_0_0.Op != OpAdd32 { 17590 break 17591 } 17592 _ = v_0_1_0_0.Args[1] 17593 mul := v_0_1_0_0.Args[0] 17594 if mul.Op != OpHmul32 { 17595 break 17596 } 17597 _ = mul.Args[1] 17598 if x != mul.Args[0] { 17599 break 17600 } 17601 mul_1 := mul.Args[1] 17602 if mul_1.Op != OpConst32 { 17603 break 17604 } 17605 m := mul_1.AuxInt 17606 if x != v_0_1_0_0.Args[1] { 17607 break 17608 } 17609 v_0_1_0_1 := v_0_1_0.Args[1] 17610 if v_0_1_0_1.Op != OpConst64 { 17611 break 17612 } 17613 s := v_0_1_0_1.AuxInt 17614 v_0_1_1 := v_0_1.Args[1] 17615 if v_0_1_1.Op != OpRsh32x64 { 17616 break 17617 } 17618 _ = v_0_1_1.Args[1] 17619 if x != v_0_1_1.Args[0] { 17620 break 17621 } 17622 v_0_1_1_1 := v_0_1_1.Args[1] 17623 if v_0_1_1_1.Op != OpConst64 || v_0_1_1_1.AuxInt != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m)) && s == smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 17624 break 17625 } 17626 v.reset(OpLeq32U) 17627 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 17628 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 17629 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 17630 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17631 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 17632 v2.AddArg(v3) 17633 v2.AddArg(x) 17634 v1.AddArg(v2) 17635 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17636 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 17637 v1.AddArg(v4) 17638 v0.AddArg(v1) 17639 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17640 v5.AuxInt = int64(32 - sdivisible(32, c).k) 17641 v0.AddArg(v5) 17642 v.AddArg(v0) 17643 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17644 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 17645 v.AddArg(v6) 17646 return true 17647 } 17648 // match: (Eq32 (Mul32 (Const32 [c]) (Sub32 (Rsh32x64 (Add32 x mul:(Hmul32 (Const32 [m]) x)) (Const64 [s])) (Rsh32x64 x (Const64 [31])))) x) 17649 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m)) && s == smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 17650 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 17651 for { 17652 x := v.Args[1] 17653 v_0 := v.Args[0] 17654 if v_0.Op != OpMul32 { 17655 break 17656 } 17657 _ = v_0.Args[1] 17658 v_0_0 := v_0.Args[0] 17659 if v_0_0.Op != OpConst32 { 17660 break 17661 } 17662 c := v_0_0.AuxInt 17663 v_0_1 := v_0.Args[1] 17664 if v_0_1.Op != OpSub32 { 17665 break 17666 } 17667 _ = v_0_1.Args[1] 17668 v_0_1_0 := v_0_1.Args[0] 17669 if v_0_1_0.Op != OpRsh32x64 { 17670 break 17671 } 17672 _ = v_0_1_0.Args[1] 17673 v_0_1_0_0 := v_0_1_0.Args[0] 17674 if v_0_1_0_0.Op != OpAdd32 { 17675 break 17676 } 17677 _ = v_0_1_0_0.Args[1] 17678 if x != v_0_1_0_0.Args[0] { 17679 break 17680 } 17681 mul := v_0_1_0_0.Args[1] 17682 if mul.Op != OpHmul32 { 17683 break 17684 } 17685 _ = mul.Args[1] 17686 mul_0 := mul.Args[0] 17687 if mul_0.Op != OpConst32 { 17688 break 17689 } 17690 m := mul_0.AuxInt 17691 if x != mul.Args[1] { 17692 break 17693 } 17694 v_0_1_0_1 := v_0_1_0.Args[1] 17695 if v_0_1_0_1.Op != OpConst64 { 17696 break 17697 } 17698 s := v_0_1_0_1.AuxInt 17699 v_0_1_1 := v_0_1.Args[1] 17700 if v_0_1_1.Op != OpRsh32x64 { 17701 break 17702 } 17703 _ = v_0_1_1.Args[1] 17704 if x != v_0_1_1.Args[0] { 17705 break 17706 } 17707 v_0_1_1_1 := v_0_1_1.Args[1] 17708 if v_0_1_1_1.Op != OpConst64 || v_0_1_1_1.AuxInt != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m)) && s == smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 17709 break 17710 } 17711 v.reset(OpLeq32U) 17712 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 17713 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 17714 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 17715 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17716 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 17717 v2.AddArg(v3) 17718 v2.AddArg(x) 17719 v1.AddArg(v2) 17720 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17721 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 17722 v1.AddArg(v4) 17723 v0.AddArg(v1) 17724 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17725 v5.AuxInt = int64(32 - sdivisible(32, c).k) 17726 v0.AddArg(v5) 17727 v.AddArg(v0) 17728 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17729 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 17730 v.AddArg(v6) 17731 return true 17732 } 17733 // match: (Eq32 (Mul32 (Const32 [c]) (Sub32 (Rsh32x64 (Add32 x mul:(Hmul32 x (Const32 [m]))) (Const64 [s])) (Rsh32x64 x (Const64 [31])))) x) 17734 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m)) && s == smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 17735 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 17736 for { 17737 x := v.Args[1] 17738 v_0 := v.Args[0] 17739 if v_0.Op != OpMul32 { 17740 break 17741 } 17742 _ = v_0.Args[1] 17743 v_0_0 := v_0.Args[0] 17744 if v_0_0.Op != OpConst32 { 17745 break 17746 } 17747 c := v_0_0.AuxInt 17748 v_0_1 := v_0.Args[1] 17749 if v_0_1.Op != OpSub32 { 17750 break 17751 } 17752 _ = v_0_1.Args[1] 17753 v_0_1_0 := v_0_1.Args[0] 17754 if v_0_1_0.Op != OpRsh32x64 { 17755 break 17756 } 17757 _ = v_0_1_0.Args[1] 17758 v_0_1_0_0 := v_0_1_0.Args[0] 17759 if v_0_1_0_0.Op != OpAdd32 { 17760 break 17761 } 17762 _ = v_0_1_0_0.Args[1] 17763 if x != v_0_1_0_0.Args[0] { 17764 break 17765 } 17766 mul := v_0_1_0_0.Args[1] 17767 if mul.Op != OpHmul32 { 17768 break 17769 } 17770 _ = mul.Args[1] 17771 if x != mul.Args[0] { 17772 break 17773 } 17774 mul_1 := mul.Args[1] 17775 if mul_1.Op != OpConst32 { 17776 break 17777 } 17778 m := mul_1.AuxInt 17779 v_0_1_0_1 := v_0_1_0.Args[1] 17780 if v_0_1_0_1.Op != OpConst64 { 17781 break 17782 } 17783 s := v_0_1_0_1.AuxInt 17784 v_0_1_1 := v_0_1.Args[1] 17785 if v_0_1_1.Op != OpRsh32x64 { 17786 break 17787 } 17788 _ = v_0_1_1.Args[1] 17789 if x != v_0_1_1.Args[0] { 17790 break 17791 } 17792 v_0_1_1_1 := v_0_1_1.Args[1] 17793 if v_0_1_1_1.Op != OpConst64 || v_0_1_1_1.AuxInt != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m)) && s == smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 17794 break 17795 } 17796 v.reset(OpLeq32U) 17797 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 17798 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 17799 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 17800 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17801 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 17802 v2.AddArg(v3) 17803 v2.AddArg(x) 17804 v1.AddArg(v2) 17805 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17806 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 17807 v1.AddArg(v4) 17808 v0.AddArg(v1) 17809 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17810 v5.AuxInt = int64(32 - sdivisible(32, c).k) 17811 v0.AddArg(v5) 17812 v.AddArg(v0) 17813 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17814 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 17815 v.AddArg(v6) 17816 return true 17817 } 17818 // match: (Eq32 (Mul32 (Sub32 (Rsh32x64 (Add32 mul:(Hmul32 (Const32 [m]) x) x) (Const64 [s])) (Rsh32x64 x (Const64 [31]))) (Const32 [c])) x) 17819 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m)) && s == smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 17820 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 17821 for { 17822 x := v.Args[1] 17823 v_0 := v.Args[0] 17824 if v_0.Op != OpMul32 { 17825 break 17826 } 17827 _ = v_0.Args[1] 17828 v_0_0 := v_0.Args[0] 17829 if v_0_0.Op != OpSub32 { 17830 break 17831 } 17832 _ = v_0_0.Args[1] 17833 v_0_0_0 := v_0_0.Args[0] 17834 if v_0_0_0.Op != OpRsh32x64 { 17835 break 17836 } 17837 _ = v_0_0_0.Args[1] 17838 v_0_0_0_0 := v_0_0_0.Args[0] 17839 if v_0_0_0_0.Op != OpAdd32 { 17840 break 17841 } 17842 _ = v_0_0_0_0.Args[1] 17843 mul := v_0_0_0_0.Args[0] 17844 if mul.Op != OpHmul32 { 17845 break 17846 } 17847 _ = mul.Args[1] 17848 mul_0 := mul.Args[0] 17849 if mul_0.Op != OpConst32 { 17850 break 17851 } 17852 m := mul_0.AuxInt 17853 if x != mul.Args[1] || x != v_0_0_0_0.Args[1] { 17854 break 17855 } 17856 v_0_0_0_1 := v_0_0_0.Args[1] 17857 if v_0_0_0_1.Op != OpConst64 { 17858 break 17859 } 17860 s := v_0_0_0_1.AuxInt 17861 v_0_0_1 := v_0_0.Args[1] 17862 if v_0_0_1.Op != OpRsh32x64 { 17863 break 17864 } 17865 _ = v_0_0_1.Args[1] 17866 if x != v_0_0_1.Args[0] { 17867 break 17868 } 17869 v_0_0_1_1 := v_0_0_1.Args[1] 17870 if v_0_0_1_1.Op != OpConst64 || v_0_0_1_1.AuxInt != 31 { 17871 break 17872 } 17873 v_0_1 := v_0.Args[1] 17874 if v_0_1.Op != OpConst32 { 17875 break 17876 } 17877 c := v_0_1.AuxInt 17878 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m)) && s == smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 17879 break 17880 } 17881 v.reset(OpLeq32U) 17882 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 17883 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 17884 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 17885 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17886 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 17887 v2.AddArg(v3) 17888 v2.AddArg(x) 17889 v1.AddArg(v2) 17890 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17891 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 17892 v1.AddArg(v4) 17893 v0.AddArg(v1) 17894 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17895 v5.AuxInt = int64(32 - sdivisible(32, c).k) 17896 v0.AddArg(v5) 17897 v.AddArg(v0) 17898 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17899 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 17900 v.AddArg(v6) 17901 return true 17902 } 17903 // match: (Eq32 (Mul32 (Sub32 (Rsh32x64 (Add32 mul:(Hmul32 x (Const32 [m])) x) (Const64 [s])) (Rsh32x64 x (Const64 [31]))) (Const32 [c])) x) 17904 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m)) && s == smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 17905 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 17906 for { 17907 x := v.Args[1] 17908 v_0 := v.Args[0] 17909 if v_0.Op != OpMul32 { 17910 break 17911 } 17912 _ = v_0.Args[1] 17913 v_0_0 := v_0.Args[0] 17914 if v_0_0.Op != OpSub32 { 17915 break 17916 } 17917 _ = v_0_0.Args[1] 17918 v_0_0_0 := v_0_0.Args[0] 17919 if v_0_0_0.Op != OpRsh32x64 { 17920 break 17921 } 17922 _ = v_0_0_0.Args[1] 17923 v_0_0_0_0 := v_0_0_0.Args[0] 17924 if v_0_0_0_0.Op != OpAdd32 { 17925 break 17926 } 17927 _ = v_0_0_0_0.Args[1] 17928 mul := v_0_0_0_0.Args[0] 17929 if mul.Op != OpHmul32 { 17930 break 17931 } 17932 _ = mul.Args[1] 17933 if x != mul.Args[0] { 17934 break 17935 } 17936 mul_1 := mul.Args[1] 17937 if mul_1.Op != OpConst32 { 17938 break 17939 } 17940 m := mul_1.AuxInt 17941 if x != v_0_0_0_0.Args[1] { 17942 break 17943 } 17944 v_0_0_0_1 := v_0_0_0.Args[1] 17945 if v_0_0_0_1.Op != OpConst64 { 17946 break 17947 } 17948 s := v_0_0_0_1.AuxInt 17949 v_0_0_1 := v_0_0.Args[1] 17950 if v_0_0_1.Op != OpRsh32x64 { 17951 break 17952 } 17953 _ = v_0_0_1.Args[1] 17954 if x != v_0_0_1.Args[0] { 17955 break 17956 } 17957 v_0_0_1_1 := v_0_0_1.Args[1] 17958 if v_0_0_1_1.Op != OpConst64 || v_0_0_1_1.AuxInt != 31 { 17959 break 17960 } 17961 v_0_1 := v_0.Args[1] 17962 if v_0_1.Op != OpConst32 { 17963 break 17964 } 17965 c := v_0_1.AuxInt 17966 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m)) && s == smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 17967 break 17968 } 17969 v.reset(OpLeq32U) 17970 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 17971 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 17972 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 17973 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17974 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 17975 v2.AddArg(v3) 17976 v2.AddArg(x) 17977 v1.AddArg(v2) 17978 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17979 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 17980 v1.AddArg(v4) 17981 v0.AddArg(v1) 17982 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17983 v5.AuxInt = int64(32 - sdivisible(32, c).k) 17984 v0.AddArg(v5) 17985 v.AddArg(v0) 17986 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 17987 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 17988 v.AddArg(v6) 17989 return true 17990 } 17991 // match: (Eq32 (Mul32 (Sub32 (Rsh32x64 (Add32 x mul:(Hmul32 (Const32 [m]) x)) (Const64 [s])) (Rsh32x64 x (Const64 [31]))) (Const32 [c])) x) 17992 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m)) && s == smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 17993 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 17994 for { 17995 x := v.Args[1] 17996 v_0 := v.Args[0] 17997 if v_0.Op != OpMul32 { 17998 break 17999 } 18000 _ = v_0.Args[1] 18001 v_0_0 := v_0.Args[0] 18002 if v_0_0.Op != OpSub32 { 18003 break 18004 } 18005 _ = v_0_0.Args[1] 18006 v_0_0_0 := v_0_0.Args[0] 18007 if v_0_0_0.Op != OpRsh32x64 { 18008 break 18009 } 18010 _ = v_0_0_0.Args[1] 18011 v_0_0_0_0 := v_0_0_0.Args[0] 18012 if v_0_0_0_0.Op != OpAdd32 { 18013 break 18014 } 18015 _ = v_0_0_0_0.Args[1] 18016 if x != v_0_0_0_0.Args[0] { 18017 break 18018 } 18019 mul := v_0_0_0_0.Args[1] 18020 if mul.Op != OpHmul32 { 18021 break 18022 } 18023 _ = mul.Args[1] 18024 mul_0 := mul.Args[0] 18025 if mul_0.Op != OpConst32 { 18026 break 18027 } 18028 m := mul_0.AuxInt 18029 if x != mul.Args[1] { 18030 break 18031 } 18032 v_0_0_0_1 := v_0_0_0.Args[1] 18033 if v_0_0_0_1.Op != OpConst64 { 18034 break 18035 } 18036 s := v_0_0_0_1.AuxInt 18037 v_0_0_1 := v_0_0.Args[1] 18038 if v_0_0_1.Op != OpRsh32x64 { 18039 break 18040 } 18041 _ = v_0_0_1.Args[1] 18042 if x != v_0_0_1.Args[0] { 18043 break 18044 } 18045 v_0_0_1_1 := v_0_0_1.Args[1] 18046 if v_0_0_1_1.Op != OpConst64 || v_0_0_1_1.AuxInt != 31 { 18047 break 18048 } 18049 v_0_1 := v_0.Args[1] 18050 if v_0_1.Op != OpConst32 { 18051 break 18052 } 18053 c := v_0_1.AuxInt 18054 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m)) && s == smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 18055 break 18056 } 18057 v.reset(OpLeq32U) 18058 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 18059 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 18060 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 18061 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 18062 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 18063 v2.AddArg(v3) 18064 v2.AddArg(x) 18065 v1.AddArg(v2) 18066 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 18067 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 18068 v1.AddArg(v4) 18069 v0.AddArg(v1) 18070 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 18071 v5.AuxInt = int64(32 - sdivisible(32, c).k) 18072 v0.AddArg(v5) 18073 v.AddArg(v0) 18074 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 18075 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 18076 v.AddArg(v6) 18077 return true 18078 } 18079 // match: (Eq32 (Mul32 (Sub32 (Rsh32x64 (Add32 x mul:(Hmul32 x (Const32 [m]))) (Const64 [s])) (Rsh32x64 x (Const64 [31]))) (Const32 [c])) x) 18080 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32,c).m)) && s == smagic(32,c).s && x.Op != OpConst32 && sdivisibleOK(32,c) 18081 // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).m))]) x) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).a))]) ) (Const32 <typ.UInt32> [int64(32-sdivisible(32,c).k)]) ) (Const32 <typ.UInt32> [int64(int32(sdivisible(32,c).max))]) ) 18082 for { 18083 x := v.Args[1] 18084 v_0 := v.Args[0] 18085 if v_0.Op != OpMul32 { 18086 break 18087 } 18088 _ = v_0.Args[1] 18089 v_0_0 := v_0.Args[0] 18090 if v_0_0.Op != OpSub32 { 18091 break 18092 } 18093 _ = v_0_0.Args[1] 18094 v_0_0_0 := v_0_0.Args[0] 18095 if v_0_0_0.Op != OpRsh32x64 { 18096 break 18097 } 18098 _ = v_0_0_0.Args[1] 18099 v_0_0_0_0 := v_0_0_0.Args[0] 18100 if v_0_0_0_0.Op != OpAdd32 { 18101 break 18102 } 18103 _ = v_0_0_0_0.Args[1] 18104 if x != v_0_0_0_0.Args[0] { 18105 break 18106 } 18107 mul := v_0_0_0_0.Args[1] 18108 if mul.Op != OpHmul32 { 18109 break 18110 } 18111 _ = mul.Args[1] 18112 if x != mul.Args[0] { 18113 break 18114 } 18115 mul_1 := mul.Args[1] 18116 if mul_1.Op != OpConst32 { 18117 break 18118 } 18119 m := mul_1.AuxInt 18120 v_0_0_0_1 := v_0_0_0.Args[1] 18121 if v_0_0_0_1.Op != OpConst64 { 18122 break 18123 } 18124 s := v_0_0_0_1.AuxInt 18125 v_0_0_1 := v_0_0.Args[1] 18126 if v_0_0_1.Op != OpRsh32x64 { 18127 break 18128 } 18129 _ = v_0_0_1.Args[1] 18130 if x != v_0_0_1.Args[0] { 18131 break 18132 } 18133 v_0_0_1_1 := v_0_0_1.Args[1] 18134 if v_0_0_1_1.Op != OpConst64 || v_0_0_1_1.AuxInt != 31 { 18135 break 18136 } 18137 v_0_1 := v_0.Args[1] 18138 if v_0_1.Op != OpConst32 { 18139 break 18140 } 18141 c := v_0_1.AuxInt 18142 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(int32(smagic(32, c).m)) && s == smagic(32, c).s && x.Op != OpConst32 && sdivisibleOK(32, c)) { 18143 break 18144 } 18145 v.reset(OpLeq32U) 18146 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32) 18147 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32) 18148 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32) 18149 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 18150 v3.AuxInt = int64(int32(sdivisible(32, c).m)) 18151 v2.AddArg(v3) 18152 v2.AddArg(x) 18153 v1.AddArg(v2) 18154 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 18155 v4.AuxInt = int64(int32(sdivisible(32, c).a)) 18156 v1.AddArg(v4) 18157 v0.AddArg(v1) 18158 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 18159 v5.AuxInt = int64(32 - sdivisible(32, c).k) 18160 v0.AddArg(v5) 18161 v.AddArg(v0) 18162 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 18163 v6.AuxInt = int64(int32(sdivisible(32, c).max)) 18164 v.AddArg(v6) 18165 return true 18166 } 18167 // match: (Eq32 n (Lsh32x64 (Rsh32x64 (Add32 <t> n (Rsh32Ux64 <t> (Rsh32x64 <t> n (Const64 <typ.UInt64> [31])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k]))) 18168 // cond: k > 0 && k < 31 && kbar == 32 - k 18169 // result: (Eq32 (And32 <t> n (Const32 <t> [int64(1<<uint(k)-1)])) (Const32 <t> [0])) 18170 for { 18171 _ = v.Args[1] 18172 n := v.Args[0] 18173 v_1 := v.Args[1] 18174 if v_1.Op != OpLsh32x64 { 18175 break 18176 } 18177 _ = v_1.Args[1] 18178 v_1_0 := v_1.Args[0] 18179 if v_1_0.Op != OpRsh32x64 { 18180 break 18181 } 18182 _ = v_1_0.Args[1] 18183 v_1_0_0 := v_1_0.Args[0] 18184 if v_1_0_0.Op != OpAdd32 { 18185 break 18186 } 18187 t := v_1_0_0.Type 18188 _ = v_1_0_0.Args[1] 18189 if n != v_1_0_0.Args[0] { 18190 break 18191 } 18192 v_1_0_0_1 := v_1_0_0.Args[1] 18193 if v_1_0_0_1.Op != OpRsh32Ux64 || v_1_0_0_1.Type != t { 18194 break 18195 } 18196 _ = v_1_0_0_1.Args[1] 18197 v_1_0_0_1_0 := v_1_0_0_1.Args[0] 18198 if v_1_0_0_1_0.Op != OpRsh32x64 || v_1_0_0_1_0.Type != t { 18199 break 18200 } 18201 _ = v_1_0_0_1_0.Args[1] 18202 if n != v_1_0_0_1_0.Args[0] { 18203 break 18204 } 18205 v_1_0_0_1_0_1 := v_1_0_0_1_0.Args[1] 18206 if v_1_0_0_1_0_1.Op != OpConst64 || v_1_0_0_1_0_1.Type != typ.UInt64 || v_1_0_0_1_0_1.AuxInt != 31 { 18207 break 18208 } 18209 v_1_0_0_1_1 := v_1_0_0_1.Args[1] 18210 if v_1_0_0_1_1.Op != OpConst64 || v_1_0_0_1_1.Type != typ.UInt64 { 18211 break 18212 } 18213 kbar := v_1_0_0_1_1.AuxInt 18214 v_1_0_1 := v_1_0.Args[1] 18215 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 { 18216 break 18217 } 18218 k := v_1_0_1.AuxInt 18219 v_1_1 := v_1.Args[1] 18220 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || v_1_1.AuxInt != k || !(k > 0 && k < 31 && kbar == 32-k) { 18221 break 18222 } 18223 v.reset(OpEq32) 18224 v0 := b.NewValue0(v.Pos, OpAnd32, t) 18225 v0.AddArg(n) 18226 v1 := b.NewValue0(v.Pos, OpConst32, t) 18227 v1.AuxInt = int64(1<<uint(k) - 1) 18228 v0.AddArg(v1) 18229 v.AddArg(v0) 18230 v2 := b.NewValue0(v.Pos, OpConst32, t) 18231 v2.AuxInt = 0 18232 v.AddArg(v2) 18233 return true 18234 } 18235 // match: (Eq32 n (Lsh32x64 (Rsh32x64 (Add32 <t> (Rsh32Ux64 <t> (Rsh32x64 <t> n (Const64 <typ.UInt64> [31])) (Const64 <typ.UInt64> [kbar])) n) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k]))) 18236 // cond: k > 0 && k < 31 && kbar == 32 - k 18237 // result: (Eq32 (And32 <t> n (Const32 <t> [int64(1<<uint(k)-1)])) (Const32 <t> [0])) 18238 for { 18239 _ = v.Args[1] 18240 n := v.Args[0] 18241 v_1 := v.Args[1] 18242 if v_1.Op != OpLsh32x64 { 18243 break 18244 } 18245 _ = v_1.Args[1] 18246 v_1_0 := v_1.Args[0] 18247 if v_1_0.Op != OpRsh32x64 { 18248 break 18249 } 18250 _ = v_1_0.Args[1] 18251 v_1_0_0 := v_1_0.Args[0] 18252 if v_1_0_0.Op != OpAdd32 { 18253 break 18254 } 18255 t := v_1_0_0.Type 18256 _ = v_1_0_0.Args[1] 18257 v_1_0_0_0 := v_1_0_0.Args[0] 18258 if v_1_0_0_0.Op != OpRsh32Ux64 || v_1_0_0_0.Type != t { 18259 break 18260 } 18261 _ = v_1_0_0_0.Args[1] 18262 v_1_0_0_0_0 := v_1_0_0_0.Args[0] 18263 if v_1_0_0_0_0.Op != OpRsh32x64 || v_1_0_0_0_0.Type != t { 18264 break 18265 } 18266 _ = v_1_0_0_0_0.Args[1] 18267 if n != v_1_0_0_0_0.Args[0] { 18268 break 18269 } 18270 v_1_0_0_0_0_1 := v_1_0_0_0_0.Args[1] 18271 if v_1_0_0_0_0_1.Op != OpConst64 || v_1_0_0_0_0_1.Type != typ.UInt64 || v_1_0_0_0_0_1.AuxInt != 31 { 18272 break 18273 } 18274 v_1_0_0_0_1 := v_1_0_0_0.Args[1] 18275 if v_1_0_0_0_1.Op != OpConst64 || v_1_0_0_0_1.Type != typ.UInt64 { 18276 break 18277 } 18278 kbar := v_1_0_0_0_1.AuxInt 18279 if n != v_1_0_0.Args[1] { 18280 break 18281 } 18282 v_1_0_1 := v_1_0.Args[1] 18283 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 { 18284 break 18285 } 18286 k := v_1_0_1.AuxInt 18287 v_1_1 := v_1.Args[1] 18288 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || v_1_1.AuxInt != k || !(k > 0 && k < 31 && kbar == 32-k) { 18289 break 18290 } 18291 v.reset(OpEq32) 18292 v0 := b.NewValue0(v.Pos, OpAnd32, t) 18293 v0.AddArg(n) 18294 v1 := b.NewValue0(v.Pos, OpConst32, t) 18295 v1.AuxInt = int64(1<<uint(k) - 1) 18296 v0.AddArg(v1) 18297 v.AddArg(v0) 18298 v2 := b.NewValue0(v.Pos, OpConst32, t) 18299 v2.AuxInt = 0 18300 v.AddArg(v2) 18301 return true 18302 } 18303 // match: (Eq32 (Lsh32x64 (Rsh32x64 (Add32 <t> n (Rsh32Ux64 <t> (Rsh32x64 <t> n (Const64 <typ.UInt64> [31])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) n) 18304 // cond: k > 0 && k < 31 && kbar == 32 - k 18305 // result: (Eq32 (And32 <t> n (Const32 <t> [int64(1<<uint(k)-1)])) (Const32 <t> [0])) 18306 for { 18307 n := v.Args[1] 18308 v_0 := v.Args[0] 18309 if v_0.Op != OpLsh32x64 { 18310 break 18311 } 18312 _ = v_0.Args[1] 18313 v_0_0 := v_0.Args[0] 18314 if v_0_0.Op != OpRsh32x64 { 18315 break 18316 } 18317 _ = v_0_0.Args[1] 18318 v_0_0_0 := v_0_0.Args[0] 18319 if v_0_0_0.Op != OpAdd32 { 18320 break 18321 } 18322 t := v_0_0_0.Type 18323 _ = v_0_0_0.Args[1] 18324 if n != v_0_0_0.Args[0] { 18325 break 18326 } 18327 v_0_0_0_1 := v_0_0_0.Args[1] 18328 if v_0_0_0_1.Op != OpRsh32Ux64 || v_0_0_0_1.Type != t { 18329 break 18330 } 18331 _ = v_0_0_0_1.Args[1] 18332 v_0_0_0_1_0 := v_0_0_0_1.Args[0] 18333 if v_0_0_0_1_0.Op != OpRsh32x64 || v_0_0_0_1_0.Type != t { 18334 break 18335 } 18336 _ = v_0_0_0_1_0.Args[1] 18337 if n != v_0_0_0_1_0.Args[0] { 18338 break 18339 } 18340 v_0_0_0_1_0_1 := v_0_0_0_1_0.Args[1] 18341 if v_0_0_0_1_0_1.Op != OpConst64 || v_0_0_0_1_0_1.Type != typ.UInt64 || v_0_0_0_1_0_1.AuxInt != 31 { 18342 break 18343 } 18344 v_0_0_0_1_1 := v_0_0_0_1.Args[1] 18345 if v_0_0_0_1_1.Op != OpConst64 || v_0_0_0_1_1.Type != typ.UInt64 { 18346 break 18347 } 18348 kbar := v_0_0_0_1_1.AuxInt 18349 v_0_0_1 := v_0_0.Args[1] 18350 if v_0_0_1.Op != OpConst64 || v_0_0_1.Type != typ.UInt64 { 18351 break 18352 } 18353 k := v_0_0_1.AuxInt 18354 v_0_1 := v_0.Args[1] 18355 if v_0_1.Op != OpConst64 || v_0_1.Type != typ.UInt64 || v_0_1.AuxInt != k || !(k > 0 && k < 31 && kbar == 32-k) { 18356 break 18357 } 18358 v.reset(OpEq32) 18359 v0 := b.NewValue0(v.Pos, OpAnd32, t) 18360 v0.AddArg(n) 18361 v1 := b.NewValue0(v.Pos, OpConst32, t) 18362 v1.AuxInt = int64(1<<uint(k) - 1) 18363 v0.AddArg(v1) 18364 v.AddArg(v0) 18365 v2 := b.NewValue0(v.Pos, OpConst32, t) 18366 v2.AuxInt = 0 18367 v.AddArg(v2) 18368 return true 18369 } 18370 return false 18371 } 18372 func rewriteValuegeneric_OpEq32_90(v *Value) bool { 18373 b := v.Block 18374 typ := &b.Func.Config.Types 18375 // match: (Eq32 (Lsh32x64 (Rsh32x64 (Add32 <t> (Rsh32Ux64 <t> (Rsh32x64 <t> n (Const64 <typ.UInt64> [31])) (Const64 <typ.UInt64> [kbar])) n) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) n) 18376 // cond: k > 0 && k < 31 && kbar == 32 - k 18377 // result: (Eq32 (And32 <t> n (Const32 <t> [int64(1<<uint(k)-1)])) (Const32 <t> [0])) 18378 for { 18379 n := v.Args[1] 18380 v_0 := v.Args[0] 18381 if v_0.Op != OpLsh32x64 { 18382 break 18383 } 18384 _ = v_0.Args[1] 18385 v_0_0 := v_0.Args[0] 18386 if v_0_0.Op != OpRsh32x64 { 18387 break 18388 } 18389 _ = v_0_0.Args[1] 18390 v_0_0_0 := v_0_0.Args[0] 18391 if v_0_0_0.Op != OpAdd32 { 18392 break 18393 } 18394 t := v_0_0_0.Type 18395 _ = v_0_0_0.Args[1] 18396 v_0_0_0_0 := v_0_0_0.Args[0] 18397 if v_0_0_0_0.Op != OpRsh32Ux64 || v_0_0_0_0.Type != t { 18398 break 18399 } 18400 _ = v_0_0_0_0.Args[1] 18401 v_0_0_0_0_0 := v_0_0_0_0.Args[0] 18402 if v_0_0_0_0_0.Op != OpRsh32x64 || v_0_0_0_0_0.Type != t { 18403 break 18404 } 18405 _ = v_0_0_0_0_0.Args[1] 18406 if n != v_0_0_0_0_0.Args[0] { 18407 break 18408 } 18409 v_0_0_0_0_0_1 := v_0_0_0_0_0.Args[1] 18410 if v_0_0_0_0_0_1.Op != OpConst64 || v_0_0_0_0_0_1.Type != typ.UInt64 || v_0_0_0_0_0_1.AuxInt != 31 { 18411 break 18412 } 18413 v_0_0_0_0_1 := v_0_0_0_0.Args[1] 18414 if v_0_0_0_0_1.Op != OpConst64 || v_0_0_0_0_1.Type != typ.UInt64 { 18415 break 18416 } 18417 kbar := v_0_0_0_0_1.AuxInt 18418 if n != v_0_0_0.Args[1] { 18419 break 18420 } 18421 v_0_0_1 := v_0_0.Args[1] 18422 if v_0_0_1.Op != OpConst64 || v_0_0_1.Type != typ.UInt64 { 18423 break 18424 } 18425 k := v_0_0_1.AuxInt 18426 v_0_1 := v_0.Args[1] 18427 if v_0_1.Op != OpConst64 || v_0_1.Type != typ.UInt64 || v_0_1.AuxInt != k || !(k > 0 && k < 31 && kbar == 32-k) { 18428 break 18429 } 18430 v.reset(OpEq32) 18431 v0 := b.NewValue0(v.Pos, OpAnd32, t) 18432 v0.AddArg(n) 18433 v1 := b.NewValue0(v.Pos, OpConst32, t) 18434 v1.AuxInt = int64(1<<uint(k) - 1) 18435 v0.AddArg(v1) 18436 v.AddArg(v0) 18437 v2 := b.NewValue0(v.Pos, OpConst32, t) 18438 v2.AuxInt = 0 18439 v.AddArg(v2) 18440 return true 18441 } 18442 // match: (Eq32 s:(Sub32 x y) (Const32 [0])) 18443 // cond: s.Uses == 1 18444 // result: (Eq32 x y) 18445 for { 18446 _ = v.Args[1] 18447 s := v.Args[0] 18448 if s.Op != OpSub32 { 18449 break 18450 } 18451 y := s.Args[1] 18452 x := s.Args[0] 18453 v_1 := v.Args[1] 18454 if v_1.Op != OpConst32 || v_1.AuxInt != 0 || !(s.Uses == 1) { 18455 break 18456 } 18457 v.reset(OpEq32) 18458 v.AddArg(x) 18459 v.AddArg(y) 18460 return true 18461 } 18462 // match: (Eq32 (Const32 [0]) s:(Sub32 x y)) 18463 // cond: s.Uses == 1 18464 // result: (Eq32 x y) 18465 for { 18466 _ = v.Args[1] 18467 v_0 := v.Args[0] 18468 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 18469 break 18470 } 18471 s := v.Args[1] 18472 if s.Op != OpSub32 { 18473 break 18474 } 18475 y := s.Args[1] 18476 x := s.Args[0] 18477 if !(s.Uses == 1) { 18478 break 18479 } 18480 v.reset(OpEq32) 18481 v.AddArg(x) 18482 v.AddArg(y) 18483 return true 18484 } 18485 // match: (Eq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [y])) 18486 // cond: isPowerOfTwo(y) 18487 // result: (Neq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [0])) 18488 for { 18489 _ = v.Args[1] 18490 v_0 := v.Args[0] 18491 if v_0.Op != OpAnd32 { 18492 break 18493 } 18494 t := v_0.Type 18495 _ = v_0.Args[1] 18496 x := v_0.Args[0] 18497 v_0_1 := v_0.Args[1] 18498 if v_0_1.Op != OpConst32 || v_0_1.Type != t { 18499 break 18500 } 18501 y := v_0_1.AuxInt 18502 v_1 := v.Args[1] 18503 if v_1.Op != OpConst32 || v_1.Type != t || v_1.AuxInt != y || !(isPowerOfTwo(y)) { 18504 break 18505 } 18506 v.reset(OpNeq32) 18507 v0 := b.NewValue0(v.Pos, OpAnd32, t) 18508 v0.AddArg(x) 18509 v1 := b.NewValue0(v.Pos, OpConst32, t) 18510 v1.AuxInt = y 18511 v0.AddArg(v1) 18512 v.AddArg(v0) 18513 v2 := b.NewValue0(v.Pos, OpConst32, t) 18514 v2.AuxInt = 0 18515 v.AddArg(v2) 18516 return true 18517 } 18518 // match: (Eq32 (And32 <t> (Const32 <t> [y]) x) (Const32 <t> [y])) 18519 // cond: isPowerOfTwo(y) 18520 // result: (Neq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [0])) 18521 for { 18522 _ = v.Args[1] 18523 v_0 := v.Args[0] 18524 if v_0.Op != OpAnd32 { 18525 break 18526 } 18527 t := v_0.Type 18528 x := v_0.Args[1] 18529 v_0_0 := v_0.Args[0] 18530 if v_0_0.Op != OpConst32 || v_0_0.Type != t { 18531 break 18532 } 18533 y := v_0_0.AuxInt 18534 v_1 := v.Args[1] 18535 if v_1.Op != OpConst32 || v_1.Type != t || v_1.AuxInt != y || !(isPowerOfTwo(y)) { 18536 break 18537 } 18538 v.reset(OpNeq32) 18539 v0 := b.NewValue0(v.Pos, OpAnd32, t) 18540 v0.AddArg(x) 18541 v1 := b.NewValue0(v.Pos, OpConst32, t) 18542 v1.AuxInt = y 18543 v0.AddArg(v1) 18544 v.AddArg(v0) 18545 v2 := b.NewValue0(v.Pos, OpConst32, t) 18546 v2.AuxInt = 0 18547 v.AddArg(v2) 18548 return true 18549 } 18550 // match: (Eq32 (Const32 <t> [y]) (And32 <t> x (Const32 <t> [y]))) 18551 // cond: isPowerOfTwo(y) 18552 // result: (Neq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [0])) 18553 for { 18554 _ = v.Args[1] 18555 v_0 := v.Args[0] 18556 if v_0.Op != OpConst32 { 18557 break 18558 } 18559 t := v_0.Type 18560 y := v_0.AuxInt 18561 v_1 := v.Args[1] 18562 if v_1.Op != OpAnd32 || v_1.Type != t { 18563 break 18564 } 18565 _ = v_1.Args[1] 18566 x := v_1.Args[0] 18567 v_1_1 := v_1.Args[1] 18568 if v_1_1.Op != OpConst32 || v_1_1.Type != t || v_1_1.AuxInt != y || !(isPowerOfTwo(y)) { 18569 break 18570 } 18571 v.reset(OpNeq32) 18572 v0 := b.NewValue0(v.Pos, OpAnd32, t) 18573 v0.AddArg(x) 18574 v1 := b.NewValue0(v.Pos, OpConst32, t) 18575 v1.AuxInt = y 18576 v0.AddArg(v1) 18577 v.AddArg(v0) 18578 v2 := b.NewValue0(v.Pos, OpConst32, t) 18579 v2.AuxInt = 0 18580 v.AddArg(v2) 18581 return true 18582 } 18583 // match: (Eq32 (Const32 <t> [y]) (And32 <t> (Const32 <t> [y]) x)) 18584 // cond: isPowerOfTwo(y) 18585 // result: (Neq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [0])) 18586 for { 18587 _ = v.Args[1] 18588 v_0 := v.Args[0] 18589 if v_0.Op != OpConst32 { 18590 break 18591 } 18592 t := v_0.Type 18593 y := v_0.AuxInt 18594 v_1 := v.Args[1] 18595 if v_1.Op != OpAnd32 || v_1.Type != t { 18596 break 18597 } 18598 x := v_1.Args[1] 18599 v_1_0 := v_1.Args[0] 18600 if v_1_0.Op != OpConst32 || v_1_0.Type != t || v_1_0.AuxInt != y || !(isPowerOfTwo(y)) { 18601 break 18602 } 18603 v.reset(OpNeq32) 18604 v0 := b.NewValue0(v.Pos, OpAnd32, t) 18605 v0.AddArg(x) 18606 v1 := b.NewValue0(v.Pos, OpConst32, t) 18607 v1.AuxInt = y 18608 v0.AddArg(v1) 18609 v.AddArg(v0) 18610 v2 := b.NewValue0(v.Pos, OpConst32, t) 18611 v2.AuxInt = 0 18612 v.AddArg(v2) 18613 return true 18614 } 18615 return false 18616 } 18617 func rewriteValuegeneric_OpEq32F_0(v *Value) bool { 18618 // match: (Eq32F (Const32F [c]) (Const32F [d])) 18619 // result: (ConstBool [b2i(auxTo32F(c) == auxTo32F(d))]) 18620 for { 18621 _ = v.Args[1] 18622 v_0 := v.Args[0] 18623 if v_0.Op != OpConst32F { 18624 break 18625 } 18626 c := v_0.AuxInt 18627 v_1 := v.Args[1] 18628 if v_1.Op != OpConst32F { 18629 break 18630 } 18631 d := v_1.AuxInt 18632 v.reset(OpConstBool) 18633 v.AuxInt = b2i(auxTo32F(c) == auxTo32F(d)) 18634 return true 18635 } 18636 // match: (Eq32F (Const32F [d]) (Const32F [c])) 18637 // result: (ConstBool [b2i(auxTo32F(c) == auxTo32F(d))]) 18638 for { 18639 _ = v.Args[1] 18640 v_0 := v.Args[0] 18641 if v_0.Op != OpConst32F { 18642 break 18643 } 18644 d := v_0.AuxInt 18645 v_1 := v.Args[1] 18646 if v_1.Op != OpConst32F { 18647 break 18648 } 18649 c := v_1.AuxInt 18650 v.reset(OpConstBool) 18651 v.AuxInt = b2i(auxTo32F(c) == auxTo32F(d)) 18652 return true 18653 } 18654 return false 18655 } 18656 func rewriteValuegeneric_OpEq64_0(v *Value) bool { 18657 b := v.Block 18658 typ := &b.Func.Config.Types 18659 // match: (Eq64 x x) 18660 // result: (ConstBool [1]) 18661 for { 18662 x := v.Args[1] 18663 if x != v.Args[0] { 18664 break 18665 } 18666 v.reset(OpConstBool) 18667 v.AuxInt = 1 18668 return true 18669 } 18670 // match: (Eq64 (Const64 <t> [c]) (Add64 (Const64 <t> [d]) x)) 18671 // result: (Eq64 (Const64 <t> [c-d]) x) 18672 for { 18673 _ = v.Args[1] 18674 v_0 := v.Args[0] 18675 if v_0.Op != OpConst64 { 18676 break 18677 } 18678 t := v_0.Type 18679 c := v_0.AuxInt 18680 v_1 := v.Args[1] 18681 if v_1.Op != OpAdd64 { 18682 break 18683 } 18684 x := v_1.Args[1] 18685 v_1_0 := v_1.Args[0] 18686 if v_1_0.Op != OpConst64 || v_1_0.Type != t { 18687 break 18688 } 18689 d := v_1_0.AuxInt 18690 v.reset(OpEq64) 18691 v0 := b.NewValue0(v.Pos, OpConst64, t) 18692 v0.AuxInt = c - d 18693 v.AddArg(v0) 18694 v.AddArg(x) 18695 return true 18696 } 18697 // match: (Eq64 (Const64 <t> [c]) (Add64 x (Const64 <t> [d]))) 18698 // result: (Eq64 (Const64 <t> [c-d]) x) 18699 for { 18700 _ = v.Args[1] 18701 v_0 := v.Args[0] 18702 if v_0.Op != OpConst64 { 18703 break 18704 } 18705 t := v_0.Type 18706 c := v_0.AuxInt 18707 v_1 := v.Args[1] 18708 if v_1.Op != OpAdd64 { 18709 break 18710 } 18711 _ = v_1.Args[1] 18712 x := v_1.Args[0] 18713 v_1_1 := v_1.Args[1] 18714 if v_1_1.Op != OpConst64 || v_1_1.Type != t { 18715 break 18716 } 18717 d := v_1_1.AuxInt 18718 v.reset(OpEq64) 18719 v0 := b.NewValue0(v.Pos, OpConst64, t) 18720 v0.AuxInt = c - d 18721 v.AddArg(v0) 18722 v.AddArg(x) 18723 return true 18724 } 18725 // match: (Eq64 (Add64 (Const64 <t> [d]) x) (Const64 <t> [c])) 18726 // result: (Eq64 (Const64 <t> [c-d]) x) 18727 for { 18728 _ = v.Args[1] 18729 v_0 := v.Args[0] 18730 if v_0.Op != OpAdd64 { 18731 break 18732 } 18733 x := v_0.Args[1] 18734 v_0_0 := v_0.Args[0] 18735 if v_0_0.Op != OpConst64 { 18736 break 18737 } 18738 t := v_0_0.Type 18739 d := v_0_0.AuxInt 18740 v_1 := v.Args[1] 18741 if v_1.Op != OpConst64 || v_1.Type != t { 18742 break 18743 } 18744 c := v_1.AuxInt 18745 v.reset(OpEq64) 18746 v0 := b.NewValue0(v.Pos, OpConst64, t) 18747 v0.AuxInt = c - d 18748 v.AddArg(v0) 18749 v.AddArg(x) 18750 return true 18751 } 18752 // match: (Eq64 (Add64 x (Const64 <t> [d])) (Const64 <t> [c])) 18753 // result: (Eq64 (Const64 <t> [c-d]) x) 18754 for { 18755 _ = v.Args[1] 18756 v_0 := v.Args[0] 18757 if v_0.Op != OpAdd64 { 18758 break 18759 } 18760 _ = v_0.Args[1] 18761 x := v_0.Args[0] 18762 v_0_1 := v_0.Args[1] 18763 if v_0_1.Op != OpConst64 { 18764 break 18765 } 18766 t := v_0_1.Type 18767 d := v_0_1.AuxInt 18768 v_1 := v.Args[1] 18769 if v_1.Op != OpConst64 || v_1.Type != t { 18770 break 18771 } 18772 c := v_1.AuxInt 18773 v.reset(OpEq64) 18774 v0 := b.NewValue0(v.Pos, OpConst64, t) 18775 v0.AuxInt = c - d 18776 v.AddArg(v0) 18777 v.AddArg(x) 18778 return true 18779 } 18780 // match: (Eq64 (Const64 [c]) (Const64 [d])) 18781 // result: (ConstBool [b2i(c == d)]) 18782 for { 18783 _ = v.Args[1] 18784 v_0 := v.Args[0] 18785 if v_0.Op != OpConst64 { 18786 break 18787 } 18788 c := v_0.AuxInt 18789 v_1 := v.Args[1] 18790 if v_1.Op != OpConst64 { 18791 break 18792 } 18793 d := v_1.AuxInt 18794 v.reset(OpConstBool) 18795 v.AuxInt = b2i(c == d) 18796 return true 18797 } 18798 // match: (Eq64 (Const64 [d]) (Const64 [c])) 18799 // result: (ConstBool [b2i(c == d)]) 18800 for { 18801 _ = v.Args[1] 18802 v_0 := v.Args[0] 18803 if v_0.Op != OpConst64 { 18804 break 18805 } 18806 d := v_0.AuxInt 18807 v_1 := v.Args[1] 18808 if v_1.Op != OpConst64 { 18809 break 18810 } 18811 c := v_1.AuxInt 18812 v.reset(OpConstBool) 18813 v.AuxInt = b2i(c == d) 18814 return true 18815 } 18816 // match: (Eq64 x (Mul64 (Const64 [c]) (Rsh64Ux64 mul:(Hmul64u (Const64 [m]) x) (Const64 [s])))) 18817 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+umagic(64,c).m/2) && s == umagic(64,c).s-1 && x.Op != OpConst64 && udivisibleOK(64,c) 18818 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 18819 for { 18820 _ = v.Args[1] 18821 x := v.Args[0] 18822 v_1 := v.Args[1] 18823 if v_1.Op != OpMul64 { 18824 break 18825 } 18826 _ = v_1.Args[1] 18827 v_1_0 := v_1.Args[0] 18828 if v_1_0.Op != OpConst64 { 18829 break 18830 } 18831 c := v_1_0.AuxInt 18832 v_1_1 := v_1.Args[1] 18833 if v_1_1.Op != OpRsh64Ux64 { 18834 break 18835 } 18836 _ = v_1_1.Args[1] 18837 mul := v_1_1.Args[0] 18838 if mul.Op != OpHmul64u { 18839 break 18840 } 18841 _ = mul.Args[1] 18842 mul_0 := mul.Args[0] 18843 if mul_0.Op != OpConst64 { 18844 break 18845 } 18846 m := mul_0.AuxInt 18847 if x != mul.Args[1] { 18848 break 18849 } 18850 v_1_1_1 := v_1_1.Args[1] 18851 if v_1_1_1.Op != OpConst64 { 18852 break 18853 } 18854 s := v_1_1_1.AuxInt 18855 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+umagic(64, c).m/2) && s == umagic(64, c).s-1 && x.Op != OpConst64 && udivisibleOK(64, c)) { 18856 break 18857 } 18858 v.reset(OpLeq64U) 18859 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 18860 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 18861 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 18862 v2.AuxInt = int64(udivisible(64, c).m) 18863 v1.AddArg(v2) 18864 v1.AddArg(x) 18865 v0.AddArg(v1) 18866 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 18867 v3.AuxInt = int64(64 - udivisible(64, c).k) 18868 v0.AddArg(v3) 18869 v.AddArg(v0) 18870 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 18871 v4.AuxInt = int64(udivisible(64, c).max) 18872 v.AddArg(v4) 18873 return true 18874 } 18875 // match: (Eq64 x (Mul64 (Const64 [c]) (Rsh64Ux64 mul:(Hmul64u x (Const64 [m])) (Const64 [s])))) 18876 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+umagic(64,c).m/2) && s == umagic(64,c).s-1 && x.Op != OpConst64 && udivisibleOK(64,c) 18877 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 18878 for { 18879 _ = v.Args[1] 18880 x := v.Args[0] 18881 v_1 := v.Args[1] 18882 if v_1.Op != OpMul64 { 18883 break 18884 } 18885 _ = v_1.Args[1] 18886 v_1_0 := v_1.Args[0] 18887 if v_1_0.Op != OpConst64 { 18888 break 18889 } 18890 c := v_1_0.AuxInt 18891 v_1_1 := v_1.Args[1] 18892 if v_1_1.Op != OpRsh64Ux64 { 18893 break 18894 } 18895 _ = v_1_1.Args[1] 18896 mul := v_1_1.Args[0] 18897 if mul.Op != OpHmul64u { 18898 break 18899 } 18900 _ = mul.Args[1] 18901 if x != mul.Args[0] { 18902 break 18903 } 18904 mul_1 := mul.Args[1] 18905 if mul_1.Op != OpConst64 { 18906 break 18907 } 18908 m := mul_1.AuxInt 18909 v_1_1_1 := v_1_1.Args[1] 18910 if v_1_1_1.Op != OpConst64 { 18911 break 18912 } 18913 s := v_1_1_1.AuxInt 18914 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+umagic(64, c).m/2) && s == umagic(64, c).s-1 && x.Op != OpConst64 && udivisibleOK(64, c)) { 18915 break 18916 } 18917 v.reset(OpLeq64U) 18918 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 18919 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 18920 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 18921 v2.AuxInt = int64(udivisible(64, c).m) 18922 v1.AddArg(v2) 18923 v1.AddArg(x) 18924 v0.AddArg(v1) 18925 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 18926 v3.AuxInt = int64(64 - udivisible(64, c).k) 18927 v0.AddArg(v3) 18928 v.AddArg(v0) 18929 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 18930 v4.AuxInt = int64(udivisible(64, c).max) 18931 v.AddArg(v4) 18932 return true 18933 } 18934 // match: (Eq64 x (Mul64 (Rsh64Ux64 mul:(Hmul64u (Const64 [m]) x) (Const64 [s])) (Const64 [c]))) 18935 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+umagic(64,c).m/2) && s == umagic(64,c).s-1 && x.Op != OpConst64 && udivisibleOK(64,c) 18936 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 18937 for { 18938 _ = v.Args[1] 18939 x := v.Args[0] 18940 v_1 := v.Args[1] 18941 if v_1.Op != OpMul64 { 18942 break 18943 } 18944 _ = v_1.Args[1] 18945 v_1_0 := v_1.Args[0] 18946 if v_1_0.Op != OpRsh64Ux64 { 18947 break 18948 } 18949 _ = v_1_0.Args[1] 18950 mul := v_1_0.Args[0] 18951 if mul.Op != OpHmul64u { 18952 break 18953 } 18954 _ = mul.Args[1] 18955 mul_0 := mul.Args[0] 18956 if mul_0.Op != OpConst64 { 18957 break 18958 } 18959 m := mul_0.AuxInt 18960 if x != mul.Args[1] { 18961 break 18962 } 18963 v_1_0_1 := v_1_0.Args[1] 18964 if v_1_0_1.Op != OpConst64 { 18965 break 18966 } 18967 s := v_1_0_1.AuxInt 18968 v_1_1 := v_1.Args[1] 18969 if v_1_1.Op != OpConst64 { 18970 break 18971 } 18972 c := v_1_1.AuxInt 18973 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+umagic(64, c).m/2) && s == umagic(64, c).s-1 && x.Op != OpConst64 && udivisibleOK(64, c)) { 18974 break 18975 } 18976 v.reset(OpLeq64U) 18977 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 18978 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 18979 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 18980 v2.AuxInt = int64(udivisible(64, c).m) 18981 v1.AddArg(v2) 18982 v1.AddArg(x) 18983 v0.AddArg(v1) 18984 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 18985 v3.AuxInt = int64(64 - udivisible(64, c).k) 18986 v0.AddArg(v3) 18987 v.AddArg(v0) 18988 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 18989 v4.AuxInt = int64(udivisible(64, c).max) 18990 v.AddArg(v4) 18991 return true 18992 } 18993 return false 18994 } 18995 func rewriteValuegeneric_OpEq64_10(v *Value) bool { 18996 b := v.Block 18997 typ := &b.Func.Config.Types 18998 // match: (Eq64 x (Mul64 (Rsh64Ux64 mul:(Hmul64u x (Const64 [m])) (Const64 [s])) (Const64 [c]))) 18999 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+umagic(64,c).m/2) && s == umagic(64,c).s-1 && x.Op != OpConst64 && udivisibleOK(64,c) 19000 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 19001 for { 19002 _ = v.Args[1] 19003 x := v.Args[0] 19004 v_1 := v.Args[1] 19005 if v_1.Op != OpMul64 { 19006 break 19007 } 19008 _ = v_1.Args[1] 19009 v_1_0 := v_1.Args[0] 19010 if v_1_0.Op != OpRsh64Ux64 { 19011 break 19012 } 19013 _ = v_1_0.Args[1] 19014 mul := v_1_0.Args[0] 19015 if mul.Op != OpHmul64u { 19016 break 19017 } 19018 _ = mul.Args[1] 19019 if x != mul.Args[0] { 19020 break 19021 } 19022 mul_1 := mul.Args[1] 19023 if mul_1.Op != OpConst64 { 19024 break 19025 } 19026 m := mul_1.AuxInt 19027 v_1_0_1 := v_1_0.Args[1] 19028 if v_1_0_1.Op != OpConst64 { 19029 break 19030 } 19031 s := v_1_0_1.AuxInt 19032 v_1_1 := v_1.Args[1] 19033 if v_1_1.Op != OpConst64 { 19034 break 19035 } 19036 c := v_1_1.AuxInt 19037 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+umagic(64, c).m/2) && s == umagic(64, c).s-1 && x.Op != OpConst64 && udivisibleOK(64, c)) { 19038 break 19039 } 19040 v.reset(OpLeq64U) 19041 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 19042 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 19043 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19044 v2.AuxInt = int64(udivisible(64, c).m) 19045 v1.AddArg(v2) 19046 v1.AddArg(x) 19047 v0.AddArg(v1) 19048 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19049 v3.AuxInt = int64(64 - udivisible(64, c).k) 19050 v0.AddArg(v3) 19051 v.AddArg(v0) 19052 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19053 v4.AuxInt = int64(udivisible(64, c).max) 19054 v.AddArg(v4) 19055 return true 19056 } 19057 // match: (Eq64 (Mul64 (Const64 [c]) (Rsh64Ux64 mul:(Hmul64u (Const64 [m]) x) (Const64 [s]))) x) 19058 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+umagic(64,c).m/2) && s == umagic(64,c).s-1 && x.Op != OpConst64 && udivisibleOK(64,c) 19059 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 19060 for { 19061 x := v.Args[1] 19062 v_0 := v.Args[0] 19063 if v_0.Op != OpMul64 { 19064 break 19065 } 19066 _ = v_0.Args[1] 19067 v_0_0 := v_0.Args[0] 19068 if v_0_0.Op != OpConst64 { 19069 break 19070 } 19071 c := v_0_0.AuxInt 19072 v_0_1 := v_0.Args[1] 19073 if v_0_1.Op != OpRsh64Ux64 { 19074 break 19075 } 19076 _ = v_0_1.Args[1] 19077 mul := v_0_1.Args[0] 19078 if mul.Op != OpHmul64u { 19079 break 19080 } 19081 _ = mul.Args[1] 19082 mul_0 := mul.Args[0] 19083 if mul_0.Op != OpConst64 { 19084 break 19085 } 19086 m := mul_0.AuxInt 19087 if x != mul.Args[1] { 19088 break 19089 } 19090 v_0_1_1 := v_0_1.Args[1] 19091 if v_0_1_1.Op != OpConst64 { 19092 break 19093 } 19094 s := v_0_1_1.AuxInt 19095 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+umagic(64, c).m/2) && s == umagic(64, c).s-1 && x.Op != OpConst64 && udivisibleOK(64, c)) { 19096 break 19097 } 19098 v.reset(OpLeq64U) 19099 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 19100 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 19101 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19102 v2.AuxInt = int64(udivisible(64, c).m) 19103 v1.AddArg(v2) 19104 v1.AddArg(x) 19105 v0.AddArg(v1) 19106 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19107 v3.AuxInt = int64(64 - udivisible(64, c).k) 19108 v0.AddArg(v3) 19109 v.AddArg(v0) 19110 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19111 v4.AuxInt = int64(udivisible(64, c).max) 19112 v.AddArg(v4) 19113 return true 19114 } 19115 // match: (Eq64 (Mul64 (Const64 [c]) (Rsh64Ux64 mul:(Hmul64u x (Const64 [m])) (Const64 [s]))) x) 19116 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+umagic(64,c).m/2) && s == umagic(64,c).s-1 && x.Op != OpConst64 && udivisibleOK(64,c) 19117 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 19118 for { 19119 x := v.Args[1] 19120 v_0 := v.Args[0] 19121 if v_0.Op != OpMul64 { 19122 break 19123 } 19124 _ = v_0.Args[1] 19125 v_0_0 := v_0.Args[0] 19126 if v_0_0.Op != OpConst64 { 19127 break 19128 } 19129 c := v_0_0.AuxInt 19130 v_0_1 := v_0.Args[1] 19131 if v_0_1.Op != OpRsh64Ux64 { 19132 break 19133 } 19134 _ = v_0_1.Args[1] 19135 mul := v_0_1.Args[0] 19136 if mul.Op != OpHmul64u { 19137 break 19138 } 19139 _ = mul.Args[1] 19140 if x != mul.Args[0] { 19141 break 19142 } 19143 mul_1 := mul.Args[1] 19144 if mul_1.Op != OpConst64 { 19145 break 19146 } 19147 m := mul_1.AuxInt 19148 v_0_1_1 := v_0_1.Args[1] 19149 if v_0_1_1.Op != OpConst64 { 19150 break 19151 } 19152 s := v_0_1_1.AuxInt 19153 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+umagic(64, c).m/2) && s == umagic(64, c).s-1 && x.Op != OpConst64 && udivisibleOK(64, c)) { 19154 break 19155 } 19156 v.reset(OpLeq64U) 19157 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 19158 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 19159 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19160 v2.AuxInt = int64(udivisible(64, c).m) 19161 v1.AddArg(v2) 19162 v1.AddArg(x) 19163 v0.AddArg(v1) 19164 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19165 v3.AuxInt = int64(64 - udivisible(64, c).k) 19166 v0.AddArg(v3) 19167 v.AddArg(v0) 19168 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19169 v4.AuxInt = int64(udivisible(64, c).max) 19170 v.AddArg(v4) 19171 return true 19172 } 19173 // match: (Eq64 (Mul64 (Rsh64Ux64 mul:(Hmul64u (Const64 [m]) x) (Const64 [s])) (Const64 [c])) x) 19174 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+umagic(64,c).m/2) && s == umagic(64,c).s-1 && x.Op != OpConst64 && udivisibleOK(64,c) 19175 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 19176 for { 19177 x := v.Args[1] 19178 v_0 := v.Args[0] 19179 if v_0.Op != OpMul64 { 19180 break 19181 } 19182 _ = v_0.Args[1] 19183 v_0_0 := v_0.Args[0] 19184 if v_0_0.Op != OpRsh64Ux64 { 19185 break 19186 } 19187 _ = v_0_0.Args[1] 19188 mul := v_0_0.Args[0] 19189 if mul.Op != OpHmul64u { 19190 break 19191 } 19192 _ = mul.Args[1] 19193 mul_0 := mul.Args[0] 19194 if mul_0.Op != OpConst64 { 19195 break 19196 } 19197 m := mul_0.AuxInt 19198 if x != mul.Args[1] { 19199 break 19200 } 19201 v_0_0_1 := v_0_0.Args[1] 19202 if v_0_0_1.Op != OpConst64 { 19203 break 19204 } 19205 s := v_0_0_1.AuxInt 19206 v_0_1 := v_0.Args[1] 19207 if v_0_1.Op != OpConst64 { 19208 break 19209 } 19210 c := v_0_1.AuxInt 19211 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+umagic(64, c).m/2) && s == umagic(64, c).s-1 && x.Op != OpConst64 && udivisibleOK(64, c)) { 19212 break 19213 } 19214 v.reset(OpLeq64U) 19215 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 19216 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 19217 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19218 v2.AuxInt = int64(udivisible(64, c).m) 19219 v1.AddArg(v2) 19220 v1.AddArg(x) 19221 v0.AddArg(v1) 19222 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19223 v3.AuxInt = int64(64 - udivisible(64, c).k) 19224 v0.AddArg(v3) 19225 v.AddArg(v0) 19226 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19227 v4.AuxInt = int64(udivisible(64, c).max) 19228 v.AddArg(v4) 19229 return true 19230 } 19231 // match: (Eq64 (Mul64 (Rsh64Ux64 mul:(Hmul64u x (Const64 [m])) (Const64 [s])) (Const64 [c])) x) 19232 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+umagic(64,c).m/2) && s == umagic(64,c).s-1 && x.Op != OpConst64 && udivisibleOK(64,c) 19233 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 19234 for { 19235 x := v.Args[1] 19236 v_0 := v.Args[0] 19237 if v_0.Op != OpMul64 { 19238 break 19239 } 19240 _ = v_0.Args[1] 19241 v_0_0 := v_0.Args[0] 19242 if v_0_0.Op != OpRsh64Ux64 { 19243 break 19244 } 19245 _ = v_0_0.Args[1] 19246 mul := v_0_0.Args[0] 19247 if mul.Op != OpHmul64u { 19248 break 19249 } 19250 _ = mul.Args[1] 19251 if x != mul.Args[0] { 19252 break 19253 } 19254 mul_1 := mul.Args[1] 19255 if mul_1.Op != OpConst64 { 19256 break 19257 } 19258 m := mul_1.AuxInt 19259 v_0_0_1 := v_0_0.Args[1] 19260 if v_0_0_1.Op != OpConst64 { 19261 break 19262 } 19263 s := v_0_0_1.AuxInt 19264 v_0_1 := v_0.Args[1] 19265 if v_0_1.Op != OpConst64 { 19266 break 19267 } 19268 c := v_0_1.AuxInt 19269 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+umagic(64, c).m/2) && s == umagic(64, c).s-1 && x.Op != OpConst64 && udivisibleOK(64, c)) { 19270 break 19271 } 19272 v.reset(OpLeq64U) 19273 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 19274 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 19275 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19276 v2.AuxInt = int64(udivisible(64, c).m) 19277 v1.AddArg(v2) 19278 v1.AddArg(x) 19279 v0.AddArg(v1) 19280 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19281 v3.AuxInt = int64(64 - udivisible(64, c).k) 19282 v0.AddArg(v3) 19283 v.AddArg(v0) 19284 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19285 v4.AuxInt = int64(udivisible(64, c).max) 19286 v.AddArg(v4) 19287 return true 19288 } 19289 // match: (Eq64 x (Mul64 (Const64 [c]) (Rsh64Ux64 mul:(Hmul64u (Const64 [m]) (Rsh64Ux64 x (Const64 [1]))) (Const64 [s])))) 19290 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+(umagic(64,c).m+1)/2) && s == umagic(64,c).s-2 && x.Op != OpConst64 && udivisibleOK(64,c) 19291 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 19292 for { 19293 _ = v.Args[1] 19294 x := v.Args[0] 19295 v_1 := v.Args[1] 19296 if v_1.Op != OpMul64 { 19297 break 19298 } 19299 _ = v_1.Args[1] 19300 v_1_0 := v_1.Args[0] 19301 if v_1_0.Op != OpConst64 { 19302 break 19303 } 19304 c := v_1_0.AuxInt 19305 v_1_1 := v_1.Args[1] 19306 if v_1_1.Op != OpRsh64Ux64 { 19307 break 19308 } 19309 _ = v_1_1.Args[1] 19310 mul := v_1_1.Args[0] 19311 if mul.Op != OpHmul64u { 19312 break 19313 } 19314 _ = mul.Args[1] 19315 mul_0 := mul.Args[0] 19316 if mul_0.Op != OpConst64 { 19317 break 19318 } 19319 m := mul_0.AuxInt 19320 mul_1 := mul.Args[1] 19321 if mul_1.Op != OpRsh64Ux64 { 19322 break 19323 } 19324 _ = mul_1.Args[1] 19325 if x != mul_1.Args[0] { 19326 break 19327 } 19328 mul_1_1 := mul_1.Args[1] 19329 if mul_1_1.Op != OpConst64 || mul_1_1.AuxInt != 1 { 19330 break 19331 } 19332 v_1_1_1 := v_1_1.Args[1] 19333 if v_1_1_1.Op != OpConst64 { 19334 break 19335 } 19336 s := v_1_1_1.AuxInt 19337 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+(umagic(64, c).m+1)/2) && s == umagic(64, c).s-2 && x.Op != OpConst64 && udivisibleOK(64, c)) { 19338 break 19339 } 19340 v.reset(OpLeq64U) 19341 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 19342 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 19343 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19344 v2.AuxInt = int64(udivisible(64, c).m) 19345 v1.AddArg(v2) 19346 v1.AddArg(x) 19347 v0.AddArg(v1) 19348 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19349 v3.AuxInt = int64(64 - udivisible(64, c).k) 19350 v0.AddArg(v3) 19351 v.AddArg(v0) 19352 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19353 v4.AuxInt = int64(udivisible(64, c).max) 19354 v.AddArg(v4) 19355 return true 19356 } 19357 // match: (Eq64 x (Mul64 (Const64 [c]) (Rsh64Ux64 mul:(Hmul64u (Rsh64Ux64 x (Const64 [1])) (Const64 [m])) (Const64 [s])))) 19358 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+(umagic(64,c).m+1)/2) && s == umagic(64,c).s-2 && x.Op != OpConst64 && udivisibleOK(64,c) 19359 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 19360 for { 19361 _ = v.Args[1] 19362 x := v.Args[0] 19363 v_1 := v.Args[1] 19364 if v_1.Op != OpMul64 { 19365 break 19366 } 19367 _ = v_1.Args[1] 19368 v_1_0 := v_1.Args[0] 19369 if v_1_0.Op != OpConst64 { 19370 break 19371 } 19372 c := v_1_0.AuxInt 19373 v_1_1 := v_1.Args[1] 19374 if v_1_1.Op != OpRsh64Ux64 { 19375 break 19376 } 19377 _ = v_1_1.Args[1] 19378 mul := v_1_1.Args[0] 19379 if mul.Op != OpHmul64u { 19380 break 19381 } 19382 _ = mul.Args[1] 19383 mul_0 := mul.Args[0] 19384 if mul_0.Op != OpRsh64Ux64 { 19385 break 19386 } 19387 _ = mul_0.Args[1] 19388 if x != mul_0.Args[0] { 19389 break 19390 } 19391 mul_0_1 := mul_0.Args[1] 19392 if mul_0_1.Op != OpConst64 || mul_0_1.AuxInt != 1 { 19393 break 19394 } 19395 mul_1 := mul.Args[1] 19396 if mul_1.Op != OpConst64 { 19397 break 19398 } 19399 m := mul_1.AuxInt 19400 v_1_1_1 := v_1_1.Args[1] 19401 if v_1_1_1.Op != OpConst64 { 19402 break 19403 } 19404 s := v_1_1_1.AuxInt 19405 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+(umagic(64, c).m+1)/2) && s == umagic(64, c).s-2 && x.Op != OpConst64 && udivisibleOK(64, c)) { 19406 break 19407 } 19408 v.reset(OpLeq64U) 19409 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 19410 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 19411 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19412 v2.AuxInt = int64(udivisible(64, c).m) 19413 v1.AddArg(v2) 19414 v1.AddArg(x) 19415 v0.AddArg(v1) 19416 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19417 v3.AuxInt = int64(64 - udivisible(64, c).k) 19418 v0.AddArg(v3) 19419 v.AddArg(v0) 19420 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19421 v4.AuxInt = int64(udivisible(64, c).max) 19422 v.AddArg(v4) 19423 return true 19424 } 19425 // match: (Eq64 x (Mul64 (Rsh64Ux64 mul:(Hmul64u (Const64 [m]) (Rsh64Ux64 x (Const64 [1]))) (Const64 [s])) (Const64 [c]))) 19426 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+(umagic(64,c).m+1)/2) && s == umagic(64,c).s-2 && x.Op != OpConst64 && udivisibleOK(64,c) 19427 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 19428 for { 19429 _ = v.Args[1] 19430 x := v.Args[0] 19431 v_1 := v.Args[1] 19432 if v_1.Op != OpMul64 { 19433 break 19434 } 19435 _ = v_1.Args[1] 19436 v_1_0 := v_1.Args[0] 19437 if v_1_0.Op != OpRsh64Ux64 { 19438 break 19439 } 19440 _ = v_1_0.Args[1] 19441 mul := v_1_0.Args[0] 19442 if mul.Op != OpHmul64u { 19443 break 19444 } 19445 _ = mul.Args[1] 19446 mul_0 := mul.Args[0] 19447 if mul_0.Op != OpConst64 { 19448 break 19449 } 19450 m := mul_0.AuxInt 19451 mul_1 := mul.Args[1] 19452 if mul_1.Op != OpRsh64Ux64 { 19453 break 19454 } 19455 _ = mul_1.Args[1] 19456 if x != mul_1.Args[0] { 19457 break 19458 } 19459 mul_1_1 := mul_1.Args[1] 19460 if mul_1_1.Op != OpConst64 || mul_1_1.AuxInt != 1 { 19461 break 19462 } 19463 v_1_0_1 := v_1_0.Args[1] 19464 if v_1_0_1.Op != OpConst64 { 19465 break 19466 } 19467 s := v_1_0_1.AuxInt 19468 v_1_1 := v_1.Args[1] 19469 if v_1_1.Op != OpConst64 { 19470 break 19471 } 19472 c := v_1_1.AuxInt 19473 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+(umagic(64, c).m+1)/2) && s == umagic(64, c).s-2 && x.Op != OpConst64 && udivisibleOK(64, c)) { 19474 break 19475 } 19476 v.reset(OpLeq64U) 19477 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 19478 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 19479 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19480 v2.AuxInt = int64(udivisible(64, c).m) 19481 v1.AddArg(v2) 19482 v1.AddArg(x) 19483 v0.AddArg(v1) 19484 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19485 v3.AuxInt = int64(64 - udivisible(64, c).k) 19486 v0.AddArg(v3) 19487 v.AddArg(v0) 19488 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19489 v4.AuxInt = int64(udivisible(64, c).max) 19490 v.AddArg(v4) 19491 return true 19492 } 19493 // match: (Eq64 x (Mul64 (Rsh64Ux64 mul:(Hmul64u (Rsh64Ux64 x (Const64 [1])) (Const64 [m])) (Const64 [s])) (Const64 [c]))) 19494 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+(umagic(64,c).m+1)/2) && s == umagic(64,c).s-2 && x.Op != OpConst64 && udivisibleOK(64,c) 19495 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 19496 for { 19497 _ = v.Args[1] 19498 x := v.Args[0] 19499 v_1 := v.Args[1] 19500 if v_1.Op != OpMul64 { 19501 break 19502 } 19503 _ = v_1.Args[1] 19504 v_1_0 := v_1.Args[0] 19505 if v_1_0.Op != OpRsh64Ux64 { 19506 break 19507 } 19508 _ = v_1_0.Args[1] 19509 mul := v_1_0.Args[0] 19510 if mul.Op != OpHmul64u { 19511 break 19512 } 19513 _ = mul.Args[1] 19514 mul_0 := mul.Args[0] 19515 if mul_0.Op != OpRsh64Ux64 { 19516 break 19517 } 19518 _ = mul_0.Args[1] 19519 if x != mul_0.Args[0] { 19520 break 19521 } 19522 mul_0_1 := mul_0.Args[1] 19523 if mul_0_1.Op != OpConst64 || mul_0_1.AuxInt != 1 { 19524 break 19525 } 19526 mul_1 := mul.Args[1] 19527 if mul_1.Op != OpConst64 { 19528 break 19529 } 19530 m := mul_1.AuxInt 19531 v_1_0_1 := v_1_0.Args[1] 19532 if v_1_0_1.Op != OpConst64 { 19533 break 19534 } 19535 s := v_1_0_1.AuxInt 19536 v_1_1 := v_1.Args[1] 19537 if v_1_1.Op != OpConst64 { 19538 break 19539 } 19540 c := v_1_1.AuxInt 19541 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+(umagic(64, c).m+1)/2) && s == umagic(64, c).s-2 && x.Op != OpConst64 && udivisibleOK(64, c)) { 19542 break 19543 } 19544 v.reset(OpLeq64U) 19545 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 19546 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 19547 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19548 v2.AuxInt = int64(udivisible(64, c).m) 19549 v1.AddArg(v2) 19550 v1.AddArg(x) 19551 v0.AddArg(v1) 19552 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19553 v3.AuxInt = int64(64 - udivisible(64, c).k) 19554 v0.AddArg(v3) 19555 v.AddArg(v0) 19556 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19557 v4.AuxInt = int64(udivisible(64, c).max) 19558 v.AddArg(v4) 19559 return true 19560 } 19561 // match: (Eq64 (Mul64 (Const64 [c]) (Rsh64Ux64 mul:(Hmul64u (Const64 [m]) (Rsh64Ux64 x (Const64 [1]))) (Const64 [s]))) x) 19562 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+(umagic(64,c).m+1)/2) && s == umagic(64,c).s-2 && x.Op != OpConst64 && udivisibleOK(64,c) 19563 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 19564 for { 19565 x := v.Args[1] 19566 v_0 := v.Args[0] 19567 if v_0.Op != OpMul64 { 19568 break 19569 } 19570 _ = v_0.Args[1] 19571 v_0_0 := v_0.Args[0] 19572 if v_0_0.Op != OpConst64 { 19573 break 19574 } 19575 c := v_0_0.AuxInt 19576 v_0_1 := v_0.Args[1] 19577 if v_0_1.Op != OpRsh64Ux64 { 19578 break 19579 } 19580 _ = v_0_1.Args[1] 19581 mul := v_0_1.Args[0] 19582 if mul.Op != OpHmul64u { 19583 break 19584 } 19585 _ = mul.Args[1] 19586 mul_0 := mul.Args[0] 19587 if mul_0.Op != OpConst64 { 19588 break 19589 } 19590 m := mul_0.AuxInt 19591 mul_1 := mul.Args[1] 19592 if mul_1.Op != OpRsh64Ux64 { 19593 break 19594 } 19595 _ = mul_1.Args[1] 19596 if x != mul_1.Args[0] { 19597 break 19598 } 19599 mul_1_1 := mul_1.Args[1] 19600 if mul_1_1.Op != OpConst64 || mul_1_1.AuxInt != 1 { 19601 break 19602 } 19603 v_0_1_1 := v_0_1.Args[1] 19604 if v_0_1_1.Op != OpConst64 { 19605 break 19606 } 19607 s := v_0_1_1.AuxInt 19608 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+(umagic(64, c).m+1)/2) && s == umagic(64, c).s-2 && x.Op != OpConst64 && udivisibleOK(64, c)) { 19609 break 19610 } 19611 v.reset(OpLeq64U) 19612 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 19613 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 19614 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19615 v2.AuxInt = int64(udivisible(64, c).m) 19616 v1.AddArg(v2) 19617 v1.AddArg(x) 19618 v0.AddArg(v1) 19619 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19620 v3.AuxInt = int64(64 - udivisible(64, c).k) 19621 v0.AddArg(v3) 19622 v.AddArg(v0) 19623 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19624 v4.AuxInt = int64(udivisible(64, c).max) 19625 v.AddArg(v4) 19626 return true 19627 } 19628 return false 19629 } 19630 func rewriteValuegeneric_OpEq64_20(v *Value) bool { 19631 b := v.Block 19632 typ := &b.Func.Config.Types 19633 // match: (Eq64 (Mul64 (Const64 [c]) (Rsh64Ux64 mul:(Hmul64u (Rsh64Ux64 x (Const64 [1])) (Const64 [m])) (Const64 [s]))) x) 19634 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+(umagic(64,c).m+1)/2) && s == umagic(64,c).s-2 && x.Op != OpConst64 && udivisibleOK(64,c) 19635 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 19636 for { 19637 x := v.Args[1] 19638 v_0 := v.Args[0] 19639 if v_0.Op != OpMul64 { 19640 break 19641 } 19642 _ = v_0.Args[1] 19643 v_0_0 := v_0.Args[0] 19644 if v_0_0.Op != OpConst64 { 19645 break 19646 } 19647 c := v_0_0.AuxInt 19648 v_0_1 := v_0.Args[1] 19649 if v_0_1.Op != OpRsh64Ux64 { 19650 break 19651 } 19652 _ = v_0_1.Args[1] 19653 mul := v_0_1.Args[0] 19654 if mul.Op != OpHmul64u { 19655 break 19656 } 19657 _ = mul.Args[1] 19658 mul_0 := mul.Args[0] 19659 if mul_0.Op != OpRsh64Ux64 { 19660 break 19661 } 19662 _ = mul_0.Args[1] 19663 if x != mul_0.Args[0] { 19664 break 19665 } 19666 mul_0_1 := mul_0.Args[1] 19667 if mul_0_1.Op != OpConst64 || mul_0_1.AuxInt != 1 { 19668 break 19669 } 19670 mul_1 := mul.Args[1] 19671 if mul_1.Op != OpConst64 { 19672 break 19673 } 19674 m := mul_1.AuxInt 19675 v_0_1_1 := v_0_1.Args[1] 19676 if v_0_1_1.Op != OpConst64 { 19677 break 19678 } 19679 s := v_0_1_1.AuxInt 19680 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+(umagic(64, c).m+1)/2) && s == umagic(64, c).s-2 && x.Op != OpConst64 && udivisibleOK(64, c)) { 19681 break 19682 } 19683 v.reset(OpLeq64U) 19684 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 19685 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 19686 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19687 v2.AuxInt = int64(udivisible(64, c).m) 19688 v1.AddArg(v2) 19689 v1.AddArg(x) 19690 v0.AddArg(v1) 19691 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19692 v3.AuxInt = int64(64 - udivisible(64, c).k) 19693 v0.AddArg(v3) 19694 v.AddArg(v0) 19695 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19696 v4.AuxInt = int64(udivisible(64, c).max) 19697 v.AddArg(v4) 19698 return true 19699 } 19700 // match: (Eq64 (Mul64 (Rsh64Ux64 mul:(Hmul64u (Const64 [m]) (Rsh64Ux64 x (Const64 [1]))) (Const64 [s])) (Const64 [c])) x) 19701 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+(umagic(64,c).m+1)/2) && s == umagic(64,c).s-2 && x.Op != OpConst64 && udivisibleOK(64,c) 19702 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 19703 for { 19704 x := v.Args[1] 19705 v_0 := v.Args[0] 19706 if v_0.Op != OpMul64 { 19707 break 19708 } 19709 _ = v_0.Args[1] 19710 v_0_0 := v_0.Args[0] 19711 if v_0_0.Op != OpRsh64Ux64 { 19712 break 19713 } 19714 _ = v_0_0.Args[1] 19715 mul := v_0_0.Args[0] 19716 if mul.Op != OpHmul64u { 19717 break 19718 } 19719 _ = mul.Args[1] 19720 mul_0 := mul.Args[0] 19721 if mul_0.Op != OpConst64 { 19722 break 19723 } 19724 m := mul_0.AuxInt 19725 mul_1 := mul.Args[1] 19726 if mul_1.Op != OpRsh64Ux64 { 19727 break 19728 } 19729 _ = mul_1.Args[1] 19730 if x != mul_1.Args[0] { 19731 break 19732 } 19733 mul_1_1 := mul_1.Args[1] 19734 if mul_1_1.Op != OpConst64 || mul_1_1.AuxInt != 1 { 19735 break 19736 } 19737 v_0_0_1 := v_0_0.Args[1] 19738 if v_0_0_1.Op != OpConst64 { 19739 break 19740 } 19741 s := v_0_0_1.AuxInt 19742 v_0_1 := v_0.Args[1] 19743 if v_0_1.Op != OpConst64 { 19744 break 19745 } 19746 c := v_0_1.AuxInt 19747 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+(umagic(64, c).m+1)/2) && s == umagic(64, c).s-2 && x.Op != OpConst64 && udivisibleOK(64, c)) { 19748 break 19749 } 19750 v.reset(OpLeq64U) 19751 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 19752 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 19753 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19754 v2.AuxInt = int64(udivisible(64, c).m) 19755 v1.AddArg(v2) 19756 v1.AddArg(x) 19757 v0.AddArg(v1) 19758 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19759 v3.AuxInt = int64(64 - udivisible(64, c).k) 19760 v0.AddArg(v3) 19761 v.AddArg(v0) 19762 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19763 v4.AuxInt = int64(udivisible(64, c).max) 19764 v.AddArg(v4) 19765 return true 19766 } 19767 // match: (Eq64 (Mul64 (Rsh64Ux64 mul:(Hmul64u (Rsh64Ux64 x (Const64 [1])) (Const64 [m])) (Const64 [s])) (Const64 [c])) x) 19768 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+(umagic(64,c).m+1)/2) && s == umagic(64,c).s-2 && x.Op != OpConst64 && udivisibleOK(64,c) 19769 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 19770 for { 19771 x := v.Args[1] 19772 v_0 := v.Args[0] 19773 if v_0.Op != OpMul64 { 19774 break 19775 } 19776 _ = v_0.Args[1] 19777 v_0_0 := v_0.Args[0] 19778 if v_0_0.Op != OpRsh64Ux64 { 19779 break 19780 } 19781 _ = v_0_0.Args[1] 19782 mul := v_0_0.Args[0] 19783 if mul.Op != OpHmul64u { 19784 break 19785 } 19786 _ = mul.Args[1] 19787 mul_0 := mul.Args[0] 19788 if mul_0.Op != OpRsh64Ux64 { 19789 break 19790 } 19791 _ = mul_0.Args[1] 19792 if x != mul_0.Args[0] { 19793 break 19794 } 19795 mul_0_1 := mul_0.Args[1] 19796 if mul_0_1.Op != OpConst64 || mul_0_1.AuxInt != 1 { 19797 break 19798 } 19799 mul_1 := mul.Args[1] 19800 if mul_1.Op != OpConst64 { 19801 break 19802 } 19803 m := mul_1.AuxInt 19804 v_0_0_1 := v_0_0.Args[1] 19805 if v_0_0_1.Op != OpConst64 { 19806 break 19807 } 19808 s := v_0_0_1.AuxInt 19809 v_0_1 := v_0.Args[1] 19810 if v_0_1.Op != OpConst64 { 19811 break 19812 } 19813 c := v_0_1.AuxInt 19814 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+(umagic(64, c).m+1)/2) && s == umagic(64, c).s-2 && x.Op != OpConst64 && udivisibleOK(64, c)) { 19815 break 19816 } 19817 v.reset(OpLeq64U) 19818 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 19819 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 19820 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19821 v2.AuxInt = int64(udivisible(64, c).m) 19822 v1.AddArg(v2) 19823 v1.AddArg(x) 19824 v0.AddArg(v1) 19825 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19826 v3.AuxInt = int64(64 - udivisible(64, c).k) 19827 v0.AddArg(v3) 19828 v.AddArg(v0) 19829 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19830 v4.AuxInt = int64(udivisible(64, c).max) 19831 v.AddArg(v4) 19832 return true 19833 } 19834 // match: (Eq64 x (Mul64 (Const64 [c]) (Rsh64Ux64 (Avg64u x mul:(Hmul64u (Const64 [m]) x)) (Const64 [s])))) 19835 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(64,c).m) && s == umagic(64,c).s-1 && x.Op != OpConst64 && udivisibleOK(64,c) 19836 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 19837 for { 19838 _ = v.Args[1] 19839 x := v.Args[0] 19840 v_1 := v.Args[1] 19841 if v_1.Op != OpMul64 { 19842 break 19843 } 19844 _ = v_1.Args[1] 19845 v_1_0 := v_1.Args[0] 19846 if v_1_0.Op != OpConst64 { 19847 break 19848 } 19849 c := v_1_0.AuxInt 19850 v_1_1 := v_1.Args[1] 19851 if v_1_1.Op != OpRsh64Ux64 { 19852 break 19853 } 19854 _ = v_1_1.Args[1] 19855 v_1_1_0 := v_1_1.Args[0] 19856 if v_1_1_0.Op != OpAvg64u { 19857 break 19858 } 19859 _ = v_1_1_0.Args[1] 19860 if x != v_1_1_0.Args[0] { 19861 break 19862 } 19863 mul := v_1_1_0.Args[1] 19864 if mul.Op != OpHmul64u { 19865 break 19866 } 19867 _ = mul.Args[1] 19868 mul_0 := mul.Args[0] 19869 if mul_0.Op != OpConst64 { 19870 break 19871 } 19872 m := mul_0.AuxInt 19873 if x != mul.Args[1] { 19874 break 19875 } 19876 v_1_1_1 := v_1_1.Args[1] 19877 if v_1_1_1.Op != OpConst64 { 19878 break 19879 } 19880 s := v_1_1_1.AuxInt 19881 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(64, c).m) && s == umagic(64, c).s-1 && x.Op != OpConst64 && udivisibleOK(64, c)) { 19882 break 19883 } 19884 v.reset(OpLeq64U) 19885 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 19886 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 19887 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19888 v2.AuxInt = int64(udivisible(64, c).m) 19889 v1.AddArg(v2) 19890 v1.AddArg(x) 19891 v0.AddArg(v1) 19892 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19893 v3.AuxInt = int64(64 - udivisible(64, c).k) 19894 v0.AddArg(v3) 19895 v.AddArg(v0) 19896 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19897 v4.AuxInt = int64(udivisible(64, c).max) 19898 v.AddArg(v4) 19899 return true 19900 } 19901 // match: (Eq64 x (Mul64 (Const64 [c]) (Rsh64Ux64 (Avg64u x mul:(Hmul64u x (Const64 [m]))) (Const64 [s])))) 19902 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(64,c).m) && s == umagic(64,c).s-1 && x.Op != OpConst64 && udivisibleOK(64,c) 19903 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 19904 for { 19905 _ = v.Args[1] 19906 x := v.Args[0] 19907 v_1 := v.Args[1] 19908 if v_1.Op != OpMul64 { 19909 break 19910 } 19911 _ = v_1.Args[1] 19912 v_1_0 := v_1.Args[0] 19913 if v_1_0.Op != OpConst64 { 19914 break 19915 } 19916 c := v_1_0.AuxInt 19917 v_1_1 := v_1.Args[1] 19918 if v_1_1.Op != OpRsh64Ux64 { 19919 break 19920 } 19921 _ = v_1_1.Args[1] 19922 v_1_1_0 := v_1_1.Args[0] 19923 if v_1_1_0.Op != OpAvg64u { 19924 break 19925 } 19926 _ = v_1_1_0.Args[1] 19927 if x != v_1_1_0.Args[0] { 19928 break 19929 } 19930 mul := v_1_1_0.Args[1] 19931 if mul.Op != OpHmul64u { 19932 break 19933 } 19934 _ = mul.Args[1] 19935 if x != mul.Args[0] { 19936 break 19937 } 19938 mul_1 := mul.Args[1] 19939 if mul_1.Op != OpConst64 { 19940 break 19941 } 19942 m := mul_1.AuxInt 19943 v_1_1_1 := v_1_1.Args[1] 19944 if v_1_1_1.Op != OpConst64 { 19945 break 19946 } 19947 s := v_1_1_1.AuxInt 19948 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(64, c).m) && s == umagic(64, c).s-1 && x.Op != OpConst64 && udivisibleOK(64, c)) { 19949 break 19950 } 19951 v.reset(OpLeq64U) 19952 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 19953 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 19954 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19955 v2.AuxInt = int64(udivisible(64, c).m) 19956 v1.AddArg(v2) 19957 v1.AddArg(x) 19958 v0.AddArg(v1) 19959 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19960 v3.AuxInt = int64(64 - udivisible(64, c).k) 19961 v0.AddArg(v3) 19962 v.AddArg(v0) 19963 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 19964 v4.AuxInt = int64(udivisible(64, c).max) 19965 v.AddArg(v4) 19966 return true 19967 } 19968 // match: (Eq64 x (Mul64 (Rsh64Ux64 (Avg64u x mul:(Hmul64u (Const64 [m]) x)) (Const64 [s])) (Const64 [c]))) 19969 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(64,c).m) && s == umagic(64,c).s-1 && x.Op != OpConst64 && udivisibleOK(64,c) 19970 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 19971 for { 19972 _ = v.Args[1] 19973 x := v.Args[0] 19974 v_1 := v.Args[1] 19975 if v_1.Op != OpMul64 { 19976 break 19977 } 19978 _ = v_1.Args[1] 19979 v_1_0 := v_1.Args[0] 19980 if v_1_0.Op != OpRsh64Ux64 { 19981 break 19982 } 19983 _ = v_1_0.Args[1] 19984 v_1_0_0 := v_1_0.Args[0] 19985 if v_1_0_0.Op != OpAvg64u { 19986 break 19987 } 19988 _ = v_1_0_0.Args[1] 19989 if x != v_1_0_0.Args[0] { 19990 break 19991 } 19992 mul := v_1_0_0.Args[1] 19993 if mul.Op != OpHmul64u { 19994 break 19995 } 19996 _ = mul.Args[1] 19997 mul_0 := mul.Args[0] 19998 if mul_0.Op != OpConst64 { 19999 break 20000 } 20001 m := mul_0.AuxInt 20002 if x != mul.Args[1] { 20003 break 20004 } 20005 v_1_0_1 := v_1_0.Args[1] 20006 if v_1_0_1.Op != OpConst64 { 20007 break 20008 } 20009 s := v_1_0_1.AuxInt 20010 v_1_1 := v_1.Args[1] 20011 if v_1_1.Op != OpConst64 { 20012 break 20013 } 20014 c := v_1_1.AuxInt 20015 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(64, c).m) && s == umagic(64, c).s-1 && x.Op != OpConst64 && udivisibleOK(64, c)) { 20016 break 20017 } 20018 v.reset(OpLeq64U) 20019 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 20020 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 20021 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20022 v2.AuxInt = int64(udivisible(64, c).m) 20023 v1.AddArg(v2) 20024 v1.AddArg(x) 20025 v0.AddArg(v1) 20026 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20027 v3.AuxInt = int64(64 - udivisible(64, c).k) 20028 v0.AddArg(v3) 20029 v.AddArg(v0) 20030 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20031 v4.AuxInt = int64(udivisible(64, c).max) 20032 v.AddArg(v4) 20033 return true 20034 } 20035 // match: (Eq64 x (Mul64 (Rsh64Ux64 (Avg64u x mul:(Hmul64u x (Const64 [m]))) (Const64 [s])) (Const64 [c]))) 20036 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(64,c).m) && s == umagic(64,c).s-1 && x.Op != OpConst64 && udivisibleOK(64,c) 20037 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 20038 for { 20039 _ = v.Args[1] 20040 x := v.Args[0] 20041 v_1 := v.Args[1] 20042 if v_1.Op != OpMul64 { 20043 break 20044 } 20045 _ = v_1.Args[1] 20046 v_1_0 := v_1.Args[0] 20047 if v_1_0.Op != OpRsh64Ux64 { 20048 break 20049 } 20050 _ = v_1_0.Args[1] 20051 v_1_0_0 := v_1_0.Args[0] 20052 if v_1_0_0.Op != OpAvg64u { 20053 break 20054 } 20055 _ = v_1_0_0.Args[1] 20056 if x != v_1_0_0.Args[0] { 20057 break 20058 } 20059 mul := v_1_0_0.Args[1] 20060 if mul.Op != OpHmul64u { 20061 break 20062 } 20063 _ = mul.Args[1] 20064 if x != mul.Args[0] { 20065 break 20066 } 20067 mul_1 := mul.Args[1] 20068 if mul_1.Op != OpConst64 { 20069 break 20070 } 20071 m := mul_1.AuxInt 20072 v_1_0_1 := v_1_0.Args[1] 20073 if v_1_0_1.Op != OpConst64 { 20074 break 20075 } 20076 s := v_1_0_1.AuxInt 20077 v_1_1 := v_1.Args[1] 20078 if v_1_1.Op != OpConst64 { 20079 break 20080 } 20081 c := v_1_1.AuxInt 20082 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(64, c).m) && s == umagic(64, c).s-1 && x.Op != OpConst64 && udivisibleOK(64, c)) { 20083 break 20084 } 20085 v.reset(OpLeq64U) 20086 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 20087 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 20088 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20089 v2.AuxInt = int64(udivisible(64, c).m) 20090 v1.AddArg(v2) 20091 v1.AddArg(x) 20092 v0.AddArg(v1) 20093 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20094 v3.AuxInt = int64(64 - udivisible(64, c).k) 20095 v0.AddArg(v3) 20096 v.AddArg(v0) 20097 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20098 v4.AuxInt = int64(udivisible(64, c).max) 20099 v.AddArg(v4) 20100 return true 20101 } 20102 // match: (Eq64 (Mul64 (Const64 [c]) (Rsh64Ux64 (Avg64u x mul:(Hmul64u (Const64 [m]) x)) (Const64 [s]))) x) 20103 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(64,c).m) && s == umagic(64,c).s-1 && x.Op != OpConst64 && udivisibleOK(64,c) 20104 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 20105 for { 20106 x := v.Args[1] 20107 v_0 := v.Args[0] 20108 if v_0.Op != OpMul64 { 20109 break 20110 } 20111 _ = v_0.Args[1] 20112 v_0_0 := v_0.Args[0] 20113 if v_0_0.Op != OpConst64 { 20114 break 20115 } 20116 c := v_0_0.AuxInt 20117 v_0_1 := v_0.Args[1] 20118 if v_0_1.Op != OpRsh64Ux64 { 20119 break 20120 } 20121 _ = v_0_1.Args[1] 20122 v_0_1_0 := v_0_1.Args[0] 20123 if v_0_1_0.Op != OpAvg64u { 20124 break 20125 } 20126 _ = v_0_1_0.Args[1] 20127 if x != v_0_1_0.Args[0] { 20128 break 20129 } 20130 mul := v_0_1_0.Args[1] 20131 if mul.Op != OpHmul64u { 20132 break 20133 } 20134 _ = mul.Args[1] 20135 mul_0 := mul.Args[0] 20136 if mul_0.Op != OpConst64 { 20137 break 20138 } 20139 m := mul_0.AuxInt 20140 if x != mul.Args[1] { 20141 break 20142 } 20143 v_0_1_1 := v_0_1.Args[1] 20144 if v_0_1_1.Op != OpConst64 { 20145 break 20146 } 20147 s := v_0_1_1.AuxInt 20148 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(64, c).m) && s == umagic(64, c).s-1 && x.Op != OpConst64 && udivisibleOK(64, c)) { 20149 break 20150 } 20151 v.reset(OpLeq64U) 20152 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 20153 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 20154 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20155 v2.AuxInt = int64(udivisible(64, c).m) 20156 v1.AddArg(v2) 20157 v1.AddArg(x) 20158 v0.AddArg(v1) 20159 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20160 v3.AuxInt = int64(64 - udivisible(64, c).k) 20161 v0.AddArg(v3) 20162 v.AddArg(v0) 20163 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20164 v4.AuxInt = int64(udivisible(64, c).max) 20165 v.AddArg(v4) 20166 return true 20167 } 20168 // match: (Eq64 (Mul64 (Const64 [c]) (Rsh64Ux64 (Avg64u x mul:(Hmul64u x (Const64 [m]))) (Const64 [s]))) x) 20169 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(64,c).m) && s == umagic(64,c).s-1 && x.Op != OpConst64 && udivisibleOK(64,c) 20170 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 20171 for { 20172 x := v.Args[1] 20173 v_0 := v.Args[0] 20174 if v_0.Op != OpMul64 { 20175 break 20176 } 20177 _ = v_0.Args[1] 20178 v_0_0 := v_0.Args[0] 20179 if v_0_0.Op != OpConst64 { 20180 break 20181 } 20182 c := v_0_0.AuxInt 20183 v_0_1 := v_0.Args[1] 20184 if v_0_1.Op != OpRsh64Ux64 { 20185 break 20186 } 20187 _ = v_0_1.Args[1] 20188 v_0_1_0 := v_0_1.Args[0] 20189 if v_0_1_0.Op != OpAvg64u { 20190 break 20191 } 20192 _ = v_0_1_0.Args[1] 20193 if x != v_0_1_0.Args[0] { 20194 break 20195 } 20196 mul := v_0_1_0.Args[1] 20197 if mul.Op != OpHmul64u { 20198 break 20199 } 20200 _ = mul.Args[1] 20201 if x != mul.Args[0] { 20202 break 20203 } 20204 mul_1 := mul.Args[1] 20205 if mul_1.Op != OpConst64 { 20206 break 20207 } 20208 m := mul_1.AuxInt 20209 v_0_1_1 := v_0_1.Args[1] 20210 if v_0_1_1.Op != OpConst64 { 20211 break 20212 } 20213 s := v_0_1_1.AuxInt 20214 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(64, c).m) && s == umagic(64, c).s-1 && x.Op != OpConst64 && udivisibleOK(64, c)) { 20215 break 20216 } 20217 v.reset(OpLeq64U) 20218 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 20219 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 20220 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20221 v2.AuxInt = int64(udivisible(64, c).m) 20222 v1.AddArg(v2) 20223 v1.AddArg(x) 20224 v0.AddArg(v1) 20225 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20226 v3.AuxInt = int64(64 - udivisible(64, c).k) 20227 v0.AddArg(v3) 20228 v.AddArg(v0) 20229 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20230 v4.AuxInt = int64(udivisible(64, c).max) 20231 v.AddArg(v4) 20232 return true 20233 } 20234 // match: (Eq64 (Mul64 (Rsh64Ux64 (Avg64u x mul:(Hmul64u (Const64 [m]) x)) (Const64 [s])) (Const64 [c])) x) 20235 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(64,c).m) && s == umagic(64,c).s-1 && x.Op != OpConst64 && udivisibleOK(64,c) 20236 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 20237 for { 20238 x := v.Args[1] 20239 v_0 := v.Args[0] 20240 if v_0.Op != OpMul64 { 20241 break 20242 } 20243 _ = v_0.Args[1] 20244 v_0_0 := v_0.Args[0] 20245 if v_0_0.Op != OpRsh64Ux64 { 20246 break 20247 } 20248 _ = v_0_0.Args[1] 20249 v_0_0_0 := v_0_0.Args[0] 20250 if v_0_0_0.Op != OpAvg64u { 20251 break 20252 } 20253 _ = v_0_0_0.Args[1] 20254 if x != v_0_0_0.Args[0] { 20255 break 20256 } 20257 mul := v_0_0_0.Args[1] 20258 if mul.Op != OpHmul64u { 20259 break 20260 } 20261 _ = mul.Args[1] 20262 mul_0 := mul.Args[0] 20263 if mul_0.Op != OpConst64 { 20264 break 20265 } 20266 m := mul_0.AuxInt 20267 if x != mul.Args[1] { 20268 break 20269 } 20270 v_0_0_1 := v_0_0.Args[1] 20271 if v_0_0_1.Op != OpConst64 { 20272 break 20273 } 20274 s := v_0_0_1.AuxInt 20275 v_0_1 := v_0.Args[1] 20276 if v_0_1.Op != OpConst64 { 20277 break 20278 } 20279 c := v_0_1.AuxInt 20280 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(64, c).m) && s == umagic(64, c).s-1 && x.Op != OpConst64 && udivisibleOK(64, c)) { 20281 break 20282 } 20283 v.reset(OpLeq64U) 20284 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 20285 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 20286 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20287 v2.AuxInt = int64(udivisible(64, c).m) 20288 v1.AddArg(v2) 20289 v1.AddArg(x) 20290 v0.AddArg(v1) 20291 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20292 v3.AuxInt = int64(64 - udivisible(64, c).k) 20293 v0.AddArg(v3) 20294 v.AddArg(v0) 20295 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20296 v4.AuxInt = int64(udivisible(64, c).max) 20297 v.AddArg(v4) 20298 return true 20299 } 20300 return false 20301 } 20302 func rewriteValuegeneric_OpEq64_30(v *Value) bool { 20303 b := v.Block 20304 typ := &b.Func.Config.Types 20305 // match: (Eq64 (Mul64 (Rsh64Ux64 (Avg64u x mul:(Hmul64u x (Const64 [m]))) (Const64 [s])) (Const64 [c])) x) 20306 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(64,c).m) && s == umagic(64,c).s-1 && x.Op != OpConst64 && udivisibleOK(64,c) 20307 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(64-udivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(udivisible(64,c).max)]) ) 20308 for { 20309 x := v.Args[1] 20310 v_0 := v.Args[0] 20311 if v_0.Op != OpMul64 { 20312 break 20313 } 20314 _ = v_0.Args[1] 20315 v_0_0 := v_0.Args[0] 20316 if v_0_0.Op != OpRsh64Ux64 { 20317 break 20318 } 20319 _ = v_0_0.Args[1] 20320 v_0_0_0 := v_0_0.Args[0] 20321 if v_0_0_0.Op != OpAvg64u { 20322 break 20323 } 20324 _ = v_0_0_0.Args[1] 20325 if x != v_0_0_0.Args[0] { 20326 break 20327 } 20328 mul := v_0_0_0.Args[1] 20329 if mul.Op != OpHmul64u { 20330 break 20331 } 20332 _ = mul.Args[1] 20333 if x != mul.Args[0] { 20334 break 20335 } 20336 mul_1 := mul.Args[1] 20337 if mul_1.Op != OpConst64 { 20338 break 20339 } 20340 m := mul_1.AuxInt 20341 v_0_0_1 := v_0_0.Args[1] 20342 if v_0_0_1.Op != OpConst64 { 20343 break 20344 } 20345 s := v_0_0_1.AuxInt 20346 v_0_1 := v_0.Args[1] 20347 if v_0_1.Op != OpConst64 { 20348 break 20349 } 20350 c := v_0_1.AuxInt 20351 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic(64, c).m) && s == umagic(64, c).s-1 && x.Op != OpConst64 && udivisibleOK(64, c)) { 20352 break 20353 } 20354 v.reset(OpLeq64U) 20355 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 20356 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 20357 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20358 v2.AuxInt = int64(udivisible(64, c).m) 20359 v1.AddArg(v2) 20360 v1.AddArg(x) 20361 v0.AddArg(v1) 20362 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20363 v3.AuxInt = int64(64 - udivisible(64, c).k) 20364 v0.AddArg(v3) 20365 v.AddArg(v0) 20366 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20367 v4.AuxInt = int64(udivisible(64, c).max) 20368 v.AddArg(v4) 20369 return true 20370 } 20371 // match: (Eq64 x (Mul64 (Const64 [c]) (Sub64 (Rsh64x64 mul:(Hmul64 (Const64 [m]) x) (Const64 [s])) (Rsh64x64 x (Const64 [63]))))) 20372 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m/2) && s == smagic(64,c).s-1 && x.Op != OpConst64 && sdivisibleOK(64,c) 20373 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 20374 for { 20375 _ = v.Args[1] 20376 x := v.Args[0] 20377 v_1 := v.Args[1] 20378 if v_1.Op != OpMul64 { 20379 break 20380 } 20381 _ = v_1.Args[1] 20382 v_1_0 := v_1.Args[0] 20383 if v_1_0.Op != OpConst64 { 20384 break 20385 } 20386 c := v_1_0.AuxInt 20387 v_1_1 := v_1.Args[1] 20388 if v_1_1.Op != OpSub64 { 20389 break 20390 } 20391 _ = v_1_1.Args[1] 20392 v_1_1_0 := v_1_1.Args[0] 20393 if v_1_1_0.Op != OpRsh64x64 { 20394 break 20395 } 20396 _ = v_1_1_0.Args[1] 20397 mul := v_1_1_0.Args[0] 20398 if mul.Op != OpHmul64 { 20399 break 20400 } 20401 _ = mul.Args[1] 20402 mul_0 := mul.Args[0] 20403 if mul_0.Op != OpConst64 { 20404 break 20405 } 20406 m := mul_0.AuxInt 20407 if x != mul.Args[1] { 20408 break 20409 } 20410 v_1_1_0_1 := v_1_1_0.Args[1] 20411 if v_1_1_0_1.Op != OpConst64 { 20412 break 20413 } 20414 s := v_1_1_0_1.AuxInt 20415 v_1_1_1 := v_1_1.Args[1] 20416 if v_1_1_1.Op != OpRsh64x64 { 20417 break 20418 } 20419 _ = v_1_1_1.Args[1] 20420 if x != v_1_1_1.Args[0] { 20421 break 20422 } 20423 v_1_1_1_1 := v_1_1_1.Args[1] 20424 if v_1_1_1_1.Op != OpConst64 || v_1_1_1_1.AuxInt != 63 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m/2) && s == smagic(64, c).s-1 && x.Op != OpConst64 && sdivisibleOK(64, c)) { 20425 break 20426 } 20427 v.reset(OpLeq64U) 20428 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 20429 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 20430 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 20431 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20432 v3.AuxInt = int64(sdivisible(64, c).m) 20433 v2.AddArg(v3) 20434 v2.AddArg(x) 20435 v1.AddArg(v2) 20436 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20437 v4.AuxInt = int64(sdivisible(64, c).a) 20438 v1.AddArg(v4) 20439 v0.AddArg(v1) 20440 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20441 v5.AuxInt = int64(64 - sdivisible(64, c).k) 20442 v0.AddArg(v5) 20443 v.AddArg(v0) 20444 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20445 v6.AuxInt = int64(sdivisible(64, c).max) 20446 v.AddArg(v6) 20447 return true 20448 } 20449 // match: (Eq64 x (Mul64 (Const64 [c]) (Sub64 (Rsh64x64 mul:(Hmul64 x (Const64 [m])) (Const64 [s])) (Rsh64x64 x (Const64 [63]))))) 20450 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m/2) && s == smagic(64,c).s-1 && x.Op != OpConst64 && sdivisibleOK(64,c) 20451 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 20452 for { 20453 _ = v.Args[1] 20454 x := v.Args[0] 20455 v_1 := v.Args[1] 20456 if v_1.Op != OpMul64 { 20457 break 20458 } 20459 _ = v_1.Args[1] 20460 v_1_0 := v_1.Args[0] 20461 if v_1_0.Op != OpConst64 { 20462 break 20463 } 20464 c := v_1_0.AuxInt 20465 v_1_1 := v_1.Args[1] 20466 if v_1_1.Op != OpSub64 { 20467 break 20468 } 20469 _ = v_1_1.Args[1] 20470 v_1_1_0 := v_1_1.Args[0] 20471 if v_1_1_0.Op != OpRsh64x64 { 20472 break 20473 } 20474 _ = v_1_1_0.Args[1] 20475 mul := v_1_1_0.Args[0] 20476 if mul.Op != OpHmul64 { 20477 break 20478 } 20479 _ = mul.Args[1] 20480 if x != mul.Args[0] { 20481 break 20482 } 20483 mul_1 := mul.Args[1] 20484 if mul_1.Op != OpConst64 { 20485 break 20486 } 20487 m := mul_1.AuxInt 20488 v_1_1_0_1 := v_1_1_0.Args[1] 20489 if v_1_1_0_1.Op != OpConst64 { 20490 break 20491 } 20492 s := v_1_1_0_1.AuxInt 20493 v_1_1_1 := v_1_1.Args[1] 20494 if v_1_1_1.Op != OpRsh64x64 { 20495 break 20496 } 20497 _ = v_1_1_1.Args[1] 20498 if x != v_1_1_1.Args[0] { 20499 break 20500 } 20501 v_1_1_1_1 := v_1_1_1.Args[1] 20502 if v_1_1_1_1.Op != OpConst64 || v_1_1_1_1.AuxInt != 63 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m/2) && s == smagic(64, c).s-1 && x.Op != OpConst64 && sdivisibleOK(64, c)) { 20503 break 20504 } 20505 v.reset(OpLeq64U) 20506 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 20507 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 20508 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 20509 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20510 v3.AuxInt = int64(sdivisible(64, c).m) 20511 v2.AddArg(v3) 20512 v2.AddArg(x) 20513 v1.AddArg(v2) 20514 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20515 v4.AuxInt = int64(sdivisible(64, c).a) 20516 v1.AddArg(v4) 20517 v0.AddArg(v1) 20518 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20519 v5.AuxInt = int64(64 - sdivisible(64, c).k) 20520 v0.AddArg(v5) 20521 v.AddArg(v0) 20522 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20523 v6.AuxInt = int64(sdivisible(64, c).max) 20524 v.AddArg(v6) 20525 return true 20526 } 20527 // match: (Eq64 x (Mul64 (Sub64 (Rsh64x64 mul:(Hmul64 (Const64 [m]) x) (Const64 [s])) (Rsh64x64 x (Const64 [63]))) (Const64 [c]))) 20528 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m/2) && s == smagic(64,c).s-1 && x.Op != OpConst64 && sdivisibleOK(64,c) 20529 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 20530 for { 20531 _ = v.Args[1] 20532 x := v.Args[0] 20533 v_1 := v.Args[1] 20534 if v_1.Op != OpMul64 { 20535 break 20536 } 20537 _ = v_1.Args[1] 20538 v_1_0 := v_1.Args[0] 20539 if v_1_0.Op != OpSub64 { 20540 break 20541 } 20542 _ = v_1_0.Args[1] 20543 v_1_0_0 := v_1_0.Args[0] 20544 if v_1_0_0.Op != OpRsh64x64 { 20545 break 20546 } 20547 _ = v_1_0_0.Args[1] 20548 mul := v_1_0_0.Args[0] 20549 if mul.Op != OpHmul64 { 20550 break 20551 } 20552 _ = mul.Args[1] 20553 mul_0 := mul.Args[0] 20554 if mul_0.Op != OpConst64 { 20555 break 20556 } 20557 m := mul_0.AuxInt 20558 if x != mul.Args[1] { 20559 break 20560 } 20561 v_1_0_0_1 := v_1_0_0.Args[1] 20562 if v_1_0_0_1.Op != OpConst64 { 20563 break 20564 } 20565 s := v_1_0_0_1.AuxInt 20566 v_1_0_1 := v_1_0.Args[1] 20567 if v_1_0_1.Op != OpRsh64x64 { 20568 break 20569 } 20570 _ = v_1_0_1.Args[1] 20571 if x != v_1_0_1.Args[0] { 20572 break 20573 } 20574 v_1_0_1_1 := v_1_0_1.Args[1] 20575 if v_1_0_1_1.Op != OpConst64 || v_1_0_1_1.AuxInt != 63 { 20576 break 20577 } 20578 v_1_1 := v_1.Args[1] 20579 if v_1_1.Op != OpConst64 { 20580 break 20581 } 20582 c := v_1_1.AuxInt 20583 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m/2) && s == smagic(64, c).s-1 && x.Op != OpConst64 && sdivisibleOK(64, c)) { 20584 break 20585 } 20586 v.reset(OpLeq64U) 20587 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 20588 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 20589 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 20590 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20591 v3.AuxInt = int64(sdivisible(64, c).m) 20592 v2.AddArg(v3) 20593 v2.AddArg(x) 20594 v1.AddArg(v2) 20595 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20596 v4.AuxInt = int64(sdivisible(64, c).a) 20597 v1.AddArg(v4) 20598 v0.AddArg(v1) 20599 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20600 v5.AuxInt = int64(64 - sdivisible(64, c).k) 20601 v0.AddArg(v5) 20602 v.AddArg(v0) 20603 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20604 v6.AuxInt = int64(sdivisible(64, c).max) 20605 v.AddArg(v6) 20606 return true 20607 } 20608 // match: (Eq64 x (Mul64 (Sub64 (Rsh64x64 mul:(Hmul64 x (Const64 [m])) (Const64 [s])) (Rsh64x64 x (Const64 [63]))) (Const64 [c]))) 20609 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m/2) && s == smagic(64,c).s-1 && x.Op != OpConst64 && sdivisibleOK(64,c) 20610 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 20611 for { 20612 _ = v.Args[1] 20613 x := v.Args[0] 20614 v_1 := v.Args[1] 20615 if v_1.Op != OpMul64 { 20616 break 20617 } 20618 _ = v_1.Args[1] 20619 v_1_0 := v_1.Args[0] 20620 if v_1_0.Op != OpSub64 { 20621 break 20622 } 20623 _ = v_1_0.Args[1] 20624 v_1_0_0 := v_1_0.Args[0] 20625 if v_1_0_0.Op != OpRsh64x64 { 20626 break 20627 } 20628 _ = v_1_0_0.Args[1] 20629 mul := v_1_0_0.Args[0] 20630 if mul.Op != OpHmul64 { 20631 break 20632 } 20633 _ = mul.Args[1] 20634 if x != mul.Args[0] { 20635 break 20636 } 20637 mul_1 := mul.Args[1] 20638 if mul_1.Op != OpConst64 { 20639 break 20640 } 20641 m := mul_1.AuxInt 20642 v_1_0_0_1 := v_1_0_0.Args[1] 20643 if v_1_0_0_1.Op != OpConst64 { 20644 break 20645 } 20646 s := v_1_0_0_1.AuxInt 20647 v_1_0_1 := v_1_0.Args[1] 20648 if v_1_0_1.Op != OpRsh64x64 { 20649 break 20650 } 20651 _ = v_1_0_1.Args[1] 20652 if x != v_1_0_1.Args[0] { 20653 break 20654 } 20655 v_1_0_1_1 := v_1_0_1.Args[1] 20656 if v_1_0_1_1.Op != OpConst64 || v_1_0_1_1.AuxInt != 63 { 20657 break 20658 } 20659 v_1_1 := v_1.Args[1] 20660 if v_1_1.Op != OpConst64 { 20661 break 20662 } 20663 c := v_1_1.AuxInt 20664 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m/2) && s == smagic(64, c).s-1 && x.Op != OpConst64 && sdivisibleOK(64, c)) { 20665 break 20666 } 20667 v.reset(OpLeq64U) 20668 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 20669 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 20670 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 20671 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20672 v3.AuxInt = int64(sdivisible(64, c).m) 20673 v2.AddArg(v3) 20674 v2.AddArg(x) 20675 v1.AddArg(v2) 20676 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20677 v4.AuxInt = int64(sdivisible(64, c).a) 20678 v1.AddArg(v4) 20679 v0.AddArg(v1) 20680 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20681 v5.AuxInt = int64(64 - sdivisible(64, c).k) 20682 v0.AddArg(v5) 20683 v.AddArg(v0) 20684 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20685 v6.AuxInt = int64(sdivisible(64, c).max) 20686 v.AddArg(v6) 20687 return true 20688 } 20689 // match: (Eq64 (Mul64 (Const64 [c]) (Sub64 (Rsh64x64 mul:(Hmul64 (Const64 [m]) x) (Const64 [s])) (Rsh64x64 x (Const64 [63])))) x) 20690 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m/2) && s == smagic(64,c).s-1 && x.Op != OpConst64 && sdivisibleOK(64,c) 20691 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 20692 for { 20693 x := v.Args[1] 20694 v_0 := v.Args[0] 20695 if v_0.Op != OpMul64 { 20696 break 20697 } 20698 _ = v_0.Args[1] 20699 v_0_0 := v_0.Args[0] 20700 if v_0_0.Op != OpConst64 { 20701 break 20702 } 20703 c := v_0_0.AuxInt 20704 v_0_1 := v_0.Args[1] 20705 if v_0_1.Op != OpSub64 { 20706 break 20707 } 20708 _ = v_0_1.Args[1] 20709 v_0_1_0 := v_0_1.Args[0] 20710 if v_0_1_0.Op != OpRsh64x64 { 20711 break 20712 } 20713 _ = v_0_1_0.Args[1] 20714 mul := v_0_1_0.Args[0] 20715 if mul.Op != OpHmul64 { 20716 break 20717 } 20718 _ = mul.Args[1] 20719 mul_0 := mul.Args[0] 20720 if mul_0.Op != OpConst64 { 20721 break 20722 } 20723 m := mul_0.AuxInt 20724 if x != mul.Args[1] { 20725 break 20726 } 20727 v_0_1_0_1 := v_0_1_0.Args[1] 20728 if v_0_1_0_1.Op != OpConst64 { 20729 break 20730 } 20731 s := v_0_1_0_1.AuxInt 20732 v_0_1_1 := v_0_1.Args[1] 20733 if v_0_1_1.Op != OpRsh64x64 { 20734 break 20735 } 20736 _ = v_0_1_1.Args[1] 20737 if x != v_0_1_1.Args[0] { 20738 break 20739 } 20740 v_0_1_1_1 := v_0_1_1.Args[1] 20741 if v_0_1_1_1.Op != OpConst64 || v_0_1_1_1.AuxInt != 63 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m/2) && s == smagic(64, c).s-1 && x.Op != OpConst64 && sdivisibleOK(64, c)) { 20742 break 20743 } 20744 v.reset(OpLeq64U) 20745 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 20746 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 20747 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 20748 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20749 v3.AuxInt = int64(sdivisible(64, c).m) 20750 v2.AddArg(v3) 20751 v2.AddArg(x) 20752 v1.AddArg(v2) 20753 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20754 v4.AuxInt = int64(sdivisible(64, c).a) 20755 v1.AddArg(v4) 20756 v0.AddArg(v1) 20757 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20758 v5.AuxInt = int64(64 - sdivisible(64, c).k) 20759 v0.AddArg(v5) 20760 v.AddArg(v0) 20761 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20762 v6.AuxInt = int64(sdivisible(64, c).max) 20763 v.AddArg(v6) 20764 return true 20765 } 20766 // match: (Eq64 (Mul64 (Const64 [c]) (Sub64 (Rsh64x64 mul:(Hmul64 x (Const64 [m])) (Const64 [s])) (Rsh64x64 x (Const64 [63])))) x) 20767 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m/2) && s == smagic(64,c).s-1 && x.Op != OpConst64 && sdivisibleOK(64,c) 20768 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 20769 for { 20770 x := v.Args[1] 20771 v_0 := v.Args[0] 20772 if v_0.Op != OpMul64 { 20773 break 20774 } 20775 _ = v_0.Args[1] 20776 v_0_0 := v_0.Args[0] 20777 if v_0_0.Op != OpConst64 { 20778 break 20779 } 20780 c := v_0_0.AuxInt 20781 v_0_1 := v_0.Args[1] 20782 if v_0_1.Op != OpSub64 { 20783 break 20784 } 20785 _ = v_0_1.Args[1] 20786 v_0_1_0 := v_0_1.Args[0] 20787 if v_0_1_0.Op != OpRsh64x64 { 20788 break 20789 } 20790 _ = v_0_1_0.Args[1] 20791 mul := v_0_1_0.Args[0] 20792 if mul.Op != OpHmul64 { 20793 break 20794 } 20795 _ = mul.Args[1] 20796 if x != mul.Args[0] { 20797 break 20798 } 20799 mul_1 := mul.Args[1] 20800 if mul_1.Op != OpConst64 { 20801 break 20802 } 20803 m := mul_1.AuxInt 20804 v_0_1_0_1 := v_0_1_0.Args[1] 20805 if v_0_1_0_1.Op != OpConst64 { 20806 break 20807 } 20808 s := v_0_1_0_1.AuxInt 20809 v_0_1_1 := v_0_1.Args[1] 20810 if v_0_1_1.Op != OpRsh64x64 { 20811 break 20812 } 20813 _ = v_0_1_1.Args[1] 20814 if x != v_0_1_1.Args[0] { 20815 break 20816 } 20817 v_0_1_1_1 := v_0_1_1.Args[1] 20818 if v_0_1_1_1.Op != OpConst64 || v_0_1_1_1.AuxInt != 63 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m/2) && s == smagic(64, c).s-1 && x.Op != OpConst64 && sdivisibleOK(64, c)) { 20819 break 20820 } 20821 v.reset(OpLeq64U) 20822 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 20823 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 20824 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 20825 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20826 v3.AuxInt = int64(sdivisible(64, c).m) 20827 v2.AddArg(v3) 20828 v2.AddArg(x) 20829 v1.AddArg(v2) 20830 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20831 v4.AuxInt = int64(sdivisible(64, c).a) 20832 v1.AddArg(v4) 20833 v0.AddArg(v1) 20834 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20835 v5.AuxInt = int64(64 - sdivisible(64, c).k) 20836 v0.AddArg(v5) 20837 v.AddArg(v0) 20838 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20839 v6.AuxInt = int64(sdivisible(64, c).max) 20840 v.AddArg(v6) 20841 return true 20842 } 20843 // match: (Eq64 (Mul64 (Sub64 (Rsh64x64 mul:(Hmul64 (Const64 [m]) x) (Const64 [s])) (Rsh64x64 x (Const64 [63]))) (Const64 [c])) x) 20844 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m/2) && s == smagic(64,c).s-1 && x.Op != OpConst64 && sdivisibleOK(64,c) 20845 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 20846 for { 20847 x := v.Args[1] 20848 v_0 := v.Args[0] 20849 if v_0.Op != OpMul64 { 20850 break 20851 } 20852 _ = v_0.Args[1] 20853 v_0_0 := v_0.Args[0] 20854 if v_0_0.Op != OpSub64 { 20855 break 20856 } 20857 _ = v_0_0.Args[1] 20858 v_0_0_0 := v_0_0.Args[0] 20859 if v_0_0_0.Op != OpRsh64x64 { 20860 break 20861 } 20862 _ = v_0_0_0.Args[1] 20863 mul := v_0_0_0.Args[0] 20864 if mul.Op != OpHmul64 { 20865 break 20866 } 20867 _ = mul.Args[1] 20868 mul_0 := mul.Args[0] 20869 if mul_0.Op != OpConst64 { 20870 break 20871 } 20872 m := mul_0.AuxInt 20873 if x != mul.Args[1] { 20874 break 20875 } 20876 v_0_0_0_1 := v_0_0_0.Args[1] 20877 if v_0_0_0_1.Op != OpConst64 { 20878 break 20879 } 20880 s := v_0_0_0_1.AuxInt 20881 v_0_0_1 := v_0_0.Args[1] 20882 if v_0_0_1.Op != OpRsh64x64 { 20883 break 20884 } 20885 _ = v_0_0_1.Args[1] 20886 if x != v_0_0_1.Args[0] { 20887 break 20888 } 20889 v_0_0_1_1 := v_0_0_1.Args[1] 20890 if v_0_0_1_1.Op != OpConst64 || v_0_0_1_1.AuxInt != 63 { 20891 break 20892 } 20893 v_0_1 := v_0.Args[1] 20894 if v_0_1.Op != OpConst64 { 20895 break 20896 } 20897 c := v_0_1.AuxInt 20898 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m/2) && s == smagic(64, c).s-1 && x.Op != OpConst64 && sdivisibleOK(64, c)) { 20899 break 20900 } 20901 v.reset(OpLeq64U) 20902 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 20903 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 20904 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 20905 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20906 v3.AuxInt = int64(sdivisible(64, c).m) 20907 v2.AddArg(v3) 20908 v2.AddArg(x) 20909 v1.AddArg(v2) 20910 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20911 v4.AuxInt = int64(sdivisible(64, c).a) 20912 v1.AddArg(v4) 20913 v0.AddArg(v1) 20914 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20915 v5.AuxInt = int64(64 - sdivisible(64, c).k) 20916 v0.AddArg(v5) 20917 v.AddArg(v0) 20918 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20919 v6.AuxInt = int64(sdivisible(64, c).max) 20920 v.AddArg(v6) 20921 return true 20922 } 20923 // match: (Eq64 (Mul64 (Sub64 (Rsh64x64 mul:(Hmul64 x (Const64 [m])) (Const64 [s])) (Rsh64x64 x (Const64 [63]))) (Const64 [c])) x) 20924 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m/2) && s == smagic(64,c).s-1 && x.Op != OpConst64 && sdivisibleOK(64,c) 20925 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 20926 for { 20927 x := v.Args[1] 20928 v_0 := v.Args[0] 20929 if v_0.Op != OpMul64 { 20930 break 20931 } 20932 _ = v_0.Args[1] 20933 v_0_0 := v_0.Args[0] 20934 if v_0_0.Op != OpSub64 { 20935 break 20936 } 20937 _ = v_0_0.Args[1] 20938 v_0_0_0 := v_0_0.Args[0] 20939 if v_0_0_0.Op != OpRsh64x64 { 20940 break 20941 } 20942 _ = v_0_0_0.Args[1] 20943 mul := v_0_0_0.Args[0] 20944 if mul.Op != OpHmul64 { 20945 break 20946 } 20947 _ = mul.Args[1] 20948 if x != mul.Args[0] { 20949 break 20950 } 20951 mul_1 := mul.Args[1] 20952 if mul_1.Op != OpConst64 { 20953 break 20954 } 20955 m := mul_1.AuxInt 20956 v_0_0_0_1 := v_0_0_0.Args[1] 20957 if v_0_0_0_1.Op != OpConst64 { 20958 break 20959 } 20960 s := v_0_0_0_1.AuxInt 20961 v_0_0_1 := v_0_0.Args[1] 20962 if v_0_0_1.Op != OpRsh64x64 { 20963 break 20964 } 20965 _ = v_0_0_1.Args[1] 20966 if x != v_0_0_1.Args[0] { 20967 break 20968 } 20969 v_0_0_1_1 := v_0_0_1.Args[1] 20970 if v_0_0_1_1.Op != OpConst64 || v_0_0_1_1.AuxInt != 63 { 20971 break 20972 } 20973 v_0_1 := v_0.Args[1] 20974 if v_0_1.Op != OpConst64 { 20975 break 20976 } 20977 c := v_0_1.AuxInt 20978 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m/2) && s == smagic(64, c).s-1 && x.Op != OpConst64 && sdivisibleOK(64, c)) { 20979 break 20980 } 20981 v.reset(OpLeq64U) 20982 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 20983 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 20984 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 20985 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20986 v3.AuxInt = int64(sdivisible(64, c).m) 20987 v2.AddArg(v3) 20988 v2.AddArg(x) 20989 v1.AddArg(v2) 20990 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20991 v4.AuxInt = int64(sdivisible(64, c).a) 20992 v1.AddArg(v4) 20993 v0.AddArg(v1) 20994 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20995 v5.AuxInt = int64(64 - sdivisible(64, c).k) 20996 v0.AddArg(v5) 20997 v.AddArg(v0) 20998 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 20999 v6.AuxInt = int64(sdivisible(64, c).max) 21000 v.AddArg(v6) 21001 return true 21002 } 21003 // match: (Eq64 x (Mul64 (Const64 [c]) (Sub64 (Rsh64x64 (Add64 mul:(Hmul64 (Const64 [m]) x) x) (Const64 [s])) (Rsh64x64 x (Const64 [63]))))) 21004 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m) && s == smagic(64,c).s && x.Op != OpConst64 && sdivisibleOK(64,c) 21005 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 21006 for { 21007 _ = v.Args[1] 21008 x := v.Args[0] 21009 v_1 := v.Args[1] 21010 if v_1.Op != OpMul64 { 21011 break 21012 } 21013 _ = v_1.Args[1] 21014 v_1_0 := v_1.Args[0] 21015 if v_1_0.Op != OpConst64 { 21016 break 21017 } 21018 c := v_1_0.AuxInt 21019 v_1_1 := v_1.Args[1] 21020 if v_1_1.Op != OpSub64 { 21021 break 21022 } 21023 _ = v_1_1.Args[1] 21024 v_1_1_0 := v_1_1.Args[0] 21025 if v_1_1_0.Op != OpRsh64x64 { 21026 break 21027 } 21028 _ = v_1_1_0.Args[1] 21029 v_1_1_0_0 := v_1_1_0.Args[0] 21030 if v_1_1_0_0.Op != OpAdd64 { 21031 break 21032 } 21033 _ = v_1_1_0_0.Args[1] 21034 mul := v_1_1_0_0.Args[0] 21035 if mul.Op != OpHmul64 { 21036 break 21037 } 21038 _ = mul.Args[1] 21039 mul_0 := mul.Args[0] 21040 if mul_0.Op != OpConst64 { 21041 break 21042 } 21043 m := mul_0.AuxInt 21044 if x != mul.Args[1] || x != v_1_1_0_0.Args[1] { 21045 break 21046 } 21047 v_1_1_0_1 := v_1_1_0.Args[1] 21048 if v_1_1_0_1.Op != OpConst64 { 21049 break 21050 } 21051 s := v_1_1_0_1.AuxInt 21052 v_1_1_1 := v_1_1.Args[1] 21053 if v_1_1_1.Op != OpRsh64x64 { 21054 break 21055 } 21056 _ = v_1_1_1.Args[1] 21057 if x != v_1_1_1.Args[0] { 21058 break 21059 } 21060 v_1_1_1_1 := v_1_1_1.Args[1] 21061 if v_1_1_1_1.Op != OpConst64 || v_1_1_1_1.AuxInt != 63 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m) && s == smagic(64, c).s && x.Op != OpConst64 && sdivisibleOK(64, c)) { 21062 break 21063 } 21064 v.reset(OpLeq64U) 21065 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 21066 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 21067 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 21068 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21069 v3.AuxInt = int64(sdivisible(64, c).m) 21070 v2.AddArg(v3) 21071 v2.AddArg(x) 21072 v1.AddArg(v2) 21073 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21074 v4.AuxInt = int64(sdivisible(64, c).a) 21075 v1.AddArg(v4) 21076 v0.AddArg(v1) 21077 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21078 v5.AuxInt = int64(64 - sdivisible(64, c).k) 21079 v0.AddArg(v5) 21080 v.AddArg(v0) 21081 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21082 v6.AuxInt = int64(sdivisible(64, c).max) 21083 v.AddArg(v6) 21084 return true 21085 } 21086 return false 21087 } 21088 func rewriteValuegeneric_OpEq64_40(v *Value) bool { 21089 b := v.Block 21090 typ := &b.Func.Config.Types 21091 // match: (Eq64 x (Mul64 (Const64 [c]) (Sub64 (Rsh64x64 (Add64 mul:(Hmul64 x (Const64 [m])) x) (Const64 [s])) (Rsh64x64 x (Const64 [63]))))) 21092 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m) && s == smagic(64,c).s && x.Op != OpConst64 && sdivisibleOK(64,c) 21093 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 21094 for { 21095 _ = v.Args[1] 21096 x := v.Args[0] 21097 v_1 := v.Args[1] 21098 if v_1.Op != OpMul64 { 21099 break 21100 } 21101 _ = v_1.Args[1] 21102 v_1_0 := v_1.Args[0] 21103 if v_1_0.Op != OpConst64 { 21104 break 21105 } 21106 c := v_1_0.AuxInt 21107 v_1_1 := v_1.Args[1] 21108 if v_1_1.Op != OpSub64 { 21109 break 21110 } 21111 _ = v_1_1.Args[1] 21112 v_1_1_0 := v_1_1.Args[0] 21113 if v_1_1_0.Op != OpRsh64x64 { 21114 break 21115 } 21116 _ = v_1_1_0.Args[1] 21117 v_1_1_0_0 := v_1_1_0.Args[0] 21118 if v_1_1_0_0.Op != OpAdd64 { 21119 break 21120 } 21121 _ = v_1_1_0_0.Args[1] 21122 mul := v_1_1_0_0.Args[0] 21123 if mul.Op != OpHmul64 { 21124 break 21125 } 21126 _ = mul.Args[1] 21127 if x != mul.Args[0] { 21128 break 21129 } 21130 mul_1 := mul.Args[1] 21131 if mul_1.Op != OpConst64 { 21132 break 21133 } 21134 m := mul_1.AuxInt 21135 if x != v_1_1_0_0.Args[1] { 21136 break 21137 } 21138 v_1_1_0_1 := v_1_1_0.Args[1] 21139 if v_1_1_0_1.Op != OpConst64 { 21140 break 21141 } 21142 s := v_1_1_0_1.AuxInt 21143 v_1_1_1 := v_1_1.Args[1] 21144 if v_1_1_1.Op != OpRsh64x64 { 21145 break 21146 } 21147 _ = v_1_1_1.Args[1] 21148 if x != v_1_1_1.Args[0] { 21149 break 21150 } 21151 v_1_1_1_1 := v_1_1_1.Args[1] 21152 if v_1_1_1_1.Op != OpConst64 || v_1_1_1_1.AuxInt != 63 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m) && s == smagic(64, c).s && x.Op != OpConst64 && sdivisibleOK(64, c)) { 21153 break 21154 } 21155 v.reset(OpLeq64U) 21156 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 21157 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 21158 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 21159 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21160 v3.AuxInt = int64(sdivisible(64, c).m) 21161 v2.AddArg(v3) 21162 v2.AddArg(x) 21163 v1.AddArg(v2) 21164 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21165 v4.AuxInt = int64(sdivisible(64, c).a) 21166 v1.AddArg(v4) 21167 v0.AddArg(v1) 21168 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21169 v5.AuxInt = int64(64 - sdivisible(64, c).k) 21170 v0.AddArg(v5) 21171 v.AddArg(v0) 21172 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21173 v6.AuxInt = int64(sdivisible(64, c).max) 21174 v.AddArg(v6) 21175 return true 21176 } 21177 // match: (Eq64 x (Mul64 (Const64 [c]) (Sub64 (Rsh64x64 (Add64 x mul:(Hmul64 (Const64 [m]) x)) (Const64 [s])) (Rsh64x64 x (Const64 [63]))))) 21178 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m) && s == smagic(64,c).s && x.Op != OpConst64 && sdivisibleOK(64,c) 21179 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 21180 for { 21181 _ = v.Args[1] 21182 x := v.Args[0] 21183 v_1 := v.Args[1] 21184 if v_1.Op != OpMul64 { 21185 break 21186 } 21187 _ = v_1.Args[1] 21188 v_1_0 := v_1.Args[0] 21189 if v_1_0.Op != OpConst64 { 21190 break 21191 } 21192 c := v_1_0.AuxInt 21193 v_1_1 := v_1.Args[1] 21194 if v_1_1.Op != OpSub64 { 21195 break 21196 } 21197 _ = v_1_1.Args[1] 21198 v_1_1_0 := v_1_1.Args[0] 21199 if v_1_1_0.Op != OpRsh64x64 { 21200 break 21201 } 21202 _ = v_1_1_0.Args[1] 21203 v_1_1_0_0 := v_1_1_0.Args[0] 21204 if v_1_1_0_0.Op != OpAdd64 { 21205 break 21206 } 21207 _ = v_1_1_0_0.Args[1] 21208 if x != v_1_1_0_0.Args[0] { 21209 break 21210 } 21211 mul := v_1_1_0_0.Args[1] 21212 if mul.Op != OpHmul64 { 21213 break 21214 } 21215 _ = mul.Args[1] 21216 mul_0 := mul.Args[0] 21217 if mul_0.Op != OpConst64 { 21218 break 21219 } 21220 m := mul_0.AuxInt 21221 if x != mul.Args[1] { 21222 break 21223 } 21224 v_1_1_0_1 := v_1_1_0.Args[1] 21225 if v_1_1_0_1.Op != OpConst64 { 21226 break 21227 } 21228 s := v_1_1_0_1.AuxInt 21229 v_1_1_1 := v_1_1.Args[1] 21230 if v_1_1_1.Op != OpRsh64x64 { 21231 break 21232 } 21233 _ = v_1_1_1.Args[1] 21234 if x != v_1_1_1.Args[0] { 21235 break 21236 } 21237 v_1_1_1_1 := v_1_1_1.Args[1] 21238 if v_1_1_1_1.Op != OpConst64 || v_1_1_1_1.AuxInt != 63 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m) && s == smagic(64, c).s && x.Op != OpConst64 && sdivisibleOK(64, c)) { 21239 break 21240 } 21241 v.reset(OpLeq64U) 21242 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 21243 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 21244 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 21245 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21246 v3.AuxInt = int64(sdivisible(64, c).m) 21247 v2.AddArg(v3) 21248 v2.AddArg(x) 21249 v1.AddArg(v2) 21250 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21251 v4.AuxInt = int64(sdivisible(64, c).a) 21252 v1.AddArg(v4) 21253 v0.AddArg(v1) 21254 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21255 v5.AuxInt = int64(64 - sdivisible(64, c).k) 21256 v0.AddArg(v5) 21257 v.AddArg(v0) 21258 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21259 v6.AuxInt = int64(sdivisible(64, c).max) 21260 v.AddArg(v6) 21261 return true 21262 } 21263 // match: (Eq64 x (Mul64 (Const64 [c]) (Sub64 (Rsh64x64 (Add64 x mul:(Hmul64 x (Const64 [m]))) (Const64 [s])) (Rsh64x64 x (Const64 [63]))))) 21264 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m) && s == smagic(64,c).s && x.Op != OpConst64 && sdivisibleOK(64,c) 21265 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 21266 for { 21267 _ = v.Args[1] 21268 x := v.Args[0] 21269 v_1 := v.Args[1] 21270 if v_1.Op != OpMul64 { 21271 break 21272 } 21273 _ = v_1.Args[1] 21274 v_1_0 := v_1.Args[0] 21275 if v_1_0.Op != OpConst64 { 21276 break 21277 } 21278 c := v_1_0.AuxInt 21279 v_1_1 := v_1.Args[1] 21280 if v_1_1.Op != OpSub64 { 21281 break 21282 } 21283 _ = v_1_1.Args[1] 21284 v_1_1_0 := v_1_1.Args[0] 21285 if v_1_1_0.Op != OpRsh64x64 { 21286 break 21287 } 21288 _ = v_1_1_0.Args[1] 21289 v_1_1_0_0 := v_1_1_0.Args[0] 21290 if v_1_1_0_0.Op != OpAdd64 { 21291 break 21292 } 21293 _ = v_1_1_0_0.Args[1] 21294 if x != v_1_1_0_0.Args[0] { 21295 break 21296 } 21297 mul := v_1_1_0_0.Args[1] 21298 if mul.Op != OpHmul64 { 21299 break 21300 } 21301 _ = mul.Args[1] 21302 if x != mul.Args[0] { 21303 break 21304 } 21305 mul_1 := mul.Args[1] 21306 if mul_1.Op != OpConst64 { 21307 break 21308 } 21309 m := mul_1.AuxInt 21310 v_1_1_0_1 := v_1_1_0.Args[1] 21311 if v_1_1_0_1.Op != OpConst64 { 21312 break 21313 } 21314 s := v_1_1_0_1.AuxInt 21315 v_1_1_1 := v_1_1.Args[1] 21316 if v_1_1_1.Op != OpRsh64x64 { 21317 break 21318 } 21319 _ = v_1_1_1.Args[1] 21320 if x != v_1_1_1.Args[0] { 21321 break 21322 } 21323 v_1_1_1_1 := v_1_1_1.Args[1] 21324 if v_1_1_1_1.Op != OpConst64 || v_1_1_1_1.AuxInt != 63 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m) && s == smagic(64, c).s && x.Op != OpConst64 && sdivisibleOK(64, c)) { 21325 break 21326 } 21327 v.reset(OpLeq64U) 21328 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 21329 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 21330 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 21331 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21332 v3.AuxInt = int64(sdivisible(64, c).m) 21333 v2.AddArg(v3) 21334 v2.AddArg(x) 21335 v1.AddArg(v2) 21336 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21337 v4.AuxInt = int64(sdivisible(64, c).a) 21338 v1.AddArg(v4) 21339 v0.AddArg(v1) 21340 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21341 v5.AuxInt = int64(64 - sdivisible(64, c).k) 21342 v0.AddArg(v5) 21343 v.AddArg(v0) 21344 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21345 v6.AuxInt = int64(sdivisible(64, c).max) 21346 v.AddArg(v6) 21347 return true 21348 } 21349 // match: (Eq64 x (Mul64 (Sub64 (Rsh64x64 (Add64 mul:(Hmul64 (Const64 [m]) x) x) (Const64 [s])) (Rsh64x64 x (Const64 [63]))) (Const64 [c]))) 21350 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m) && s == smagic(64,c).s && x.Op != OpConst64 && sdivisibleOK(64,c) 21351 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 21352 for { 21353 _ = v.Args[1] 21354 x := v.Args[0] 21355 v_1 := v.Args[1] 21356 if v_1.Op != OpMul64 { 21357 break 21358 } 21359 _ = v_1.Args[1] 21360 v_1_0 := v_1.Args[0] 21361 if v_1_0.Op != OpSub64 { 21362 break 21363 } 21364 _ = v_1_0.Args[1] 21365 v_1_0_0 := v_1_0.Args[0] 21366 if v_1_0_0.Op != OpRsh64x64 { 21367 break 21368 } 21369 _ = v_1_0_0.Args[1] 21370 v_1_0_0_0 := v_1_0_0.Args[0] 21371 if v_1_0_0_0.Op != OpAdd64 { 21372 break 21373 } 21374 _ = v_1_0_0_0.Args[1] 21375 mul := v_1_0_0_0.Args[0] 21376 if mul.Op != OpHmul64 { 21377 break 21378 } 21379 _ = mul.Args[1] 21380 mul_0 := mul.Args[0] 21381 if mul_0.Op != OpConst64 { 21382 break 21383 } 21384 m := mul_0.AuxInt 21385 if x != mul.Args[1] || x != v_1_0_0_0.Args[1] { 21386 break 21387 } 21388 v_1_0_0_1 := v_1_0_0.Args[1] 21389 if v_1_0_0_1.Op != OpConst64 { 21390 break 21391 } 21392 s := v_1_0_0_1.AuxInt 21393 v_1_0_1 := v_1_0.Args[1] 21394 if v_1_0_1.Op != OpRsh64x64 { 21395 break 21396 } 21397 _ = v_1_0_1.Args[1] 21398 if x != v_1_0_1.Args[0] { 21399 break 21400 } 21401 v_1_0_1_1 := v_1_0_1.Args[1] 21402 if v_1_0_1_1.Op != OpConst64 || v_1_0_1_1.AuxInt != 63 { 21403 break 21404 } 21405 v_1_1 := v_1.Args[1] 21406 if v_1_1.Op != OpConst64 { 21407 break 21408 } 21409 c := v_1_1.AuxInt 21410 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m) && s == smagic(64, c).s && x.Op != OpConst64 && sdivisibleOK(64, c)) { 21411 break 21412 } 21413 v.reset(OpLeq64U) 21414 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 21415 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 21416 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 21417 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21418 v3.AuxInt = int64(sdivisible(64, c).m) 21419 v2.AddArg(v3) 21420 v2.AddArg(x) 21421 v1.AddArg(v2) 21422 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21423 v4.AuxInt = int64(sdivisible(64, c).a) 21424 v1.AddArg(v4) 21425 v0.AddArg(v1) 21426 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21427 v5.AuxInt = int64(64 - sdivisible(64, c).k) 21428 v0.AddArg(v5) 21429 v.AddArg(v0) 21430 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21431 v6.AuxInt = int64(sdivisible(64, c).max) 21432 v.AddArg(v6) 21433 return true 21434 } 21435 // match: (Eq64 x (Mul64 (Sub64 (Rsh64x64 (Add64 mul:(Hmul64 x (Const64 [m])) x) (Const64 [s])) (Rsh64x64 x (Const64 [63]))) (Const64 [c]))) 21436 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m) && s == smagic(64,c).s && x.Op != OpConst64 && sdivisibleOK(64,c) 21437 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 21438 for { 21439 _ = v.Args[1] 21440 x := v.Args[0] 21441 v_1 := v.Args[1] 21442 if v_1.Op != OpMul64 { 21443 break 21444 } 21445 _ = v_1.Args[1] 21446 v_1_0 := v_1.Args[0] 21447 if v_1_0.Op != OpSub64 { 21448 break 21449 } 21450 _ = v_1_0.Args[1] 21451 v_1_0_0 := v_1_0.Args[0] 21452 if v_1_0_0.Op != OpRsh64x64 { 21453 break 21454 } 21455 _ = v_1_0_0.Args[1] 21456 v_1_0_0_0 := v_1_0_0.Args[0] 21457 if v_1_0_0_0.Op != OpAdd64 { 21458 break 21459 } 21460 _ = v_1_0_0_0.Args[1] 21461 mul := v_1_0_0_0.Args[0] 21462 if mul.Op != OpHmul64 { 21463 break 21464 } 21465 _ = mul.Args[1] 21466 if x != mul.Args[0] { 21467 break 21468 } 21469 mul_1 := mul.Args[1] 21470 if mul_1.Op != OpConst64 { 21471 break 21472 } 21473 m := mul_1.AuxInt 21474 if x != v_1_0_0_0.Args[1] { 21475 break 21476 } 21477 v_1_0_0_1 := v_1_0_0.Args[1] 21478 if v_1_0_0_1.Op != OpConst64 { 21479 break 21480 } 21481 s := v_1_0_0_1.AuxInt 21482 v_1_0_1 := v_1_0.Args[1] 21483 if v_1_0_1.Op != OpRsh64x64 { 21484 break 21485 } 21486 _ = v_1_0_1.Args[1] 21487 if x != v_1_0_1.Args[0] { 21488 break 21489 } 21490 v_1_0_1_1 := v_1_0_1.Args[1] 21491 if v_1_0_1_1.Op != OpConst64 || v_1_0_1_1.AuxInt != 63 { 21492 break 21493 } 21494 v_1_1 := v_1.Args[1] 21495 if v_1_1.Op != OpConst64 { 21496 break 21497 } 21498 c := v_1_1.AuxInt 21499 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m) && s == smagic(64, c).s && x.Op != OpConst64 && sdivisibleOK(64, c)) { 21500 break 21501 } 21502 v.reset(OpLeq64U) 21503 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 21504 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 21505 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 21506 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21507 v3.AuxInt = int64(sdivisible(64, c).m) 21508 v2.AddArg(v3) 21509 v2.AddArg(x) 21510 v1.AddArg(v2) 21511 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21512 v4.AuxInt = int64(sdivisible(64, c).a) 21513 v1.AddArg(v4) 21514 v0.AddArg(v1) 21515 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21516 v5.AuxInt = int64(64 - sdivisible(64, c).k) 21517 v0.AddArg(v5) 21518 v.AddArg(v0) 21519 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21520 v6.AuxInt = int64(sdivisible(64, c).max) 21521 v.AddArg(v6) 21522 return true 21523 } 21524 // match: (Eq64 x (Mul64 (Sub64 (Rsh64x64 (Add64 x mul:(Hmul64 (Const64 [m]) x)) (Const64 [s])) (Rsh64x64 x (Const64 [63]))) (Const64 [c]))) 21525 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m) && s == smagic(64,c).s && x.Op != OpConst64 && sdivisibleOK(64,c) 21526 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 21527 for { 21528 _ = v.Args[1] 21529 x := v.Args[0] 21530 v_1 := v.Args[1] 21531 if v_1.Op != OpMul64 { 21532 break 21533 } 21534 _ = v_1.Args[1] 21535 v_1_0 := v_1.Args[0] 21536 if v_1_0.Op != OpSub64 { 21537 break 21538 } 21539 _ = v_1_0.Args[1] 21540 v_1_0_0 := v_1_0.Args[0] 21541 if v_1_0_0.Op != OpRsh64x64 { 21542 break 21543 } 21544 _ = v_1_0_0.Args[1] 21545 v_1_0_0_0 := v_1_0_0.Args[0] 21546 if v_1_0_0_0.Op != OpAdd64 { 21547 break 21548 } 21549 _ = v_1_0_0_0.Args[1] 21550 if x != v_1_0_0_0.Args[0] { 21551 break 21552 } 21553 mul := v_1_0_0_0.Args[1] 21554 if mul.Op != OpHmul64 { 21555 break 21556 } 21557 _ = mul.Args[1] 21558 mul_0 := mul.Args[0] 21559 if mul_0.Op != OpConst64 { 21560 break 21561 } 21562 m := mul_0.AuxInt 21563 if x != mul.Args[1] { 21564 break 21565 } 21566 v_1_0_0_1 := v_1_0_0.Args[1] 21567 if v_1_0_0_1.Op != OpConst64 { 21568 break 21569 } 21570 s := v_1_0_0_1.AuxInt 21571 v_1_0_1 := v_1_0.Args[1] 21572 if v_1_0_1.Op != OpRsh64x64 { 21573 break 21574 } 21575 _ = v_1_0_1.Args[1] 21576 if x != v_1_0_1.Args[0] { 21577 break 21578 } 21579 v_1_0_1_1 := v_1_0_1.Args[1] 21580 if v_1_0_1_1.Op != OpConst64 || v_1_0_1_1.AuxInt != 63 { 21581 break 21582 } 21583 v_1_1 := v_1.Args[1] 21584 if v_1_1.Op != OpConst64 { 21585 break 21586 } 21587 c := v_1_1.AuxInt 21588 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m) && s == smagic(64, c).s && x.Op != OpConst64 && sdivisibleOK(64, c)) { 21589 break 21590 } 21591 v.reset(OpLeq64U) 21592 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 21593 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 21594 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 21595 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21596 v3.AuxInt = int64(sdivisible(64, c).m) 21597 v2.AddArg(v3) 21598 v2.AddArg(x) 21599 v1.AddArg(v2) 21600 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21601 v4.AuxInt = int64(sdivisible(64, c).a) 21602 v1.AddArg(v4) 21603 v0.AddArg(v1) 21604 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21605 v5.AuxInt = int64(64 - sdivisible(64, c).k) 21606 v0.AddArg(v5) 21607 v.AddArg(v0) 21608 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21609 v6.AuxInt = int64(sdivisible(64, c).max) 21610 v.AddArg(v6) 21611 return true 21612 } 21613 // match: (Eq64 x (Mul64 (Sub64 (Rsh64x64 (Add64 x mul:(Hmul64 x (Const64 [m]))) (Const64 [s])) (Rsh64x64 x (Const64 [63]))) (Const64 [c]))) 21614 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m) && s == smagic(64,c).s && x.Op != OpConst64 && sdivisibleOK(64,c) 21615 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 21616 for { 21617 _ = v.Args[1] 21618 x := v.Args[0] 21619 v_1 := v.Args[1] 21620 if v_1.Op != OpMul64 { 21621 break 21622 } 21623 _ = v_1.Args[1] 21624 v_1_0 := v_1.Args[0] 21625 if v_1_0.Op != OpSub64 { 21626 break 21627 } 21628 _ = v_1_0.Args[1] 21629 v_1_0_0 := v_1_0.Args[0] 21630 if v_1_0_0.Op != OpRsh64x64 { 21631 break 21632 } 21633 _ = v_1_0_0.Args[1] 21634 v_1_0_0_0 := v_1_0_0.Args[0] 21635 if v_1_0_0_0.Op != OpAdd64 { 21636 break 21637 } 21638 _ = v_1_0_0_0.Args[1] 21639 if x != v_1_0_0_0.Args[0] { 21640 break 21641 } 21642 mul := v_1_0_0_0.Args[1] 21643 if mul.Op != OpHmul64 { 21644 break 21645 } 21646 _ = mul.Args[1] 21647 if x != mul.Args[0] { 21648 break 21649 } 21650 mul_1 := mul.Args[1] 21651 if mul_1.Op != OpConst64 { 21652 break 21653 } 21654 m := mul_1.AuxInt 21655 v_1_0_0_1 := v_1_0_0.Args[1] 21656 if v_1_0_0_1.Op != OpConst64 { 21657 break 21658 } 21659 s := v_1_0_0_1.AuxInt 21660 v_1_0_1 := v_1_0.Args[1] 21661 if v_1_0_1.Op != OpRsh64x64 { 21662 break 21663 } 21664 _ = v_1_0_1.Args[1] 21665 if x != v_1_0_1.Args[0] { 21666 break 21667 } 21668 v_1_0_1_1 := v_1_0_1.Args[1] 21669 if v_1_0_1_1.Op != OpConst64 || v_1_0_1_1.AuxInt != 63 { 21670 break 21671 } 21672 v_1_1 := v_1.Args[1] 21673 if v_1_1.Op != OpConst64 { 21674 break 21675 } 21676 c := v_1_1.AuxInt 21677 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m) && s == smagic(64, c).s && x.Op != OpConst64 && sdivisibleOK(64, c)) { 21678 break 21679 } 21680 v.reset(OpLeq64U) 21681 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 21682 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 21683 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 21684 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21685 v3.AuxInt = int64(sdivisible(64, c).m) 21686 v2.AddArg(v3) 21687 v2.AddArg(x) 21688 v1.AddArg(v2) 21689 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21690 v4.AuxInt = int64(sdivisible(64, c).a) 21691 v1.AddArg(v4) 21692 v0.AddArg(v1) 21693 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21694 v5.AuxInt = int64(64 - sdivisible(64, c).k) 21695 v0.AddArg(v5) 21696 v.AddArg(v0) 21697 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21698 v6.AuxInt = int64(sdivisible(64, c).max) 21699 v.AddArg(v6) 21700 return true 21701 } 21702 // match: (Eq64 (Mul64 (Const64 [c]) (Sub64 (Rsh64x64 (Add64 mul:(Hmul64 (Const64 [m]) x) x) (Const64 [s])) (Rsh64x64 x (Const64 [63])))) x) 21703 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m) && s == smagic(64,c).s && x.Op != OpConst64 && sdivisibleOK(64,c) 21704 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 21705 for { 21706 x := v.Args[1] 21707 v_0 := v.Args[0] 21708 if v_0.Op != OpMul64 { 21709 break 21710 } 21711 _ = v_0.Args[1] 21712 v_0_0 := v_0.Args[0] 21713 if v_0_0.Op != OpConst64 { 21714 break 21715 } 21716 c := v_0_0.AuxInt 21717 v_0_1 := v_0.Args[1] 21718 if v_0_1.Op != OpSub64 { 21719 break 21720 } 21721 _ = v_0_1.Args[1] 21722 v_0_1_0 := v_0_1.Args[0] 21723 if v_0_1_0.Op != OpRsh64x64 { 21724 break 21725 } 21726 _ = v_0_1_0.Args[1] 21727 v_0_1_0_0 := v_0_1_0.Args[0] 21728 if v_0_1_0_0.Op != OpAdd64 { 21729 break 21730 } 21731 _ = v_0_1_0_0.Args[1] 21732 mul := v_0_1_0_0.Args[0] 21733 if mul.Op != OpHmul64 { 21734 break 21735 } 21736 _ = mul.Args[1] 21737 mul_0 := mul.Args[0] 21738 if mul_0.Op != OpConst64 { 21739 break 21740 } 21741 m := mul_0.AuxInt 21742 if x != mul.Args[1] || x != v_0_1_0_0.Args[1] { 21743 break 21744 } 21745 v_0_1_0_1 := v_0_1_0.Args[1] 21746 if v_0_1_0_1.Op != OpConst64 { 21747 break 21748 } 21749 s := v_0_1_0_1.AuxInt 21750 v_0_1_1 := v_0_1.Args[1] 21751 if v_0_1_1.Op != OpRsh64x64 { 21752 break 21753 } 21754 _ = v_0_1_1.Args[1] 21755 if x != v_0_1_1.Args[0] { 21756 break 21757 } 21758 v_0_1_1_1 := v_0_1_1.Args[1] 21759 if v_0_1_1_1.Op != OpConst64 || v_0_1_1_1.AuxInt != 63 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m) && s == smagic(64, c).s && x.Op != OpConst64 && sdivisibleOK(64, c)) { 21760 break 21761 } 21762 v.reset(OpLeq64U) 21763 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 21764 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 21765 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 21766 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21767 v3.AuxInt = int64(sdivisible(64, c).m) 21768 v2.AddArg(v3) 21769 v2.AddArg(x) 21770 v1.AddArg(v2) 21771 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21772 v4.AuxInt = int64(sdivisible(64, c).a) 21773 v1.AddArg(v4) 21774 v0.AddArg(v1) 21775 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21776 v5.AuxInt = int64(64 - sdivisible(64, c).k) 21777 v0.AddArg(v5) 21778 v.AddArg(v0) 21779 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21780 v6.AuxInt = int64(sdivisible(64, c).max) 21781 v.AddArg(v6) 21782 return true 21783 } 21784 // match: (Eq64 (Mul64 (Const64 [c]) (Sub64 (Rsh64x64 (Add64 mul:(Hmul64 x (Const64 [m])) x) (Const64 [s])) (Rsh64x64 x (Const64 [63])))) x) 21785 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m) && s == smagic(64,c).s && x.Op != OpConst64 && sdivisibleOK(64,c) 21786 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 21787 for { 21788 x := v.Args[1] 21789 v_0 := v.Args[0] 21790 if v_0.Op != OpMul64 { 21791 break 21792 } 21793 _ = v_0.Args[1] 21794 v_0_0 := v_0.Args[0] 21795 if v_0_0.Op != OpConst64 { 21796 break 21797 } 21798 c := v_0_0.AuxInt 21799 v_0_1 := v_0.Args[1] 21800 if v_0_1.Op != OpSub64 { 21801 break 21802 } 21803 _ = v_0_1.Args[1] 21804 v_0_1_0 := v_0_1.Args[0] 21805 if v_0_1_0.Op != OpRsh64x64 { 21806 break 21807 } 21808 _ = v_0_1_0.Args[1] 21809 v_0_1_0_0 := v_0_1_0.Args[0] 21810 if v_0_1_0_0.Op != OpAdd64 { 21811 break 21812 } 21813 _ = v_0_1_0_0.Args[1] 21814 mul := v_0_1_0_0.Args[0] 21815 if mul.Op != OpHmul64 { 21816 break 21817 } 21818 _ = mul.Args[1] 21819 if x != mul.Args[0] { 21820 break 21821 } 21822 mul_1 := mul.Args[1] 21823 if mul_1.Op != OpConst64 { 21824 break 21825 } 21826 m := mul_1.AuxInt 21827 if x != v_0_1_0_0.Args[1] { 21828 break 21829 } 21830 v_0_1_0_1 := v_0_1_0.Args[1] 21831 if v_0_1_0_1.Op != OpConst64 { 21832 break 21833 } 21834 s := v_0_1_0_1.AuxInt 21835 v_0_1_1 := v_0_1.Args[1] 21836 if v_0_1_1.Op != OpRsh64x64 { 21837 break 21838 } 21839 _ = v_0_1_1.Args[1] 21840 if x != v_0_1_1.Args[0] { 21841 break 21842 } 21843 v_0_1_1_1 := v_0_1_1.Args[1] 21844 if v_0_1_1_1.Op != OpConst64 || v_0_1_1_1.AuxInt != 63 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m) && s == smagic(64, c).s && x.Op != OpConst64 && sdivisibleOK(64, c)) { 21845 break 21846 } 21847 v.reset(OpLeq64U) 21848 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 21849 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 21850 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 21851 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21852 v3.AuxInt = int64(sdivisible(64, c).m) 21853 v2.AddArg(v3) 21854 v2.AddArg(x) 21855 v1.AddArg(v2) 21856 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21857 v4.AuxInt = int64(sdivisible(64, c).a) 21858 v1.AddArg(v4) 21859 v0.AddArg(v1) 21860 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21861 v5.AuxInt = int64(64 - sdivisible(64, c).k) 21862 v0.AddArg(v5) 21863 v.AddArg(v0) 21864 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21865 v6.AuxInt = int64(sdivisible(64, c).max) 21866 v.AddArg(v6) 21867 return true 21868 } 21869 // match: (Eq64 (Mul64 (Const64 [c]) (Sub64 (Rsh64x64 (Add64 x mul:(Hmul64 (Const64 [m]) x)) (Const64 [s])) (Rsh64x64 x (Const64 [63])))) x) 21870 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m) && s == smagic(64,c).s && x.Op != OpConst64 && sdivisibleOK(64,c) 21871 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 21872 for { 21873 x := v.Args[1] 21874 v_0 := v.Args[0] 21875 if v_0.Op != OpMul64 { 21876 break 21877 } 21878 _ = v_0.Args[1] 21879 v_0_0 := v_0.Args[0] 21880 if v_0_0.Op != OpConst64 { 21881 break 21882 } 21883 c := v_0_0.AuxInt 21884 v_0_1 := v_0.Args[1] 21885 if v_0_1.Op != OpSub64 { 21886 break 21887 } 21888 _ = v_0_1.Args[1] 21889 v_0_1_0 := v_0_1.Args[0] 21890 if v_0_1_0.Op != OpRsh64x64 { 21891 break 21892 } 21893 _ = v_0_1_0.Args[1] 21894 v_0_1_0_0 := v_0_1_0.Args[0] 21895 if v_0_1_0_0.Op != OpAdd64 { 21896 break 21897 } 21898 _ = v_0_1_0_0.Args[1] 21899 if x != v_0_1_0_0.Args[0] { 21900 break 21901 } 21902 mul := v_0_1_0_0.Args[1] 21903 if mul.Op != OpHmul64 { 21904 break 21905 } 21906 _ = mul.Args[1] 21907 mul_0 := mul.Args[0] 21908 if mul_0.Op != OpConst64 { 21909 break 21910 } 21911 m := mul_0.AuxInt 21912 if x != mul.Args[1] { 21913 break 21914 } 21915 v_0_1_0_1 := v_0_1_0.Args[1] 21916 if v_0_1_0_1.Op != OpConst64 { 21917 break 21918 } 21919 s := v_0_1_0_1.AuxInt 21920 v_0_1_1 := v_0_1.Args[1] 21921 if v_0_1_1.Op != OpRsh64x64 { 21922 break 21923 } 21924 _ = v_0_1_1.Args[1] 21925 if x != v_0_1_1.Args[0] { 21926 break 21927 } 21928 v_0_1_1_1 := v_0_1_1.Args[1] 21929 if v_0_1_1_1.Op != OpConst64 || v_0_1_1_1.AuxInt != 63 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m) && s == smagic(64, c).s && x.Op != OpConst64 && sdivisibleOK(64, c)) { 21930 break 21931 } 21932 v.reset(OpLeq64U) 21933 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 21934 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 21935 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 21936 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21937 v3.AuxInt = int64(sdivisible(64, c).m) 21938 v2.AddArg(v3) 21939 v2.AddArg(x) 21940 v1.AddArg(v2) 21941 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21942 v4.AuxInt = int64(sdivisible(64, c).a) 21943 v1.AddArg(v4) 21944 v0.AddArg(v1) 21945 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21946 v5.AuxInt = int64(64 - sdivisible(64, c).k) 21947 v0.AddArg(v5) 21948 v.AddArg(v0) 21949 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 21950 v6.AuxInt = int64(sdivisible(64, c).max) 21951 v.AddArg(v6) 21952 return true 21953 } 21954 return false 21955 } 21956 func rewriteValuegeneric_OpEq64_50(v *Value) bool { 21957 b := v.Block 21958 typ := &b.Func.Config.Types 21959 // match: (Eq64 (Mul64 (Const64 [c]) (Sub64 (Rsh64x64 (Add64 x mul:(Hmul64 x (Const64 [m]))) (Const64 [s])) (Rsh64x64 x (Const64 [63])))) x) 21960 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m) && s == smagic(64,c).s && x.Op != OpConst64 && sdivisibleOK(64,c) 21961 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 21962 for { 21963 x := v.Args[1] 21964 v_0 := v.Args[0] 21965 if v_0.Op != OpMul64 { 21966 break 21967 } 21968 _ = v_0.Args[1] 21969 v_0_0 := v_0.Args[0] 21970 if v_0_0.Op != OpConst64 { 21971 break 21972 } 21973 c := v_0_0.AuxInt 21974 v_0_1 := v_0.Args[1] 21975 if v_0_1.Op != OpSub64 { 21976 break 21977 } 21978 _ = v_0_1.Args[1] 21979 v_0_1_0 := v_0_1.Args[0] 21980 if v_0_1_0.Op != OpRsh64x64 { 21981 break 21982 } 21983 _ = v_0_1_0.Args[1] 21984 v_0_1_0_0 := v_0_1_0.Args[0] 21985 if v_0_1_0_0.Op != OpAdd64 { 21986 break 21987 } 21988 _ = v_0_1_0_0.Args[1] 21989 if x != v_0_1_0_0.Args[0] { 21990 break 21991 } 21992 mul := v_0_1_0_0.Args[1] 21993 if mul.Op != OpHmul64 { 21994 break 21995 } 21996 _ = mul.Args[1] 21997 if x != mul.Args[0] { 21998 break 21999 } 22000 mul_1 := mul.Args[1] 22001 if mul_1.Op != OpConst64 { 22002 break 22003 } 22004 m := mul_1.AuxInt 22005 v_0_1_0_1 := v_0_1_0.Args[1] 22006 if v_0_1_0_1.Op != OpConst64 { 22007 break 22008 } 22009 s := v_0_1_0_1.AuxInt 22010 v_0_1_1 := v_0_1.Args[1] 22011 if v_0_1_1.Op != OpRsh64x64 { 22012 break 22013 } 22014 _ = v_0_1_1.Args[1] 22015 if x != v_0_1_1.Args[0] { 22016 break 22017 } 22018 v_0_1_1_1 := v_0_1_1.Args[1] 22019 if v_0_1_1_1.Op != OpConst64 || v_0_1_1_1.AuxInt != 63 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m) && s == smagic(64, c).s && x.Op != OpConst64 && sdivisibleOK(64, c)) { 22020 break 22021 } 22022 v.reset(OpLeq64U) 22023 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 22024 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 22025 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 22026 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 22027 v3.AuxInt = int64(sdivisible(64, c).m) 22028 v2.AddArg(v3) 22029 v2.AddArg(x) 22030 v1.AddArg(v2) 22031 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 22032 v4.AuxInt = int64(sdivisible(64, c).a) 22033 v1.AddArg(v4) 22034 v0.AddArg(v1) 22035 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 22036 v5.AuxInt = int64(64 - sdivisible(64, c).k) 22037 v0.AddArg(v5) 22038 v.AddArg(v0) 22039 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 22040 v6.AuxInt = int64(sdivisible(64, c).max) 22041 v.AddArg(v6) 22042 return true 22043 } 22044 // match: (Eq64 (Mul64 (Sub64 (Rsh64x64 (Add64 mul:(Hmul64 (Const64 [m]) x) x) (Const64 [s])) (Rsh64x64 x (Const64 [63]))) (Const64 [c])) x) 22045 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m) && s == smagic(64,c).s && x.Op != OpConst64 && sdivisibleOK(64,c) 22046 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 22047 for { 22048 x := v.Args[1] 22049 v_0 := v.Args[0] 22050 if v_0.Op != OpMul64 { 22051 break 22052 } 22053 _ = v_0.Args[1] 22054 v_0_0 := v_0.Args[0] 22055 if v_0_0.Op != OpSub64 { 22056 break 22057 } 22058 _ = v_0_0.Args[1] 22059 v_0_0_0 := v_0_0.Args[0] 22060 if v_0_0_0.Op != OpRsh64x64 { 22061 break 22062 } 22063 _ = v_0_0_0.Args[1] 22064 v_0_0_0_0 := v_0_0_0.Args[0] 22065 if v_0_0_0_0.Op != OpAdd64 { 22066 break 22067 } 22068 _ = v_0_0_0_0.Args[1] 22069 mul := v_0_0_0_0.Args[0] 22070 if mul.Op != OpHmul64 { 22071 break 22072 } 22073 _ = mul.Args[1] 22074 mul_0 := mul.Args[0] 22075 if mul_0.Op != OpConst64 { 22076 break 22077 } 22078 m := mul_0.AuxInt 22079 if x != mul.Args[1] || x != v_0_0_0_0.Args[1] { 22080 break 22081 } 22082 v_0_0_0_1 := v_0_0_0.Args[1] 22083 if v_0_0_0_1.Op != OpConst64 { 22084 break 22085 } 22086 s := v_0_0_0_1.AuxInt 22087 v_0_0_1 := v_0_0.Args[1] 22088 if v_0_0_1.Op != OpRsh64x64 { 22089 break 22090 } 22091 _ = v_0_0_1.Args[1] 22092 if x != v_0_0_1.Args[0] { 22093 break 22094 } 22095 v_0_0_1_1 := v_0_0_1.Args[1] 22096 if v_0_0_1_1.Op != OpConst64 || v_0_0_1_1.AuxInt != 63 { 22097 break 22098 } 22099 v_0_1 := v_0.Args[1] 22100 if v_0_1.Op != OpConst64 { 22101 break 22102 } 22103 c := v_0_1.AuxInt 22104 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m) && s == smagic(64, c).s && x.Op != OpConst64 && sdivisibleOK(64, c)) { 22105 break 22106 } 22107 v.reset(OpLeq64U) 22108 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 22109 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 22110 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 22111 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 22112 v3.AuxInt = int64(sdivisible(64, c).m) 22113 v2.AddArg(v3) 22114 v2.AddArg(x) 22115 v1.AddArg(v2) 22116 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 22117 v4.AuxInt = int64(sdivisible(64, c).a) 22118 v1.AddArg(v4) 22119 v0.AddArg(v1) 22120 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 22121 v5.AuxInt = int64(64 - sdivisible(64, c).k) 22122 v0.AddArg(v5) 22123 v.AddArg(v0) 22124 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 22125 v6.AuxInt = int64(sdivisible(64, c).max) 22126 v.AddArg(v6) 22127 return true 22128 } 22129 // match: (Eq64 (Mul64 (Sub64 (Rsh64x64 (Add64 mul:(Hmul64 x (Const64 [m])) x) (Const64 [s])) (Rsh64x64 x (Const64 [63]))) (Const64 [c])) x) 22130 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m) && s == smagic(64,c).s && x.Op != OpConst64 && sdivisibleOK(64,c) 22131 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 22132 for { 22133 x := v.Args[1] 22134 v_0 := v.Args[0] 22135 if v_0.Op != OpMul64 { 22136 break 22137 } 22138 _ = v_0.Args[1] 22139 v_0_0 := v_0.Args[0] 22140 if v_0_0.Op != OpSub64 { 22141 break 22142 } 22143 _ = v_0_0.Args[1] 22144 v_0_0_0 := v_0_0.Args[0] 22145 if v_0_0_0.Op != OpRsh64x64 { 22146 break 22147 } 22148 _ = v_0_0_0.Args[1] 22149 v_0_0_0_0 := v_0_0_0.Args[0] 22150 if v_0_0_0_0.Op != OpAdd64 { 22151 break 22152 } 22153 _ = v_0_0_0_0.Args[1] 22154 mul := v_0_0_0_0.Args[0] 22155 if mul.Op != OpHmul64 { 22156 break 22157 } 22158 _ = mul.Args[1] 22159 if x != mul.Args[0] { 22160 break 22161 } 22162 mul_1 := mul.Args[1] 22163 if mul_1.Op != OpConst64 { 22164 break 22165 } 22166 m := mul_1.AuxInt 22167 if x != v_0_0_0_0.Args[1] { 22168 break 22169 } 22170 v_0_0_0_1 := v_0_0_0.Args[1] 22171 if v_0_0_0_1.Op != OpConst64 { 22172 break 22173 } 22174 s := v_0_0_0_1.AuxInt 22175 v_0_0_1 := v_0_0.Args[1] 22176 if v_0_0_1.Op != OpRsh64x64 { 22177 break 22178 } 22179 _ = v_0_0_1.Args[1] 22180 if x != v_0_0_1.Args[0] { 22181 break 22182 } 22183 v_0_0_1_1 := v_0_0_1.Args[1] 22184 if v_0_0_1_1.Op != OpConst64 || v_0_0_1_1.AuxInt != 63 { 22185 break 22186 } 22187 v_0_1 := v_0.Args[1] 22188 if v_0_1.Op != OpConst64 { 22189 break 22190 } 22191 c := v_0_1.AuxInt 22192 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m) && s == smagic(64, c).s && x.Op != OpConst64 && sdivisibleOK(64, c)) { 22193 break 22194 } 22195 v.reset(OpLeq64U) 22196 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 22197 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 22198 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 22199 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 22200 v3.AuxInt = int64(sdivisible(64, c).m) 22201 v2.AddArg(v3) 22202 v2.AddArg(x) 22203 v1.AddArg(v2) 22204 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 22205 v4.AuxInt = int64(sdivisible(64, c).a) 22206 v1.AddArg(v4) 22207 v0.AddArg(v1) 22208 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 22209 v5.AuxInt = int64(64 - sdivisible(64, c).k) 22210 v0.AddArg(v5) 22211 v.AddArg(v0) 22212 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 22213 v6.AuxInt = int64(sdivisible(64, c).max) 22214 v.AddArg(v6) 22215 return true 22216 } 22217 // match: (Eq64 (Mul64 (Sub64 (Rsh64x64 (Add64 x mul:(Hmul64 (Const64 [m]) x)) (Const64 [s])) (Rsh64x64 x (Const64 [63]))) (Const64 [c])) x) 22218 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m) && s == smagic(64,c).s && x.Op != OpConst64 && sdivisibleOK(64,c) 22219 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 22220 for { 22221 x := v.Args[1] 22222 v_0 := v.Args[0] 22223 if v_0.Op != OpMul64 { 22224 break 22225 } 22226 _ = v_0.Args[1] 22227 v_0_0 := v_0.Args[0] 22228 if v_0_0.Op != OpSub64 { 22229 break 22230 } 22231 _ = v_0_0.Args[1] 22232 v_0_0_0 := v_0_0.Args[0] 22233 if v_0_0_0.Op != OpRsh64x64 { 22234 break 22235 } 22236 _ = v_0_0_0.Args[1] 22237 v_0_0_0_0 := v_0_0_0.Args[0] 22238 if v_0_0_0_0.Op != OpAdd64 { 22239 break 22240 } 22241 _ = v_0_0_0_0.Args[1] 22242 if x != v_0_0_0_0.Args[0] { 22243 break 22244 } 22245 mul := v_0_0_0_0.Args[1] 22246 if mul.Op != OpHmul64 { 22247 break 22248 } 22249 _ = mul.Args[1] 22250 mul_0 := mul.Args[0] 22251 if mul_0.Op != OpConst64 { 22252 break 22253 } 22254 m := mul_0.AuxInt 22255 if x != mul.Args[1] { 22256 break 22257 } 22258 v_0_0_0_1 := v_0_0_0.Args[1] 22259 if v_0_0_0_1.Op != OpConst64 { 22260 break 22261 } 22262 s := v_0_0_0_1.AuxInt 22263 v_0_0_1 := v_0_0.Args[1] 22264 if v_0_0_1.Op != OpRsh64x64 { 22265 break 22266 } 22267 _ = v_0_0_1.Args[1] 22268 if x != v_0_0_1.Args[0] { 22269 break 22270 } 22271 v_0_0_1_1 := v_0_0_1.Args[1] 22272 if v_0_0_1_1.Op != OpConst64 || v_0_0_1_1.AuxInt != 63 { 22273 break 22274 } 22275 v_0_1 := v_0.Args[1] 22276 if v_0_1.Op != OpConst64 { 22277 break 22278 } 22279 c := v_0_1.AuxInt 22280 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m) && s == smagic(64, c).s && x.Op != OpConst64 && sdivisibleOK(64, c)) { 22281 break 22282 } 22283 v.reset(OpLeq64U) 22284 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 22285 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 22286 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 22287 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 22288 v3.AuxInt = int64(sdivisible(64, c).m) 22289 v2.AddArg(v3) 22290 v2.AddArg(x) 22291 v1.AddArg(v2) 22292 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 22293 v4.AuxInt = int64(sdivisible(64, c).a) 22294 v1.AddArg(v4) 22295 v0.AddArg(v1) 22296 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 22297 v5.AuxInt = int64(64 - sdivisible(64, c).k) 22298 v0.AddArg(v5) 22299 v.AddArg(v0) 22300 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 22301 v6.AuxInt = int64(sdivisible(64, c).max) 22302 v.AddArg(v6) 22303 return true 22304 } 22305 // match: (Eq64 (Mul64 (Sub64 (Rsh64x64 (Add64 x mul:(Hmul64 x (Const64 [m]))) (Const64 [s])) (Rsh64x64 x (Const64 [63]))) (Const64 [c])) x) 22306 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64,c).m) && s == smagic(64,c).s && x.Op != OpConst64 && sdivisibleOK(64,c) 22307 // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible(64,c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible(64,c).a)]) ) (Const64 <typ.UInt64> [int64(64-sdivisible(64,c).k)]) ) (Const64 <typ.UInt64> [int64(sdivisible(64,c).max)]) ) 22308 for { 22309 x := v.Args[1] 22310 v_0 := v.Args[0] 22311 if v_0.Op != OpMul64 { 22312 break 22313 } 22314 _ = v_0.Args[1] 22315 v_0_0 := v_0.Args[0] 22316 if v_0_0.Op != OpSub64 { 22317 break 22318 } 22319 _ = v_0_0.Args[1] 22320 v_0_0_0 := v_0_0.Args[0] 22321 if v_0_0_0.Op != OpRsh64x64 { 22322 break 22323 } 22324 _ = v_0_0_0.Args[1] 22325 v_0_0_0_0 := v_0_0_0.Args[0] 22326 if v_0_0_0_0.Op != OpAdd64 { 22327 break 22328 } 22329 _ = v_0_0_0_0.Args[1] 22330 if x != v_0_0_0_0.Args[0] { 22331 break 22332 } 22333 mul := v_0_0_0_0.Args[1] 22334 if mul.Op != OpHmul64 { 22335 break 22336 } 22337 _ = mul.Args[1] 22338 if x != mul.Args[0] { 22339 break 22340 } 22341 mul_1 := mul.Args[1] 22342 if mul_1.Op != OpConst64 { 22343 break 22344 } 22345 m := mul_1.AuxInt 22346 v_0_0_0_1 := v_0_0_0.Args[1] 22347 if v_0_0_0_1.Op != OpConst64 { 22348 break 22349 } 22350 s := v_0_0_0_1.AuxInt 22351 v_0_0_1 := v_0_0.Args[1] 22352 if v_0_0_1.Op != OpRsh64x64 { 22353 break 22354 } 22355 _ = v_0_0_1.Args[1] 22356 if x != v_0_0_1.Args[0] { 22357 break 22358 } 22359 v_0_0_1_1 := v_0_0_1.Args[1] 22360 if v_0_0_1_1.Op != OpConst64 || v_0_0_1_1.AuxInt != 63 { 22361 break 22362 } 22363 v_0_1 := v_0.Args[1] 22364 if v_0_1.Op != OpConst64 { 22365 break 22366 } 22367 c := v_0_1.AuxInt 22368 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(64, c).m) && s == smagic(64, c).s && x.Op != OpConst64 && sdivisibleOK(64, c)) { 22369 break 22370 } 22371 v.reset(OpLeq64U) 22372 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64) 22373 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64) 22374 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64) 22375 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 22376 v3.AuxInt = int64(sdivisible(64, c).m) 22377 v2.AddArg(v3) 22378 v2.AddArg(x) 22379 v1.AddArg(v2) 22380 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 22381 v4.AuxInt = int64(sdivisible(64, c).a) 22382 v1.AddArg(v4) 22383 v0.AddArg(v1) 22384 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 22385 v5.AuxInt = int64(64 - sdivisible(64, c).k) 22386 v0.AddArg(v5) 22387 v.AddArg(v0) 22388 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 22389 v6.AuxInt = int64(sdivisible(64, c).max) 22390 v.AddArg(v6) 22391 return true 22392 } 22393 // match: (Eq64 n (Lsh64x64 (Rsh64x64 (Add64 <t> n (Rsh64Ux64 <t> (Rsh64x64 <t> n (Const64 <typ.UInt64> [63])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k]))) 22394 // cond: k > 0 && k < 63 && kbar == 64 - k 22395 // result: (Eq64 (And64 <t> n (Const64 <t> [int64(1<<uint(k)-1)])) (Const64 <t> [0])) 22396 for { 22397 _ = v.Args[1] 22398 n := v.Args[0] 22399 v_1 := v.Args[1] 22400 if v_1.Op != OpLsh64x64 { 22401 break 22402 } 22403 _ = v_1.Args[1] 22404 v_1_0 := v_1.Args[0] 22405 if v_1_0.Op != OpRsh64x64 { 22406 break 22407 } 22408 _ = v_1_0.Args[1] 22409 v_1_0_0 := v_1_0.Args[0] 22410 if v_1_0_0.Op != OpAdd64 { 22411 break 22412 } 22413 t := v_1_0_0.Type 22414 _ = v_1_0_0.Args[1] 22415 if n != v_1_0_0.Args[0] { 22416 break 22417 } 22418 v_1_0_0_1 := v_1_0_0.Args[1] 22419 if v_1_0_0_1.Op != OpRsh64Ux64 || v_1_0_0_1.Type != t { 22420 break 22421 } 22422 _ = v_1_0_0_1.Args[1] 22423 v_1_0_0_1_0 := v_1_0_0_1.Args[0] 22424 if v_1_0_0_1_0.Op != OpRsh64x64 || v_1_0_0_1_0.Type != t { 22425 break 22426 } 22427 _ = v_1_0_0_1_0.Args[1] 22428 if n != v_1_0_0_1_0.Args[0] { 22429 break 22430 } 22431 v_1_0_0_1_0_1 := v_1_0_0_1_0.Args[1] 22432 if v_1_0_0_1_0_1.Op != OpConst64 || v_1_0_0_1_0_1.Type != typ.UInt64 || v_1_0_0_1_0_1.AuxInt != 63 { 22433 break 22434 } 22435 v_1_0_0_1_1 := v_1_0_0_1.Args[1] 22436 if v_1_0_0_1_1.Op != OpConst64 || v_1_0_0_1_1.Type != typ.UInt64 { 22437 break 22438 } 22439 kbar := v_1_0_0_1_1.AuxInt 22440 v_1_0_1 := v_1_0.Args[1] 22441 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 { 22442 break 22443 } 22444 k := v_1_0_1.AuxInt 22445 v_1_1 := v_1.Args[1] 22446 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || v_1_1.AuxInt != k || !(k > 0 && k < 63 && kbar == 64-k) { 22447 break 22448 } 22449 v.reset(OpEq64) 22450 v0 := b.NewValue0(v.Pos, OpAnd64, t) 22451 v0.AddArg(n) 22452 v1 := b.NewValue0(v.Pos, OpConst64, t) 22453 v1.AuxInt = int64(1<<uint(k) - 1) 22454 v0.AddArg(v1) 22455 v.AddArg(v0) 22456 v2 := b.NewValue0(v.Pos, OpConst64, t) 22457 v2.AuxInt = 0 22458 v.AddArg(v2) 22459 return true 22460 } 22461 // match: (Eq64 n (Lsh64x64 (Rsh64x64 (Add64 <t> (Rsh64Ux64 <t> (Rsh64x64 <t> n (Const64 <typ.UInt64> [63])) (Const64 <typ.UInt64> [kbar])) n) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k]))) 22462 // cond: k > 0 && k < 63 && kbar == 64 - k 22463 // result: (Eq64 (And64 <t> n (Const64 <t> [int64(1<<uint(k)-1)])) (Const64 <t> [0])) 22464 for { 22465 _ = v.Args[1] 22466 n := v.Args[0] 22467 v_1 := v.Args[1] 22468 if v_1.Op != OpLsh64x64 { 22469 break 22470 } 22471 _ = v_1.Args[1] 22472 v_1_0 := v_1.Args[0] 22473 if v_1_0.Op != OpRsh64x64 { 22474 break 22475 } 22476 _ = v_1_0.Args[1] 22477 v_1_0_0 := v_1_0.Args[0] 22478 if v_1_0_0.Op != OpAdd64 { 22479 break 22480 } 22481 t := v_1_0_0.Type 22482 _ = v_1_0_0.Args[1] 22483 v_1_0_0_0 := v_1_0_0.Args[0] 22484 if v_1_0_0_0.Op != OpRsh64Ux64 || v_1_0_0_0.Type != t { 22485 break 22486 } 22487 _ = v_1_0_0_0.Args[1] 22488 v_1_0_0_0_0 := v_1_0_0_0.Args[0] 22489 if v_1_0_0_0_0.Op != OpRsh64x64 || v_1_0_0_0_0.Type != t { 22490 break 22491 } 22492 _ = v_1_0_0_0_0.Args[1] 22493 if n != v_1_0_0_0_0.Args[0] { 22494 break 22495 } 22496 v_1_0_0_0_0_1 := v_1_0_0_0_0.Args[1] 22497 if v_1_0_0_0_0_1.Op != OpConst64 || v_1_0_0_0_0_1.Type != typ.UInt64 || v_1_0_0_0_0_1.AuxInt != 63 { 22498 break 22499 } 22500 v_1_0_0_0_1 := v_1_0_0_0.Args[1] 22501 if v_1_0_0_0_1.Op != OpConst64 || v_1_0_0_0_1.Type != typ.UInt64 { 22502 break 22503 } 22504 kbar := v_1_0_0_0_1.AuxInt 22505 if n != v_1_0_0.Args[1] { 22506 break 22507 } 22508 v_1_0_1 := v_1_0.Args[1] 22509 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 { 22510 break 22511 } 22512 k := v_1_0_1.AuxInt 22513 v_1_1 := v_1.Args[1] 22514 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || v_1_1.AuxInt != k || !(k > 0 && k < 63 && kbar == 64-k) { 22515 break 22516 } 22517 v.reset(OpEq64) 22518 v0 := b.NewValue0(v.Pos, OpAnd64, t) 22519 v0.AddArg(n) 22520 v1 := b.NewValue0(v.Pos, OpConst64, t) 22521 v1.AuxInt = int64(1<<uint(k) - 1) 22522 v0.AddArg(v1) 22523 v.AddArg(v0) 22524 v2 := b.NewValue0(v.Pos, OpConst64, t) 22525 v2.AuxInt = 0 22526 v.AddArg(v2) 22527 return true 22528 } 22529 // match: (Eq64 (Lsh64x64 (Rsh64x64 (Add64 <t> n (Rsh64Ux64 <t> (Rsh64x64 <t> n (Const64 <typ.UInt64> [63])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) n) 22530 // cond: k > 0 && k < 63 && kbar == 64 - k 22531 // result: (Eq64 (And64 <t> n (Const64 <t> [int64(1<<uint(k)-1)])) (Const64 <t> [0])) 22532 for { 22533 n := v.Args[1] 22534 v_0 := v.Args[0] 22535 if v_0.Op != OpLsh64x64 { 22536 break 22537 } 22538 _ = v_0.Args[1] 22539 v_0_0 := v_0.Args[0] 22540 if v_0_0.Op != OpRsh64x64 { 22541 break 22542 } 22543 _ = v_0_0.Args[1] 22544 v_0_0_0 := v_0_0.Args[0] 22545 if v_0_0_0.Op != OpAdd64 { 22546 break 22547 } 22548 t := v_0_0_0.Type 22549 _ = v_0_0_0.Args[1] 22550 if n != v_0_0_0.Args[0] { 22551 break 22552 } 22553 v_0_0_0_1 := v_0_0_0.Args[1] 22554 if v_0_0_0_1.Op != OpRsh64Ux64 || v_0_0_0_1.Type != t { 22555 break 22556 } 22557 _ = v_0_0_0_1.Args[1] 22558 v_0_0_0_1_0 := v_0_0_0_1.Args[0] 22559 if v_0_0_0_1_0.Op != OpRsh64x64 || v_0_0_0_1_0.Type != t { 22560 break 22561 } 22562 _ = v_0_0_0_1_0.Args[1] 22563 if n != v_0_0_0_1_0.Args[0] { 22564 break 22565 } 22566 v_0_0_0_1_0_1 := v_0_0_0_1_0.Args[1] 22567 if v_0_0_0_1_0_1.Op != OpConst64 || v_0_0_0_1_0_1.Type != typ.UInt64 || v_0_0_0_1_0_1.AuxInt != 63 { 22568 break 22569 } 22570 v_0_0_0_1_1 := v_0_0_0_1.Args[1] 22571 if v_0_0_0_1_1.Op != OpConst64 || v_0_0_0_1_1.Type != typ.UInt64 { 22572 break 22573 } 22574 kbar := v_0_0_0_1_1.AuxInt 22575 v_0_0_1 := v_0_0.Args[1] 22576 if v_0_0_1.Op != OpConst64 || v_0_0_1.Type != typ.UInt64 { 22577 break 22578 } 22579 k := v_0_0_1.AuxInt 22580 v_0_1 := v_0.Args[1] 22581 if v_0_1.Op != OpConst64 || v_0_1.Type != typ.UInt64 || v_0_1.AuxInt != k || !(k > 0 && k < 63 && kbar == 64-k) { 22582 break 22583 } 22584 v.reset(OpEq64) 22585 v0 := b.NewValue0(v.Pos, OpAnd64, t) 22586 v0.AddArg(n) 22587 v1 := b.NewValue0(v.Pos, OpConst64, t) 22588 v1.AuxInt = int64(1<<uint(k) - 1) 22589 v0.AddArg(v1) 22590 v.AddArg(v0) 22591 v2 := b.NewValue0(v.Pos, OpConst64, t) 22592 v2.AuxInt = 0 22593 v.AddArg(v2) 22594 return true 22595 } 22596 // match: (Eq64 (Lsh64x64 (Rsh64x64 (Add64 <t> (Rsh64Ux64 <t> (Rsh64x64 <t> n (Const64 <typ.UInt64> [63])) (Const64 <typ.UInt64> [kbar])) n) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) n) 22597 // cond: k > 0 && k < 63 && kbar == 64 - k 22598 // result: (Eq64 (And64 <t> n (Const64 <t> [int64(1<<uint(k)-1)])) (Const64 <t> [0])) 22599 for { 22600 n := v.Args[1] 22601 v_0 := v.Args[0] 22602 if v_0.Op != OpLsh64x64 { 22603 break 22604 } 22605 _ = v_0.Args[1] 22606 v_0_0 := v_0.Args[0] 22607 if v_0_0.Op != OpRsh64x64 { 22608 break 22609 } 22610 _ = v_0_0.Args[1] 22611 v_0_0_0 := v_0_0.Args[0] 22612 if v_0_0_0.Op != OpAdd64 { 22613 break 22614 } 22615 t := v_0_0_0.Type 22616 _ = v_0_0_0.Args[1] 22617 v_0_0_0_0 := v_0_0_0.Args[0] 22618 if v_0_0_0_0.Op != OpRsh64Ux64 || v_0_0_0_0.Type != t { 22619 break 22620 } 22621 _ = v_0_0_0_0.Args[1] 22622 v_0_0_0_0_0 := v_0_0_0_0.Args[0] 22623 if v_0_0_0_0_0.Op != OpRsh64x64 || v_0_0_0_0_0.Type != t { 22624 break 22625 } 22626 _ = v_0_0_0_0_0.Args[1] 22627 if n != v_0_0_0_0_0.Args[0] { 22628 break 22629 } 22630 v_0_0_0_0_0_1 := v_0_0_0_0_0.Args[1] 22631 if v_0_0_0_0_0_1.Op != OpConst64 || v_0_0_0_0_0_1.Type != typ.UInt64 || v_0_0_0_0_0_1.AuxInt != 63 { 22632 break 22633 } 22634 v_0_0_0_0_1 := v_0_0_0_0.Args[1] 22635 if v_0_0_0_0_1.Op != OpConst64 || v_0_0_0_0_1.Type != typ.UInt64 { 22636 break 22637 } 22638 kbar := v_0_0_0_0_1.AuxInt 22639 if n != v_0_0_0.Args[1] { 22640 break 22641 } 22642 v_0_0_1 := v_0_0.Args[1] 22643 if v_0_0_1.Op != OpConst64 || v_0_0_1.Type != typ.UInt64 { 22644 break 22645 } 22646 k := v_0_0_1.AuxInt 22647 v_0_1 := v_0.Args[1] 22648 if v_0_1.Op != OpConst64 || v_0_1.Type != typ.UInt64 || v_0_1.AuxInt != k || !(k > 0 && k < 63 && kbar == 64-k) { 22649 break 22650 } 22651 v.reset(OpEq64) 22652 v0 := b.NewValue0(v.Pos, OpAnd64, t) 22653 v0.AddArg(n) 22654 v1 := b.NewValue0(v.Pos, OpConst64, t) 22655 v1.AuxInt = int64(1<<uint(k) - 1) 22656 v0.AddArg(v1) 22657 v.AddArg(v0) 22658 v2 := b.NewValue0(v.Pos, OpConst64, t) 22659 v2.AuxInt = 0 22660 v.AddArg(v2) 22661 return true 22662 } 22663 // match: (Eq64 s:(Sub64 x y) (Const64 [0])) 22664 // cond: s.Uses == 1 22665 // result: (Eq64 x y) 22666 for { 22667 _ = v.Args[1] 22668 s := v.Args[0] 22669 if s.Op != OpSub64 { 22670 break 22671 } 22672 y := s.Args[1] 22673 x := s.Args[0] 22674 v_1 := v.Args[1] 22675 if v_1.Op != OpConst64 || v_1.AuxInt != 0 || !(s.Uses == 1) { 22676 break 22677 } 22678 v.reset(OpEq64) 22679 v.AddArg(x) 22680 v.AddArg(y) 22681 return true 22682 } 22683 return false 22684 } 22685 func rewriteValuegeneric_OpEq64_60(v *Value) bool { 22686 b := v.Block 22687 // match: (Eq64 (Const64 [0]) s:(Sub64 x y)) 22688 // cond: s.Uses == 1 22689 // result: (Eq64 x y) 22690 for { 22691 _ = v.Args[1] 22692 v_0 := v.Args[0] 22693 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 22694 break 22695 } 22696 s := v.Args[1] 22697 if s.Op != OpSub64 { 22698 break 22699 } 22700 y := s.Args[1] 22701 x := s.Args[0] 22702 if !(s.Uses == 1) { 22703 break 22704 } 22705 v.reset(OpEq64) 22706 v.AddArg(x) 22707 v.AddArg(y) 22708 return true 22709 } 22710 // match: (Eq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [y])) 22711 // cond: isPowerOfTwo(y) 22712 // result: (Neq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [0])) 22713 for { 22714 _ = v.Args[1] 22715 v_0 := v.Args[0] 22716 if v_0.Op != OpAnd64 { 22717 break 22718 } 22719 t := v_0.Type 22720 _ = v_0.Args[1] 22721 x := v_0.Args[0] 22722 v_0_1 := v_0.Args[1] 22723 if v_0_1.Op != OpConst64 || v_0_1.Type != t { 22724 break 22725 } 22726 y := v_0_1.AuxInt 22727 v_1 := v.Args[1] 22728 if v_1.Op != OpConst64 || v_1.Type != t || v_1.AuxInt != y || !(isPowerOfTwo(y)) { 22729 break 22730 } 22731 v.reset(OpNeq64) 22732 v0 := b.NewValue0(v.Pos, OpAnd64, t) 22733 v0.AddArg(x) 22734 v1 := b.NewValue0(v.Pos, OpConst64, t) 22735 v1.AuxInt = y 22736 v0.AddArg(v1) 22737 v.AddArg(v0) 22738 v2 := b.NewValue0(v.Pos, OpConst64, t) 22739 v2.AuxInt = 0 22740 v.AddArg(v2) 22741 return true 22742 } 22743 // match: (Eq64 (And64 <t> (Const64 <t> [y]) x) (Const64 <t> [y])) 22744 // cond: isPowerOfTwo(y) 22745 // result: (Neq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [0])) 22746 for { 22747 _ = v.Args[1] 22748 v_0 := v.Args[0] 22749 if v_0.Op != OpAnd64 { 22750 break 22751 } 22752 t := v_0.Type 22753 x := v_0.Args[1] 22754 v_0_0 := v_0.Args[0] 22755 if v_0_0.Op != OpConst64 || v_0_0.Type != t { 22756 break 22757 } 22758 y := v_0_0.AuxInt 22759 v_1 := v.Args[1] 22760 if v_1.Op != OpConst64 || v_1.Type != t || v_1.AuxInt != y || !(isPowerOfTwo(y)) { 22761 break 22762 } 22763 v.reset(OpNeq64) 22764 v0 := b.NewValue0(v.Pos, OpAnd64, t) 22765 v0.AddArg(x) 22766 v1 := b.NewValue0(v.Pos, OpConst64, t) 22767 v1.AuxInt = y 22768 v0.AddArg(v1) 22769 v.AddArg(v0) 22770 v2 := b.NewValue0(v.Pos, OpConst64, t) 22771 v2.AuxInt = 0 22772 v.AddArg(v2) 22773 return true 22774 } 22775 // match: (Eq64 (Const64 <t> [y]) (And64 <t> x (Const64 <t> [y]))) 22776 // cond: isPowerOfTwo(y) 22777 // result: (Neq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [0])) 22778 for { 22779 _ = v.Args[1] 22780 v_0 := v.Args[0] 22781 if v_0.Op != OpConst64 { 22782 break 22783 } 22784 t := v_0.Type 22785 y := v_0.AuxInt 22786 v_1 := v.Args[1] 22787 if v_1.Op != OpAnd64 || v_1.Type != t { 22788 break 22789 } 22790 _ = v_1.Args[1] 22791 x := v_1.Args[0] 22792 v_1_1 := v_1.Args[1] 22793 if v_1_1.Op != OpConst64 || v_1_1.Type != t || v_1_1.AuxInt != y || !(isPowerOfTwo(y)) { 22794 break 22795 } 22796 v.reset(OpNeq64) 22797 v0 := b.NewValue0(v.Pos, OpAnd64, t) 22798 v0.AddArg(x) 22799 v1 := b.NewValue0(v.Pos, OpConst64, t) 22800 v1.AuxInt = y 22801 v0.AddArg(v1) 22802 v.AddArg(v0) 22803 v2 := b.NewValue0(v.Pos, OpConst64, t) 22804 v2.AuxInt = 0 22805 v.AddArg(v2) 22806 return true 22807 } 22808 // match: (Eq64 (Const64 <t> [y]) (And64 <t> (Const64 <t> [y]) x)) 22809 // cond: isPowerOfTwo(y) 22810 // result: (Neq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [0])) 22811 for { 22812 _ = v.Args[1] 22813 v_0 := v.Args[0] 22814 if v_0.Op != OpConst64 { 22815 break 22816 } 22817 t := v_0.Type 22818 y := v_0.AuxInt 22819 v_1 := v.Args[1] 22820 if v_1.Op != OpAnd64 || v_1.Type != t { 22821 break 22822 } 22823 x := v_1.Args[1] 22824 v_1_0 := v_1.Args[0] 22825 if v_1_0.Op != OpConst64 || v_1_0.Type != t || v_1_0.AuxInt != y || !(isPowerOfTwo(y)) { 22826 break 22827 } 22828 v.reset(OpNeq64) 22829 v0 := b.NewValue0(v.Pos, OpAnd64, t) 22830 v0.AddArg(x) 22831 v1 := b.NewValue0(v.Pos, OpConst64, t) 22832 v1.AuxInt = y 22833 v0.AddArg(v1) 22834 v.AddArg(v0) 22835 v2 := b.NewValue0(v.Pos, OpConst64, t) 22836 v2.AuxInt = 0 22837 v.AddArg(v2) 22838 return true 22839 } 22840 return false 22841 } 22842 func rewriteValuegeneric_OpEq64F_0(v *Value) bool { 22843 // match: (Eq64F (Const64F [c]) (Const64F [d])) 22844 // result: (ConstBool [b2i(auxTo64F(c) == auxTo64F(d))]) 22845 for { 22846 _ = v.Args[1] 22847 v_0 := v.Args[0] 22848 if v_0.Op != OpConst64F { 22849 break 22850 } 22851 c := v_0.AuxInt 22852 v_1 := v.Args[1] 22853 if v_1.Op != OpConst64F { 22854 break 22855 } 22856 d := v_1.AuxInt 22857 v.reset(OpConstBool) 22858 v.AuxInt = b2i(auxTo64F(c) == auxTo64F(d)) 22859 return true 22860 } 22861 // match: (Eq64F (Const64F [d]) (Const64F [c])) 22862 // result: (ConstBool [b2i(auxTo64F(c) == auxTo64F(d))]) 22863 for { 22864 _ = v.Args[1] 22865 v_0 := v.Args[0] 22866 if v_0.Op != OpConst64F { 22867 break 22868 } 22869 d := v_0.AuxInt 22870 v_1 := v.Args[1] 22871 if v_1.Op != OpConst64F { 22872 break 22873 } 22874 c := v_1.AuxInt 22875 v.reset(OpConstBool) 22876 v.AuxInt = b2i(auxTo64F(c) == auxTo64F(d)) 22877 return true 22878 } 22879 return false 22880 } 22881 func rewriteValuegeneric_OpEq8_0(v *Value) bool { 22882 b := v.Block 22883 config := b.Func.Config 22884 typ := &b.Func.Config.Types 22885 // match: (Eq8 x x) 22886 // result: (ConstBool [1]) 22887 for { 22888 x := v.Args[1] 22889 if x != v.Args[0] { 22890 break 22891 } 22892 v.reset(OpConstBool) 22893 v.AuxInt = 1 22894 return true 22895 } 22896 // match: (Eq8 (Const8 <t> [c]) (Add8 (Const8 <t> [d]) x)) 22897 // result: (Eq8 (Const8 <t> [int64(int8(c-d))]) x) 22898 for { 22899 _ = v.Args[1] 22900 v_0 := v.Args[0] 22901 if v_0.Op != OpConst8 { 22902 break 22903 } 22904 t := v_0.Type 22905 c := v_0.AuxInt 22906 v_1 := v.Args[1] 22907 if v_1.Op != OpAdd8 { 22908 break 22909 } 22910 x := v_1.Args[1] 22911 v_1_0 := v_1.Args[0] 22912 if v_1_0.Op != OpConst8 || v_1_0.Type != t { 22913 break 22914 } 22915 d := v_1_0.AuxInt 22916 v.reset(OpEq8) 22917 v0 := b.NewValue0(v.Pos, OpConst8, t) 22918 v0.AuxInt = int64(int8(c - d)) 22919 v.AddArg(v0) 22920 v.AddArg(x) 22921 return true 22922 } 22923 // match: (Eq8 (Const8 <t> [c]) (Add8 x (Const8 <t> [d]))) 22924 // result: (Eq8 (Const8 <t> [int64(int8(c-d))]) x) 22925 for { 22926 _ = v.Args[1] 22927 v_0 := v.Args[0] 22928 if v_0.Op != OpConst8 { 22929 break 22930 } 22931 t := v_0.Type 22932 c := v_0.AuxInt 22933 v_1 := v.Args[1] 22934 if v_1.Op != OpAdd8 { 22935 break 22936 } 22937 _ = v_1.Args[1] 22938 x := v_1.Args[0] 22939 v_1_1 := v_1.Args[1] 22940 if v_1_1.Op != OpConst8 || v_1_1.Type != t { 22941 break 22942 } 22943 d := v_1_1.AuxInt 22944 v.reset(OpEq8) 22945 v0 := b.NewValue0(v.Pos, OpConst8, t) 22946 v0.AuxInt = int64(int8(c - d)) 22947 v.AddArg(v0) 22948 v.AddArg(x) 22949 return true 22950 } 22951 // match: (Eq8 (Add8 (Const8 <t> [d]) x) (Const8 <t> [c])) 22952 // result: (Eq8 (Const8 <t> [int64(int8(c-d))]) x) 22953 for { 22954 _ = v.Args[1] 22955 v_0 := v.Args[0] 22956 if v_0.Op != OpAdd8 { 22957 break 22958 } 22959 x := v_0.Args[1] 22960 v_0_0 := v_0.Args[0] 22961 if v_0_0.Op != OpConst8 { 22962 break 22963 } 22964 t := v_0_0.Type 22965 d := v_0_0.AuxInt 22966 v_1 := v.Args[1] 22967 if v_1.Op != OpConst8 || v_1.Type != t { 22968 break 22969 } 22970 c := v_1.AuxInt 22971 v.reset(OpEq8) 22972 v0 := b.NewValue0(v.Pos, OpConst8, t) 22973 v0.AuxInt = int64(int8(c - d)) 22974 v.AddArg(v0) 22975 v.AddArg(x) 22976 return true 22977 } 22978 // match: (Eq8 (Add8 x (Const8 <t> [d])) (Const8 <t> [c])) 22979 // result: (Eq8 (Const8 <t> [int64(int8(c-d))]) x) 22980 for { 22981 _ = v.Args[1] 22982 v_0 := v.Args[0] 22983 if v_0.Op != OpAdd8 { 22984 break 22985 } 22986 _ = v_0.Args[1] 22987 x := v_0.Args[0] 22988 v_0_1 := v_0.Args[1] 22989 if v_0_1.Op != OpConst8 { 22990 break 22991 } 22992 t := v_0_1.Type 22993 d := v_0_1.AuxInt 22994 v_1 := v.Args[1] 22995 if v_1.Op != OpConst8 || v_1.Type != t { 22996 break 22997 } 22998 c := v_1.AuxInt 22999 v.reset(OpEq8) 23000 v0 := b.NewValue0(v.Pos, OpConst8, t) 23001 v0.AuxInt = int64(int8(c - d)) 23002 v.AddArg(v0) 23003 v.AddArg(x) 23004 return true 23005 } 23006 // match: (Eq8 (Const8 [c]) (Const8 [d])) 23007 // result: (ConstBool [b2i(c == d)]) 23008 for { 23009 _ = v.Args[1] 23010 v_0 := v.Args[0] 23011 if v_0.Op != OpConst8 { 23012 break 23013 } 23014 c := v_0.AuxInt 23015 v_1 := v.Args[1] 23016 if v_1.Op != OpConst8 { 23017 break 23018 } 23019 d := v_1.AuxInt 23020 v.reset(OpConstBool) 23021 v.AuxInt = b2i(c == d) 23022 return true 23023 } 23024 // match: (Eq8 (Const8 [d]) (Const8 [c])) 23025 // result: (ConstBool [b2i(c == d)]) 23026 for { 23027 _ = v.Args[1] 23028 v_0 := v.Args[0] 23029 if v_0.Op != OpConst8 { 23030 break 23031 } 23032 d := v_0.AuxInt 23033 v_1 := v.Args[1] 23034 if v_1.Op != OpConst8 { 23035 break 23036 } 23037 c := v_1.AuxInt 23038 v.reset(OpConstBool) 23039 v.AuxInt = b2i(c == d) 23040 return true 23041 } 23042 // match: (Eq8 (Mod8u x (Const8 [c])) (Const8 [0])) 23043 // cond: x.Op != OpConst8 && udivisibleOK(8,c) && !hasSmallRotate(config) 23044 // result: (Eq32 (Mod32u <typ.UInt32> (ZeroExt8to32 <typ.UInt32> x) (Const32 <typ.UInt32> [c&0xff])) (Const32 <typ.UInt32> [0])) 23045 for { 23046 _ = v.Args[1] 23047 v_0 := v.Args[0] 23048 if v_0.Op != OpMod8u { 23049 break 23050 } 23051 _ = v_0.Args[1] 23052 x := v_0.Args[0] 23053 v_0_1 := v_0.Args[1] 23054 if v_0_1.Op != OpConst8 { 23055 break 23056 } 23057 c := v_0_1.AuxInt 23058 v_1 := v.Args[1] 23059 if v_1.Op != OpConst8 || v_1.AuxInt != 0 || !(x.Op != OpConst8 && udivisibleOK(8, c) && !hasSmallRotate(config)) { 23060 break 23061 } 23062 v.reset(OpEq32) 23063 v0 := b.NewValue0(v.Pos, OpMod32u, typ.UInt32) 23064 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 23065 v1.AddArg(x) 23066 v0.AddArg(v1) 23067 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 23068 v2.AuxInt = c & 0xff 23069 v0.AddArg(v2) 23070 v.AddArg(v0) 23071 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 23072 v3.AuxInt = 0 23073 v.AddArg(v3) 23074 return true 23075 } 23076 // match: (Eq8 (Const8 [0]) (Mod8u x (Const8 [c]))) 23077 // cond: x.Op != OpConst8 && udivisibleOK(8,c) && !hasSmallRotate(config) 23078 // result: (Eq32 (Mod32u <typ.UInt32> (ZeroExt8to32 <typ.UInt32> x) (Const32 <typ.UInt32> [c&0xff])) (Const32 <typ.UInt32> [0])) 23079 for { 23080 _ = v.Args[1] 23081 v_0 := v.Args[0] 23082 if v_0.Op != OpConst8 || v_0.AuxInt != 0 { 23083 break 23084 } 23085 v_1 := v.Args[1] 23086 if v_1.Op != OpMod8u { 23087 break 23088 } 23089 _ = v_1.Args[1] 23090 x := v_1.Args[0] 23091 v_1_1 := v_1.Args[1] 23092 if v_1_1.Op != OpConst8 { 23093 break 23094 } 23095 c := v_1_1.AuxInt 23096 if !(x.Op != OpConst8 && udivisibleOK(8, c) && !hasSmallRotate(config)) { 23097 break 23098 } 23099 v.reset(OpEq32) 23100 v0 := b.NewValue0(v.Pos, OpMod32u, typ.UInt32) 23101 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 23102 v1.AddArg(x) 23103 v0.AddArg(v1) 23104 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 23105 v2.AuxInt = c & 0xff 23106 v0.AddArg(v2) 23107 v.AddArg(v0) 23108 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32) 23109 v3.AuxInt = 0 23110 v.AddArg(v3) 23111 return true 23112 } 23113 // match: (Eq8 (Mod8 x (Const8 [c])) (Const8 [0])) 23114 // cond: x.Op != OpConst8 && sdivisibleOK(8,c) && !hasSmallRotate(config) 23115 // result: (Eq32 (Mod32 <typ.Int32> (SignExt8to32 <typ.Int32> x) (Const32 <typ.Int32> [c])) (Const32 <typ.Int32> [0])) 23116 for { 23117 _ = v.Args[1] 23118 v_0 := v.Args[0] 23119 if v_0.Op != OpMod8 { 23120 break 23121 } 23122 _ = v_0.Args[1] 23123 x := v_0.Args[0] 23124 v_0_1 := v_0.Args[1] 23125 if v_0_1.Op != OpConst8 { 23126 break 23127 } 23128 c := v_0_1.AuxInt 23129 v_1 := v.Args[1] 23130 if v_1.Op != OpConst8 || v_1.AuxInt != 0 || !(x.Op != OpConst8 && sdivisibleOK(8, c) && !hasSmallRotate(config)) { 23131 break 23132 } 23133 v.reset(OpEq32) 23134 v0 := b.NewValue0(v.Pos, OpMod32, typ.Int32) 23135 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 23136 v1.AddArg(x) 23137 v0.AddArg(v1) 23138 v2 := b.NewValue0(v.Pos, OpConst32, typ.Int32) 23139 v2.AuxInt = c 23140 v0.AddArg(v2) 23141 v.AddArg(v0) 23142 v3 := b.NewValue0(v.Pos, OpConst32, typ.Int32) 23143 v3.AuxInt = 0 23144 v.AddArg(v3) 23145 return true 23146 } 23147 return false 23148 } 23149 func rewriteValuegeneric_OpEq8_10(v *Value) bool { 23150 b := v.Block 23151 config := b.Func.Config 23152 typ := &b.Func.Config.Types 23153 // match: (Eq8 (Const8 [0]) (Mod8 x (Const8 [c]))) 23154 // cond: x.Op != OpConst8 && sdivisibleOK(8,c) && !hasSmallRotate(config) 23155 // result: (Eq32 (Mod32 <typ.Int32> (SignExt8to32 <typ.Int32> x) (Const32 <typ.Int32> [c])) (Const32 <typ.Int32> [0])) 23156 for { 23157 _ = v.Args[1] 23158 v_0 := v.Args[0] 23159 if v_0.Op != OpConst8 || v_0.AuxInt != 0 { 23160 break 23161 } 23162 v_1 := v.Args[1] 23163 if v_1.Op != OpMod8 { 23164 break 23165 } 23166 _ = v_1.Args[1] 23167 x := v_1.Args[0] 23168 v_1_1 := v_1.Args[1] 23169 if v_1_1.Op != OpConst8 { 23170 break 23171 } 23172 c := v_1_1.AuxInt 23173 if !(x.Op != OpConst8 && sdivisibleOK(8, c) && !hasSmallRotate(config)) { 23174 break 23175 } 23176 v.reset(OpEq32) 23177 v0 := b.NewValue0(v.Pos, OpMod32, typ.Int32) 23178 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 23179 v1.AddArg(x) 23180 v0.AddArg(v1) 23181 v2 := b.NewValue0(v.Pos, OpConst32, typ.Int32) 23182 v2.AuxInt = c 23183 v0.AddArg(v2) 23184 v.AddArg(v0) 23185 v3 := b.NewValue0(v.Pos, OpConst32, typ.Int32) 23186 v3.AuxInt = 0 23187 v.AddArg(v3) 23188 return true 23189 } 23190 // match: (Eq8 x (Mul8 (Const8 [c]) (Trunc32to8 (Rsh32Ux64 mul:(Mul32 (Const32 [m]) (ZeroExt8to32 x)) (Const64 [s]))))) 23191 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<8+umagic(8,c).m) && s == 8+umagic(8,c).s && x.Op != OpConst8 && udivisibleOK(8,c) 23192 // result: (Leq8U (RotateLeft8 <typ.UInt8> (Mul8 <typ.UInt8> (Const8 <typ.UInt8> [int64(int8(udivisible(8,c).m))]) x) (Const8 <typ.UInt8> [int64(8-udivisible(8,c).k)]) ) (Const8 <typ.UInt8> [int64(int8(udivisible(8,c).max))]) ) 23193 for { 23194 _ = v.Args[1] 23195 x := v.Args[0] 23196 v_1 := v.Args[1] 23197 if v_1.Op != OpMul8 { 23198 break 23199 } 23200 _ = v_1.Args[1] 23201 v_1_0 := v_1.Args[0] 23202 if v_1_0.Op != OpConst8 { 23203 break 23204 } 23205 c := v_1_0.AuxInt 23206 v_1_1 := v_1.Args[1] 23207 if v_1_1.Op != OpTrunc32to8 { 23208 break 23209 } 23210 v_1_1_0 := v_1_1.Args[0] 23211 if v_1_1_0.Op != OpRsh32Ux64 { 23212 break 23213 } 23214 _ = v_1_1_0.Args[1] 23215 mul := v_1_1_0.Args[0] 23216 if mul.Op != OpMul32 { 23217 break 23218 } 23219 _ = mul.Args[1] 23220 mul_0 := mul.Args[0] 23221 if mul_0.Op != OpConst32 { 23222 break 23223 } 23224 m := mul_0.AuxInt 23225 mul_1 := mul.Args[1] 23226 if mul_1.Op != OpZeroExt8to32 || x != mul_1.Args[0] { 23227 break 23228 } 23229 v_1_1_0_1 := v_1_1_0.Args[1] 23230 if v_1_1_0_1.Op != OpConst64 { 23231 break 23232 } 23233 s := v_1_1_0_1.AuxInt 23234 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<8+umagic(8, c).m) && s == 8+umagic(8, c).s && x.Op != OpConst8 && udivisibleOK(8, c)) { 23235 break 23236 } 23237 v.reset(OpLeq8U) 23238 v0 := b.NewValue0(v.Pos, OpRotateLeft8, typ.UInt8) 23239 v1 := b.NewValue0(v.Pos, OpMul8, typ.UInt8) 23240 v2 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23241 v2.AuxInt = int64(int8(udivisible(8, c).m)) 23242 v1.AddArg(v2) 23243 v1.AddArg(x) 23244 v0.AddArg(v1) 23245 v3 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23246 v3.AuxInt = int64(8 - udivisible(8, c).k) 23247 v0.AddArg(v3) 23248 v.AddArg(v0) 23249 v4 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23250 v4.AuxInt = int64(int8(udivisible(8, c).max)) 23251 v.AddArg(v4) 23252 return true 23253 } 23254 // match: (Eq8 x (Mul8 (Const8 [c]) (Trunc32to8 (Rsh32Ux64 mul:(Mul32 (ZeroExt8to32 x) (Const32 [m])) (Const64 [s]))))) 23255 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<8+umagic(8,c).m) && s == 8+umagic(8,c).s && x.Op != OpConst8 && udivisibleOK(8,c) 23256 // result: (Leq8U (RotateLeft8 <typ.UInt8> (Mul8 <typ.UInt8> (Const8 <typ.UInt8> [int64(int8(udivisible(8,c).m))]) x) (Const8 <typ.UInt8> [int64(8-udivisible(8,c).k)]) ) (Const8 <typ.UInt8> [int64(int8(udivisible(8,c).max))]) ) 23257 for { 23258 _ = v.Args[1] 23259 x := v.Args[0] 23260 v_1 := v.Args[1] 23261 if v_1.Op != OpMul8 { 23262 break 23263 } 23264 _ = v_1.Args[1] 23265 v_1_0 := v_1.Args[0] 23266 if v_1_0.Op != OpConst8 { 23267 break 23268 } 23269 c := v_1_0.AuxInt 23270 v_1_1 := v_1.Args[1] 23271 if v_1_1.Op != OpTrunc32to8 { 23272 break 23273 } 23274 v_1_1_0 := v_1_1.Args[0] 23275 if v_1_1_0.Op != OpRsh32Ux64 { 23276 break 23277 } 23278 _ = v_1_1_0.Args[1] 23279 mul := v_1_1_0.Args[0] 23280 if mul.Op != OpMul32 { 23281 break 23282 } 23283 _ = mul.Args[1] 23284 mul_0 := mul.Args[0] 23285 if mul_0.Op != OpZeroExt8to32 || x != mul_0.Args[0] { 23286 break 23287 } 23288 mul_1 := mul.Args[1] 23289 if mul_1.Op != OpConst32 { 23290 break 23291 } 23292 m := mul_1.AuxInt 23293 v_1_1_0_1 := v_1_1_0.Args[1] 23294 if v_1_1_0_1.Op != OpConst64 { 23295 break 23296 } 23297 s := v_1_1_0_1.AuxInt 23298 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<8+umagic(8, c).m) && s == 8+umagic(8, c).s && x.Op != OpConst8 && udivisibleOK(8, c)) { 23299 break 23300 } 23301 v.reset(OpLeq8U) 23302 v0 := b.NewValue0(v.Pos, OpRotateLeft8, typ.UInt8) 23303 v1 := b.NewValue0(v.Pos, OpMul8, typ.UInt8) 23304 v2 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23305 v2.AuxInt = int64(int8(udivisible(8, c).m)) 23306 v1.AddArg(v2) 23307 v1.AddArg(x) 23308 v0.AddArg(v1) 23309 v3 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23310 v3.AuxInt = int64(8 - udivisible(8, c).k) 23311 v0.AddArg(v3) 23312 v.AddArg(v0) 23313 v4 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23314 v4.AuxInt = int64(int8(udivisible(8, c).max)) 23315 v.AddArg(v4) 23316 return true 23317 } 23318 // match: (Eq8 x (Mul8 (Trunc32to8 (Rsh32Ux64 mul:(Mul32 (Const32 [m]) (ZeroExt8to32 x)) (Const64 [s]))) (Const8 [c]))) 23319 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<8+umagic(8,c).m) && s == 8+umagic(8,c).s && x.Op != OpConst8 && udivisibleOK(8,c) 23320 // result: (Leq8U (RotateLeft8 <typ.UInt8> (Mul8 <typ.UInt8> (Const8 <typ.UInt8> [int64(int8(udivisible(8,c).m))]) x) (Const8 <typ.UInt8> [int64(8-udivisible(8,c).k)]) ) (Const8 <typ.UInt8> [int64(int8(udivisible(8,c).max))]) ) 23321 for { 23322 _ = v.Args[1] 23323 x := v.Args[0] 23324 v_1 := v.Args[1] 23325 if v_1.Op != OpMul8 { 23326 break 23327 } 23328 _ = v_1.Args[1] 23329 v_1_0 := v_1.Args[0] 23330 if v_1_0.Op != OpTrunc32to8 { 23331 break 23332 } 23333 v_1_0_0 := v_1_0.Args[0] 23334 if v_1_0_0.Op != OpRsh32Ux64 { 23335 break 23336 } 23337 _ = v_1_0_0.Args[1] 23338 mul := v_1_0_0.Args[0] 23339 if mul.Op != OpMul32 { 23340 break 23341 } 23342 _ = mul.Args[1] 23343 mul_0 := mul.Args[0] 23344 if mul_0.Op != OpConst32 { 23345 break 23346 } 23347 m := mul_0.AuxInt 23348 mul_1 := mul.Args[1] 23349 if mul_1.Op != OpZeroExt8to32 || x != mul_1.Args[0] { 23350 break 23351 } 23352 v_1_0_0_1 := v_1_0_0.Args[1] 23353 if v_1_0_0_1.Op != OpConst64 { 23354 break 23355 } 23356 s := v_1_0_0_1.AuxInt 23357 v_1_1 := v_1.Args[1] 23358 if v_1_1.Op != OpConst8 { 23359 break 23360 } 23361 c := v_1_1.AuxInt 23362 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<8+umagic(8, c).m) && s == 8+umagic(8, c).s && x.Op != OpConst8 && udivisibleOK(8, c)) { 23363 break 23364 } 23365 v.reset(OpLeq8U) 23366 v0 := b.NewValue0(v.Pos, OpRotateLeft8, typ.UInt8) 23367 v1 := b.NewValue0(v.Pos, OpMul8, typ.UInt8) 23368 v2 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23369 v2.AuxInt = int64(int8(udivisible(8, c).m)) 23370 v1.AddArg(v2) 23371 v1.AddArg(x) 23372 v0.AddArg(v1) 23373 v3 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23374 v3.AuxInt = int64(8 - udivisible(8, c).k) 23375 v0.AddArg(v3) 23376 v.AddArg(v0) 23377 v4 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23378 v4.AuxInt = int64(int8(udivisible(8, c).max)) 23379 v.AddArg(v4) 23380 return true 23381 } 23382 // match: (Eq8 x (Mul8 (Trunc32to8 (Rsh32Ux64 mul:(Mul32 (ZeroExt8to32 x) (Const32 [m])) (Const64 [s]))) (Const8 [c]))) 23383 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<8+umagic(8,c).m) && s == 8+umagic(8,c).s && x.Op != OpConst8 && udivisibleOK(8,c) 23384 // result: (Leq8U (RotateLeft8 <typ.UInt8> (Mul8 <typ.UInt8> (Const8 <typ.UInt8> [int64(int8(udivisible(8,c).m))]) x) (Const8 <typ.UInt8> [int64(8-udivisible(8,c).k)]) ) (Const8 <typ.UInt8> [int64(int8(udivisible(8,c).max))]) ) 23385 for { 23386 _ = v.Args[1] 23387 x := v.Args[0] 23388 v_1 := v.Args[1] 23389 if v_1.Op != OpMul8 { 23390 break 23391 } 23392 _ = v_1.Args[1] 23393 v_1_0 := v_1.Args[0] 23394 if v_1_0.Op != OpTrunc32to8 { 23395 break 23396 } 23397 v_1_0_0 := v_1_0.Args[0] 23398 if v_1_0_0.Op != OpRsh32Ux64 { 23399 break 23400 } 23401 _ = v_1_0_0.Args[1] 23402 mul := v_1_0_0.Args[0] 23403 if mul.Op != OpMul32 { 23404 break 23405 } 23406 _ = mul.Args[1] 23407 mul_0 := mul.Args[0] 23408 if mul_0.Op != OpZeroExt8to32 || x != mul_0.Args[0] { 23409 break 23410 } 23411 mul_1 := mul.Args[1] 23412 if mul_1.Op != OpConst32 { 23413 break 23414 } 23415 m := mul_1.AuxInt 23416 v_1_0_0_1 := v_1_0_0.Args[1] 23417 if v_1_0_0_1.Op != OpConst64 { 23418 break 23419 } 23420 s := v_1_0_0_1.AuxInt 23421 v_1_1 := v_1.Args[1] 23422 if v_1_1.Op != OpConst8 { 23423 break 23424 } 23425 c := v_1_1.AuxInt 23426 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<8+umagic(8, c).m) && s == 8+umagic(8, c).s && x.Op != OpConst8 && udivisibleOK(8, c)) { 23427 break 23428 } 23429 v.reset(OpLeq8U) 23430 v0 := b.NewValue0(v.Pos, OpRotateLeft8, typ.UInt8) 23431 v1 := b.NewValue0(v.Pos, OpMul8, typ.UInt8) 23432 v2 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23433 v2.AuxInt = int64(int8(udivisible(8, c).m)) 23434 v1.AddArg(v2) 23435 v1.AddArg(x) 23436 v0.AddArg(v1) 23437 v3 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23438 v3.AuxInt = int64(8 - udivisible(8, c).k) 23439 v0.AddArg(v3) 23440 v.AddArg(v0) 23441 v4 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23442 v4.AuxInt = int64(int8(udivisible(8, c).max)) 23443 v.AddArg(v4) 23444 return true 23445 } 23446 // match: (Eq8 (Mul8 (Const8 [c]) (Trunc32to8 (Rsh32Ux64 mul:(Mul32 (Const32 [m]) (ZeroExt8to32 x)) (Const64 [s])))) x) 23447 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<8+umagic(8,c).m) && s == 8+umagic(8,c).s && x.Op != OpConst8 && udivisibleOK(8,c) 23448 // result: (Leq8U (RotateLeft8 <typ.UInt8> (Mul8 <typ.UInt8> (Const8 <typ.UInt8> [int64(int8(udivisible(8,c).m))]) x) (Const8 <typ.UInt8> [int64(8-udivisible(8,c).k)]) ) (Const8 <typ.UInt8> [int64(int8(udivisible(8,c).max))]) ) 23449 for { 23450 x := v.Args[1] 23451 v_0 := v.Args[0] 23452 if v_0.Op != OpMul8 { 23453 break 23454 } 23455 _ = v_0.Args[1] 23456 v_0_0 := v_0.Args[0] 23457 if v_0_0.Op != OpConst8 { 23458 break 23459 } 23460 c := v_0_0.AuxInt 23461 v_0_1 := v_0.Args[1] 23462 if v_0_1.Op != OpTrunc32to8 { 23463 break 23464 } 23465 v_0_1_0 := v_0_1.Args[0] 23466 if v_0_1_0.Op != OpRsh32Ux64 { 23467 break 23468 } 23469 _ = v_0_1_0.Args[1] 23470 mul := v_0_1_0.Args[0] 23471 if mul.Op != OpMul32 { 23472 break 23473 } 23474 _ = mul.Args[1] 23475 mul_0 := mul.Args[0] 23476 if mul_0.Op != OpConst32 { 23477 break 23478 } 23479 m := mul_0.AuxInt 23480 mul_1 := mul.Args[1] 23481 if mul_1.Op != OpZeroExt8to32 || x != mul_1.Args[0] { 23482 break 23483 } 23484 v_0_1_0_1 := v_0_1_0.Args[1] 23485 if v_0_1_0_1.Op != OpConst64 { 23486 break 23487 } 23488 s := v_0_1_0_1.AuxInt 23489 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<8+umagic(8, c).m) && s == 8+umagic(8, c).s && x.Op != OpConst8 && udivisibleOK(8, c)) { 23490 break 23491 } 23492 v.reset(OpLeq8U) 23493 v0 := b.NewValue0(v.Pos, OpRotateLeft8, typ.UInt8) 23494 v1 := b.NewValue0(v.Pos, OpMul8, typ.UInt8) 23495 v2 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23496 v2.AuxInt = int64(int8(udivisible(8, c).m)) 23497 v1.AddArg(v2) 23498 v1.AddArg(x) 23499 v0.AddArg(v1) 23500 v3 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23501 v3.AuxInt = int64(8 - udivisible(8, c).k) 23502 v0.AddArg(v3) 23503 v.AddArg(v0) 23504 v4 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23505 v4.AuxInt = int64(int8(udivisible(8, c).max)) 23506 v.AddArg(v4) 23507 return true 23508 } 23509 // match: (Eq8 (Mul8 (Const8 [c]) (Trunc32to8 (Rsh32Ux64 mul:(Mul32 (ZeroExt8to32 x) (Const32 [m])) (Const64 [s])))) x) 23510 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<8+umagic(8,c).m) && s == 8+umagic(8,c).s && x.Op != OpConst8 && udivisibleOK(8,c) 23511 // result: (Leq8U (RotateLeft8 <typ.UInt8> (Mul8 <typ.UInt8> (Const8 <typ.UInt8> [int64(int8(udivisible(8,c).m))]) x) (Const8 <typ.UInt8> [int64(8-udivisible(8,c).k)]) ) (Const8 <typ.UInt8> [int64(int8(udivisible(8,c).max))]) ) 23512 for { 23513 x := v.Args[1] 23514 v_0 := v.Args[0] 23515 if v_0.Op != OpMul8 { 23516 break 23517 } 23518 _ = v_0.Args[1] 23519 v_0_0 := v_0.Args[0] 23520 if v_0_0.Op != OpConst8 { 23521 break 23522 } 23523 c := v_0_0.AuxInt 23524 v_0_1 := v_0.Args[1] 23525 if v_0_1.Op != OpTrunc32to8 { 23526 break 23527 } 23528 v_0_1_0 := v_0_1.Args[0] 23529 if v_0_1_0.Op != OpRsh32Ux64 { 23530 break 23531 } 23532 _ = v_0_1_0.Args[1] 23533 mul := v_0_1_0.Args[0] 23534 if mul.Op != OpMul32 { 23535 break 23536 } 23537 _ = mul.Args[1] 23538 mul_0 := mul.Args[0] 23539 if mul_0.Op != OpZeroExt8to32 || x != mul_0.Args[0] { 23540 break 23541 } 23542 mul_1 := mul.Args[1] 23543 if mul_1.Op != OpConst32 { 23544 break 23545 } 23546 m := mul_1.AuxInt 23547 v_0_1_0_1 := v_0_1_0.Args[1] 23548 if v_0_1_0_1.Op != OpConst64 { 23549 break 23550 } 23551 s := v_0_1_0_1.AuxInt 23552 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<8+umagic(8, c).m) && s == 8+umagic(8, c).s && x.Op != OpConst8 && udivisibleOK(8, c)) { 23553 break 23554 } 23555 v.reset(OpLeq8U) 23556 v0 := b.NewValue0(v.Pos, OpRotateLeft8, typ.UInt8) 23557 v1 := b.NewValue0(v.Pos, OpMul8, typ.UInt8) 23558 v2 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23559 v2.AuxInt = int64(int8(udivisible(8, c).m)) 23560 v1.AddArg(v2) 23561 v1.AddArg(x) 23562 v0.AddArg(v1) 23563 v3 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23564 v3.AuxInt = int64(8 - udivisible(8, c).k) 23565 v0.AddArg(v3) 23566 v.AddArg(v0) 23567 v4 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23568 v4.AuxInt = int64(int8(udivisible(8, c).max)) 23569 v.AddArg(v4) 23570 return true 23571 } 23572 // match: (Eq8 (Mul8 (Trunc32to8 (Rsh32Ux64 mul:(Mul32 (Const32 [m]) (ZeroExt8to32 x)) (Const64 [s]))) (Const8 [c])) x) 23573 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<8+umagic(8,c).m) && s == 8+umagic(8,c).s && x.Op != OpConst8 && udivisibleOK(8,c) 23574 // result: (Leq8U (RotateLeft8 <typ.UInt8> (Mul8 <typ.UInt8> (Const8 <typ.UInt8> [int64(int8(udivisible(8,c).m))]) x) (Const8 <typ.UInt8> [int64(8-udivisible(8,c).k)]) ) (Const8 <typ.UInt8> [int64(int8(udivisible(8,c).max))]) ) 23575 for { 23576 x := v.Args[1] 23577 v_0 := v.Args[0] 23578 if v_0.Op != OpMul8 { 23579 break 23580 } 23581 _ = v_0.Args[1] 23582 v_0_0 := v_0.Args[0] 23583 if v_0_0.Op != OpTrunc32to8 { 23584 break 23585 } 23586 v_0_0_0 := v_0_0.Args[0] 23587 if v_0_0_0.Op != OpRsh32Ux64 { 23588 break 23589 } 23590 _ = v_0_0_0.Args[1] 23591 mul := v_0_0_0.Args[0] 23592 if mul.Op != OpMul32 { 23593 break 23594 } 23595 _ = mul.Args[1] 23596 mul_0 := mul.Args[0] 23597 if mul_0.Op != OpConst32 { 23598 break 23599 } 23600 m := mul_0.AuxInt 23601 mul_1 := mul.Args[1] 23602 if mul_1.Op != OpZeroExt8to32 || x != mul_1.Args[0] { 23603 break 23604 } 23605 v_0_0_0_1 := v_0_0_0.Args[1] 23606 if v_0_0_0_1.Op != OpConst64 { 23607 break 23608 } 23609 s := v_0_0_0_1.AuxInt 23610 v_0_1 := v_0.Args[1] 23611 if v_0_1.Op != OpConst8 { 23612 break 23613 } 23614 c := v_0_1.AuxInt 23615 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<8+umagic(8, c).m) && s == 8+umagic(8, c).s && x.Op != OpConst8 && udivisibleOK(8, c)) { 23616 break 23617 } 23618 v.reset(OpLeq8U) 23619 v0 := b.NewValue0(v.Pos, OpRotateLeft8, typ.UInt8) 23620 v1 := b.NewValue0(v.Pos, OpMul8, typ.UInt8) 23621 v2 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23622 v2.AuxInt = int64(int8(udivisible(8, c).m)) 23623 v1.AddArg(v2) 23624 v1.AddArg(x) 23625 v0.AddArg(v1) 23626 v3 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23627 v3.AuxInt = int64(8 - udivisible(8, c).k) 23628 v0.AddArg(v3) 23629 v.AddArg(v0) 23630 v4 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23631 v4.AuxInt = int64(int8(udivisible(8, c).max)) 23632 v.AddArg(v4) 23633 return true 23634 } 23635 // match: (Eq8 (Mul8 (Trunc32to8 (Rsh32Ux64 mul:(Mul32 (ZeroExt8to32 x) (Const32 [m])) (Const64 [s]))) (Const8 [c])) x) 23636 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<8+umagic(8,c).m) && s == 8+umagic(8,c).s && x.Op != OpConst8 && udivisibleOK(8,c) 23637 // result: (Leq8U (RotateLeft8 <typ.UInt8> (Mul8 <typ.UInt8> (Const8 <typ.UInt8> [int64(int8(udivisible(8,c).m))]) x) (Const8 <typ.UInt8> [int64(8-udivisible(8,c).k)]) ) (Const8 <typ.UInt8> [int64(int8(udivisible(8,c).max))]) ) 23638 for { 23639 x := v.Args[1] 23640 v_0 := v.Args[0] 23641 if v_0.Op != OpMul8 { 23642 break 23643 } 23644 _ = v_0.Args[1] 23645 v_0_0 := v_0.Args[0] 23646 if v_0_0.Op != OpTrunc32to8 { 23647 break 23648 } 23649 v_0_0_0 := v_0_0.Args[0] 23650 if v_0_0_0.Op != OpRsh32Ux64 { 23651 break 23652 } 23653 _ = v_0_0_0.Args[1] 23654 mul := v_0_0_0.Args[0] 23655 if mul.Op != OpMul32 { 23656 break 23657 } 23658 _ = mul.Args[1] 23659 mul_0 := mul.Args[0] 23660 if mul_0.Op != OpZeroExt8to32 || x != mul_0.Args[0] { 23661 break 23662 } 23663 mul_1 := mul.Args[1] 23664 if mul_1.Op != OpConst32 { 23665 break 23666 } 23667 m := mul_1.AuxInt 23668 v_0_0_0_1 := v_0_0_0.Args[1] 23669 if v_0_0_0_1.Op != OpConst64 { 23670 break 23671 } 23672 s := v_0_0_0_1.AuxInt 23673 v_0_1 := v_0.Args[1] 23674 if v_0_1.Op != OpConst8 { 23675 break 23676 } 23677 c := v_0_1.AuxInt 23678 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<8+umagic(8, c).m) && s == 8+umagic(8, c).s && x.Op != OpConst8 && udivisibleOK(8, c)) { 23679 break 23680 } 23681 v.reset(OpLeq8U) 23682 v0 := b.NewValue0(v.Pos, OpRotateLeft8, typ.UInt8) 23683 v1 := b.NewValue0(v.Pos, OpMul8, typ.UInt8) 23684 v2 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23685 v2.AuxInt = int64(int8(udivisible(8, c).m)) 23686 v1.AddArg(v2) 23687 v1.AddArg(x) 23688 v0.AddArg(v1) 23689 v3 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23690 v3.AuxInt = int64(8 - udivisible(8, c).k) 23691 v0.AddArg(v3) 23692 v.AddArg(v0) 23693 v4 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23694 v4.AuxInt = int64(int8(udivisible(8, c).max)) 23695 v.AddArg(v4) 23696 return true 23697 } 23698 // match: (Eq8 x (Mul8 (Const8 [c]) (Sub8 (Rsh32x64 mul:(Mul32 (Const32 [m]) (SignExt8to32 x)) (Const64 [s])) (Rsh32x64 (SignExt8to32 x) (Const64 [31]))))) 23699 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(8,c).m) && s == 8+smagic(8,c).s && x.Op != OpConst8 && sdivisibleOK(8,c) 23700 // result: (Leq8U (RotateLeft8 <typ.UInt8> (Add8 <typ.UInt8> (Mul8 <typ.UInt8> (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).m))]) x) (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).a))]) ) (Const8 <typ.UInt8> [int64(8-sdivisible(8,c).k)]) ) (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).max))]) ) 23701 for { 23702 _ = v.Args[1] 23703 x := v.Args[0] 23704 v_1 := v.Args[1] 23705 if v_1.Op != OpMul8 { 23706 break 23707 } 23708 _ = v_1.Args[1] 23709 v_1_0 := v_1.Args[0] 23710 if v_1_0.Op != OpConst8 { 23711 break 23712 } 23713 c := v_1_0.AuxInt 23714 v_1_1 := v_1.Args[1] 23715 if v_1_1.Op != OpSub8 { 23716 break 23717 } 23718 _ = v_1_1.Args[1] 23719 v_1_1_0 := v_1_1.Args[0] 23720 if v_1_1_0.Op != OpRsh32x64 { 23721 break 23722 } 23723 _ = v_1_1_0.Args[1] 23724 mul := v_1_1_0.Args[0] 23725 if mul.Op != OpMul32 { 23726 break 23727 } 23728 _ = mul.Args[1] 23729 mul_0 := mul.Args[0] 23730 if mul_0.Op != OpConst32 { 23731 break 23732 } 23733 m := mul_0.AuxInt 23734 mul_1 := mul.Args[1] 23735 if mul_1.Op != OpSignExt8to32 || x != mul_1.Args[0] { 23736 break 23737 } 23738 v_1_1_0_1 := v_1_1_0.Args[1] 23739 if v_1_1_0_1.Op != OpConst64 { 23740 break 23741 } 23742 s := v_1_1_0_1.AuxInt 23743 v_1_1_1 := v_1_1.Args[1] 23744 if v_1_1_1.Op != OpRsh32x64 { 23745 break 23746 } 23747 _ = v_1_1_1.Args[1] 23748 v_1_1_1_0 := v_1_1_1.Args[0] 23749 if v_1_1_1_0.Op != OpSignExt8to32 || x != v_1_1_1_0.Args[0] { 23750 break 23751 } 23752 v_1_1_1_1 := v_1_1_1.Args[1] 23753 if v_1_1_1_1.Op != OpConst64 || v_1_1_1_1.AuxInt != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(8, c).m) && s == 8+smagic(8, c).s && x.Op != OpConst8 && sdivisibleOK(8, c)) { 23754 break 23755 } 23756 v.reset(OpLeq8U) 23757 v0 := b.NewValue0(v.Pos, OpRotateLeft8, typ.UInt8) 23758 v1 := b.NewValue0(v.Pos, OpAdd8, typ.UInt8) 23759 v2 := b.NewValue0(v.Pos, OpMul8, typ.UInt8) 23760 v3 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23761 v3.AuxInt = int64(int8(sdivisible(8, c).m)) 23762 v2.AddArg(v3) 23763 v2.AddArg(x) 23764 v1.AddArg(v2) 23765 v4 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23766 v4.AuxInt = int64(int8(sdivisible(8, c).a)) 23767 v1.AddArg(v4) 23768 v0.AddArg(v1) 23769 v5 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23770 v5.AuxInt = int64(8 - sdivisible(8, c).k) 23771 v0.AddArg(v5) 23772 v.AddArg(v0) 23773 v6 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23774 v6.AuxInt = int64(int8(sdivisible(8, c).max)) 23775 v.AddArg(v6) 23776 return true 23777 } 23778 return false 23779 } 23780 func rewriteValuegeneric_OpEq8_20(v *Value) bool { 23781 b := v.Block 23782 typ := &b.Func.Config.Types 23783 // match: (Eq8 x (Mul8 (Const8 [c]) (Sub8 (Rsh32x64 mul:(Mul32 (SignExt8to32 x) (Const32 [m])) (Const64 [s])) (Rsh32x64 (SignExt8to32 x) (Const64 [31]))))) 23784 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(8,c).m) && s == 8+smagic(8,c).s && x.Op != OpConst8 && sdivisibleOK(8,c) 23785 // result: (Leq8U (RotateLeft8 <typ.UInt8> (Add8 <typ.UInt8> (Mul8 <typ.UInt8> (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).m))]) x) (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).a))]) ) (Const8 <typ.UInt8> [int64(8-sdivisible(8,c).k)]) ) (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).max))]) ) 23786 for { 23787 _ = v.Args[1] 23788 x := v.Args[0] 23789 v_1 := v.Args[1] 23790 if v_1.Op != OpMul8 { 23791 break 23792 } 23793 _ = v_1.Args[1] 23794 v_1_0 := v_1.Args[0] 23795 if v_1_0.Op != OpConst8 { 23796 break 23797 } 23798 c := v_1_0.AuxInt 23799 v_1_1 := v_1.Args[1] 23800 if v_1_1.Op != OpSub8 { 23801 break 23802 } 23803 _ = v_1_1.Args[1] 23804 v_1_1_0 := v_1_1.Args[0] 23805 if v_1_1_0.Op != OpRsh32x64 { 23806 break 23807 } 23808 _ = v_1_1_0.Args[1] 23809 mul := v_1_1_0.Args[0] 23810 if mul.Op != OpMul32 { 23811 break 23812 } 23813 _ = mul.Args[1] 23814 mul_0 := mul.Args[0] 23815 if mul_0.Op != OpSignExt8to32 || x != mul_0.Args[0] { 23816 break 23817 } 23818 mul_1 := mul.Args[1] 23819 if mul_1.Op != OpConst32 { 23820 break 23821 } 23822 m := mul_1.AuxInt 23823 v_1_1_0_1 := v_1_1_0.Args[1] 23824 if v_1_1_0_1.Op != OpConst64 { 23825 break 23826 } 23827 s := v_1_1_0_1.AuxInt 23828 v_1_1_1 := v_1_1.Args[1] 23829 if v_1_1_1.Op != OpRsh32x64 { 23830 break 23831 } 23832 _ = v_1_1_1.Args[1] 23833 v_1_1_1_0 := v_1_1_1.Args[0] 23834 if v_1_1_1_0.Op != OpSignExt8to32 || x != v_1_1_1_0.Args[0] { 23835 break 23836 } 23837 v_1_1_1_1 := v_1_1_1.Args[1] 23838 if v_1_1_1_1.Op != OpConst64 || v_1_1_1_1.AuxInt != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(8, c).m) && s == 8+smagic(8, c).s && x.Op != OpConst8 && sdivisibleOK(8, c)) { 23839 break 23840 } 23841 v.reset(OpLeq8U) 23842 v0 := b.NewValue0(v.Pos, OpRotateLeft8, typ.UInt8) 23843 v1 := b.NewValue0(v.Pos, OpAdd8, typ.UInt8) 23844 v2 := b.NewValue0(v.Pos, OpMul8, typ.UInt8) 23845 v3 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23846 v3.AuxInt = int64(int8(sdivisible(8, c).m)) 23847 v2.AddArg(v3) 23848 v2.AddArg(x) 23849 v1.AddArg(v2) 23850 v4 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23851 v4.AuxInt = int64(int8(sdivisible(8, c).a)) 23852 v1.AddArg(v4) 23853 v0.AddArg(v1) 23854 v5 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23855 v5.AuxInt = int64(8 - sdivisible(8, c).k) 23856 v0.AddArg(v5) 23857 v.AddArg(v0) 23858 v6 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23859 v6.AuxInt = int64(int8(sdivisible(8, c).max)) 23860 v.AddArg(v6) 23861 return true 23862 } 23863 // match: (Eq8 x (Mul8 (Sub8 (Rsh32x64 mul:(Mul32 (Const32 [m]) (SignExt8to32 x)) (Const64 [s])) (Rsh32x64 (SignExt8to32 x) (Const64 [31]))) (Const8 [c]))) 23864 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(8,c).m) && s == 8+smagic(8,c).s && x.Op != OpConst8 && sdivisibleOK(8,c) 23865 // result: (Leq8U (RotateLeft8 <typ.UInt8> (Add8 <typ.UInt8> (Mul8 <typ.UInt8> (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).m))]) x) (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).a))]) ) (Const8 <typ.UInt8> [int64(8-sdivisible(8,c).k)]) ) (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).max))]) ) 23866 for { 23867 _ = v.Args[1] 23868 x := v.Args[0] 23869 v_1 := v.Args[1] 23870 if v_1.Op != OpMul8 { 23871 break 23872 } 23873 _ = v_1.Args[1] 23874 v_1_0 := v_1.Args[0] 23875 if v_1_0.Op != OpSub8 { 23876 break 23877 } 23878 _ = v_1_0.Args[1] 23879 v_1_0_0 := v_1_0.Args[0] 23880 if v_1_0_0.Op != OpRsh32x64 { 23881 break 23882 } 23883 _ = v_1_0_0.Args[1] 23884 mul := v_1_0_0.Args[0] 23885 if mul.Op != OpMul32 { 23886 break 23887 } 23888 _ = mul.Args[1] 23889 mul_0 := mul.Args[0] 23890 if mul_0.Op != OpConst32 { 23891 break 23892 } 23893 m := mul_0.AuxInt 23894 mul_1 := mul.Args[1] 23895 if mul_1.Op != OpSignExt8to32 || x != mul_1.Args[0] { 23896 break 23897 } 23898 v_1_0_0_1 := v_1_0_0.Args[1] 23899 if v_1_0_0_1.Op != OpConst64 { 23900 break 23901 } 23902 s := v_1_0_0_1.AuxInt 23903 v_1_0_1 := v_1_0.Args[1] 23904 if v_1_0_1.Op != OpRsh32x64 { 23905 break 23906 } 23907 _ = v_1_0_1.Args[1] 23908 v_1_0_1_0 := v_1_0_1.Args[0] 23909 if v_1_0_1_0.Op != OpSignExt8to32 || x != v_1_0_1_0.Args[0] { 23910 break 23911 } 23912 v_1_0_1_1 := v_1_0_1.Args[1] 23913 if v_1_0_1_1.Op != OpConst64 || v_1_0_1_1.AuxInt != 31 { 23914 break 23915 } 23916 v_1_1 := v_1.Args[1] 23917 if v_1_1.Op != OpConst8 { 23918 break 23919 } 23920 c := v_1_1.AuxInt 23921 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(8, c).m) && s == 8+smagic(8, c).s && x.Op != OpConst8 && sdivisibleOK(8, c)) { 23922 break 23923 } 23924 v.reset(OpLeq8U) 23925 v0 := b.NewValue0(v.Pos, OpRotateLeft8, typ.UInt8) 23926 v1 := b.NewValue0(v.Pos, OpAdd8, typ.UInt8) 23927 v2 := b.NewValue0(v.Pos, OpMul8, typ.UInt8) 23928 v3 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23929 v3.AuxInt = int64(int8(sdivisible(8, c).m)) 23930 v2.AddArg(v3) 23931 v2.AddArg(x) 23932 v1.AddArg(v2) 23933 v4 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23934 v4.AuxInt = int64(int8(sdivisible(8, c).a)) 23935 v1.AddArg(v4) 23936 v0.AddArg(v1) 23937 v5 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23938 v5.AuxInt = int64(8 - sdivisible(8, c).k) 23939 v0.AddArg(v5) 23940 v.AddArg(v0) 23941 v6 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 23942 v6.AuxInt = int64(int8(sdivisible(8, c).max)) 23943 v.AddArg(v6) 23944 return true 23945 } 23946 // match: (Eq8 x (Mul8 (Sub8 (Rsh32x64 mul:(Mul32 (SignExt8to32 x) (Const32 [m])) (Const64 [s])) (Rsh32x64 (SignExt8to32 x) (Const64 [31]))) (Const8 [c]))) 23947 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(8,c).m) && s == 8+smagic(8,c).s && x.Op != OpConst8 && sdivisibleOK(8,c) 23948 // result: (Leq8U (RotateLeft8 <typ.UInt8> (Add8 <typ.UInt8> (Mul8 <typ.UInt8> (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).m))]) x) (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).a))]) ) (Const8 <typ.UInt8> [int64(8-sdivisible(8,c).k)]) ) (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).max))]) ) 23949 for { 23950 _ = v.Args[1] 23951 x := v.Args[0] 23952 v_1 := v.Args[1] 23953 if v_1.Op != OpMul8 { 23954 break 23955 } 23956 _ = v_1.Args[1] 23957 v_1_0 := v_1.Args[0] 23958 if v_1_0.Op != OpSub8 { 23959 break 23960 } 23961 _ = v_1_0.Args[1] 23962 v_1_0_0 := v_1_0.Args[0] 23963 if v_1_0_0.Op != OpRsh32x64 { 23964 break 23965 } 23966 _ = v_1_0_0.Args[1] 23967 mul := v_1_0_0.Args[0] 23968 if mul.Op != OpMul32 { 23969 break 23970 } 23971 _ = mul.Args[1] 23972 mul_0 := mul.Args[0] 23973 if mul_0.Op != OpSignExt8to32 || x != mul_0.Args[0] { 23974 break 23975 } 23976 mul_1 := mul.Args[1] 23977 if mul_1.Op != OpConst32 { 23978 break 23979 } 23980 m := mul_1.AuxInt 23981 v_1_0_0_1 := v_1_0_0.Args[1] 23982 if v_1_0_0_1.Op != OpConst64 { 23983 break 23984 } 23985 s := v_1_0_0_1.AuxInt 23986 v_1_0_1 := v_1_0.Args[1] 23987 if v_1_0_1.Op != OpRsh32x64 { 23988 break 23989 } 23990 _ = v_1_0_1.Args[1] 23991 v_1_0_1_0 := v_1_0_1.Args[0] 23992 if v_1_0_1_0.Op != OpSignExt8to32 || x != v_1_0_1_0.Args[0] { 23993 break 23994 } 23995 v_1_0_1_1 := v_1_0_1.Args[1] 23996 if v_1_0_1_1.Op != OpConst64 || v_1_0_1_1.AuxInt != 31 { 23997 break 23998 } 23999 v_1_1 := v_1.Args[1] 24000 if v_1_1.Op != OpConst8 { 24001 break 24002 } 24003 c := v_1_1.AuxInt 24004 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(8, c).m) && s == 8+smagic(8, c).s && x.Op != OpConst8 && sdivisibleOK(8, c)) { 24005 break 24006 } 24007 v.reset(OpLeq8U) 24008 v0 := b.NewValue0(v.Pos, OpRotateLeft8, typ.UInt8) 24009 v1 := b.NewValue0(v.Pos, OpAdd8, typ.UInt8) 24010 v2 := b.NewValue0(v.Pos, OpMul8, typ.UInt8) 24011 v3 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 24012 v3.AuxInt = int64(int8(sdivisible(8, c).m)) 24013 v2.AddArg(v3) 24014 v2.AddArg(x) 24015 v1.AddArg(v2) 24016 v4 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 24017 v4.AuxInt = int64(int8(sdivisible(8, c).a)) 24018 v1.AddArg(v4) 24019 v0.AddArg(v1) 24020 v5 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 24021 v5.AuxInt = int64(8 - sdivisible(8, c).k) 24022 v0.AddArg(v5) 24023 v.AddArg(v0) 24024 v6 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 24025 v6.AuxInt = int64(int8(sdivisible(8, c).max)) 24026 v.AddArg(v6) 24027 return true 24028 } 24029 // match: (Eq8 (Mul8 (Const8 [c]) (Sub8 (Rsh32x64 mul:(Mul32 (Const32 [m]) (SignExt8to32 x)) (Const64 [s])) (Rsh32x64 (SignExt8to32 x) (Const64 [31])))) x) 24030 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(8,c).m) && s == 8+smagic(8,c).s && x.Op != OpConst8 && sdivisibleOK(8,c) 24031 // result: (Leq8U (RotateLeft8 <typ.UInt8> (Add8 <typ.UInt8> (Mul8 <typ.UInt8> (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).m))]) x) (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).a))]) ) (Const8 <typ.UInt8> [int64(8-sdivisible(8,c).k)]) ) (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).max))]) ) 24032 for { 24033 x := v.Args[1] 24034 v_0 := v.Args[0] 24035 if v_0.Op != OpMul8 { 24036 break 24037 } 24038 _ = v_0.Args[1] 24039 v_0_0 := v_0.Args[0] 24040 if v_0_0.Op != OpConst8 { 24041 break 24042 } 24043 c := v_0_0.AuxInt 24044 v_0_1 := v_0.Args[1] 24045 if v_0_1.Op != OpSub8 { 24046 break 24047 } 24048 _ = v_0_1.Args[1] 24049 v_0_1_0 := v_0_1.Args[0] 24050 if v_0_1_0.Op != OpRsh32x64 { 24051 break 24052 } 24053 _ = v_0_1_0.Args[1] 24054 mul := v_0_1_0.Args[0] 24055 if mul.Op != OpMul32 { 24056 break 24057 } 24058 _ = mul.Args[1] 24059 mul_0 := mul.Args[0] 24060 if mul_0.Op != OpConst32 { 24061 break 24062 } 24063 m := mul_0.AuxInt 24064 mul_1 := mul.Args[1] 24065 if mul_1.Op != OpSignExt8to32 || x != mul_1.Args[0] { 24066 break 24067 } 24068 v_0_1_0_1 := v_0_1_0.Args[1] 24069 if v_0_1_0_1.Op != OpConst64 { 24070 break 24071 } 24072 s := v_0_1_0_1.AuxInt 24073 v_0_1_1 := v_0_1.Args[1] 24074 if v_0_1_1.Op != OpRsh32x64 { 24075 break 24076 } 24077 _ = v_0_1_1.Args[1] 24078 v_0_1_1_0 := v_0_1_1.Args[0] 24079 if v_0_1_1_0.Op != OpSignExt8to32 || x != v_0_1_1_0.Args[0] { 24080 break 24081 } 24082 v_0_1_1_1 := v_0_1_1.Args[1] 24083 if v_0_1_1_1.Op != OpConst64 || v_0_1_1_1.AuxInt != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(8, c).m) && s == 8+smagic(8, c).s && x.Op != OpConst8 && sdivisibleOK(8, c)) { 24084 break 24085 } 24086 v.reset(OpLeq8U) 24087 v0 := b.NewValue0(v.Pos, OpRotateLeft8, typ.UInt8) 24088 v1 := b.NewValue0(v.Pos, OpAdd8, typ.UInt8) 24089 v2 := b.NewValue0(v.Pos, OpMul8, typ.UInt8) 24090 v3 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 24091 v3.AuxInt = int64(int8(sdivisible(8, c).m)) 24092 v2.AddArg(v3) 24093 v2.AddArg(x) 24094 v1.AddArg(v2) 24095 v4 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 24096 v4.AuxInt = int64(int8(sdivisible(8, c).a)) 24097 v1.AddArg(v4) 24098 v0.AddArg(v1) 24099 v5 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 24100 v5.AuxInt = int64(8 - sdivisible(8, c).k) 24101 v0.AddArg(v5) 24102 v.AddArg(v0) 24103 v6 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 24104 v6.AuxInt = int64(int8(sdivisible(8, c).max)) 24105 v.AddArg(v6) 24106 return true 24107 } 24108 // match: (Eq8 (Mul8 (Const8 [c]) (Sub8 (Rsh32x64 mul:(Mul32 (SignExt8to32 x) (Const32 [m])) (Const64 [s])) (Rsh32x64 (SignExt8to32 x) (Const64 [31])))) x) 24109 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(8,c).m) && s == 8+smagic(8,c).s && x.Op != OpConst8 && sdivisibleOK(8,c) 24110 // result: (Leq8U (RotateLeft8 <typ.UInt8> (Add8 <typ.UInt8> (Mul8 <typ.UInt8> (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).m))]) x) (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).a))]) ) (Const8 <typ.UInt8> [int64(8-sdivisible(8,c).k)]) ) (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).max))]) ) 24111 for { 24112 x := v.Args[1] 24113 v_0 := v.Args[0] 24114 if v_0.Op != OpMul8 { 24115 break 24116 } 24117 _ = v_0.Args[1] 24118 v_0_0 := v_0.Args[0] 24119 if v_0_0.Op != OpConst8 { 24120 break 24121 } 24122 c := v_0_0.AuxInt 24123 v_0_1 := v_0.Args[1] 24124 if v_0_1.Op != OpSub8 { 24125 break 24126 } 24127 _ = v_0_1.Args[1] 24128 v_0_1_0 := v_0_1.Args[0] 24129 if v_0_1_0.Op != OpRsh32x64 { 24130 break 24131 } 24132 _ = v_0_1_0.Args[1] 24133 mul := v_0_1_0.Args[0] 24134 if mul.Op != OpMul32 { 24135 break 24136 } 24137 _ = mul.Args[1] 24138 mul_0 := mul.Args[0] 24139 if mul_0.Op != OpSignExt8to32 || x != mul_0.Args[0] { 24140 break 24141 } 24142 mul_1 := mul.Args[1] 24143 if mul_1.Op != OpConst32 { 24144 break 24145 } 24146 m := mul_1.AuxInt 24147 v_0_1_0_1 := v_0_1_0.Args[1] 24148 if v_0_1_0_1.Op != OpConst64 { 24149 break 24150 } 24151 s := v_0_1_0_1.AuxInt 24152 v_0_1_1 := v_0_1.Args[1] 24153 if v_0_1_1.Op != OpRsh32x64 { 24154 break 24155 } 24156 _ = v_0_1_1.Args[1] 24157 v_0_1_1_0 := v_0_1_1.Args[0] 24158 if v_0_1_1_0.Op != OpSignExt8to32 || x != v_0_1_1_0.Args[0] { 24159 break 24160 } 24161 v_0_1_1_1 := v_0_1_1.Args[1] 24162 if v_0_1_1_1.Op != OpConst64 || v_0_1_1_1.AuxInt != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(8, c).m) && s == 8+smagic(8, c).s && x.Op != OpConst8 && sdivisibleOK(8, c)) { 24163 break 24164 } 24165 v.reset(OpLeq8U) 24166 v0 := b.NewValue0(v.Pos, OpRotateLeft8, typ.UInt8) 24167 v1 := b.NewValue0(v.Pos, OpAdd8, typ.UInt8) 24168 v2 := b.NewValue0(v.Pos, OpMul8, typ.UInt8) 24169 v3 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 24170 v3.AuxInt = int64(int8(sdivisible(8, c).m)) 24171 v2.AddArg(v3) 24172 v2.AddArg(x) 24173 v1.AddArg(v2) 24174 v4 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 24175 v4.AuxInt = int64(int8(sdivisible(8, c).a)) 24176 v1.AddArg(v4) 24177 v0.AddArg(v1) 24178 v5 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 24179 v5.AuxInt = int64(8 - sdivisible(8, c).k) 24180 v0.AddArg(v5) 24181 v.AddArg(v0) 24182 v6 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 24183 v6.AuxInt = int64(int8(sdivisible(8, c).max)) 24184 v.AddArg(v6) 24185 return true 24186 } 24187 // match: (Eq8 (Mul8 (Sub8 (Rsh32x64 mul:(Mul32 (Const32 [m]) (SignExt8to32 x)) (Const64 [s])) (Rsh32x64 (SignExt8to32 x) (Const64 [31]))) (Const8 [c])) x) 24188 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(8,c).m) && s == 8+smagic(8,c).s && x.Op != OpConst8 && sdivisibleOK(8,c) 24189 // result: (Leq8U (RotateLeft8 <typ.UInt8> (Add8 <typ.UInt8> (Mul8 <typ.UInt8> (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).m))]) x) (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).a))]) ) (Const8 <typ.UInt8> [int64(8-sdivisible(8,c).k)]) ) (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).max))]) ) 24190 for { 24191 x := v.Args[1] 24192 v_0 := v.Args[0] 24193 if v_0.Op != OpMul8 { 24194 break 24195 } 24196 _ = v_0.Args[1] 24197 v_0_0 := v_0.Args[0] 24198 if v_0_0.Op != OpSub8 { 24199 break 24200 } 24201 _ = v_0_0.Args[1] 24202 v_0_0_0 := v_0_0.Args[0] 24203 if v_0_0_0.Op != OpRsh32x64 { 24204 break 24205 } 24206 _ = v_0_0_0.Args[1] 24207 mul := v_0_0_0.Args[0] 24208 if mul.Op != OpMul32 { 24209 break 24210 } 24211 _ = mul.Args[1] 24212 mul_0 := mul.Args[0] 24213 if mul_0.Op != OpConst32 { 24214 break 24215 } 24216 m := mul_0.AuxInt 24217 mul_1 := mul.Args[1] 24218 if mul_1.Op != OpSignExt8to32 || x != mul_1.Args[0] { 24219 break 24220 } 24221 v_0_0_0_1 := v_0_0_0.Args[1] 24222 if v_0_0_0_1.Op != OpConst64 { 24223 break 24224 } 24225 s := v_0_0_0_1.AuxInt 24226 v_0_0_1 := v_0_0.Args[1] 24227 if v_0_0_1.Op != OpRsh32x64 { 24228 break 24229 } 24230 _ = v_0_0_1.Args[1] 24231 v_0_0_1_0 := v_0_0_1.Args[0] 24232 if v_0_0_1_0.Op != OpSignExt8to32 || x != v_0_0_1_0.Args[0] { 24233 break 24234 } 24235 v_0_0_1_1 := v_0_0_1.Args[1] 24236 if v_0_0_1_1.Op != OpConst64 || v_0_0_1_1.AuxInt != 31 { 24237 break 24238 } 24239 v_0_1 := v_0.Args[1] 24240 if v_0_1.Op != OpConst8 { 24241 break 24242 } 24243 c := v_0_1.AuxInt 24244 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(8, c).m) && s == 8+smagic(8, c).s && x.Op != OpConst8 && sdivisibleOK(8, c)) { 24245 break 24246 } 24247 v.reset(OpLeq8U) 24248 v0 := b.NewValue0(v.Pos, OpRotateLeft8, typ.UInt8) 24249 v1 := b.NewValue0(v.Pos, OpAdd8, typ.UInt8) 24250 v2 := b.NewValue0(v.Pos, OpMul8, typ.UInt8) 24251 v3 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 24252 v3.AuxInt = int64(int8(sdivisible(8, c).m)) 24253 v2.AddArg(v3) 24254 v2.AddArg(x) 24255 v1.AddArg(v2) 24256 v4 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 24257 v4.AuxInt = int64(int8(sdivisible(8, c).a)) 24258 v1.AddArg(v4) 24259 v0.AddArg(v1) 24260 v5 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 24261 v5.AuxInt = int64(8 - sdivisible(8, c).k) 24262 v0.AddArg(v5) 24263 v.AddArg(v0) 24264 v6 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 24265 v6.AuxInt = int64(int8(sdivisible(8, c).max)) 24266 v.AddArg(v6) 24267 return true 24268 } 24269 // match: (Eq8 (Mul8 (Sub8 (Rsh32x64 mul:(Mul32 (SignExt8to32 x) (Const32 [m])) (Const64 [s])) (Rsh32x64 (SignExt8to32 x) (Const64 [31]))) (Const8 [c])) x) 24270 // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(8,c).m) && s == 8+smagic(8,c).s && x.Op != OpConst8 && sdivisibleOK(8,c) 24271 // result: (Leq8U (RotateLeft8 <typ.UInt8> (Add8 <typ.UInt8> (Mul8 <typ.UInt8> (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).m))]) x) (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).a))]) ) (Const8 <typ.UInt8> [int64(8-sdivisible(8,c).k)]) ) (Const8 <typ.UInt8> [int64(int8(sdivisible(8,c).max))]) ) 24272 for { 24273 x := v.Args[1] 24274 v_0 := v.Args[0] 24275 if v_0.Op != OpMul8 { 24276 break 24277 } 24278 _ = v_0.Args[1] 24279 v_0_0 := v_0.Args[0] 24280 if v_0_0.Op != OpSub8 { 24281 break 24282 } 24283 _ = v_0_0.Args[1] 24284 v_0_0_0 := v_0_0.Args[0] 24285 if v_0_0_0.Op != OpRsh32x64 { 24286 break 24287 } 24288 _ = v_0_0_0.Args[1] 24289 mul := v_0_0_0.Args[0] 24290 if mul.Op != OpMul32 { 24291 break 24292 } 24293 _ = mul.Args[1] 24294 mul_0 := mul.Args[0] 24295 if mul_0.Op != OpSignExt8to32 || x != mul_0.Args[0] { 24296 break 24297 } 24298 mul_1 := mul.Args[1] 24299 if mul_1.Op != OpConst32 { 24300 break 24301 } 24302 m := mul_1.AuxInt 24303 v_0_0_0_1 := v_0_0_0.Args[1] 24304 if v_0_0_0_1.Op != OpConst64 { 24305 break 24306 } 24307 s := v_0_0_0_1.AuxInt 24308 v_0_0_1 := v_0_0.Args[1] 24309 if v_0_0_1.Op != OpRsh32x64 { 24310 break 24311 } 24312 _ = v_0_0_1.Args[1] 24313 v_0_0_1_0 := v_0_0_1.Args[0] 24314 if v_0_0_1_0.Op != OpSignExt8to32 || x != v_0_0_1_0.Args[0] { 24315 break 24316 } 24317 v_0_0_1_1 := v_0_0_1.Args[1] 24318 if v_0_0_1_1.Op != OpConst64 || v_0_0_1_1.AuxInt != 31 { 24319 break 24320 } 24321 v_0_1 := v_0.Args[1] 24322 if v_0_1.Op != OpConst8 { 24323 break 24324 } 24325 c := v_0_1.AuxInt 24326 if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic(8, c).m) && s == 8+smagic(8, c).s && x.Op != OpConst8 && sdivisibleOK(8, c)) { 24327 break 24328 } 24329 v.reset(OpLeq8U) 24330 v0 := b.NewValue0(v.Pos, OpRotateLeft8, typ.UInt8) 24331 v1 := b.NewValue0(v.Pos, OpAdd8, typ.UInt8) 24332 v2 := b.NewValue0(v.Pos, OpMul8, typ.UInt8) 24333 v3 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 24334 v3.AuxInt = int64(int8(sdivisible(8, c).m)) 24335 v2.AddArg(v3) 24336 v2.AddArg(x) 24337 v1.AddArg(v2) 24338 v4 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 24339 v4.AuxInt = int64(int8(sdivisible(8, c).a)) 24340 v1.AddArg(v4) 24341 v0.AddArg(v1) 24342 v5 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 24343 v5.AuxInt = int64(8 - sdivisible(8, c).k) 24344 v0.AddArg(v5) 24345 v.AddArg(v0) 24346 v6 := b.NewValue0(v.Pos, OpConst8, typ.UInt8) 24347 v6.AuxInt = int64(int8(sdivisible(8, c).max)) 24348 v.AddArg(v6) 24349 return true 24350 } 24351 // match: (Eq8 n (Lsh8x64 (Rsh8x64 (Add8 <t> n (Rsh8Ux64 <t> (Rsh8x64 <t> n (Const64 <typ.UInt64> [ 7])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k]))) 24352 // cond: k > 0 && k < 7 && kbar == 8 - k 24353 // result: (Eq8 (And8 <t> n (Const8 <t> [int64(1<<uint(k)-1)])) (Const8 <t> [0])) 24354 for { 24355 _ = v.Args[1] 24356 n := v.Args[0] 24357 v_1 := v.Args[1] 24358 if v_1.Op != OpLsh8x64 { 24359 break 24360 } 24361 _ = v_1.Args[1] 24362 v_1_0 := v_1.Args[0] 24363 if v_1_0.Op != OpRsh8x64 { 24364 break 24365 } 24366 _ = v_1_0.Args[1] 24367 v_1_0_0 := v_1_0.Args[0] 24368 if v_1_0_0.Op != OpAdd8 { 24369 break 24370 } 24371 t := v_1_0_0.Type 24372 _ = v_1_0_0.Args[1] 24373 if n != v_1_0_0.Args[0] { 24374 break 24375 } 24376 v_1_0_0_1 := v_1_0_0.Args[1] 24377 if v_1_0_0_1.Op != OpRsh8Ux64 || v_1_0_0_1.Type != t { 24378 break 24379 } 24380 _ = v_1_0_0_1.Args[1] 24381 v_1_0_0_1_0 := v_1_0_0_1.Args[0] 24382 if v_1_0_0_1_0.Op != OpRsh8x64 || v_1_0_0_1_0.Type != t { 24383 break 24384 } 24385 _ = v_1_0_0_1_0.Args[1] 24386 if n != v_1_0_0_1_0.Args[0] { 24387 break 24388 } 24389 v_1_0_0_1_0_1 := v_1_0_0_1_0.Args[1] 24390 if v_1_0_0_1_0_1.Op != OpConst64 || v_1_0_0_1_0_1.Type != typ.UInt64 || v_1_0_0_1_0_1.AuxInt != 7 { 24391 break 24392 } 24393 v_1_0_0_1_1 := v_1_0_0_1.Args[1] 24394 if v_1_0_0_1_1.Op != OpConst64 || v_1_0_0_1_1.Type != typ.UInt64 { 24395 break 24396 } 24397 kbar := v_1_0_0_1_1.AuxInt 24398 v_1_0_1 := v_1_0.Args[1] 24399 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 { 24400 break 24401 } 24402 k := v_1_0_1.AuxInt 24403 v_1_1 := v_1.Args[1] 24404 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || v_1_1.AuxInt != k || !(k > 0 && k < 7 && kbar == 8-k) { 24405 break 24406 } 24407 v.reset(OpEq8) 24408 v0 := b.NewValue0(v.Pos, OpAnd8, t) 24409 v0.AddArg(n) 24410 v1 := b.NewValue0(v.Pos, OpConst8, t) 24411 v1.AuxInt = int64(1<<uint(k) - 1) 24412 v0.AddArg(v1) 24413 v.AddArg(v0) 24414 v2 := b.NewValue0(v.Pos, OpConst8, t) 24415 v2.AuxInt = 0 24416 v.AddArg(v2) 24417 return true 24418 } 24419 // match: (Eq8 n (Lsh8x64 (Rsh8x64 (Add8 <t> (Rsh8Ux64 <t> (Rsh8x64 <t> n (Const64 <typ.UInt64> [ 7])) (Const64 <typ.UInt64> [kbar])) n) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k]))) 24420 // cond: k > 0 && k < 7 && kbar == 8 - k 24421 // result: (Eq8 (And8 <t> n (Const8 <t> [int64(1<<uint(k)-1)])) (Const8 <t> [0])) 24422 for { 24423 _ = v.Args[1] 24424 n := v.Args[0] 24425 v_1 := v.Args[1] 24426 if v_1.Op != OpLsh8x64 { 24427 break 24428 } 24429 _ = v_1.Args[1] 24430 v_1_0 := v_1.Args[0] 24431 if v_1_0.Op != OpRsh8x64 { 24432 break 24433 } 24434 _ = v_1_0.Args[1] 24435 v_1_0_0 := v_1_0.Args[0] 24436 if v_1_0_0.Op != OpAdd8 { 24437 break 24438 } 24439 t := v_1_0_0.Type 24440 _ = v_1_0_0.Args[1] 24441 v_1_0_0_0 := v_1_0_0.Args[0] 24442 if v_1_0_0_0.Op != OpRsh8Ux64 || v_1_0_0_0.Type != t { 24443 break 24444 } 24445 _ = v_1_0_0_0.Args[1] 24446 v_1_0_0_0_0 := v_1_0_0_0.Args[0] 24447 if v_1_0_0_0_0.Op != OpRsh8x64 || v_1_0_0_0_0.Type != t { 24448 break 24449 } 24450 _ = v_1_0_0_0_0.Args[1] 24451 if n != v_1_0_0_0_0.Args[0] { 24452 break 24453 } 24454 v_1_0_0_0_0_1 := v_1_0_0_0_0.Args[1] 24455 if v_1_0_0_0_0_1.Op != OpConst64 || v_1_0_0_0_0_1.Type != typ.UInt64 || v_1_0_0_0_0_1.AuxInt != 7 { 24456 break 24457 } 24458 v_1_0_0_0_1 := v_1_0_0_0.Args[1] 24459 if v_1_0_0_0_1.Op != OpConst64 || v_1_0_0_0_1.Type != typ.UInt64 { 24460 break 24461 } 24462 kbar := v_1_0_0_0_1.AuxInt 24463 if n != v_1_0_0.Args[1] { 24464 break 24465 } 24466 v_1_0_1 := v_1_0.Args[1] 24467 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 { 24468 break 24469 } 24470 k := v_1_0_1.AuxInt 24471 v_1_1 := v_1.Args[1] 24472 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || v_1_1.AuxInt != k || !(k > 0 && k < 7 && kbar == 8-k) { 24473 break 24474 } 24475 v.reset(OpEq8) 24476 v0 := b.NewValue0(v.Pos, OpAnd8, t) 24477 v0.AddArg(n) 24478 v1 := b.NewValue0(v.Pos, OpConst8, t) 24479 v1.AuxInt = int64(1<<uint(k) - 1) 24480 v0.AddArg(v1) 24481 v.AddArg(v0) 24482 v2 := b.NewValue0(v.Pos, OpConst8, t) 24483 v2.AuxInt = 0 24484 v.AddArg(v2) 24485 return true 24486 } 24487 // match: (Eq8 (Lsh8x64 (Rsh8x64 (Add8 <t> n (Rsh8Ux64 <t> (Rsh8x64 <t> n (Const64 <typ.UInt64> [ 7])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) n) 24488 // cond: k > 0 && k < 7 && kbar == 8 - k 24489 // result: (Eq8 (And8 <t> n (Const8 <t> [int64(1<<uint(k)-1)])) (Const8 <t> [0])) 24490 for { 24491 n := v.Args[1] 24492 v_0 := v.Args[0] 24493 if v_0.Op != OpLsh8x64 { 24494 break 24495 } 24496 _ = v_0.Args[1] 24497 v_0_0 := v_0.Args[0] 24498 if v_0_0.Op != OpRsh8x64 { 24499 break 24500 } 24501 _ = v_0_0.Args[1] 24502 v_0_0_0 := v_0_0.Args[0] 24503 if v_0_0_0.Op != OpAdd8 { 24504 break 24505 } 24506 t := v_0_0_0.Type 24507 _ = v_0_0_0.Args[1] 24508 if n != v_0_0_0.Args[0] { 24509 break 24510 } 24511 v_0_0_0_1 := v_0_0_0.Args[1] 24512 if v_0_0_0_1.Op != OpRsh8Ux64 || v_0_0_0_1.Type != t { 24513 break 24514 } 24515 _ = v_0_0_0_1.Args[1] 24516 v_0_0_0_1_0 := v_0_0_0_1.Args[0] 24517 if v_0_0_0_1_0.Op != OpRsh8x64 || v_0_0_0_1_0.Type != t { 24518 break 24519 } 24520 _ = v_0_0_0_1_0.Args[1] 24521 if n != v_0_0_0_1_0.Args[0] { 24522 break 24523 } 24524 v_0_0_0_1_0_1 := v_0_0_0_1_0.Args[1] 24525 if v_0_0_0_1_0_1.Op != OpConst64 || v_0_0_0_1_0_1.Type != typ.UInt64 || v_0_0_0_1_0_1.AuxInt != 7 { 24526 break 24527 } 24528 v_0_0_0_1_1 := v_0_0_0_1.Args[1] 24529 if v_0_0_0_1_1.Op != OpConst64 || v_0_0_0_1_1.Type != typ.UInt64 { 24530 break 24531 } 24532 kbar := v_0_0_0_1_1.AuxInt 24533 v_0_0_1 := v_0_0.Args[1] 24534 if v_0_0_1.Op != OpConst64 || v_0_0_1.Type != typ.UInt64 { 24535 break 24536 } 24537 k := v_0_0_1.AuxInt 24538 v_0_1 := v_0.Args[1] 24539 if v_0_1.Op != OpConst64 || v_0_1.Type != typ.UInt64 || v_0_1.AuxInt != k || !(k > 0 && k < 7 && kbar == 8-k) { 24540 break 24541 } 24542 v.reset(OpEq8) 24543 v0 := b.NewValue0(v.Pos, OpAnd8, t) 24544 v0.AddArg(n) 24545 v1 := b.NewValue0(v.Pos, OpConst8, t) 24546 v1.AuxInt = int64(1<<uint(k) - 1) 24547 v0.AddArg(v1) 24548 v.AddArg(v0) 24549 v2 := b.NewValue0(v.Pos, OpConst8, t) 24550 v2.AuxInt = 0 24551 v.AddArg(v2) 24552 return true 24553 } 24554 return false 24555 } 24556 func rewriteValuegeneric_OpEq8_30(v *Value) bool { 24557 b := v.Block 24558 typ := &b.Func.Config.Types 24559 // match: (Eq8 (Lsh8x64 (Rsh8x64 (Add8 <t> (Rsh8Ux64 <t> (Rsh8x64 <t> n (Const64 <typ.UInt64> [ 7])) (Const64 <typ.UInt64> [kbar])) n) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) n) 24560 // cond: k > 0 && k < 7 && kbar == 8 - k 24561 // result: (Eq8 (And8 <t> n (Const8 <t> [int64(1<<uint(k)-1)])) (Const8 <t> [0])) 24562 for { 24563 n := v.Args[1] 24564 v_0 := v.Args[0] 24565 if v_0.Op != OpLsh8x64 { 24566 break 24567 } 24568 _ = v_0.Args[1] 24569 v_0_0 := v_0.Args[0] 24570 if v_0_0.Op != OpRsh8x64 { 24571 break 24572 } 24573 _ = v_0_0.Args[1] 24574 v_0_0_0 := v_0_0.Args[0] 24575 if v_0_0_0.Op != OpAdd8 { 24576 break 24577 } 24578 t := v_0_0_0.Type 24579 _ = v_0_0_0.Args[1] 24580 v_0_0_0_0 := v_0_0_0.Args[0] 24581 if v_0_0_0_0.Op != OpRsh8Ux64 || v_0_0_0_0.Type != t { 24582 break 24583 } 24584 _ = v_0_0_0_0.Args[1] 24585 v_0_0_0_0_0 := v_0_0_0_0.Args[0] 24586 if v_0_0_0_0_0.Op != OpRsh8x64 || v_0_0_0_0_0.Type != t { 24587 break 24588 } 24589 _ = v_0_0_0_0_0.Args[1] 24590 if n != v_0_0_0_0_0.Args[0] { 24591 break 24592 } 24593 v_0_0_0_0_0_1 := v_0_0_0_0_0.Args[1] 24594 if v_0_0_0_0_0_1.Op != OpConst64 || v_0_0_0_0_0_1.Type != typ.UInt64 || v_0_0_0_0_0_1.AuxInt != 7 { 24595 break 24596 } 24597 v_0_0_0_0_1 := v_0_0_0_0.Args[1] 24598 if v_0_0_0_0_1.Op != OpConst64 || v_0_0_0_0_1.Type != typ.UInt64 { 24599 break 24600 } 24601 kbar := v_0_0_0_0_1.AuxInt 24602 if n != v_0_0_0.Args[1] { 24603 break 24604 } 24605 v_0_0_1 := v_0_0.Args[1] 24606 if v_0_0_1.Op != OpConst64 || v_0_0_1.Type != typ.UInt64 { 24607 break 24608 } 24609 k := v_0_0_1.AuxInt 24610 v_0_1 := v_0.Args[1] 24611 if v_0_1.Op != OpConst64 || v_0_1.Type != typ.UInt64 || v_0_1.AuxInt != k || !(k > 0 && k < 7 && kbar == 8-k) { 24612 break 24613 } 24614 v.reset(OpEq8) 24615 v0 := b.NewValue0(v.Pos, OpAnd8, t) 24616 v0.AddArg(n) 24617 v1 := b.NewValue0(v.Pos, OpConst8, t) 24618 v1.AuxInt = int64(1<<uint(k) - 1) 24619 v0.AddArg(v1) 24620 v.AddArg(v0) 24621 v2 := b.NewValue0(v.Pos, OpConst8, t) 24622 v2.AuxInt = 0 24623 v.AddArg(v2) 24624 return true 24625 } 24626 // match: (Eq8 s:(Sub8 x y) (Const8 [0])) 24627 // cond: s.Uses == 1 24628 // result: (Eq8 x y) 24629 for { 24630 _ = v.Args[1] 24631 s := v.Args[0] 24632 if s.Op != OpSub8 { 24633 break 24634 } 24635 y := s.Args[1] 24636 x := s.Args[0] 24637 v_1 := v.Args[1] 24638 if v_1.Op != OpConst8 || v_1.AuxInt != 0 || !(s.Uses == 1) { 24639 break 24640 } 24641 v.reset(OpEq8) 24642 v.AddArg(x) 24643 v.AddArg(y) 24644 return true 24645 } 24646 // match: (Eq8 (Const8 [0]) s:(Sub8 x y)) 24647 // cond: s.Uses == 1 24648 // result: (Eq8 x y) 24649 for { 24650 _ = v.Args[1] 24651 v_0 := v.Args[0] 24652 if v_0.Op != OpConst8 || v_0.AuxInt != 0 { 24653 break 24654 } 24655 s := v.Args[1] 24656 if s.Op != OpSub8 { 24657 break 24658 } 24659 y := s.Args[1] 24660 x := s.Args[0] 24661 if !(s.Uses == 1) { 24662 break 24663 } 24664 v.reset(OpEq8) 24665 v.AddArg(x) 24666 v.AddArg(y) 24667 return true 24668 } 24669 // match: (Eq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [y])) 24670 // cond: isPowerOfTwo(y) 24671 // result: (Neq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [0])) 24672 for { 24673 _ = v.Args[1] 24674 v_0 := v.Args[0] 24675 if v_0.Op != OpAnd8 { 24676 break 24677 } 24678 t := v_0.Type 24679 _ = v_0.Args[1] 24680 x := v_0.Args[0] 24681 v_0_1 := v_0.Args[1] 24682 if v_0_1.Op != OpConst8 || v_0_1.Type != t { 24683 break 24684 } 24685 y := v_0_1.AuxInt 24686 v_1 := v.Args[1] 24687 if v_1.Op != OpConst8 || v_1.Type != t || v_1.AuxInt != y || !(isPowerOfTwo(y)) { 24688 break 24689 } 24690 v.reset(OpNeq8) 24691 v0 := b.NewValue0(v.Pos, OpAnd8, t) 24692 v0.AddArg(x) 24693 v1 := b.NewValue0(v.Pos, OpConst8, t) 24694 v1.AuxInt = y 24695 v0.AddArg(v1) 24696 v.AddArg(v0) 24697 v2 := b.NewValue0(v.Pos, OpConst8, t) 24698 v2.AuxInt = 0 24699 v.AddArg(v2) 24700 return true 24701 } 24702 // match: (Eq8 (And8 <t> (Const8 <t> [y]) x) (Const8 <t> [y])) 24703 // cond: isPowerOfTwo(y) 24704 // result: (Neq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [0])) 24705 for { 24706 _ = v.Args[1] 24707 v_0 := v.Args[0] 24708 if v_0.Op != OpAnd8 { 24709 break 24710 } 24711 t := v_0.Type 24712 x := v_0.Args[1] 24713 v_0_0 := v_0.Args[0] 24714 if v_0_0.Op != OpConst8 || v_0_0.Type != t { 24715 break 24716 } 24717 y := v_0_0.AuxInt 24718 v_1 := v.Args[1] 24719 if v_1.Op != OpConst8 || v_1.Type != t || v_1.AuxInt != y || !(isPowerOfTwo(y)) { 24720 break 24721 } 24722 v.reset(OpNeq8) 24723 v0 := b.NewValue0(v.Pos, OpAnd8, t) 24724 v0.AddArg(x) 24725 v1 := b.NewValue0(v.Pos, OpConst8, t) 24726 v1.AuxInt = y 24727 v0.AddArg(v1) 24728 v.AddArg(v0) 24729 v2 := b.NewValue0(v.Pos, OpConst8, t) 24730 v2.AuxInt = 0 24731 v.AddArg(v2) 24732 return true 24733 } 24734 // match: (Eq8 (Const8 <t> [y]) (And8 <t> x (Const8 <t> [y]))) 24735 // cond: isPowerOfTwo(y) 24736 // result: (Neq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [0])) 24737 for { 24738 _ = v.Args[1] 24739 v_0 := v.Args[0] 24740 if v_0.Op != OpConst8 { 24741 break 24742 } 24743 t := v_0.Type 24744 y := v_0.AuxInt 24745 v_1 := v.Args[1] 24746 if v_1.Op != OpAnd8 || v_1.Type != t { 24747 break 24748 } 24749 _ = v_1.Args[1] 24750 x := v_1.Args[0] 24751 v_1_1 := v_1.Args[1] 24752 if v_1_1.Op != OpConst8 || v_1_1.Type != t || v_1_1.AuxInt != y || !(isPowerOfTwo(y)) { 24753 break 24754 } 24755 v.reset(OpNeq8) 24756 v0 := b.NewValue0(v.Pos, OpAnd8, t) 24757 v0.AddArg(x) 24758 v1 := b.NewValue0(v.Pos, OpConst8, t) 24759 v1.AuxInt = y 24760 v0.AddArg(v1) 24761 v.AddArg(v0) 24762 v2 := b.NewValue0(v.Pos, OpConst8, t) 24763 v2.AuxInt = 0 24764 v.AddArg(v2) 24765 return true 24766 } 24767 // match: (Eq8 (Const8 <t> [y]) (And8 <t> (Const8 <t> [y]) x)) 24768 // cond: isPowerOfTwo(y) 24769 // result: (Neq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [0])) 24770 for { 24771 _ = v.Args[1] 24772 v_0 := v.Args[0] 24773 if v_0.Op != OpConst8 { 24774 break 24775 } 24776 t := v_0.Type 24777 y := v_0.AuxInt 24778 v_1 := v.Args[1] 24779 if v_1.Op != OpAnd8 || v_1.Type != t { 24780 break 24781 } 24782 x := v_1.Args[1] 24783 v_1_0 := v_1.Args[0] 24784 if v_1_0.Op != OpConst8 || v_1_0.Type != t || v_1_0.AuxInt != y || !(isPowerOfTwo(y)) { 24785 break 24786 } 24787 v.reset(OpNeq8) 24788 v0 := b.NewValue0(v.Pos, OpAnd8, t) 24789 v0.AddArg(x) 24790 v1 := b.NewValue0(v.Pos, OpConst8, t) 24791 v1.AuxInt = y 24792 v0.AddArg(v1) 24793 v.AddArg(v0) 24794 v2 := b.NewValue0(v.Pos, OpConst8, t) 24795 v2.AuxInt = 0 24796 v.AddArg(v2) 24797 return true 24798 } 24799 return false 24800 } 24801 func rewriteValuegeneric_OpEqB_0(v *Value) bool { 24802 // match: (EqB (ConstBool [c]) (ConstBool [d])) 24803 // result: (ConstBool [b2i(c == d)]) 24804 for { 24805 _ = v.Args[1] 24806 v_0 := v.Args[0] 24807 if v_0.Op != OpConstBool { 24808 break 24809 } 24810 c := v_0.AuxInt 24811 v_1 := v.Args[1] 24812 if v_1.Op != OpConstBool { 24813 break 24814 } 24815 d := v_1.AuxInt 24816 v.reset(OpConstBool) 24817 v.AuxInt = b2i(c == d) 24818 return true 24819 } 24820 // match: (EqB (ConstBool [d]) (ConstBool [c])) 24821 // result: (ConstBool [b2i(c == d)]) 24822 for { 24823 _ = v.Args[1] 24824 v_0 := v.Args[0] 24825 if v_0.Op != OpConstBool { 24826 break 24827 } 24828 d := v_0.AuxInt 24829 v_1 := v.Args[1] 24830 if v_1.Op != OpConstBool { 24831 break 24832 } 24833 c := v_1.AuxInt 24834 v.reset(OpConstBool) 24835 v.AuxInt = b2i(c == d) 24836 return true 24837 } 24838 // match: (EqB (ConstBool [0]) x) 24839 // result: (Not x) 24840 for { 24841 x := v.Args[1] 24842 v_0 := v.Args[0] 24843 if v_0.Op != OpConstBool || v_0.AuxInt != 0 { 24844 break 24845 } 24846 v.reset(OpNot) 24847 v.AddArg(x) 24848 return true 24849 } 24850 // match: (EqB x (ConstBool [0])) 24851 // result: (Not x) 24852 for { 24853 _ = v.Args[1] 24854 x := v.Args[0] 24855 v_1 := v.Args[1] 24856 if v_1.Op != OpConstBool || v_1.AuxInt != 0 { 24857 break 24858 } 24859 v.reset(OpNot) 24860 v.AddArg(x) 24861 return true 24862 } 24863 // match: (EqB (ConstBool [1]) x) 24864 // result: x 24865 for { 24866 x := v.Args[1] 24867 v_0 := v.Args[0] 24868 if v_0.Op != OpConstBool || v_0.AuxInt != 1 { 24869 break 24870 } 24871 v.reset(OpCopy) 24872 v.Type = x.Type 24873 v.AddArg(x) 24874 return true 24875 } 24876 // match: (EqB x (ConstBool [1])) 24877 // result: x 24878 for { 24879 _ = v.Args[1] 24880 x := v.Args[0] 24881 v_1 := v.Args[1] 24882 if v_1.Op != OpConstBool || v_1.AuxInt != 1 { 24883 break 24884 } 24885 v.reset(OpCopy) 24886 v.Type = x.Type 24887 v.AddArg(x) 24888 return true 24889 } 24890 return false 24891 } 24892 func rewriteValuegeneric_OpEqInter_0(v *Value) bool { 24893 b := v.Block 24894 typ := &b.Func.Config.Types 24895 // match: (EqInter x y) 24896 // result: (EqPtr (ITab x) (ITab y)) 24897 for { 24898 y := v.Args[1] 24899 x := v.Args[0] 24900 v.reset(OpEqPtr) 24901 v0 := b.NewValue0(v.Pos, OpITab, typ.Uintptr) 24902 v0.AddArg(x) 24903 v.AddArg(v0) 24904 v1 := b.NewValue0(v.Pos, OpITab, typ.Uintptr) 24905 v1.AddArg(y) 24906 v.AddArg(v1) 24907 return true 24908 } 24909 } 24910 func rewriteValuegeneric_OpEqPtr_0(v *Value) bool { 24911 // match: (EqPtr x x) 24912 // result: (ConstBool [1]) 24913 for { 24914 x := v.Args[1] 24915 if x != v.Args[0] { 24916 break 24917 } 24918 v.reset(OpConstBool) 24919 v.AuxInt = 1 24920 return true 24921 } 24922 // match: (EqPtr (Addr {a} _) (Addr {b} _)) 24923 // result: (ConstBool [b2i(a == b)]) 24924 for { 24925 _ = v.Args[1] 24926 v_0 := v.Args[0] 24927 if v_0.Op != OpAddr { 24928 break 24929 } 24930 a := v_0.Aux 24931 v_1 := v.Args[1] 24932 if v_1.Op != OpAddr { 24933 break 24934 } 24935 b := v_1.Aux 24936 v.reset(OpConstBool) 24937 v.AuxInt = b2i(a == b) 24938 return true 24939 } 24940 // match: (EqPtr (Addr {b} _) (Addr {a} _)) 24941 // result: (ConstBool [b2i(a == b)]) 24942 for { 24943 _ = v.Args[1] 24944 v_0 := v.Args[0] 24945 if v_0.Op != OpAddr { 24946 break 24947 } 24948 b := v_0.Aux 24949 v_1 := v.Args[1] 24950 if v_1.Op != OpAddr { 24951 break 24952 } 24953 a := v_1.Aux 24954 v.reset(OpConstBool) 24955 v.AuxInt = b2i(a == b) 24956 return true 24957 } 24958 // match: (EqPtr (Addr {a} _) (OffPtr [o] (Addr {b} _))) 24959 // result: (ConstBool [b2i(a == b && o == 0)]) 24960 for { 24961 _ = v.Args[1] 24962 v_0 := v.Args[0] 24963 if v_0.Op != OpAddr { 24964 break 24965 } 24966 a := v_0.Aux 24967 v_1 := v.Args[1] 24968 if v_1.Op != OpOffPtr { 24969 break 24970 } 24971 o := v_1.AuxInt 24972 v_1_0 := v_1.Args[0] 24973 if v_1_0.Op != OpAddr { 24974 break 24975 } 24976 b := v_1_0.Aux 24977 v.reset(OpConstBool) 24978 v.AuxInt = b2i(a == b && o == 0) 24979 return true 24980 } 24981 // match: (EqPtr (OffPtr [o] (Addr {b} _)) (Addr {a} _)) 24982 // result: (ConstBool [b2i(a == b && o == 0)]) 24983 for { 24984 _ = v.Args[1] 24985 v_0 := v.Args[0] 24986 if v_0.Op != OpOffPtr { 24987 break 24988 } 24989 o := v_0.AuxInt 24990 v_0_0 := v_0.Args[0] 24991 if v_0_0.Op != OpAddr { 24992 break 24993 } 24994 b := v_0_0.Aux 24995 v_1 := v.Args[1] 24996 if v_1.Op != OpAddr { 24997 break 24998 } 24999 a := v_1.Aux 25000 v.reset(OpConstBool) 25001 v.AuxInt = b2i(a == b && o == 0) 25002 return true 25003 } 25004 // match: (EqPtr (OffPtr [o1] (Addr {a} _)) (OffPtr [o2] (Addr {b} _))) 25005 // result: (ConstBool [b2i(a == b && o1 == o2)]) 25006 for { 25007 _ = v.Args[1] 25008 v_0 := v.Args[0] 25009 if v_0.Op != OpOffPtr { 25010 break 25011 } 25012 o1 := v_0.AuxInt 25013 v_0_0 := v_0.Args[0] 25014 if v_0_0.Op != OpAddr { 25015 break 25016 } 25017 a := v_0_0.Aux 25018 v_1 := v.Args[1] 25019 if v_1.Op != OpOffPtr { 25020 break 25021 } 25022 o2 := v_1.AuxInt 25023 v_1_0 := v_1.Args[0] 25024 if v_1_0.Op != OpAddr { 25025 break 25026 } 25027 b := v_1_0.Aux 25028 v.reset(OpConstBool) 25029 v.AuxInt = b2i(a == b && o1 == o2) 25030 return true 25031 } 25032 // match: (EqPtr (OffPtr [o2] (Addr {b} _)) (OffPtr [o1] (Addr {a} _))) 25033 // result: (ConstBool [b2i(a == b && o1 == o2)]) 25034 for { 25035 _ = v.Args[1] 25036 v_0 := v.Args[0] 25037 if v_0.Op != OpOffPtr { 25038 break 25039 } 25040 o2 := v_0.AuxInt 25041 v_0_0 := v_0.Args[0] 25042 if v_0_0.Op != OpAddr { 25043 break 25044 } 25045 b := v_0_0.Aux 25046 v_1 := v.Args[1] 25047 if v_1.Op != OpOffPtr { 25048 break 25049 } 25050 o1 := v_1.AuxInt 25051 v_1_0 := v_1.Args[0] 25052 if v_1_0.Op != OpAddr { 25053 break 25054 } 25055 a := v_1_0.Aux 25056 v.reset(OpConstBool) 25057 v.AuxInt = b2i(a == b && o1 == o2) 25058 return true 25059 } 25060 // match: (EqPtr (LocalAddr {a} _ _) (LocalAddr {b} _ _)) 25061 // result: (ConstBool [b2i(a == b)]) 25062 for { 25063 _ = v.Args[1] 25064 v_0 := v.Args[0] 25065 if v_0.Op != OpLocalAddr { 25066 break 25067 } 25068 a := v_0.Aux 25069 _ = v_0.Args[1] 25070 v_1 := v.Args[1] 25071 if v_1.Op != OpLocalAddr { 25072 break 25073 } 25074 b := v_1.Aux 25075 _ = v_1.Args[1] 25076 v.reset(OpConstBool) 25077 v.AuxInt = b2i(a == b) 25078 return true 25079 } 25080 // match: (EqPtr (LocalAddr {b} _ _) (LocalAddr {a} _ _)) 25081 // result: (ConstBool [b2i(a == b)]) 25082 for { 25083 _ = v.Args[1] 25084 v_0 := v.Args[0] 25085 if v_0.Op != OpLocalAddr { 25086 break 25087 } 25088 b := v_0.Aux 25089 _ = v_0.Args[1] 25090 v_1 := v.Args[1] 25091 if v_1.Op != OpLocalAddr { 25092 break 25093 } 25094 a := v_1.Aux 25095 _ = v_1.Args[1] 25096 v.reset(OpConstBool) 25097 v.AuxInt = b2i(a == b) 25098 return true 25099 } 25100 // match: (EqPtr (LocalAddr {a} _ _) (OffPtr [o] (LocalAddr {b} _ _))) 25101 // result: (ConstBool [b2i(a == b && o == 0)]) 25102 for { 25103 _ = v.Args[1] 25104 v_0 := v.Args[0] 25105 if v_0.Op != OpLocalAddr { 25106 break 25107 } 25108 a := v_0.Aux 25109 _ = v_0.Args[1] 25110 v_1 := v.Args[1] 25111 if v_1.Op != OpOffPtr { 25112 break 25113 } 25114 o := v_1.AuxInt 25115 v_1_0 := v_1.Args[0] 25116 if v_1_0.Op != OpLocalAddr { 25117 break 25118 } 25119 b := v_1_0.Aux 25120 _ = v_1_0.Args[1] 25121 v.reset(OpConstBool) 25122 v.AuxInt = b2i(a == b && o == 0) 25123 return true 25124 } 25125 return false 25126 } 25127 func rewriteValuegeneric_OpEqPtr_10(v *Value) bool { 25128 // match: (EqPtr (OffPtr [o] (LocalAddr {b} _ _)) (LocalAddr {a} _ _)) 25129 // result: (ConstBool [b2i(a == b && o == 0)]) 25130 for { 25131 _ = v.Args[1] 25132 v_0 := v.Args[0] 25133 if v_0.Op != OpOffPtr { 25134 break 25135 } 25136 o := v_0.AuxInt 25137 v_0_0 := v_0.Args[0] 25138 if v_0_0.Op != OpLocalAddr { 25139 break 25140 } 25141 b := v_0_0.Aux 25142 _ = v_0_0.Args[1] 25143 v_1 := v.Args[1] 25144 if v_1.Op != OpLocalAddr { 25145 break 25146 } 25147 a := v_1.Aux 25148 _ = v_1.Args[1] 25149 v.reset(OpConstBool) 25150 v.AuxInt = b2i(a == b && o == 0) 25151 return true 25152 } 25153 // match: (EqPtr (OffPtr [o1] (LocalAddr {a} _ _)) (OffPtr [o2] (LocalAddr {b} _ _))) 25154 // result: (ConstBool [b2i(a == b && o1 == o2)]) 25155 for { 25156 _ = v.Args[1] 25157 v_0 := v.Args[0] 25158 if v_0.Op != OpOffPtr { 25159 break 25160 } 25161 o1 := v_0.AuxInt 25162 v_0_0 := v_0.Args[0] 25163 if v_0_0.Op != OpLocalAddr { 25164 break 25165 } 25166 a := v_0_0.Aux 25167 _ = v_0_0.Args[1] 25168 v_1 := v.Args[1] 25169 if v_1.Op != OpOffPtr { 25170 break 25171 } 25172 o2 := v_1.AuxInt 25173 v_1_0 := v_1.Args[0] 25174 if v_1_0.Op != OpLocalAddr { 25175 break 25176 } 25177 b := v_1_0.Aux 25178 _ = v_1_0.Args[1] 25179 v.reset(OpConstBool) 25180 v.AuxInt = b2i(a == b && o1 == o2) 25181 return true 25182 } 25183 // match: (EqPtr (OffPtr [o2] (LocalAddr {b} _ _)) (OffPtr [o1] (LocalAddr {a} _ _))) 25184 // result: (ConstBool [b2i(a == b && o1 == o2)]) 25185 for { 25186 _ = v.Args[1] 25187 v_0 := v.Args[0] 25188 if v_0.Op != OpOffPtr { 25189 break 25190 } 25191 o2 := v_0.AuxInt 25192 v_0_0 := v_0.Args[0] 25193 if v_0_0.Op != OpLocalAddr { 25194 break 25195 } 25196 b := v_0_0.Aux 25197 _ = v_0_0.Args[1] 25198 v_1 := v.Args[1] 25199 if v_1.Op != OpOffPtr { 25200 break 25201 } 25202 o1 := v_1.AuxInt 25203 v_1_0 := v_1.Args[0] 25204 if v_1_0.Op != OpLocalAddr { 25205 break 25206 } 25207 a := v_1_0.Aux 25208 _ = v_1_0.Args[1] 25209 v.reset(OpConstBool) 25210 v.AuxInt = b2i(a == b && o1 == o2) 25211 return true 25212 } 25213 // match: (EqPtr (OffPtr [o1] p1) p2) 25214 // cond: isSamePtr(p1, p2) 25215 // result: (ConstBool [b2i(o1 == 0)]) 25216 for { 25217 p2 := v.Args[1] 25218 v_0 := v.Args[0] 25219 if v_0.Op != OpOffPtr { 25220 break 25221 } 25222 o1 := v_0.AuxInt 25223 p1 := v_0.Args[0] 25224 if !(isSamePtr(p1, p2)) { 25225 break 25226 } 25227 v.reset(OpConstBool) 25228 v.AuxInt = b2i(o1 == 0) 25229 return true 25230 } 25231 // match: (EqPtr p2 (OffPtr [o1] p1)) 25232 // cond: isSamePtr(p1, p2) 25233 // result: (ConstBool [b2i(o1 == 0)]) 25234 for { 25235 _ = v.Args[1] 25236 p2 := v.Args[0] 25237 v_1 := v.Args[1] 25238 if v_1.Op != OpOffPtr { 25239 break 25240 } 25241 o1 := v_1.AuxInt 25242 p1 := v_1.Args[0] 25243 if !(isSamePtr(p1, p2)) { 25244 break 25245 } 25246 v.reset(OpConstBool) 25247 v.AuxInt = b2i(o1 == 0) 25248 return true 25249 } 25250 // match: (EqPtr (OffPtr [o1] p1) (OffPtr [o2] p2)) 25251 // cond: isSamePtr(p1, p2) 25252 // result: (ConstBool [b2i(o1 == o2)]) 25253 for { 25254 _ = v.Args[1] 25255 v_0 := v.Args[0] 25256 if v_0.Op != OpOffPtr { 25257 break 25258 } 25259 o1 := v_0.AuxInt 25260 p1 := v_0.Args[0] 25261 v_1 := v.Args[1] 25262 if v_1.Op != OpOffPtr { 25263 break 25264 } 25265 o2 := v_1.AuxInt 25266 p2 := v_1.Args[0] 25267 if !(isSamePtr(p1, p2)) { 25268 break 25269 } 25270 v.reset(OpConstBool) 25271 v.AuxInt = b2i(o1 == o2) 25272 return true 25273 } 25274 // match: (EqPtr (OffPtr [o2] p2) (OffPtr [o1] p1)) 25275 // cond: isSamePtr(p1, p2) 25276 // result: (ConstBool [b2i(o1 == o2)]) 25277 for { 25278 _ = v.Args[1] 25279 v_0 := v.Args[0] 25280 if v_0.Op != OpOffPtr { 25281 break 25282 } 25283 o2 := v_0.AuxInt 25284 p2 := v_0.Args[0] 25285 v_1 := v.Args[1] 25286 if v_1.Op != OpOffPtr { 25287 break 25288 } 25289 o1 := v_1.AuxInt 25290 p1 := v_1.Args[0] 25291 if !(isSamePtr(p1, p2)) { 25292 break 25293 } 25294 v.reset(OpConstBool) 25295 v.AuxInt = b2i(o1 == o2) 25296 return true 25297 } 25298 // match: (EqPtr (Const32 [c]) (Const32 [d])) 25299 // result: (ConstBool [b2i(c == d)]) 25300 for { 25301 _ = v.Args[1] 25302 v_0 := v.Args[0] 25303 if v_0.Op != OpConst32 { 25304 break 25305 } 25306 c := v_0.AuxInt 25307 v_1 := v.Args[1] 25308 if v_1.Op != OpConst32 { 25309 break 25310 } 25311 d := v_1.AuxInt 25312 v.reset(OpConstBool) 25313 v.AuxInt = b2i(c == d) 25314 return true 25315 } 25316 // match: (EqPtr (Const32 [d]) (Const32 [c])) 25317 // result: (ConstBool [b2i(c == d)]) 25318 for { 25319 _ = v.Args[1] 25320 v_0 := v.Args[0] 25321 if v_0.Op != OpConst32 { 25322 break 25323 } 25324 d := v_0.AuxInt 25325 v_1 := v.Args[1] 25326 if v_1.Op != OpConst32 { 25327 break 25328 } 25329 c := v_1.AuxInt 25330 v.reset(OpConstBool) 25331 v.AuxInt = b2i(c == d) 25332 return true 25333 } 25334 // match: (EqPtr (Const64 [c]) (Const64 [d])) 25335 // result: (ConstBool [b2i(c == d)]) 25336 for { 25337 _ = v.Args[1] 25338 v_0 := v.Args[0] 25339 if v_0.Op != OpConst64 { 25340 break 25341 } 25342 c := v_0.AuxInt 25343 v_1 := v.Args[1] 25344 if v_1.Op != OpConst64 { 25345 break 25346 } 25347 d := v_1.AuxInt 25348 v.reset(OpConstBool) 25349 v.AuxInt = b2i(c == d) 25350 return true 25351 } 25352 return false 25353 } 25354 func rewriteValuegeneric_OpEqPtr_20(v *Value) bool { 25355 b := v.Block 25356 typ := &b.Func.Config.Types 25357 // match: (EqPtr (Const64 [d]) (Const64 [c])) 25358 // result: (ConstBool [b2i(c == d)]) 25359 for { 25360 _ = v.Args[1] 25361 v_0 := v.Args[0] 25362 if v_0.Op != OpConst64 { 25363 break 25364 } 25365 d := v_0.AuxInt 25366 v_1 := v.Args[1] 25367 if v_1.Op != OpConst64 { 25368 break 25369 } 25370 c := v_1.AuxInt 25371 v.reset(OpConstBool) 25372 v.AuxInt = b2i(c == d) 25373 return true 25374 } 25375 // match: (EqPtr (LocalAddr _ _) (Addr _)) 25376 // result: (ConstBool [0]) 25377 for { 25378 _ = v.Args[1] 25379 v_0 := v.Args[0] 25380 if v_0.Op != OpLocalAddr { 25381 break 25382 } 25383 _ = v_0.Args[1] 25384 v_1 := v.Args[1] 25385 if v_1.Op != OpAddr { 25386 break 25387 } 25388 v.reset(OpConstBool) 25389 v.AuxInt = 0 25390 return true 25391 } 25392 // match: (EqPtr (Addr _) (LocalAddr _ _)) 25393 // result: (ConstBool [0]) 25394 for { 25395 _ = v.Args[1] 25396 v_0 := v.Args[0] 25397 if v_0.Op != OpAddr { 25398 break 25399 } 25400 v_1 := v.Args[1] 25401 if v_1.Op != OpLocalAddr { 25402 break 25403 } 25404 _ = v_1.Args[1] 25405 v.reset(OpConstBool) 25406 v.AuxInt = 0 25407 return true 25408 } 25409 // match: (EqPtr (OffPtr (LocalAddr _ _)) (Addr _)) 25410 // result: (ConstBool [0]) 25411 for { 25412 _ = v.Args[1] 25413 v_0 := v.Args[0] 25414 if v_0.Op != OpOffPtr { 25415 break 25416 } 25417 v_0_0 := v_0.Args[0] 25418 if v_0_0.Op != OpLocalAddr { 25419 break 25420 } 25421 _ = v_0_0.Args[1] 25422 v_1 := v.Args[1] 25423 if v_1.Op != OpAddr { 25424 break 25425 } 25426 v.reset(OpConstBool) 25427 v.AuxInt = 0 25428 return true 25429 } 25430 // match: (EqPtr (Addr _) (OffPtr (LocalAddr _ _))) 25431 // result: (ConstBool [0]) 25432 for { 25433 _ = v.Args[1] 25434 v_0 := v.Args[0] 25435 if v_0.Op != OpAddr { 25436 break 25437 } 25438 v_1 := v.Args[1] 25439 if v_1.Op != OpOffPtr { 25440 break 25441 } 25442 v_1_0 := v_1.Args[0] 25443 if v_1_0.Op != OpLocalAddr { 25444 break 25445 } 25446 _ = v_1_0.Args[1] 25447 v.reset(OpConstBool) 25448 v.AuxInt = 0 25449 return true 25450 } 25451 // match: (EqPtr (LocalAddr _ _) (OffPtr (Addr _))) 25452 // result: (ConstBool [0]) 25453 for { 25454 _ = v.Args[1] 25455 v_0 := v.Args[0] 25456 if v_0.Op != OpLocalAddr { 25457 break 25458 } 25459 _ = v_0.Args[1] 25460 v_1 := v.Args[1] 25461 if v_1.Op != OpOffPtr { 25462 break 25463 } 25464 v_1_0 := v_1.Args[0] 25465 if v_1_0.Op != OpAddr { 25466 break 25467 } 25468 v.reset(OpConstBool) 25469 v.AuxInt = 0 25470 return true 25471 } 25472 // match: (EqPtr (OffPtr (Addr _)) (LocalAddr _ _)) 25473 // result: (ConstBool [0]) 25474 for { 25475 _ = v.Args[1] 25476 v_0 := v.Args[0] 25477 if v_0.Op != OpOffPtr { 25478 break 25479 } 25480 v_0_0 := v_0.Args[0] 25481 if v_0_0.Op != OpAddr { 25482 break 25483 } 25484 v_1 := v.Args[1] 25485 if v_1.Op != OpLocalAddr { 25486 break 25487 } 25488 _ = v_1.Args[1] 25489 v.reset(OpConstBool) 25490 v.AuxInt = 0 25491 return true 25492 } 25493 // match: (EqPtr (OffPtr (LocalAddr _ _)) (OffPtr (Addr _))) 25494 // result: (ConstBool [0]) 25495 for { 25496 _ = v.Args[1] 25497 v_0 := v.Args[0] 25498 if v_0.Op != OpOffPtr { 25499 break 25500 } 25501 v_0_0 := v_0.Args[0] 25502 if v_0_0.Op != OpLocalAddr { 25503 break 25504 } 25505 _ = v_0_0.Args[1] 25506 v_1 := v.Args[1] 25507 if v_1.Op != OpOffPtr { 25508 break 25509 } 25510 v_1_0 := v_1.Args[0] 25511 if v_1_0.Op != OpAddr { 25512 break 25513 } 25514 v.reset(OpConstBool) 25515 v.AuxInt = 0 25516 return true 25517 } 25518 // match: (EqPtr (OffPtr (Addr _)) (OffPtr (LocalAddr _ _))) 25519 // result: (ConstBool [0]) 25520 for { 25521 _ = v.Args[1] 25522 v_0 := v.Args[0] 25523 if v_0.Op != OpOffPtr { 25524 break 25525 } 25526 v_0_0 := v_0.Args[0] 25527 if v_0_0.Op != OpAddr { 25528 break 25529 } 25530 v_1 := v.Args[1] 25531 if v_1.Op != OpOffPtr { 25532 break 25533 } 25534 v_1_0 := v_1.Args[0] 25535 if v_1_0.Op != OpLocalAddr { 25536 break 25537 } 25538 _ = v_1_0.Args[1] 25539 v.reset(OpConstBool) 25540 v.AuxInt = 0 25541 return true 25542 } 25543 // match: (EqPtr (AddPtr p1 o1) p2) 25544 // cond: isSamePtr(p1, p2) 25545 // result: (Not (IsNonNil o1)) 25546 for { 25547 p2 := v.Args[1] 25548 v_0 := v.Args[0] 25549 if v_0.Op != OpAddPtr { 25550 break 25551 } 25552 o1 := v_0.Args[1] 25553 p1 := v_0.Args[0] 25554 if !(isSamePtr(p1, p2)) { 25555 break 25556 } 25557 v.reset(OpNot) 25558 v0 := b.NewValue0(v.Pos, OpIsNonNil, typ.Bool) 25559 v0.AddArg(o1) 25560 v.AddArg(v0) 25561 return true 25562 } 25563 return false 25564 } 25565 func rewriteValuegeneric_OpEqPtr_30(v *Value) bool { 25566 b := v.Block 25567 typ := &b.Func.Config.Types 25568 // match: (EqPtr p2 (AddPtr p1 o1)) 25569 // cond: isSamePtr(p1, p2) 25570 // result: (Not (IsNonNil o1)) 25571 for { 25572 _ = v.Args[1] 25573 p2 := v.Args[0] 25574 v_1 := v.Args[1] 25575 if v_1.Op != OpAddPtr { 25576 break 25577 } 25578 o1 := v_1.Args[1] 25579 p1 := v_1.Args[0] 25580 if !(isSamePtr(p1, p2)) { 25581 break 25582 } 25583 v.reset(OpNot) 25584 v0 := b.NewValue0(v.Pos, OpIsNonNil, typ.Bool) 25585 v0.AddArg(o1) 25586 v.AddArg(v0) 25587 return true 25588 } 25589 // match: (EqPtr (Const32 [0]) p) 25590 // result: (Not (IsNonNil p)) 25591 for { 25592 p := v.Args[1] 25593 v_0 := v.Args[0] 25594 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 25595 break 25596 } 25597 v.reset(OpNot) 25598 v0 := b.NewValue0(v.Pos, OpIsNonNil, typ.Bool) 25599 v0.AddArg(p) 25600 v.AddArg(v0) 25601 return true 25602 } 25603 // match: (EqPtr p (Const32 [0])) 25604 // result: (Not (IsNonNil p)) 25605 for { 25606 _ = v.Args[1] 25607 p := v.Args[0] 25608 v_1 := v.Args[1] 25609 if v_1.Op != OpConst32 || v_1.AuxInt != 0 { 25610 break 25611 } 25612 v.reset(OpNot) 25613 v0 := b.NewValue0(v.Pos, OpIsNonNil, typ.Bool) 25614 v0.AddArg(p) 25615 v.AddArg(v0) 25616 return true 25617 } 25618 // match: (EqPtr (Const64 [0]) p) 25619 // result: (Not (IsNonNil p)) 25620 for { 25621 p := v.Args[1] 25622 v_0 := v.Args[0] 25623 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 25624 break 25625 } 25626 v.reset(OpNot) 25627 v0 := b.NewValue0(v.Pos, OpIsNonNil, typ.Bool) 25628 v0.AddArg(p) 25629 v.AddArg(v0) 25630 return true 25631 } 25632 // match: (EqPtr p (Const64 [0])) 25633 // result: (Not (IsNonNil p)) 25634 for { 25635 _ = v.Args[1] 25636 p := v.Args[0] 25637 v_1 := v.Args[1] 25638 if v_1.Op != OpConst64 || v_1.AuxInt != 0 { 25639 break 25640 } 25641 v.reset(OpNot) 25642 v0 := b.NewValue0(v.Pos, OpIsNonNil, typ.Bool) 25643 v0.AddArg(p) 25644 v.AddArg(v0) 25645 return true 25646 } 25647 // match: (EqPtr (ConstNil) p) 25648 // result: (Not (IsNonNil p)) 25649 for { 25650 p := v.Args[1] 25651 v_0 := v.Args[0] 25652 if v_0.Op != OpConstNil { 25653 break 25654 } 25655 v.reset(OpNot) 25656 v0 := b.NewValue0(v.Pos, OpIsNonNil, typ.Bool) 25657 v0.AddArg(p) 25658 v.AddArg(v0) 25659 return true 25660 } 25661 // match: (EqPtr p (ConstNil)) 25662 // result: (Not (IsNonNil p)) 25663 for { 25664 _ = v.Args[1] 25665 p := v.Args[0] 25666 v_1 := v.Args[1] 25667 if v_1.Op != OpConstNil { 25668 break 25669 } 25670 v.reset(OpNot) 25671 v0 := b.NewValue0(v.Pos, OpIsNonNil, typ.Bool) 25672 v0.AddArg(p) 25673 v.AddArg(v0) 25674 return true 25675 } 25676 return false 25677 } 25678 func rewriteValuegeneric_OpEqSlice_0(v *Value) bool { 25679 b := v.Block 25680 typ := &b.Func.Config.Types 25681 // match: (EqSlice x y) 25682 // result: (EqPtr (SlicePtr x) (SlicePtr y)) 25683 for { 25684 y := v.Args[1] 25685 x := v.Args[0] 25686 v.reset(OpEqPtr) 25687 v0 := b.NewValue0(v.Pos, OpSlicePtr, typ.BytePtr) 25688 v0.AddArg(x) 25689 v.AddArg(v0) 25690 v1 := b.NewValue0(v.Pos, OpSlicePtr, typ.BytePtr) 25691 v1.AddArg(y) 25692 v.AddArg(v1) 25693 return true 25694 } 25695 } 25696 func rewriteValuegeneric_OpGeq16_0(v *Value) bool { 25697 // match: (Geq16 (Const16 [c]) (Const16 [d])) 25698 // result: (ConstBool [b2i(c >= d)]) 25699 for { 25700 _ = v.Args[1] 25701 v_0 := v.Args[0] 25702 if v_0.Op != OpConst16 { 25703 break 25704 } 25705 c := v_0.AuxInt 25706 v_1 := v.Args[1] 25707 if v_1.Op != OpConst16 { 25708 break 25709 } 25710 d := v_1.AuxInt 25711 v.reset(OpConstBool) 25712 v.AuxInt = b2i(c >= d) 25713 return true 25714 } 25715 // match: (Geq16 (And16 _ (Const16 [c])) (Const16 [0])) 25716 // cond: int16(c) >= 0 25717 // result: (ConstBool [1]) 25718 for { 25719 _ = v.Args[1] 25720 v_0 := v.Args[0] 25721 if v_0.Op != OpAnd16 { 25722 break 25723 } 25724 _ = v_0.Args[1] 25725 v_0_1 := v_0.Args[1] 25726 if v_0_1.Op != OpConst16 { 25727 break 25728 } 25729 c := v_0_1.AuxInt 25730 v_1 := v.Args[1] 25731 if v_1.Op != OpConst16 || v_1.AuxInt != 0 || !(int16(c) >= 0) { 25732 break 25733 } 25734 v.reset(OpConstBool) 25735 v.AuxInt = 1 25736 return true 25737 } 25738 // match: (Geq16 (And16 (Const16 [c]) _) (Const16 [0])) 25739 // cond: int16(c) >= 0 25740 // result: (ConstBool [1]) 25741 for { 25742 _ = v.Args[1] 25743 v_0 := v.Args[0] 25744 if v_0.Op != OpAnd16 { 25745 break 25746 } 25747 _ = v_0.Args[1] 25748 v_0_0 := v_0.Args[0] 25749 if v_0_0.Op != OpConst16 { 25750 break 25751 } 25752 c := v_0_0.AuxInt 25753 v_1 := v.Args[1] 25754 if v_1.Op != OpConst16 || v_1.AuxInt != 0 || !(int16(c) >= 0) { 25755 break 25756 } 25757 v.reset(OpConstBool) 25758 v.AuxInt = 1 25759 return true 25760 } 25761 return false 25762 } 25763 func rewriteValuegeneric_OpGeq16U_0(v *Value) bool { 25764 // match: (Geq16U (Const16 [c]) (Const16 [d])) 25765 // result: (ConstBool [b2i(uint16(c) >= uint16(d))]) 25766 for { 25767 _ = v.Args[1] 25768 v_0 := v.Args[0] 25769 if v_0.Op != OpConst16 { 25770 break 25771 } 25772 c := v_0.AuxInt 25773 v_1 := v.Args[1] 25774 if v_1.Op != OpConst16 { 25775 break 25776 } 25777 d := v_1.AuxInt 25778 v.reset(OpConstBool) 25779 v.AuxInt = b2i(uint16(c) >= uint16(d)) 25780 return true 25781 } 25782 return false 25783 } 25784 func rewriteValuegeneric_OpGeq32_0(v *Value) bool { 25785 // match: (Geq32 (Const32 [c]) (Const32 [d])) 25786 // result: (ConstBool [b2i(c >= d)]) 25787 for { 25788 _ = v.Args[1] 25789 v_0 := v.Args[0] 25790 if v_0.Op != OpConst32 { 25791 break 25792 } 25793 c := v_0.AuxInt 25794 v_1 := v.Args[1] 25795 if v_1.Op != OpConst32 { 25796 break 25797 } 25798 d := v_1.AuxInt 25799 v.reset(OpConstBool) 25800 v.AuxInt = b2i(c >= d) 25801 return true 25802 } 25803 // match: (Geq32 (And32 _ (Const32 [c])) (Const32 [0])) 25804 // cond: int32(c) >= 0 25805 // result: (ConstBool [1]) 25806 for { 25807 _ = v.Args[1] 25808 v_0 := v.Args[0] 25809 if v_0.Op != OpAnd32 { 25810 break 25811 } 25812 _ = v_0.Args[1] 25813 v_0_1 := v_0.Args[1] 25814 if v_0_1.Op != OpConst32 { 25815 break 25816 } 25817 c := v_0_1.AuxInt 25818 v_1 := v.Args[1] 25819 if v_1.Op != OpConst32 || v_1.AuxInt != 0 || !(int32(c) >= 0) { 25820 break 25821 } 25822 v.reset(OpConstBool) 25823 v.AuxInt = 1 25824 return true 25825 } 25826 // match: (Geq32 (And32 (Const32 [c]) _) (Const32 [0])) 25827 // cond: int32(c) >= 0 25828 // result: (ConstBool [1]) 25829 for { 25830 _ = v.Args[1] 25831 v_0 := v.Args[0] 25832 if v_0.Op != OpAnd32 { 25833 break 25834 } 25835 _ = v_0.Args[1] 25836 v_0_0 := v_0.Args[0] 25837 if v_0_0.Op != OpConst32 { 25838 break 25839 } 25840 c := v_0_0.AuxInt 25841 v_1 := v.Args[1] 25842 if v_1.Op != OpConst32 || v_1.AuxInt != 0 || !(int32(c) >= 0) { 25843 break 25844 } 25845 v.reset(OpConstBool) 25846 v.AuxInt = 1 25847 return true 25848 } 25849 return false 25850 } 25851 func rewriteValuegeneric_OpGeq32F_0(v *Value) bool { 25852 // match: (Geq32F (Const32F [c]) (Const32F [d])) 25853 // result: (ConstBool [b2i(auxTo32F(c) >= auxTo32F(d))]) 25854 for { 25855 _ = v.Args[1] 25856 v_0 := v.Args[0] 25857 if v_0.Op != OpConst32F { 25858 break 25859 } 25860 c := v_0.AuxInt 25861 v_1 := v.Args[1] 25862 if v_1.Op != OpConst32F { 25863 break 25864 } 25865 d := v_1.AuxInt 25866 v.reset(OpConstBool) 25867 v.AuxInt = b2i(auxTo32F(c) >= auxTo32F(d)) 25868 return true 25869 } 25870 return false 25871 } 25872 func rewriteValuegeneric_OpGeq32U_0(v *Value) bool { 25873 // match: (Geq32U (Const32 [c]) (Const32 [d])) 25874 // result: (ConstBool [b2i(uint32(c) >= uint32(d))]) 25875 for { 25876 _ = v.Args[1] 25877 v_0 := v.Args[0] 25878 if v_0.Op != OpConst32 { 25879 break 25880 } 25881 c := v_0.AuxInt 25882 v_1 := v.Args[1] 25883 if v_1.Op != OpConst32 { 25884 break 25885 } 25886 d := v_1.AuxInt 25887 v.reset(OpConstBool) 25888 v.AuxInt = b2i(uint32(c) >= uint32(d)) 25889 return true 25890 } 25891 return false 25892 } 25893 func rewriteValuegeneric_OpGeq64_0(v *Value) bool { 25894 // match: (Geq64 (Const64 [c]) (Const64 [d])) 25895 // result: (ConstBool [b2i(c >= d)]) 25896 for { 25897 _ = v.Args[1] 25898 v_0 := v.Args[0] 25899 if v_0.Op != OpConst64 { 25900 break 25901 } 25902 c := v_0.AuxInt 25903 v_1 := v.Args[1] 25904 if v_1.Op != OpConst64 { 25905 break 25906 } 25907 d := v_1.AuxInt 25908 v.reset(OpConstBool) 25909 v.AuxInt = b2i(c >= d) 25910 return true 25911 } 25912 // match: (Geq64 (And64 _ (Const64 [c])) (Const64 [0])) 25913 // cond: int64(c) >= 0 25914 // result: (ConstBool [1]) 25915 for { 25916 _ = v.Args[1] 25917 v_0 := v.Args[0] 25918 if v_0.Op != OpAnd64 { 25919 break 25920 } 25921 _ = v_0.Args[1] 25922 v_0_1 := v_0.Args[1] 25923 if v_0_1.Op != OpConst64 { 25924 break 25925 } 25926 c := v_0_1.AuxInt 25927 v_1 := v.Args[1] 25928 if v_1.Op != OpConst64 || v_1.AuxInt != 0 || !(int64(c) >= 0) { 25929 break 25930 } 25931 v.reset(OpConstBool) 25932 v.AuxInt = 1 25933 return true 25934 } 25935 // match: (Geq64 (And64 (Const64 [c]) _) (Const64 [0])) 25936 // cond: int64(c) >= 0 25937 // result: (ConstBool [1]) 25938 for { 25939 _ = v.Args[1] 25940 v_0 := v.Args[0] 25941 if v_0.Op != OpAnd64 { 25942 break 25943 } 25944 _ = v_0.Args[1] 25945 v_0_0 := v_0.Args[0] 25946 if v_0_0.Op != OpConst64 { 25947 break 25948 } 25949 c := v_0_0.AuxInt 25950 v_1 := v.Args[1] 25951 if v_1.Op != OpConst64 || v_1.AuxInt != 0 || !(int64(c) >= 0) { 25952 break 25953 } 25954 v.reset(OpConstBool) 25955 v.AuxInt = 1 25956 return true 25957 } 25958 // match: (Geq64 (Rsh64Ux64 _ (Const64 [c])) (Const64 [0])) 25959 // cond: c > 0 25960 // result: (ConstBool [1]) 25961 for { 25962 _ = v.Args[1] 25963 v_0 := v.Args[0] 25964 if v_0.Op != OpRsh64Ux64 { 25965 break 25966 } 25967 _ = v_0.Args[1] 25968 v_0_1 := v_0.Args[1] 25969 if v_0_1.Op != OpConst64 { 25970 break 25971 } 25972 c := v_0_1.AuxInt 25973 v_1 := v.Args[1] 25974 if v_1.Op != OpConst64 || v_1.AuxInt != 0 || !(c > 0) { 25975 break 25976 } 25977 v.reset(OpConstBool) 25978 v.AuxInt = 1 25979 return true 25980 } 25981 return false 25982 } 25983 func rewriteValuegeneric_OpGeq64F_0(v *Value) bool { 25984 // match: (Geq64F (Const64F [c]) (Const64F [d])) 25985 // result: (ConstBool [b2i(auxTo64F(c) >= auxTo64F(d))]) 25986 for { 25987 _ = v.Args[1] 25988 v_0 := v.Args[0] 25989 if v_0.Op != OpConst64F { 25990 break 25991 } 25992 c := v_0.AuxInt 25993 v_1 := v.Args[1] 25994 if v_1.Op != OpConst64F { 25995 break 25996 } 25997 d := v_1.AuxInt 25998 v.reset(OpConstBool) 25999 v.AuxInt = b2i(auxTo64F(c) >= auxTo64F(d)) 26000 return true 26001 } 26002 return false 26003 } 26004 func rewriteValuegeneric_OpGeq64U_0(v *Value) bool { 26005 // match: (Geq64U (Const64 [c]) (Const64 [d])) 26006 // result: (ConstBool [b2i(uint64(c) >= uint64(d))]) 26007 for { 26008 _ = v.Args[1] 26009 v_0 := v.Args[0] 26010 if v_0.Op != OpConst64 { 26011 break 26012 } 26013 c := v_0.AuxInt 26014 v_1 := v.Args[1] 26015 if v_1.Op != OpConst64 { 26016 break 26017 } 26018 d := v_1.AuxInt 26019 v.reset(OpConstBool) 26020 v.AuxInt = b2i(uint64(c) >= uint64(d)) 26021 return true 26022 } 26023 return false 26024 } 26025 func rewriteValuegeneric_OpGeq8_0(v *Value) bool { 26026 // match: (Geq8 (Const8 [c]) (Const8 [d])) 26027 // result: (ConstBool [b2i(c >= d)]) 26028 for { 26029 _ = v.Args[1] 26030 v_0 := v.Args[0] 26031 if v_0.Op != OpConst8 { 26032 break 26033 } 26034 c := v_0.AuxInt 26035 v_1 := v.Args[1] 26036 if v_1.Op != OpConst8 { 26037 break 26038 } 26039 d := v_1.AuxInt 26040 v.reset(OpConstBool) 26041 v.AuxInt = b2i(c >= d) 26042 return true 26043 } 26044 // match: (Geq8 (And8 _ (Const8 [c])) (Const8 [0])) 26045 // cond: int8(c) >= 0 26046 // result: (ConstBool [1]) 26047 for { 26048 _ = v.Args[1] 26049 v_0 := v.Args[0] 26050 if v_0.Op != OpAnd8 { 26051 break 26052 } 26053 _ = v_0.Args[1] 26054 v_0_1 := v_0.Args[1] 26055 if v_0_1.Op != OpConst8 { 26056 break 26057 } 26058 c := v_0_1.AuxInt 26059 v_1 := v.Args[1] 26060 if v_1.Op != OpConst8 || v_1.AuxInt != 0 || !(int8(c) >= 0) { 26061 break 26062 } 26063 v.reset(OpConstBool) 26064 v.AuxInt = 1 26065 return true 26066 } 26067 // match: (Geq8 (And8 (Const8 [c]) _) (Const8 [0])) 26068 // cond: int8(c) >= 0 26069 // result: (ConstBool [1]) 26070 for { 26071 _ = v.Args[1] 26072 v_0 := v.Args[0] 26073 if v_0.Op != OpAnd8 { 26074 break 26075 } 26076 _ = v_0.Args[1] 26077 v_0_0 := v_0.Args[0] 26078 if v_0_0.Op != OpConst8 { 26079 break 26080 } 26081 c := v_0_0.AuxInt 26082 v_1 := v.Args[1] 26083 if v_1.Op != OpConst8 || v_1.AuxInt != 0 || !(int8(c) >= 0) { 26084 break 26085 } 26086 v.reset(OpConstBool) 26087 v.AuxInt = 1 26088 return true 26089 } 26090 return false 26091 } 26092 func rewriteValuegeneric_OpGeq8U_0(v *Value) bool { 26093 // match: (Geq8U (Const8 [c]) (Const8 [d])) 26094 // result: (ConstBool [b2i(uint8(c) >= uint8(d))]) 26095 for { 26096 _ = v.Args[1] 26097 v_0 := v.Args[0] 26098 if v_0.Op != OpConst8 { 26099 break 26100 } 26101 c := v_0.AuxInt 26102 v_1 := v.Args[1] 26103 if v_1.Op != OpConst8 { 26104 break 26105 } 26106 d := v_1.AuxInt 26107 v.reset(OpConstBool) 26108 v.AuxInt = b2i(uint8(c) >= uint8(d)) 26109 return true 26110 } 26111 return false 26112 } 26113 func rewriteValuegeneric_OpGreater16_0(v *Value) bool { 26114 // match: (Greater16 (Const16 [c]) (Const16 [d])) 26115 // result: (ConstBool [b2i(c > d)]) 26116 for { 26117 _ = v.Args[1] 26118 v_0 := v.Args[0] 26119 if v_0.Op != OpConst16 { 26120 break 26121 } 26122 c := v_0.AuxInt 26123 v_1 := v.Args[1] 26124 if v_1.Op != OpConst16 { 26125 break 26126 } 26127 d := v_1.AuxInt 26128 v.reset(OpConstBool) 26129 v.AuxInt = b2i(c > d) 26130 return true 26131 } 26132 return false 26133 } 26134 func rewriteValuegeneric_OpGreater16U_0(v *Value) bool { 26135 // match: (Greater16U (Const16 [c]) (Const16 [d])) 26136 // result: (ConstBool [b2i(uint16(c) > uint16(d))]) 26137 for { 26138 _ = v.Args[1] 26139 v_0 := v.Args[0] 26140 if v_0.Op != OpConst16 { 26141 break 26142 } 26143 c := v_0.AuxInt 26144 v_1 := v.Args[1] 26145 if v_1.Op != OpConst16 { 26146 break 26147 } 26148 d := v_1.AuxInt 26149 v.reset(OpConstBool) 26150 v.AuxInt = b2i(uint16(c) > uint16(d)) 26151 return true 26152 } 26153 return false 26154 } 26155 func rewriteValuegeneric_OpGreater32_0(v *Value) bool { 26156 // match: (Greater32 (Const32 [c]) (Const32 [d])) 26157 // result: (ConstBool [b2i(c > d)]) 26158 for { 26159 _ = v.Args[1] 26160 v_0 := v.Args[0] 26161 if v_0.Op != OpConst32 { 26162 break 26163 } 26164 c := v_0.AuxInt 26165 v_1 := v.Args[1] 26166 if v_1.Op != OpConst32 { 26167 break 26168 } 26169 d := v_1.AuxInt 26170 v.reset(OpConstBool) 26171 v.AuxInt = b2i(c > d) 26172 return true 26173 } 26174 return false 26175 } 26176 func rewriteValuegeneric_OpGreater32F_0(v *Value) bool { 26177 // match: (Greater32F (Const32F [c]) (Const32F [d])) 26178 // result: (ConstBool [b2i(auxTo32F(c) > auxTo32F(d))]) 26179 for { 26180 _ = v.Args[1] 26181 v_0 := v.Args[0] 26182 if v_0.Op != OpConst32F { 26183 break 26184 } 26185 c := v_0.AuxInt 26186 v_1 := v.Args[1] 26187 if v_1.Op != OpConst32F { 26188 break 26189 } 26190 d := v_1.AuxInt 26191 v.reset(OpConstBool) 26192 v.AuxInt = b2i(auxTo32F(c) > auxTo32F(d)) 26193 return true 26194 } 26195 return false 26196 } 26197 func rewriteValuegeneric_OpGreater32U_0(v *Value) bool { 26198 // match: (Greater32U (Const32 [c]) (Const32 [d])) 26199 // result: (ConstBool [b2i(uint32(c) > uint32(d))]) 26200 for { 26201 _ = v.Args[1] 26202 v_0 := v.Args[0] 26203 if v_0.Op != OpConst32 { 26204 break 26205 } 26206 c := v_0.AuxInt 26207 v_1 := v.Args[1] 26208 if v_1.Op != OpConst32 { 26209 break 26210 } 26211 d := v_1.AuxInt 26212 v.reset(OpConstBool) 26213 v.AuxInt = b2i(uint32(c) > uint32(d)) 26214 return true 26215 } 26216 return false 26217 } 26218 func rewriteValuegeneric_OpGreater64_0(v *Value) bool { 26219 // match: (Greater64 (Const64 [c]) (Const64 [d])) 26220 // result: (ConstBool [b2i(c > d)]) 26221 for { 26222 _ = v.Args[1] 26223 v_0 := v.Args[0] 26224 if v_0.Op != OpConst64 { 26225 break 26226 } 26227 c := v_0.AuxInt 26228 v_1 := v.Args[1] 26229 if v_1.Op != OpConst64 { 26230 break 26231 } 26232 d := v_1.AuxInt 26233 v.reset(OpConstBool) 26234 v.AuxInt = b2i(c > d) 26235 return true 26236 } 26237 return false 26238 } 26239 func rewriteValuegeneric_OpGreater64F_0(v *Value) bool { 26240 // match: (Greater64F (Const64F [c]) (Const64F [d])) 26241 // result: (ConstBool [b2i(auxTo64F(c) > auxTo64F(d))]) 26242 for { 26243 _ = v.Args[1] 26244 v_0 := v.Args[0] 26245 if v_0.Op != OpConst64F { 26246 break 26247 } 26248 c := v_0.AuxInt 26249 v_1 := v.Args[1] 26250 if v_1.Op != OpConst64F { 26251 break 26252 } 26253 d := v_1.AuxInt 26254 v.reset(OpConstBool) 26255 v.AuxInt = b2i(auxTo64F(c) > auxTo64F(d)) 26256 return true 26257 } 26258 return false 26259 } 26260 func rewriteValuegeneric_OpGreater64U_0(v *Value) bool { 26261 // match: (Greater64U (Const64 [c]) (Const64 [d])) 26262 // result: (ConstBool [b2i(uint64(c) > uint64(d))]) 26263 for { 26264 _ = v.Args[1] 26265 v_0 := v.Args[0] 26266 if v_0.Op != OpConst64 { 26267 break 26268 } 26269 c := v_0.AuxInt 26270 v_1 := v.Args[1] 26271 if v_1.Op != OpConst64 { 26272 break 26273 } 26274 d := v_1.AuxInt 26275 v.reset(OpConstBool) 26276 v.AuxInt = b2i(uint64(c) > uint64(d)) 26277 return true 26278 } 26279 return false 26280 } 26281 func rewriteValuegeneric_OpGreater8_0(v *Value) bool { 26282 // match: (Greater8 (Const8 [c]) (Const8 [d])) 26283 // result: (ConstBool [b2i(c > d)]) 26284 for { 26285 _ = v.Args[1] 26286 v_0 := v.Args[0] 26287 if v_0.Op != OpConst8 { 26288 break 26289 } 26290 c := v_0.AuxInt 26291 v_1 := v.Args[1] 26292 if v_1.Op != OpConst8 { 26293 break 26294 } 26295 d := v_1.AuxInt 26296 v.reset(OpConstBool) 26297 v.AuxInt = b2i(c > d) 26298 return true 26299 } 26300 return false 26301 } 26302 func rewriteValuegeneric_OpGreater8U_0(v *Value) bool { 26303 // match: (Greater8U (Const8 [c]) (Const8 [d])) 26304 // result: (ConstBool [b2i(uint8(c) > uint8(d))]) 26305 for { 26306 _ = v.Args[1] 26307 v_0 := v.Args[0] 26308 if v_0.Op != OpConst8 { 26309 break 26310 } 26311 c := v_0.AuxInt 26312 v_1 := v.Args[1] 26313 if v_1.Op != OpConst8 { 26314 break 26315 } 26316 d := v_1.AuxInt 26317 v.reset(OpConstBool) 26318 v.AuxInt = b2i(uint8(c) > uint8(d)) 26319 return true 26320 } 26321 return false 26322 } 26323 func rewriteValuegeneric_OpIMake_0(v *Value) bool { 26324 // match: (IMake typ (StructMake1 val)) 26325 // result: (IMake typ val) 26326 for { 26327 _ = v.Args[1] 26328 typ := v.Args[0] 26329 v_1 := v.Args[1] 26330 if v_1.Op != OpStructMake1 { 26331 break 26332 } 26333 val := v_1.Args[0] 26334 v.reset(OpIMake) 26335 v.AddArg(typ) 26336 v.AddArg(val) 26337 return true 26338 } 26339 // match: (IMake typ (ArrayMake1 val)) 26340 // result: (IMake typ val) 26341 for { 26342 _ = v.Args[1] 26343 typ := v.Args[0] 26344 v_1 := v.Args[1] 26345 if v_1.Op != OpArrayMake1 { 26346 break 26347 } 26348 val := v_1.Args[0] 26349 v.reset(OpIMake) 26350 v.AddArg(typ) 26351 v.AddArg(val) 26352 return true 26353 } 26354 return false 26355 } 26356 func rewriteValuegeneric_OpInterCall_0(v *Value) bool { 26357 // match: (InterCall [argsize] (Load (OffPtr [off] (ITab (IMake (Addr {itab} (SB)) _))) _) mem) 26358 // cond: devirt(v, itab, off) != nil 26359 // result: (StaticCall [argsize] {devirt(v, itab, off)} mem) 26360 for { 26361 argsize := v.AuxInt 26362 mem := v.Args[1] 26363 v_0 := v.Args[0] 26364 if v_0.Op != OpLoad { 26365 break 26366 } 26367 _ = v_0.Args[1] 26368 v_0_0 := v_0.Args[0] 26369 if v_0_0.Op != OpOffPtr { 26370 break 26371 } 26372 off := v_0_0.AuxInt 26373 v_0_0_0 := v_0_0.Args[0] 26374 if v_0_0_0.Op != OpITab { 26375 break 26376 } 26377 v_0_0_0_0 := v_0_0_0.Args[0] 26378 if v_0_0_0_0.Op != OpIMake { 26379 break 26380 } 26381 _ = v_0_0_0_0.Args[1] 26382 v_0_0_0_0_0 := v_0_0_0_0.Args[0] 26383 if v_0_0_0_0_0.Op != OpAddr { 26384 break 26385 } 26386 itab := v_0_0_0_0_0.Aux 26387 v_0_0_0_0_0_0 := v_0_0_0_0_0.Args[0] 26388 if v_0_0_0_0_0_0.Op != OpSB || !(devirt(v, itab, off) != nil) { 26389 break 26390 } 26391 v.reset(OpStaticCall) 26392 v.AuxInt = argsize 26393 v.Aux = devirt(v, itab, off) 26394 v.AddArg(mem) 26395 return true 26396 } 26397 return false 26398 } 26399 func rewriteValuegeneric_OpIsInBounds_0(v *Value) bool { 26400 // match: (IsInBounds (ZeroExt8to32 _) (Const32 [c])) 26401 // cond: (1 << 8) <= c 26402 // result: (ConstBool [1]) 26403 for { 26404 _ = v.Args[1] 26405 v_0 := v.Args[0] 26406 if v_0.Op != OpZeroExt8to32 { 26407 break 26408 } 26409 v_1 := v.Args[1] 26410 if v_1.Op != OpConst32 { 26411 break 26412 } 26413 c := v_1.AuxInt 26414 if !((1 << 8) <= c) { 26415 break 26416 } 26417 v.reset(OpConstBool) 26418 v.AuxInt = 1 26419 return true 26420 } 26421 // match: (IsInBounds (ZeroExt8to64 _) (Const64 [c])) 26422 // cond: (1 << 8) <= c 26423 // result: (ConstBool [1]) 26424 for { 26425 _ = v.Args[1] 26426 v_0 := v.Args[0] 26427 if v_0.Op != OpZeroExt8to64 { 26428 break 26429 } 26430 v_1 := v.Args[1] 26431 if v_1.Op != OpConst64 { 26432 break 26433 } 26434 c := v_1.AuxInt 26435 if !((1 << 8) <= c) { 26436 break 26437 } 26438 v.reset(OpConstBool) 26439 v.AuxInt = 1 26440 return true 26441 } 26442 // match: (IsInBounds (ZeroExt16to32 _) (Const32 [c])) 26443 // cond: (1 << 16) <= c 26444 // result: (ConstBool [1]) 26445 for { 26446 _ = v.Args[1] 26447 v_0 := v.Args[0] 26448 if v_0.Op != OpZeroExt16to32 { 26449 break 26450 } 26451 v_1 := v.Args[1] 26452 if v_1.Op != OpConst32 { 26453 break 26454 } 26455 c := v_1.AuxInt 26456 if !((1 << 16) <= c) { 26457 break 26458 } 26459 v.reset(OpConstBool) 26460 v.AuxInt = 1 26461 return true 26462 } 26463 // match: (IsInBounds (ZeroExt16to64 _) (Const64 [c])) 26464 // cond: (1 << 16) <= c 26465 // result: (ConstBool [1]) 26466 for { 26467 _ = v.Args[1] 26468 v_0 := v.Args[0] 26469 if v_0.Op != OpZeroExt16to64 { 26470 break 26471 } 26472 v_1 := v.Args[1] 26473 if v_1.Op != OpConst64 { 26474 break 26475 } 26476 c := v_1.AuxInt 26477 if !((1 << 16) <= c) { 26478 break 26479 } 26480 v.reset(OpConstBool) 26481 v.AuxInt = 1 26482 return true 26483 } 26484 // match: (IsInBounds x x) 26485 // result: (ConstBool [0]) 26486 for { 26487 x := v.Args[1] 26488 if x != v.Args[0] { 26489 break 26490 } 26491 v.reset(OpConstBool) 26492 v.AuxInt = 0 26493 return true 26494 } 26495 // match: (IsInBounds (And8 (Const8 [c]) _) (Const8 [d])) 26496 // cond: 0 <= c && c < d 26497 // result: (ConstBool [1]) 26498 for { 26499 _ = v.Args[1] 26500 v_0 := v.Args[0] 26501 if v_0.Op != OpAnd8 { 26502 break 26503 } 26504 _ = v_0.Args[1] 26505 v_0_0 := v_0.Args[0] 26506 if v_0_0.Op != OpConst8 { 26507 break 26508 } 26509 c := v_0_0.AuxInt 26510 v_1 := v.Args[1] 26511 if v_1.Op != OpConst8 { 26512 break 26513 } 26514 d := v_1.AuxInt 26515 if !(0 <= c && c < d) { 26516 break 26517 } 26518 v.reset(OpConstBool) 26519 v.AuxInt = 1 26520 return true 26521 } 26522 // match: (IsInBounds (And8 _ (Const8 [c])) (Const8 [d])) 26523 // cond: 0 <= c && c < d 26524 // result: (ConstBool [1]) 26525 for { 26526 _ = v.Args[1] 26527 v_0 := v.Args[0] 26528 if v_0.Op != OpAnd8 { 26529 break 26530 } 26531 _ = v_0.Args[1] 26532 v_0_1 := v_0.Args[1] 26533 if v_0_1.Op != OpConst8 { 26534 break 26535 } 26536 c := v_0_1.AuxInt 26537 v_1 := v.Args[1] 26538 if v_1.Op != OpConst8 { 26539 break 26540 } 26541 d := v_1.AuxInt 26542 if !(0 <= c && c < d) { 26543 break 26544 } 26545 v.reset(OpConstBool) 26546 v.AuxInt = 1 26547 return true 26548 } 26549 // match: (IsInBounds (ZeroExt8to16 (And8 (Const8 [c]) _)) (Const16 [d])) 26550 // cond: 0 <= c && c < d 26551 // result: (ConstBool [1]) 26552 for { 26553 _ = v.Args[1] 26554 v_0 := v.Args[0] 26555 if v_0.Op != OpZeroExt8to16 { 26556 break 26557 } 26558 v_0_0 := v_0.Args[0] 26559 if v_0_0.Op != OpAnd8 { 26560 break 26561 } 26562 _ = v_0_0.Args[1] 26563 v_0_0_0 := v_0_0.Args[0] 26564 if v_0_0_0.Op != OpConst8 { 26565 break 26566 } 26567 c := v_0_0_0.AuxInt 26568 v_1 := v.Args[1] 26569 if v_1.Op != OpConst16 { 26570 break 26571 } 26572 d := v_1.AuxInt 26573 if !(0 <= c && c < d) { 26574 break 26575 } 26576 v.reset(OpConstBool) 26577 v.AuxInt = 1 26578 return true 26579 } 26580 // match: (IsInBounds (ZeroExt8to16 (And8 _ (Const8 [c]))) (Const16 [d])) 26581 // cond: 0 <= c && c < d 26582 // result: (ConstBool [1]) 26583 for { 26584 _ = v.Args[1] 26585 v_0 := v.Args[0] 26586 if v_0.Op != OpZeroExt8to16 { 26587 break 26588 } 26589 v_0_0 := v_0.Args[0] 26590 if v_0_0.Op != OpAnd8 { 26591 break 26592 } 26593 _ = v_0_0.Args[1] 26594 v_0_0_1 := v_0_0.Args[1] 26595 if v_0_0_1.Op != OpConst8 { 26596 break 26597 } 26598 c := v_0_0_1.AuxInt 26599 v_1 := v.Args[1] 26600 if v_1.Op != OpConst16 { 26601 break 26602 } 26603 d := v_1.AuxInt 26604 if !(0 <= c && c < d) { 26605 break 26606 } 26607 v.reset(OpConstBool) 26608 v.AuxInt = 1 26609 return true 26610 } 26611 // match: (IsInBounds (ZeroExt8to32 (And8 (Const8 [c]) _)) (Const32 [d])) 26612 // cond: 0 <= c && c < d 26613 // result: (ConstBool [1]) 26614 for { 26615 _ = v.Args[1] 26616 v_0 := v.Args[0] 26617 if v_0.Op != OpZeroExt8to32 { 26618 break 26619 } 26620 v_0_0 := v_0.Args[0] 26621 if v_0_0.Op != OpAnd8 { 26622 break 26623 } 26624 _ = v_0_0.Args[1] 26625 v_0_0_0 := v_0_0.Args[0] 26626 if v_0_0_0.Op != OpConst8 { 26627 break 26628 } 26629 c := v_0_0_0.AuxInt 26630 v_1 := v.Args[1] 26631 if v_1.Op != OpConst32 { 26632 break 26633 } 26634 d := v_1.AuxInt 26635 if !(0 <= c && c < d) { 26636 break 26637 } 26638 v.reset(OpConstBool) 26639 v.AuxInt = 1 26640 return true 26641 } 26642 return false 26643 } 26644 func rewriteValuegeneric_OpIsInBounds_10(v *Value) bool { 26645 // match: (IsInBounds (ZeroExt8to32 (And8 _ (Const8 [c]))) (Const32 [d])) 26646 // cond: 0 <= c && c < d 26647 // result: (ConstBool [1]) 26648 for { 26649 _ = v.Args[1] 26650 v_0 := v.Args[0] 26651 if v_0.Op != OpZeroExt8to32 { 26652 break 26653 } 26654 v_0_0 := v_0.Args[0] 26655 if v_0_0.Op != OpAnd8 { 26656 break 26657 } 26658 _ = v_0_0.Args[1] 26659 v_0_0_1 := v_0_0.Args[1] 26660 if v_0_0_1.Op != OpConst8 { 26661 break 26662 } 26663 c := v_0_0_1.AuxInt 26664 v_1 := v.Args[1] 26665 if v_1.Op != OpConst32 { 26666 break 26667 } 26668 d := v_1.AuxInt 26669 if !(0 <= c && c < d) { 26670 break 26671 } 26672 v.reset(OpConstBool) 26673 v.AuxInt = 1 26674 return true 26675 } 26676 // match: (IsInBounds (ZeroExt8to64 (And8 (Const8 [c]) _)) (Const64 [d])) 26677 // cond: 0 <= c && c < d 26678 // result: (ConstBool [1]) 26679 for { 26680 _ = v.Args[1] 26681 v_0 := v.Args[0] 26682 if v_0.Op != OpZeroExt8to64 { 26683 break 26684 } 26685 v_0_0 := v_0.Args[0] 26686 if v_0_0.Op != OpAnd8 { 26687 break 26688 } 26689 _ = v_0_0.Args[1] 26690 v_0_0_0 := v_0_0.Args[0] 26691 if v_0_0_0.Op != OpConst8 { 26692 break 26693 } 26694 c := v_0_0_0.AuxInt 26695 v_1 := v.Args[1] 26696 if v_1.Op != OpConst64 { 26697 break 26698 } 26699 d := v_1.AuxInt 26700 if !(0 <= c && c < d) { 26701 break 26702 } 26703 v.reset(OpConstBool) 26704 v.AuxInt = 1 26705 return true 26706 } 26707 // match: (IsInBounds (ZeroExt8to64 (And8 _ (Const8 [c]))) (Const64 [d])) 26708 // cond: 0 <= c && c < d 26709 // result: (ConstBool [1]) 26710 for { 26711 _ = v.Args[1] 26712 v_0 := v.Args[0] 26713 if v_0.Op != OpZeroExt8to64 { 26714 break 26715 } 26716 v_0_0 := v_0.Args[0] 26717 if v_0_0.Op != OpAnd8 { 26718 break 26719 } 26720 _ = v_0_0.Args[1] 26721 v_0_0_1 := v_0_0.Args[1] 26722 if v_0_0_1.Op != OpConst8 { 26723 break 26724 } 26725 c := v_0_0_1.AuxInt 26726 v_1 := v.Args[1] 26727 if v_1.Op != OpConst64 { 26728 break 26729 } 26730 d := v_1.AuxInt 26731 if !(0 <= c && c < d) { 26732 break 26733 } 26734 v.reset(OpConstBool) 26735 v.AuxInt = 1 26736 return true 26737 } 26738 // match: (IsInBounds (And16 (Const16 [c]) _) (Const16 [d])) 26739 // cond: 0 <= c && c < d 26740 // result: (ConstBool [1]) 26741 for { 26742 _ = v.Args[1] 26743 v_0 := v.Args[0] 26744 if v_0.Op != OpAnd16 { 26745 break 26746 } 26747 _ = v_0.Args[1] 26748 v_0_0 := v_0.Args[0] 26749 if v_0_0.Op != OpConst16 { 26750 break 26751 } 26752 c := v_0_0.AuxInt 26753 v_1 := v.Args[1] 26754 if v_1.Op != OpConst16 { 26755 break 26756 } 26757 d := v_1.AuxInt 26758 if !(0 <= c && c < d) { 26759 break 26760 } 26761 v.reset(OpConstBool) 26762 v.AuxInt = 1 26763 return true 26764 } 26765 // match: (IsInBounds (And16 _ (Const16 [c])) (Const16 [d])) 26766 // cond: 0 <= c && c < d 26767 // result: (ConstBool [1]) 26768 for { 26769 _ = v.Args[1] 26770 v_0 := v.Args[0] 26771 if v_0.Op != OpAnd16 { 26772 break 26773 } 26774 _ = v_0.Args[1] 26775 v_0_1 := v_0.Args[1] 26776 if v_0_1.Op != OpConst16 { 26777 break 26778 } 26779 c := v_0_1.AuxInt 26780 v_1 := v.Args[1] 26781 if v_1.Op != OpConst16 { 26782 break 26783 } 26784 d := v_1.AuxInt 26785 if !(0 <= c && c < d) { 26786 break 26787 } 26788 v.reset(OpConstBool) 26789 v.AuxInt = 1 26790 return true 26791 } 26792 // match: (IsInBounds (ZeroExt16to32 (And16 (Const16 [c]) _)) (Const32 [d])) 26793 // cond: 0 <= c && c < d 26794 // result: (ConstBool [1]) 26795 for { 26796 _ = v.Args[1] 26797 v_0 := v.Args[0] 26798 if v_0.Op != OpZeroExt16to32 { 26799 break 26800 } 26801 v_0_0 := v_0.Args[0] 26802 if v_0_0.Op != OpAnd16 { 26803 break 26804 } 26805 _ = v_0_0.Args[1] 26806 v_0_0_0 := v_0_0.Args[0] 26807 if v_0_0_0.Op != OpConst16 { 26808 break 26809 } 26810 c := v_0_0_0.AuxInt 26811 v_1 := v.Args[1] 26812 if v_1.Op != OpConst32 { 26813 break 26814 } 26815 d := v_1.AuxInt 26816 if !(0 <= c && c < d) { 26817 break 26818 } 26819 v.reset(OpConstBool) 26820 v.AuxInt = 1 26821 return true 26822 } 26823 // match: (IsInBounds (ZeroExt16to32 (And16 _ (Const16 [c]))) (Const32 [d])) 26824 // cond: 0 <= c && c < d 26825 // result: (ConstBool [1]) 26826 for { 26827 _ = v.Args[1] 26828 v_0 := v.Args[0] 26829 if v_0.Op != OpZeroExt16to32 { 26830 break 26831 } 26832 v_0_0 := v_0.Args[0] 26833 if v_0_0.Op != OpAnd16 { 26834 break 26835 } 26836 _ = v_0_0.Args[1] 26837 v_0_0_1 := v_0_0.Args[1] 26838 if v_0_0_1.Op != OpConst16 { 26839 break 26840 } 26841 c := v_0_0_1.AuxInt 26842 v_1 := v.Args[1] 26843 if v_1.Op != OpConst32 { 26844 break 26845 } 26846 d := v_1.AuxInt 26847 if !(0 <= c && c < d) { 26848 break 26849 } 26850 v.reset(OpConstBool) 26851 v.AuxInt = 1 26852 return true 26853 } 26854 // match: (IsInBounds (ZeroExt16to64 (And16 (Const16 [c]) _)) (Const64 [d])) 26855 // cond: 0 <= c && c < d 26856 // result: (ConstBool [1]) 26857 for { 26858 _ = v.Args[1] 26859 v_0 := v.Args[0] 26860 if v_0.Op != OpZeroExt16to64 { 26861 break 26862 } 26863 v_0_0 := v_0.Args[0] 26864 if v_0_0.Op != OpAnd16 { 26865 break 26866 } 26867 _ = v_0_0.Args[1] 26868 v_0_0_0 := v_0_0.Args[0] 26869 if v_0_0_0.Op != OpConst16 { 26870 break 26871 } 26872 c := v_0_0_0.AuxInt 26873 v_1 := v.Args[1] 26874 if v_1.Op != OpConst64 { 26875 break 26876 } 26877 d := v_1.AuxInt 26878 if !(0 <= c && c < d) { 26879 break 26880 } 26881 v.reset(OpConstBool) 26882 v.AuxInt = 1 26883 return true 26884 } 26885 // match: (IsInBounds (ZeroExt16to64 (And16 _ (Const16 [c]))) (Const64 [d])) 26886 // cond: 0 <= c && c < d 26887 // result: (ConstBool [1]) 26888 for { 26889 _ = v.Args[1] 26890 v_0 := v.Args[0] 26891 if v_0.Op != OpZeroExt16to64 { 26892 break 26893 } 26894 v_0_0 := v_0.Args[0] 26895 if v_0_0.Op != OpAnd16 { 26896 break 26897 } 26898 _ = v_0_0.Args[1] 26899 v_0_0_1 := v_0_0.Args[1] 26900 if v_0_0_1.Op != OpConst16 { 26901 break 26902 } 26903 c := v_0_0_1.AuxInt 26904 v_1 := v.Args[1] 26905 if v_1.Op != OpConst64 { 26906 break 26907 } 26908 d := v_1.AuxInt 26909 if !(0 <= c && c < d) { 26910 break 26911 } 26912 v.reset(OpConstBool) 26913 v.AuxInt = 1 26914 return true 26915 } 26916 // match: (IsInBounds (And32 (Const32 [c]) _) (Const32 [d])) 26917 // cond: 0 <= c && c < d 26918 // result: (ConstBool [1]) 26919 for { 26920 _ = v.Args[1] 26921 v_0 := v.Args[0] 26922 if v_0.Op != OpAnd32 { 26923 break 26924 } 26925 _ = v_0.Args[1] 26926 v_0_0 := v_0.Args[0] 26927 if v_0_0.Op != OpConst32 { 26928 break 26929 } 26930 c := v_0_0.AuxInt 26931 v_1 := v.Args[1] 26932 if v_1.Op != OpConst32 { 26933 break 26934 } 26935 d := v_1.AuxInt 26936 if !(0 <= c && c < d) { 26937 break 26938 } 26939 v.reset(OpConstBool) 26940 v.AuxInt = 1 26941 return true 26942 } 26943 return false 26944 } 26945 func rewriteValuegeneric_OpIsInBounds_20(v *Value) bool { 26946 // match: (IsInBounds (And32 _ (Const32 [c])) (Const32 [d])) 26947 // cond: 0 <= c && c < d 26948 // result: (ConstBool [1]) 26949 for { 26950 _ = v.Args[1] 26951 v_0 := v.Args[0] 26952 if v_0.Op != OpAnd32 { 26953 break 26954 } 26955 _ = v_0.Args[1] 26956 v_0_1 := v_0.Args[1] 26957 if v_0_1.Op != OpConst32 { 26958 break 26959 } 26960 c := v_0_1.AuxInt 26961 v_1 := v.Args[1] 26962 if v_1.Op != OpConst32 { 26963 break 26964 } 26965 d := v_1.AuxInt 26966 if !(0 <= c && c < d) { 26967 break 26968 } 26969 v.reset(OpConstBool) 26970 v.AuxInt = 1 26971 return true 26972 } 26973 // match: (IsInBounds (ZeroExt32to64 (And32 (Const32 [c]) _)) (Const64 [d])) 26974 // cond: 0 <= c && c < d 26975 // result: (ConstBool [1]) 26976 for { 26977 _ = v.Args[1] 26978 v_0 := v.Args[0] 26979 if v_0.Op != OpZeroExt32to64 { 26980 break 26981 } 26982 v_0_0 := v_0.Args[0] 26983 if v_0_0.Op != OpAnd32 { 26984 break 26985 } 26986 _ = v_0_0.Args[1] 26987 v_0_0_0 := v_0_0.Args[0] 26988 if v_0_0_0.Op != OpConst32 { 26989 break 26990 } 26991 c := v_0_0_0.AuxInt 26992 v_1 := v.Args[1] 26993 if v_1.Op != OpConst64 { 26994 break 26995 } 26996 d := v_1.AuxInt 26997 if !(0 <= c && c < d) { 26998 break 26999 } 27000 v.reset(OpConstBool) 27001 v.AuxInt = 1 27002 return true 27003 } 27004 // match: (IsInBounds (ZeroExt32to64 (And32 _ (Const32 [c]))) (Const64 [d])) 27005 // cond: 0 <= c && c < d 27006 // result: (ConstBool [1]) 27007 for { 27008 _ = v.Args[1] 27009 v_0 := v.Args[0] 27010 if v_0.Op != OpZeroExt32to64 { 27011 break 27012 } 27013 v_0_0 := v_0.Args[0] 27014 if v_0_0.Op != OpAnd32 { 27015 break 27016 } 27017 _ = v_0_0.Args[1] 27018 v_0_0_1 := v_0_0.Args[1] 27019 if v_0_0_1.Op != OpConst32 { 27020 break 27021 } 27022 c := v_0_0_1.AuxInt 27023 v_1 := v.Args[1] 27024 if v_1.Op != OpConst64 { 27025 break 27026 } 27027 d := v_1.AuxInt 27028 if !(0 <= c && c < d) { 27029 break 27030 } 27031 v.reset(OpConstBool) 27032 v.AuxInt = 1 27033 return true 27034 } 27035 // match: (IsInBounds (And64 (Const64 [c]) _) (Const64 [d])) 27036 // cond: 0 <= c && c < d 27037 // result: (ConstBool [1]) 27038 for { 27039 _ = v.Args[1] 27040 v_0 := v.Args[0] 27041 if v_0.Op != OpAnd64 { 27042 break 27043 } 27044 _ = v_0.Args[1] 27045 v_0_0 := v_0.Args[0] 27046 if v_0_0.Op != OpConst64 { 27047 break 27048 } 27049 c := v_0_0.AuxInt 27050 v_1 := v.Args[1] 27051 if v_1.Op != OpConst64 { 27052 break 27053 } 27054 d := v_1.AuxInt 27055 if !(0 <= c && c < d) { 27056 break 27057 } 27058 v.reset(OpConstBool) 27059 v.AuxInt = 1 27060 return true 27061 } 27062 // match: (IsInBounds (And64 _ (Const64 [c])) (Const64 [d])) 27063 // cond: 0 <= c && c < d 27064 // result: (ConstBool [1]) 27065 for { 27066 _ = v.Args[1] 27067 v_0 := v.Args[0] 27068 if v_0.Op != OpAnd64 { 27069 break 27070 } 27071 _ = v_0.Args[1] 27072 v_0_1 := v_0.Args[1] 27073 if v_0_1.Op != OpConst64 { 27074 break 27075 } 27076 c := v_0_1.AuxInt 27077 v_1 := v.Args[1] 27078 if v_1.Op != OpConst64 { 27079 break 27080 } 27081 d := v_1.AuxInt 27082 if !(0 <= c && c < d) { 27083 break 27084 } 27085 v.reset(OpConstBool) 27086 v.AuxInt = 1 27087 return true 27088 } 27089 // match: (IsInBounds (Const32 [c]) (Const32 [d])) 27090 // result: (ConstBool [b2i(0 <= c && c < d)]) 27091 for { 27092 _ = v.Args[1] 27093 v_0 := v.Args[0] 27094 if v_0.Op != OpConst32 { 27095 break 27096 } 27097 c := v_0.AuxInt 27098 v_1 := v.Args[1] 27099 if v_1.Op != OpConst32 { 27100 break 27101 } 27102 d := v_1.AuxInt 27103 v.reset(OpConstBool) 27104 v.AuxInt = b2i(0 <= c && c < d) 27105 return true 27106 } 27107 // match: (IsInBounds (Const64 [c]) (Const64 [d])) 27108 // result: (ConstBool [b2i(0 <= c && c < d)]) 27109 for { 27110 _ = v.Args[1] 27111 v_0 := v.Args[0] 27112 if v_0.Op != OpConst64 { 27113 break 27114 } 27115 c := v_0.AuxInt 27116 v_1 := v.Args[1] 27117 if v_1.Op != OpConst64 { 27118 break 27119 } 27120 d := v_1.AuxInt 27121 v.reset(OpConstBool) 27122 v.AuxInt = b2i(0 <= c && c < d) 27123 return true 27124 } 27125 // match: (IsInBounds (Mod32u _ y) y) 27126 // result: (ConstBool [1]) 27127 for { 27128 y := v.Args[1] 27129 v_0 := v.Args[0] 27130 if v_0.Op != OpMod32u { 27131 break 27132 } 27133 _ = v_0.Args[1] 27134 if y != v_0.Args[1] { 27135 break 27136 } 27137 v.reset(OpConstBool) 27138 v.AuxInt = 1 27139 return true 27140 } 27141 // match: (IsInBounds (Mod64u _ y) y) 27142 // result: (ConstBool [1]) 27143 for { 27144 y := v.Args[1] 27145 v_0 := v.Args[0] 27146 if v_0.Op != OpMod64u { 27147 break 27148 } 27149 _ = v_0.Args[1] 27150 if y != v_0.Args[1] { 27151 break 27152 } 27153 v.reset(OpConstBool) 27154 v.AuxInt = 1 27155 return true 27156 } 27157 // match: (IsInBounds (ZeroExt8to64 (Rsh8Ux64 _ (Const64 [c]))) (Const64 [d])) 27158 // cond: 0 < c && c < 8 && 1<<uint( 8-c)-1 < d 27159 // result: (ConstBool [1]) 27160 for { 27161 _ = v.Args[1] 27162 v_0 := v.Args[0] 27163 if v_0.Op != OpZeroExt8to64 { 27164 break 27165 } 27166 v_0_0 := v_0.Args[0] 27167 if v_0_0.Op != OpRsh8Ux64 { 27168 break 27169 } 27170 _ = v_0_0.Args[1] 27171 v_0_0_1 := v_0_0.Args[1] 27172 if v_0_0_1.Op != OpConst64 { 27173 break 27174 } 27175 c := v_0_0_1.AuxInt 27176 v_1 := v.Args[1] 27177 if v_1.Op != OpConst64 { 27178 break 27179 } 27180 d := v_1.AuxInt 27181 if !(0 < c && c < 8 && 1<<uint(8-c)-1 < d) { 27182 break 27183 } 27184 v.reset(OpConstBool) 27185 v.AuxInt = 1 27186 return true 27187 } 27188 return false 27189 } 27190 func rewriteValuegeneric_OpIsInBounds_30(v *Value) bool { 27191 // match: (IsInBounds (ZeroExt8to32 (Rsh8Ux64 _ (Const64 [c]))) (Const32 [d])) 27192 // cond: 0 < c && c < 8 && 1<<uint( 8-c)-1 < d 27193 // result: (ConstBool [1]) 27194 for { 27195 _ = v.Args[1] 27196 v_0 := v.Args[0] 27197 if v_0.Op != OpZeroExt8to32 { 27198 break 27199 } 27200 v_0_0 := v_0.Args[0] 27201 if v_0_0.Op != OpRsh8Ux64 { 27202 break 27203 } 27204 _ = v_0_0.Args[1] 27205 v_0_0_1 := v_0_0.Args[1] 27206 if v_0_0_1.Op != OpConst64 { 27207 break 27208 } 27209 c := v_0_0_1.AuxInt 27210 v_1 := v.Args[1] 27211 if v_1.Op != OpConst32 { 27212 break 27213 } 27214 d := v_1.AuxInt 27215 if !(0 < c && c < 8 && 1<<uint(8-c)-1 < d) { 27216 break 27217 } 27218 v.reset(OpConstBool) 27219 v.AuxInt = 1 27220 return true 27221 } 27222 // match: (IsInBounds (ZeroExt8to16 (Rsh8Ux64 _ (Const64 [c]))) (Const16 [d])) 27223 // cond: 0 < c && c < 8 && 1<<uint( 8-c)-1 < d 27224 // result: (ConstBool [1]) 27225 for { 27226 _ = v.Args[1] 27227 v_0 := v.Args[0] 27228 if v_0.Op != OpZeroExt8to16 { 27229 break 27230 } 27231 v_0_0 := v_0.Args[0] 27232 if v_0_0.Op != OpRsh8Ux64 { 27233 break 27234 } 27235 _ = v_0_0.Args[1] 27236 v_0_0_1 := v_0_0.Args[1] 27237 if v_0_0_1.Op != OpConst64 { 27238 break 27239 } 27240 c := v_0_0_1.AuxInt 27241 v_1 := v.Args[1] 27242 if v_1.Op != OpConst16 { 27243 break 27244 } 27245 d := v_1.AuxInt 27246 if !(0 < c && c < 8 && 1<<uint(8-c)-1 < d) { 27247 break 27248 } 27249 v.reset(OpConstBool) 27250 v.AuxInt = 1 27251 return true 27252 } 27253 // match: (IsInBounds (Rsh8Ux64 _ (Const64 [c])) (Const64 [d])) 27254 // cond: 0 < c && c < 8 && 1<<uint( 8-c)-1 < d 27255 // result: (ConstBool [1]) 27256 for { 27257 _ = v.Args[1] 27258 v_0 := v.Args[0] 27259 if v_0.Op != OpRsh8Ux64 { 27260 break 27261 } 27262 _ = v_0.Args[1] 27263 v_0_1 := v_0.Args[1] 27264 if v_0_1.Op != OpConst64 { 27265 break 27266 } 27267 c := v_0_1.AuxInt 27268 v_1 := v.Args[1] 27269 if v_1.Op != OpConst64 { 27270 break 27271 } 27272 d := v_1.AuxInt 27273 if !(0 < c && c < 8 && 1<<uint(8-c)-1 < d) { 27274 break 27275 } 27276 v.reset(OpConstBool) 27277 v.AuxInt = 1 27278 return true 27279 } 27280 // match: (IsInBounds (ZeroExt16to64 (Rsh16Ux64 _ (Const64 [c]))) (Const64 [d])) 27281 // cond: 0 < c && c < 16 && 1<<uint(16-c)-1 < d 27282 // result: (ConstBool [1]) 27283 for { 27284 _ = v.Args[1] 27285 v_0 := v.Args[0] 27286 if v_0.Op != OpZeroExt16to64 { 27287 break 27288 } 27289 v_0_0 := v_0.Args[0] 27290 if v_0_0.Op != OpRsh16Ux64 { 27291 break 27292 } 27293 _ = v_0_0.Args[1] 27294 v_0_0_1 := v_0_0.Args[1] 27295 if v_0_0_1.Op != OpConst64 { 27296 break 27297 } 27298 c := v_0_0_1.AuxInt 27299 v_1 := v.Args[1] 27300 if v_1.Op != OpConst64 { 27301 break 27302 } 27303 d := v_1.AuxInt 27304 if !(0 < c && c < 16 && 1<<uint(16-c)-1 < d) { 27305 break 27306 } 27307 v.reset(OpConstBool) 27308 v.AuxInt = 1 27309 return true 27310 } 27311 // match: (IsInBounds (ZeroExt16to32 (Rsh16Ux64 _ (Const64 [c]))) (Const64 [d])) 27312 // cond: 0 < c && c < 16 && 1<<uint(16-c)-1 < d 27313 // result: (ConstBool [1]) 27314 for { 27315 _ = v.Args[1] 27316 v_0 := v.Args[0] 27317 if v_0.Op != OpZeroExt16to32 { 27318 break 27319 } 27320 v_0_0 := v_0.Args[0] 27321 if v_0_0.Op != OpRsh16Ux64 { 27322 break 27323 } 27324 _ = v_0_0.Args[1] 27325 v_0_0_1 := v_0_0.Args[1] 27326 if v_0_0_1.Op != OpConst64 { 27327 break 27328 } 27329 c := v_0_0_1.AuxInt 27330 v_1 := v.Args[1] 27331 if v_1.Op != OpConst64 { 27332 break 27333 } 27334 d := v_1.AuxInt 27335 if !(0 < c && c < 16 && 1<<uint(16-c)-1 < d) { 27336 break 27337 } 27338 v.reset(OpConstBool) 27339 v.AuxInt = 1 27340 return true 27341 } 27342 // match: (IsInBounds (Rsh16Ux64 _ (Const64 [c])) (Const64 [d])) 27343 // cond: 0 < c && c < 16 && 1<<uint(16-c)-1 < d 27344 // result: (ConstBool [1]) 27345 for { 27346 _ = v.Args[1] 27347 v_0 := v.Args[0] 27348 if v_0.Op != OpRsh16Ux64 { 27349 break 27350 } 27351 _ = v_0.Args[1] 27352 v_0_1 := v_0.Args[1] 27353 if v_0_1.Op != OpConst64 { 27354 break 27355 } 27356 c := v_0_1.AuxInt 27357 v_1 := v.Args[1] 27358 if v_1.Op != OpConst64 { 27359 break 27360 } 27361 d := v_1.AuxInt 27362 if !(0 < c && c < 16 && 1<<uint(16-c)-1 < d) { 27363 break 27364 } 27365 v.reset(OpConstBool) 27366 v.AuxInt = 1 27367 return true 27368 } 27369 // match: (IsInBounds (ZeroExt32to64 (Rsh32Ux64 _ (Const64 [c]))) (Const64 [d])) 27370 // cond: 0 < c && c < 32 && 1<<uint(32-c)-1 < d 27371 // result: (ConstBool [1]) 27372 for { 27373 _ = v.Args[1] 27374 v_0 := v.Args[0] 27375 if v_0.Op != OpZeroExt32to64 { 27376 break 27377 } 27378 v_0_0 := v_0.Args[0] 27379 if v_0_0.Op != OpRsh32Ux64 { 27380 break 27381 } 27382 _ = v_0_0.Args[1] 27383 v_0_0_1 := v_0_0.Args[1] 27384 if v_0_0_1.Op != OpConst64 { 27385 break 27386 } 27387 c := v_0_0_1.AuxInt 27388 v_1 := v.Args[1] 27389 if v_1.Op != OpConst64 { 27390 break 27391 } 27392 d := v_1.AuxInt 27393 if !(0 < c && c < 32 && 1<<uint(32-c)-1 < d) { 27394 break 27395 } 27396 v.reset(OpConstBool) 27397 v.AuxInt = 1 27398 return true 27399 } 27400 // match: (IsInBounds (Rsh32Ux64 _ (Const64 [c])) (Const64 [d])) 27401 // cond: 0 < c && c < 32 && 1<<uint(32-c)-1 < d 27402 // result: (ConstBool [1]) 27403 for { 27404 _ = v.Args[1] 27405 v_0 := v.Args[0] 27406 if v_0.Op != OpRsh32Ux64 { 27407 break 27408 } 27409 _ = v_0.Args[1] 27410 v_0_1 := v_0.Args[1] 27411 if v_0_1.Op != OpConst64 { 27412 break 27413 } 27414 c := v_0_1.AuxInt 27415 v_1 := v.Args[1] 27416 if v_1.Op != OpConst64 { 27417 break 27418 } 27419 d := v_1.AuxInt 27420 if !(0 < c && c < 32 && 1<<uint(32-c)-1 < d) { 27421 break 27422 } 27423 v.reset(OpConstBool) 27424 v.AuxInt = 1 27425 return true 27426 } 27427 // match: (IsInBounds (Rsh64Ux64 _ (Const64 [c])) (Const64 [d])) 27428 // cond: 0 < c && c < 64 && 1<<uint(64-c)-1 < d 27429 // result: (ConstBool [1]) 27430 for { 27431 _ = v.Args[1] 27432 v_0 := v.Args[0] 27433 if v_0.Op != OpRsh64Ux64 { 27434 break 27435 } 27436 _ = v_0.Args[1] 27437 v_0_1 := v_0.Args[1] 27438 if v_0_1.Op != OpConst64 { 27439 break 27440 } 27441 c := v_0_1.AuxInt 27442 v_1 := v.Args[1] 27443 if v_1.Op != OpConst64 { 27444 break 27445 } 27446 d := v_1.AuxInt 27447 if !(0 < c && c < 64 && 1<<uint(64-c)-1 < d) { 27448 break 27449 } 27450 v.reset(OpConstBool) 27451 v.AuxInt = 1 27452 return true 27453 } 27454 return false 27455 } 27456 func rewriteValuegeneric_OpIsNonNil_0(v *Value) bool { 27457 // match: (IsNonNil (ConstNil)) 27458 // result: (ConstBool [0]) 27459 for { 27460 v_0 := v.Args[0] 27461 if v_0.Op != OpConstNil { 27462 break 27463 } 27464 v.reset(OpConstBool) 27465 v.AuxInt = 0 27466 return true 27467 } 27468 // match: (IsNonNil (Const32 [c])) 27469 // result: (ConstBool [b2i(c != 0)]) 27470 for { 27471 v_0 := v.Args[0] 27472 if v_0.Op != OpConst32 { 27473 break 27474 } 27475 c := v_0.AuxInt 27476 v.reset(OpConstBool) 27477 v.AuxInt = b2i(c != 0) 27478 return true 27479 } 27480 // match: (IsNonNil (Const64 [c])) 27481 // result: (ConstBool [b2i(c != 0)]) 27482 for { 27483 v_0 := v.Args[0] 27484 if v_0.Op != OpConst64 { 27485 break 27486 } 27487 c := v_0.AuxInt 27488 v.reset(OpConstBool) 27489 v.AuxInt = b2i(c != 0) 27490 return true 27491 } 27492 // match: (IsNonNil (Addr _)) 27493 // result: (ConstBool [1]) 27494 for { 27495 v_0 := v.Args[0] 27496 if v_0.Op != OpAddr { 27497 break 27498 } 27499 v.reset(OpConstBool) 27500 v.AuxInt = 1 27501 return true 27502 } 27503 // match: (IsNonNil (LocalAddr _ _)) 27504 // result: (ConstBool [1]) 27505 for { 27506 v_0 := v.Args[0] 27507 if v_0.Op != OpLocalAddr { 27508 break 27509 } 27510 _ = v_0.Args[1] 27511 v.reset(OpConstBool) 27512 v.AuxInt = 1 27513 return true 27514 } 27515 return false 27516 } 27517 func rewriteValuegeneric_OpIsSliceInBounds_0(v *Value) bool { 27518 // match: (IsSliceInBounds x x) 27519 // result: (ConstBool [1]) 27520 for { 27521 x := v.Args[1] 27522 if x != v.Args[0] { 27523 break 27524 } 27525 v.reset(OpConstBool) 27526 v.AuxInt = 1 27527 return true 27528 } 27529 // match: (IsSliceInBounds (And32 (Const32 [c]) _) (Const32 [d])) 27530 // cond: 0 <= c && c <= d 27531 // result: (ConstBool [1]) 27532 for { 27533 _ = v.Args[1] 27534 v_0 := v.Args[0] 27535 if v_0.Op != OpAnd32 { 27536 break 27537 } 27538 _ = v_0.Args[1] 27539 v_0_0 := v_0.Args[0] 27540 if v_0_0.Op != OpConst32 { 27541 break 27542 } 27543 c := v_0_0.AuxInt 27544 v_1 := v.Args[1] 27545 if v_1.Op != OpConst32 { 27546 break 27547 } 27548 d := v_1.AuxInt 27549 if !(0 <= c && c <= d) { 27550 break 27551 } 27552 v.reset(OpConstBool) 27553 v.AuxInt = 1 27554 return true 27555 } 27556 // match: (IsSliceInBounds (And32 _ (Const32 [c])) (Const32 [d])) 27557 // cond: 0 <= c && c <= d 27558 // result: (ConstBool [1]) 27559 for { 27560 _ = v.Args[1] 27561 v_0 := v.Args[0] 27562 if v_0.Op != OpAnd32 { 27563 break 27564 } 27565 _ = v_0.Args[1] 27566 v_0_1 := v_0.Args[1] 27567 if v_0_1.Op != OpConst32 { 27568 break 27569 } 27570 c := v_0_1.AuxInt 27571 v_1 := v.Args[1] 27572 if v_1.Op != OpConst32 { 27573 break 27574 } 27575 d := v_1.AuxInt 27576 if !(0 <= c && c <= d) { 27577 break 27578 } 27579 v.reset(OpConstBool) 27580 v.AuxInt = 1 27581 return true 27582 } 27583 // match: (IsSliceInBounds (And64 (Const64 [c]) _) (Const64 [d])) 27584 // cond: 0 <= c && c <= d 27585 // result: (ConstBool [1]) 27586 for { 27587 _ = v.Args[1] 27588 v_0 := v.Args[0] 27589 if v_0.Op != OpAnd64 { 27590 break 27591 } 27592 _ = v_0.Args[1] 27593 v_0_0 := v_0.Args[0] 27594 if v_0_0.Op != OpConst64 { 27595 break 27596 } 27597 c := v_0_0.AuxInt 27598 v_1 := v.Args[1] 27599 if v_1.Op != OpConst64 { 27600 break 27601 } 27602 d := v_1.AuxInt 27603 if !(0 <= c && c <= d) { 27604 break 27605 } 27606 v.reset(OpConstBool) 27607 v.AuxInt = 1 27608 return true 27609 } 27610 // match: (IsSliceInBounds (And64 _ (Const64 [c])) (Const64 [d])) 27611 // cond: 0 <= c && c <= d 27612 // result: (ConstBool [1]) 27613 for { 27614 _ = v.Args[1] 27615 v_0 := v.Args[0] 27616 if v_0.Op != OpAnd64 { 27617 break 27618 } 27619 _ = v_0.Args[1] 27620 v_0_1 := v_0.Args[1] 27621 if v_0_1.Op != OpConst64 { 27622 break 27623 } 27624 c := v_0_1.AuxInt 27625 v_1 := v.Args[1] 27626 if v_1.Op != OpConst64 { 27627 break 27628 } 27629 d := v_1.AuxInt 27630 if !(0 <= c && c <= d) { 27631 break 27632 } 27633 v.reset(OpConstBool) 27634 v.AuxInt = 1 27635 return true 27636 } 27637 // match: (IsSliceInBounds (Const32 [0]) _) 27638 // result: (ConstBool [1]) 27639 for { 27640 _ = v.Args[1] 27641 v_0 := v.Args[0] 27642 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 27643 break 27644 } 27645 v.reset(OpConstBool) 27646 v.AuxInt = 1 27647 return true 27648 } 27649 // match: (IsSliceInBounds (Const64 [0]) _) 27650 // result: (ConstBool [1]) 27651 for { 27652 _ = v.Args[1] 27653 v_0 := v.Args[0] 27654 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 27655 break 27656 } 27657 v.reset(OpConstBool) 27658 v.AuxInt = 1 27659 return true 27660 } 27661 // match: (IsSliceInBounds (Const32 [c]) (Const32 [d])) 27662 // result: (ConstBool [b2i(0 <= c && c <= d)]) 27663 for { 27664 _ = v.Args[1] 27665 v_0 := v.Args[0] 27666 if v_0.Op != OpConst32 { 27667 break 27668 } 27669 c := v_0.AuxInt 27670 v_1 := v.Args[1] 27671 if v_1.Op != OpConst32 { 27672 break 27673 } 27674 d := v_1.AuxInt 27675 v.reset(OpConstBool) 27676 v.AuxInt = b2i(0 <= c && c <= d) 27677 return true 27678 } 27679 // match: (IsSliceInBounds (Const64 [c]) (Const64 [d])) 27680 // result: (ConstBool [b2i(0 <= c && c <= d)]) 27681 for { 27682 _ = v.Args[1] 27683 v_0 := v.Args[0] 27684 if v_0.Op != OpConst64 { 27685 break 27686 } 27687 c := v_0.AuxInt 27688 v_1 := v.Args[1] 27689 if v_1.Op != OpConst64 { 27690 break 27691 } 27692 d := v_1.AuxInt 27693 v.reset(OpConstBool) 27694 v.AuxInt = b2i(0 <= c && c <= d) 27695 return true 27696 } 27697 // match: (IsSliceInBounds (SliceLen x) (SliceCap x)) 27698 // result: (ConstBool [1]) 27699 for { 27700 _ = v.Args[1] 27701 v_0 := v.Args[0] 27702 if v_0.Op != OpSliceLen { 27703 break 27704 } 27705 x := v_0.Args[0] 27706 v_1 := v.Args[1] 27707 if v_1.Op != OpSliceCap || x != v_1.Args[0] { 27708 break 27709 } 27710 v.reset(OpConstBool) 27711 v.AuxInt = 1 27712 return true 27713 } 27714 return false 27715 } 27716 func rewriteValuegeneric_OpLeq16_0(v *Value) bool { 27717 // match: (Leq16 (Const16 [c]) (Const16 [d])) 27718 // result: (ConstBool [b2i(c <= d)]) 27719 for { 27720 _ = v.Args[1] 27721 v_0 := v.Args[0] 27722 if v_0.Op != OpConst16 { 27723 break 27724 } 27725 c := v_0.AuxInt 27726 v_1 := v.Args[1] 27727 if v_1.Op != OpConst16 { 27728 break 27729 } 27730 d := v_1.AuxInt 27731 v.reset(OpConstBool) 27732 v.AuxInt = b2i(c <= d) 27733 return true 27734 } 27735 return false 27736 } 27737 func rewriteValuegeneric_OpLeq16U_0(v *Value) bool { 27738 // match: (Leq16U (Const16 [c]) (Const16 [d])) 27739 // result: (ConstBool [b2i(uint16(c) <= uint16(d))]) 27740 for { 27741 _ = v.Args[1] 27742 v_0 := v.Args[0] 27743 if v_0.Op != OpConst16 { 27744 break 27745 } 27746 c := v_0.AuxInt 27747 v_1 := v.Args[1] 27748 if v_1.Op != OpConst16 { 27749 break 27750 } 27751 d := v_1.AuxInt 27752 v.reset(OpConstBool) 27753 v.AuxInt = b2i(uint16(c) <= uint16(d)) 27754 return true 27755 } 27756 return false 27757 } 27758 func rewriteValuegeneric_OpLeq32_0(v *Value) bool { 27759 // match: (Leq32 (Const32 [c]) (Const32 [d])) 27760 // result: (ConstBool [b2i(c <= d)]) 27761 for { 27762 _ = v.Args[1] 27763 v_0 := v.Args[0] 27764 if v_0.Op != OpConst32 { 27765 break 27766 } 27767 c := v_0.AuxInt 27768 v_1 := v.Args[1] 27769 if v_1.Op != OpConst32 { 27770 break 27771 } 27772 d := v_1.AuxInt 27773 v.reset(OpConstBool) 27774 v.AuxInt = b2i(c <= d) 27775 return true 27776 } 27777 return false 27778 } 27779 func rewriteValuegeneric_OpLeq32F_0(v *Value) bool { 27780 // match: (Leq32F (Const32F [c]) (Const32F [d])) 27781 // result: (ConstBool [b2i(auxTo32F(c) <= auxTo32F(d))]) 27782 for { 27783 _ = v.Args[1] 27784 v_0 := v.Args[0] 27785 if v_0.Op != OpConst32F { 27786 break 27787 } 27788 c := v_0.AuxInt 27789 v_1 := v.Args[1] 27790 if v_1.Op != OpConst32F { 27791 break 27792 } 27793 d := v_1.AuxInt 27794 v.reset(OpConstBool) 27795 v.AuxInt = b2i(auxTo32F(c) <= auxTo32F(d)) 27796 return true 27797 } 27798 return false 27799 } 27800 func rewriteValuegeneric_OpLeq32U_0(v *Value) bool { 27801 // match: (Leq32U (Const32 [c]) (Const32 [d])) 27802 // result: (ConstBool [b2i(uint32(c) <= uint32(d))]) 27803 for { 27804 _ = v.Args[1] 27805 v_0 := v.Args[0] 27806 if v_0.Op != OpConst32 { 27807 break 27808 } 27809 c := v_0.AuxInt 27810 v_1 := v.Args[1] 27811 if v_1.Op != OpConst32 { 27812 break 27813 } 27814 d := v_1.AuxInt 27815 v.reset(OpConstBool) 27816 v.AuxInt = b2i(uint32(c) <= uint32(d)) 27817 return true 27818 } 27819 return false 27820 } 27821 func rewriteValuegeneric_OpLeq64_0(v *Value) bool { 27822 // match: (Leq64 (Const64 [c]) (Const64 [d])) 27823 // result: (ConstBool [b2i(c <= d)]) 27824 for { 27825 _ = v.Args[1] 27826 v_0 := v.Args[0] 27827 if v_0.Op != OpConst64 { 27828 break 27829 } 27830 c := v_0.AuxInt 27831 v_1 := v.Args[1] 27832 if v_1.Op != OpConst64 { 27833 break 27834 } 27835 d := v_1.AuxInt 27836 v.reset(OpConstBool) 27837 v.AuxInt = b2i(c <= d) 27838 return true 27839 } 27840 return false 27841 } 27842 func rewriteValuegeneric_OpLeq64F_0(v *Value) bool { 27843 // match: (Leq64F (Const64F [c]) (Const64F [d])) 27844 // result: (ConstBool [b2i(auxTo64F(c) <= auxTo64F(d))]) 27845 for { 27846 _ = v.Args[1] 27847 v_0 := v.Args[0] 27848 if v_0.Op != OpConst64F { 27849 break 27850 } 27851 c := v_0.AuxInt 27852 v_1 := v.Args[1] 27853 if v_1.Op != OpConst64F { 27854 break 27855 } 27856 d := v_1.AuxInt 27857 v.reset(OpConstBool) 27858 v.AuxInt = b2i(auxTo64F(c) <= auxTo64F(d)) 27859 return true 27860 } 27861 return false 27862 } 27863 func rewriteValuegeneric_OpLeq64U_0(v *Value) bool { 27864 // match: (Leq64U (Const64 [c]) (Const64 [d])) 27865 // result: (ConstBool [b2i(uint64(c) <= uint64(d))]) 27866 for { 27867 _ = v.Args[1] 27868 v_0 := v.Args[0] 27869 if v_0.Op != OpConst64 { 27870 break 27871 } 27872 c := v_0.AuxInt 27873 v_1 := v.Args[1] 27874 if v_1.Op != OpConst64 { 27875 break 27876 } 27877 d := v_1.AuxInt 27878 v.reset(OpConstBool) 27879 v.AuxInt = b2i(uint64(c) <= uint64(d)) 27880 return true 27881 } 27882 return false 27883 } 27884 func rewriteValuegeneric_OpLeq8_0(v *Value) bool { 27885 // match: (Leq8 (Const8 [c]) (Const8 [d])) 27886 // result: (ConstBool [b2i(c <= d)]) 27887 for { 27888 _ = v.Args[1] 27889 v_0 := v.Args[0] 27890 if v_0.Op != OpConst8 { 27891 break 27892 } 27893 c := v_0.AuxInt 27894 v_1 := v.Args[1] 27895 if v_1.Op != OpConst8 { 27896 break 27897 } 27898 d := v_1.AuxInt 27899 v.reset(OpConstBool) 27900 v.AuxInt = b2i(c <= d) 27901 return true 27902 } 27903 return false 27904 } 27905 func rewriteValuegeneric_OpLeq8U_0(v *Value) bool { 27906 // match: (Leq8U (Const8 [c]) (Const8 [d])) 27907 // result: (ConstBool [b2i(uint8(c) <= uint8(d))]) 27908 for { 27909 _ = v.Args[1] 27910 v_0 := v.Args[0] 27911 if v_0.Op != OpConst8 { 27912 break 27913 } 27914 c := v_0.AuxInt 27915 v_1 := v.Args[1] 27916 if v_1.Op != OpConst8 { 27917 break 27918 } 27919 d := v_1.AuxInt 27920 v.reset(OpConstBool) 27921 v.AuxInt = b2i(uint8(c) <= uint8(d)) 27922 return true 27923 } 27924 return false 27925 } 27926 func rewriteValuegeneric_OpLess16_0(v *Value) bool { 27927 // match: (Less16 (Const16 [c]) (Const16 [d])) 27928 // result: (ConstBool [b2i(c < d)]) 27929 for { 27930 _ = v.Args[1] 27931 v_0 := v.Args[0] 27932 if v_0.Op != OpConst16 { 27933 break 27934 } 27935 c := v_0.AuxInt 27936 v_1 := v.Args[1] 27937 if v_1.Op != OpConst16 { 27938 break 27939 } 27940 d := v_1.AuxInt 27941 v.reset(OpConstBool) 27942 v.AuxInt = b2i(c < d) 27943 return true 27944 } 27945 return false 27946 } 27947 func rewriteValuegeneric_OpLess16U_0(v *Value) bool { 27948 // match: (Less16U (Const16 [c]) (Const16 [d])) 27949 // result: (ConstBool [b2i(uint16(c) < uint16(d))]) 27950 for { 27951 _ = v.Args[1] 27952 v_0 := v.Args[0] 27953 if v_0.Op != OpConst16 { 27954 break 27955 } 27956 c := v_0.AuxInt 27957 v_1 := v.Args[1] 27958 if v_1.Op != OpConst16 { 27959 break 27960 } 27961 d := v_1.AuxInt 27962 v.reset(OpConstBool) 27963 v.AuxInt = b2i(uint16(c) < uint16(d)) 27964 return true 27965 } 27966 return false 27967 } 27968 func rewriteValuegeneric_OpLess32_0(v *Value) bool { 27969 // match: (Less32 (Const32 [c]) (Const32 [d])) 27970 // result: (ConstBool [b2i(c < d)]) 27971 for { 27972 _ = v.Args[1] 27973 v_0 := v.Args[0] 27974 if v_0.Op != OpConst32 { 27975 break 27976 } 27977 c := v_0.AuxInt 27978 v_1 := v.Args[1] 27979 if v_1.Op != OpConst32 { 27980 break 27981 } 27982 d := v_1.AuxInt 27983 v.reset(OpConstBool) 27984 v.AuxInt = b2i(c < d) 27985 return true 27986 } 27987 return false 27988 } 27989 func rewriteValuegeneric_OpLess32F_0(v *Value) bool { 27990 // match: (Less32F (Const32F [c]) (Const32F [d])) 27991 // result: (ConstBool [b2i(auxTo32F(c) < auxTo32F(d))]) 27992 for { 27993 _ = v.Args[1] 27994 v_0 := v.Args[0] 27995 if v_0.Op != OpConst32F { 27996 break 27997 } 27998 c := v_0.AuxInt 27999 v_1 := v.Args[1] 28000 if v_1.Op != OpConst32F { 28001 break 28002 } 28003 d := v_1.AuxInt 28004 v.reset(OpConstBool) 28005 v.AuxInt = b2i(auxTo32F(c) < auxTo32F(d)) 28006 return true 28007 } 28008 return false 28009 } 28010 func rewriteValuegeneric_OpLess32U_0(v *Value) bool { 28011 // match: (Less32U (Const32 [c]) (Const32 [d])) 28012 // result: (ConstBool [b2i(uint32(c) < uint32(d))]) 28013 for { 28014 _ = v.Args[1] 28015 v_0 := v.Args[0] 28016 if v_0.Op != OpConst32 { 28017 break 28018 } 28019 c := v_0.AuxInt 28020 v_1 := v.Args[1] 28021 if v_1.Op != OpConst32 { 28022 break 28023 } 28024 d := v_1.AuxInt 28025 v.reset(OpConstBool) 28026 v.AuxInt = b2i(uint32(c) < uint32(d)) 28027 return true 28028 } 28029 return false 28030 } 28031 func rewriteValuegeneric_OpLess64_0(v *Value) bool { 28032 // match: (Less64 (Const64 [c]) (Const64 [d])) 28033 // result: (ConstBool [b2i(c < d)]) 28034 for { 28035 _ = v.Args[1] 28036 v_0 := v.Args[0] 28037 if v_0.Op != OpConst64 { 28038 break 28039 } 28040 c := v_0.AuxInt 28041 v_1 := v.Args[1] 28042 if v_1.Op != OpConst64 { 28043 break 28044 } 28045 d := v_1.AuxInt 28046 v.reset(OpConstBool) 28047 v.AuxInt = b2i(c < d) 28048 return true 28049 } 28050 return false 28051 } 28052 func rewriteValuegeneric_OpLess64F_0(v *Value) bool { 28053 // match: (Less64F (Const64F [c]) (Const64F [d])) 28054 // result: (ConstBool [b2i(auxTo64F(c) < auxTo64F(d))]) 28055 for { 28056 _ = v.Args[1] 28057 v_0 := v.Args[0] 28058 if v_0.Op != OpConst64F { 28059 break 28060 } 28061 c := v_0.AuxInt 28062 v_1 := v.Args[1] 28063 if v_1.Op != OpConst64F { 28064 break 28065 } 28066 d := v_1.AuxInt 28067 v.reset(OpConstBool) 28068 v.AuxInt = b2i(auxTo64F(c) < auxTo64F(d)) 28069 return true 28070 } 28071 return false 28072 } 28073 func rewriteValuegeneric_OpLess64U_0(v *Value) bool { 28074 // match: (Less64U (Const64 [c]) (Const64 [d])) 28075 // result: (ConstBool [b2i(uint64(c) < uint64(d))]) 28076 for { 28077 _ = v.Args[1] 28078 v_0 := v.Args[0] 28079 if v_0.Op != OpConst64 { 28080 break 28081 } 28082 c := v_0.AuxInt 28083 v_1 := v.Args[1] 28084 if v_1.Op != OpConst64 { 28085 break 28086 } 28087 d := v_1.AuxInt 28088 v.reset(OpConstBool) 28089 v.AuxInt = b2i(uint64(c) < uint64(d)) 28090 return true 28091 } 28092 return false 28093 } 28094 func rewriteValuegeneric_OpLess8_0(v *Value) bool { 28095 // match: (Less8 (Const8 [c]) (Const8 [d])) 28096 // result: (ConstBool [b2i(c < d)]) 28097 for { 28098 _ = v.Args[1] 28099 v_0 := v.Args[0] 28100 if v_0.Op != OpConst8 { 28101 break 28102 } 28103 c := v_0.AuxInt 28104 v_1 := v.Args[1] 28105 if v_1.Op != OpConst8 { 28106 break 28107 } 28108 d := v_1.AuxInt 28109 v.reset(OpConstBool) 28110 v.AuxInt = b2i(c < d) 28111 return true 28112 } 28113 return false 28114 } 28115 func rewriteValuegeneric_OpLess8U_0(v *Value) bool { 28116 // match: (Less8U (Const8 [c]) (Const8 [d])) 28117 // result: (ConstBool [b2i(uint8(c) < uint8(d))]) 28118 for { 28119 _ = v.Args[1] 28120 v_0 := v.Args[0] 28121 if v_0.Op != OpConst8 { 28122 break 28123 } 28124 c := v_0.AuxInt 28125 v_1 := v.Args[1] 28126 if v_1.Op != OpConst8 { 28127 break 28128 } 28129 d := v_1.AuxInt 28130 v.reset(OpConstBool) 28131 v.AuxInt = b2i(uint8(c) < uint8(d)) 28132 return true 28133 } 28134 return false 28135 } 28136 func rewriteValuegeneric_OpLoad_0(v *Value) bool { 28137 b := v.Block 28138 fe := b.Func.fe 28139 // match: (Load <t1> p1 (Store {t2} p2 x _)) 28140 // cond: isSamePtr(p1, p2) && t1.Compare(x.Type) == types.CMPeq && t1.Size() == sizeof(t2) 28141 // result: x 28142 for { 28143 t1 := v.Type 28144 _ = v.Args[1] 28145 p1 := v.Args[0] 28146 v_1 := v.Args[1] 28147 if v_1.Op != OpStore { 28148 break 28149 } 28150 t2 := v_1.Aux 28151 _ = v_1.Args[2] 28152 p2 := v_1.Args[0] 28153 x := v_1.Args[1] 28154 if !(isSamePtr(p1, p2) && t1.Compare(x.Type) == types.CMPeq && t1.Size() == sizeof(t2)) { 28155 break 28156 } 28157 v.reset(OpCopy) 28158 v.Type = x.Type 28159 v.AddArg(x) 28160 return true 28161 } 28162 // match: (Load <t1> p1 (Store {t2} p2 _ (Store {t3} p3 x _))) 28163 // cond: isSamePtr(p1, p3) && t1.Compare(x.Type) == types.CMPeq && t1.Size() == sizeof(t2) && disjoint(p3, sizeof(t3), p2, sizeof(t2)) 28164 // result: x 28165 for { 28166 t1 := v.Type 28167 _ = v.Args[1] 28168 p1 := v.Args[0] 28169 v_1 := v.Args[1] 28170 if v_1.Op != OpStore { 28171 break 28172 } 28173 t2 := v_1.Aux 28174 _ = v_1.Args[2] 28175 p2 := v_1.Args[0] 28176 v_1_2 := v_1.Args[2] 28177 if v_1_2.Op != OpStore { 28178 break 28179 } 28180 t3 := v_1_2.Aux 28181 _ = v_1_2.Args[2] 28182 p3 := v_1_2.Args[0] 28183 x := v_1_2.Args[1] 28184 if !(isSamePtr(p1, p3) && t1.Compare(x.Type) == types.CMPeq && t1.Size() == sizeof(t2) && disjoint(p3, sizeof(t3), p2, sizeof(t2))) { 28185 break 28186 } 28187 v.reset(OpCopy) 28188 v.Type = x.Type 28189 v.AddArg(x) 28190 return true 28191 } 28192 // match: (Load <t1> p1 (Store {t2} p2 _ (Store {t3} p3 _ (Store {t4} p4 x _)))) 28193 // cond: isSamePtr(p1, p4) && t1.Compare(x.Type) == types.CMPeq && t1.Size() == sizeof(t2) && disjoint(p4, sizeof(t4), p2, sizeof(t2)) && disjoint(p4, sizeof(t4), p3, sizeof(t3)) 28194 // result: x 28195 for { 28196 t1 := v.Type 28197 _ = v.Args[1] 28198 p1 := v.Args[0] 28199 v_1 := v.Args[1] 28200 if v_1.Op != OpStore { 28201 break 28202 } 28203 t2 := v_1.Aux 28204 _ = v_1.Args[2] 28205 p2 := v_1.Args[0] 28206 v_1_2 := v_1.Args[2] 28207 if v_1_2.Op != OpStore { 28208 break 28209 } 28210 t3 := v_1_2.Aux 28211 _ = v_1_2.Args[2] 28212 p3 := v_1_2.Args[0] 28213 v_1_2_2 := v_1_2.Args[2] 28214 if v_1_2_2.Op != OpStore { 28215 break 28216 } 28217 t4 := v_1_2_2.Aux 28218 _ = v_1_2_2.Args[2] 28219 p4 := v_1_2_2.Args[0] 28220 x := v_1_2_2.Args[1] 28221 if !(isSamePtr(p1, p4) && t1.Compare(x.Type) == types.CMPeq && t1.Size() == sizeof(t2) && disjoint(p4, sizeof(t4), p2, sizeof(t2)) && disjoint(p4, sizeof(t4), p3, sizeof(t3))) { 28222 break 28223 } 28224 v.reset(OpCopy) 28225 v.Type = x.Type 28226 v.AddArg(x) 28227 return true 28228 } 28229 // match: (Load <t1> p1 (Store {t2} p2 _ (Store {t3} p3 _ (Store {t4} p4 _ (Store {t5} p5 x _))))) 28230 // cond: isSamePtr(p1, p5) && t1.Compare(x.Type) == types.CMPeq && t1.Size() == sizeof(t2) && disjoint(p5, sizeof(t5), p2, sizeof(t2)) && disjoint(p5, sizeof(t5), p3, sizeof(t3)) && disjoint(p5, sizeof(t5), p4, sizeof(t4)) 28231 // result: x 28232 for { 28233 t1 := v.Type 28234 _ = v.Args[1] 28235 p1 := v.Args[0] 28236 v_1 := v.Args[1] 28237 if v_1.Op != OpStore { 28238 break 28239 } 28240 t2 := v_1.Aux 28241 _ = v_1.Args[2] 28242 p2 := v_1.Args[0] 28243 v_1_2 := v_1.Args[2] 28244 if v_1_2.Op != OpStore { 28245 break 28246 } 28247 t3 := v_1_2.Aux 28248 _ = v_1_2.Args[2] 28249 p3 := v_1_2.Args[0] 28250 v_1_2_2 := v_1_2.Args[2] 28251 if v_1_2_2.Op != OpStore { 28252 break 28253 } 28254 t4 := v_1_2_2.Aux 28255 _ = v_1_2_2.Args[2] 28256 p4 := v_1_2_2.Args[0] 28257 v_1_2_2_2 := v_1_2_2.Args[2] 28258 if v_1_2_2_2.Op != OpStore { 28259 break 28260 } 28261 t5 := v_1_2_2_2.Aux 28262 _ = v_1_2_2_2.Args[2] 28263 p5 := v_1_2_2_2.Args[0] 28264 x := v_1_2_2_2.Args[1] 28265 if !(isSamePtr(p1, p5) && t1.Compare(x.Type) == types.CMPeq && t1.Size() == sizeof(t2) && disjoint(p5, sizeof(t5), p2, sizeof(t2)) && disjoint(p5, sizeof(t5), p3, sizeof(t3)) && disjoint(p5, sizeof(t5), p4, sizeof(t4))) { 28266 break 28267 } 28268 v.reset(OpCopy) 28269 v.Type = x.Type 28270 v.AddArg(x) 28271 return true 28272 } 28273 // match: (Load <t1> p1 (Store {t2} p2 (Const64 [x]) _)) 28274 // cond: isSamePtr(p1,p2) && sizeof(t2) == 8 && is64BitFloat(t1) 28275 // result: (Const64F [x]) 28276 for { 28277 t1 := v.Type 28278 _ = v.Args[1] 28279 p1 := v.Args[0] 28280 v_1 := v.Args[1] 28281 if v_1.Op != OpStore { 28282 break 28283 } 28284 t2 := v_1.Aux 28285 _ = v_1.Args[2] 28286 p2 := v_1.Args[0] 28287 v_1_1 := v_1.Args[1] 28288 if v_1_1.Op != OpConst64 { 28289 break 28290 } 28291 x := v_1_1.AuxInt 28292 if !(isSamePtr(p1, p2) && sizeof(t2) == 8 && is64BitFloat(t1)) { 28293 break 28294 } 28295 v.reset(OpConst64F) 28296 v.AuxInt = x 28297 return true 28298 } 28299 // match: (Load <t1> p1 (Store {t2} p2 (Const32 [x]) _)) 28300 // cond: isSamePtr(p1,p2) && sizeof(t2) == 4 && is32BitFloat(t1) 28301 // result: (Const32F [auxFrom32F(math.Float32frombits(uint32(x)))]) 28302 for { 28303 t1 := v.Type 28304 _ = v.Args[1] 28305 p1 := v.Args[0] 28306 v_1 := v.Args[1] 28307 if v_1.Op != OpStore { 28308 break 28309 } 28310 t2 := v_1.Aux 28311 _ = v_1.Args[2] 28312 p2 := v_1.Args[0] 28313 v_1_1 := v_1.Args[1] 28314 if v_1_1.Op != OpConst32 { 28315 break 28316 } 28317 x := v_1_1.AuxInt 28318 if !(isSamePtr(p1, p2) && sizeof(t2) == 4 && is32BitFloat(t1)) { 28319 break 28320 } 28321 v.reset(OpConst32F) 28322 v.AuxInt = auxFrom32F(math.Float32frombits(uint32(x))) 28323 return true 28324 } 28325 // match: (Load <t1> p1 (Store {t2} p2 (Const64F [x]) _)) 28326 // cond: isSamePtr(p1,p2) && sizeof(t2) == 8 && is64BitInt(t1) 28327 // result: (Const64 [x]) 28328 for { 28329 t1 := v.Type 28330 _ = v.Args[1] 28331 p1 := v.Args[0] 28332 v_1 := v.Args[1] 28333 if v_1.Op != OpStore { 28334 break 28335 } 28336 t2 := v_1.Aux 28337 _ = v_1.Args[2] 28338 p2 := v_1.Args[0] 28339 v_1_1 := v_1.Args[1] 28340 if v_1_1.Op != OpConst64F { 28341 break 28342 } 28343 x := v_1_1.AuxInt 28344 if !(isSamePtr(p1, p2) && sizeof(t2) == 8 && is64BitInt(t1)) { 28345 break 28346 } 28347 v.reset(OpConst64) 28348 v.AuxInt = x 28349 return true 28350 } 28351 // match: (Load <t1> p1 (Store {t2} p2 (Const32F [x]) _)) 28352 // cond: isSamePtr(p1,p2) && sizeof(t2) == 4 && is32BitInt(t1) 28353 // result: (Const32 [int64(int32(math.Float32bits(auxTo32F(x))))]) 28354 for { 28355 t1 := v.Type 28356 _ = v.Args[1] 28357 p1 := v.Args[0] 28358 v_1 := v.Args[1] 28359 if v_1.Op != OpStore { 28360 break 28361 } 28362 t2 := v_1.Aux 28363 _ = v_1.Args[2] 28364 p2 := v_1.Args[0] 28365 v_1_1 := v_1.Args[1] 28366 if v_1_1.Op != OpConst32F { 28367 break 28368 } 28369 x := v_1_1.AuxInt 28370 if !(isSamePtr(p1, p2) && sizeof(t2) == 4 && is32BitInt(t1)) { 28371 break 28372 } 28373 v.reset(OpConst32) 28374 v.AuxInt = int64(int32(math.Float32bits(auxTo32F(x)))) 28375 return true 28376 } 28377 // match: (Load <t1> op:(OffPtr [o1] p1) (Store {t2} p2 _ mem:(Zero [n] p3 _))) 28378 // cond: o1 >= 0 && o1+t1.Size() <= n && isSamePtr(p1, p3) && fe.CanSSA(t1) && disjoint(op, t1.Size(), p2, sizeof(t2)) 28379 // result: @mem.Block (Load <t1> (OffPtr <op.Type> [o1] p3) mem) 28380 for { 28381 t1 := v.Type 28382 _ = v.Args[1] 28383 op := v.Args[0] 28384 if op.Op != OpOffPtr { 28385 break 28386 } 28387 o1 := op.AuxInt 28388 p1 := op.Args[0] 28389 v_1 := v.Args[1] 28390 if v_1.Op != OpStore { 28391 break 28392 } 28393 t2 := v_1.Aux 28394 _ = v_1.Args[2] 28395 p2 := v_1.Args[0] 28396 mem := v_1.Args[2] 28397 if mem.Op != OpZero { 28398 break 28399 } 28400 n := mem.AuxInt 28401 _ = mem.Args[1] 28402 p3 := mem.Args[0] 28403 if !(o1 >= 0 && o1+t1.Size() <= n && isSamePtr(p1, p3) && fe.CanSSA(t1) && disjoint(op, t1.Size(), p2, sizeof(t2))) { 28404 break 28405 } 28406 b = mem.Block 28407 v0 := b.NewValue0(v.Pos, OpLoad, t1) 28408 v.reset(OpCopy) 28409 v.AddArg(v0) 28410 v1 := b.NewValue0(v.Pos, OpOffPtr, op.Type) 28411 v1.AuxInt = o1 28412 v1.AddArg(p3) 28413 v0.AddArg(v1) 28414 v0.AddArg(mem) 28415 return true 28416 } 28417 // match: (Load <t1> op:(OffPtr [o1] p1) (Store {t2} p2 _ (Store {t3} p3 _ mem:(Zero [n] p4 _)))) 28418 // cond: o1 >= 0 && o1+t1.Size() <= n && isSamePtr(p1, p4) && fe.CanSSA(t1) && disjoint(op, t1.Size(), p2, sizeof(t2)) && disjoint(op, t1.Size(), p3, sizeof(t3)) 28419 // result: @mem.Block (Load <t1> (OffPtr <op.Type> [o1] p4) mem) 28420 for { 28421 t1 := v.Type 28422 _ = v.Args[1] 28423 op := v.Args[0] 28424 if op.Op != OpOffPtr { 28425 break 28426 } 28427 o1 := op.AuxInt 28428 p1 := op.Args[0] 28429 v_1 := v.Args[1] 28430 if v_1.Op != OpStore { 28431 break 28432 } 28433 t2 := v_1.Aux 28434 _ = v_1.Args[2] 28435 p2 := v_1.Args[0] 28436 v_1_2 := v_1.Args[2] 28437 if v_1_2.Op != OpStore { 28438 break 28439 } 28440 t3 := v_1_2.Aux 28441 _ = v_1_2.Args[2] 28442 p3 := v_1_2.Args[0] 28443 mem := v_1_2.Args[2] 28444 if mem.Op != OpZero { 28445 break 28446 } 28447 n := mem.AuxInt 28448 _ = mem.Args[1] 28449 p4 := mem.Args[0] 28450 if !(o1 >= 0 && o1+t1.Size() <= n && isSamePtr(p1, p4) && fe.CanSSA(t1) && disjoint(op, t1.Size(), p2, sizeof(t2)) && disjoint(op, t1.Size(), p3, sizeof(t3))) { 28451 break 28452 } 28453 b = mem.Block 28454 v0 := b.NewValue0(v.Pos, OpLoad, t1) 28455 v.reset(OpCopy) 28456 v.AddArg(v0) 28457 v1 := b.NewValue0(v.Pos, OpOffPtr, op.Type) 28458 v1.AuxInt = o1 28459 v1.AddArg(p4) 28460 v0.AddArg(v1) 28461 v0.AddArg(mem) 28462 return true 28463 } 28464 return false 28465 } 28466 func rewriteValuegeneric_OpLoad_10(v *Value) bool { 28467 b := v.Block 28468 fe := b.Func.fe 28469 // match: (Load <t1> op:(OffPtr [o1] p1) (Store {t2} p2 _ (Store {t3} p3 _ (Store {t4} p4 _ mem:(Zero [n] p5 _))))) 28470 // cond: o1 >= 0 && o1+t1.Size() <= n && isSamePtr(p1, p5) && fe.CanSSA(t1) && disjoint(op, t1.Size(), p2, sizeof(t2)) && disjoint(op, t1.Size(), p3, sizeof(t3)) && disjoint(op, t1.Size(), p4, sizeof(t4)) 28471 // result: @mem.Block (Load <t1> (OffPtr <op.Type> [o1] p5) mem) 28472 for { 28473 t1 := v.Type 28474 _ = v.Args[1] 28475 op := v.Args[0] 28476 if op.Op != OpOffPtr { 28477 break 28478 } 28479 o1 := op.AuxInt 28480 p1 := op.Args[0] 28481 v_1 := v.Args[1] 28482 if v_1.Op != OpStore { 28483 break 28484 } 28485 t2 := v_1.Aux 28486 _ = v_1.Args[2] 28487 p2 := v_1.Args[0] 28488 v_1_2 := v_1.Args[2] 28489 if v_1_2.Op != OpStore { 28490 break 28491 } 28492 t3 := v_1_2.Aux 28493 _ = v_1_2.Args[2] 28494 p3 := v_1_2.Args[0] 28495 v_1_2_2 := v_1_2.Args[2] 28496 if v_1_2_2.Op != OpStore { 28497 break 28498 } 28499 t4 := v_1_2_2.Aux 28500 _ = v_1_2_2.Args[2] 28501 p4 := v_1_2_2.Args[0] 28502 mem := v_1_2_2.Args[2] 28503 if mem.Op != OpZero { 28504 break 28505 } 28506 n := mem.AuxInt 28507 _ = mem.Args[1] 28508 p5 := mem.Args[0] 28509 if !(o1 >= 0 && o1+t1.Size() <= n && isSamePtr(p1, p5) && fe.CanSSA(t1) && disjoint(op, t1.Size(), p2, sizeof(t2)) && disjoint(op, t1.Size(), p3, sizeof(t3)) && disjoint(op, t1.Size(), p4, sizeof(t4))) { 28510 break 28511 } 28512 b = mem.Block 28513 v0 := b.NewValue0(v.Pos, OpLoad, t1) 28514 v.reset(OpCopy) 28515 v.AddArg(v0) 28516 v1 := b.NewValue0(v.Pos, OpOffPtr, op.Type) 28517 v1.AuxInt = o1 28518 v1.AddArg(p5) 28519 v0.AddArg(v1) 28520 v0.AddArg(mem) 28521 return true 28522 } 28523 // match: (Load <t1> op:(OffPtr [o1] p1) (Store {t2} p2 _ (Store {t3} p3 _ (Store {t4} p4 _ (Store {t5} p5 _ mem:(Zero [n] p6 _)))))) 28524 // cond: o1 >= 0 && o1+t1.Size() <= n && isSamePtr(p1, p6) && fe.CanSSA(t1) && disjoint(op, t1.Size(), p2, sizeof(t2)) && disjoint(op, t1.Size(), p3, sizeof(t3)) && disjoint(op, t1.Size(), p4, sizeof(t4)) && disjoint(op, t1.Size(), p5, sizeof(t5)) 28525 // result: @mem.Block (Load <t1> (OffPtr <op.Type> [o1] p6) mem) 28526 for { 28527 t1 := v.Type 28528 _ = v.Args[1] 28529 op := v.Args[0] 28530 if op.Op != OpOffPtr { 28531 break 28532 } 28533 o1 := op.AuxInt 28534 p1 := op.Args[0] 28535 v_1 := v.Args[1] 28536 if v_1.Op != OpStore { 28537 break 28538 } 28539 t2 := v_1.Aux 28540 _ = v_1.Args[2] 28541 p2 := v_1.Args[0] 28542 v_1_2 := v_1.Args[2] 28543 if v_1_2.Op != OpStore { 28544 break 28545 } 28546 t3 := v_1_2.Aux 28547 _ = v_1_2.Args[2] 28548 p3 := v_1_2.Args[0] 28549 v_1_2_2 := v_1_2.Args[2] 28550 if v_1_2_2.Op != OpStore { 28551 break 28552 } 28553 t4 := v_1_2_2.Aux 28554 _ = v_1_2_2.Args[2] 28555 p4 := v_1_2_2.Args[0] 28556 v_1_2_2_2 := v_1_2_2.Args[2] 28557 if v_1_2_2_2.Op != OpStore { 28558 break 28559 } 28560 t5 := v_1_2_2_2.Aux 28561 _ = v_1_2_2_2.Args[2] 28562 p5 := v_1_2_2_2.Args[0] 28563 mem := v_1_2_2_2.Args[2] 28564 if mem.Op != OpZero { 28565 break 28566 } 28567 n := mem.AuxInt 28568 _ = mem.Args[1] 28569 p6 := mem.Args[0] 28570 if !(o1 >= 0 && o1+t1.Size() <= n && isSamePtr(p1, p6) && fe.CanSSA(t1) && disjoint(op, t1.Size(), p2, sizeof(t2)) && disjoint(op, t1.Size(), p3, sizeof(t3)) && disjoint(op, t1.Size(), p4, sizeof(t4)) && disjoint(op, t1.Size(), p5, sizeof(t5))) { 28571 break 28572 } 28573 b = mem.Block 28574 v0 := b.NewValue0(v.Pos, OpLoad, t1) 28575 v.reset(OpCopy) 28576 v.AddArg(v0) 28577 v1 := b.NewValue0(v.Pos, OpOffPtr, op.Type) 28578 v1.AuxInt = o1 28579 v1.AddArg(p6) 28580 v0.AddArg(v1) 28581 v0.AddArg(mem) 28582 return true 28583 } 28584 // match: (Load <t1> (OffPtr [o] p1) (Zero [n] p2 _)) 28585 // cond: t1.IsBoolean() && isSamePtr(p1, p2) && n >= o + 1 28586 // result: (ConstBool [0]) 28587 for { 28588 t1 := v.Type 28589 _ = v.Args[1] 28590 v_0 := v.Args[0] 28591 if v_0.Op != OpOffPtr { 28592 break 28593 } 28594 o := v_0.AuxInt 28595 p1 := v_0.Args[0] 28596 v_1 := v.Args[1] 28597 if v_1.Op != OpZero { 28598 break 28599 } 28600 n := v_1.AuxInt 28601 _ = v_1.Args[1] 28602 p2 := v_1.Args[0] 28603 if !(t1.IsBoolean() && isSamePtr(p1, p2) && n >= o+1) { 28604 break 28605 } 28606 v.reset(OpConstBool) 28607 v.AuxInt = 0 28608 return true 28609 } 28610 // match: (Load <t1> (OffPtr [o] p1) (Zero [n] p2 _)) 28611 // cond: is8BitInt(t1) && isSamePtr(p1, p2) && n >= o + 1 28612 // result: (Const8 [0]) 28613 for { 28614 t1 := v.Type 28615 _ = v.Args[1] 28616 v_0 := v.Args[0] 28617 if v_0.Op != OpOffPtr { 28618 break 28619 } 28620 o := v_0.AuxInt 28621 p1 := v_0.Args[0] 28622 v_1 := v.Args[1] 28623 if v_1.Op != OpZero { 28624 break 28625 } 28626 n := v_1.AuxInt 28627 _ = v_1.Args[1] 28628 p2 := v_1.Args[0] 28629 if !(is8BitInt(t1) && isSamePtr(p1, p2) && n >= o+1) { 28630 break 28631 } 28632 v.reset(OpConst8) 28633 v.AuxInt = 0 28634 return true 28635 } 28636 // match: (Load <t1> (OffPtr [o] p1) (Zero [n] p2 _)) 28637 // cond: is16BitInt(t1) && isSamePtr(p1, p2) && n >= o + 2 28638 // result: (Const16 [0]) 28639 for { 28640 t1 := v.Type 28641 _ = v.Args[1] 28642 v_0 := v.Args[0] 28643 if v_0.Op != OpOffPtr { 28644 break 28645 } 28646 o := v_0.AuxInt 28647 p1 := v_0.Args[0] 28648 v_1 := v.Args[1] 28649 if v_1.Op != OpZero { 28650 break 28651 } 28652 n := v_1.AuxInt 28653 _ = v_1.Args[1] 28654 p2 := v_1.Args[0] 28655 if !(is16BitInt(t1) && isSamePtr(p1, p2) && n >= o+2) { 28656 break 28657 } 28658 v.reset(OpConst16) 28659 v.AuxInt = 0 28660 return true 28661 } 28662 // match: (Load <t1> (OffPtr [o] p1) (Zero [n] p2 _)) 28663 // cond: is32BitInt(t1) && isSamePtr(p1, p2) && n >= o + 4 28664 // result: (Const32 [0]) 28665 for { 28666 t1 := v.Type 28667 _ = v.Args[1] 28668 v_0 := v.Args[0] 28669 if v_0.Op != OpOffPtr { 28670 break 28671 } 28672 o := v_0.AuxInt 28673 p1 := v_0.Args[0] 28674 v_1 := v.Args[1] 28675 if v_1.Op != OpZero { 28676 break 28677 } 28678 n := v_1.AuxInt 28679 _ = v_1.Args[1] 28680 p2 := v_1.Args[0] 28681 if !(is32BitInt(t1) && isSamePtr(p1, p2) && n >= o+4) { 28682 break 28683 } 28684 v.reset(OpConst32) 28685 v.AuxInt = 0 28686 return true 28687 } 28688 // match: (Load <t1> (OffPtr [o] p1) (Zero [n] p2 _)) 28689 // cond: is64BitInt(t1) && isSamePtr(p1, p2) && n >= o + 8 28690 // result: (Const64 [0]) 28691 for { 28692 t1 := v.Type 28693 _ = v.Args[1] 28694 v_0 := v.Args[0] 28695 if v_0.Op != OpOffPtr { 28696 break 28697 } 28698 o := v_0.AuxInt 28699 p1 := v_0.Args[0] 28700 v_1 := v.Args[1] 28701 if v_1.Op != OpZero { 28702 break 28703 } 28704 n := v_1.AuxInt 28705 _ = v_1.Args[1] 28706 p2 := v_1.Args[0] 28707 if !(is64BitInt(t1) && isSamePtr(p1, p2) && n >= o+8) { 28708 break 28709 } 28710 v.reset(OpConst64) 28711 v.AuxInt = 0 28712 return true 28713 } 28714 // match: (Load <t1> (OffPtr [o] p1) (Zero [n] p2 _)) 28715 // cond: is32BitFloat(t1) && isSamePtr(p1, p2) && n >= o + 4 28716 // result: (Const32F [0]) 28717 for { 28718 t1 := v.Type 28719 _ = v.Args[1] 28720 v_0 := v.Args[0] 28721 if v_0.Op != OpOffPtr { 28722 break 28723 } 28724 o := v_0.AuxInt 28725 p1 := v_0.Args[0] 28726 v_1 := v.Args[1] 28727 if v_1.Op != OpZero { 28728 break 28729 } 28730 n := v_1.AuxInt 28731 _ = v_1.Args[1] 28732 p2 := v_1.Args[0] 28733 if !(is32BitFloat(t1) && isSamePtr(p1, p2) && n >= o+4) { 28734 break 28735 } 28736 v.reset(OpConst32F) 28737 v.AuxInt = 0 28738 return true 28739 } 28740 // match: (Load <t1> (OffPtr [o] p1) (Zero [n] p2 _)) 28741 // cond: is64BitFloat(t1) && isSamePtr(p1, p2) && n >= o + 8 28742 // result: (Const64F [0]) 28743 for { 28744 t1 := v.Type 28745 _ = v.Args[1] 28746 v_0 := v.Args[0] 28747 if v_0.Op != OpOffPtr { 28748 break 28749 } 28750 o := v_0.AuxInt 28751 p1 := v_0.Args[0] 28752 v_1 := v.Args[1] 28753 if v_1.Op != OpZero { 28754 break 28755 } 28756 n := v_1.AuxInt 28757 _ = v_1.Args[1] 28758 p2 := v_1.Args[0] 28759 if !(is64BitFloat(t1) && isSamePtr(p1, p2) && n >= o+8) { 28760 break 28761 } 28762 v.reset(OpConst64F) 28763 v.AuxInt = 0 28764 return true 28765 } 28766 // match: (Load <t> _ _) 28767 // cond: t.IsStruct() && t.NumFields() == 0 && fe.CanSSA(t) 28768 // result: (StructMake0) 28769 for { 28770 t := v.Type 28771 _ = v.Args[1] 28772 if !(t.IsStruct() && t.NumFields() == 0 && fe.CanSSA(t)) { 28773 break 28774 } 28775 v.reset(OpStructMake0) 28776 return true 28777 } 28778 return false 28779 } 28780 func rewriteValuegeneric_OpLoad_20(v *Value) bool { 28781 b := v.Block 28782 fe := b.Func.fe 28783 // match: (Load <t> ptr mem) 28784 // cond: t.IsStruct() && t.NumFields() == 1 && fe.CanSSA(t) 28785 // result: (StructMake1 (Load <t.FieldType(0)> (OffPtr <t.FieldType(0).PtrTo()> [0] ptr) mem)) 28786 for { 28787 t := v.Type 28788 mem := v.Args[1] 28789 ptr := v.Args[0] 28790 if !(t.IsStruct() && t.NumFields() == 1 && fe.CanSSA(t)) { 28791 break 28792 } 28793 v.reset(OpStructMake1) 28794 v0 := b.NewValue0(v.Pos, OpLoad, t.FieldType(0)) 28795 v1 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(0).PtrTo()) 28796 v1.AuxInt = 0 28797 v1.AddArg(ptr) 28798 v0.AddArg(v1) 28799 v0.AddArg(mem) 28800 v.AddArg(v0) 28801 return true 28802 } 28803 // match: (Load <t> ptr mem) 28804 // cond: t.IsStruct() && t.NumFields() == 2 && fe.CanSSA(t) 28805 // result: (StructMake2 (Load <t.FieldType(0)> (OffPtr <t.FieldType(0).PtrTo()> [0] ptr) mem) (Load <t.FieldType(1)> (OffPtr <t.FieldType(1).PtrTo()> [t.FieldOff(1)] ptr) mem)) 28806 for { 28807 t := v.Type 28808 mem := v.Args[1] 28809 ptr := v.Args[0] 28810 if !(t.IsStruct() && t.NumFields() == 2 && fe.CanSSA(t)) { 28811 break 28812 } 28813 v.reset(OpStructMake2) 28814 v0 := b.NewValue0(v.Pos, OpLoad, t.FieldType(0)) 28815 v1 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(0).PtrTo()) 28816 v1.AuxInt = 0 28817 v1.AddArg(ptr) 28818 v0.AddArg(v1) 28819 v0.AddArg(mem) 28820 v.AddArg(v0) 28821 v2 := b.NewValue0(v.Pos, OpLoad, t.FieldType(1)) 28822 v3 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(1).PtrTo()) 28823 v3.AuxInt = t.FieldOff(1) 28824 v3.AddArg(ptr) 28825 v2.AddArg(v3) 28826 v2.AddArg(mem) 28827 v.AddArg(v2) 28828 return true 28829 } 28830 // match: (Load <t> ptr mem) 28831 // cond: t.IsStruct() && t.NumFields() == 3 && fe.CanSSA(t) 28832 // result: (StructMake3 (Load <t.FieldType(0)> (OffPtr <t.FieldType(0).PtrTo()> [0] ptr) mem) (Load <t.FieldType(1)> (OffPtr <t.FieldType(1).PtrTo()> [t.FieldOff(1)] ptr) mem) (Load <t.FieldType(2)> (OffPtr <t.FieldType(2).PtrTo()> [t.FieldOff(2)] ptr) mem)) 28833 for { 28834 t := v.Type 28835 mem := v.Args[1] 28836 ptr := v.Args[0] 28837 if !(t.IsStruct() && t.NumFields() == 3 && fe.CanSSA(t)) { 28838 break 28839 } 28840 v.reset(OpStructMake3) 28841 v0 := b.NewValue0(v.Pos, OpLoad, t.FieldType(0)) 28842 v1 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(0).PtrTo()) 28843 v1.AuxInt = 0 28844 v1.AddArg(ptr) 28845 v0.AddArg(v1) 28846 v0.AddArg(mem) 28847 v.AddArg(v0) 28848 v2 := b.NewValue0(v.Pos, OpLoad, t.FieldType(1)) 28849 v3 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(1).PtrTo()) 28850 v3.AuxInt = t.FieldOff(1) 28851 v3.AddArg(ptr) 28852 v2.AddArg(v3) 28853 v2.AddArg(mem) 28854 v.AddArg(v2) 28855 v4 := b.NewValue0(v.Pos, OpLoad, t.FieldType(2)) 28856 v5 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(2).PtrTo()) 28857 v5.AuxInt = t.FieldOff(2) 28858 v5.AddArg(ptr) 28859 v4.AddArg(v5) 28860 v4.AddArg(mem) 28861 v.AddArg(v4) 28862 return true 28863 } 28864 // match: (Load <t> ptr mem) 28865 // cond: t.IsStruct() && t.NumFields() == 4 && fe.CanSSA(t) 28866 // result: (StructMake4 (Load <t.FieldType(0)> (OffPtr <t.FieldType(0).PtrTo()> [0] ptr) mem) (Load <t.FieldType(1)> (OffPtr <t.FieldType(1).PtrTo()> [t.FieldOff(1)] ptr) mem) (Load <t.FieldType(2)> (OffPtr <t.FieldType(2).PtrTo()> [t.FieldOff(2)] ptr) mem) (Load <t.FieldType(3)> (OffPtr <t.FieldType(3).PtrTo()> [t.FieldOff(3)] ptr) mem)) 28867 for { 28868 t := v.Type 28869 mem := v.Args[1] 28870 ptr := v.Args[0] 28871 if !(t.IsStruct() && t.NumFields() == 4 && fe.CanSSA(t)) { 28872 break 28873 } 28874 v.reset(OpStructMake4) 28875 v0 := b.NewValue0(v.Pos, OpLoad, t.FieldType(0)) 28876 v1 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(0).PtrTo()) 28877 v1.AuxInt = 0 28878 v1.AddArg(ptr) 28879 v0.AddArg(v1) 28880 v0.AddArg(mem) 28881 v.AddArg(v0) 28882 v2 := b.NewValue0(v.Pos, OpLoad, t.FieldType(1)) 28883 v3 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(1).PtrTo()) 28884 v3.AuxInt = t.FieldOff(1) 28885 v3.AddArg(ptr) 28886 v2.AddArg(v3) 28887 v2.AddArg(mem) 28888 v.AddArg(v2) 28889 v4 := b.NewValue0(v.Pos, OpLoad, t.FieldType(2)) 28890 v5 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(2).PtrTo()) 28891 v5.AuxInt = t.FieldOff(2) 28892 v5.AddArg(ptr) 28893 v4.AddArg(v5) 28894 v4.AddArg(mem) 28895 v.AddArg(v4) 28896 v6 := b.NewValue0(v.Pos, OpLoad, t.FieldType(3)) 28897 v7 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(3).PtrTo()) 28898 v7.AuxInt = t.FieldOff(3) 28899 v7.AddArg(ptr) 28900 v6.AddArg(v7) 28901 v6.AddArg(mem) 28902 v.AddArg(v6) 28903 return true 28904 } 28905 // match: (Load <t> _ _) 28906 // cond: t.IsArray() && t.NumElem() == 0 28907 // result: (ArrayMake0) 28908 for { 28909 t := v.Type 28910 _ = v.Args[1] 28911 if !(t.IsArray() && t.NumElem() == 0) { 28912 break 28913 } 28914 v.reset(OpArrayMake0) 28915 return true 28916 } 28917 // match: (Load <t> ptr mem) 28918 // cond: t.IsArray() && t.NumElem() == 1 && fe.CanSSA(t) 28919 // result: (ArrayMake1 (Load <t.Elem()> ptr mem)) 28920 for { 28921 t := v.Type 28922 mem := v.Args[1] 28923 ptr := v.Args[0] 28924 if !(t.IsArray() && t.NumElem() == 1 && fe.CanSSA(t)) { 28925 break 28926 } 28927 v.reset(OpArrayMake1) 28928 v0 := b.NewValue0(v.Pos, OpLoad, t.Elem()) 28929 v0.AddArg(ptr) 28930 v0.AddArg(mem) 28931 v.AddArg(v0) 28932 return true 28933 } 28934 return false 28935 } 28936 func rewriteValuegeneric_OpLsh16x16_0(v *Value) bool { 28937 b := v.Block 28938 // match: (Lsh16x16 <t> x (Const16 [c])) 28939 // result: (Lsh16x64 x (Const64 <t> [int64(uint16(c))])) 28940 for { 28941 t := v.Type 28942 _ = v.Args[1] 28943 x := v.Args[0] 28944 v_1 := v.Args[1] 28945 if v_1.Op != OpConst16 { 28946 break 28947 } 28948 c := v_1.AuxInt 28949 v.reset(OpLsh16x64) 28950 v.AddArg(x) 28951 v0 := b.NewValue0(v.Pos, OpConst64, t) 28952 v0.AuxInt = int64(uint16(c)) 28953 v.AddArg(v0) 28954 return true 28955 } 28956 // match: (Lsh16x16 (Const16 [0]) _) 28957 // result: (Const16 [0]) 28958 for { 28959 _ = v.Args[1] 28960 v_0 := v.Args[0] 28961 if v_0.Op != OpConst16 || v_0.AuxInt != 0 { 28962 break 28963 } 28964 v.reset(OpConst16) 28965 v.AuxInt = 0 28966 return true 28967 } 28968 return false 28969 } 28970 func rewriteValuegeneric_OpLsh16x32_0(v *Value) bool { 28971 b := v.Block 28972 // match: (Lsh16x32 <t> x (Const32 [c])) 28973 // result: (Lsh16x64 x (Const64 <t> [int64(uint32(c))])) 28974 for { 28975 t := v.Type 28976 _ = v.Args[1] 28977 x := v.Args[0] 28978 v_1 := v.Args[1] 28979 if v_1.Op != OpConst32 { 28980 break 28981 } 28982 c := v_1.AuxInt 28983 v.reset(OpLsh16x64) 28984 v.AddArg(x) 28985 v0 := b.NewValue0(v.Pos, OpConst64, t) 28986 v0.AuxInt = int64(uint32(c)) 28987 v.AddArg(v0) 28988 return true 28989 } 28990 // match: (Lsh16x32 (Const16 [0]) _) 28991 // result: (Const16 [0]) 28992 for { 28993 _ = v.Args[1] 28994 v_0 := v.Args[0] 28995 if v_0.Op != OpConst16 || v_0.AuxInt != 0 { 28996 break 28997 } 28998 v.reset(OpConst16) 28999 v.AuxInt = 0 29000 return true 29001 } 29002 return false 29003 } 29004 func rewriteValuegeneric_OpLsh16x64_0(v *Value) bool { 29005 b := v.Block 29006 typ := &b.Func.Config.Types 29007 // match: (Lsh16x64 (Const16 [c]) (Const64 [d])) 29008 // result: (Const16 [int64(int16(c) << uint64(d))]) 29009 for { 29010 _ = v.Args[1] 29011 v_0 := v.Args[0] 29012 if v_0.Op != OpConst16 { 29013 break 29014 } 29015 c := v_0.AuxInt 29016 v_1 := v.Args[1] 29017 if v_1.Op != OpConst64 { 29018 break 29019 } 29020 d := v_1.AuxInt 29021 v.reset(OpConst16) 29022 v.AuxInt = int64(int16(c) << uint64(d)) 29023 return true 29024 } 29025 // match: (Lsh16x64 x (Const64 [0])) 29026 // result: x 29027 for { 29028 _ = v.Args[1] 29029 x := v.Args[0] 29030 v_1 := v.Args[1] 29031 if v_1.Op != OpConst64 || v_1.AuxInt != 0 { 29032 break 29033 } 29034 v.reset(OpCopy) 29035 v.Type = x.Type 29036 v.AddArg(x) 29037 return true 29038 } 29039 // match: (Lsh16x64 (Const16 [0]) _) 29040 // result: (Const16 [0]) 29041 for { 29042 _ = v.Args[1] 29043 v_0 := v.Args[0] 29044 if v_0.Op != OpConst16 || v_0.AuxInt != 0 { 29045 break 29046 } 29047 v.reset(OpConst16) 29048 v.AuxInt = 0 29049 return true 29050 } 29051 // match: (Lsh16x64 _ (Const64 [c])) 29052 // cond: uint64(c) >= 16 29053 // result: (Const16 [0]) 29054 for { 29055 _ = v.Args[1] 29056 v_1 := v.Args[1] 29057 if v_1.Op != OpConst64 { 29058 break 29059 } 29060 c := v_1.AuxInt 29061 if !(uint64(c) >= 16) { 29062 break 29063 } 29064 v.reset(OpConst16) 29065 v.AuxInt = 0 29066 return true 29067 } 29068 // match: (Lsh16x64 <t> (Lsh16x64 x (Const64 [c])) (Const64 [d])) 29069 // cond: !uaddOvf(c,d) 29070 // result: (Lsh16x64 x (Const64 <t> [c+d])) 29071 for { 29072 t := v.Type 29073 _ = v.Args[1] 29074 v_0 := v.Args[0] 29075 if v_0.Op != OpLsh16x64 { 29076 break 29077 } 29078 _ = v_0.Args[1] 29079 x := v_0.Args[0] 29080 v_0_1 := v_0.Args[1] 29081 if v_0_1.Op != OpConst64 { 29082 break 29083 } 29084 c := v_0_1.AuxInt 29085 v_1 := v.Args[1] 29086 if v_1.Op != OpConst64 { 29087 break 29088 } 29089 d := v_1.AuxInt 29090 if !(!uaddOvf(c, d)) { 29091 break 29092 } 29093 v.reset(OpLsh16x64) 29094 v.AddArg(x) 29095 v0 := b.NewValue0(v.Pos, OpConst64, t) 29096 v0.AuxInt = c + d 29097 v.AddArg(v0) 29098 return true 29099 } 29100 // match: (Lsh16x64 (Rsh16Ux64 (Lsh16x64 x (Const64 [c1])) (Const64 [c2])) (Const64 [c3])) 29101 // cond: uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3) 29102 // result: (Lsh16x64 x (Const64 <typ.UInt64> [c1-c2+c3])) 29103 for { 29104 _ = v.Args[1] 29105 v_0 := v.Args[0] 29106 if v_0.Op != OpRsh16Ux64 { 29107 break 29108 } 29109 _ = v_0.Args[1] 29110 v_0_0 := v_0.Args[0] 29111 if v_0_0.Op != OpLsh16x64 { 29112 break 29113 } 29114 _ = v_0_0.Args[1] 29115 x := v_0_0.Args[0] 29116 v_0_0_1 := v_0_0.Args[1] 29117 if v_0_0_1.Op != OpConst64 { 29118 break 29119 } 29120 c1 := v_0_0_1.AuxInt 29121 v_0_1 := v_0.Args[1] 29122 if v_0_1.Op != OpConst64 { 29123 break 29124 } 29125 c2 := v_0_1.AuxInt 29126 v_1 := v.Args[1] 29127 if v_1.Op != OpConst64 { 29128 break 29129 } 29130 c3 := v_1.AuxInt 29131 if !(uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)) { 29132 break 29133 } 29134 v.reset(OpLsh16x64) 29135 v.AddArg(x) 29136 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 29137 v0.AuxInt = c1 - c2 + c3 29138 v.AddArg(v0) 29139 return true 29140 } 29141 return false 29142 } 29143 func rewriteValuegeneric_OpLsh16x8_0(v *Value) bool { 29144 b := v.Block 29145 // match: (Lsh16x8 <t> x (Const8 [c])) 29146 // result: (Lsh16x64 x (Const64 <t> [int64(uint8(c))])) 29147 for { 29148 t := v.Type 29149 _ = v.Args[1] 29150 x := v.Args[0] 29151 v_1 := v.Args[1] 29152 if v_1.Op != OpConst8 { 29153 break 29154 } 29155 c := v_1.AuxInt 29156 v.reset(OpLsh16x64) 29157 v.AddArg(x) 29158 v0 := b.NewValue0(v.Pos, OpConst64, t) 29159 v0.AuxInt = int64(uint8(c)) 29160 v.AddArg(v0) 29161 return true 29162 } 29163 // match: (Lsh16x8 (Const16 [0]) _) 29164 // result: (Const16 [0]) 29165 for { 29166 _ = v.Args[1] 29167 v_0 := v.Args[0] 29168 if v_0.Op != OpConst16 || v_0.AuxInt != 0 { 29169 break 29170 } 29171 v.reset(OpConst16) 29172 v.AuxInt = 0 29173 return true 29174 } 29175 return false 29176 } 29177 func rewriteValuegeneric_OpLsh32x16_0(v *Value) bool { 29178 b := v.Block 29179 // match: (Lsh32x16 <t> x (Const16 [c])) 29180 // result: (Lsh32x64 x (Const64 <t> [int64(uint16(c))])) 29181 for { 29182 t := v.Type 29183 _ = v.Args[1] 29184 x := v.Args[0] 29185 v_1 := v.Args[1] 29186 if v_1.Op != OpConst16 { 29187 break 29188 } 29189 c := v_1.AuxInt 29190 v.reset(OpLsh32x64) 29191 v.AddArg(x) 29192 v0 := b.NewValue0(v.Pos, OpConst64, t) 29193 v0.AuxInt = int64(uint16(c)) 29194 v.AddArg(v0) 29195 return true 29196 } 29197 // match: (Lsh32x16 (Const32 [0]) _) 29198 // result: (Const32 [0]) 29199 for { 29200 _ = v.Args[1] 29201 v_0 := v.Args[0] 29202 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 29203 break 29204 } 29205 v.reset(OpConst32) 29206 v.AuxInt = 0 29207 return true 29208 } 29209 return false 29210 } 29211 func rewriteValuegeneric_OpLsh32x32_0(v *Value) bool { 29212 b := v.Block 29213 // match: (Lsh32x32 <t> x (Const32 [c])) 29214 // result: (Lsh32x64 x (Const64 <t> [int64(uint32(c))])) 29215 for { 29216 t := v.Type 29217 _ = v.Args[1] 29218 x := v.Args[0] 29219 v_1 := v.Args[1] 29220 if v_1.Op != OpConst32 { 29221 break 29222 } 29223 c := v_1.AuxInt 29224 v.reset(OpLsh32x64) 29225 v.AddArg(x) 29226 v0 := b.NewValue0(v.Pos, OpConst64, t) 29227 v0.AuxInt = int64(uint32(c)) 29228 v.AddArg(v0) 29229 return true 29230 } 29231 // match: (Lsh32x32 (Const32 [0]) _) 29232 // result: (Const32 [0]) 29233 for { 29234 _ = v.Args[1] 29235 v_0 := v.Args[0] 29236 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 29237 break 29238 } 29239 v.reset(OpConst32) 29240 v.AuxInt = 0 29241 return true 29242 } 29243 return false 29244 } 29245 func rewriteValuegeneric_OpLsh32x64_0(v *Value) bool { 29246 b := v.Block 29247 typ := &b.Func.Config.Types 29248 // match: (Lsh32x64 (Const32 [c]) (Const64 [d])) 29249 // result: (Const32 [int64(int32(c) << uint64(d))]) 29250 for { 29251 _ = v.Args[1] 29252 v_0 := v.Args[0] 29253 if v_0.Op != OpConst32 { 29254 break 29255 } 29256 c := v_0.AuxInt 29257 v_1 := v.Args[1] 29258 if v_1.Op != OpConst64 { 29259 break 29260 } 29261 d := v_1.AuxInt 29262 v.reset(OpConst32) 29263 v.AuxInt = int64(int32(c) << uint64(d)) 29264 return true 29265 } 29266 // match: (Lsh32x64 x (Const64 [0])) 29267 // result: x 29268 for { 29269 _ = v.Args[1] 29270 x := v.Args[0] 29271 v_1 := v.Args[1] 29272 if v_1.Op != OpConst64 || v_1.AuxInt != 0 { 29273 break 29274 } 29275 v.reset(OpCopy) 29276 v.Type = x.Type 29277 v.AddArg(x) 29278 return true 29279 } 29280 // match: (Lsh32x64 (Const32 [0]) _) 29281 // result: (Const32 [0]) 29282 for { 29283 _ = v.Args[1] 29284 v_0 := v.Args[0] 29285 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 29286 break 29287 } 29288 v.reset(OpConst32) 29289 v.AuxInt = 0 29290 return true 29291 } 29292 // match: (Lsh32x64 _ (Const64 [c])) 29293 // cond: uint64(c) >= 32 29294 // result: (Const32 [0]) 29295 for { 29296 _ = v.Args[1] 29297 v_1 := v.Args[1] 29298 if v_1.Op != OpConst64 { 29299 break 29300 } 29301 c := v_1.AuxInt 29302 if !(uint64(c) >= 32) { 29303 break 29304 } 29305 v.reset(OpConst32) 29306 v.AuxInt = 0 29307 return true 29308 } 29309 // match: (Lsh32x64 <t> (Lsh32x64 x (Const64 [c])) (Const64 [d])) 29310 // cond: !uaddOvf(c,d) 29311 // result: (Lsh32x64 x (Const64 <t> [c+d])) 29312 for { 29313 t := v.Type 29314 _ = v.Args[1] 29315 v_0 := v.Args[0] 29316 if v_0.Op != OpLsh32x64 { 29317 break 29318 } 29319 _ = v_0.Args[1] 29320 x := v_0.Args[0] 29321 v_0_1 := v_0.Args[1] 29322 if v_0_1.Op != OpConst64 { 29323 break 29324 } 29325 c := v_0_1.AuxInt 29326 v_1 := v.Args[1] 29327 if v_1.Op != OpConst64 { 29328 break 29329 } 29330 d := v_1.AuxInt 29331 if !(!uaddOvf(c, d)) { 29332 break 29333 } 29334 v.reset(OpLsh32x64) 29335 v.AddArg(x) 29336 v0 := b.NewValue0(v.Pos, OpConst64, t) 29337 v0.AuxInt = c + d 29338 v.AddArg(v0) 29339 return true 29340 } 29341 // match: (Lsh32x64 (Rsh32Ux64 (Lsh32x64 x (Const64 [c1])) (Const64 [c2])) (Const64 [c3])) 29342 // cond: uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3) 29343 // result: (Lsh32x64 x (Const64 <typ.UInt64> [c1-c2+c3])) 29344 for { 29345 _ = v.Args[1] 29346 v_0 := v.Args[0] 29347 if v_0.Op != OpRsh32Ux64 { 29348 break 29349 } 29350 _ = v_0.Args[1] 29351 v_0_0 := v_0.Args[0] 29352 if v_0_0.Op != OpLsh32x64 { 29353 break 29354 } 29355 _ = v_0_0.Args[1] 29356 x := v_0_0.Args[0] 29357 v_0_0_1 := v_0_0.Args[1] 29358 if v_0_0_1.Op != OpConst64 { 29359 break 29360 } 29361 c1 := v_0_0_1.AuxInt 29362 v_0_1 := v_0.Args[1] 29363 if v_0_1.Op != OpConst64 { 29364 break 29365 } 29366 c2 := v_0_1.AuxInt 29367 v_1 := v.Args[1] 29368 if v_1.Op != OpConst64 { 29369 break 29370 } 29371 c3 := v_1.AuxInt 29372 if !(uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)) { 29373 break 29374 } 29375 v.reset(OpLsh32x64) 29376 v.AddArg(x) 29377 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 29378 v0.AuxInt = c1 - c2 + c3 29379 v.AddArg(v0) 29380 return true 29381 } 29382 return false 29383 } 29384 func rewriteValuegeneric_OpLsh32x8_0(v *Value) bool { 29385 b := v.Block 29386 // match: (Lsh32x8 <t> x (Const8 [c])) 29387 // result: (Lsh32x64 x (Const64 <t> [int64(uint8(c))])) 29388 for { 29389 t := v.Type 29390 _ = v.Args[1] 29391 x := v.Args[0] 29392 v_1 := v.Args[1] 29393 if v_1.Op != OpConst8 { 29394 break 29395 } 29396 c := v_1.AuxInt 29397 v.reset(OpLsh32x64) 29398 v.AddArg(x) 29399 v0 := b.NewValue0(v.Pos, OpConst64, t) 29400 v0.AuxInt = int64(uint8(c)) 29401 v.AddArg(v0) 29402 return true 29403 } 29404 // match: (Lsh32x8 (Const32 [0]) _) 29405 // result: (Const32 [0]) 29406 for { 29407 _ = v.Args[1] 29408 v_0 := v.Args[0] 29409 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 29410 break 29411 } 29412 v.reset(OpConst32) 29413 v.AuxInt = 0 29414 return true 29415 } 29416 return false 29417 } 29418 func rewriteValuegeneric_OpLsh64x16_0(v *Value) bool { 29419 b := v.Block 29420 // match: (Lsh64x16 <t> x (Const16 [c])) 29421 // result: (Lsh64x64 x (Const64 <t> [int64(uint16(c))])) 29422 for { 29423 t := v.Type 29424 _ = v.Args[1] 29425 x := v.Args[0] 29426 v_1 := v.Args[1] 29427 if v_1.Op != OpConst16 { 29428 break 29429 } 29430 c := v_1.AuxInt 29431 v.reset(OpLsh64x64) 29432 v.AddArg(x) 29433 v0 := b.NewValue0(v.Pos, OpConst64, t) 29434 v0.AuxInt = int64(uint16(c)) 29435 v.AddArg(v0) 29436 return true 29437 } 29438 // match: (Lsh64x16 (Const64 [0]) _) 29439 // result: (Const64 [0]) 29440 for { 29441 _ = v.Args[1] 29442 v_0 := v.Args[0] 29443 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 29444 break 29445 } 29446 v.reset(OpConst64) 29447 v.AuxInt = 0 29448 return true 29449 } 29450 return false 29451 } 29452 func rewriteValuegeneric_OpLsh64x32_0(v *Value) bool { 29453 b := v.Block 29454 // match: (Lsh64x32 <t> x (Const32 [c])) 29455 // result: (Lsh64x64 x (Const64 <t> [int64(uint32(c))])) 29456 for { 29457 t := v.Type 29458 _ = v.Args[1] 29459 x := v.Args[0] 29460 v_1 := v.Args[1] 29461 if v_1.Op != OpConst32 { 29462 break 29463 } 29464 c := v_1.AuxInt 29465 v.reset(OpLsh64x64) 29466 v.AddArg(x) 29467 v0 := b.NewValue0(v.Pos, OpConst64, t) 29468 v0.AuxInt = int64(uint32(c)) 29469 v.AddArg(v0) 29470 return true 29471 } 29472 // match: (Lsh64x32 (Const64 [0]) _) 29473 // result: (Const64 [0]) 29474 for { 29475 _ = v.Args[1] 29476 v_0 := v.Args[0] 29477 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 29478 break 29479 } 29480 v.reset(OpConst64) 29481 v.AuxInt = 0 29482 return true 29483 } 29484 return false 29485 } 29486 func rewriteValuegeneric_OpLsh64x64_0(v *Value) bool { 29487 b := v.Block 29488 typ := &b.Func.Config.Types 29489 // match: (Lsh64x64 (Const64 [c]) (Const64 [d])) 29490 // result: (Const64 [c << uint64(d)]) 29491 for { 29492 _ = v.Args[1] 29493 v_0 := v.Args[0] 29494 if v_0.Op != OpConst64 { 29495 break 29496 } 29497 c := v_0.AuxInt 29498 v_1 := v.Args[1] 29499 if v_1.Op != OpConst64 { 29500 break 29501 } 29502 d := v_1.AuxInt 29503 v.reset(OpConst64) 29504 v.AuxInt = c << uint64(d) 29505 return true 29506 } 29507 // match: (Lsh64x64 x (Const64 [0])) 29508 // result: x 29509 for { 29510 _ = v.Args[1] 29511 x := v.Args[0] 29512 v_1 := v.Args[1] 29513 if v_1.Op != OpConst64 || v_1.AuxInt != 0 { 29514 break 29515 } 29516 v.reset(OpCopy) 29517 v.Type = x.Type 29518 v.AddArg(x) 29519 return true 29520 } 29521 // match: (Lsh64x64 (Const64 [0]) _) 29522 // result: (Const64 [0]) 29523 for { 29524 _ = v.Args[1] 29525 v_0 := v.Args[0] 29526 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 29527 break 29528 } 29529 v.reset(OpConst64) 29530 v.AuxInt = 0 29531 return true 29532 } 29533 // match: (Lsh64x64 _ (Const64 [c])) 29534 // cond: uint64(c) >= 64 29535 // result: (Const64 [0]) 29536 for { 29537 _ = v.Args[1] 29538 v_1 := v.Args[1] 29539 if v_1.Op != OpConst64 { 29540 break 29541 } 29542 c := v_1.AuxInt 29543 if !(uint64(c) >= 64) { 29544 break 29545 } 29546 v.reset(OpConst64) 29547 v.AuxInt = 0 29548 return true 29549 } 29550 // match: (Lsh64x64 <t> (Lsh64x64 x (Const64 [c])) (Const64 [d])) 29551 // cond: !uaddOvf(c,d) 29552 // result: (Lsh64x64 x (Const64 <t> [c+d])) 29553 for { 29554 t := v.Type 29555 _ = v.Args[1] 29556 v_0 := v.Args[0] 29557 if v_0.Op != OpLsh64x64 { 29558 break 29559 } 29560 _ = v_0.Args[1] 29561 x := v_0.Args[0] 29562 v_0_1 := v_0.Args[1] 29563 if v_0_1.Op != OpConst64 { 29564 break 29565 } 29566 c := v_0_1.AuxInt 29567 v_1 := v.Args[1] 29568 if v_1.Op != OpConst64 { 29569 break 29570 } 29571 d := v_1.AuxInt 29572 if !(!uaddOvf(c, d)) { 29573 break 29574 } 29575 v.reset(OpLsh64x64) 29576 v.AddArg(x) 29577 v0 := b.NewValue0(v.Pos, OpConst64, t) 29578 v0.AuxInt = c + d 29579 v.AddArg(v0) 29580 return true 29581 } 29582 // match: (Lsh64x64 (Rsh64Ux64 (Lsh64x64 x (Const64 [c1])) (Const64 [c2])) (Const64 [c3])) 29583 // cond: uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3) 29584 // result: (Lsh64x64 x (Const64 <typ.UInt64> [c1-c2+c3])) 29585 for { 29586 _ = v.Args[1] 29587 v_0 := v.Args[0] 29588 if v_0.Op != OpRsh64Ux64 { 29589 break 29590 } 29591 _ = v_0.Args[1] 29592 v_0_0 := v_0.Args[0] 29593 if v_0_0.Op != OpLsh64x64 { 29594 break 29595 } 29596 _ = v_0_0.Args[1] 29597 x := v_0_0.Args[0] 29598 v_0_0_1 := v_0_0.Args[1] 29599 if v_0_0_1.Op != OpConst64 { 29600 break 29601 } 29602 c1 := v_0_0_1.AuxInt 29603 v_0_1 := v_0.Args[1] 29604 if v_0_1.Op != OpConst64 { 29605 break 29606 } 29607 c2 := v_0_1.AuxInt 29608 v_1 := v.Args[1] 29609 if v_1.Op != OpConst64 { 29610 break 29611 } 29612 c3 := v_1.AuxInt 29613 if !(uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)) { 29614 break 29615 } 29616 v.reset(OpLsh64x64) 29617 v.AddArg(x) 29618 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 29619 v0.AuxInt = c1 - c2 + c3 29620 v.AddArg(v0) 29621 return true 29622 } 29623 return false 29624 } 29625 func rewriteValuegeneric_OpLsh64x8_0(v *Value) bool { 29626 b := v.Block 29627 // match: (Lsh64x8 <t> x (Const8 [c])) 29628 // result: (Lsh64x64 x (Const64 <t> [int64(uint8(c))])) 29629 for { 29630 t := v.Type 29631 _ = v.Args[1] 29632 x := v.Args[0] 29633 v_1 := v.Args[1] 29634 if v_1.Op != OpConst8 { 29635 break 29636 } 29637 c := v_1.AuxInt 29638 v.reset(OpLsh64x64) 29639 v.AddArg(x) 29640 v0 := b.NewValue0(v.Pos, OpConst64, t) 29641 v0.AuxInt = int64(uint8(c)) 29642 v.AddArg(v0) 29643 return true 29644 } 29645 // match: (Lsh64x8 (Const64 [0]) _) 29646 // result: (Const64 [0]) 29647 for { 29648 _ = v.Args[1] 29649 v_0 := v.Args[0] 29650 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 29651 break 29652 } 29653 v.reset(OpConst64) 29654 v.AuxInt = 0 29655 return true 29656 } 29657 return false 29658 } 29659 func rewriteValuegeneric_OpLsh8x16_0(v *Value) bool { 29660 b := v.Block 29661 // match: (Lsh8x16 <t> x (Const16 [c])) 29662 // result: (Lsh8x64 x (Const64 <t> [int64(uint16(c))])) 29663 for { 29664 t := v.Type 29665 _ = v.Args[1] 29666 x := v.Args[0] 29667 v_1 := v.Args[1] 29668 if v_1.Op != OpConst16 { 29669 break 29670 } 29671 c := v_1.AuxInt 29672 v.reset(OpLsh8x64) 29673 v.AddArg(x) 29674 v0 := b.NewValue0(v.Pos, OpConst64, t) 29675 v0.AuxInt = int64(uint16(c)) 29676 v.AddArg(v0) 29677 return true 29678 } 29679 // match: (Lsh8x16 (Const8 [0]) _) 29680 // result: (Const8 [0]) 29681 for { 29682 _ = v.Args[1] 29683 v_0 := v.Args[0] 29684 if v_0.Op != OpConst8 || v_0.AuxInt != 0 { 29685 break 29686 } 29687 v.reset(OpConst8) 29688 v.AuxInt = 0 29689 return true 29690 } 29691 return false 29692 } 29693 func rewriteValuegeneric_OpLsh8x32_0(v *Value) bool { 29694 b := v.Block 29695 // match: (Lsh8x32 <t> x (Const32 [c])) 29696 // result: (Lsh8x64 x (Const64 <t> [int64(uint32(c))])) 29697 for { 29698 t := v.Type 29699 _ = v.Args[1] 29700 x := v.Args[0] 29701 v_1 := v.Args[1] 29702 if v_1.Op != OpConst32 { 29703 break 29704 } 29705 c := v_1.AuxInt 29706 v.reset(OpLsh8x64) 29707 v.AddArg(x) 29708 v0 := b.NewValue0(v.Pos, OpConst64, t) 29709 v0.AuxInt = int64(uint32(c)) 29710 v.AddArg(v0) 29711 return true 29712 } 29713 // match: (Lsh8x32 (Const8 [0]) _) 29714 // result: (Const8 [0]) 29715 for { 29716 _ = v.Args[1] 29717 v_0 := v.Args[0] 29718 if v_0.Op != OpConst8 || v_0.AuxInt != 0 { 29719 break 29720 } 29721 v.reset(OpConst8) 29722 v.AuxInt = 0 29723 return true 29724 } 29725 return false 29726 } 29727 func rewriteValuegeneric_OpLsh8x64_0(v *Value) bool { 29728 b := v.Block 29729 typ := &b.Func.Config.Types 29730 // match: (Lsh8x64 (Const8 [c]) (Const64 [d])) 29731 // result: (Const8 [int64(int8(c) << uint64(d))]) 29732 for { 29733 _ = v.Args[1] 29734 v_0 := v.Args[0] 29735 if v_0.Op != OpConst8 { 29736 break 29737 } 29738 c := v_0.AuxInt 29739 v_1 := v.Args[1] 29740 if v_1.Op != OpConst64 { 29741 break 29742 } 29743 d := v_1.AuxInt 29744 v.reset(OpConst8) 29745 v.AuxInt = int64(int8(c) << uint64(d)) 29746 return true 29747 } 29748 // match: (Lsh8x64 x (Const64 [0])) 29749 // result: x 29750 for { 29751 _ = v.Args[1] 29752 x := v.Args[0] 29753 v_1 := v.Args[1] 29754 if v_1.Op != OpConst64 || v_1.AuxInt != 0 { 29755 break 29756 } 29757 v.reset(OpCopy) 29758 v.Type = x.Type 29759 v.AddArg(x) 29760 return true 29761 } 29762 // match: (Lsh8x64 (Const8 [0]) _) 29763 // result: (Const8 [0]) 29764 for { 29765 _ = v.Args[1] 29766 v_0 := v.Args[0] 29767 if v_0.Op != OpConst8 || v_0.AuxInt != 0 { 29768 break 29769 } 29770 v.reset(OpConst8) 29771 v.AuxInt = 0 29772 return true 29773 } 29774 // match: (Lsh8x64 _ (Const64 [c])) 29775 // cond: uint64(c) >= 8 29776 // result: (Const8 [0]) 29777 for { 29778 _ = v.Args[1] 29779 v_1 := v.Args[1] 29780 if v_1.Op != OpConst64 { 29781 break 29782 } 29783 c := v_1.AuxInt 29784 if !(uint64(c) >= 8) { 29785 break 29786 } 29787 v.reset(OpConst8) 29788 v.AuxInt = 0 29789 return true 29790 } 29791 // match: (Lsh8x64 <t> (Lsh8x64 x (Const64 [c])) (Const64 [d])) 29792 // cond: !uaddOvf(c,d) 29793 // result: (Lsh8x64 x (Const64 <t> [c+d])) 29794 for { 29795 t := v.Type 29796 _ = v.Args[1] 29797 v_0 := v.Args[0] 29798 if v_0.Op != OpLsh8x64 { 29799 break 29800 } 29801 _ = v_0.Args[1] 29802 x := v_0.Args[0] 29803 v_0_1 := v_0.Args[1] 29804 if v_0_1.Op != OpConst64 { 29805 break 29806 } 29807 c := v_0_1.AuxInt 29808 v_1 := v.Args[1] 29809 if v_1.Op != OpConst64 { 29810 break 29811 } 29812 d := v_1.AuxInt 29813 if !(!uaddOvf(c, d)) { 29814 break 29815 } 29816 v.reset(OpLsh8x64) 29817 v.AddArg(x) 29818 v0 := b.NewValue0(v.Pos, OpConst64, t) 29819 v0.AuxInt = c + d 29820 v.AddArg(v0) 29821 return true 29822 } 29823 // match: (Lsh8x64 (Rsh8Ux64 (Lsh8x64 x (Const64 [c1])) (Const64 [c2])) (Const64 [c3])) 29824 // cond: uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3) 29825 // result: (Lsh8x64 x (Const64 <typ.UInt64> [c1-c2+c3])) 29826 for { 29827 _ = v.Args[1] 29828 v_0 := v.Args[0] 29829 if v_0.Op != OpRsh8Ux64 { 29830 break 29831 } 29832 _ = v_0.Args[1] 29833 v_0_0 := v_0.Args[0] 29834 if v_0_0.Op != OpLsh8x64 { 29835 break 29836 } 29837 _ = v_0_0.Args[1] 29838 x := v_0_0.Args[0] 29839 v_0_0_1 := v_0_0.Args[1] 29840 if v_0_0_1.Op != OpConst64 { 29841 break 29842 } 29843 c1 := v_0_0_1.AuxInt 29844 v_0_1 := v_0.Args[1] 29845 if v_0_1.Op != OpConst64 { 29846 break 29847 } 29848 c2 := v_0_1.AuxInt 29849 v_1 := v.Args[1] 29850 if v_1.Op != OpConst64 { 29851 break 29852 } 29853 c3 := v_1.AuxInt 29854 if !(uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)) { 29855 break 29856 } 29857 v.reset(OpLsh8x64) 29858 v.AddArg(x) 29859 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 29860 v0.AuxInt = c1 - c2 + c3 29861 v.AddArg(v0) 29862 return true 29863 } 29864 return false 29865 } 29866 func rewriteValuegeneric_OpLsh8x8_0(v *Value) bool { 29867 b := v.Block 29868 // match: (Lsh8x8 <t> x (Const8 [c])) 29869 // result: (Lsh8x64 x (Const64 <t> [int64(uint8(c))])) 29870 for { 29871 t := v.Type 29872 _ = v.Args[1] 29873 x := v.Args[0] 29874 v_1 := v.Args[1] 29875 if v_1.Op != OpConst8 { 29876 break 29877 } 29878 c := v_1.AuxInt 29879 v.reset(OpLsh8x64) 29880 v.AddArg(x) 29881 v0 := b.NewValue0(v.Pos, OpConst64, t) 29882 v0.AuxInt = int64(uint8(c)) 29883 v.AddArg(v0) 29884 return true 29885 } 29886 // match: (Lsh8x8 (Const8 [0]) _) 29887 // result: (Const8 [0]) 29888 for { 29889 _ = v.Args[1] 29890 v_0 := v.Args[0] 29891 if v_0.Op != OpConst8 || v_0.AuxInt != 0 { 29892 break 29893 } 29894 v.reset(OpConst8) 29895 v.AuxInt = 0 29896 return true 29897 } 29898 return false 29899 } 29900 func rewriteValuegeneric_OpMod16_0(v *Value) bool { 29901 b := v.Block 29902 // match: (Mod16 (Const16 [c]) (Const16 [d])) 29903 // cond: d != 0 29904 // result: (Const16 [int64(int16(c % d))]) 29905 for { 29906 _ = v.Args[1] 29907 v_0 := v.Args[0] 29908 if v_0.Op != OpConst16 { 29909 break 29910 } 29911 c := v_0.AuxInt 29912 v_1 := v.Args[1] 29913 if v_1.Op != OpConst16 { 29914 break 29915 } 29916 d := v_1.AuxInt 29917 if !(d != 0) { 29918 break 29919 } 29920 v.reset(OpConst16) 29921 v.AuxInt = int64(int16(c % d)) 29922 return true 29923 } 29924 // match: (Mod16 <t> n (Const16 [c])) 29925 // cond: isNonNegative(n) && isPowerOfTwo(c&0xffff) 29926 // result: (And16 n (Const16 <t> [(c&0xffff)-1])) 29927 for { 29928 t := v.Type 29929 _ = v.Args[1] 29930 n := v.Args[0] 29931 v_1 := v.Args[1] 29932 if v_1.Op != OpConst16 { 29933 break 29934 } 29935 c := v_1.AuxInt 29936 if !(isNonNegative(n) && isPowerOfTwo(c&0xffff)) { 29937 break 29938 } 29939 v.reset(OpAnd16) 29940 v.AddArg(n) 29941 v0 := b.NewValue0(v.Pos, OpConst16, t) 29942 v0.AuxInt = (c & 0xffff) - 1 29943 v.AddArg(v0) 29944 return true 29945 } 29946 // match: (Mod16 <t> n (Const16 [c])) 29947 // cond: c < 0 && c != -1<<15 29948 // result: (Mod16 <t> n (Const16 <t> [-c])) 29949 for { 29950 t := v.Type 29951 _ = v.Args[1] 29952 n := v.Args[0] 29953 v_1 := v.Args[1] 29954 if v_1.Op != OpConst16 { 29955 break 29956 } 29957 c := v_1.AuxInt 29958 if !(c < 0 && c != -1<<15) { 29959 break 29960 } 29961 v.reset(OpMod16) 29962 v.Type = t 29963 v.AddArg(n) 29964 v0 := b.NewValue0(v.Pos, OpConst16, t) 29965 v0.AuxInt = -c 29966 v.AddArg(v0) 29967 return true 29968 } 29969 // match: (Mod16 <t> x (Const16 [c])) 29970 // cond: x.Op != OpConst16 && (c > 0 || c == -1<<15) 29971 // result: (Sub16 x (Mul16 <t> (Div16 <t> x (Const16 <t> [c])) (Const16 <t> [c]))) 29972 for { 29973 t := v.Type 29974 _ = v.Args[1] 29975 x := v.Args[0] 29976 v_1 := v.Args[1] 29977 if v_1.Op != OpConst16 { 29978 break 29979 } 29980 c := v_1.AuxInt 29981 if !(x.Op != OpConst16 && (c > 0 || c == -1<<15)) { 29982 break 29983 } 29984 v.reset(OpSub16) 29985 v.AddArg(x) 29986 v0 := b.NewValue0(v.Pos, OpMul16, t) 29987 v1 := b.NewValue0(v.Pos, OpDiv16, t) 29988 v1.AddArg(x) 29989 v2 := b.NewValue0(v.Pos, OpConst16, t) 29990 v2.AuxInt = c 29991 v1.AddArg(v2) 29992 v0.AddArg(v1) 29993 v3 := b.NewValue0(v.Pos, OpConst16, t) 29994 v3.AuxInt = c 29995 v0.AddArg(v3) 29996 v.AddArg(v0) 29997 return true 29998 } 29999 return false 30000 } 30001 func rewriteValuegeneric_OpMod16u_0(v *Value) bool { 30002 b := v.Block 30003 // match: (Mod16u (Const16 [c]) (Const16 [d])) 30004 // cond: d != 0 30005 // result: (Const16 [int64(uint16(c) % uint16(d))]) 30006 for { 30007 _ = v.Args[1] 30008 v_0 := v.Args[0] 30009 if v_0.Op != OpConst16 { 30010 break 30011 } 30012 c := v_0.AuxInt 30013 v_1 := v.Args[1] 30014 if v_1.Op != OpConst16 { 30015 break 30016 } 30017 d := v_1.AuxInt 30018 if !(d != 0) { 30019 break 30020 } 30021 v.reset(OpConst16) 30022 v.AuxInt = int64(uint16(c) % uint16(d)) 30023 return true 30024 } 30025 // match: (Mod16u <t> n (Const16 [c])) 30026 // cond: isPowerOfTwo(c&0xffff) 30027 // result: (And16 n (Const16 <t> [(c&0xffff)-1])) 30028 for { 30029 t := v.Type 30030 _ = v.Args[1] 30031 n := v.Args[0] 30032 v_1 := v.Args[1] 30033 if v_1.Op != OpConst16 { 30034 break 30035 } 30036 c := v_1.AuxInt 30037 if !(isPowerOfTwo(c & 0xffff)) { 30038 break 30039 } 30040 v.reset(OpAnd16) 30041 v.AddArg(n) 30042 v0 := b.NewValue0(v.Pos, OpConst16, t) 30043 v0.AuxInt = (c & 0xffff) - 1 30044 v.AddArg(v0) 30045 return true 30046 } 30047 // match: (Mod16u <t> x (Const16 [c])) 30048 // cond: x.Op != OpConst16 && c > 0 && umagicOK(16,c) 30049 // result: (Sub16 x (Mul16 <t> (Div16u <t> x (Const16 <t> [c])) (Const16 <t> [c]))) 30050 for { 30051 t := v.Type 30052 _ = v.Args[1] 30053 x := v.Args[0] 30054 v_1 := v.Args[1] 30055 if v_1.Op != OpConst16 { 30056 break 30057 } 30058 c := v_1.AuxInt 30059 if !(x.Op != OpConst16 && c > 0 && umagicOK(16, c)) { 30060 break 30061 } 30062 v.reset(OpSub16) 30063 v.AddArg(x) 30064 v0 := b.NewValue0(v.Pos, OpMul16, t) 30065 v1 := b.NewValue0(v.Pos, OpDiv16u, t) 30066 v1.AddArg(x) 30067 v2 := b.NewValue0(v.Pos, OpConst16, t) 30068 v2.AuxInt = c 30069 v1.AddArg(v2) 30070 v0.AddArg(v1) 30071 v3 := b.NewValue0(v.Pos, OpConst16, t) 30072 v3.AuxInt = c 30073 v0.AddArg(v3) 30074 v.AddArg(v0) 30075 return true 30076 } 30077 return false 30078 } 30079 func rewriteValuegeneric_OpMod32_0(v *Value) bool { 30080 b := v.Block 30081 // match: (Mod32 (Const32 [c]) (Const32 [d])) 30082 // cond: d != 0 30083 // result: (Const32 [int64(int32(c % d))]) 30084 for { 30085 _ = v.Args[1] 30086 v_0 := v.Args[0] 30087 if v_0.Op != OpConst32 { 30088 break 30089 } 30090 c := v_0.AuxInt 30091 v_1 := v.Args[1] 30092 if v_1.Op != OpConst32 { 30093 break 30094 } 30095 d := v_1.AuxInt 30096 if !(d != 0) { 30097 break 30098 } 30099 v.reset(OpConst32) 30100 v.AuxInt = int64(int32(c % d)) 30101 return true 30102 } 30103 // match: (Mod32 <t> n (Const32 [c])) 30104 // cond: isNonNegative(n) && isPowerOfTwo(c&0xffffffff) 30105 // result: (And32 n (Const32 <t> [(c&0xffffffff)-1])) 30106 for { 30107 t := v.Type 30108 _ = v.Args[1] 30109 n := v.Args[0] 30110 v_1 := v.Args[1] 30111 if v_1.Op != OpConst32 { 30112 break 30113 } 30114 c := v_1.AuxInt 30115 if !(isNonNegative(n) && isPowerOfTwo(c&0xffffffff)) { 30116 break 30117 } 30118 v.reset(OpAnd32) 30119 v.AddArg(n) 30120 v0 := b.NewValue0(v.Pos, OpConst32, t) 30121 v0.AuxInt = (c & 0xffffffff) - 1 30122 v.AddArg(v0) 30123 return true 30124 } 30125 // match: (Mod32 <t> n (Const32 [c])) 30126 // cond: c < 0 && c != -1<<31 30127 // result: (Mod32 <t> n (Const32 <t> [-c])) 30128 for { 30129 t := v.Type 30130 _ = v.Args[1] 30131 n := v.Args[0] 30132 v_1 := v.Args[1] 30133 if v_1.Op != OpConst32 { 30134 break 30135 } 30136 c := v_1.AuxInt 30137 if !(c < 0 && c != -1<<31) { 30138 break 30139 } 30140 v.reset(OpMod32) 30141 v.Type = t 30142 v.AddArg(n) 30143 v0 := b.NewValue0(v.Pos, OpConst32, t) 30144 v0.AuxInt = -c 30145 v.AddArg(v0) 30146 return true 30147 } 30148 // match: (Mod32 <t> x (Const32 [c])) 30149 // cond: x.Op != OpConst32 && (c > 0 || c == -1<<31) 30150 // result: (Sub32 x (Mul32 <t> (Div32 <t> x (Const32 <t> [c])) (Const32 <t> [c]))) 30151 for { 30152 t := v.Type 30153 _ = v.Args[1] 30154 x := v.Args[0] 30155 v_1 := v.Args[1] 30156 if v_1.Op != OpConst32 { 30157 break 30158 } 30159 c := v_1.AuxInt 30160 if !(x.Op != OpConst32 && (c > 0 || c == -1<<31)) { 30161 break 30162 } 30163 v.reset(OpSub32) 30164 v.AddArg(x) 30165 v0 := b.NewValue0(v.Pos, OpMul32, t) 30166 v1 := b.NewValue0(v.Pos, OpDiv32, t) 30167 v1.AddArg(x) 30168 v2 := b.NewValue0(v.Pos, OpConst32, t) 30169 v2.AuxInt = c 30170 v1.AddArg(v2) 30171 v0.AddArg(v1) 30172 v3 := b.NewValue0(v.Pos, OpConst32, t) 30173 v3.AuxInt = c 30174 v0.AddArg(v3) 30175 v.AddArg(v0) 30176 return true 30177 } 30178 return false 30179 } 30180 func rewriteValuegeneric_OpMod32u_0(v *Value) bool { 30181 b := v.Block 30182 // match: (Mod32u (Const32 [c]) (Const32 [d])) 30183 // cond: d != 0 30184 // result: (Const32 [int64(uint32(c) % uint32(d))]) 30185 for { 30186 _ = v.Args[1] 30187 v_0 := v.Args[0] 30188 if v_0.Op != OpConst32 { 30189 break 30190 } 30191 c := v_0.AuxInt 30192 v_1 := v.Args[1] 30193 if v_1.Op != OpConst32 { 30194 break 30195 } 30196 d := v_1.AuxInt 30197 if !(d != 0) { 30198 break 30199 } 30200 v.reset(OpConst32) 30201 v.AuxInt = int64(uint32(c) % uint32(d)) 30202 return true 30203 } 30204 // match: (Mod32u <t> n (Const32 [c])) 30205 // cond: isPowerOfTwo(c&0xffffffff) 30206 // result: (And32 n (Const32 <t> [(c&0xffffffff)-1])) 30207 for { 30208 t := v.Type 30209 _ = v.Args[1] 30210 n := v.Args[0] 30211 v_1 := v.Args[1] 30212 if v_1.Op != OpConst32 { 30213 break 30214 } 30215 c := v_1.AuxInt 30216 if !(isPowerOfTwo(c & 0xffffffff)) { 30217 break 30218 } 30219 v.reset(OpAnd32) 30220 v.AddArg(n) 30221 v0 := b.NewValue0(v.Pos, OpConst32, t) 30222 v0.AuxInt = (c & 0xffffffff) - 1 30223 v.AddArg(v0) 30224 return true 30225 } 30226 // match: (Mod32u <t> x (Const32 [c])) 30227 // cond: x.Op != OpConst32 && c > 0 && umagicOK(32,c) 30228 // result: (Sub32 x (Mul32 <t> (Div32u <t> x (Const32 <t> [c])) (Const32 <t> [c]))) 30229 for { 30230 t := v.Type 30231 _ = v.Args[1] 30232 x := v.Args[0] 30233 v_1 := v.Args[1] 30234 if v_1.Op != OpConst32 { 30235 break 30236 } 30237 c := v_1.AuxInt 30238 if !(x.Op != OpConst32 && c > 0 && umagicOK(32, c)) { 30239 break 30240 } 30241 v.reset(OpSub32) 30242 v.AddArg(x) 30243 v0 := b.NewValue0(v.Pos, OpMul32, t) 30244 v1 := b.NewValue0(v.Pos, OpDiv32u, t) 30245 v1.AddArg(x) 30246 v2 := b.NewValue0(v.Pos, OpConst32, t) 30247 v2.AuxInt = c 30248 v1.AddArg(v2) 30249 v0.AddArg(v1) 30250 v3 := b.NewValue0(v.Pos, OpConst32, t) 30251 v3.AuxInt = c 30252 v0.AddArg(v3) 30253 v.AddArg(v0) 30254 return true 30255 } 30256 return false 30257 } 30258 func rewriteValuegeneric_OpMod64_0(v *Value) bool { 30259 b := v.Block 30260 // match: (Mod64 (Const64 [c]) (Const64 [d])) 30261 // cond: d != 0 30262 // result: (Const64 [c % d]) 30263 for { 30264 _ = v.Args[1] 30265 v_0 := v.Args[0] 30266 if v_0.Op != OpConst64 { 30267 break 30268 } 30269 c := v_0.AuxInt 30270 v_1 := v.Args[1] 30271 if v_1.Op != OpConst64 { 30272 break 30273 } 30274 d := v_1.AuxInt 30275 if !(d != 0) { 30276 break 30277 } 30278 v.reset(OpConst64) 30279 v.AuxInt = c % d 30280 return true 30281 } 30282 // match: (Mod64 <t> n (Const64 [c])) 30283 // cond: isNonNegative(n) && isPowerOfTwo(c) 30284 // result: (And64 n (Const64 <t> [c-1])) 30285 for { 30286 t := v.Type 30287 _ = v.Args[1] 30288 n := v.Args[0] 30289 v_1 := v.Args[1] 30290 if v_1.Op != OpConst64 { 30291 break 30292 } 30293 c := v_1.AuxInt 30294 if !(isNonNegative(n) && isPowerOfTwo(c)) { 30295 break 30296 } 30297 v.reset(OpAnd64) 30298 v.AddArg(n) 30299 v0 := b.NewValue0(v.Pos, OpConst64, t) 30300 v0.AuxInt = c - 1 30301 v.AddArg(v0) 30302 return true 30303 } 30304 // match: (Mod64 n (Const64 [-1<<63])) 30305 // cond: isNonNegative(n) 30306 // result: n 30307 for { 30308 _ = v.Args[1] 30309 n := v.Args[0] 30310 v_1 := v.Args[1] 30311 if v_1.Op != OpConst64 || v_1.AuxInt != -1<<63 || !(isNonNegative(n)) { 30312 break 30313 } 30314 v.reset(OpCopy) 30315 v.Type = n.Type 30316 v.AddArg(n) 30317 return true 30318 } 30319 // match: (Mod64 <t> n (Const64 [c])) 30320 // cond: c < 0 && c != -1<<63 30321 // result: (Mod64 <t> n (Const64 <t> [-c])) 30322 for { 30323 t := v.Type 30324 _ = v.Args[1] 30325 n := v.Args[0] 30326 v_1 := v.Args[1] 30327 if v_1.Op != OpConst64 { 30328 break 30329 } 30330 c := v_1.AuxInt 30331 if !(c < 0 && c != -1<<63) { 30332 break 30333 } 30334 v.reset(OpMod64) 30335 v.Type = t 30336 v.AddArg(n) 30337 v0 := b.NewValue0(v.Pos, OpConst64, t) 30338 v0.AuxInt = -c 30339 v.AddArg(v0) 30340 return true 30341 } 30342 // match: (Mod64 <t> x (Const64 [c])) 30343 // cond: x.Op != OpConst64 && (c > 0 || c == -1<<63) 30344 // result: (Sub64 x (Mul64 <t> (Div64 <t> x (Const64 <t> [c])) (Const64 <t> [c]))) 30345 for { 30346 t := v.Type 30347 _ = v.Args[1] 30348 x := v.Args[0] 30349 v_1 := v.Args[1] 30350 if v_1.Op != OpConst64 { 30351 break 30352 } 30353 c := v_1.AuxInt 30354 if !(x.Op != OpConst64 && (c > 0 || c == -1<<63)) { 30355 break 30356 } 30357 v.reset(OpSub64) 30358 v.AddArg(x) 30359 v0 := b.NewValue0(v.Pos, OpMul64, t) 30360 v1 := b.NewValue0(v.Pos, OpDiv64, t) 30361 v1.AddArg(x) 30362 v2 := b.NewValue0(v.Pos, OpConst64, t) 30363 v2.AuxInt = c 30364 v1.AddArg(v2) 30365 v0.AddArg(v1) 30366 v3 := b.NewValue0(v.Pos, OpConst64, t) 30367 v3.AuxInt = c 30368 v0.AddArg(v3) 30369 v.AddArg(v0) 30370 return true 30371 } 30372 return false 30373 } 30374 func rewriteValuegeneric_OpMod64u_0(v *Value) bool { 30375 b := v.Block 30376 // match: (Mod64u (Const64 [c]) (Const64 [d])) 30377 // cond: d != 0 30378 // result: (Const64 [int64(uint64(c) % uint64(d))]) 30379 for { 30380 _ = v.Args[1] 30381 v_0 := v.Args[0] 30382 if v_0.Op != OpConst64 { 30383 break 30384 } 30385 c := v_0.AuxInt 30386 v_1 := v.Args[1] 30387 if v_1.Op != OpConst64 { 30388 break 30389 } 30390 d := v_1.AuxInt 30391 if !(d != 0) { 30392 break 30393 } 30394 v.reset(OpConst64) 30395 v.AuxInt = int64(uint64(c) % uint64(d)) 30396 return true 30397 } 30398 // match: (Mod64u <t> n (Const64 [c])) 30399 // cond: isPowerOfTwo(c) 30400 // result: (And64 n (Const64 <t> [c-1])) 30401 for { 30402 t := v.Type 30403 _ = v.Args[1] 30404 n := v.Args[0] 30405 v_1 := v.Args[1] 30406 if v_1.Op != OpConst64 { 30407 break 30408 } 30409 c := v_1.AuxInt 30410 if !(isPowerOfTwo(c)) { 30411 break 30412 } 30413 v.reset(OpAnd64) 30414 v.AddArg(n) 30415 v0 := b.NewValue0(v.Pos, OpConst64, t) 30416 v0.AuxInt = c - 1 30417 v.AddArg(v0) 30418 return true 30419 } 30420 // match: (Mod64u <t> n (Const64 [-1<<63])) 30421 // result: (And64 n (Const64 <t> [1<<63-1])) 30422 for { 30423 t := v.Type 30424 _ = v.Args[1] 30425 n := v.Args[0] 30426 v_1 := v.Args[1] 30427 if v_1.Op != OpConst64 || v_1.AuxInt != -1<<63 { 30428 break 30429 } 30430 v.reset(OpAnd64) 30431 v.AddArg(n) 30432 v0 := b.NewValue0(v.Pos, OpConst64, t) 30433 v0.AuxInt = 1<<63 - 1 30434 v.AddArg(v0) 30435 return true 30436 } 30437 // match: (Mod64u <t> x (Const64 [c])) 30438 // cond: x.Op != OpConst64 && c > 0 && umagicOK(64,c) 30439 // result: (Sub64 x (Mul64 <t> (Div64u <t> x (Const64 <t> [c])) (Const64 <t> [c]))) 30440 for { 30441 t := v.Type 30442 _ = v.Args[1] 30443 x := v.Args[0] 30444 v_1 := v.Args[1] 30445 if v_1.Op != OpConst64 { 30446 break 30447 } 30448 c := v_1.AuxInt 30449 if !(x.Op != OpConst64 && c > 0 && umagicOK(64, c)) { 30450 break 30451 } 30452 v.reset(OpSub64) 30453 v.AddArg(x) 30454 v0 := b.NewValue0(v.Pos, OpMul64, t) 30455 v1 := b.NewValue0(v.Pos, OpDiv64u, t) 30456 v1.AddArg(x) 30457 v2 := b.NewValue0(v.Pos, OpConst64, t) 30458 v2.AuxInt = c 30459 v1.AddArg(v2) 30460 v0.AddArg(v1) 30461 v3 := b.NewValue0(v.Pos, OpConst64, t) 30462 v3.AuxInt = c 30463 v0.AddArg(v3) 30464 v.AddArg(v0) 30465 return true 30466 } 30467 return false 30468 } 30469 func rewriteValuegeneric_OpMod8_0(v *Value) bool { 30470 b := v.Block 30471 // match: (Mod8 (Const8 [c]) (Const8 [d])) 30472 // cond: d != 0 30473 // result: (Const8 [int64(int8(c % d))]) 30474 for { 30475 _ = v.Args[1] 30476 v_0 := v.Args[0] 30477 if v_0.Op != OpConst8 { 30478 break 30479 } 30480 c := v_0.AuxInt 30481 v_1 := v.Args[1] 30482 if v_1.Op != OpConst8 { 30483 break 30484 } 30485 d := v_1.AuxInt 30486 if !(d != 0) { 30487 break 30488 } 30489 v.reset(OpConst8) 30490 v.AuxInt = int64(int8(c % d)) 30491 return true 30492 } 30493 // match: (Mod8 <t> n (Const8 [c])) 30494 // cond: isNonNegative(n) && isPowerOfTwo(c&0xff) 30495 // result: (And8 n (Const8 <t> [(c&0xff)-1])) 30496 for { 30497 t := v.Type 30498 _ = v.Args[1] 30499 n := v.Args[0] 30500 v_1 := v.Args[1] 30501 if v_1.Op != OpConst8 { 30502 break 30503 } 30504 c := v_1.AuxInt 30505 if !(isNonNegative(n) && isPowerOfTwo(c&0xff)) { 30506 break 30507 } 30508 v.reset(OpAnd8) 30509 v.AddArg(n) 30510 v0 := b.NewValue0(v.Pos, OpConst8, t) 30511 v0.AuxInt = (c & 0xff) - 1 30512 v.AddArg(v0) 30513 return true 30514 } 30515 // match: (Mod8 <t> n (Const8 [c])) 30516 // cond: c < 0 && c != -1<<7 30517 // result: (Mod8 <t> n (Const8 <t> [-c])) 30518 for { 30519 t := v.Type 30520 _ = v.Args[1] 30521 n := v.Args[0] 30522 v_1 := v.Args[1] 30523 if v_1.Op != OpConst8 { 30524 break 30525 } 30526 c := v_1.AuxInt 30527 if !(c < 0 && c != -1<<7) { 30528 break 30529 } 30530 v.reset(OpMod8) 30531 v.Type = t 30532 v.AddArg(n) 30533 v0 := b.NewValue0(v.Pos, OpConst8, t) 30534 v0.AuxInt = -c 30535 v.AddArg(v0) 30536 return true 30537 } 30538 // match: (Mod8 <t> x (Const8 [c])) 30539 // cond: x.Op != OpConst8 && (c > 0 || c == -1<<7) 30540 // result: (Sub8 x (Mul8 <t> (Div8 <t> x (Const8 <t> [c])) (Const8 <t> [c]))) 30541 for { 30542 t := v.Type 30543 _ = v.Args[1] 30544 x := v.Args[0] 30545 v_1 := v.Args[1] 30546 if v_1.Op != OpConst8 { 30547 break 30548 } 30549 c := v_1.AuxInt 30550 if !(x.Op != OpConst8 && (c > 0 || c == -1<<7)) { 30551 break 30552 } 30553 v.reset(OpSub8) 30554 v.AddArg(x) 30555 v0 := b.NewValue0(v.Pos, OpMul8, t) 30556 v1 := b.NewValue0(v.Pos, OpDiv8, t) 30557 v1.AddArg(x) 30558 v2 := b.NewValue0(v.Pos, OpConst8, t) 30559 v2.AuxInt = c 30560 v1.AddArg(v2) 30561 v0.AddArg(v1) 30562 v3 := b.NewValue0(v.Pos, OpConst8, t) 30563 v3.AuxInt = c 30564 v0.AddArg(v3) 30565 v.AddArg(v0) 30566 return true 30567 } 30568 return false 30569 } 30570 func rewriteValuegeneric_OpMod8u_0(v *Value) bool { 30571 b := v.Block 30572 // match: (Mod8u (Const8 [c]) (Const8 [d])) 30573 // cond: d != 0 30574 // result: (Const8 [int64(uint8(c) % uint8(d))]) 30575 for { 30576 _ = v.Args[1] 30577 v_0 := v.Args[0] 30578 if v_0.Op != OpConst8 { 30579 break 30580 } 30581 c := v_0.AuxInt 30582 v_1 := v.Args[1] 30583 if v_1.Op != OpConst8 { 30584 break 30585 } 30586 d := v_1.AuxInt 30587 if !(d != 0) { 30588 break 30589 } 30590 v.reset(OpConst8) 30591 v.AuxInt = int64(uint8(c) % uint8(d)) 30592 return true 30593 } 30594 // match: (Mod8u <t> n (Const8 [c])) 30595 // cond: isPowerOfTwo(c&0xff) 30596 // result: (And8 n (Const8 <t> [(c&0xff)-1])) 30597 for { 30598 t := v.Type 30599 _ = v.Args[1] 30600 n := v.Args[0] 30601 v_1 := v.Args[1] 30602 if v_1.Op != OpConst8 { 30603 break 30604 } 30605 c := v_1.AuxInt 30606 if !(isPowerOfTwo(c & 0xff)) { 30607 break 30608 } 30609 v.reset(OpAnd8) 30610 v.AddArg(n) 30611 v0 := b.NewValue0(v.Pos, OpConst8, t) 30612 v0.AuxInt = (c & 0xff) - 1 30613 v.AddArg(v0) 30614 return true 30615 } 30616 // match: (Mod8u <t> x (Const8 [c])) 30617 // cond: x.Op != OpConst8 && c > 0 && umagicOK(8, c) 30618 // result: (Sub8 x (Mul8 <t> (Div8u <t> x (Const8 <t> [c])) (Const8 <t> [c]))) 30619 for { 30620 t := v.Type 30621 _ = v.Args[1] 30622 x := v.Args[0] 30623 v_1 := v.Args[1] 30624 if v_1.Op != OpConst8 { 30625 break 30626 } 30627 c := v_1.AuxInt 30628 if !(x.Op != OpConst8 && c > 0 && umagicOK(8, c)) { 30629 break 30630 } 30631 v.reset(OpSub8) 30632 v.AddArg(x) 30633 v0 := b.NewValue0(v.Pos, OpMul8, t) 30634 v1 := b.NewValue0(v.Pos, OpDiv8u, t) 30635 v1.AddArg(x) 30636 v2 := b.NewValue0(v.Pos, OpConst8, t) 30637 v2.AuxInt = c 30638 v1.AddArg(v2) 30639 v0.AddArg(v1) 30640 v3 := b.NewValue0(v.Pos, OpConst8, t) 30641 v3.AuxInt = c 30642 v0.AddArg(v3) 30643 v.AddArg(v0) 30644 return true 30645 } 30646 return false 30647 } 30648 func rewriteValuegeneric_OpMove_0(v *Value) bool { 30649 b := v.Block 30650 // match: (Move {t} [n] dst1 src mem:(Zero {t} [n] dst2 _)) 30651 // cond: isSamePtr(src, dst2) 30652 // result: (Zero {t} [n] dst1 mem) 30653 for { 30654 n := v.AuxInt 30655 t := v.Aux 30656 _ = v.Args[2] 30657 dst1 := v.Args[0] 30658 src := v.Args[1] 30659 mem := v.Args[2] 30660 if mem.Op != OpZero || mem.AuxInt != n || mem.Aux != t { 30661 break 30662 } 30663 _ = mem.Args[1] 30664 dst2 := mem.Args[0] 30665 if !(isSamePtr(src, dst2)) { 30666 break 30667 } 30668 v.reset(OpZero) 30669 v.AuxInt = n 30670 v.Aux = t 30671 v.AddArg(dst1) 30672 v.AddArg(mem) 30673 return true 30674 } 30675 // match: (Move {t} [n] dst1 src mem:(VarDef (Zero {t} [n] dst0 _))) 30676 // cond: isSamePtr(src, dst0) 30677 // result: (Zero {t} [n] dst1 mem) 30678 for { 30679 n := v.AuxInt 30680 t := v.Aux 30681 _ = v.Args[2] 30682 dst1 := v.Args[0] 30683 src := v.Args[1] 30684 mem := v.Args[2] 30685 if mem.Op != OpVarDef { 30686 break 30687 } 30688 mem_0 := mem.Args[0] 30689 if mem_0.Op != OpZero || mem_0.AuxInt != n || mem_0.Aux != t { 30690 break 30691 } 30692 _ = mem_0.Args[1] 30693 dst0 := mem_0.Args[0] 30694 if !(isSamePtr(src, dst0)) { 30695 break 30696 } 30697 v.reset(OpZero) 30698 v.AuxInt = n 30699 v.Aux = t 30700 v.AddArg(dst1) 30701 v.AddArg(mem) 30702 return true 30703 } 30704 // match: (Move {t1} [n] dst1 src1 store:(Store {t2} op:(OffPtr [o2] dst2) _ mem)) 30705 // cond: isSamePtr(dst1, dst2) && store.Uses == 1 && n >= o2 + sizeof(t2) && disjoint(src1, n, op, sizeof(t2)) && clobber(store) 30706 // result: (Move {t1} [n] dst1 src1 mem) 30707 for { 30708 n := v.AuxInt 30709 t1 := v.Aux 30710 _ = v.Args[2] 30711 dst1 := v.Args[0] 30712 src1 := v.Args[1] 30713 store := v.Args[2] 30714 if store.Op != OpStore { 30715 break 30716 } 30717 t2 := store.Aux 30718 mem := store.Args[2] 30719 op := store.Args[0] 30720 if op.Op != OpOffPtr { 30721 break 30722 } 30723 o2 := op.AuxInt 30724 dst2 := op.Args[0] 30725 if !(isSamePtr(dst1, dst2) && store.Uses == 1 && n >= o2+sizeof(t2) && disjoint(src1, n, op, sizeof(t2)) && clobber(store)) { 30726 break 30727 } 30728 v.reset(OpMove) 30729 v.AuxInt = n 30730 v.Aux = t1 30731 v.AddArg(dst1) 30732 v.AddArg(src1) 30733 v.AddArg(mem) 30734 return true 30735 } 30736 // match: (Move {t} [n] dst1 src1 move:(Move {t} [n] dst2 _ mem)) 30737 // cond: move.Uses == 1 && isSamePtr(dst1, dst2) && disjoint(src1, n, dst2, n) && clobber(move) 30738 // result: (Move {t} [n] dst1 src1 mem) 30739 for { 30740 n := v.AuxInt 30741 t := v.Aux 30742 _ = v.Args[2] 30743 dst1 := v.Args[0] 30744 src1 := v.Args[1] 30745 move := v.Args[2] 30746 if move.Op != OpMove || move.AuxInt != n || move.Aux != t { 30747 break 30748 } 30749 mem := move.Args[2] 30750 dst2 := move.Args[0] 30751 if !(move.Uses == 1 && isSamePtr(dst1, dst2) && disjoint(src1, n, dst2, n) && clobber(move)) { 30752 break 30753 } 30754 v.reset(OpMove) 30755 v.AuxInt = n 30756 v.Aux = t 30757 v.AddArg(dst1) 30758 v.AddArg(src1) 30759 v.AddArg(mem) 30760 return true 30761 } 30762 // match: (Move {t} [n] dst1 src1 vardef:(VarDef {x} move:(Move {t} [n] dst2 _ mem))) 30763 // cond: move.Uses == 1 && vardef.Uses == 1 && isSamePtr(dst1, dst2) && disjoint(src1, n, dst2, n) && clobber(move) && clobber(vardef) 30764 // result: (Move {t} [n] dst1 src1 (VarDef {x} mem)) 30765 for { 30766 n := v.AuxInt 30767 t := v.Aux 30768 _ = v.Args[2] 30769 dst1 := v.Args[0] 30770 src1 := v.Args[1] 30771 vardef := v.Args[2] 30772 if vardef.Op != OpVarDef { 30773 break 30774 } 30775 x := vardef.Aux 30776 move := vardef.Args[0] 30777 if move.Op != OpMove || move.AuxInt != n || move.Aux != t { 30778 break 30779 } 30780 mem := move.Args[2] 30781 dst2 := move.Args[0] 30782 if !(move.Uses == 1 && vardef.Uses == 1 && isSamePtr(dst1, dst2) && disjoint(src1, n, dst2, n) && clobber(move) && clobber(vardef)) { 30783 break 30784 } 30785 v.reset(OpMove) 30786 v.AuxInt = n 30787 v.Aux = t 30788 v.AddArg(dst1) 30789 v.AddArg(src1) 30790 v0 := b.NewValue0(v.Pos, OpVarDef, types.TypeMem) 30791 v0.Aux = x 30792 v0.AddArg(mem) 30793 v.AddArg(v0) 30794 return true 30795 } 30796 // match: (Move {t} [n] dst1 src1 zero:(Zero {t} [n] dst2 mem)) 30797 // cond: zero.Uses == 1 && isSamePtr(dst1, dst2) && disjoint(src1, n, dst2, n) && clobber(zero) 30798 // result: (Move {t} [n] dst1 src1 mem) 30799 for { 30800 n := v.AuxInt 30801 t := v.Aux 30802 _ = v.Args[2] 30803 dst1 := v.Args[0] 30804 src1 := v.Args[1] 30805 zero := v.Args[2] 30806 if zero.Op != OpZero || zero.AuxInt != n || zero.Aux != t { 30807 break 30808 } 30809 mem := zero.Args[1] 30810 dst2 := zero.Args[0] 30811 if !(zero.Uses == 1 && isSamePtr(dst1, dst2) && disjoint(src1, n, dst2, n) && clobber(zero)) { 30812 break 30813 } 30814 v.reset(OpMove) 30815 v.AuxInt = n 30816 v.Aux = t 30817 v.AddArg(dst1) 30818 v.AddArg(src1) 30819 v.AddArg(mem) 30820 return true 30821 } 30822 // match: (Move {t} [n] dst1 src1 vardef:(VarDef {x} zero:(Zero {t} [n] dst2 mem))) 30823 // cond: zero.Uses == 1 && vardef.Uses == 1 && isSamePtr(dst1, dst2) && disjoint(src1, n, dst2, n) && clobber(zero) && clobber(vardef) 30824 // result: (Move {t} [n] dst1 src1 (VarDef {x} mem)) 30825 for { 30826 n := v.AuxInt 30827 t := v.Aux 30828 _ = v.Args[2] 30829 dst1 := v.Args[0] 30830 src1 := v.Args[1] 30831 vardef := v.Args[2] 30832 if vardef.Op != OpVarDef { 30833 break 30834 } 30835 x := vardef.Aux 30836 zero := vardef.Args[0] 30837 if zero.Op != OpZero || zero.AuxInt != n || zero.Aux != t { 30838 break 30839 } 30840 mem := zero.Args[1] 30841 dst2 := zero.Args[0] 30842 if !(zero.Uses == 1 && vardef.Uses == 1 && isSamePtr(dst1, dst2) && disjoint(src1, n, dst2, n) && clobber(zero) && clobber(vardef)) { 30843 break 30844 } 30845 v.reset(OpMove) 30846 v.AuxInt = n 30847 v.Aux = t 30848 v.AddArg(dst1) 30849 v.AddArg(src1) 30850 v0 := b.NewValue0(v.Pos, OpVarDef, types.TypeMem) 30851 v0.Aux = x 30852 v0.AddArg(mem) 30853 v.AddArg(v0) 30854 return true 30855 } 30856 // match: (Move {t1} [n] dst p1 mem:(Store {t2} op2:(OffPtr <tt2> [o2] p2) d1 (Store {t3} op3:(OffPtr <tt3> [0] p3) d2 _))) 30857 // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && o2 == sizeof(t3) && n == sizeof(t2) + sizeof(t3) 30858 // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [0] dst) d2 mem)) 30859 for { 30860 n := v.AuxInt 30861 t1 := v.Aux 30862 _ = v.Args[2] 30863 dst := v.Args[0] 30864 p1 := v.Args[1] 30865 mem := v.Args[2] 30866 if mem.Op != OpStore { 30867 break 30868 } 30869 t2 := mem.Aux 30870 _ = mem.Args[2] 30871 op2 := mem.Args[0] 30872 if op2.Op != OpOffPtr { 30873 break 30874 } 30875 tt2 := op2.Type 30876 o2 := op2.AuxInt 30877 p2 := op2.Args[0] 30878 d1 := mem.Args[1] 30879 mem_2 := mem.Args[2] 30880 if mem_2.Op != OpStore { 30881 break 30882 } 30883 t3 := mem_2.Aux 30884 _ = mem_2.Args[2] 30885 op3 := mem_2.Args[0] 30886 if op3.Op != OpOffPtr { 30887 break 30888 } 30889 tt3 := op3.Type 30890 if op3.AuxInt != 0 { 30891 break 30892 } 30893 p3 := op3.Args[0] 30894 d2 := mem_2.Args[1] 30895 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && o2 == sizeof(t3) && n == sizeof(t2)+sizeof(t3)) { 30896 break 30897 } 30898 v.reset(OpStore) 30899 v.Aux = t2 30900 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2) 30901 v0.AuxInt = o2 30902 v0.AddArg(dst) 30903 v.AddArg(v0) 30904 v.AddArg(d1) 30905 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 30906 v1.Aux = t3 30907 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3) 30908 v2.AuxInt = 0 30909 v2.AddArg(dst) 30910 v1.AddArg(v2) 30911 v1.AddArg(d2) 30912 v1.AddArg(mem) 30913 v.AddArg(v1) 30914 return true 30915 } 30916 // match: (Move {t1} [n] dst p1 mem:(Store {t2} op2:(OffPtr <tt2> [o2] p2) d1 (Store {t3} op3:(OffPtr <tt3> [o3] p3) d2 (Store {t4} op4:(OffPtr <tt4> [0] p4) d3 _)))) 30917 // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && alignof(t4) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && o3 == sizeof(t4) && o2-o3 == sizeof(t3) && n == sizeof(t2) + sizeof(t3) + sizeof(t4) 30918 // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [o3] dst) d2 (Store {t4} (OffPtr <tt4> [0] dst) d3 mem))) 30919 for { 30920 n := v.AuxInt 30921 t1 := v.Aux 30922 _ = v.Args[2] 30923 dst := v.Args[0] 30924 p1 := v.Args[1] 30925 mem := v.Args[2] 30926 if mem.Op != OpStore { 30927 break 30928 } 30929 t2 := mem.Aux 30930 _ = mem.Args[2] 30931 op2 := mem.Args[0] 30932 if op2.Op != OpOffPtr { 30933 break 30934 } 30935 tt2 := op2.Type 30936 o2 := op2.AuxInt 30937 p2 := op2.Args[0] 30938 d1 := mem.Args[1] 30939 mem_2 := mem.Args[2] 30940 if mem_2.Op != OpStore { 30941 break 30942 } 30943 t3 := mem_2.Aux 30944 _ = mem_2.Args[2] 30945 op3 := mem_2.Args[0] 30946 if op3.Op != OpOffPtr { 30947 break 30948 } 30949 tt3 := op3.Type 30950 o3 := op3.AuxInt 30951 p3 := op3.Args[0] 30952 d2 := mem_2.Args[1] 30953 mem_2_2 := mem_2.Args[2] 30954 if mem_2_2.Op != OpStore { 30955 break 30956 } 30957 t4 := mem_2_2.Aux 30958 _ = mem_2_2.Args[2] 30959 op4 := mem_2_2.Args[0] 30960 if op4.Op != OpOffPtr { 30961 break 30962 } 30963 tt4 := op4.Type 30964 if op4.AuxInt != 0 { 30965 break 30966 } 30967 p4 := op4.Args[0] 30968 d3 := mem_2_2.Args[1] 30969 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && alignof(t4) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && o3 == sizeof(t4) && o2-o3 == sizeof(t3) && n == sizeof(t2)+sizeof(t3)+sizeof(t4)) { 30970 break 30971 } 30972 v.reset(OpStore) 30973 v.Aux = t2 30974 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2) 30975 v0.AuxInt = o2 30976 v0.AddArg(dst) 30977 v.AddArg(v0) 30978 v.AddArg(d1) 30979 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 30980 v1.Aux = t3 30981 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3) 30982 v2.AuxInt = o3 30983 v2.AddArg(dst) 30984 v1.AddArg(v2) 30985 v1.AddArg(d2) 30986 v3 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 30987 v3.Aux = t4 30988 v4 := b.NewValue0(v.Pos, OpOffPtr, tt4) 30989 v4.AuxInt = 0 30990 v4.AddArg(dst) 30991 v3.AddArg(v4) 30992 v3.AddArg(d3) 30993 v3.AddArg(mem) 30994 v1.AddArg(v3) 30995 v.AddArg(v1) 30996 return true 30997 } 30998 // match: (Move {t1} [n] dst p1 mem:(Store {t2} op2:(OffPtr <tt2> [o2] p2) d1 (Store {t3} op3:(OffPtr <tt3> [o3] p3) d2 (Store {t4} op4:(OffPtr <tt4> [o4] p4) d3 (Store {t5} op5:(OffPtr <tt5> [0] p5) d4 _))))) 30999 // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && alignof(t4) <= alignof(t1) && alignof(t5) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && registerizable(b, t5) && o4 == sizeof(t5) && o3-o4 == sizeof(t4) && o2-o3 == sizeof(t3) && n == sizeof(t2) + sizeof(t3) + sizeof(t4) + sizeof(t5) 31000 // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [o3] dst) d2 (Store {t4} (OffPtr <tt4> [o4] dst) d3 (Store {t5} (OffPtr <tt5> [0] dst) d4 mem)))) 31001 for { 31002 n := v.AuxInt 31003 t1 := v.Aux 31004 _ = v.Args[2] 31005 dst := v.Args[0] 31006 p1 := v.Args[1] 31007 mem := v.Args[2] 31008 if mem.Op != OpStore { 31009 break 31010 } 31011 t2 := mem.Aux 31012 _ = mem.Args[2] 31013 op2 := mem.Args[0] 31014 if op2.Op != OpOffPtr { 31015 break 31016 } 31017 tt2 := op2.Type 31018 o2 := op2.AuxInt 31019 p2 := op2.Args[0] 31020 d1 := mem.Args[1] 31021 mem_2 := mem.Args[2] 31022 if mem_2.Op != OpStore { 31023 break 31024 } 31025 t3 := mem_2.Aux 31026 _ = mem_2.Args[2] 31027 op3 := mem_2.Args[0] 31028 if op3.Op != OpOffPtr { 31029 break 31030 } 31031 tt3 := op3.Type 31032 o3 := op3.AuxInt 31033 p3 := op3.Args[0] 31034 d2 := mem_2.Args[1] 31035 mem_2_2 := mem_2.Args[2] 31036 if mem_2_2.Op != OpStore { 31037 break 31038 } 31039 t4 := mem_2_2.Aux 31040 _ = mem_2_2.Args[2] 31041 op4 := mem_2_2.Args[0] 31042 if op4.Op != OpOffPtr { 31043 break 31044 } 31045 tt4 := op4.Type 31046 o4 := op4.AuxInt 31047 p4 := op4.Args[0] 31048 d3 := mem_2_2.Args[1] 31049 mem_2_2_2 := mem_2_2.Args[2] 31050 if mem_2_2_2.Op != OpStore { 31051 break 31052 } 31053 t5 := mem_2_2_2.Aux 31054 _ = mem_2_2_2.Args[2] 31055 op5 := mem_2_2_2.Args[0] 31056 if op5.Op != OpOffPtr { 31057 break 31058 } 31059 tt5 := op5.Type 31060 if op5.AuxInt != 0 { 31061 break 31062 } 31063 p5 := op5.Args[0] 31064 d4 := mem_2_2_2.Args[1] 31065 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && alignof(t4) <= alignof(t1) && alignof(t5) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && registerizable(b, t5) && o4 == sizeof(t5) && o3-o4 == sizeof(t4) && o2-o3 == sizeof(t3) && n == sizeof(t2)+sizeof(t3)+sizeof(t4)+sizeof(t5)) { 31066 break 31067 } 31068 v.reset(OpStore) 31069 v.Aux = t2 31070 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2) 31071 v0.AuxInt = o2 31072 v0.AddArg(dst) 31073 v.AddArg(v0) 31074 v.AddArg(d1) 31075 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 31076 v1.Aux = t3 31077 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3) 31078 v2.AuxInt = o3 31079 v2.AddArg(dst) 31080 v1.AddArg(v2) 31081 v1.AddArg(d2) 31082 v3 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 31083 v3.Aux = t4 31084 v4 := b.NewValue0(v.Pos, OpOffPtr, tt4) 31085 v4.AuxInt = o4 31086 v4.AddArg(dst) 31087 v3.AddArg(v4) 31088 v3.AddArg(d3) 31089 v5 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 31090 v5.Aux = t5 31091 v6 := b.NewValue0(v.Pos, OpOffPtr, tt5) 31092 v6.AuxInt = 0 31093 v6.AddArg(dst) 31094 v5.AddArg(v6) 31095 v5.AddArg(d4) 31096 v5.AddArg(mem) 31097 v3.AddArg(v5) 31098 v1.AddArg(v3) 31099 v.AddArg(v1) 31100 return true 31101 } 31102 return false 31103 } 31104 func rewriteValuegeneric_OpMove_10(v *Value) bool { 31105 b := v.Block 31106 // match: (Move {t1} [n] dst p1 mem:(VarDef (Store {t2} op2:(OffPtr <tt2> [o2] p2) d1 (Store {t3} op3:(OffPtr <tt3> [0] p3) d2 _)))) 31107 // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && o2 == sizeof(t3) && n == sizeof(t2) + sizeof(t3) 31108 // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [0] dst) d2 mem)) 31109 for { 31110 n := v.AuxInt 31111 t1 := v.Aux 31112 _ = v.Args[2] 31113 dst := v.Args[0] 31114 p1 := v.Args[1] 31115 mem := v.Args[2] 31116 if mem.Op != OpVarDef { 31117 break 31118 } 31119 mem_0 := mem.Args[0] 31120 if mem_0.Op != OpStore { 31121 break 31122 } 31123 t2 := mem_0.Aux 31124 _ = mem_0.Args[2] 31125 op2 := mem_0.Args[0] 31126 if op2.Op != OpOffPtr { 31127 break 31128 } 31129 tt2 := op2.Type 31130 o2 := op2.AuxInt 31131 p2 := op2.Args[0] 31132 d1 := mem_0.Args[1] 31133 mem_0_2 := mem_0.Args[2] 31134 if mem_0_2.Op != OpStore { 31135 break 31136 } 31137 t3 := mem_0_2.Aux 31138 _ = mem_0_2.Args[2] 31139 op3 := mem_0_2.Args[0] 31140 if op3.Op != OpOffPtr { 31141 break 31142 } 31143 tt3 := op3.Type 31144 if op3.AuxInt != 0 { 31145 break 31146 } 31147 p3 := op3.Args[0] 31148 d2 := mem_0_2.Args[1] 31149 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && o2 == sizeof(t3) && n == sizeof(t2)+sizeof(t3)) { 31150 break 31151 } 31152 v.reset(OpStore) 31153 v.Aux = t2 31154 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2) 31155 v0.AuxInt = o2 31156 v0.AddArg(dst) 31157 v.AddArg(v0) 31158 v.AddArg(d1) 31159 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 31160 v1.Aux = t3 31161 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3) 31162 v2.AuxInt = 0 31163 v2.AddArg(dst) 31164 v1.AddArg(v2) 31165 v1.AddArg(d2) 31166 v1.AddArg(mem) 31167 v.AddArg(v1) 31168 return true 31169 } 31170 // match: (Move {t1} [n] dst p1 mem:(VarDef (Store {t2} op2:(OffPtr <tt2> [o2] p2) d1 (Store {t3} op3:(OffPtr <tt3> [o3] p3) d2 (Store {t4} op4:(OffPtr <tt4> [0] p4) d3 _))))) 31171 // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && alignof(t4) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && o3 == sizeof(t4) && o2-o3 == sizeof(t3) && n == sizeof(t2) + sizeof(t3) + sizeof(t4) 31172 // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [o3] dst) d2 (Store {t4} (OffPtr <tt4> [0] dst) d3 mem))) 31173 for { 31174 n := v.AuxInt 31175 t1 := v.Aux 31176 _ = v.Args[2] 31177 dst := v.Args[0] 31178 p1 := v.Args[1] 31179 mem := v.Args[2] 31180 if mem.Op != OpVarDef { 31181 break 31182 } 31183 mem_0 := mem.Args[0] 31184 if mem_0.Op != OpStore { 31185 break 31186 } 31187 t2 := mem_0.Aux 31188 _ = mem_0.Args[2] 31189 op2 := mem_0.Args[0] 31190 if op2.Op != OpOffPtr { 31191 break 31192 } 31193 tt2 := op2.Type 31194 o2 := op2.AuxInt 31195 p2 := op2.Args[0] 31196 d1 := mem_0.Args[1] 31197 mem_0_2 := mem_0.Args[2] 31198 if mem_0_2.Op != OpStore { 31199 break 31200 } 31201 t3 := mem_0_2.Aux 31202 _ = mem_0_2.Args[2] 31203 op3 := mem_0_2.Args[0] 31204 if op3.Op != OpOffPtr { 31205 break 31206 } 31207 tt3 := op3.Type 31208 o3 := op3.AuxInt 31209 p3 := op3.Args[0] 31210 d2 := mem_0_2.Args[1] 31211 mem_0_2_2 := mem_0_2.Args[2] 31212 if mem_0_2_2.Op != OpStore { 31213 break 31214 } 31215 t4 := mem_0_2_2.Aux 31216 _ = mem_0_2_2.Args[2] 31217 op4 := mem_0_2_2.Args[0] 31218 if op4.Op != OpOffPtr { 31219 break 31220 } 31221 tt4 := op4.Type 31222 if op4.AuxInt != 0 { 31223 break 31224 } 31225 p4 := op4.Args[0] 31226 d3 := mem_0_2_2.Args[1] 31227 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && alignof(t4) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && o3 == sizeof(t4) && o2-o3 == sizeof(t3) && n == sizeof(t2)+sizeof(t3)+sizeof(t4)) { 31228 break 31229 } 31230 v.reset(OpStore) 31231 v.Aux = t2 31232 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2) 31233 v0.AuxInt = o2 31234 v0.AddArg(dst) 31235 v.AddArg(v0) 31236 v.AddArg(d1) 31237 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 31238 v1.Aux = t3 31239 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3) 31240 v2.AuxInt = o3 31241 v2.AddArg(dst) 31242 v1.AddArg(v2) 31243 v1.AddArg(d2) 31244 v3 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 31245 v3.Aux = t4 31246 v4 := b.NewValue0(v.Pos, OpOffPtr, tt4) 31247 v4.AuxInt = 0 31248 v4.AddArg(dst) 31249 v3.AddArg(v4) 31250 v3.AddArg(d3) 31251 v3.AddArg(mem) 31252 v1.AddArg(v3) 31253 v.AddArg(v1) 31254 return true 31255 } 31256 // match: (Move {t1} [n] dst p1 mem:(VarDef (Store {t2} op2:(OffPtr <tt2> [o2] p2) d1 (Store {t3} op3:(OffPtr <tt3> [o3] p3) d2 (Store {t4} op4:(OffPtr <tt4> [o4] p4) d3 (Store {t5} op5:(OffPtr <tt5> [0] p5) d4 _)))))) 31257 // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && alignof(t4) <= alignof(t1) && alignof(t5) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && registerizable(b, t5) && o4 == sizeof(t5) && o3-o4 == sizeof(t4) && o2-o3 == sizeof(t3) && n == sizeof(t2) + sizeof(t3) + sizeof(t4) + sizeof(t5) 31258 // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [o3] dst) d2 (Store {t4} (OffPtr <tt4> [o4] dst) d3 (Store {t5} (OffPtr <tt5> [0] dst) d4 mem)))) 31259 for { 31260 n := v.AuxInt 31261 t1 := v.Aux 31262 _ = v.Args[2] 31263 dst := v.Args[0] 31264 p1 := v.Args[1] 31265 mem := v.Args[2] 31266 if mem.Op != OpVarDef { 31267 break 31268 } 31269 mem_0 := mem.Args[0] 31270 if mem_0.Op != OpStore { 31271 break 31272 } 31273 t2 := mem_0.Aux 31274 _ = mem_0.Args[2] 31275 op2 := mem_0.Args[0] 31276 if op2.Op != OpOffPtr { 31277 break 31278 } 31279 tt2 := op2.Type 31280 o2 := op2.AuxInt 31281 p2 := op2.Args[0] 31282 d1 := mem_0.Args[1] 31283 mem_0_2 := mem_0.Args[2] 31284 if mem_0_2.Op != OpStore { 31285 break 31286 } 31287 t3 := mem_0_2.Aux 31288 _ = mem_0_2.Args[2] 31289 op3 := mem_0_2.Args[0] 31290 if op3.Op != OpOffPtr { 31291 break 31292 } 31293 tt3 := op3.Type 31294 o3 := op3.AuxInt 31295 p3 := op3.Args[0] 31296 d2 := mem_0_2.Args[1] 31297 mem_0_2_2 := mem_0_2.Args[2] 31298 if mem_0_2_2.Op != OpStore { 31299 break 31300 } 31301 t4 := mem_0_2_2.Aux 31302 _ = mem_0_2_2.Args[2] 31303 op4 := mem_0_2_2.Args[0] 31304 if op4.Op != OpOffPtr { 31305 break 31306 } 31307 tt4 := op4.Type 31308 o4 := op4.AuxInt 31309 p4 := op4.Args[0] 31310 d3 := mem_0_2_2.Args[1] 31311 mem_0_2_2_2 := mem_0_2_2.Args[2] 31312 if mem_0_2_2_2.Op != OpStore { 31313 break 31314 } 31315 t5 := mem_0_2_2_2.Aux 31316 _ = mem_0_2_2_2.Args[2] 31317 op5 := mem_0_2_2_2.Args[0] 31318 if op5.Op != OpOffPtr { 31319 break 31320 } 31321 tt5 := op5.Type 31322 if op5.AuxInt != 0 { 31323 break 31324 } 31325 p5 := op5.Args[0] 31326 d4 := mem_0_2_2_2.Args[1] 31327 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && alignof(t4) <= alignof(t1) && alignof(t5) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && registerizable(b, t5) && o4 == sizeof(t5) && o3-o4 == sizeof(t4) && o2-o3 == sizeof(t3) && n == sizeof(t2)+sizeof(t3)+sizeof(t4)+sizeof(t5)) { 31328 break 31329 } 31330 v.reset(OpStore) 31331 v.Aux = t2 31332 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2) 31333 v0.AuxInt = o2 31334 v0.AddArg(dst) 31335 v.AddArg(v0) 31336 v.AddArg(d1) 31337 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 31338 v1.Aux = t3 31339 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3) 31340 v2.AuxInt = o3 31341 v2.AddArg(dst) 31342 v1.AddArg(v2) 31343 v1.AddArg(d2) 31344 v3 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 31345 v3.Aux = t4 31346 v4 := b.NewValue0(v.Pos, OpOffPtr, tt4) 31347 v4.AuxInt = o4 31348 v4.AddArg(dst) 31349 v3.AddArg(v4) 31350 v3.AddArg(d3) 31351 v5 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 31352 v5.Aux = t5 31353 v6 := b.NewValue0(v.Pos, OpOffPtr, tt5) 31354 v6.AuxInt = 0 31355 v6.AddArg(dst) 31356 v5.AddArg(v6) 31357 v5.AddArg(d4) 31358 v5.AddArg(mem) 31359 v3.AddArg(v5) 31360 v1.AddArg(v3) 31361 v.AddArg(v1) 31362 return true 31363 } 31364 // match: (Move {t1} [n] dst p1 mem:(Store {t2} op2:(OffPtr <tt2> [o2] p2) d1 (Zero {t3} [n] p3 _))) 31365 // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && registerizable(b, t2) && n >= o2 + sizeof(t2) 31366 // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Zero {t1} [n] dst mem)) 31367 for { 31368 n := v.AuxInt 31369 t1 := v.Aux 31370 _ = v.Args[2] 31371 dst := v.Args[0] 31372 p1 := v.Args[1] 31373 mem := v.Args[2] 31374 if mem.Op != OpStore { 31375 break 31376 } 31377 t2 := mem.Aux 31378 _ = mem.Args[2] 31379 op2 := mem.Args[0] 31380 if op2.Op != OpOffPtr { 31381 break 31382 } 31383 tt2 := op2.Type 31384 o2 := op2.AuxInt 31385 p2 := op2.Args[0] 31386 d1 := mem.Args[1] 31387 mem_2 := mem.Args[2] 31388 if mem_2.Op != OpZero || mem_2.AuxInt != n { 31389 break 31390 } 31391 t3 := mem_2.Aux 31392 _ = mem_2.Args[1] 31393 p3 := mem_2.Args[0] 31394 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && registerizable(b, t2) && n >= o2+sizeof(t2)) { 31395 break 31396 } 31397 v.reset(OpStore) 31398 v.Aux = t2 31399 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2) 31400 v0.AuxInt = o2 31401 v0.AddArg(dst) 31402 v.AddArg(v0) 31403 v.AddArg(d1) 31404 v1 := b.NewValue0(v.Pos, OpZero, types.TypeMem) 31405 v1.AuxInt = n 31406 v1.Aux = t1 31407 v1.AddArg(dst) 31408 v1.AddArg(mem) 31409 v.AddArg(v1) 31410 return true 31411 } 31412 // match: (Move {t1} [n] dst p1 mem:(Store {t2} (OffPtr <tt2> [o2] p2) d1 (Store {t3} (OffPtr <tt3> [o3] p3) d2 (Zero {t4} [n] p4 _)))) 31413 // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && alignof(t4) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && n >= o2 + sizeof(t2) && n >= o3 + sizeof(t3) 31414 // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [o3] dst) d2 (Zero {t1} [n] dst mem))) 31415 for { 31416 n := v.AuxInt 31417 t1 := v.Aux 31418 _ = v.Args[2] 31419 dst := v.Args[0] 31420 p1 := v.Args[1] 31421 mem := v.Args[2] 31422 if mem.Op != OpStore { 31423 break 31424 } 31425 t2 := mem.Aux 31426 _ = mem.Args[2] 31427 mem_0 := mem.Args[0] 31428 if mem_0.Op != OpOffPtr { 31429 break 31430 } 31431 tt2 := mem_0.Type 31432 o2 := mem_0.AuxInt 31433 p2 := mem_0.Args[0] 31434 d1 := mem.Args[1] 31435 mem_2 := mem.Args[2] 31436 if mem_2.Op != OpStore { 31437 break 31438 } 31439 t3 := mem_2.Aux 31440 _ = mem_2.Args[2] 31441 mem_2_0 := mem_2.Args[0] 31442 if mem_2_0.Op != OpOffPtr { 31443 break 31444 } 31445 tt3 := mem_2_0.Type 31446 o3 := mem_2_0.AuxInt 31447 p3 := mem_2_0.Args[0] 31448 d2 := mem_2.Args[1] 31449 mem_2_2 := mem_2.Args[2] 31450 if mem_2_2.Op != OpZero || mem_2_2.AuxInt != n { 31451 break 31452 } 31453 t4 := mem_2_2.Aux 31454 _ = mem_2_2.Args[1] 31455 p4 := mem_2_2.Args[0] 31456 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && alignof(t4) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && n >= o2+sizeof(t2) && n >= o3+sizeof(t3)) { 31457 break 31458 } 31459 v.reset(OpStore) 31460 v.Aux = t2 31461 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2) 31462 v0.AuxInt = o2 31463 v0.AddArg(dst) 31464 v.AddArg(v0) 31465 v.AddArg(d1) 31466 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 31467 v1.Aux = t3 31468 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3) 31469 v2.AuxInt = o3 31470 v2.AddArg(dst) 31471 v1.AddArg(v2) 31472 v1.AddArg(d2) 31473 v3 := b.NewValue0(v.Pos, OpZero, types.TypeMem) 31474 v3.AuxInt = n 31475 v3.Aux = t1 31476 v3.AddArg(dst) 31477 v3.AddArg(mem) 31478 v1.AddArg(v3) 31479 v.AddArg(v1) 31480 return true 31481 } 31482 // match: (Move {t1} [n] dst p1 mem:(Store {t2} (OffPtr <tt2> [o2] p2) d1 (Store {t3} (OffPtr <tt3> [o3] p3) d2 (Store {t4} (OffPtr <tt4> [o4] p4) d3 (Zero {t5} [n] p5 _))))) 31483 // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && alignof(t4) <= alignof(t1) && alignof(t5) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && n >= o2 + sizeof(t2) && n >= o3 + sizeof(t3) && n >= o4 + sizeof(t4) 31484 // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [o3] dst) d2 (Store {t4} (OffPtr <tt4> [o4] dst) d3 (Zero {t1} [n] dst mem)))) 31485 for { 31486 n := v.AuxInt 31487 t1 := v.Aux 31488 _ = v.Args[2] 31489 dst := v.Args[0] 31490 p1 := v.Args[1] 31491 mem := v.Args[2] 31492 if mem.Op != OpStore { 31493 break 31494 } 31495 t2 := mem.Aux 31496 _ = mem.Args[2] 31497 mem_0 := mem.Args[0] 31498 if mem_0.Op != OpOffPtr { 31499 break 31500 } 31501 tt2 := mem_0.Type 31502 o2 := mem_0.AuxInt 31503 p2 := mem_0.Args[0] 31504 d1 := mem.Args[1] 31505 mem_2 := mem.Args[2] 31506 if mem_2.Op != OpStore { 31507 break 31508 } 31509 t3 := mem_2.Aux 31510 _ = mem_2.Args[2] 31511 mem_2_0 := mem_2.Args[0] 31512 if mem_2_0.Op != OpOffPtr { 31513 break 31514 } 31515 tt3 := mem_2_0.Type 31516 o3 := mem_2_0.AuxInt 31517 p3 := mem_2_0.Args[0] 31518 d2 := mem_2.Args[1] 31519 mem_2_2 := mem_2.Args[2] 31520 if mem_2_2.Op != OpStore { 31521 break 31522 } 31523 t4 := mem_2_2.Aux 31524 _ = mem_2_2.Args[2] 31525 mem_2_2_0 := mem_2_2.Args[0] 31526 if mem_2_2_0.Op != OpOffPtr { 31527 break 31528 } 31529 tt4 := mem_2_2_0.Type 31530 o4 := mem_2_2_0.AuxInt 31531 p4 := mem_2_2_0.Args[0] 31532 d3 := mem_2_2.Args[1] 31533 mem_2_2_2 := mem_2_2.Args[2] 31534 if mem_2_2_2.Op != OpZero || mem_2_2_2.AuxInt != n { 31535 break 31536 } 31537 t5 := mem_2_2_2.Aux 31538 _ = mem_2_2_2.Args[1] 31539 p5 := mem_2_2_2.Args[0] 31540 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && alignof(t4) <= alignof(t1) && alignof(t5) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && n >= o2+sizeof(t2) && n >= o3+sizeof(t3) && n >= o4+sizeof(t4)) { 31541 break 31542 } 31543 v.reset(OpStore) 31544 v.Aux = t2 31545 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2) 31546 v0.AuxInt = o2 31547 v0.AddArg(dst) 31548 v.AddArg(v0) 31549 v.AddArg(d1) 31550 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 31551 v1.Aux = t3 31552 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3) 31553 v2.AuxInt = o3 31554 v2.AddArg(dst) 31555 v1.AddArg(v2) 31556 v1.AddArg(d2) 31557 v3 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 31558 v3.Aux = t4 31559 v4 := b.NewValue0(v.Pos, OpOffPtr, tt4) 31560 v4.AuxInt = o4 31561 v4.AddArg(dst) 31562 v3.AddArg(v4) 31563 v3.AddArg(d3) 31564 v5 := b.NewValue0(v.Pos, OpZero, types.TypeMem) 31565 v5.AuxInt = n 31566 v5.Aux = t1 31567 v5.AddArg(dst) 31568 v5.AddArg(mem) 31569 v3.AddArg(v5) 31570 v1.AddArg(v3) 31571 v.AddArg(v1) 31572 return true 31573 } 31574 // match: (Move {t1} [n] dst p1 mem:(Store {t2} (OffPtr <tt2> [o2] p2) d1 (Store {t3} (OffPtr <tt3> [o3] p3) d2 (Store {t4} (OffPtr <tt4> [o4] p4) d3 (Store {t5} (OffPtr <tt5> [o5] p5) d4 (Zero {t6} [n] p6 _)))))) 31575 // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && isSamePtr(p5, p6) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && alignof(t4) <= alignof(t1) && alignof(t5) <= alignof(t1) && alignof(t6) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && registerizable(b, t5) && n >= o2 + sizeof(t2) && n >= o3 + sizeof(t3) && n >= o4 + sizeof(t4) && n >= o5 + sizeof(t5) 31576 // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [o3] dst) d2 (Store {t4} (OffPtr <tt4> [o4] dst) d3 (Store {t5} (OffPtr <tt5> [o5] dst) d4 (Zero {t1} [n] dst mem))))) 31577 for { 31578 n := v.AuxInt 31579 t1 := v.Aux 31580 _ = v.Args[2] 31581 dst := v.Args[0] 31582 p1 := v.Args[1] 31583 mem := v.Args[2] 31584 if mem.Op != OpStore { 31585 break 31586 } 31587 t2 := mem.Aux 31588 _ = mem.Args[2] 31589 mem_0 := mem.Args[0] 31590 if mem_0.Op != OpOffPtr { 31591 break 31592 } 31593 tt2 := mem_0.Type 31594 o2 := mem_0.AuxInt 31595 p2 := mem_0.Args[0] 31596 d1 := mem.Args[1] 31597 mem_2 := mem.Args[2] 31598 if mem_2.Op != OpStore { 31599 break 31600 } 31601 t3 := mem_2.Aux 31602 _ = mem_2.Args[2] 31603 mem_2_0 := mem_2.Args[0] 31604 if mem_2_0.Op != OpOffPtr { 31605 break 31606 } 31607 tt3 := mem_2_0.Type 31608 o3 := mem_2_0.AuxInt 31609 p3 := mem_2_0.Args[0] 31610 d2 := mem_2.Args[1] 31611 mem_2_2 := mem_2.Args[2] 31612 if mem_2_2.Op != OpStore { 31613 break 31614 } 31615 t4 := mem_2_2.Aux 31616 _ = mem_2_2.Args[2] 31617 mem_2_2_0 := mem_2_2.Args[0] 31618 if mem_2_2_0.Op != OpOffPtr { 31619 break 31620 } 31621 tt4 := mem_2_2_0.Type 31622 o4 := mem_2_2_0.AuxInt 31623 p4 := mem_2_2_0.Args[0] 31624 d3 := mem_2_2.Args[1] 31625 mem_2_2_2 := mem_2_2.Args[2] 31626 if mem_2_2_2.Op != OpStore { 31627 break 31628 } 31629 t5 := mem_2_2_2.Aux 31630 _ = mem_2_2_2.Args[2] 31631 mem_2_2_2_0 := mem_2_2_2.Args[0] 31632 if mem_2_2_2_0.Op != OpOffPtr { 31633 break 31634 } 31635 tt5 := mem_2_2_2_0.Type 31636 o5 := mem_2_2_2_0.AuxInt 31637 p5 := mem_2_2_2_0.Args[0] 31638 d4 := mem_2_2_2.Args[1] 31639 mem_2_2_2_2 := mem_2_2_2.Args[2] 31640 if mem_2_2_2_2.Op != OpZero || mem_2_2_2_2.AuxInt != n { 31641 break 31642 } 31643 t6 := mem_2_2_2_2.Aux 31644 _ = mem_2_2_2_2.Args[1] 31645 p6 := mem_2_2_2_2.Args[0] 31646 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && isSamePtr(p5, p6) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && alignof(t4) <= alignof(t1) && alignof(t5) <= alignof(t1) && alignof(t6) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && registerizable(b, t5) && n >= o2+sizeof(t2) && n >= o3+sizeof(t3) && n >= o4+sizeof(t4) && n >= o5+sizeof(t5)) { 31647 break 31648 } 31649 v.reset(OpStore) 31650 v.Aux = t2 31651 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2) 31652 v0.AuxInt = o2 31653 v0.AddArg(dst) 31654 v.AddArg(v0) 31655 v.AddArg(d1) 31656 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 31657 v1.Aux = t3 31658 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3) 31659 v2.AuxInt = o3 31660 v2.AddArg(dst) 31661 v1.AddArg(v2) 31662 v1.AddArg(d2) 31663 v3 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 31664 v3.Aux = t4 31665 v4 := b.NewValue0(v.Pos, OpOffPtr, tt4) 31666 v4.AuxInt = o4 31667 v4.AddArg(dst) 31668 v3.AddArg(v4) 31669 v3.AddArg(d3) 31670 v5 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 31671 v5.Aux = t5 31672 v6 := b.NewValue0(v.Pos, OpOffPtr, tt5) 31673 v6.AuxInt = o5 31674 v6.AddArg(dst) 31675 v5.AddArg(v6) 31676 v5.AddArg(d4) 31677 v7 := b.NewValue0(v.Pos, OpZero, types.TypeMem) 31678 v7.AuxInt = n 31679 v7.Aux = t1 31680 v7.AddArg(dst) 31681 v7.AddArg(mem) 31682 v5.AddArg(v7) 31683 v3.AddArg(v5) 31684 v1.AddArg(v3) 31685 v.AddArg(v1) 31686 return true 31687 } 31688 // match: (Move {t1} [n] dst p1 mem:(VarDef (Store {t2} op2:(OffPtr <tt2> [o2] p2) d1 (Zero {t3} [n] p3 _)))) 31689 // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && registerizable(b, t2) && n >= o2 + sizeof(t2) 31690 // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Zero {t1} [n] dst mem)) 31691 for { 31692 n := v.AuxInt 31693 t1 := v.Aux 31694 _ = v.Args[2] 31695 dst := v.Args[0] 31696 p1 := v.Args[1] 31697 mem := v.Args[2] 31698 if mem.Op != OpVarDef { 31699 break 31700 } 31701 mem_0 := mem.Args[0] 31702 if mem_0.Op != OpStore { 31703 break 31704 } 31705 t2 := mem_0.Aux 31706 _ = mem_0.Args[2] 31707 op2 := mem_0.Args[0] 31708 if op2.Op != OpOffPtr { 31709 break 31710 } 31711 tt2 := op2.Type 31712 o2 := op2.AuxInt 31713 p2 := op2.Args[0] 31714 d1 := mem_0.Args[1] 31715 mem_0_2 := mem_0.Args[2] 31716 if mem_0_2.Op != OpZero || mem_0_2.AuxInt != n { 31717 break 31718 } 31719 t3 := mem_0_2.Aux 31720 _ = mem_0_2.Args[1] 31721 p3 := mem_0_2.Args[0] 31722 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && registerizable(b, t2) && n >= o2+sizeof(t2)) { 31723 break 31724 } 31725 v.reset(OpStore) 31726 v.Aux = t2 31727 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2) 31728 v0.AuxInt = o2 31729 v0.AddArg(dst) 31730 v.AddArg(v0) 31731 v.AddArg(d1) 31732 v1 := b.NewValue0(v.Pos, OpZero, types.TypeMem) 31733 v1.AuxInt = n 31734 v1.Aux = t1 31735 v1.AddArg(dst) 31736 v1.AddArg(mem) 31737 v.AddArg(v1) 31738 return true 31739 } 31740 // match: (Move {t1} [n] dst p1 mem:(VarDef (Store {t2} (OffPtr <tt2> [o2] p2) d1 (Store {t3} (OffPtr <tt3> [o3] p3) d2 (Zero {t4} [n] p4 _))))) 31741 // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && alignof(t4) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && n >= o2 + sizeof(t2) && n >= o3 + sizeof(t3) 31742 // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [o3] dst) d2 (Zero {t1} [n] dst mem))) 31743 for { 31744 n := v.AuxInt 31745 t1 := v.Aux 31746 _ = v.Args[2] 31747 dst := v.Args[0] 31748 p1 := v.Args[1] 31749 mem := v.Args[2] 31750 if mem.Op != OpVarDef { 31751 break 31752 } 31753 mem_0 := mem.Args[0] 31754 if mem_0.Op != OpStore { 31755 break 31756 } 31757 t2 := mem_0.Aux 31758 _ = mem_0.Args[2] 31759 mem_0_0 := mem_0.Args[0] 31760 if mem_0_0.Op != OpOffPtr { 31761 break 31762 } 31763 tt2 := mem_0_0.Type 31764 o2 := mem_0_0.AuxInt 31765 p2 := mem_0_0.Args[0] 31766 d1 := mem_0.Args[1] 31767 mem_0_2 := mem_0.Args[2] 31768 if mem_0_2.Op != OpStore { 31769 break 31770 } 31771 t3 := mem_0_2.Aux 31772 _ = mem_0_2.Args[2] 31773 mem_0_2_0 := mem_0_2.Args[0] 31774 if mem_0_2_0.Op != OpOffPtr { 31775 break 31776 } 31777 tt3 := mem_0_2_0.Type 31778 o3 := mem_0_2_0.AuxInt 31779 p3 := mem_0_2_0.Args[0] 31780 d2 := mem_0_2.Args[1] 31781 mem_0_2_2 := mem_0_2.Args[2] 31782 if mem_0_2_2.Op != OpZero || mem_0_2_2.AuxInt != n { 31783 break 31784 } 31785 t4 := mem_0_2_2.Aux 31786 _ = mem_0_2_2.Args[1] 31787 p4 := mem_0_2_2.Args[0] 31788 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && alignof(t4) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && n >= o2+sizeof(t2) && n >= o3+sizeof(t3)) { 31789 break 31790 } 31791 v.reset(OpStore) 31792 v.Aux = t2 31793 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2) 31794 v0.AuxInt = o2 31795 v0.AddArg(dst) 31796 v.AddArg(v0) 31797 v.AddArg(d1) 31798 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 31799 v1.Aux = t3 31800 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3) 31801 v2.AuxInt = o3 31802 v2.AddArg(dst) 31803 v1.AddArg(v2) 31804 v1.AddArg(d2) 31805 v3 := b.NewValue0(v.Pos, OpZero, types.TypeMem) 31806 v3.AuxInt = n 31807 v3.Aux = t1 31808 v3.AddArg(dst) 31809 v3.AddArg(mem) 31810 v1.AddArg(v3) 31811 v.AddArg(v1) 31812 return true 31813 } 31814 // match: (Move {t1} [n] dst p1 mem:(VarDef (Store {t2} (OffPtr <tt2> [o2] p2) d1 (Store {t3} (OffPtr <tt3> [o3] p3) d2 (Store {t4} (OffPtr <tt4> [o4] p4) d3 (Zero {t5} [n] p5 _)))))) 31815 // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && alignof(t4) <= alignof(t1) && alignof(t5) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && n >= o2 + sizeof(t2) && n >= o3 + sizeof(t3) && n >= o4 + sizeof(t4) 31816 // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [o3] dst) d2 (Store {t4} (OffPtr <tt4> [o4] dst) d3 (Zero {t1} [n] dst mem)))) 31817 for { 31818 n := v.AuxInt 31819 t1 := v.Aux 31820 _ = v.Args[2] 31821 dst := v.Args[0] 31822 p1 := v.Args[1] 31823 mem := v.Args[2] 31824 if mem.Op != OpVarDef { 31825 break 31826 } 31827 mem_0 := mem.Args[0] 31828 if mem_0.Op != OpStore { 31829 break 31830 } 31831 t2 := mem_0.Aux 31832 _ = mem_0.Args[2] 31833 mem_0_0 := mem_0.Args[0] 31834 if mem_0_0.Op != OpOffPtr { 31835 break 31836 } 31837 tt2 := mem_0_0.Type 31838 o2 := mem_0_0.AuxInt 31839 p2 := mem_0_0.Args[0] 31840 d1 := mem_0.Args[1] 31841 mem_0_2 := mem_0.Args[2] 31842 if mem_0_2.Op != OpStore { 31843 break 31844 } 31845 t3 := mem_0_2.Aux 31846 _ = mem_0_2.Args[2] 31847 mem_0_2_0 := mem_0_2.Args[0] 31848 if mem_0_2_0.Op != OpOffPtr { 31849 break 31850 } 31851 tt3 := mem_0_2_0.Type 31852 o3 := mem_0_2_0.AuxInt 31853 p3 := mem_0_2_0.Args[0] 31854 d2 := mem_0_2.Args[1] 31855 mem_0_2_2 := mem_0_2.Args[2] 31856 if mem_0_2_2.Op != OpStore { 31857 break 31858 } 31859 t4 := mem_0_2_2.Aux 31860 _ = mem_0_2_2.Args[2] 31861 mem_0_2_2_0 := mem_0_2_2.Args[0] 31862 if mem_0_2_2_0.Op != OpOffPtr { 31863 break 31864 } 31865 tt4 := mem_0_2_2_0.Type 31866 o4 := mem_0_2_2_0.AuxInt 31867 p4 := mem_0_2_2_0.Args[0] 31868 d3 := mem_0_2_2.Args[1] 31869 mem_0_2_2_2 := mem_0_2_2.Args[2] 31870 if mem_0_2_2_2.Op != OpZero || mem_0_2_2_2.AuxInt != n { 31871 break 31872 } 31873 t5 := mem_0_2_2_2.Aux 31874 _ = mem_0_2_2_2.Args[1] 31875 p5 := mem_0_2_2_2.Args[0] 31876 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && alignof(t4) <= alignof(t1) && alignof(t5) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && n >= o2+sizeof(t2) && n >= o3+sizeof(t3) && n >= o4+sizeof(t4)) { 31877 break 31878 } 31879 v.reset(OpStore) 31880 v.Aux = t2 31881 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2) 31882 v0.AuxInt = o2 31883 v0.AddArg(dst) 31884 v.AddArg(v0) 31885 v.AddArg(d1) 31886 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 31887 v1.Aux = t3 31888 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3) 31889 v2.AuxInt = o3 31890 v2.AddArg(dst) 31891 v1.AddArg(v2) 31892 v1.AddArg(d2) 31893 v3 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 31894 v3.Aux = t4 31895 v4 := b.NewValue0(v.Pos, OpOffPtr, tt4) 31896 v4.AuxInt = o4 31897 v4.AddArg(dst) 31898 v3.AddArg(v4) 31899 v3.AddArg(d3) 31900 v5 := b.NewValue0(v.Pos, OpZero, types.TypeMem) 31901 v5.AuxInt = n 31902 v5.Aux = t1 31903 v5.AddArg(dst) 31904 v5.AddArg(mem) 31905 v3.AddArg(v5) 31906 v1.AddArg(v3) 31907 v.AddArg(v1) 31908 return true 31909 } 31910 return false 31911 } 31912 func rewriteValuegeneric_OpMove_20(v *Value) bool { 31913 b := v.Block 31914 config := b.Func.Config 31915 // match: (Move {t1} [n] dst p1 mem:(VarDef (Store {t2} (OffPtr <tt2> [o2] p2) d1 (Store {t3} (OffPtr <tt3> [o3] p3) d2 (Store {t4} (OffPtr <tt4> [o4] p4) d3 (Store {t5} (OffPtr <tt5> [o5] p5) d4 (Zero {t6} [n] p6 _))))))) 31916 // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && isSamePtr(p5, p6) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && alignof(t4) <= alignof(t1) && alignof(t5) <= alignof(t1) && alignof(t6) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && registerizable(b, t5) && n >= o2 + sizeof(t2) && n >= o3 + sizeof(t3) && n >= o4 + sizeof(t4) && n >= o5 + sizeof(t5) 31917 // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [o3] dst) d2 (Store {t4} (OffPtr <tt4> [o4] dst) d3 (Store {t5} (OffPtr <tt5> [o5] dst) d4 (Zero {t1} [n] dst mem))))) 31918 for { 31919 n := v.AuxInt 31920 t1 := v.Aux 31921 _ = v.Args[2] 31922 dst := v.Args[0] 31923 p1 := v.Args[1] 31924 mem := v.Args[2] 31925 if mem.Op != OpVarDef { 31926 break 31927 } 31928 mem_0 := mem.Args[0] 31929 if mem_0.Op != OpStore { 31930 break 31931 } 31932 t2 := mem_0.Aux 31933 _ = mem_0.Args[2] 31934 mem_0_0 := mem_0.Args[0] 31935 if mem_0_0.Op != OpOffPtr { 31936 break 31937 } 31938 tt2 := mem_0_0.Type 31939 o2 := mem_0_0.AuxInt 31940 p2 := mem_0_0.Args[0] 31941 d1 := mem_0.Args[1] 31942 mem_0_2 := mem_0.Args[2] 31943 if mem_0_2.Op != OpStore { 31944 break 31945 } 31946 t3 := mem_0_2.Aux 31947 _ = mem_0_2.Args[2] 31948 mem_0_2_0 := mem_0_2.Args[0] 31949 if mem_0_2_0.Op != OpOffPtr { 31950 break 31951 } 31952 tt3 := mem_0_2_0.Type 31953 o3 := mem_0_2_0.AuxInt 31954 p3 := mem_0_2_0.Args[0] 31955 d2 := mem_0_2.Args[1] 31956 mem_0_2_2 := mem_0_2.Args[2] 31957 if mem_0_2_2.Op != OpStore { 31958 break 31959 } 31960 t4 := mem_0_2_2.Aux 31961 _ = mem_0_2_2.Args[2] 31962 mem_0_2_2_0 := mem_0_2_2.Args[0] 31963 if mem_0_2_2_0.Op != OpOffPtr { 31964 break 31965 } 31966 tt4 := mem_0_2_2_0.Type 31967 o4 := mem_0_2_2_0.AuxInt 31968 p4 := mem_0_2_2_0.Args[0] 31969 d3 := mem_0_2_2.Args[1] 31970 mem_0_2_2_2 := mem_0_2_2.Args[2] 31971 if mem_0_2_2_2.Op != OpStore { 31972 break 31973 } 31974 t5 := mem_0_2_2_2.Aux 31975 _ = mem_0_2_2_2.Args[2] 31976 mem_0_2_2_2_0 := mem_0_2_2_2.Args[0] 31977 if mem_0_2_2_2_0.Op != OpOffPtr { 31978 break 31979 } 31980 tt5 := mem_0_2_2_2_0.Type 31981 o5 := mem_0_2_2_2_0.AuxInt 31982 p5 := mem_0_2_2_2_0.Args[0] 31983 d4 := mem_0_2_2_2.Args[1] 31984 mem_0_2_2_2_2 := mem_0_2_2_2.Args[2] 31985 if mem_0_2_2_2_2.Op != OpZero || mem_0_2_2_2_2.AuxInt != n { 31986 break 31987 } 31988 t6 := mem_0_2_2_2_2.Aux 31989 _ = mem_0_2_2_2_2.Args[1] 31990 p6 := mem_0_2_2_2_2.Args[0] 31991 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && isSamePtr(p5, p6) && alignof(t2) <= alignof(t1) && alignof(t3) <= alignof(t1) && alignof(t4) <= alignof(t1) && alignof(t5) <= alignof(t1) && alignof(t6) <= alignof(t1) && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && registerizable(b, t5) && n >= o2+sizeof(t2) && n >= o3+sizeof(t3) && n >= o4+sizeof(t4) && n >= o5+sizeof(t5)) { 31992 break 31993 } 31994 v.reset(OpStore) 31995 v.Aux = t2 31996 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2) 31997 v0.AuxInt = o2 31998 v0.AddArg(dst) 31999 v.AddArg(v0) 32000 v.AddArg(d1) 32001 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 32002 v1.Aux = t3 32003 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3) 32004 v2.AuxInt = o3 32005 v2.AddArg(dst) 32006 v1.AddArg(v2) 32007 v1.AddArg(d2) 32008 v3 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 32009 v3.Aux = t4 32010 v4 := b.NewValue0(v.Pos, OpOffPtr, tt4) 32011 v4.AuxInt = o4 32012 v4.AddArg(dst) 32013 v3.AddArg(v4) 32014 v3.AddArg(d3) 32015 v5 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 32016 v5.Aux = t5 32017 v6 := b.NewValue0(v.Pos, OpOffPtr, tt5) 32018 v6.AuxInt = o5 32019 v6.AddArg(dst) 32020 v5.AddArg(v6) 32021 v5.AddArg(d4) 32022 v7 := b.NewValue0(v.Pos, OpZero, types.TypeMem) 32023 v7.AuxInt = n 32024 v7.Aux = t1 32025 v7.AddArg(dst) 32026 v7.AddArg(mem) 32027 v5.AddArg(v7) 32028 v3.AddArg(v5) 32029 v1.AddArg(v3) 32030 v.AddArg(v1) 32031 return true 32032 } 32033 // match: (Move {t1} [s] dst tmp1 midmem:(Move {t2} [s] tmp2 src _)) 32034 // cond: t1.(*types.Type).Compare(t2.(*types.Type)) == types.CMPeq && isSamePtr(tmp1, tmp2) && isStackPtr(src) && disjoint(src, s, tmp2, s) && (disjoint(src, s, dst, s) || isInlinableMemmove(dst, src, s, config)) 32035 // result: (Move {t1} [s] dst src midmem) 32036 for { 32037 s := v.AuxInt 32038 t1 := v.Aux 32039 _ = v.Args[2] 32040 dst := v.Args[0] 32041 tmp1 := v.Args[1] 32042 midmem := v.Args[2] 32043 if midmem.Op != OpMove || midmem.AuxInt != s { 32044 break 32045 } 32046 t2 := midmem.Aux 32047 _ = midmem.Args[2] 32048 tmp2 := midmem.Args[0] 32049 src := midmem.Args[1] 32050 if !(t1.(*types.Type).Compare(t2.(*types.Type)) == types.CMPeq && isSamePtr(tmp1, tmp2) && isStackPtr(src) && disjoint(src, s, tmp2, s) && (disjoint(src, s, dst, s) || isInlinableMemmove(dst, src, s, config))) { 32051 break 32052 } 32053 v.reset(OpMove) 32054 v.AuxInt = s 32055 v.Aux = t1 32056 v.AddArg(dst) 32057 v.AddArg(src) 32058 v.AddArg(midmem) 32059 return true 32060 } 32061 // match: (Move {t1} [s] dst tmp1 midmem:(VarDef (Move {t2} [s] tmp2 src _))) 32062 // cond: t1.(*types.Type).Compare(t2.(*types.Type)) == types.CMPeq && isSamePtr(tmp1, tmp2) && isStackPtr(src) && disjoint(src, s, tmp2, s) && (disjoint(src, s, dst, s) || isInlinableMemmove(dst, src, s, config)) 32063 // result: (Move {t1} [s] dst src midmem) 32064 for { 32065 s := v.AuxInt 32066 t1 := v.Aux 32067 _ = v.Args[2] 32068 dst := v.Args[0] 32069 tmp1 := v.Args[1] 32070 midmem := v.Args[2] 32071 if midmem.Op != OpVarDef { 32072 break 32073 } 32074 midmem_0 := midmem.Args[0] 32075 if midmem_0.Op != OpMove || midmem_0.AuxInt != s { 32076 break 32077 } 32078 t2 := midmem_0.Aux 32079 _ = midmem_0.Args[2] 32080 tmp2 := midmem_0.Args[0] 32081 src := midmem_0.Args[1] 32082 if !(t1.(*types.Type).Compare(t2.(*types.Type)) == types.CMPeq && isSamePtr(tmp1, tmp2) && isStackPtr(src) && disjoint(src, s, tmp2, s) && (disjoint(src, s, dst, s) || isInlinableMemmove(dst, src, s, config))) { 32083 break 32084 } 32085 v.reset(OpMove) 32086 v.AuxInt = s 32087 v.Aux = t1 32088 v.AddArg(dst) 32089 v.AddArg(src) 32090 v.AddArg(midmem) 32091 return true 32092 } 32093 // match: (Move dst src mem) 32094 // cond: isSamePtr(dst, src) 32095 // result: mem 32096 for { 32097 mem := v.Args[2] 32098 dst := v.Args[0] 32099 src := v.Args[1] 32100 if !(isSamePtr(dst, src)) { 32101 break 32102 } 32103 v.reset(OpCopy) 32104 v.Type = mem.Type 32105 v.AddArg(mem) 32106 return true 32107 } 32108 return false 32109 } 32110 func rewriteValuegeneric_OpMul16_0(v *Value) bool { 32111 b := v.Block 32112 typ := &b.Func.Config.Types 32113 // match: (Mul16 (Const16 [c]) (Const16 [d])) 32114 // result: (Const16 [int64(int16(c*d))]) 32115 for { 32116 _ = v.Args[1] 32117 v_0 := v.Args[0] 32118 if v_0.Op != OpConst16 { 32119 break 32120 } 32121 c := v_0.AuxInt 32122 v_1 := v.Args[1] 32123 if v_1.Op != OpConst16 { 32124 break 32125 } 32126 d := v_1.AuxInt 32127 v.reset(OpConst16) 32128 v.AuxInt = int64(int16(c * d)) 32129 return true 32130 } 32131 // match: (Mul16 (Const16 [d]) (Const16 [c])) 32132 // result: (Const16 [int64(int16(c*d))]) 32133 for { 32134 _ = v.Args[1] 32135 v_0 := v.Args[0] 32136 if v_0.Op != OpConst16 { 32137 break 32138 } 32139 d := v_0.AuxInt 32140 v_1 := v.Args[1] 32141 if v_1.Op != OpConst16 { 32142 break 32143 } 32144 c := v_1.AuxInt 32145 v.reset(OpConst16) 32146 v.AuxInt = int64(int16(c * d)) 32147 return true 32148 } 32149 // match: (Mul16 (Const16 [1]) x) 32150 // result: x 32151 for { 32152 x := v.Args[1] 32153 v_0 := v.Args[0] 32154 if v_0.Op != OpConst16 || v_0.AuxInt != 1 { 32155 break 32156 } 32157 v.reset(OpCopy) 32158 v.Type = x.Type 32159 v.AddArg(x) 32160 return true 32161 } 32162 // match: (Mul16 x (Const16 [1])) 32163 // result: x 32164 for { 32165 _ = v.Args[1] 32166 x := v.Args[0] 32167 v_1 := v.Args[1] 32168 if v_1.Op != OpConst16 || v_1.AuxInt != 1 { 32169 break 32170 } 32171 v.reset(OpCopy) 32172 v.Type = x.Type 32173 v.AddArg(x) 32174 return true 32175 } 32176 // match: (Mul16 (Const16 [-1]) x) 32177 // result: (Neg16 x) 32178 for { 32179 x := v.Args[1] 32180 v_0 := v.Args[0] 32181 if v_0.Op != OpConst16 || v_0.AuxInt != -1 { 32182 break 32183 } 32184 v.reset(OpNeg16) 32185 v.AddArg(x) 32186 return true 32187 } 32188 // match: (Mul16 x (Const16 [-1])) 32189 // result: (Neg16 x) 32190 for { 32191 _ = v.Args[1] 32192 x := v.Args[0] 32193 v_1 := v.Args[1] 32194 if v_1.Op != OpConst16 || v_1.AuxInt != -1 { 32195 break 32196 } 32197 v.reset(OpNeg16) 32198 v.AddArg(x) 32199 return true 32200 } 32201 // match: (Mul16 <t> n (Const16 [c])) 32202 // cond: isPowerOfTwo(c) 32203 // result: (Lsh16x64 <t> n (Const64 <typ.UInt64> [log2(c)])) 32204 for { 32205 t := v.Type 32206 _ = v.Args[1] 32207 n := v.Args[0] 32208 v_1 := v.Args[1] 32209 if v_1.Op != OpConst16 { 32210 break 32211 } 32212 c := v_1.AuxInt 32213 if !(isPowerOfTwo(c)) { 32214 break 32215 } 32216 v.reset(OpLsh16x64) 32217 v.Type = t 32218 v.AddArg(n) 32219 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 32220 v0.AuxInt = log2(c) 32221 v.AddArg(v0) 32222 return true 32223 } 32224 // match: (Mul16 <t> (Const16 [c]) n) 32225 // cond: isPowerOfTwo(c) 32226 // result: (Lsh16x64 <t> n (Const64 <typ.UInt64> [log2(c)])) 32227 for { 32228 t := v.Type 32229 n := v.Args[1] 32230 v_0 := v.Args[0] 32231 if v_0.Op != OpConst16 { 32232 break 32233 } 32234 c := v_0.AuxInt 32235 if !(isPowerOfTwo(c)) { 32236 break 32237 } 32238 v.reset(OpLsh16x64) 32239 v.Type = t 32240 v.AddArg(n) 32241 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 32242 v0.AuxInt = log2(c) 32243 v.AddArg(v0) 32244 return true 32245 } 32246 // match: (Mul16 <t> n (Const16 [c])) 32247 // cond: t.IsSigned() && isPowerOfTwo(-c) 32248 // result: (Neg16 (Lsh16x64 <t> n (Const64 <typ.UInt64> [log2(-c)]))) 32249 for { 32250 t := v.Type 32251 _ = v.Args[1] 32252 n := v.Args[0] 32253 v_1 := v.Args[1] 32254 if v_1.Op != OpConst16 { 32255 break 32256 } 32257 c := v_1.AuxInt 32258 if !(t.IsSigned() && isPowerOfTwo(-c)) { 32259 break 32260 } 32261 v.reset(OpNeg16) 32262 v0 := b.NewValue0(v.Pos, OpLsh16x64, t) 32263 v0.AddArg(n) 32264 v1 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 32265 v1.AuxInt = log2(-c) 32266 v0.AddArg(v1) 32267 v.AddArg(v0) 32268 return true 32269 } 32270 // match: (Mul16 <t> (Const16 [c]) n) 32271 // cond: t.IsSigned() && isPowerOfTwo(-c) 32272 // result: (Neg16 (Lsh16x64 <t> n (Const64 <typ.UInt64> [log2(-c)]))) 32273 for { 32274 t := v.Type 32275 n := v.Args[1] 32276 v_0 := v.Args[0] 32277 if v_0.Op != OpConst16 { 32278 break 32279 } 32280 c := v_0.AuxInt 32281 if !(t.IsSigned() && isPowerOfTwo(-c)) { 32282 break 32283 } 32284 v.reset(OpNeg16) 32285 v0 := b.NewValue0(v.Pos, OpLsh16x64, t) 32286 v0.AddArg(n) 32287 v1 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 32288 v1.AuxInt = log2(-c) 32289 v0.AddArg(v1) 32290 v.AddArg(v0) 32291 return true 32292 } 32293 return false 32294 } 32295 func rewriteValuegeneric_OpMul16_10(v *Value) bool { 32296 b := v.Block 32297 // match: (Mul16 (Const16 [0]) _) 32298 // result: (Const16 [0]) 32299 for { 32300 _ = v.Args[1] 32301 v_0 := v.Args[0] 32302 if v_0.Op != OpConst16 || v_0.AuxInt != 0 { 32303 break 32304 } 32305 v.reset(OpConst16) 32306 v.AuxInt = 0 32307 return true 32308 } 32309 // match: (Mul16 _ (Const16 [0])) 32310 // result: (Const16 [0]) 32311 for { 32312 _ = v.Args[1] 32313 v_1 := v.Args[1] 32314 if v_1.Op != OpConst16 || v_1.AuxInt != 0 { 32315 break 32316 } 32317 v.reset(OpConst16) 32318 v.AuxInt = 0 32319 return true 32320 } 32321 // match: (Mul16 (Const16 <t> [c]) (Mul16 (Const16 <t> [d]) x)) 32322 // result: (Mul16 (Const16 <t> [int64(int16(c*d))]) x) 32323 for { 32324 _ = v.Args[1] 32325 v_0 := v.Args[0] 32326 if v_0.Op != OpConst16 { 32327 break 32328 } 32329 t := v_0.Type 32330 c := v_0.AuxInt 32331 v_1 := v.Args[1] 32332 if v_1.Op != OpMul16 { 32333 break 32334 } 32335 x := v_1.Args[1] 32336 v_1_0 := v_1.Args[0] 32337 if v_1_0.Op != OpConst16 || v_1_0.Type != t { 32338 break 32339 } 32340 d := v_1_0.AuxInt 32341 v.reset(OpMul16) 32342 v0 := b.NewValue0(v.Pos, OpConst16, t) 32343 v0.AuxInt = int64(int16(c * d)) 32344 v.AddArg(v0) 32345 v.AddArg(x) 32346 return true 32347 } 32348 // match: (Mul16 (Const16 <t> [c]) (Mul16 x (Const16 <t> [d]))) 32349 // result: (Mul16 (Const16 <t> [int64(int16(c*d))]) x) 32350 for { 32351 _ = v.Args[1] 32352 v_0 := v.Args[0] 32353 if v_0.Op != OpConst16 { 32354 break 32355 } 32356 t := v_0.Type 32357 c := v_0.AuxInt 32358 v_1 := v.Args[1] 32359 if v_1.Op != OpMul16 { 32360 break 32361 } 32362 _ = v_1.Args[1] 32363 x := v_1.Args[0] 32364 v_1_1 := v_1.Args[1] 32365 if v_1_1.Op != OpConst16 || v_1_1.Type != t { 32366 break 32367 } 32368 d := v_1_1.AuxInt 32369 v.reset(OpMul16) 32370 v0 := b.NewValue0(v.Pos, OpConst16, t) 32371 v0.AuxInt = int64(int16(c * d)) 32372 v.AddArg(v0) 32373 v.AddArg(x) 32374 return true 32375 } 32376 // match: (Mul16 (Mul16 (Const16 <t> [d]) x) (Const16 <t> [c])) 32377 // result: (Mul16 (Const16 <t> [int64(int16(c*d))]) x) 32378 for { 32379 _ = v.Args[1] 32380 v_0 := v.Args[0] 32381 if v_0.Op != OpMul16 { 32382 break 32383 } 32384 x := v_0.Args[1] 32385 v_0_0 := v_0.Args[0] 32386 if v_0_0.Op != OpConst16 { 32387 break 32388 } 32389 t := v_0_0.Type 32390 d := v_0_0.AuxInt 32391 v_1 := v.Args[1] 32392 if v_1.Op != OpConst16 || v_1.Type != t { 32393 break 32394 } 32395 c := v_1.AuxInt 32396 v.reset(OpMul16) 32397 v0 := b.NewValue0(v.Pos, OpConst16, t) 32398 v0.AuxInt = int64(int16(c * d)) 32399 v.AddArg(v0) 32400 v.AddArg(x) 32401 return true 32402 } 32403 // match: (Mul16 (Mul16 x (Const16 <t> [d])) (Const16 <t> [c])) 32404 // result: (Mul16 (Const16 <t> [int64(int16(c*d))]) x) 32405 for { 32406 _ = v.Args[1] 32407 v_0 := v.Args[0] 32408 if v_0.Op != OpMul16 { 32409 break 32410 } 32411 _ = v_0.Args[1] 32412 x := v_0.Args[0] 32413 v_0_1 := v_0.Args[1] 32414 if v_0_1.Op != OpConst16 { 32415 break 32416 } 32417 t := v_0_1.Type 32418 d := v_0_1.AuxInt 32419 v_1 := v.Args[1] 32420 if v_1.Op != OpConst16 || v_1.Type != t { 32421 break 32422 } 32423 c := v_1.AuxInt 32424 v.reset(OpMul16) 32425 v0 := b.NewValue0(v.Pos, OpConst16, t) 32426 v0.AuxInt = int64(int16(c * d)) 32427 v.AddArg(v0) 32428 v.AddArg(x) 32429 return true 32430 } 32431 return false 32432 } 32433 func rewriteValuegeneric_OpMul32_0(v *Value) bool { 32434 b := v.Block 32435 typ := &b.Func.Config.Types 32436 // match: (Mul32 (Const32 [c]) (Const32 [d])) 32437 // result: (Const32 [int64(int32(c*d))]) 32438 for { 32439 _ = v.Args[1] 32440 v_0 := v.Args[0] 32441 if v_0.Op != OpConst32 { 32442 break 32443 } 32444 c := v_0.AuxInt 32445 v_1 := v.Args[1] 32446 if v_1.Op != OpConst32 { 32447 break 32448 } 32449 d := v_1.AuxInt 32450 v.reset(OpConst32) 32451 v.AuxInt = int64(int32(c * d)) 32452 return true 32453 } 32454 // match: (Mul32 (Const32 [d]) (Const32 [c])) 32455 // result: (Const32 [int64(int32(c*d))]) 32456 for { 32457 _ = v.Args[1] 32458 v_0 := v.Args[0] 32459 if v_0.Op != OpConst32 { 32460 break 32461 } 32462 d := v_0.AuxInt 32463 v_1 := v.Args[1] 32464 if v_1.Op != OpConst32 { 32465 break 32466 } 32467 c := v_1.AuxInt 32468 v.reset(OpConst32) 32469 v.AuxInt = int64(int32(c * d)) 32470 return true 32471 } 32472 // match: (Mul32 (Const32 [1]) x) 32473 // result: x 32474 for { 32475 x := v.Args[1] 32476 v_0 := v.Args[0] 32477 if v_0.Op != OpConst32 || v_0.AuxInt != 1 { 32478 break 32479 } 32480 v.reset(OpCopy) 32481 v.Type = x.Type 32482 v.AddArg(x) 32483 return true 32484 } 32485 // match: (Mul32 x (Const32 [1])) 32486 // result: x 32487 for { 32488 _ = v.Args[1] 32489 x := v.Args[0] 32490 v_1 := v.Args[1] 32491 if v_1.Op != OpConst32 || v_1.AuxInt != 1 { 32492 break 32493 } 32494 v.reset(OpCopy) 32495 v.Type = x.Type 32496 v.AddArg(x) 32497 return true 32498 } 32499 // match: (Mul32 (Const32 [-1]) x) 32500 // result: (Neg32 x) 32501 for { 32502 x := v.Args[1] 32503 v_0 := v.Args[0] 32504 if v_0.Op != OpConst32 || v_0.AuxInt != -1 { 32505 break 32506 } 32507 v.reset(OpNeg32) 32508 v.AddArg(x) 32509 return true 32510 } 32511 // match: (Mul32 x (Const32 [-1])) 32512 // result: (Neg32 x) 32513 for { 32514 _ = v.Args[1] 32515 x := v.Args[0] 32516 v_1 := v.Args[1] 32517 if v_1.Op != OpConst32 || v_1.AuxInt != -1 { 32518 break 32519 } 32520 v.reset(OpNeg32) 32521 v.AddArg(x) 32522 return true 32523 } 32524 // match: (Mul32 <t> n (Const32 [c])) 32525 // cond: isPowerOfTwo(c) 32526 // result: (Lsh32x64 <t> n (Const64 <typ.UInt64> [log2(c)])) 32527 for { 32528 t := v.Type 32529 _ = v.Args[1] 32530 n := v.Args[0] 32531 v_1 := v.Args[1] 32532 if v_1.Op != OpConst32 { 32533 break 32534 } 32535 c := v_1.AuxInt 32536 if !(isPowerOfTwo(c)) { 32537 break 32538 } 32539 v.reset(OpLsh32x64) 32540 v.Type = t 32541 v.AddArg(n) 32542 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 32543 v0.AuxInt = log2(c) 32544 v.AddArg(v0) 32545 return true 32546 } 32547 // match: (Mul32 <t> (Const32 [c]) n) 32548 // cond: isPowerOfTwo(c) 32549 // result: (Lsh32x64 <t> n (Const64 <typ.UInt64> [log2(c)])) 32550 for { 32551 t := v.Type 32552 n := v.Args[1] 32553 v_0 := v.Args[0] 32554 if v_0.Op != OpConst32 { 32555 break 32556 } 32557 c := v_0.AuxInt 32558 if !(isPowerOfTwo(c)) { 32559 break 32560 } 32561 v.reset(OpLsh32x64) 32562 v.Type = t 32563 v.AddArg(n) 32564 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 32565 v0.AuxInt = log2(c) 32566 v.AddArg(v0) 32567 return true 32568 } 32569 // match: (Mul32 <t> n (Const32 [c])) 32570 // cond: t.IsSigned() && isPowerOfTwo(-c) 32571 // result: (Neg32 (Lsh32x64 <t> n (Const64 <typ.UInt64> [log2(-c)]))) 32572 for { 32573 t := v.Type 32574 _ = v.Args[1] 32575 n := v.Args[0] 32576 v_1 := v.Args[1] 32577 if v_1.Op != OpConst32 { 32578 break 32579 } 32580 c := v_1.AuxInt 32581 if !(t.IsSigned() && isPowerOfTwo(-c)) { 32582 break 32583 } 32584 v.reset(OpNeg32) 32585 v0 := b.NewValue0(v.Pos, OpLsh32x64, t) 32586 v0.AddArg(n) 32587 v1 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 32588 v1.AuxInt = log2(-c) 32589 v0.AddArg(v1) 32590 v.AddArg(v0) 32591 return true 32592 } 32593 // match: (Mul32 <t> (Const32 [c]) n) 32594 // cond: t.IsSigned() && isPowerOfTwo(-c) 32595 // result: (Neg32 (Lsh32x64 <t> n (Const64 <typ.UInt64> [log2(-c)]))) 32596 for { 32597 t := v.Type 32598 n := v.Args[1] 32599 v_0 := v.Args[0] 32600 if v_0.Op != OpConst32 { 32601 break 32602 } 32603 c := v_0.AuxInt 32604 if !(t.IsSigned() && isPowerOfTwo(-c)) { 32605 break 32606 } 32607 v.reset(OpNeg32) 32608 v0 := b.NewValue0(v.Pos, OpLsh32x64, t) 32609 v0.AddArg(n) 32610 v1 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 32611 v1.AuxInt = log2(-c) 32612 v0.AddArg(v1) 32613 v.AddArg(v0) 32614 return true 32615 } 32616 return false 32617 } 32618 func rewriteValuegeneric_OpMul32_10(v *Value) bool { 32619 b := v.Block 32620 // match: (Mul32 (Const32 <t> [c]) (Add32 <t> (Const32 <t> [d]) x)) 32621 // result: (Add32 (Const32 <t> [int64(int32(c*d))]) (Mul32 <t> (Const32 <t> [c]) x)) 32622 for { 32623 _ = v.Args[1] 32624 v_0 := v.Args[0] 32625 if v_0.Op != OpConst32 { 32626 break 32627 } 32628 t := v_0.Type 32629 c := v_0.AuxInt 32630 v_1 := v.Args[1] 32631 if v_1.Op != OpAdd32 || v_1.Type != t { 32632 break 32633 } 32634 x := v_1.Args[1] 32635 v_1_0 := v_1.Args[0] 32636 if v_1_0.Op != OpConst32 || v_1_0.Type != t { 32637 break 32638 } 32639 d := v_1_0.AuxInt 32640 v.reset(OpAdd32) 32641 v0 := b.NewValue0(v.Pos, OpConst32, t) 32642 v0.AuxInt = int64(int32(c * d)) 32643 v.AddArg(v0) 32644 v1 := b.NewValue0(v.Pos, OpMul32, t) 32645 v2 := b.NewValue0(v.Pos, OpConst32, t) 32646 v2.AuxInt = c 32647 v1.AddArg(v2) 32648 v1.AddArg(x) 32649 v.AddArg(v1) 32650 return true 32651 } 32652 // match: (Mul32 (Const32 <t> [c]) (Add32 <t> x (Const32 <t> [d]))) 32653 // result: (Add32 (Const32 <t> [int64(int32(c*d))]) (Mul32 <t> (Const32 <t> [c]) x)) 32654 for { 32655 _ = v.Args[1] 32656 v_0 := v.Args[0] 32657 if v_0.Op != OpConst32 { 32658 break 32659 } 32660 t := v_0.Type 32661 c := v_0.AuxInt 32662 v_1 := v.Args[1] 32663 if v_1.Op != OpAdd32 || v_1.Type != t { 32664 break 32665 } 32666 _ = v_1.Args[1] 32667 x := v_1.Args[0] 32668 v_1_1 := v_1.Args[1] 32669 if v_1_1.Op != OpConst32 || v_1_1.Type != t { 32670 break 32671 } 32672 d := v_1_1.AuxInt 32673 v.reset(OpAdd32) 32674 v0 := b.NewValue0(v.Pos, OpConst32, t) 32675 v0.AuxInt = int64(int32(c * d)) 32676 v.AddArg(v0) 32677 v1 := b.NewValue0(v.Pos, OpMul32, t) 32678 v2 := b.NewValue0(v.Pos, OpConst32, t) 32679 v2.AuxInt = c 32680 v1.AddArg(v2) 32681 v1.AddArg(x) 32682 v.AddArg(v1) 32683 return true 32684 } 32685 // match: (Mul32 (Add32 <t> (Const32 <t> [d]) x) (Const32 <t> [c])) 32686 // result: (Add32 (Const32 <t> [int64(int32(c*d))]) (Mul32 <t> (Const32 <t> [c]) x)) 32687 for { 32688 _ = v.Args[1] 32689 v_0 := v.Args[0] 32690 if v_0.Op != OpAdd32 { 32691 break 32692 } 32693 t := v_0.Type 32694 x := v_0.Args[1] 32695 v_0_0 := v_0.Args[0] 32696 if v_0_0.Op != OpConst32 || v_0_0.Type != t { 32697 break 32698 } 32699 d := v_0_0.AuxInt 32700 v_1 := v.Args[1] 32701 if v_1.Op != OpConst32 || v_1.Type != t { 32702 break 32703 } 32704 c := v_1.AuxInt 32705 v.reset(OpAdd32) 32706 v0 := b.NewValue0(v.Pos, OpConst32, t) 32707 v0.AuxInt = int64(int32(c * d)) 32708 v.AddArg(v0) 32709 v1 := b.NewValue0(v.Pos, OpMul32, t) 32710 v2 := b.NewValue0(v.Pos, OpConst32, t) 32711 v2.AuxInt = c 32712 v1.AddArg(v2) 32713 v1.AddArg(x) 32714 v.AddArg(v1) 32715 return true 32716 } 32717 // match: (Mul32 (Add32 <t> x (Const32 <t> [d])) (Const32 <t> [c])) 32718 // result: (Add32 (Const32 <t> [int64(int32(c*d))]) (Mul32 <t> (Const32 <t> [c]) x)) 32719 for { 32720 _ = v.Args[1] 32721 v_0 := v.Args[0] 32722 if v_0.Op != OpAdd32 { 32723 break 32724 } 32725 t := v_0.Type 32726 _ = v_0.Args[1] 32727 x := v_0.Args[0] 32728 v_0_1 := v_0.Args[1] 32729 if v_0_1.Op != OpConst32 || v_0_1.Type != t { 32730 break 32731 } 32732 d := v_0_1.AuxInt 32733 v_1 := v.Args[1] 32734 if v_1.Op != OpConst32 || v_1.Type != t { 32735 break 32736 } 32737 c := v_1.AuxInt 32738 v.reset(OpAdd32) 32739 v0 := b.NewValue0(v.Pos, OpConst32, t) 32740 v0.AuxInt = int64(int32(c * d)) 32741 v.AddArg(v0) 32742 v1 := b.NewValue0(v.Pos, OpMul32, t) 32743 v2 := b.NewValue0(v.Pos, OpConst32, t) 32744 v2.AuxInt = c 32745 v1.AddArg(v2) 32746 v1.AddArg(x) 32747 v.AddArg(v1) 32748 return true 32749 } 32750 // match: (Mul32 (Const32 [0]) _) 32751 // result: (Const32 [0]) 32752 for { 32753 _ = v.Args[1] 32754 v_0 := v.Args[0] 32755 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 32756 break 32757 } 32758 v.reset(OpConst32) 32759 v.AuxInt = 0 32760 return true 32761 } 32762 // match: (Mul32 _ (Const32 [0])) 32763 // result: (Const32 [0]) 32764 for { 32765 _ = v.Args[1] 32766 v_1 := v.Args[1] 32767 if v_1.Op != OpConst32 || v_1.AuxInt != 0 { 32768 break 32769 } 32770 v.reset(OpConst32) 32771 v.AuxInt = 0 32772 return true 32773 } 32774 // match: (Mul32 (Const32 <t> [c]) (Mul32 (Const32 <t> [d]) x)) 32775 // result: (Mul32 (Const32 <t> [int64(int32(c*d))]) x) 32776 for { 32777 _ = v.Args[1] 32778 v_0 := v.Args[0] 32779 if v_0.Op != OpConst32 { 32780 break 32781 } 32782 t := v_0.Type 32783 c := v_0.AuxInt 32784 v_1 := v.Args[1] 32785 if v_1.Op != OpMul32 { 32786 break 32787 } 32788 x := v_1.Args[1] 32789 v_1_0 := v_1.Args[0] 32790 if v_1_0.Op != OpConst32 || v_1_0.Type != t { 32791 break 32792 } 32793 d := v_1_0.AuxInt 32794 v.reset(OpMul32) 32795 v0 := b.NewValue0(v.Pos, OpConst32, t) 32796 v0.AuxInt = int64(int32(c * d)) 32797 v.AddArg(v0) 32798 v.AddArg(x) 32799 return true 32800 } 32801 // match: (Mul32 (Const32 <t> [c]) (Mul32 x (Const32 <t> [d]))) 32802 // result: (Mul32 (Const32 <t> [int64(int32(c*d))]) x) 32803 for { 32804 _ = v.Args[1] 32805 v_0 := v.Args[0] 32806 if v_0.Op != OpConst32 { 32807 break 32808 } 32809 t := v_0.Type 32810 c := v_0.AuxInt 32811 v_1 := v.Args[1] 32812 if v_1.Op != OpMul32 { 32813 break 32814 } 32815 _ = v_1.Args[1] 32816 x := v_1.Args[0] 32817 v_1_1 := v_1.Args[1] 32818 if v_1_1.Op != OpConst32 || v_1_1.Type != t { 32819 break 32820 } 32821 d := v_1_1.AuxInt 32822 v.reset(OpMul32) 32823 v0 := b.NewValue0(v.Pos, OpConst32, t) 32824 v0.AuxInt = int64(int32(c * d)) 32825 v.AddArg(v0) 32826 v.AddArg(x) 32827 return true 32828 } 32829 // match: (Mul32 (Mul32 (Const32 <t> [d]) x) (Const32 <t> [c])) 32830 // result: (Mul32 (Const32 <t> [int64(int32(c*d))]) x) 32831 for { 32832 _ = v.Args[1] 32833 v_0 := v.Args[0] 32834 if v_0.Op != OpMul32 { 32835 break 32836 } 32837 x := v_0.Args[1] 32838 v_0_0 := v_0.Args[0] 32839 if v_0_0.Op != OpConst32 { 32840 break 32841 } 32842 t := v_0_0.Type 32843 d := v_0_0.AuxInt 32844 v_1 := v.Args[1] 32845 if v_1.Op != OpConst32 || v_1.Type != t { 32846 break 32847 } 32848 c := v_1.AuxInt 32849 v.reset(OpMul32) 32850 v0 := b.NewValue0(v.Pos, OpConst32, t) 32851 v0.AuxInt = int64(int32(c * d)) 32852 v.AddArg(v0) 32853 v.AddArg(x) 32854 return true 32855 } 32856 // match: (Mul32 (Mul32 x (Const32 <t> [d])) (Const32 <t> [c])) 32857 // result: (Mul32 (Const32 <t> [int64(int32(c*d))]) x) 32858 for { 32859 _ = v.Args[1] 32860 v_0 := v.Args[0] 32861 if v_0.Op != OpMul32 { 32862 break 32863 } 32864 _ = v_0.Args[1] 32865 x := v_0.Args[0] 32866 v_0_1 := v_0.Args[1] 32867 if v_0_1.Op != OpConst32 { 32868 break 32869 } 32870 t := v_0_1.Type 32871 d := v_0_1.AuxInt 32872 v_1 := v.Args[1] 32873 if v_1.Op != OpConst32 || v_1.Type != t { 32874 break 32875 } 32876 c := v_1.AuxInt 32877 v.reset(OpMul32) 32878 v0 := b.NewValue0(v.Pos, OpConst32, t) 32879 v0.AuxInt = int64(int32(c * d)) 32880 v.AddArg(v0) 32881 v.AddArg(x) 32882 return true 32883 } 32884 return false 32885 } 32886 func rewriteValuegeneric_OpMul32F_0(v *Value) bool { 32887 // match: (Mul32F (Const32F [c]) (Const32F [d])) 32888 // result: (Const32F [auxFrom32F(auxTo32F(c) * auxTo32F(d))]) 32889 for { 32890 _ = v.Args[1] 32891 v_0 := v.Args[0] 32892 if v_0.Op != OpConst32F { 32893 break 32894 } 32895 c := v_0.AuxInt 32896 v_1 := v.Args[1] 32897 if v_1.Op != OpConst32F { 32898 break 32899 } 32900 d := v_1.AuxInt 32901 v.reset(OpConst32F) 32902 v.AuxInt = auxFrom32F(auxTo32F(c) * auxTo32F(d)) 32903 return true 32904 } 32905 // match: (Mul32F (Const32F [d]) (Const32F [c])) 32906 // result: (Const32F [auxFrom32F(auxTo32F(c) * auxTo32F(d))]) 32907 for { 32908 _ = v.Args[1] 32909 v_0 := v.Args[0] 32910 if v_0.Op != OpConst32F { 32911 break 32912 } 32913 d := v_0.AuxInt 32914 v_1 := v.Args[1] 32915 if v_1.Op != OpConst32F { 32916 break 32917 } 32918 c := v_1.AuxInt 32919 v.reset(OpConst32F) 32920 v.AuxInt = auxFrom32F(auxTo32F(c) * auxTo32F(d)) 32921 return true 32922 } 32923 // match: (Mul32F x (Const32F [auxFrom64F(1)])) 32924 // result: x 32925 for { 32926 _ = v.Args[1] 32927 x := v.Args[0] 32928 v_1 := v.Args[1] 32929 if v_1.Op != OpConst32F || v_1.AuxInt != auxFrom64F(1) { 32930 break 32931 } 32932 v.reset(OpCopy) 32933 v.Type = x.Type 32934 v.AddArg(x) 32935 return true 32936 } 32937 // match: (Mul32F (Const32F [auxFrom64F(1)]) x) 32938 // result: x 32939 for { 32940 x := v.Args[1] 32941 v_0 := v.Args[0] 32942 if v_0.Op != OpConst32F || v_0.AuxInt != auxFrom64F(1) { 32943 break 32944 } 32945 v.reset(OpCopy) 32946 v.Type = x.Type 32947 v.AddArg(x) 32948 return true 32949 } 32950 // match: (Mul32F x (Const32F [auxFrom32F(-1)])) 32951 // result: (Neg32F x) 32952 for { 32953 _ = v.Args[1] 32954 x := v.Args[0] 32955 v_1 := v.Args[1] 32956 if v_1.Op != OpConst32F || v_1.AuxInt != auxFrom32F(-1) { 32957 break 32958 } 32959 v.reset(OpNeg32F) 32960 v.AddArg(x) 32961 return true 32962 } 32963 // match: (Mul32F (Const32F [auxFrom32F(-1)]) x) 32964 // result: (Neg32F x) 32965 for { 32966 x := v.Args[1] 32967 v_0 := v.Args[0] 32968 if v_0.Op != OpConst32F || v_0.AuxInt != auxFrom32F(-1) { 32969 break 32970 } 32971 v.reset(OpNeg32F) 32972 v.AddArg(x) 32973 return true 32974 } 32975 // match: (Mul32F x (Const32F [auxFrom32F(2)])) 32976 // result: (Add32F x x) 32977 for { 32978 _ = v.Args[1] 32979 x := v.Args[0] 32980 v_1 := v.Args[1] 32981 if v_1.Op != OpConst32F || v_1.AuxInt != auxFrom32F(2) { 32982 break 32983 } 32984 v.reset(OpAdd32F) 32985 v.AddArg(x) 32986 v.AddArg(x) 32987 return true 32988 } 32989 // match: (Mul32F (Const32F [auxFrom32F(2)]) x) 32990 // result: (Add32F x x) 32991 for { 32992 x := v.Args[1] 32993 v_0 := v.Args[0] 32994 if v_0.Op != OpConst32F || v_0.AuxInt != auxFrom32F(2) { 32995 break 32996 } 32997 v.reset(OpAdd32F) 32998 v.AddArg(x) 32999 v.AddArg(x) 33000 return true 33001 } 33002 return false 33003 } 33004 func rewriteValuegeneric_OpMul64_0(v *Value) bool { 33005 b := v.Block 33006 typ := &b.Func.Config.Types 33007 // match: (Mul64 (Const64 [c]) (Const64 [d])) 33008 // result: (Const64 [c*d]) 33009 for { 33010 _ = v.Args[1] 33011 v_0 := v.Args[0] 33012 if v_0.Op != OpConst64 { 33013 break 33014 } 33015 c := v_0.AuxInt 33016 v_1 := v.Args[1] 33017 if v_1.Op != OpConst64 { 33018 break 33019 } 33020 d := v_1.AuxInt 33021 v.reset(OpConst64) 33022 v.AuxInt = c * d 33023 return true 33024 } 33025 // match: (Mul64 (Const64 [d]) (Const64 [c])) 33026 // result: (Const64 [c*d]) 33027 for { 33028 _ = v.Args[1] 33029 v_0 := v.Args[0] 33030 if v_0.Op != OpConst64 { 33031 break 33032 } 33033 d := v_0.AuxInt 33034 v_1 := v.Args[1] 33035 if v_1.Op != OpConst64 { 33036 break 33037 } 33038 c := v_1.AuxInt 33039 v.reset(OpConst64) 33040 v.AuxInt = c * d 33041 return true 33042 } 33043 // match: (Mul64 (Const64 [1]) x) 33044 // result: x 33045 for { 33046 x := v.Args[1] 33047 v_0 := v.Args[0] 33048 if v_0.Op != OpConst64 || v_0.AuxInt != 1 { 33049 break 33050 } 33051 v.reset(OpCopy) 33052 v.Type = x.Type 33053 v.AddArg(x) 33054 return true 33055 } 33056 // match: (Mul64 x (Const64 [1])) 33057 // result: x 33058 for { 33059 _ = v.Args[1] 33060 x := v.Args[0] 33061 v_1 := v.Args[1] 33062 if v_1.Op != OpConst64 || v_1.AuxInt != 1 { 33063 break 33064 } 33065 v.reset(OpCopy) 33066 v.Type = x.Type 33067 v.AddArg(x) 33068 return true 33069 } 33070 // match: (Mul64 (Const64 [-1]) x) 33071 // result: (Neg64 x) 33072 for { 33073 x := v.Args[1] 33074 v_0 := v.Args[0] 33075 if v_0.Op != OpConst64 || v_0.AuxInt != -1 { 33076 break 33077 } 33078 v.reset(OpNeg64) 33079 v.AddArg(x) 33080 return true 33081 } 33082 // match: (Mul64 x (Const64 [-1])) 33083 // result: (Neg64 x) 33084 for { 33085 _ = v.Args[1] 33086 x := v.Args[0] 33087 v_1 := v.Args[1] 33088 if v_1.Op != OpConst64 || v_1.AuxInt != -1 { 33089 break 33090 } 33091 v.reset(OpNeg64) 33092 v.AddArg(x) 33093 return true 33094 } 33095 // match: (Mul64 <t> n (Const64 [c])) 33096 // cond: isPowerOfTwo(c) 33097 // result: (Lsh64x64 <t> n (Const64 <typ.UInt64> [log2(c)])) 33098 for { 33099 t := v.Type 33100 _ = v.Args[1] 33101 n := v.Args[0] 33102 v_1 := v.Args[1] 33103 if v_1.Op != OpConst64 { 33104 break 33105 } 33106 c := v_1.AuxInt 33107 if !(isPowerOfTwo(c)) { 33108 break 33109 } 33110 v.reset(OpLsh64x64) 33111 v.Type = t 33112 v.AddArg(n) 33113 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 33114 v0.AuxInt = log2(c) 33115 v.AddArg(v0) 33116 return true 33117 } 33118 // match: (Mul64 <t> (Const64 [c]) n) 33119 // cond: isPowerOfTwo(c) 33120 // result: (Lsh64x64 <t> n (Const64 <typ.UInt64> [log2(c)])) 33121 for { 33122 t := v.Type 33123 n := v.Args[1] 33124 v_0 := v.Args[0] 33125 if v_0.Op != OpConst64 { 33126 break 33127 } 33128 c := v_0.AuxInt 33129 if !(isPowerOfTwo(c)) { 33130 break 33131 } 33132 v.reset(OpLsh64x64) 33133 v.Type = t 33134 v.AddArg(n) 33135 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 33136 v0.AuxInt = log2(c) 33137 v.AddArg(v0) 33138 return true 33139 } 33140 // match: (Mul64 <t> n (Const64 [c])) 33141 // cond: t.IsSigned() && isPowerOfTwo(-c) 33142 // result: (Neg64 (Lsh64x64 <t> n (Const64 <typ.UInt64> [log2(-c)]))) 33143 for { 33144 t := v.Type 33145 _ = v.Args[1] 33146 n := v.Args[0] 33147 v_1 := v.Args[1] 33148 if v_1.Op != OpConst64 { 33149 break 33150 } 33151 c := v_1.AuxInt 33152 if !(t.IsSigned() && isPowerOfTwo(-c)) { 33153 break 33154 } 33155 v.reset(OpNeg64) 33156 v0 := b.NewValue0(v.Pos, OpLsh64x64, t) 33157 v0.AddArg(n) 33158 v1 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 33159 v1.AuxInt = log2(-c) 33160 v0.AddArg(v1) 33161 v.AddArg(v0) 33162 return true 33163 } 33164 // match: (Mul64 <t> (Const64 [c]) n) 33165 // cond: t.IsSigned() && isPowerOfTwo(-c) 33166 // result: (Neg64 (Lsh64x64 <t> n (Const64 <typ.UInt64> [log2(-c)]))) 33167 for { 33168 t := v.Type 33169 n := v.Args[1] 33170 v_0 := v.Args[0] 33171 if v_0.Op != OpConst64 { 33172 break 33173 } 33174 c := v_0.AuxInt 33175 if !(t.IsSigned() && isPowerOfTwo(-c)) { 33176 break 33177 } 33178 v.reset(OpNeg64) 33179 v0 := b.NewValue0(v.Pos, OpLsh64x64, t) 33180 v0.AddArg(n) 33181 v1 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 33182 v1.AuxInt = log2(-c) 33183 v0.AddArg(v1) 33184 v.AddArg(v0) 33185 return true 33186 } 33187 return false 33188 } 33189 func rewriteValuegeneric_OpMul64_10(v *Value) bool { 33190 b := v.Block 33191 // match: (Mul64 (Const64 <t> [c]) (Add64 <t> (Const64 <t> [d]) x)) 33192 // result: (Add64 (Const64 <t> [c*d]) (Mul64 <t> (Const64 <t> [c]) x)) 33193 for { 33194 _ = v.Args[1] 33195 v_0 := v.Args[0] 33196 if v_0.Op != OpConst64 { 33197 break 33198 } 33199 t := v_0.Type 33200 c := v_0.AuxInt 33201 v_1 := v.Args[1] 33202 if v_1.Op != OpAdd64 || v_1.Type != t { 33203 break 33204 } 33205 x := v_1.Args[1] 33206 v_1_0 := v_1.Args[0] 33207 if v_1_0.Op != OpConst64 || v_1_0.Type != t { 33208 break 33209 } 33210 d := v_1_0.AuxInt 33211 v.reset(OpAdd64) 33212 v0 := b.NewValue0(v.Pos, OpConst64, t) 33213 v0.AuxInt = c * d 33214 v.AddArg(v0) 33215 v1 := b.NewValue0(v.Pos, OpMul64, t) 33216 v2 := b.NewValue0(v.Pos, OpConst64, t) 33217 v2.AuxInt = c 33218 v1.AddArg(v2) 33219 v1.AddArg(x) 33220 v.AddArg(v1) 33221 return true 33222 } 33223 // match: (Mul64 (Const64 <t> [c]) (Add64 <t> x (Const64 <t> [d]))) 33224 // result: (Add64 (Const64 <t> [c*d]) (Mul64 <t> (Const64 <t> [c]) x)) 33225 for { 33226 _ = v.Args[1] 33227 v_0 := v.Args[0] 33228 if v_0.Op != OpConst64 { 33229 break 33230 } 33231 t := v_0.Type 33232 c := v_0.AuxInt 33233 v_1 := v.Args[1] 33234 if v_1.Op != OpAdd64 || v_1.Type != t { 33235 break 33236 } 33237 _ = v_1.Args[1] 33238 x := v_1.Args[0] 33239 v_1_1 := v_1.Args[1] 33240 if v_1_1.Op != OpConst64 || v_1_1.Type != t { 33241 break 33242 } 33243 d := v_1_1.AuxInt 33244 v.reset(OpAdd64) 33245 v0 := b.NewValue0(v.Pos, OpConst64, t) 33246 v0.AuxInt = c * d 33247 v.AddArg(v0) 33248 v1 := b.NewValue0(v.Pos, OpMul64, t) 33249 v2 := b.NewValue0(v.Pos, OpConst64, t) 33250 v2.AuxInt = c 33251 v1.AddArg(v2) 33252 v1.AddArg(x) 33253 v.AddArg(v1) 33254 return true 33255 } 33256 // match: (Mul64 (Add64 <t> (Const64 <t> [d]) x) (Const64 <t> [c])) 33257 // result: (Add64 (Const64 <t> [c*d]) (Mul64 <t> (Const64 <t> [c]) x)) 33258 for { 33259 _ = v.Args[1] 33260 v_0 := v.Args[0] 33261 if v_0.Op != OpAdd64 { 33262 break 33263 } 33264 t := v_0.Type 33265 x := v_0.Args[1] 33266 v_0_0 := v_0.Args[0] 33267 if v_0_0.Op != OpConst64 || v_0_0.Type != t { 33268 break 33269 } 33270 d := v_0_0.AuxInt 33271 v_1 := v.Args[1] 33272 if v_1.Op != OpConst64 || v_1.Type != t { 33273 break 33274 } 33275 c := v_1.AuxInt 33276 v.reset(OpAdd64) 33277 v0 := b.NewValue0(v.Pos, OpConst64, t) 33278 v0.AuxInt = c * d 33279 v.AddArg(v0) 33280 v1 := b.NewValue0(v.Pos, OpMul64, t) 33281 v2 := b.NewValue0(v.Pos, OpConst64, t) 33282 v2.AuxInt = c 33283 v1.AddArg(v2) 33284 v1.AddArg(x) 33285 v.AddArg(v1) 33286 return true 33287 } 33288 // match: (Mul64 (Add64 <t> x (Const64 <t> [d])) (Const64 <t> [c])) 33289 // result: (Add64 (Const64 <t> [c*d]) (Mul64 <t> (Const64 <t> [c]) x)) 33290 for { 33291 _ = v.Args[1] 33292 v_0 := v.Args[0] 33293 if v_0.Op != OpAdd64 { 33294 break 33295 } 33296 t := v_0.Type 33297 _ = v_0.Args[1] 33298 x := v_0.Args[0] 33299 v_0_1 := v_0.Args[1] 33300 if v_0_1.Op != OpConst64 || v_0_1.Type != t { 33301 break 33302 } 33303 d := v_0_1.AuxInt 33304 v_1 := v.Args[1] 33305 if v_1.Op != OpConst64 || v_1.Type != t { 33306 break 33307 } 33308 c := v_1.AuxInt 33309 v.reset(OpAdd64) 33310 v0 := b.NewValue0(v.Pos, OpConst64, t) 33311 v0.AuxInt = c * d 33312 v.AddArg(v0) 33313 v1 := b.NewValue0(v.Pos, OpMul64, t) 33314 v2 := b.NewValue0(v.Pos, OpConst64, t) 33315 v2.AuxInt = c 33316 v1.AddArg(v2) 33317 v1.AddArg(x) 33318 v.AddArg(v1) 33319 return true 33320 } 33321 // match: (Mul64 (Const64 [0]) _) 33322 // result: (Const64 [0]) 33323 for { 33324 _ = v.Args[1] 33325 v_0 := v.Args[0] 33326 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 33327 break 33328 } 33329 v.reset(OpConst64) 33330 v.AuxInt = 0 33331 return true 33332 } 33333 // match: (Mul64 _ (Const64 [0])) 33334 // result: (Const64 [0]) 33335 for { 33336 _ = v.Args[1] 33337 v_1 := v.Args[1] 33338 if v_1.Op != OpConst64 || v_1.AuxInt != 0 { 33339 break 33340 } 33341 v.reset(OpConst64) 33342 v.AuxInt = 0 33343 return true 33344 } 33345 // match: (Mul64 (Const64 <t> [c]) (Mul64 (Const64 <t> [d]) x)) 33346 // result: (Mul64 (Const64 <t> [c*d]) x) 33347 for { 33348 _ = v.Args[1] 33349 v_0 := v.Args[0] 33350 if v_0.Op != OpConst64 { 33351 break 33352 } 33353 t := v_0.Type 33354 c := v_0.AuxInt 33355 v_1 := v.Args[1] 33356 if v_1.Op != OpMul64 { 33357 break 33358 } 33359 x := v_1.Args[1] 33360 v_1_0 := v_1.Args[0] 33361 if v_1_0.Op != OpConst64 || v_1_0.Type != t { 33362 break 33363 } 33364 d := v_1_0.AuxInt 33365 v.reset(OpMul64) 33366 v0 := b.NewValue0(v.Pos, OpConst64, t) 33367 v0.AuxInt = c * d 33368 v.AddArg(v0) 33369 v.AddArg(x) 33370 return true 33371 } 33372 // match: (Mul64 (Const64 <t> [c]) (Mul64 x (Const64 <t> [d]))) 33373 // result: (Mul64 (Const64 <t> [c*d]) x) 33374 for { 33375 _ = v.Args[1] 33376 v_0 := v.Args[0] 33377 if v_0.Op != OpConst64 { 33378 break 33379 } 33380 t := v_0.Type 33381 c := v_0.AuxInt 33382 v_1 := v.Args[1] 33383 if v_1.Op != OpMul64 { 33384 break 33385 } 33386 _ = v_1.Args[1] 33387 x := v_1.Args[0] 33388 v_1_1 := v_1.Args[1] 33389 if v_1_1.Op != OpConst64 || v_1_1.Type != t { 33390 break 33391 } 33392 d := v_1_1.AuxInt 33393 v.reset(OpMul64) 33394 v0 := b.NewValue0(v.Pos, OpConst64, t) 33395 v0.AuxInt = c * d 33396 v.AddArg(v0) 33397 v.AddArg(x) 33398 return true 33399 } 33400 // match: (Mul64 (Mul64 (Const64 <t> [d]) x) (Const64 <t> [c])) 33401 // result: (Mul64 (Const64 <t> [c*d]) x) 33402 for { 33403 _ = v.Args[1] 33404 v_0 := v.Args[0] 33405 if v_0.Op != OpMul64 { 33406 break 33407 } 33408 x := v_0.Args[1] 33409 v_0_0 := v_0.Args[0] 33410 if v_0_0.Op != OpConst64 { 33411 break 33412 } 33413 t := v_0_0.Type 33414 d := v_0_0.AuxInt 33415 v_1 := v.Args[1] 33416 if v_1.Op != OpConst64 || v_1.Type != t { 33417 break 33418 } 33419 c := v_1.AuxInt 33420 v.reset(OpMul64) 33421 v0 := b.NewValue0(v.Pos, OpConst64, t) 33422 v0.AuxInt = c * d 33423 v.AddArg(v0) 33424 v.AddArg(x) 33425 return true 33426 } 33427 // match: (Mul64 (Mul64 x (Const64 <t> [d])) (Const64 <t> [c])) 33428 // result: (Mul64 (Const64 <t> [c*d]) x) 33429 for { 33430 _ = v.Args[1] 33431 v_0 := v.Args[0] 33432 if v_0.Op != OpMul64 { 33433 break 33434 } 33435 _ = v_0.Args[1] 33436 x := v_0.Args[0] 33437 v_0_1 := v_0.Args[1] 33438 if v_0_1.Op != OpConst64 { 33439 break 33440 } 33441 t := v_0_1.Type 33442 d := v_0_1.AuxInt 33443 v_1 := v.Args[1] 33444 if v_1.Op != OpConst64 || v_1.Type != t { 33445 break 33446 } 33447 c := v_1.AuxInt 33448 v.reset(OpMul64) 33449 v0 := b.NewValue0(v.Pos, OpConst64, t) 33450 v0.AuxInt = c * d 33451 v.AddArg(v0) 33452 v.AddArg(x) 33453 return true 33454 } 33455 return false 33456 } 33457 func rewriteValuegeneric_OpMul64F_0(v *Value) bool { 33458 // match: (Mul64F (Const64F [c]) (Const64F [d])) 33459 // result: (Const64F [auxFrom64F(auxTo64F(c) * auxTo64F(d))]) 33460 for { 33461 _ = v.Args[1] 33462 v_0 := v.Args[0] 33463 if v_0.Op != OpConst64F { 33464 break 33465 } 33466 c := v_0.AuxInt 33467 v_1 := v.Args[1] 33468 if v_1.Op != OpConst64F { 33469 break 33470 } 33471 d := v_1.AuxInt 33472 v.reset(OpConst64F) 33473 v.AuxInt = auxFrom64F(auxTo64F(c) * auxTo64F(d)) 33474 return true 33475 } 33476 // match: (Mul64F (Const64F [d]) (Const64F [c])) 33477 // result: (Const64F [auxFrom64F(auxTo64F(c) * auxTo64F(d))]) 33478 for { 33479 _ = v.Args[1] 33480 v_0 := v.Args[0] 33481 if v_0.Op != OpConst64F { 33482 break 33483 } 33484 d := v_0.AuxInt 33485 v_1 := v.Args[1] 33486 if v_1.Op != OpConst64F { 33487 break 33488 } 33489 c := v_1.AuxInt 33490 v.reset(OpConst64F) 33491 v.AuxInt = auxFrom64F(auxTo64F(c) * auxTo64F(d)) 33492 return true 33493 } 33494 // match: (Mul64F x (Const64F [auxFrom64F(1)])) 33495 // result: x 33496 for { 33497 _ = v.Args[1] 33498 x := v.Args[0] 33499 v_1 := v.Args[1] 33500 if v_1.Op != OpConst64F || v_1.AuxInt != auxFrom64F(1) { 33501 break 33502 } 33503 v.reset(OpCopy) 33504 v.Type = x.Type 33505 v.AddArg(x) 33506 return true 33507 } 33508 // match: (Mul64F (Const64F [auxFrom64F(1)]) x) 33509 // result: x 33510 for { 33511 x := v.Args[1] 33512 v_0 := v.Args[0] 33513 if v_0.Op != OpConst64F || v_0.AuxInt != auxFrom64F(1) { 33514 break 33515 } 33516 v.reset(OpCopy) 33517 v.Type = x.Type 33518 v.AddArg(x) 33519 return true 33520 } 33521 // match: (Mul64F x (Const64F [auxFrom64F(-1)])) 33522 // result: (Neg64F x) 33523 for { 33524 _ = v.Args[1] 33525 x := v.Args[0] 33526 v_1 := v.Args[1] 33527 if v_1.Op != OpConst64F || v_1.AuxInt != auxFrom64F(-1) { 33528 break 33529 } 33530 v.reset(OpNeg64F) 33531 v.AddArg(x) 33532 return true 33533 } 33534 // match: (Mul64F (Const64F [auxFrom64F(-1)]) x) 33535 // result: (Neg64F x) 33536 for { 33537 x := v.Args[1] 33538 v_0 := v.Args[0] 33539 if v_0.Op != OpConst64F || v_0.AuxInt != auxFrom64F(-1) { 33540 break 33541 } 33542 v.reset(OpNeg64F) 33543 v.AddArg(x) 33544 return true 33545 } 33546 // match: (Mul64F x (Const64F [auxFrom64F(2)])) 33547 // result: (Add64F x x) 33548 for { 33549 _ = v.Args[1] 33550 x := v.Args[0] 33551 v_1 := v.Args[1] 33552 if v_1.Op != OpConst64F || v_1.AuxInt != auxFrom64F(2) { 33553 break 33554 } 33555 v.reset(OpAdd64F) 33556 v.AddArg(x) 33557 v.AddArg(x) 33558 return true 33559 } 33560 // match: (Mul64F (Const64F [auxFrom64F(2)]) x) 33561 // result: (Add64F x x) 33562 for { 33563 x := v.Args[1] 33564 v_0 := v.Args[0] 33565 if v_0.Op != OpConst64F || v_0.AuxInt != auxFrom64F(2) { 33566 break 33567 } 33568 v.reset(OpAdd64F) 33569 v.AddArg(x) 33570 v.AddArg(x) 33571 return true 33572 } 33573 return false 33574 } 33575 func rewriteValuegeneric_OpMul8_0(v *Value) bool { 33576 b := v.Block 33577 typ := &b.Func.Config.Types 33578 // match: (Mul8 (Const8 [c]) (Const8 [d])) 33579 // result: (Const8 [int64(int8(c*d))]) 33580 for { 33581 _ = v.Args[1] 33582 v_0 := v.Args[0] 33583 if v_0.Op != OpConst8 { 33584 break 33585 } 33586 c := v_0.AuxInt 33587 v_1 := v.Args[1] 33588 if v_1.Op != OpConst8 { 33589 break 33590 } 33591 d := v_1.AuxInt 33592 v.reset(OpConst8) 33593 v.AuxInt = int64(int8(c * d)) 33594 return true 33595 } 33596 // match: (Mul8 (Const8 [d]) (Const8 [c])) 33597 // result: (Const8 [int64(int8(c*d))]) 33598 for { 33599 _ = v.Args[1] 33600 v_0 := v.Args[0] 33601 if v_0.Op != OpConst8 { 33602 break 33603 } 33604 d := v_0.AuxInt 33605 v_1 := v.Args[1] 33606 if v_1.Op != OpConst8 { 33607 break 33608 } 33609 c := v_1.AuxInt 33610 v.reset(OpConst8) 33611 v.AuxInt = int64(int8(c * d)) 33612 return true 33613 } 33614 // match: (Mul8 (Const8 [1]) x) 33615 // result: x 33616 for { 33617 x := v.Args[1] 33618 v_0 := v.Args[0] 33619 if v_0.Op != OpConst8 || v_0.AuxInt != 1 { 33620 break 33621 } 33622 v.reset(OpCopy) 33623 v.Type = x.Type 33624 v.AddArg(x) 33625 return true 33626 } 33627 // match: (Mul8 x (Const8 [1])) 33628 // result: x 33629 for { 33630 _ = v.Args[1] 33631 x := v.Args[0] 33632 v_1 := v.Args[1] 33633 if v_1.Op != OpConst8 || v_1.AuxInt != 1 { 33634 break 33635 } 33636 v.reset(OpCopy) 33637 v.Type = x.Type 33638 v.AddArg(x) 33639 return true 33640 } 33641 // match: (Mul8 (Const8 [-1]) x) 33642 // result: (Neg8 x) 33643 for { 33644 x := v.Args[1] 33645 v_0 := v.Args[0] 33646 if v_0.Op != OpConst8 || v_0.AuxInt != -1 { 33647 break 33648 } 33649 v.reset(OpNeg8) 33650 v.AddArg(x) 33651 return true 33652 } 33653 // match: (Mul8 x (Const8 [-1])) 33654 // result: (Neg8 x) 33655 for { 33656 _ = v.Args[1] 33657 x := v.Args[0] 33658 v_1 := v.Args[1] 33659 if v_1.Op != OpConst8 || v_1.AuxInt != -1 { 33660 break 33661 } 33662 v.reset(OpNeg8) 33663 v.AddArg(x) 33664 return true 33665 } 33666 // match: (Mul8 <t> n (Const8 [c])) 33667 // cond: isPowerOfTwo(c) 33668 // result: (Lsh8x64 <t> n (Const64 <typ.UInt64> [log2(c)])) 33669 for { 33670 t := v.Type 33671 _ = v.Args[1] 33672 n := v.Args[0] 33673 v_1 := v.Args[1] 33674 if v_1.Op != OpConst8 { 33675 break 33676 } 33677 c := v_1.AuxInt 33678 if !(isPowerOfTwo(c)) { 33679 break 33680 } 33681 v.reset(OpLsh8x64) 33682 v.Type = t 33683 v.AddArg(n) 33684 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 33685 v0.AuxInt = log2(c) 33686 v.AddArg(v0) 33687 return true 33688 } 33689 // match: (Mul8 <t> (Const8 [c]) n) 33690 // cond: isPowerOfTwo(c) 33691 // result: (Lsh8x64 <t> n (Const64 <typ.UInt64> [log2(c)])) 33692 for { 33693 t := v.Type 33694 n := v.Args[1] 33695 v_0 := v.Args[0] 33696 if v_0.Op != OpConst8 { 33697 break 33698 } 33699 c := v_0.AuxInt 33700 if !(isPowerOfTwo(c)) { 33701 break 33702 } 33703 v.reset(OpLsh8x64) 33704 v.Type = t 33705 v.AddArg(n) 33706 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 33707 v0.AuxInt = log2(c) 33708 v.AddArg(v0) 33709 return true 33710 } 33711 // match: (Mul8 <t> n (Const8 [c])) 33712 // cond: t.IsSigned() && isPowerOfTwo(-c) 33713 // result: (Neg8 (Lsh8x64 <t> n (Const64 <typ.UInt64> [log2(-c)]))) 33714 for { 33715 t := v.Type 33716 _ = v.Args[1] 33717 n := v.Args[0] 33718 v_1 := v.Args[1] 33719 if v_1.Op != OpConst8 { 33720 break 33721 } 33722 c := v_1.AuxInt 33723 if !(t.IsSigned() && isPowerOfTwo(-c)) { 33724 break 33725 } 33726 v.reset(OpNeg8) 33727 v0 := b.NewValue0(v.Pos, OpLsh8x64, t) 33728 v0.AddArg(n) 33729 v1 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 33730 v1.AuxInt = log2(-c) 33731 v0.AddArg(v1) 33732 v.AddArg(v0) 33733 return true 33734 } 33735 // match: (Mul8 <t> (Const8 [c]) n) 33736 // cond: t.IsSigned() && isPowerOfTwo(-c) 33737 // result: (Neg8 (Lsh8x64 <t> n (Const64 <typ.UInt64> [log2(-c)]))) 33738 for { 33739 t := v.Type 33740 n := v.Args[1] 33741 v_0 := v.Args[0] 33742 if v_0.Op != OpConst8 { 33743 break 33744 } 33745 c := v_0.AuxInt 33746 if !(t.IsSigned() && isPowerOfTwo(-c)) { 33747 break 33748 } 33749 v.reset(OpNeg8) 33750 v0 := b.NewValue0(v.Pos, OpLsh8x64, t) 33751 v0.AddArg(n) 33752 v1 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 33753 v1.AuxInt = log2(-c) 33754 v0.AddArg(v1) 33755 v.AddArg(v0) 33756 return true 33757 } 33758 return false 33759 } 33760 func rewriteValuegeneric_OpMul8_10(v *Value) bool { 33761 b := v.Block 33762 // match: (Mul8 (Const8 [0]) _) 33763 // result: (Const8 [0]) 33764 for { 33765 _ = v.Args[1] 33766 v_0 := v.Args[0] 33767 if v_0.Op != OpConst8 || v_0.AuxInt != 0 { 33768 break 33769 } 33770 v.reset(OpConst8) 33771 v.AuxInt = 0 33772 return true 33773 } 33774 // match: (Mul8 _ (Const8 [0])) 33775 // result: (Const8 [0]) 33776 for { 33777 _ = v.Args[1] 33778 v_1 := v.Args[1] 33779 if v_1.Op != OpConst8 || v_1.AuxInt != 0 { 33780 break 33781 } 33782 v.reset(OpConst8) 33783 v.AuxInt = 0 33784 return true 33785 } 33786 // match: (Mul8 (Const8 <t> [c]) (Mul8 (Const8 <t> [d]) x)) 33787 // result: (Mul8 (Const8 <t> [int64(int8(c*d))]) x) 33788 for { 33789 _ = v.Args[1] 33790 v_0 := v.Args[0] 33791 if v_0.Op != OpConst8 { 33792 break 33793 } 33794 t := v_0.Type 33795 c := v_0.AuxInt 33796 v_1 := v.Args[1] 33797 if v_1.Op != OpMul8 { 33798 break 33799 } 33800 x := v_1.Args[1] 33801 v_1_0 := v_1.Args[0] 33802 if v_1_0.Op != OpConst8 || v_1_0.Type != t { 33803 break 33804 } 33805 d := v_1_0.AuxInt 33806 v.reset(OpMul8) 33807 v0 := b.NewValue0(v.Pos, OpConst8, t) 33808 v0.AuxInt = int64(int8(c * d)) 33809 v.AddArg(v0) 33810 v.AddArg(x) 33811 return true 33812 } 33813 // match: (Mul8 (Const8 <t> [c]) (Mul8 x (Const8 <t> [d]))) 33814 // result: (Mul8 (Const8 <t> [int64(int8(c*d))]) x) 33815 for { 33816 _ = v.Args[1] 33817 v_0 := v.Args[0] 33818 if v_0.Op != OpConst8 { 33819 break 33820 } 33821 t := v_0.Type 33822 c := v_0.AuxInt 33823 v_1 := v.Args[1] 33824 if v_1.Op != OpMul8 { 33825 break 33826 } 33827 _ = v_1.Args[1] 33828 x := v_1.Args[0] 33829 v_1_1 := v_1.Args[1] 33830 if v_1_1.Op != OpConst8 || v_1_1.Type != t { 33831 break 33832 } 33833 d := v_1_1.AuxInt 33834 v.reset(OpMul8) 33835 v0 := b.NewValue0(v.Pos, OpConst8, t) 33836 v0.AuxInt = int64(int8(c * d)) 33837 v.AddArg(v0) 33838 v.AddArg(x) 33839 return true 33840 } 33841 // match: (Mul8 (Mul8 (Const8 <t> [d]) x) (Const8 <t> [c])) 33842 // result: (Mul8 (Const8 <t> [int64(int8(c*d))]) x) 33843 for { 33844 _ = v.Args[1] 33845 v_0 := v.Args[0] 33846 if v_0.Op != OpMul8 { 33847 break 33848 } 33849 x := v_0.Args[1] 33850 v_0_0 := v_0.Args[0] 33851 if v_0_0.Op != OpConst8 { 33852 break 33853 } 33854 t := v_0_0.Type 33855 d := v_0_0.AuxInt 33856 v_1 := v.Args[1] 33857 if v_1.Op != OpConst8 || v_1.Type != t { 33858 break 33859 } 33860 c := v_1.AuxInt 33861 v.reset(OpMul8) 33862 v0 := b.NewValue0(v.Pos, OpConst8, t) 33863 v0.AuxInt = int64(int8(c * d)) 33864 v.AddArg(v0) 33865 v.AddArg(x) 33866 return true 33867 } 33868 // match: (Mul8 (Mul8 x (Const8 <t> [d])) (Const8 <t> [c])) 33869 // result: (Mul8 (Const8 <t> [int64(int8(c*d))]) x) 33870 for { 33871 _ = v.Args[1] 33872 v_0 := v.Args[0] 33873 if v_0.Op != OpMul8 { 33874 break 33875 } 33876 _ = v_0.Args[1] 33877 x := v_0.Args[0] 33878 v_0_1 := v_0.Args[1] 33879 if v_0_1.Op != OpConst8 { 33880 break 33881 } 33882 t := v_0_1.Type 33883 d := v_0_1.AuxInt 33884 v_1 := v.Args[1] 33885 if v_1.Op != OpConst8 || v_1.Type != t { 33886 break 33887 } 33888 c := v_1.AuxInt 33889 v.reset(OpMul8) 33890 v0 := b.NewValue0(v.Pos, OpConst8, t) 33891 v0.AuxInt = int64(int8(c * d)) 33892 v.AddArg(v0) 33893 v.AddArg(x) 33894 return true 33895 } 33896 return false 33897 } 33898 func rewriteValuegeneric_OpNeg16_0(v *Value) bool { 33899 b := v.Block 33900 // match: (Neg16 (Const16 [c])) 33901 // result: (Const16 [int64(-int16(c))]) 33902 for { 33903 v_0 := v.Args[0] 33904 if v_0.Op != OpConst16 { 33905 break 33906 } 33907 c := v_0.AuxInt 33908 v.reset(OpConst16) 33909 v.AuxInt = int64(-int16(c)) 33910 return true 33911 } 33912 // match: (Neg16 (Sub16 x y)) 33913 // result: (Sub16 y x) 33914 for { 33915 v_0 := v.Args[0] 33916 if v_0.Op != OpSub16 { 33917 break 33918 } 33919 y := v_0.Args[1] 33920 x := v_0.Args[0] 33921 v.reset(OpSub16) 33922 v.AddArg(y) 33923 v.AddArg(x) 33924 return true 33925 } 33926 // match: (Neg16 (Neg16 x)) 33927 // result: x 33928 for { 33929 v_0 := v.Args[0] 33930 if v_0.Op != OpNeg16 { 33931 break 33932 } 33933 x := v_0.Args[0] 33934 v.reset(OpCopy) 33935 v.Type = x.Type 33936 v.AddArg(x) 33937 return true 33938 } 33939 // match: (Neg16 <t> (Com16 x)) 33940 // result: (Add16 (Const16 <t> [1]) x) 33941 for { 33942 t := v.Type 33943 v_0 := v.Args[0] 33944 if v_0.Op != OpCom16 { 33945 break 33946 } 33947 x := v_0.Args[0] 33948 v.reset(OpAdd16) 33949 v0 := b.NewValue0(v.Pos, OpConst16, t) 33950 v0.AuxInt = 1 33951 v.AddArg(v0) 33952 v.AddArg(x) 33953 return true 33954 } 33955 return false 33956 } 33957 func rewriteValuegeneric_OpNeg32_0(v *Value) bool { 33958 b := v.Block 33959 // match: (Neg32 (Const32 [c])) 33960 // result: (Const32 [int64(-int32(c))]) 33961 for { 33962 v_0 := v.Args[0] 33963 if v_0.Op != OpConst32 { 33964 break 33965 } 33966 c := v_0.AuxInt 33967 v.reset(OpConst32) 33968 v.AuxInt = int64(-int32(c)) 33969 return true 33970 } 33971 // match: (Neg32 (Sub32 x y)) 33972 // result: (Sub32 y x) 33973 for { 33974 v_0 := v.Args[0] 33975 if v_0.Op != OpSub32 { 33976 break 33977 } 33978 y := v_0.Args[1] 33979 x := v_0.Args[0] 33980 v.reset(OpSub32) 33981 v.AddArg(y) 33982 v.AddArg(x) 33983 return true 33984 } 33985 // match: (Neg32 (Neg32 x)) 33986 // result: x 33987 for { 33988 v_0 := v.Args[0] 33989 if v_0.Op != OpNeg32 { 33990 break 33991 } 33992 x := v_0.Args[0] 33993 v.reset(OpCopy) 33994 v.Type = x.Type 33995 v.AddArg(x) 33996 return true 33997 } 33998 // match: (Neg32 <t> (Com32 x)) 33999 // result: (Add32 (Const32 <t> [1]) x) 34000 for { 34001 t := v.Type 34002 v_0 := v.Args[0] 34003 if v_0.Op != OpCom32 { 34004 break 34005 } 34006 x := v_0.Args[0] 34007 v.reset(OpAdd32) 34008 v0 := b.NewValue0(v.Pos, OpConst32, t) 34009 v0.AuxInt = 1 34010 v.AddArg(v0) 34011 v.AddArg(x) 34012 return true 34013 } 34014 return false 34015 } 34016 func rewriteValuegeneric_OpNeg32F_0(v *Value) bool { 34017 // match: (Neg32F (Const32F [c])) 34018 // cond: auxTo32F(c) != 0 34019 // result: (Const32F [auxFrom32F(-auxTo32F(c))]) 34020 for { 34021 v_0 := v.Args[0] 34022 if v_0.Op != OpConst32F { 34023 break 34024 } 34025 c := v_0.AuxInt 34026 if !(auxTo32F(c) != 0) { 34027 break 34028 } 34029 v.reset(OpConst32F) 34030 v.AuxInt = auxFrom32F(-auxTo32F(c)) 34031 return true 34032 } 34033 return false 34034 } 34035 func rewriteValuegeneric_OpNeg64_0(v *Value) bool { 34036 b := v.Block 34037 // match: (Neg64 (Const64 [c])) 34038 // result: (Const64 [-c]) 34039 for { 34040 v_0 := v.Args[0] 34041 if v_0.Op != OpConst64 { 34042 break 34043 } 34044 c := v_0.AuxInt 34045 v.reset(OpConst64) 34046 v.AuxInt = -c 34047 return true 34048 } 34049 // match: (Neg64 (Sub64 x y)) 34050 // result: (Sub64 y x) 34051 for { 34052 v_0 := v.Args[0] 34053 if v_0.Op != OpSub64 { 34054 break 34055 } 34056 y := v_0.Args[1] 34057 x := v_0.Args[0] 34058 v.reset(OpSub64) 34059 v.AddArg(y) 34060 v.AddArg(x) 34061 return true 34062 } 34063 // match: (Neg64 (Neg64 x)) 34064 // result: x 34065 for { 34066 v_0 := v.Args[0] 34067 if v_0.Op != OpNeg64 { 34068 break 34069 } 34070 x := v_0.Args[0] 34071 v.reset(OpCopy) 34072 v.Type = x.Type 34073 v.AddArg(x) 34074 return true 34075 } 34076 // match: (Neg64 <t> (Com64 x)) 34077 // result: (Add64 (Const64 <t> [1]) x) 34078 for { 34079 t := v.Type 34080 v_0 := v.Args[0] 34081 if v_0.Op != OpCom64 { 34082 break 34083 } 34084 x := v_0.Args[0] 34085 v.reset(OpAdd64) 34086 v0 := b.NewValue0(v.Pos, OpConst64, t) 34087 v0.AuxInt = 1 34088 v.AddArg(v0) 34089 v.AddArg(x) 34090 return true 34091 } 34092 return false 34093 } 34094 func rewriteValuegeneric_OpNeg64F_0(v *Value) bool { 34095 // match: (Neg64F (Const64F [c])) 34096 // cond: auxTo64F(c) != 0 34097 // result: (Const64F [auxFrom64F(-auxTo64F(c))]) 34098 for { 34099 v_0 := v.Args[0] 34100 if v_0.Op != OpConst64F { 34101 break 34102 } 34103 c := v_0.AuxInt 34104 if !(auxTo64F(c) != 0) { 34105 break 34106 } 34107 v.reset(OpConst64F) 34108 v.AuxInt = auxFrom64F(-auxTo64F(c)) 34109 return true 34110 } 34111 return false 34112 } 34113 func rewriteValuegeneric_OpNeg8_0(v *Value) bool { 34114 b := v.Block 34115 // match: (Neg8 (Const8 [c])) 34116 // result: (Const8 [int64( -int8(c))]) 34117 for { 34118 v_0 := v.Args[0] 34119 if v_0.Op != OpConst8 { 34120 break 34121 } 34122 c := v_0.AuxInt 34123 v.reset(OpConst8) 34124 v.AuxInt = int64(-int8(c)) 34125 return true 34126 } 34127 // match: (Neg8 (Sub8 x y)) 34128 // result: (Sub8 y x) 34129 for { 34130 v_0 := v.Args[0] 34131 if v_0.Op != OpSub8 { 34132 break 34133 } 34134 y := v_0.Args[1] 34135 x := v_0.Args[0] 34136 v.reset(OpSub8) 34137 v.AddArg(y) 34138 v.AddArg(x) 34139 return true 34140 } 34141 // match: (Neg8 (Neg8 x)) 34142 // result: x 34143 for { 34144 v_0 := v.Args[0] 34145 if v_0.Op != OpNeg8 { 34146 break 34147 } 34148 x := v_0.Args[0] 34149 v.reset(OpCopy) 34150 v.Type = x.Type 34151 v.AddArg(x) 34152 return true 34153 } 34154 // match: (Neg8 <t> (Com8 x)) 34155 // result: (Add8 (Const8 <t> [1]) x) 34156 for { 34157 t := v.Type 34158 v_0 := v.Args[0] 34159 if v_0.Op != OpCom8 { 34160 break 34161 } 34162 x := v_0.Args[0] 34163 v.reset(OpAdd8) 34164 v0 := b.NewValue0(v.Pos, OpConst8, t) 34165 v0.AuxInt = 1 34166 v.AddArg(v0) 34167 v.AddArg(x) 34168 return true 34169 } 34170 return false 34171 } 34172 func rewriteValuegeneric_OpNeq16_0(v *Value) bool { 34173 b := v.Block 34174 typ := &b.Func.Config.Types 34175 // match: (Neq16 x x) 34176 // result: (ConstBool [0]) 34177 for { 34178 x := v.Args[1] 34179 if x != v.Args[0] { 34180 break 34181 } 34182 v.reset(OpConstBool) 34183 v.AuxInt = 0 34184 return true 34185 } 34186 // match: (Neq16 (Const16 <t> [c]) (Add16 (Const16 <t> [d]) x)) 34187 // result: (Neq16 (Const16 <t> [int64(int16(c-d))]) x) 34188 for { 34189 _ = v.Args[1] 34190 v_0 := v.Args[0] 34191 if v_0.Op != OpConst16 { 34192 break 34193 } 34194 t := v_0.Type 34195 c := v_0.AuxInt 34196 v_1 := v.Args[1] 34197 if v_1.Op != OpAdd16 { 34198 break 34199 } 34200 x := v_1.Args[1] 34201 v_1_0 := v_1.Args[0] 34202 if v_1_0.Op != OpConst16 || v_1_0.Type != t { 34203 break 34204 } 34205 d := v_1_0.AuxInt 34206 v.reset(OpNeq16) 34207 v0 := b.NewValue0(v.Pos, OpConst16, t) 34208 v0.AuxInt = int64(int16(c - d)) 34209 v.AddArg(v0) 34210 v.AddArg(x) 34211 return true 34212 } 34213 // match: (Neq16 (Const16 <t> [c]) (Add16 x (Const16 <t> [d]))) 34214 // result: (Neq16 (Const16 <t> [int64(int16(c-d))]) x) 34215 for { 34216 _ = v.Args[1] 34217 v_0 := v.Args[0] 34218 if v_0.Op != OpConst16 { 34219 break 34220 } 34221 t := v_0.Type 34222 c := v_0.AuxInt 34223 v_1 := v.Args[1] 34224 if v_1.Op != OpAdd16 { 34225 break 34226 } 34227 _ = v_1.Args[1] 34228 x := v_1.Args[0] 34229 v_1_1 := v_1.Args[1] 34230 if v_1_1.Op != OpConst16 || v_1_1.Type != t { 34231 break 34232 } 34233 d := v_1_1.AuxInt 34234 v.reset(OpNeq16) 34235 v0 := b.NewValue0(v.Pos, OpConst16, t) 34236 v0.AuxInt = int64(int16(c - d)) 34237 v.AddArg(v0) 34238 v.AddArg(x) 34239 return true 34240 } 34241 // match: (Neq16 (Add16 (Const16 <t> [d]) x) (Const16 <t> [c])) 34242 // result: (Neq16 (Const16 <t> [int64(int16(c-d))]) x) 34243 for { 34244 _ = v.Args[1] 34245 v_0 := v.Args[0] 34246 if v_0.Op != OpAdd16 { 34247 break 34248 } 34249 x := v_0.Args[1] 34250 v_0_0 := v_0.Args[0] 34251 if v_0_0.Op != OpConst16 { 34252 break 34253 } 34254 t := v_0_0.Type 34255 d := v_0_0.AuxInt 34256 v_1 := v.Args[1] 34257 if v_1.Op != OpConst16 || v_1.Type != t { 34258 break 34259 } 34260 c := v_1.AuxInt 34261 v.reset(OpNeq16) 34262 v0 := b.NewValue0(v.Pos, OpConst16, t) 34263 v0.AuxInt = int64(int16(c - d)) 34264 v.AddArg(v0) 34265 v.AddArg(x) 34266 return true 34267 } 34268 // match: (Neq16 (Add16 x (Const16 <t> [d])) (Const16 <t> [c])) 34269 // result: (Neq16 (Const16 <t> [int64(int16(c-d))]) x) 34270 for { 34271 _ = v.Args[1] 34272 v_0 := v.Args[0] 34273 if v_0.Op != OpAdd16 { 34274 break 34275 } 34276 _ = v_0.Args[1] 34277 x := v_0.Args[0] 34278 v_0_1 := v_0.Args[1] 34279 if v_0_1.Op != OpConst16 { 34280 break 34281 } 34282 t := v_0_1.Type 34283 d := v_0_1.AuxInt 34284 v_1 := v.Args[1] 34285 if v_1.Op != OpConst16 || v_1.Type != t { 34286 break 34287 } 34288 c := v_1.AuxInt 34289 v.reset(OpNeq16) 34290 v0 := b.NewValue0(v.Pos, OpConst16, t) 34291 v0.AuxInt = int64(int16(c - d)) 34292 v.AddArg(v0) 34293 v.AddArg(x) 34294 return true 34295 } 34296 // match: (Neq16 (Const16 [c]) (Const16 [d])) 34297 // result: (ConstBool [b2i(c != d)]) 34298 for { 34299 _ = v.Args[1] 34300 v_0 := v.Args[0] 34301 if v_0.Op != OpConst16 { 34302 break 34303 } 34304 c := v_0.AuxInt 34305 v_1 := v.Args[1] 34306 if v_1.Op != OpConst16 { 34307 break 34308 } 34309 d := v_1.AuxInt 34310 v.reset(OpConstBool) 34311 v.AuxInt = b2i(c != d) 34312 return true 34313 } 34314 // match: (Neq16 (Const16 [d]) (Const16 [c])) 34315 // result: (ConstBool [b2i(c != d)]) 34316 for { 34317 _ = v.Args[1] 34318 v_0 := v.Args[0] 34319 if v_0.Op != OpConst16 { 34320 break 34321 } 34322 d := v_0.AuxInt 34323 v_1 := v.Args[1] 34324 if v_1.Op != OpConst16 { 34325 break 34326 } 34327 c := v_1.AuxInt 34328 v.reset(OpConstBool) 34329 v.AuxInt = b2i(c != d) 34330 return true 34331 } 34332 // match: (Neq16 n (Lsh16x64 (Rsh16x64 (Add16 <t> n (Rsh16Ux64 <t> (Rsh16x64 <t> n (Const64 <typ.UInt64> [15])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k]))) 34333 // cond: k > 0 && k < 15 && kbar == 16 - k 34334 // result: (Neq16 (And16 <t> n (Const16 <t> [int64(1<<uint(k)-1)])) (Const16 <t> [0])) 34335 for { 34336 _ = v.Args[1] 34337 n := v.Args[0] 34338 v_1 := v.Args[1] 34339 if v_1.Op != OpLsh16x64 { 34340 break 34341 } 34342 _ = v_1.Args[1] 34343 v_1_0 := v_1.Args[0] 34344 if v_1_0.Op != OpRsh16x64 { 34345 break 34346 } 34347 _ = v_1_0.Args[1] 34348 v_1_0_0 := v_1_0.Args[0] 34349 if v_1_0_0.Op != OpAdd16 { 34350 break 34351 } 34352 t := v_1_0_0.Type 34353 _ = v_1_0_0.Args[1] 34354 if n != v_1_0_0.Args[0] { 34355 break 34356 } 34357 v_1_0_0_1 := v_1_0_0.Args[1] 34358 if v_1_0_0_1.Op != OpRsh16Ux64 || v_1_0_0_1.Type != t { 34359 break 34360 } 34361 _ = v_1_0_0_1.Args[1] 34362 v_1_0_0_1_0 := v_1_0_0_1.Args[0] 34363 if v_1_0_0_1_0.Op != OpRsh16x64 || v_1_0_0_1_0.Type != t { 34364 break 34365 } 34366 _ = v_1_0_0_1_0.Args[1] 34367 if n != v_1_0_0_1_0.Args[0] { 34368 break 34369 } 34370 v_1_0_0_1_0_1 := v_1_0_0_1_0.Args[1] 34371 if v_1_0_0_1_0_1.Op != OpConst64 || v_1_0_0_1_0_1.Type != typ.UInt64 || v_1_0_0_1_0_1.AuxInt != 15 { 34372 break 34373 } 34374 v_1_0_0_1_1 := v_1_0_0_1.Args[1] 34375 if v_1_0_0_1_1.Op != OpConst64 || v_1_0_0_1_1.Type != typ.UInt64 { 34376 break 34377 } 34378 kbar := v_1_0_0_1_1.AuxInt 34379 v_1_0_1 := v_1_0.Args[1] 34380 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 { 34381 break 34382 } 34383 k := v_1_0_1.AuxInt 34384 v_1_1 := v_1.Args[1] 34385 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || v_1_1.AuxInt != k || !(k > 0 && k < 15 && kbar == 16-k) { 34386 break 34387 } 34388 v.reset(OpNeq16) 34389 v0 := b.NewValue0(v.Pos, OpAnd16, t) 34390 v0.AddArg(n) 34391 v1 := b.NewValue0(v.Pos, OpConst16, t) 34392 v1.AuxInt = int64(1<<uint(k) - 1) 34393 v0.AddArg(v1) 34394 v.AddArg(v0) 34395 v2 := b.NewValue0(v.Pos, OpConst16, t) 34396 v2.AuxInt = 0 34397 v.AddArg(v2) 34398 return true 34399 } 34400 // match: (Neq16 n (Lsh16x64 (Rsh16x64 (Add16 <t> (Rsh16Ux64 <t> (Rsh16x64 <t> n (Const64 <typ.UInt64> [15])) (Const64 <typ.UInt64> [kbar])) n) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k]))) 34401 // cond: k > 0 && k < 15 && kbar == 16 - k 34402 // result: (Neq16 (And16 <t> n (Const16 <t> [int64(1<<uint(k)-1)])) (Const16 <t> [0])) 34403 for { 34404 _ = v.Args[1] 34405 n := v.Args[0] 34406 v_1 := v.Args[1] 34407 if v_1.Op != OpLsh16x64 { 34408 break 34409 } 34410 _ = v_1.Args[1] 34411 v_1_0 := v_1.Args[0] 34412 if v_1_0.Op != OpRsh16x64 { 34413 break 34414 } 34415 _ = v_1_0.Args[1] 34416 v_1_0_0 := v_1_0.Args[0] 34417 if v_1_0_0.Op != OpAdd16 { 34418 break 34419 } 34420 t := v_1_0_0.Type 34421 _ = v_1_0_0.Args[1] 34422 v_1_0_0_0 := v_1_0_0.Args[0] 34423 if v_1_0_0_0.Op != OpRsh16Ux64 || v_1_0_0_0.Type != t { 34424 break 34425 } 34426 _ = v_1_0_0_0.Args[1] 34427 v_1_0_0_0_0 := v_1_0_0_0.Args[0] 34428 if v_1_0_0_0_0.Op != OpRsh16x64 || v_1_0_0_0_0.Type != t { 34429 break 34430 } 34431 _ = v_1_0_0_0_0.Args[1] 34432 if n != v_1_0_0_0_0.Args[0] { 34433 break 34434 } 34435 v_1_0_0_0_0_1 := v_1_0_0_0_0.Args[1] 34436 if v_1_0_0_0_0_1.Op != OpConst64 || v_1_0_0_0_0_1.Type != typ.UInt64 || v_1_0_0_0_0_1.AuxInt != 15 { 34437 break 34438 } 34439 v_1_0_0_0_1 := v_1_0_0_0.Args[1] 34440 if v_1_0_0_0_1.Op != OpConst64 || v_1_0_0_0_1.Type != typ.UInt64 { 34441 break 34442 } 34443 kbar := v_1_0_0_0_1.AuxInt 34444 if n != v_1_0_0.Args[1] { 34445 break 34446 } 34447 v_1_0_1 := v_1_0.Args[1] 34448 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 { 34449 break 34450 } 34451 k := v_1_0_1.AuxInt 34452 v_1_1 := v_1.Args[1] 34453 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || v_1_1.AuxInt != k || !(k > 0 && k < 15 && kbar == 16-k) { 34454 break 34455 } 34456 v.reset(OpNeq16) 34457 v0 := b.NewValue0(v.Pos, OpAnd16, t) 34458 v0.AddArg(n) 34459 v1 := b.NewValue0(v.Pos, OpConst16, t) 34460 v1.AuxInt = int64(1<<uint(k) - 1) 34461 v0.AddArg(v1) 34462 v.AddArg(v0) 34463 v2 := b.NewValue0(v.Pos, OpConst16, t) 34464 v2.AuxInt = 0 34465 v.AddArg(v2) 34466 return true 34467 } 34468 // match: (Neq16 (Lsh16x64 (Rsh16x64 (Add16 <t> n (Rsh16Ux64 <t> (Rsh16x64 <t> n (Const64 <typ.UInt64> [15])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) n) 34469 // cond: k > 0 && k < 15 && kbar == 16 - k 34470 // result: (Neq16 (And16 <t> n (Const16 <t> [int64(1<<uint(k)-1)])) (Const16 <t> [0])) 34471 for { 34472 n := v.Args[1] 34473 v_0 := v.Args[0] 34474 if v_0.Op != OpLsh16x64 { 34475 break 34476 } 34477 _ = v_0.Args[1] 34478 v_0_0 := v_0.Args[0] 34479 if v_0_0.Op != OpRsh16x64 { 34480 break 34481 } 34482 _ = v_0_0.Args[1] 34483 v_0_0_0 := v_0_0.Args[0] 34484 if v_0_0_0.Op != OpAdd16 { 34485 break 34486 } 34487 t := v_0_0_0.Type 34488 _ = v_0_0_0.Args[1] 34489 if n != v_0_0_0.Args[0] { 34490 break 34491 } 34492 v_0_0_0_1 := v_0_0_0.Args[1] 34493 if v_0_0_0_1.Op != OpRsh16Ux64 || v_0_0_0_1.Type != t { 34494 break 34495 } 34496 _ = v_0_0_0_1.Args[1] 34497 v_0_0_0_1_0 := v_0_0_0_1.Args[0] 34498 if v_0_0_0_1_0.Op != OpRsh16x64 || v_0_0_0_1_0.Type != t { 34499 break 34500 } 34501 _ = v_0_0_0_1_0.Args[1] 34502 if n != v_0_0_0_1_0.Args[0] { 34503 break 34504 } 34505 v_0_0_0_1_0_1 := v_0_0_0_1_0.Args[1] 34506 if v_0_0_0_1_0_1.Op != OpConst64 || v_0_0_0_1_0_1.Type != typ.UInt64 || v_0_0_0_1_0_1.AuxInt != 15 { 34507 break 34508 } 34509 v_0_0_0_1_1 := v_0_0_0_1.Args[1] 34510 if v_0_0_0_1_1.Op != OpConst64 || v_0_0_0_1_1.Type != typ.UInt64 { 34511 break 34512 } 34513 kbar := v_0_0_0_1_1.AuxInt 34514 v_0_0_1 := v_0_0.Args[1] 34515 if v_0_0_1.Op != OpConst64 || v_0_0_1.Type != typ.UInt64 { 34516 break 34517 } 34518 k := v_0_0_1.AuxInt 34519 v_0_1 := v_0.Args[1] 34520 if v_0_1.Op != OpConst64 || v_0_1.Type != typ.UInt64 || v_0_1.AuxInt != k || !(k > 0 && k < 15 && kbar == 16-k) { 34521 break 34522 } 34523 v.reset(OpNeq16) 34524 v0 := b.NewValue0(v.Pos, OpAnd16, t) 34525 v0.AddArg(n) 34526 v1 := b.NewValue0(v.Pos, OpConst16, t) 34527 v1.AuxInt = int64(1<<uint(k) - 1) 34528 v0.AddArg(v1) 34529 v.AddArg(v0) 34530 v2 := b.NewValue0(v.Pos, OpConst16, t) 34531 v2.AuxInt = 0 34532 v.AddArg(v2) 34533 return true 34534 } 34535 return false 34536 } 34537 func rewriteValuegeneric_OpNeq16_10(v *Value) bool { 34538 b := v.Block 34539 typ := &b.Func.Config.Types 34540 // match: (Neq16 (Lsh16x64 (Rsh16x64 (Add16 <t> (Rsh16Ux64 <t> (Rsh16x64 <t> n (Const64 <typ.UInt64> [15])) (Const64 <typ.UInt64> [kbar])) n) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) n) 34541 // cond: k > 0 && k < 15 && kbar == 16 - k 34542 // result: (Neq16 (And16 <t> n (Const16 <t> [int64(1<<uint(k)-1)])) (Const16 <t> [0])) 34543 for { 34544 n := v.Args[1] 34545 v_0 := v.Args[0] 34546 if v_0.Op != OpLsh16x64 { 34547 break 34548 } 34549 _ = v_0.Args[1] 34550 v_0_0 := v_0.Args[0] 34551 if v_0_0.Op != OpRsh16x64 { 34552 break 34553 } 34554 _ = v_0_0.Args[1] 34555 v_0_0_0 := v_0_0.Args[0] 34556 if v_0_0_0.Op != OpAdd16 { 34557 break 34558 } 34559 t := v_0_0_0.Type 34560 _ = v_0_0_0.Args[1] 34561 v_0_0_0_0 := v_0_0_0.Args[0] 34562 if v_0_0_0_0.Op != OpRsh16Ux64 || v_0_0_0_0.Type != t { 34563 break 34564 } 34565 _ = v_0_0_0_0.Args[1] 34566 v_0_0_0_0_0 := v_0_0_0_0.Args[0] 34567 if v_0_0_0_0_0.Op != OpRsh16x64 || v_0_0_0_0_0.Type != t { 34568 break 34569 } 34570 _ = v_0_0_0_0_0.Args[1] 34571 if n != v_0_0_0_0_0.Args[0] { 34572 break 34573 } 34574 v_0_0_0_0_0_1 := v_0_0_0_0_0.Args[1] 34575 if v_0_0_0_0_0_1.Op != OpConst64 || v_0_0_0_0_0_1.Type != typ.UInt64 || v_0_0_0_0_0_1.AuxInt != 15 { 34576 break 34577 } 34578 v_0_0_0_0_1 := v_0_0_0_0.Args[1] 34579 if v_0_0_0_0_1.Op != OpConst64 || v_0_0_0_0_1.Type != typ.UInt64 { 34580 break 34581 } 34582 kbar := v_0_0_0_0_1.AuxInt 34583 if n != v_0_0_0.Args[1] { 34584 break 34585 } 34586 v_0_0_1 := v_0_0.Args[1] 34587 if v_0_0_1.Op != OpConst64 || v_0_0_1.Type != typ.UInt64 { 34588 break 34589 } 34590 k := v_0_0_1.AuxInt 34591 v_0_1 := v_0.Args[1] 34592 if v_0_1.Op != OpConst64 || v_0_1.Type != typ.UInt64 || v_0_1.AuxInt != k || !(k > 0 && k < 15 && kbar == 16-k) { 34593 break 34594 } 34595 v.reset(OpNeq16) 34596 v0 := b.NewValue0(v.Pos, OpAnd16, t) 34597 v0.AddArg(n) 34598 v1 := b.NewValue0(v.Pos, OpConst16, t) 34599 v1.AuxInt = int64(1<<uint(k) - 1) 34600 v0.AddArg(v1) 34601 v.AddArg(v0) 34602 v2 := b.NewValue0(v.Pos, OpConst16, t) 34603 v2.AuxInt = 0 34604 v.AddArg(v2) 34605 return true 34606 } 34607 // match: (Neq16 s:(Sub16 x y) (Const16 [0])) 34608 // cond: s.Uses == 1 34609 // result: (Neq16 x y) 34610 for { 34611 _ = v.Args[1] 34612 s := v.Args[0] 34613 if s.Op != OpSub16 { 34614 break 34615 } 34616 y := s.Args[1] 34617 x := s.Args[0] 34618 v_1 := v.Args[1] 34619 if v_1.Op != OpConst16 || v_1.AuxInt != 0 || !(s.Uses == 1) { 34620 break 34621 } 34622 v.reset(OpNeq16) 34623 v.AddArg(x) 34624 v.AddArg(y) 34625 return true 34626 } 34627 // match: (Neq16 (Const16 [0]) s:(Sub16 x y)) 34628 // cond: s.Uses == 1 34629 // result: (Neq16 x y) 34630 for { 34631 _ = v.Args[1] 34632 v_0 := v.Args[0] 34633 if v_0.Op != OpConst16 || v_0.AuxInt != 0 { 34634 break 34635 } 34636 s := v.Args[1] 34637 if s.Op != OpSub16 { 34638 break 34639 } 34640 y := s.Args[1] 34641 x := s.Args[0] 34642 if !(s.Uses == 1) { 34643 break 34644 } 34645 v.reset(OpNeq16) 34646 v.AddArg(x) 34647 v.AddArg(y) 34648 return true 34649 } 34650 // match: (Neq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [y])) 34651 // cond: isPowerOfTwo(y) 34652 // result: (Eq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [0])) 34653 for { 34654 _ = v.Args[1] 34655 v_0 := v.Args[0] 34656 if v_0.Op != OpAnd16 { 34657 break 34658 } 34659 t := v_0.Type 34660 _ = v_0.Args[1] 34661 x := v_0.Args[0] 34662 v_0_1 := v_0.Args[1] 34663 if v_0_1.Op != OpConst16 || v_0_1.Type != t { 34664 break 34665 } 34666 y := v_0_1.AuxInt 34667 v_1 := v.Args[1] 34668 if v_1.Op != OpConst16 || v_1.Type != t || v_1.AuxInt != y || !(isPowerOfTwo(y)) { 34669 break 34670 } 34671 v.reset(OpEq16) 34672 v0 := b.NewValue0(v.Pos, OpAnd16, t) 34673 v0.AddArg(x) 34674 v1 := b.NewValue0(v.Pos, OpConst16, t) 34675 v1.AuxInt = y 34676 v0.AddArg(v1) 34677 v.AddArg(v0) 34678 v2 := b.NewValue0(v.Pos, OpConst16, t) 34679 v2.AuxInt = 0 34680 v.AddArg(v2) 34681 return true 34682 } 34683 // match: (Neq16 (And16 <t> (Const16 <t> [y]) x) (Const16 <t> [y])) 34684 // cond: isPowerOfTwo(y) 34685 // result: (Eq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [0])) 34686 for { 34687 _ = v.Args[1] 34688 v_0 := v.Args[0] 34689 if v_0.Op != OpAnd16 { 34690 break 34691 } 34692 t := v_0.Type 34693 x := v_0.Args[1] 34694 v_0_0 := v_0.Args[0] 34695 if v_0_0.Op != OpConst16 || v_0_0.Type != t { 34696 break 34697 } 34698 y := v_0_0.AuxInt 34699 v_1 := v.Args[1] 34700 if v_1.Op != OpConst16 || v_1.Type != t || v_1.AuxInt != y || !(isPowerOfTwo(y)) { 34701 break 34702 } 34703 v.reset(OpEq16) 34704 v0 := b.NewValue0(v.Pos, OpAnd16, t) 34705 v0.AddArg(x) 34706 v1 := b.NewValue0(v.Pos, OpConst16, t) 34707 v1.AuxInt = y 34708 v0.AddArg(v1) 34709 v.AddArg(v0) 34710 v2 := b.NewValue0(v.Pos, OpConst16, t) 34711 v2.AuxInt = 0 34712 v.AddArg(v2) 34713 return true 34714 } 34715 // match: (Neq16 (Const16 <t> [y]) (And16 <t> x (Const16 <t> [y]))) 34716 // cond: isPowerOfTwo(y) 34717 // result: (Eq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [0])) 34718 for { 34719 _ = v.Args[1] 34720 v_0 := v.Args[0] 34721 if v_0.Op != OpConst16 { 34722 break 34723 } 34724 t := v_0.Type 34725 y := v_0.AuxInt 34726 v_1 := v.Args[1] 34727 if v_1.Op != OpAnd16 || v_1.Type != t { 34728 break 34729 } 34730 _ = v_1.Args[1] 34731 x := v_1.Args[0] 34732 v_1_1 := v_1.Args[1] 34733 if v_1_1.Op != OpConst16 || v_1_1.Type != t || v_1_1.AuxInt != y || !(isPowerOfTwo(y)) { 34734 break 34735 } 34736 v.reset(OpEq16) 34737 v0 := b.NewValue0(v.Pos, OpAnd16, t) 34738 v0.AddArg(x) 34739 v1 := b.NewValue0(v.Pos, OpConst16, t) 34740 v1.AuxInt = y 34741 v0.AddArg(v1) 34742 v.AddArg(v0) 34743 v2 := b.NewValue0(v.Pos, OpConst16, t) 34744 v2.AuxInt = 0 34745 v.AddArg(v2) 34746 return true 34747 } 34748 // match: (Neq16 (Const16 <t> [y]) (And16 <t> (Const16 <t> [y]) x)) 34749 // cond: isPowerOfTwo(y) 34750 // result: (Eq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [0])) 34751 for { 34752 _ = v.Args[1] 34753 v_0 := v.Args[0] 34754 if v_0.Op != OpConst16 { 34755 break 34756 } 34757 t := v_0.Type 34758 y := v_0.AuxInt 34759 v_1 := v.Args[1] 34760 if v_1.Op != OpAnd16 || v_1.Type != t { 34761 break 34762 } 34763 x := v_1.Args[1] 34764 v_1_0 := v_1.Args[0] 34765 if v_1_0.Op != OpConst16 || v_1_0.Type != t || v_1_0.AuxInt != y || !(isPowerOfTwo(y)) { 34766 break 34767 } 34768 v.reset(OpEq16) 34769 v0 := b.NewValue0(v.Pos, OpAnd16, t) 34770 v0.AddArg(x) 34771 v1 := b.NewValue0(v.Pos, OpConst16, t) 34772 v1.AuxInt = y 34773 v0.AddArg(v1) 34774 v.AddArg(v0) 34775 v2 := b.NewValue0(v.Pos, OpConst16, t) 34776 v2.AuxInt = 0 34777 v.AddArg(v2) 34778 return true 34779 } 34780 return false 34781 } 34782 func rewriteValuegeneric_OpNeq32_0(v *Value) bool { 34783 b := v.Block 34784 typ := &b.Func.Config.Types 34785 // match: (Neq32 x x) 34786 // result: (ConstBool [0]) 34787 for { 34788 x := v.Args[1] 34789 if x != v.Args[0] { 34790 break 34791 } 34792 v.reset(OpConstBool) 34793 v.AuxInt = 0 34794 return true 34795 } 34796 // match: (Neq32 (Const32 <t> [c]) (Add32 (Const32 <t> [d]) x)) 34797 // result: (Neq32 (Const32 <t> [int64(int32(c-d))]) x) 34798 for { 34799 _ = v.Args[1] 34800 v_0 := v.Args[0] 34801 if v_0.Op != OpConst32 { 34802 break 34803 } 34804 t := v_0.Type 34805 c := v_0.AuxInt 34806 v_1 := v.Args[1] 34807 if v_1.Op != OpAdd32 { 34808 break 34809 } 34810 x := v_1.Args[1] 34811 v_1_0 := v_1.Args[0] 34812 if v_1_0.Op != OpConst32 || v_1_0.Type != t { 34813 break 34814 } 34815 d := v_1_0.AuxInt 34816 v.reset(OpNeq32) 34817 v0 := b.NewValue0(v.Pos, OpConst32, t) 34818 v0.AuxInt = int64(int32(c - d)) 34819 v.AddArg(v0) 34820 v.AddArg(x) 34821 return true 34822 } 34823 // match: (Neq32 (Const32 <t> [c]) (Add32 x (Const32 <t> [d]))) 34824 // result: (Neq32 (Const32 <t> [int64(int32(c-d))]) x) 34825 for { 34826 _ = v.Args[1] 34827 v_0 := v.Args[0] 34828 if v_0.Op != OpConst32 { 34829 break 34830 } 34831 t := v_0.Type 34832 c := v_0.AuxInt 34833 v_1 := v.Args[1] 34834 if v_1.Op != OpAdd32 { 34835 break 34836 } 34837 _ = v_1.Args[1] 34838 x := v_1.Args[0] 34839 v_1_1 := v_1.Args[1] 34840 if v_1_1.Op != OpConst32 || v_1_1.Type != t { 34841 break 34842 } 34843 d := v_1_1.AuxInt 34844 v.reset(OpNeq32) 34845 v0 := b.NewValue0(v.Pos, OpConst32, t) 34846 v0.AuxInt = int64(int32(c - d)) 34847 v.AddArg(v0) 34848 v.AddArg(x) 34849 return true 34850 } 34851 // match: (Neq32 (Add32 (Const32 <t> [d]) x) (Const32 <t> [c])) 34852 // result: (Neq32 (Const32 <t> [int64(int32(c-d))]) x) 34853 for { 34854 _ = v.Args[1] 34855 v_0 := v.Args[0] 34856 if v_0.Op != OpAdd32 { 34857 break 34858 } 34859 x := v_0.Args[1] 34860 v_0_0 := v_0.Args[0] 34861 if v_0_0.Op != OpConst32 { 34862 break 34863 } 34864 t := v_0_0.Type 34865 d := v_0_0.AuxInt 34866 v_1 := v.Args[1] 34867 if v_1.Op != OpConst32 || v_1.Type != t { 34868 break 34869 } 34870 c := v_1.AuxInt 34871 v.reset(OpNeq32) 34872 v0 := b.NewValue0(v.Pos, OpConst32, t) 34873 v0.AuxInt = int64(int32(c - d)) 34874 v.AddArg(v0) 34875 v.AddArg(x) 34876 return true 34877 } 34878 // match: (Neq32 (Add32 x (Const32 <t> [d])) (Const32 <t> [c])) 34879 // result: (Neq32 (Const32 <t> [int64(int32(c-d))]) x) 34880 for { 34881 _ = v.Args[1] 34882 v_0 := v.Args[0] 34883 if v_0.Op != OpAdd32 { 34884 break 34885 } 34886 _ = v_0.Args[1] 34887 x := v_0.Args[0] 34888 v_0_1 := v_0.Args[1] 34889 if v_0_1.Op != OpConst32 { 34890 break 34891 } 34892 t := v_0_1.Type 34893 d := v_0_1.AuxInt 34894 v_1 := v.Args[1] 34895 if v_1.Op != OpConst32 || v_1.Type != t { 34896 break 34897 } 34898 c := v_1.AuxInt 34899 v.reset(OpNeq32) 34900 v0 := b.NewValue0(v.Pos, OpConst32, t) 34901 v0.AuxInt = int64(int32(c - d)) 34902 v.AddArg(v0) 34903 v.AddArg(x) 34904 return true 34905 } 34906 // match: (Neq32 (Const32 [c]) (Const32 [d])) 34907 // result: (ConstBool [b2i(c != d)]) 34908 for { 34909 _ = v.Args[1] 34910 v_0 := v.Args[0] 34911 if v_0.Op != OpConst32 { 34912 break 34913 } 34914 c := v_0.AuxInt 34915 v_1 := v.Args[1] 34916 if v_1.Op != OpConst32 { 34917 break 34918 } 34919 d := v_1.AuxInt 34920 v.reset(OpConstBool) 34921 v.AuxInt = b2i(c != d) 34922 return true 34923 } 34924 // match: (Neq32 (Const32 [d]) (Const32 [c])) 34925 // result: (ConstBool [b2i(c != d)]) 34926 for { 34927 _ = v.Args[1] 34928 v_0 := v.Args[0] 34929 if v_0.Op != OpConst32 { 34930 break 34931 } 34932 d := v_0.AuxInt 34933 v_1 := v.Args[1] 34934 if v_1.Op != OpConst32 { 34935 break 34936 } 34937 c := v_1.AuxInt 34938 v.reset(OpConstBool) 34939 v.AuxInt = b2i(c != d) 34940 return true 34941 } 34942 // match: (Neq32 n (Lsh32x64 (Rsh32x64 (Add32 <t> n (Rsh32Ux64 <t> (Rsh32x64 <t> n (Const64 <typ.UInt64> [31])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k]))) 34943 // cond: k > 0 && k < 31 && kbar == 32 - k 34944 // result: (Neq32 (And32 <t> n (Const32 <t> [int64(1<<uint(k)-1)])) (Const32 <t> [0])) 34945 for { 34946 _ = v.Args[1] 34947 n := v.Args[0] 34948 v_1 := v.Args[1] 34949 if v_1.Op != OpLsh32x64 { 34950 break 34951 } 34952 _ = v_1.Args[1] 34953 v_1_0 := v_1.Args[0] 34954 if v_1_0.Op != OpRsh32x64 { 34955 break 34956 } 34957 _ = v_1_0.Args[1] 34958 v_1_0_0 := v_1_0.Args[0] 34959 if v_1_0_0.Op != OpAdd32 { 34960 break 34961 } 34962 t := v_1_0_0.Type 34963 _ = v_1_0_0.Args[1] 34964 if n != v_1_0_0.Args[0] { 34965 break 34966 } 34967 v_1_0_0_1 := v_1_0_0.Args[1] 34968 if v_1_0_0_1.Op != OpRsh32Ux64 || v_1_0_0_1.Type != t { 34969 break 34970 } 34971 _ = v_1_0_0_1.Args[1] 34972 v_1_0_0_1_0 := v_1_0_0_1.Args[0] 34973 if v_1_0_0_1_0.Op != OpRsh32x64 || v_1_0_0_1_0.Type != t { 34974 break 34975 } 34976 _ = v_1_0_0_1_0.Args[1] 34977 if n != v_1_0_0_1_0.Args[0] { 34978 break 34979 } 34980 v_1_0_0_1_0_1 := v_1_0_0_1_0.Args[1] 34981 if v_1_0_0_1_0_1.Op != OpConst64 || v_1_0_0_1_0_1.Type != typ.UInt64 || v_1_0_0_1_0_1.AuxInt != 31 { 34982 break 34983 } 34984 v_1_0_0_1_1 := v_1_0_0_1.Args[1] 34985 if v_1_0_0_1_1.Op != OpConst64 || v_1_0_0_1_1.Type != typ.UInt64 { 34986 break 34987 } 34988 kbar := v_1_0_0_1_1.AuxInt 34989 v_1_0_1 := v_1_0.Args[1] 34990 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 { 34991 break 34992 } 34993 k := v_1_0_1.AuxInt 34994 v_1_1 := v_1.Args[1] 34995 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || v_1_1.AuxInt != k || !(k > 0 && k < 31 && kbar == 32-k) { 34996 break 34997 } 34998 v.reset(OpNeq32) 34999 v0 := b.NewValue0(v.Pos, OpAnd32, t) 35000 v0.AddArg(n) 35001 v1 := b.NewValue0(v.Pos, OpConst32, t) 35002 v1.AuxInt = int64(1<<uint(k) - 1) 35003 v0.AddArg(v1) 35004 v.AddArg(v0) 35005 v2 := b.NewValue0(v.Pos, OpConst32, t) 35006 v2.AuxInt = 0 35007 v.AddArg(v2) 35008 return true 35009 } 35010 // match: (Neq32 n (Lsh32x64 (Rsh32x64 (Add32 <t> (Rsh32Ux64 <t> (Rsh32x64 <t> n (Const64 <typ.UInt64> [31])) (Const64 <typ.UInt64> [kbar])) n) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k]))) 35011 // cond: k > 0 && k < 31 && kbar == 32 - k 35012 // result: (Neq32 (And32 <t> n (Const32 <t> [int64(1<<uint(k)-1)])) (Const32 <t> [0])) 35013 for { 35014 _ = v.Args[1] 35015 n := v.Args[0] 35016 v_1 := v.Args[1] 35017 if v_1.Op != OpLsh32x64 { 35018 break 35019 } 35020 _ = v_1.Args[1] 35021 v_1_0 := v_1.Args[0] 35022 if v_1_0.Op != OpRsh32x64 { 35023 break 35024 } 35025 _ = v_1_0.Args[1] 35026 v_1_0_0 := v_1_0.Args[0] 35027 if v_1_0_0.Op != OpAdd32 { 35028 break 35029 } 35030 t := v_1_0_0.Type 35031 _ = v_1_0_0.Args[1] 35032 v_1_0_0_0 := v_1_0_0.Args[0] 35033 if v_1_0_0_0.Op != OpRsh32Ux64 || v_1_0_0_0.Type != t { 35034 break 35035 } 35036 _ = v_1_0_0_0.Args[1] 35037 v_1_0_0_0_0 := v_1_0_0_0.Args[0] 35038 if v_1_0_0_0_0.Op != OpRsh32x64 || v_1_0_0_0_0.Type != t { 35039 break 35040 } 35041 _ = v_1_0_0_0_0.Args[1] 35042 if n != v_1_0_0_0_0.Args[0] { 35043 break 35044 } 35045 v_1_0_0_0_0_1 := v_1_0_0_0_0.Args[1] 35046 if v_1_0_0_0_0_1.Op != OpConst64 || v_1_0_0_0_0_1.Type != typ.UInt64 || v_1_0_0_0_0_1.AuxInt != 31 { 35047 break 35048 } 35049 v_1_0_0_0_1 := v_1_0_0_0.Args[1] 35050 if v_1_0_0_0_1.Op != OpConst64 || v_1_0_0_0_1.Type != typ.UInt64 { 35051 break 35052 } 35053 kbar := v_1_0_0_0_1.AuxInt 35054 if n != v_1_0_0.Args[1] { 35055 break 35056 } 35057 v_1_0_1 := v_1_0.Args[1] 35058 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 { 35059 break 35060 } 35061 k := v_1_0_1.AuxInt 35062 v_1_1 := v_1.Args[1] 35063 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || v_1_1.AuxInt != k || !(k > 0 && k < 31 && kbar == 32-k) { 35064 break 35065 } 35066 v.reset(OpNeq32) 35067 v0 := b.NewValue0(v.Pos, OpAnd32, t) 35068 v0.AddArg(n) 35069 v1 := b.NewValue0(v.Pos, OpConst32, t) 35070 v1.AuxInt = int64(1<<uint(k) - 1) 35071 v0.AddArg(v1) 35072 v.AddArg(v0) 35073 v2 := b.NewValue0(v.Pos, OpConst32, t) 35074 v2.AuxInt = 0 35075 v.AddArg(v2) 35076 return true 35077 } 35078 // match: (Neq32 (Lsh32x64 (Rsh32x64 (Add32 <t> n (Rsh32Ux64 <t> (Rsh32x64 <t> n (Const64 <typ.UInt64> [31])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) n) 35079 // cond: k > 0 && k < 31 && kbar == 32 - k 35080 // result: (Neq32 (And32 <t> n (Const32 <t> [int64(1<<uint(k)-1)])) (Const32 <t> [0])) 35081 for { 35082 n := v.Args[1] 35083 v_0 := v.Args[0] 35084 if v_0.Op != OpLsh32x64 { 35085 break 35086 } 35087 _ = v_0.Args[1] 35088 v_0_0 := v_0.Args[0] 35089 if v_0_0.Op != OpRsh32x64 { 35090 break 35091 } 35092 _ = v_0_0.Args[1] 35093 v_0_0_0 := v_0_0.Args[0] 35094 if v_0_0_0.Op != OpAdd32 { 35095 break 35096 } 35097 t := v_0_0_0.Type 35098 _ = v_0_0_0.Args[1] 35099 if n != v_0_0_0.Args[0] { 35100 break 35101 } 35102 v_0_0_0_1 := v_0_0_0.Args[1] 35103 if v_0_0_0_1.Op != OpRsh32Ux64 || v_0_0_0_1.Type != t { 35104 break 35105 } 35106 _ = v_0_0_0_1.Args[1] 35107 v_0_0_0_1_0 := v_0_0_0_1.Args[0] 35108 if v_0_0_0_1_0.Op != OpRsh32x64 || v_0_0_0_1_0.Type != t { 35109 break 35110 } 35111 _ = v_0_0_0_1_0.Args[1] 35112 if n != v_0_0_0_1_0.Args[0] { 35113 break 35114 } 35115 v_0_0_0_1_0_1 := v_0_0_0_1_0.Args[1] 35116 if v_0_0_0_1_0_1.Op != OpConst64 || v_0_0_0_1_0_1.Type != typ.UInt64 || v_0_0_0_1_0_1.AuxInt != 31 { 35117 break 35118 } 35119 v_0_0_0_1_1 := v_0_0_0_1.Args[1] 35120 if v_0_0_0_1_1.Op != OpConst64 || v_0_0_0_1_1.Type != typ.UInt64 { 35121 break 35122 } 35123 kbar := v_0_0_0_1_1.AuxInt 35124 v_0_0_1 := v_0_0.Args[1] 35125 if v_0_0_1.Op != OpConst64 || v_0_0_1.Type != typ.UInt64 { 35126 break 35127 } 35128 k := v_0_0_1.AuxInt 35129 v_0_1 := v_0.Args[1] 35130 if v_0_1.Op != OpConst64 || v_0_1.Type != typ.UInt64 || v_0_1.AuxInt != k || !(k > 0 && k < 31 && kbar == 32-k) { 35131 break 35132 } 35133 v.reset(OpNeq32) 35134 v0 := b.NewValue0(v.Pos, OpAnd32, t) 35135 v0.AddArg(n) 35136 v1 := b.NewValue0(v.Pos, OpConst32, t) 35137 v1.AuxInt = int64(1<<uint(k) - 1) 35138 v0.AddArg(v1) 35139 v.AddArg(v0) 35140 v2 := b.NewValue0(v.Pos, OpConst32, t) 35141 v2.AuxInt = 0 35142 v.AddArg(v2) 35143 return true 35144 } 35145 return false 35146 } 35147 func rewriteValuegeneric_OpNeq32_10(v *Value) bool { 35148 b := v.Block 35149 typ := &b.Func.Config.Types 35150 // match: (Neq32 (Lsh32x64 (Rsh32x64 (Add32 <t> (Rsh32Ux64 <t> (Rsh32x64 <t> n (Const64 <typ.UInt64> [31])) (Const64 <typ.UInt64> [kbar])) n) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) n) 35151 // cond: k > 0 && k < 31 && kbar == 32 - k 35152 // result: (Neq32 (And32 <t> n (Const32 <t> [int64(1<<uint(k)-1)])) (Const32 <t> [0])) 35153 for { 35154 n := v.Args[1] 35155 v_0 := v.Args[0] 35156 if v_0.Op != OpLsh32x64 { 35157 break 35158 } 35159 _ = v_0.Args[1] 35160 v_0_0 := v_0.Args[0] 35161 if v_0_0.Op != OpRsh32x64 { 35162 break 35163 } 35164 _ = v_0_0.Args[1] 35165 v_0_0_0 := v_0_0.Args[0] 35166 if v_0_0_0.Op != OpAdd32 { 35167 break 35168 } 35169 t := v_0_0_0.Type 35170 _ = v_0_0_0.Args[1] 35171 v_0_0_0_0 := v_0_0_0.Args[0] 35172 if v_0_0_0_0.Op != OpRsh32Ux64 || v_0_0_0_0.Type != t { 35173 break 35174 } 35175 _ = v_0_0_0_0.Args[1] 35176 v_0_0_0_0_0 := v_0_0_0_0.Args[0] 35177 if v_0_0_0_0_0.Op != OpRsh32x64 || v_0_0_0_0_0.Type != t { 35178 break 35179 } 35180 _ = v_0_0_0_0_0.Args[1] 35181 if n != v_0_0_0_0_0.Args[0] { 35182 break 35183 } 35184 v_0_0_0_0_0_1 := v_0_0_0_0_0.Args[1] 35185 if v_0_0_0_0_0_1.Op != OpConst64 || v_0_0_0_0_0_1.Type != typ.UInt64 || v_0_0_0_0_0_1.AuxInt != 31 { 35186 break 35187 } 35188 v_0_0_0_0_1 := v_0_0_0_0.Args[1] 35189 if v_0_0_0_0_1.Op != OpConst64 || v_0_0_0_0_1.Type != typ.UInt64 { 35190 break 35191 } 35192 kbar := v_0_0_0_0_1.AuxInt 35193 if n != v_0_0_0.Args[1] { 35194 break 35195 } 35196 v_0_0_1 := v_0_0.Args[1] 35197 if v_0_0_1.Op != OpConst64 || v_0_0_1.Type != typ.UInt64 { 35198 break 35199 } 35200 k := v_0_0_1.AuxInt 35201 v_0_1 := v_0.Args[1] 35202 if v_0_1.Op != OpConst64 || v_0_1.Type != typ.UInt64 || v_0_1.AuxInt != k || !(k > 0 && k < 31 && kbar == 32-k) { 35203 break 35204 } 35205 v.reset(OpNeq32) 35206 v0 := b.NewValue0(v.Pos, OpAnd32, t) 35207 v0.AddArg(n) 35208 v1 := b.NewValue0(v.Pos, OpConst32, t) 35209 v1.AuxInt = int64(1<<uint(k) - 1) 35210 v0.AddArg(v1) 35211 v.AddArg(v0) 35212 v2 := b.NewValue0(v.Pos, OpConst32, t) 35213 v2.AuxInt = 0 35214 v.AddArg(v2) 35215 return true 35216 } 35217 // match: (Neq32 s:(Sub32 x y) (Const32 [0])) 35218 // cond: s.Uses == 1 35219 // result: (Neq32 x y) 35220 for { 35221 _ = v.Args[1] 35222 s := v.Args[0] 35223 if s.Op != OpSub32 { 35224 break 35225 } 35226 y := s.Args[1] 35227 x := s.Args[0] 35228 v_1 := v.Args[1] 35229 if v_1.Op != OpConst32 || v_1.AuxInt != 0 || !(s.Uses == 1) { 35230 break 35231 } 35232 v.reset(OpNeq32) 35233 v.AddArg(x) 35234 v.AddArg(y) 35235 return true 35236 } 35237 // match: (Neq32 (Const32 [0]) s:(Sub32 x y)) 35238 // cond: s.Uses == 1 35239 // result: (Neq32 x y) 35240 for { 35241 _ = v.Args[1] 35242 v_0 := v.Args[0] 35243 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 35244 break 35245 } 35246 s := v.Args[1] 35247 if s.Op != OpSub32 { 35248 break 35249 } 35250 y := s.Args[1] 35251 x := s.Args[0] 35252 if !(s.Uses == 1) { 35253 break 35254 } 35255 v.reset(OpNeq32) 35256 v.AddArg(x) 35257 v.AddArg(y) 35258 return true 35259 } 35260 // match: (Neq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [y])) 35261 // cond: isPowerOfTwo(y) 35262 // result: (Eq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [0])) 35263 for { 35264 _ = v.Args[1] 35265 v_0 := v.Args[0] 35266 if v_0.Op != OpAnd32 { 35267 break 35268 } 35269 t := v_0.Type 35270 _ = v_0.Args[1] 35271 x := v_0.Args[0] 35272 v_0_1 := v_0.Args[1] 35273 if v_0_1.Op != OpConst32 || v_0_1.Type != t { 35274 break 35275 } 35276 y := v_0_1.AuxInt 35277 v_1 := v.Args[1] 35278 if v_1.Op != OpConst32 || v_1.Type != t || v_1.AuxInt != y || !(isPowerOfTwo(y)) { 35279 break 35280 } 35281 v.reset(OpEq32) 35282 v0 := b.NewValue0(v.Pos, OpAnd32, t) 35283 v0.AddArg(x) 35284 v1 := b.NewValue0(v.Pos, OpConst32, t) 35285 v1.AuxInt = y 35286 v0.AddArg(v1) 35287 v.AddArg(v0) 35288 v2 := b.NewValue0(v.Pos, OpConst32, t) 35289 v2.AuxInt = 0 35290 v.AddArg(v2) 35291 return true 35292 } 35293 // match: (Neq32 (And32 <t> (Const32 <t> [y]) x) (Const32 <t> [y])) 35294 // cond: isPowerOfTwo(y) 35295 // result: (Eq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [0])) 35296 for { 35297 _ = v.Args[1] 35298 v_0 := v.Args[0] 35299 if v_0.Op != OpAnd32 { 35300 break 35301 } 35302 t := v_0.Type 35303 x := v_0.Args[1] 35304 v_0_0 := v_0.Args[0] 35305 if v_0_0.Op != OpConst32 || v_0_0.Type != t { 35306 break 35307 } 35308 y := v_0_0.AuxInt 35309 v_1 := v.Args[1] 35310 if v_1.Op != OpConst32 || v_1.Type != t || v_1.AuxInt != y || !(isPowerOfTwo(y)) { 35311 break 35312 } 35313 v.reset(OpEq32) 35314 v0 := b.NewValue0(v.Pos, OpAnd32, t) 35315 v0.AddArg(x) 35316 v1 := b.NewValue0(v.Pos, OpConst32, t) 35317 v1.AuxInt = y 35318 v0.AddArg(v1) 35319 v.AddArg(v0) 35320 v2 := b.NewValue0(v.Pos, OpConst32, t) 35321 v2.AuxInt = 0 35322 v.AddArg(v2) 35323 return true 35324 } 35325 // match: (Neq32 (Const32 <t> [y]) (And32 <t> x (Const32 <t> [y]))) 35326 // cond: isPowerOfTwo(y) 35327 // result: (Eq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [0])) 35328 for { 35329 _ = v.Args[1] 35330 v_0 := v.Args[0] 35331 if v_0.Op != OpConst32 { 35332 break 35333 } 35334 t := v_0.Type 35335 y := v_0.AuxInt 35336 v_1 := v.Args[1] 35337 if v_1.Op != OpAnd32 || v_1.Type != t { 35338 break 35339 } 35340 _ = v_1.Args[1] 35341 x := v_1.Args[0] 35342 v_1_1 := v_1.Args[1] 35343 if v_1_1.Op != OpConst32 || v_1_1.Type != t || v_1_1.AuxInt != y || !(isPowerOfTwo(y)) { 35344 break 35345 } 35346 v.reset(OpEq32) 35347 v0 := b.NewValue0(v.Pos, OpAnd32, t) 35348 v0.AddArg(x) 35349 v1 := b.NewValue0(v.Pos, OpConst32, t) 35350 v1.AuxInt = y 35351 v0.AddArg(v1) 35352 v.AddArg(v0) 35353 v2 := b.NewValue0(v.Pos, OpConst32, t) 35354 v2.AuxInt = 0 35355 v.AddArg(v2) 35356 return true 35357 } 35358 // match: (Neq32 (Const32 <t> [y]) (And32 <t> (Const32 <t> [y]) x)) 35359 // cond: isPowerOfTwo(y) 35360 // result: (Eq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [0])) 35361 for { 35362 _ = v.Args[1] 35363 v_0 := v.Args[0] 35364 if v_0.Op != OpConst32 { 35365 break 35366 } 35367 t := v_0.Type 35368 y := v_0.AuxInt 35369 v_1 := v.Args[1] 35370 if v_1.Op != OpAnd32 || v_1.Type != t { 35371 break 35372 } 35373 x := v_1.Args[1] 35374 v_1_0 := v_1.Args[0] 35375 if v_1_0.Op != OpConst32 || v_1_0.Type != t || v_1_0.AuxInt != y || !(isPowerOfTwo(y)) { 35376 break 35377 } 35378 v.reset(OpEq32) 35379 v0 := b.NewValue0(v.Pos, OpAnd32, t) 35380 v0.AddArg(x) 35381 v1 := b.NewValue0(v.Pos, OpConst32, t) 35382 v1.AuxInt = y 35383 v0.AddArg(v1) 35384 v.AddArg(v0) 35385 v2 := b.NewValue0(v.Pos, OpConst32, t) 35386 v2.AuxInt = 0 35387 v.AddArg(v2) 35388 return true 35389 } 35390 return false 35391 } 35392 func rewriteValuegeneric_OpNeq32F_0(v *Value) bool { 35393 // match: (Neq32F (Const32F [c]) (Const32F [d])) 35394 // result: (ConstBool [b2i(auxTo32F(c) != auxTo32F(d))]) 35395 for { 35396 _ = v.Args[1] 35397 v_0 := v.Args[0] 35398 if v_0.Op != OpConst32F { 35399 break 35400 } 35401 c := v_0.AuxInt 35402 v_1 := v.Args[1] 35403 if v_1.Op != OpConst32F { 35404 break 35405 } 35406 d := v_1.AuxInt 35407 v.reset(OpConstBool) 35408 v.AuxInt = b2i(auxTo32F(c) != auxTo32F(d)) 35409 return true 35410 } 35411 // match: (Neq32F (Const32F [d]) (Const32F [c])) 35412 // result: (ConstBool [b2i(auxTo32F(c) != auxTo32F(d))]) 35413 for { 35414 _ = v.Args[1] 35415 v_0 := v.Args[0] 35416 if v_0.Op != OpConst32F { 35417 break 35418 } 35419 d := v_0.AuxInt 35420 v_1 := v.Args[1] 35421 if v_1.Op != OpConst32F { 35422 break 35423 } 35424 c := v_1.AuxInt 35425 v.reset(OpConstBool) 35426 v.AuxInt = b2i(auxTo32F(c) != auxTo32F(d)) 35427 return true 35428 } 35429 return false 35430 } 35431 func rewriteValuegeneric_OpNeq64_0(v *Value) bool { 35432 b := v.Block 35433 typ := &b.Func.Config.Types 35434 // match: (Neq64 x x) 35435 // result: (ConstBool [0]) 35436 for { 35437 x := v.Args[1] 35438 if x != v.Args[0] { 35439 break 35440 } 35441 v.reset(OpConstBool) 35442 v.AuxInt = 0 35443 return true 35444 } 35445 // match: (Neq64 (Const64 <t> [c]) (Add64 (Const64 <t> [d]) x)) 35446 // result: (Neq64 (Const64 <t> [c-d]) x) 35447 for { 35448 _ = v.Args[1] 35449 v_0 := v.Args[0] 35450 if v_0.Op != OpConst64 { 35451 break 35452 } 35453 t := v_0.Type 35454 c := v_0.AuxInt 35455 v_1 := v.Args[1] 35456 if v_1.Op != OpAdd64 { 35457 break 35458 } 35459 x := v_1.Args[1] 35460 v_1_0 := v_1.Args[0] 35461 if v_1_0.Op != OpConst64 || v_1_0.Type != t { 35462 break 35463 } 35464 d := v_1_0.AuxInt 35465 v.reset(OpNeq64) 35466 v0 := b.NewValue0(v.Pos, OpConst64, t) 35467 v0.AuxInt = c - d 35468 v.AddArg(v0) 35469 v.AddArg(x) 35470 return true 35471 } 35472 // match: (Neq64 (Const64 <t> [c]) (Add64 x (Const64 <t> [d]))) 35473 // result: (Neq64 (Const64 <t> [c-d]) x) 35474 for { 35475 _ = v.Args[1] 35476 v_0 := v.Args[0] 35477 if v_0.Op != OpConst64 { 35478 break 35479 } 35480 t := v_0.Type 35481 c := v_0.AuxInt 35482 v_1 := v.Args[1] 35483 if v_1.Op != OpAdd64 { 35484 break 35485 } 35486 _ = v_1.Args[1] 35487 x := v_1.Args[0] 35488 v_1_1 := v_1.Args[1] 35489 if v_1_1.Op != OpConst64 || v_1_1.Type != t { 35490 break 35491 } 35492 d := v_1_1.AuxInt 35493 v.reset(OpNeq64) 35494 v0 := b.NewValue0(v.Pos, OpConst64, t) 35495 v0.AuxInt = c - d 35496 v.AddArg(v0) 35497 v.AddArg(x) 35498 return true 35499 } 35500 // match: (Neq64 (Add64 (Const64 <t> [d]) x) (Const64 <t> [c])) 35501 // result: (Neq64 (Const64 <t> [c-d]) x) 35502 for { 35503 _ = v.Args[1] 35504 v_0 := v.Args[0] 35505 if v_0.Op != OpAdd64 { 35506 break 35507 } 35508 x := v_0.Args[1] 35509 v_0_0 := v_0.Args[0] 35510 if v_0_0.Op != OpConst64 { 35511 break 35512 } 35513 t := v_0_0.Type 35514 d := v_0_0.AuxInt 35515 v_1 := v.Args[1] 35516 if v_1.Op != OpConst64 || v_1.Type != t { 35517 break 35518 } 35519 c := v_1.AuxInt 35520 v.reset(OpNeq64) 35521 v0 := b.NewValue0(v.Pos, OpConst64, t) 35522 v0.AuxInt = c - d 35523 v.AddArg(v0) 35524 v.AddArg(x) 35525 return true 35526 } 35527 // match: (Neq64 (Add64 x (Const64 <t> [d])) (Const64 <t> [c])) 35528 // result: (Neq64 (Const64 <t> [c-d]) x) 35529 for { 35530 _ = v.Args[1] 35531 v_0 := v.Args[0] 35532 if v_0.Op != OpAdd64 { 35533 break 35534 } 35535 _ = v_0.Args[1] 35536 x := v_0.Args[0] 35537 v_0_1 := v_0.Args[1] 35538 if v_0_1.Op != OpConst64 { 35539 break 35540 } 35541 t := v_0_1.Type 35542 d := v_0_1.AuxInt 35543 v_1 := v.Args[1] 35544 if v_1.Op != OpConst64 || v_1.Type != t { 35545 break 35546 } 35547 c := v_1.AuxInt 35548 v.reset(OpNeq64) 35549 v0 := b.NewValue0(v.Pos, OpConst64, t) 35550 v0.AuxInt = c - d 35551 v.AddArg(v0) 35552 v.AddArg(x) 35553 return true 35554 } 35555 // match: (Neq64 (Const64 [c]) (Const64 [d])) 35556 // result: (ConstBool [b2i(c != d)]) 35557 for { 35558 _ = v.Args[1] 35559 v_0 := v.Args[0] 35560 if v_0.Op != OpConst64 { 35561 break 35562 } 35563 c := v_0.AuxInt 35564 v_1 := v.Args[1] 35565 if v_1.Op != OpConst64 { 35566 break 35567 } 35568 d := v_1.AuxInt 35569 v.reset(OpConstBool) 35570 v.AuxInt = b2i(c != d) 35571 return true 35572 } 35573 // match: (Neq64 (Const64 [d]) (Const64 [c])) 35574 // result: (ConstBool [b2i(c != d)]) 35575 for { 35576 _ = v.Args[1] 35577 v_0 := v.Args[0] 35578 if v_0.Op != OpConst64 { 35579 break 35580 } 35581 d := v_0.AuxInt 35582 v_1 := v.Args[1] 35583 if v_1.Op != OpConst64 { 35584 break 35585 } 35586 c := v_1.AuxInt 35587 v.reset(OpConstBool) 35588 v.AuxInt = b2i(c != d) 35589 return true 35590 } 35591 // match: (Neq64 n (Lsh64x64 (Rsh64x64 (Add64 <t> n (Rsh64Ux64 <t> (Rsh64x64 <t> n (Const64 <typ.UInt64> [63])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k]))) 35592 // cond: k > 0 && k < 63 && kbar == 64 - k 35593 // result: (Neq64 (And64 <t> n (Const64 <t> [int64(1<<uint(k)-1)])) (Const64 <t> [0])) 35594 for { 35595 _ = v.Args[1] 35596 n := v.Args[0] 35597 v_1 := v.Args[1] 35598 if v_1.Op != OpLsh64x64 { 35599 break 35600 } 35601 _ = v_1.Args[1] 35602 v_1_0 := v_1.Args[0] 35603 if v_1_0.Op != OpRsh64x64 { 35604 break 35605 } 35606 _ = v_1_0.Args[1] 35607 v_1_0_0 := v_1_0.Args[0] 35608 if v_1_0_0.Op != OpAdd64 { 35609 break 35610 } 35611 t := v_1_0_0.Type 35612 _ = v_1_0_0.Args[1] 35613 if n != v_1_0_0.Args[0] { 35614 break 35615 } 35616 v_1_0_0_1 := v_1_0_0.Args[1] 35617 if v_1_0_0_1.Op != OpRsh64Ux64 || v_1_0_0_1.Type != t { 35618 break 35619 } 35620 _ = v_1_0_0_1.Args[1] 35621 v_1_0_0_1_0 := v_1_0_0_1.Args[0] 35622 if v_1_0_0_1_0.Op != OpRsh64x64 || v_1_0_0_1_0.Type != t { 35623 break 35624 } 35625 _ = v_1_0_0_1_0.Args[1] 35626 if n != v_1_0_0_1_0.Args[0] { 35627 break 35628 } 35629 v_1_0_0_1_0_1 := v_1_0_0_1_0.Args[1] 35630 if v_1_0_0_1_0_1.Op != OpConst64 || v_1_0_0_1_0_1.Type != typ.UInt64 || v_1_0_0_1_0_1.AuxInt != 63 { 35631 break 35632 } 35633 v_1_0_0_1_1 := v_1_0_0_1.Args[1] 35634 if v_1_0_0_1_1.Op != OpConst64 || v_1_0_0_1_1.Type != typ.UInt64 { 35635 break 35636 } 35637 kbar := v_1_0_0_1_1.AuxInt 35638 v_1_0_1 := v_1_0.Args[1] 35639 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 { 35640 break 35641 } 35642 k := v_1_0_1.AuxInt 35643 v_1_1 := v_1.Args[1] 35644 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || v_1_1.AuxInt != k || !(k > 0 && k < 63 && kbar == 64-k) { 35645 break 35646 } 35647 v.reset(OpNeq64) 35648 v0 := b.NewValue0(v.Pos, OpAnd64, t) 35649 v0.AddArg(n) 35650 v1 := b.NewValue0(v.Pos, OpConst64, t) 35651 v1.AuxInt = int64(1<<uint(k) - 1) 35652 v0.AddArg(v1) 35653 v.AddArg(v0) 35654 v2 := b.NewValue0(v.Pos, OpConst64, t) 35655 v2.AuxInt = 0 35656 v.AddArg(v2) 35657 return true 35658 } 35659 // match: (Neq64 n (Lsh64x64 (Rsh64x64 (Add64 <t> (Rsh64Ux64 <t> (Rsh64x64 <t> n (Const64 <typ.UInt64> [63])) (Const64 <typ.UInt64> [kbar])) n) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k]))) 35660 // cond: k > 0 && k < 63 && kbar == 64 - k 35661 // result: (Neq64 (And64 <t> n (Const64 <t> [int64(1<<uint(k)-1)])) (Const64 <t> [0])) 35662 for { 35663 _ = v.Args[1] 35664 n := v.Args[0] 35665 v_1 := v.Args[1] 35666 if v_1.Op != OpLsh64x64 { 35667 break 35668 } 35669 _ = v_1.Args[1] 35670 v_1_0 := v_1.Args[0] 35671 if v_1_0.Op != OpRsh64x64 { 35672 break 35673 } 35674 _ = v_1_0.Args[1] 35675 v_1_0_0 := v_1_0.Args[0] 35676 if v_1_0_0.Op != OpAdd64 { 35677 break 35678 } 35679 t := v_1_0_0.Type 35680 _ = v_1_0_0.Args[1] 35681 v_1_0_0_0 := v_1_0_0.Args[0] 35682 if v_1_0_0_0.Op != OpRsh64Ux64 || v_1_0_0_0.Type != t { 35683 break 35684 } 35685 _ = v_1_0_0_0.Args[1] 35686 v_1_0_0_0_0 := v_1_0_0_0.Args[0] 35687 if v_1_0_0_0_0.Op != OpRsh64x64 || v_1_0_0_0_0.Type != t { 35688 break 35689 } 35690 _ = v_1_0_0_0_0.Args[1] 35691 if n != v_1_0_0_0_0.Args[0] { 35692 break 35693 } 35694 v_1_0_0_0_0_1 := v_1_0_0_0_0.Args[1] 35695 if v_1_0_0_0_0_1.Op != OpConst64 || v_1_0_0_0_0_1.Type != typ.UInt64 || v_1_0_0_0_0_1.AuxInt != 63 { 35696 break 35697 } 35698 v_1_0_0_0_1 := v_1_0_0_0.Args[1] 35699 if v_1_0_0_0_1.Op != OpConst64 || v_1_0_0_0_1.Type != typ.UInt64 { 35700 break 35701 } 35702 kbar := v_1_0_0_0_1.AuxInt 35703 if n != v_1_0_0.Args[1] { 35704 break 35705 } 35706 v_1_0_1 := v_1_0.Args[1] 35707 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 { 35708 break 35709 } 35710 k := v_1_0_1.AuxInt 35711 v_1_1 := v_1.Args[1] 35712 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || v_1_1.AuxInt != k || !(k > 0 && k < 63 && kbar == 64-k) { 35713 break 35714 } 35715 v.reset(OpNeq64) 35716 v0 := b.NewValue0(v.Pos, OpAnd64, t) 35717 v0.AddArg(n) 35718 v1 := b.NewValue0(v.Pos, OpConst64, t) 35719 v1.AuxInt = int64(1<<uint(k) - 1) 35720 v0.AddArg(v1) 35721 v.AddArg(v0) 35722 v2 := b.NewValue0(v.Pos, OpConst64, t) 35723 v2.AuxInt = 0 35724 v.AddArg(v2) 35725 return true 35726 } 35727 // match: (Neq64 (Lsh64x64 (Rsh64x64 (Add64 <t> n (Rsh64Ux64 <t> (Rsh64x64 <t> n (Const64 <typ.UInt64> [63])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) n) 35728 // cond: k > 0 && k < 63 && kbar == 64 - k 35729 // result: (Neq64 (And64 <t> n (Const64 <t> [int64(1<<uint(k)-1)])) (Const64 <t> [0])) 35730 for { 35731 n := v.Args[1] 35732 v_0 := v.Args[0] 35733 if v_0.Op != OpLsh64x64 { 35734 break 35735 } 35736 _ = v_0.Args[1] 35737 v_0_0 := v_0.Args[0] 35738 if v_0_0.Op != OpRsh64x64 { 35739 break 35740 } 35741 _ = v_0_0.Args[1] 35742 v_0_0_0 := v_0_0.Args[0] 35743 if v_0_0_0.Op != OpAdd64 { 35744 break 35745 } 35746 t := v_0_0_0.Type 35747 _ = v_0_0_0.Args[1] 35748 if n != v_0_0_0.Args[0] { 35749 break 35750 } 35751 v_0_0_0_1 := v_0_0_0.Args[1] 35752 if v_0_0_0_1.Op != OpRsh64Ux64 || v_0_0_0_1.Type != t { 35753 break 35754 } 35755 _ = v_0_0_0_1.Args[1] 35756 v_0_0_0_1_0 := v_0_0_0_1.Args[0] 35757 if v_0_0_0_1_0.Op != OpRsh64x64 || v_0_0_0_1_0.Type != t { 35758 break 35759 } 35760 _ = v_0_0_0_1_0.Args[1] 35761 if n != v_0_0_0_1_0.Args[0] { 35762 break 35763 } 35764 v_0_0_0_1_0_1 := v_0_0_0_1_0.Args[1] 35765 if v_0_0_0_1_0_1.Op != OpConst64 || v_0_0_0_1_0_1.Type != typ.UInt64 || v_0_0_0_1_0_1.AuxInt != 63 { 35766 break 35767 } 35768 v_0_0_0_1_1 := v_0_0_0_1.Args[1] 35769 if v_0_0_0_1_1.Op != OpConst64 || v_0_0_0_1_1.Type != typ.UInt64 { 35770 break 35771 } 35772 kbar := v_0_0_0_1_1.AuxInt 35773 v_0_0_1 := v_0_0.Args[1] 35774 if v_0_0_1.Op != OpConst64 || v_0_0_1.Type != typ.UInt64 { 35775 break 35776 } 35777 k := v_0_0_1.AuxInt 35778 v_0_1 := v_0.Args[1] 35779 if v_0_1.Op != OpConst64 || v_0_1.Type != typ.UInt64 || v_0_1.AuxInt != k || !(k > 0 && k < 63 && kbar == 64-k) { 35780 break 35781 } 35782 v.reset(OpNeq64) 35783 v0 := b.NewValue0(v.Pos, OpAnd64, t) 35784 v0.AddArg(n) 35785 v1 := b.NewValue0(v.Pos, OpConst64, t) 35786 v1.AuxInt = int64(1<<uint(k) - 1) 35787 v0.AddArg(v1) 35788 v.AddArg(v0) 35789 v2 := b.NewValue0(v.Pos, OpConst64, t) 35790 v2.AuxInt = 0 35791 v.AddArg(v2) 35792 return true 35793 } 35794 return false 35795 } 35796 func rewriteValuegeneric_OpNeq64_10(v *Value) bool { 35797 b := v.Block 35798 typ := &b.Func.Config.Types 35799 // match: (Neq64 (Lsh64x64 (Rsh64x64 (Add64 <t> (Rsh64Ux64 <t> (Rsh64x64 <t> n (Const64 <typ.UInt64> [63])) (Const64 <typ.UInt64> [kbar])) n) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) n) 35800 // cond: k > 0 && k < 63 && kbar == 64 - k 35801 // result: (Neq64 (And64 <t> n (Const64 <t> [int64(1<<uint(k)-1)])) (Const64 <t> [0])) 35802 for { 35803 n := v.Args[1] 35804 v_0 := v.Args[0] 35805 if v_0.Op != OpLsh64x64 { 35806 break 35807 } 35808 _ = v_0.Args[1] 35809 v_0_0 := v_0.Args[0] 35810 if v_0_0.Op != OpRsh64x64 { 35811 break 35812 } 35813 _ = v_0_0.Args[1] 35814 v_0_0_0 := v_0_0.Args[0] 35815 if v_0_0_0.Op != OpAdd64 { 35816 break 35817 } 35818 t := v_0_0_0.Type 35819 _ = v_0_0_0.Args[1] 35820 v_0_0_0_0 := v_0_0_0.Args[0] 35821 if v_0_0_0_0.Op != OpRsh64Ux64 || v_0_0_0_0.Type != t { 35822 break 35823 } 35824 _ = v_0_0_0_0.Args[1] 35825 v_0_0_0_0_0 := v_0_0_0_0.Args[0] 35826 if v_0_0_0_0_0.Op != OpRsh64x64 || v_0_0_0_0_0.Type != t { 35827 break 35828 } 35829 _ = v_0_0_0_0_0.Args[1] 35830 if n != v_0_0_0_0_0.Args[0] { 35831 break 35832 } 35833 v_0_0_0_0_0_1 := v_0_0_0_0_0.Args[1] 35834 if v_0_0_0_0_0_1.Op != OpConst64 || v_0_0_0_0_0_1.Type != typ.UInt64 || v_0_0_0_0_0_1.AuxInt != 63 { 35835 break 35836 } 35837 v_0_0_0_0_1 := v_0_0_0_0.Args[1] 35838 if v_0_0_0_0_1.Op != OpConst64 || v_0_0_0_0_1.Type != typ.UInt64 { 35839 break 35840 } 35841 kbar := v_0_0_0_0_1.AuxInt 35842 if n != v_0_0_0.Args[1] { 35843 break 35844 } 35845 v_0_0_1 := v_0_0.Args[1] 35846 if v_0_0_1.Op != OpConst64 || v_0_0_1.Type != typ.UInt64 { 35847 break 35848 } 35849 k := v_0_0_1.AuxInt 35850 v_0_1 := v_0.Args[1] 35851 if v_0_1.Op != OpConst64 || v_0_1.Type != typ.UInt64 || v_0_1.AuxInt != k || !(k > 0 && k < 63 && kbar == 64-k) { 35852 break 35853 } 35854 v.reset(OpNeq64) 35855 v0 := b.NewValue0(v.Pos, OpAnd64, t) 35856 v0.AddArg(n) 35857 v1 := b.NewValue0(v.Pos, OpConst64, t) 35858 v1.AuxInt = int64(1<<uint(k) - 1) 35859 v0.AddArg(v1) 35860 v.AddArg(v0) 35861 v2 := b.NewValue0(v.Pos, OpConst64, t) 35862 v2.AuxInt = 0 35863 v.AddArg(v2) 35864 return true 35865 } 35866 // match: (Neq64 s:(Sub64 x y) (Const64 [0])) 35867 // cond: s.Uses == 1 35868 // result: (Neq64 x y) 35869 for { 35870 _ = v.Args[1] 35871 s := v.Args[0] 35872 if s.Op != OpSub64 { 35873 break 35874 } 35875 y := s.Args[1] 35876 x := s.Args[0] 35877 v_1 := v.Args[1] 35878 if v_1.Op != OpConst64 || v_1.AuxInt != 0 || !(s.Uses == 1) { 35879 break 35880 } 35881 v.reset(OpNeq64) 35882 v.AddArg(x) 35883 v.AddArg(y) 35884 return true 35885 } 35886 // match: (Neq64 (Const64 [0]) s:(Sub64 x y)) 35887 // cond: s.Uses == 1 35888 // result: (Neq64 x y) 35889 for { 35890 _ = v.Args[1] 35891 v_0 := v.Args[0] 35892 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 35893 break 35894 } 35895 s := v.Args[1] 35896 if s.Op != OpSub64 { 35897 break 35898 } 35899 y := s.Args[1] 35900 x := s.Args[0] 35901 if !(s.Uses == 1) { 35902 break 35903 } 35904 v.reset(OpNeq64) 35905 v.AddArg(x) 35906 v.AddArg(y) 35907 return true 35908 } 35909 // match: (Neq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [y])) 35910 // cond: isPowerOfTwo(y) 35911 // result: (Eq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [0])) 35912 for { 35913 _ = v.Args[1] 35914 v_0 := v.Args[0] 35915 if v_0.Op != OpAnd64 { 35916 break 35917 } 35918 t := v_0.Type 35919 _ = v_0.Args[1] 35920 x := v_0.Args[0] 35921 v_0_1 := v_0.Args[1] 35922 if v_0_1.Op != OpConst64 || v_0_1.Type != t { 35923 break 35924 } 35925 y := v_0_1.AuxInt 35926 v_1 := v.Args[1] 35927 if v_1.Op != OpConst64 || v_1.Type != t || v_1.AuxInt != y || !(isPowerOfTwo(y)) { 35928 break 35929 } 35930 v.reset(OpEq64) 35931 v0 := b.NewValue0(v.Pos, OpAnd64, t) 35932 v0.AddArg(x) 35933 v1 := b.NewValue0(v.Pos, OpConst64, t) 35934 v1.AuxInt = y 35935 v0.AddArg(v1) 35936 v.AddArg(v0) 35937 v2 := b.NewValue0(v.Pos, OpConst64, t) 35938 v2.AuxInt = 0 35939 v.AddArg(v2) 35940 return true 35941 } 35942 // match: (Neq64 (And64 <t> (Const64 <t> [y]) x) (Const64 <t> [y])) 35943 // cond: isPowerOfTwo(y) 35944 // result: (Eq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [0])) 35945 for { 35946 _ = v.Args[1] 35947 v_0 := v.Args[0] 35948 if v_0.Op != OpAnd64 { 35949 break 35950 } 35951 t := v_0.Type 35952 x := v_0.Args[1] 35953 v_0_0 := v_0.Args[0] 35954 if v_0_0.Op != OpConst64 || v_0_0.Type != t { 35955 break 35956 } 35957 y := v_0_0.AuxInt 35958 v_1 := v.Args[1] 35959 if v_1.Op != OpConst64 || v_1.Type != t || v_1.AuxInt != y || !(isPowerOfTwo(y)) { 35960 break 35961 } 35962 v.reset(OpEq64) 35963 v0 := b.NewValue0(v.Pos, OpAnd64, t) 35964 v0.AddArg(x) 35965 v1 := b.NewValue0(v.Pos, OpConst64, t) 35966 v1.AuxInt = y 35967 v0.AddArg(v1) 35968 v.AddArg(v0) 35969 v2 := b.NewValue0(v.Pos, OpConst64, t) 35970 v2.AuxInt = 0 35971 v.AddArg(v2) 35972 return true 35973 } 35974 // match: (Neq64 (Const64 <t> [y]) (And64 <t> x (Const64 <t> [y]))) 35975 // cond: isPowerOfTwo(y) 35976 // result: (Eq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [0])) 35977 for { 35978 _ = v.Args[1] 35979 v_0 := v.Args[0] 35980 if v_0.Op != OpConst64 { 35981 break 35982 } 35983 t := v_0.Type 35984 y := v_0.AuxInt 35985 v_1 := v.Args[1] 35986 if v_1.Op != OpAnd64 || v_1.Type != t { 35987 break 35988 } 35989 _ = v_1.Args[1] 35990 x := v_1.Args[0] 35991 v_1_1 := v_1.Args[1] 35992 if v_1_1.Op != OpConst64 || v_1_1.Type != t || v_1_1.AuxInt != y || !(isPowerOfTwo(y)) { 35993 break 35994 } 35995 v.reset(OpEq64) 35996 v0 := b.NewValue0(v.Pos, OpAnd64, t) 35997 v0.AddArg(x) 35998 v1 := b.NewValue0(v.Pos, OpConst64, t) 35999 v1.AuxInt = y 36000 v0.AddArg(v1) 36001 v.AddArg(v0) 36002 v2 := b.NewValue0(v.Pos, OpConst64, t) 36003 v2.AuxInt = 0 36004 v.AddArg(v2) 36005 return true 36006 } 36007 // match: (Neq64 (Const64 <t> [y]) (And64 <t> (Const64 <t> [y]) x)) 36008 // cond: isPowerOfTwo(y) 36009 // result: (Eq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [0])) 36010 for { 36011 _ = v.Args[1] 36012 v_0 := v.Args[0] 36013 if v_0.Op != OpConst64 { 36014 break 36015 } 36016 t := v_0.Type 36017 y := v_0.AuxInt 36018 v_1 := v.Args[1] 36019 if v_1.Op != OpAnd64 || v_1.Type != t { 36020 break 36021 } 36022 x := v_1.Args[1] 36023 v_1_0 := v_1.Args[0] 36024 if v_1_0.Op != OpConst64 || v_1_0.Type != t || v_1_0.AuxInt != y || !(isPowerOfTwo(y)) { 36025 break 36026 } 36027 v.reset(OpEq64) 36028 v0 := b.NewValue0(v.Pos, OpAnd64, t) 36029 v0.AddArg(x) 36030 v1 := b.NewValue0(v.Pos, OpConst64, t) 36031 v1.AuxInt = y 36032 v0.AddArg(v1) 36033 v.AddArg(v0) 36034 v2 := b.NewValue0(v.Pos, OpConst64, t) 36035 v2.AuxInt = 0 36036 v.AddArg(v2) 36037 return true 36038 } 36039 return false 36040 } 36041 func rewriteValuegeneric_OpNeq64F_0(v *Value) bool { 36042 // match: (Neq64F (Const64F [c]) (Const64F [d])) 36043 // result: (ConstBool [b2i(auxTo64F(c) != auxTo64F(d))]) 36044 for { 36045 _ = v.Args[1] 36046 v_0 := v.Args[0] 36047 if v_0.Op != OpConst64F { 36048 break 36049 } 36050 c := v_0.AuxInt 36051 v_1 := v.Args[1] 36052 if v_1.Op != OpConst64F { 36053 break 36054 } 36055 d := v_1.AuxInt 36056 v.reset(OpConstBool) 36057 v.AuxInt = b2i(auxTo64F(c) != auxTo64F(d)) 36058 return true 36059 } 36060 // match: (Neq64F (Const64F [d]) (Const64F [c])) 36061 // result: (ConstBool [b2i(auxTo64F(c) != auxTo64F(d))]) 36062 for { 36063 _ = v.Args[1] 36064 v_0 := v.Args[0] 36065 if v_0.Op != OpConst64F { 36066 break 36067 } 36068 d := v_0.AuxInt 36069 v_1 := v.Args[1] 36070 if v_1.Op != OpConst64F { 36071 break 36072 } 36073 c := v_1.AuxInt 36074 v.reset(OpConstBool) 36075 v.AuxInt = b2i(auxTo64F(c) != auxTo64F(d)) 36076 return true 36077 } 36078 return false 36079 } 36080 func rewriteValuegeneric_OpNeq8_0(v *Value) bool { 36081 b := v.Block 36082 typ := &b.Func.Config.Types 36083 // match: (Neq8 x x) 36084 // result: (ConstBool [0]) 36085 for { 36086 x := v.Args[1] 36087 if x != v.Args[0] { 36088 break 36089 } 36090 v.reset(OpConstBool) 36091 v.AuxInt = 0 36092 return true 36093 } 36094 // match: (Neq8 (Const8 <t> [c]) (Add8 (Const8 <t> [d]) x)) 36095 // result: (Neq8 (Const8 <t> [int64(int8(c-d))]) x) 36096 for { 36097 _ = v.Args[1] 36098 v_0 := v.Args[0] 36099 if v_0.Op != OpConst8 { 36100 break 36101 } 36102 t := v_0.Type 36103 c := v_0.AuxInt 36104 v_1 := v.Args[1] 36105 if v_1.Op != OpAdd8 { 36106 break 36107 } 36108 x := v_1.Args[1] 36109 v_1_0 := v_1.Args[0] 36110 if v_1_0.Op != OpConst8 || v_1_0.Type != t { 36111 break 36112 } 36113 d := v_1_0.AuxInt 36114 v.reset(OpNeq8) 36115 v0 := b.NewValue0(v.Pos, OpConst8, t) 36116 v0.AuxInt = int64(int8(c - d)) 36117 v.AddArg(v0) 36118 v.AddArg(x) 36119 return true 36120 } 36121 // match: (Neq8 (Const8 <t> [c]) (Add8 x (Const8 <t> [d]))) 36122 // result: (Neq8 (Const8 <t> [int64(int8(c-d))]) x) 36123 for { 36124 _ = v.Args[1] 36125 v_0 := v.Args[0] 36126 if v_0.Op != OpConst8 { 36127 break 36128 } 36129 t := v_0.Type 36130 c := v_0.AuxInt 36131 v_1 := v.Args[1] 36132 if v_1.Op != OpAdd8 { 36133 break 36134 } 36135 _ = v_1.Args[1] 36136 x := v_1.Args[0] 36137 v_1_1 := v_1.Args[1] 36138 if v_1_1.Op != OpConst8 || v_1_1.Type != t { 36139 break 36140 } 36141 d := v_1_1.AuxInt 36142 v.reset(OpNeq8) 36143 v0 := b.NewValue0(v.Pos, OpConst8, t) 36144 v0.AuxInt = int64(int8(c - d)) 36145 v.AddArg(v0) 36146 v.AddArg(x) 36147 return true 36148 } 36149 // match: (Neq8 (Add8 (Const8 <t> [d]) x) (Const8 <t> [c])) 36150 // result: (Neq8 (Const8 <t> [int64(int8(c-d))]) x) 36151 for { 36152 _ = v.Args[1] 36153 v_0 := v.Args[0] 36154 if v_0.Op != OpAdd8 { 36155 break 36156 } 36157 x := v_0.Args[1] 36158 v_0_0 := v_0.Args[0] 36159 if v_0_0.Op != OpConst8 { 36160 break 36161 } 36162 t := v_0_0.Type 36163 d := v_0_0.AuxInt 36164 v_1 := v.Args[1] 36165 if v_1.Op != OpConst8 || v_1.Type != t { 36166 break 36167 } 36168 c := v_1.AuxInt 36169 v.reset(OpNeq8) 36170 v0 := b.NewValue0(v.Pos, OpConst8, t) 36171 v0.AuxInt = int64(int8(c - d)) 36172 v.AddArg(v0) 36173 v.AddArg(x) 36174 return true 36175 } 36176 // match: (Neq8 (Add8 x (Const8 <t> [d])) (Const8 <t> [c])) 36177 // result: (Neq8 (Const8 <t> [int64(int8(c-d))]) x) 36178 for { 36179 _ = v.Args[1] 36180 v_0 := v.Args[0] 36181 if v_0.Op != OpAdd8 { 36182 break 36183 } 36184 _ = v_0.Args[1] 36185 x := v_0.Args[0] 36186 v_0_1 := v_0.Args[1] 36187 if v_0_1.Op != OpConst8 { 36188 break 36189 } 36190 t := v_0_1.Type 36191 d := v_0_1.AuxInt 36192 v_1 := v.Args[1] 36193 if v_1.Op != OpConst8 || v_1.Type != t { 36194 break 36195 } 36196 c := v_1.AuxInt 36197 v.reset(OpNeq8) 36198 v0 := b.NewValue0(v.Pos, OpConst8, t) 36199 v0.AuxInt = int64(int8(c - d)) 36200 v.AddArg(v0) 36201 v.AddArg(x) 36202 return true 36203 } 36204 // match: (Neq8 (Const8 [c]) (Const8 [d])) 36205 // result: (ConstBool [b2i(c != d)]) 36206 for { 36207 _ = v.Args[1] 36208 v_0 := v.Args[0] 36209 if v_0.Op != OpConst8 { 36210 break 36211 } 36212 c := v_0.AuxInt 36213 v_1 := v.Args[1] 36214 if v_1.Op != OpConst8 { 36215 break 36216 } 36217 d := v_1.AuxInt 36218 v.reset(OpConstBool) 36219 v.AuxInt = b2i(c != d) 36220 return true 36221 } 36222 // match: (Neq8 (Const8 [d]) (Const8 [c])) 36223 // result: (ConstBool [b2i(c != d)]) 36224 for { 36225 _ = v.Args[1] 36226 v_0 := v.Args[0] 36227 if v_0.Op != OpConst8 { 36228 break 36229 } 36230 d := v_0.AuxInt 36231 v_1 := v.Args[1] 36232 if v_1.Op != OpConst8 { 36233 break 36234 } 36235 c := v_1.AuxInt 36236 v.reset(OpConstBool) 36237 v.AuxInt = b2i(c != d) 36238 return true 36239 } 36240 // match: (Neq8 n (Lsh8x64 (Rsh8x64 (Add8 <t> n (Rsh8Ux64 <t> (Rsh8x64 <t> n (Const64 <typ.UInt64> [ 7])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k]))) 36241 // cond: k > 0 && k < 7 && kbar == 8 - k 36242 // result: (Neq8 (And8 <t> n (Const8 <t> [int64(1<<uint(k)-1)])) (Const8 <t> [0])) 36243 for { 36244 _ = v.Args[1] 36245 n := v.Args[0] 36246 v_1 := v.Args[1] 36247 if v_1.Op != OpLsh8x64 { 36248 break 36249 } 36250 _ = v_1.Args[1] 36251 v_1_0 := v_1.Args[0] 36252 if v_1_0.Op != OpRsh8x64 { 36253 break 36254 } 36255 _ = v_1_0.Args[1] 36256 v_1_0_0 := v_1_0.Args[0] 36257 if v_1_0_0.Op != OpAdd8 { 36258 break 36259 } 36260 t := v_1_0_0.Type 36261 _ = v_1_0_0.Args[1] 36262 if n != v_1_0_0.Args[0] { 36263 break 36264 } 36265 v_1_0_0_1 := v_1_0_0.Args[1] 36266 if v_1_0_0_1.Op != OpRsh8Ux64 || v_1_0_0_1.Type != t { 36267 break 36268 } 36269 _ = v_1_0_0_1.Args[1] 36270 v_1_0_0_1_0 := v_1_0_0_1.Args[0] 36271 if v_1_0_0_1_0.Op != OpRsh8x64 || v_1_0_0_1_0.Type != t { 36272 break 36273 } 36274 _ = v_1_0_0_1_0.Args[1] 36275 if n != v_1_0_0_1_0.Args[0] { 36276 break 36277 } 36278 v_1_0_0_1_0_1 := v_1_0_0_1_0.Args[1] 36279 if v_1_0_0_1_0_1.Op != OpConst64 || v_1_0_0_1_0_1.Type != typ.UInt64 || v_1_0_0_1_0_1.AuxInt != 7 { 36280 break 36281 } 36282 v_1_0_0_1_1 := v_1_0_0_1.Args[1] 36283 if v_1_0_0_1_1.Op != OpConst64 || v_1_0_0_1_1.Type != typ.UInt64 { 36284 break 36285 } 36286 kbar := v_1_0_0_1_1.AuxInt 36287 v_1_0_1 := v_1_0.Args[1] 36288 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 { 36289 break 36290 } 36291 k := v_1_0_1.AuxInt 36292 v_1_1 := v_1.Args[1] 36293 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || v_1_1.AuxInt != k || !(k > 0 && k < 7 && kbar == 8-k) { 36294 break 36295 } 36296 v.reset(OpNeq8) 36297 v0 := b.NewValue0(v.Pos, OpAnd8, t) 36298 v0.AddArg(n) 36299 v1 := b.NewValue0(v.Pos, OpConst8, t) 36300 v1.AuxInt = int64(1<<uint(k) - 1) 36301 v0.AddArg(v1) 36302 v.AddArg(v0) 36303 v2 := b.NewValue0(v.Pos, OpConst8, t) 36304 v2.AuxInt = 0 36305 v.AddArg(v2) 36306 return true 36307 } 36308 // match: (Neq8 n (Lsh8x64 (Rsh8x64 (Add8 <t> (Rsh8Ux64 <t> (Rsh8x64 <t> n (Const64 <typ.UInt64> [ 7])) (Const64 <typ.UInt64> [kbar])) n) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k]))) 36309 // cond: k > 0 && k < 7 && kbar == 8 - k 36310 // result: (Neq8 (And8 <t> n (Const8 <t> [int64(1<<uint(k)-1)])) (Const8 <t> [0])) 36311 for { 36312 _ = v.Args[1] 36313 n := v.Args[0] 36314 v_1 := v.Args[1] 36315 if v_1.Op != OpLsh8x64 { 36316 break 36317 } 36318 _ = v_1.Args[1] 36319 v_1_0 := v_1.Args[0] 36320 if v_1_0.Op != OpRsh8x64 { 36321 break 36322 } 36323 _ = v_1_0.Args[1] 36324 v_1_0_0 := v_1_0.Args[0] 36325 if v_1_0_0.Op != OpAdd8 { 36326 break 36327 } 36328 t := v_1_0_0.Type 36329 _ = v_1_0_0.Args[1] 36330 v_1_0_0_0 := v_1_0_0.Args[0] 36331 if v_1_0_0_0.Op != OpRsh8Ux64 || v_1_0_0_0.Type != t { 36332 break 36333 } 36334 _ = v_1_0_0_0.Args[1] 36335 v_1_0_0_0_0 := v_1_0_0_0.Args[0] 36336 if v_1_0_0_0_0.Op != OpRsh8x64 || v_1_0_0_0_0.Type != t { 36337 break 36338 } 36339 _ = v_1_0_0_0_0.Args[1] 36340 if n != v_1_0_0_0_0.Args[0] { 36341 break 36342 } 36343 v_1_0_0_0_0_1 := v_1_0_0_0_0.Args[1] 36344 if v_1_0_0_0_0_1.Op != OpConst64 || v_1_0_0_0_0_1.Type != typ.UInt64 || v_1_0_0_0_0_1.AuxInt != 7 { 36345 break 36346 } 36347 v_1_0_0_0_1 := v_1_0_0_0.Args[1] 36348 if v_1_0_0_0_1.Op != OpConst64 || v_1_0_0_0_1.Type != typ.UInt64 { 36349 break 36350 } 36351 kbar := v_1_0_0_0_1.AuxInt 36352 if n != v_1_0_0.Args[1] { 36353 break 36354 } 36355 v_1_0_1 := v_1_0.Args[1] 36356 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 { 36357 break 36358 } 36359 k := v_1_0_1.AuxInt 36360 v_1_1 := v_1.Args[1] 36361 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || v_1_1.AuxInt != k || !(k > 0 && k < 7 && kbar == 8-k) { 36362 break 36363 } 36364 v.reset(OpNeq8) 36365 v0 := b.NewValue0(v.Pos, OpAnd8, t) 36366 v0.AddArg(n) 36367 v1 := b.NewValue0(v.Pos, OpConst8, t) 36368 v1.AuxInt = int64(1<<uint(k) - 1) 36369 v0.AddArg(v1) 36370 v.AddArg(v0) 36371 v2 := b.NewValue0(v.Pos, OpConst8, t) 36372 v2.AuxInt = 0 36373 v.AddArg(v2) 36374 return true 36375 } 36376 // match: (Neq8 (Lsh8x64 (Rsh8x64 (Add8 <t> n (Rsh8Ux64 <t> (Rsh8x64 <t> n (Const64 <typ.UInt64> [ 7])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) n) 36377 // cond: k > 0 && k < 7 && kbar == 8 - k 36378 // result: (Neq8 (And8 <t> n (Const8 <t> [int64(1<<uint(k)-1)])) (Const8 <t> [0])) 36379 for { 36380 n := v.Args[1] 36381 v_0 := v.Args[0] 36382 if v_0.Op != OpLsh8x64 { 36383 break 36384 } 36385 _ = v_0.Args[1] 36386 v_0_0 := v_0.Args[0] 36387 if v_0_0.Op != OpRsh8x64 { 36388 break 36389 } 36390 _ = v_0_0.Args[1] 36391 v_0_0_0 := v_0_0.Args[0] 36392 if v_0_0_0.Op != OpAdd8 { 36393 break 36394 } 36395 t := v_0_0_0.Type 36396 _ = v_0_0_0.Args[1] 36397 if n != v_0_0_0.Args[0] { 36398 break 36399 } 36400 v_0_0_0_1 := v_0_0_0.Args[1] 36401 if v_0_0_0_1.Op != OpRsh8Ux64 || v_0_0_0_1.Type != t { 36402 break 36403 } 36404 _ = v_0_0_0_1.Args[1] 36405 v_0_0_0_1_0 := v_0_0_0_1.Args[0] 36406 if v_0_0_0_1_0.Op != OpRsh8x64 || v_0_0_0_1_0.Type != t { 36407 break 36408 } 36409 _ = v_0_0_0_1_0.Args[1] 36410 if n != v_0_0_0_1_0.Args[0] { 36411 break 36412 } 36413 v_0_0_0_1_0_1 := v_0_0_0_1_0.Args[1] 36414 if v_0_0_0_1_0_1.Op != OpConst64 || v_0_0_0_1_0_1.Type != typ.UInt64 || v_0_0_0_1_0_1.AuxInt != 7 { 36415 break 36416 } 36417 v_0_0_0_1_1 := v_0_0_0_1.Args[1] 36418 if v_0_0_0_1_1.Op != OpConst64 || v_0_0_0_1_1.Type != typ.UInt64 { 36419 break 36420 } 36421 kbar := v_0_0_0_1_1.AuxInt 36422 v_0_0_1 := v_0_0.Args[1] 36423 if v_0_0_1.Op != OpConst64 || v_0_0_1.Type != typ.UInt64 { 36424 break 36425 } 36426 k := v_0_0_1.AuxInt 36427 v_0_1 := v_0.Args[1] 36428 if v_0_1.Op != OpConst64 || v_0_1.Type != typ.UInt64 || v_0_1.AuxInt != k || !(k > 0 && k < 7 && kbar == 8-k) { 36429 break 36430 } 36431 v.reset(OpNeq8) 36432 v0 := b.NewValue0(v.Pos, OpAnd8, t) 36433 v0.AddArg(n) 36434 v1 := b.NewValue0(v.Pos, OpConst8, t) 36435 v1.AuxInt = int64(1<<uint(k) - 1) 36436 v0.AddArg(v1) 36437 v.AddArg(v0) 36438 v2 := b.NewValue0(v.Pos, OpConst8, t) 36439 v2.AuxInt = 0 36440 v.AddArg(v2) 36441 return true 36442 } 36443 return false 36444 } 36445 func rewriteValuegeneric_OpNeq8_10(v *Value) bool { 36446 b := v.Block 36447 typ := &b.Func.Config.Types 36448 // match: (Neq8 (Lsh8x64 (Rsh8x64 (Add8 <t> (Rsh8Ux64 <t> (Rsh8x64 <t> n (Const64 <typ.UInt64> [ 7])) (Const64 <typ.UInt64> [kbar])) n) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) n) 36449 // cond: k > 0 && k < 7 && kbar == 8 - k 36450 // result: (Neq8 (And8 <t> n (Const8 <t> [int64(1<<uint(k)-1)])) (Const8 <t> [0])) 36451 for { 36452 n := v.Args[1] 36453 v_0 := v.Args[0] 36454 if v_0.Op != OpLsh8x64 { 36455 break 36456 } 36457 _ = v_0.Args[1] 36458 v_0_0 := v_0.Args[0] 36459 if v_0_0.Op != OpRsh8x64 { 36460 break 36461 } 36462 _ = v_0_0.Args[1] 36463 v_0_0_0 := v_0_0.Args[0] 36464 if v_0_0_0.Op != OpAdd8 { 36465 break 36466 } 36467 t := v_0_0_0.Type 36468 _ = v_0_0_0.Args[1] 36469 v_0_0_0_0 := v_0_0_0.Args[0] 36470 if v_0_0_0_0.Op != OpRsh8Ux64 || v_0_0_0_0.Type != t { 36471 break 36472 } 36473 _ = v_0_0_0_0.Args[1] 36474 v_0_0_0_0_0 := v_0_0_0_0.Args[0] 36475 if v_0_0_0_0_0.Op != OpRsh8x64 || v_0_0_0_0_0.Type != t { 36476 break 36477 } 36478 _ = v_0_0_0_0_0.Args[1] 36479 if n != v_0_0_0_0_0.Args[0] { 36480 break 36481 } 36482 v_0_0_0_0_0_1 := v_0_0_0_0_0.Args[1] 36483 if v_0_0_0_0_0_1.Op != OpConst64 || v_0_0_0_0_0_1.Type != typ.UInt64 || v_0_0_0_0_0_1.AuxInt != 7 { 36484 break 36485 } 36486 v_0_0_0_0_1 := v_0_0_0_0.Args[1] 36487 if v_0_0_0_0_1.Op != OpConst64 || v_0_0_0_0_1.Type != typ.UInt64 { 36488 break 36489 } 36490 kbar := v_0_0_0_0_1.AuxInt 36491 if n != v_0_0_0.Args[1] { 36492 break 36493 } 36494 v_0_0_1 := v_0_0.Args[1] 36495 if v_0_0_1.Op != OpConst64 || v_0_0_1.Type != typ.UInt64 { 36496 break 36497 } 36498 k := v_0_0_1.AuxInt 36499 v_0_1 := v_0.Args[1] 36500 if v_0_1.Op != OpConst64 || v_0_1.Type != typ.UInt64 || v_0_1.AuxInt != k || !(k > 0 && k < 7 && kbar == 8-k) { 36501 break 36502 } 36503 v.reset(OpNeq8) 36504 v0 := b.NewValue0(v.Pos, OpAnd8, t) 36505 v0.AddArg(n) 36506 v1 := b.NewValue0(v.Pos, OpConst8, t) 36507 v1.AuxInt = int64(1<<uint(k) - 1) 36508 v0.AddArg(v1) 36509 v.AddArg(v0) 36510 v2 := b.NewValue0(v.Pos, OpConst8, t) 36511 v2.AuxInt = 0 36512 v.AddArg(v2) 36513 return true 36514 } 36515 // match: (Neq8 s:(Sub8 x y) (Const8 [0])) 36516 // cond: s.Uses == 1 36517 // result: (Neq8 x y) 36518 for { 36519 _ = v.Args[1] 36520 s := v.Args[0] 36521 if s.Op != OpSub8 { 36522 break 36523 } 36524 y := s.Args[1] 36525 x := s.Args[0] 36526 v_1 := v.Args[1] 36527 if v_1.Op != OpConst8 || v_1.AuxInt != 0 || !(s.Uses == 1) { 36528 break 36529 } 36530 v.reset(OpNeq8) 36531 v.AddArg(x) 36532 v.AddArg(y) 36533 return true 36534 } 36535 // match: (Neq8 (Const8 [0]) s:(Sub8 x y)) 36536 // cond: s.Uses == 1 36537 // result: (Neq8 x y) 36538 for { 36539 _ = v.Args[1] 36540 v_0 := v.Args[0] 36541 if v_0.Op != OpConst8 || v_0.AuxInt != 0 { 36542 break 36543 } 36544 s := v.Args[1] 36545 if s.Op != OpSub8 { 36546 break 36547 } 36548 y := s.Args[1] 36549 x := s.Args[0] 36550 if !(s.Uses == 1) { 36551 break 36552 } 36553 v.reset(OpNeq8) 36554 v.AddArg(x) 36555 v.AddArg(y) 36556 return true 36557 } 36558 // match: (Neq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [y])) 36559 // cond: isPowerOfTwo(y) 36560 // result: (Eq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [0])) 36561 for { 36562 _ = v.Args[1] 36563 v_0 := v.Args[0] 36564 if v_0.Op != OpAnd8 { 36565 break 36566 } 36567 t := v_0.Type 36568 _ = v_0.Args[1] 36569 x := v_0.Args[0] 36570 v_0_1 := v_0.Args[1] 36571 if v_0_1.Op != OpConst8 || v_0_1.Type != t { 36572 break 36573 } 36574 y := v_0_1.AuxInt 36575 v_1 := v.Args[1] 36576 if v_1.Op != OpConst8 || v_1.Type != t || v_1.AuxInt != y || !(isPowerOfTwo(y)) { 36577 break 36578 } 36579 v.reset(OpEq8) 36580 v0 := b.NewValue0(v.Pos, OpAnd8, t) 36581 v0.AddArg(x) 36582 v1 := b.NewValue0(v.Pos, OpConst8, t) 36583 v1.AuxInt = y 36584 v0.AddArg(v1) 36585 v.AddArg(v0) 36586 v2 := b.NewValue0(v.Pos, OpConst8, t) 36587 v2.AuxInt = 0 36588 v.AddArg(v2) 36589 return true 36590 } 36591 // match: (Neq8 (And8 <t> (Const8 <t> [y]) x) (Const8 <t> [y])) 36592 // cond: isPowerOfTwo(y) 36593 // result: (Eq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [0])) 36594 for { 36595 _ = v.Args[1] 36596 v_0 := v.Args[0] 36597 if v_0.Op != OpAnd8 { 36598 break 36599 } 36600 t := v_0.Type 36601 x := v_0.Args[1] 36602 v_0_0 := v_0.Args[0] 36603 if v_0_0.Op != OpConst8 || v_0_0.Type != t { 36604 break 36605 } 36606 y := v_0_0.AuxInt 36607 v_1 := v.Args[1] 36608 if v_1.Op != OpConst8 || v_1.Type != t || v_1.AuxInt != y || !(isPowerOfTwo(y)) { 36609 break 36610 } 36611 v.reset(OpEq8) 36612 v0 := b.NewValue0(v.Pos, OpAnd8, t) 36613 v0.AddArg(x) 36614 v1 := b.NewValue0(v.Pos, OpConst8, t) 36615 v1.AuxInt = y 36616 v0.AddArg(v1) 36617 v.AddArg(v0) 36618 v2 := b.NewValue0(v.Pos, OpConst8, t) 36619 v2.AuxInt = 0 36620 v.AddArg(v2) 36621 return true 36622 } 36623 // match: (Neq8 (Const8 <t> [y]) (And8 <t> x (Const8 <t> [y]))) 36624 // cond: isPowerOfTwo(y) 36625 // result: (Eq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [0])) 36626 for { 36627 _ = v.Args[1] 36628 v_0 := v.Args[0] 36629 if v_0.Op != OpConst8 { 36630 break 36631 } 36632 t := v_0.Type 36633 y := v_0.AuxInt 36634 v_1 := v.Args[1] 36635 if v_1.Op != OpAnd8 || v_1.Type != t { 36636 break 36637 } 36638 _ = v_1.Args[1] 36639 x := v_1.Args[0] 36640 v_1_1 := v_1.Args[1] 36641 if v_1_1.Op != OpConst8 || v_1_1.Type != t || v_1_1.AuxInt != y || !(isPowerOfTwo(y)) { 36642 break 36643 } 36644 v.reset(OpEq8) 36645 v0 := b.NewValue0(v.Pos, OpAnd8, t) 36646 v0.AddArg(x) 36647 v1 := b.NewValue0(v.Pos, OpConst8, t) 36648 v1.AuxInt = y 36649 v0.AddArg(v1) 36650 v.AddArg(v0) 36651 v2 := b.NewValue0(v.Pos, OpConst8, t) 36652 v2.AuxInt = 0 36653 v.AddArg(v2) 36654 return true 36655 } 36656 // match: (Neq8 (Const8 <t> [y]) (And8 <t> (Const8 <t> [y]) x)) 36657 // cond: isPowerOfTwo(y) 36658 // result: (Eq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [0])) 36659 for { 36660 _ = v.Args[1] 36661 v_0 := v.Args[0] 36662 if v_0.Op != OpConst8 { 36663 break 36664 } 36665 t := v_0.Type 36666 y := v_0.AuxInt 36667 v_1 := v.Args[1] 36668 if v_1.Op != OpAnd8 || v_1.Type != t { 36669 break 36670 } 36671 x := v_1.Args[1] 36672 v_1_0 := v_1.Args[0] 36673 if v_1_0.Op != OpConst8 || v_1_0.Type != t || v_1_0.AuxInt != y || !(isPowerOfTwo(y)) { 36674 break 36675 } 36676 v.reset(OpEq8) 36677 v0 := b.NewValue0(v.Pos, OpAnd8, t) 36678 v0.AddArg(x) 36679 v1 := b.NewValue0(v.Pos, OpConst8, t) 36680 v1.AuxInt = y 36681 v0.AddArg(v1) 36682 v.AddArg(v0) 36683 v2 := b.NewValue0(v.Pos, OpConst8, t) 36684 v2.AuxInt = 0 36685 v.AddArg(v2) 36686 return true 36687 } 36688 return false 36689 } 36690 func rewriteValuegeneric_OpNeqB_0(v *Value) bool { 36691 // match: (NeqB (ConstBool [c]) (ConstBool [d])) 36692 // result: (ConstBool [b2i(c != d)]) 36693 for { 36694 _ = v.Args[1] 36695 v_0 := v.Args[0] 36696 if v_0.Op != OpConstBool { 36697 break 36698 } 36699 c := v_0.AuxInt 36700 v_1 := v.Args[1] 36701 if v_1.Op != OpConstBool { 36702 break 36703 } 36704 d := v_1.AuxInt 36705 v.reset(OpConstBool) 36706 v.AuxInt = b2i(c != d) 36707 return true 36708 } 36709 // match: (NeqB (ConstBool [d]) (ConstBool [c])) 36710 // result: (ConstBool [b2i(c != d)]) 36711 for { 36712 _ = v.Args[1] 36713 v_0 := v.Args[0] 36714 if v_0.Op != OpConstBool { 36715 break 36716 } 36717 d := v_0.AuxInt 36718 v_1 := v.Args[1] 36719 if v_1.Op != OpConstBool { 36720 break 36721 } 36722 c := v_1.AuxInt 36723 v.reset(OpConstBool) 36724 v.AuxInt = b2i(c != d) 36725 return true 36726 } 36727 // match: (NeqB (ConstBool [0]) x) 36728 // result: x 36729 for { 36730 x := v.Args[1] 36731 v_0 := v.Args[0] 36732 if v_0.Op != OpConstBool || v_0.AuxInt != 0 { 36733 break 36734 } 36735 v.reset(OpCopy) 36736 v.Type = x.Type 36737 v.AddArg(x) 36738 return true 36739 } 36740 // match: (NeqB x (ConstBool [0])) 36741 // result: x 36742 for { 36743 _ = v.Args[1] 36744 x := v.Args[0] 36745 v_1 := v.Args[1] 36746 if v_1.Op != OpConstBool || v_1.AuxInt != 0 { 36747 break 36748 } 36749 v.reset(OpCopy) 36750 v.Type = x.Type 36751 v.AddArg(x) 36752 return true 36753 } 36754 // match: (NeqB (ConstBool [1]) x) 36755 // result: (Not x) 36756 for { 36757 x := v.Args[1] 36758 v_0 := v.Args[0] 36759 if v_0.Op != OpConstBool || v_0.AuxInt != 1 { 36760 break 36761 } 36762 v.reset(OpNot) 36763 v.AddArg(x) 36764 return true 36765 } 36766 // match: (NeqB x (ConstBool [1])) 36767 // result: (Not x) 36768 for { 36769 _ = v.Args[1] 36770 x := v.Args[0] 36771 v_1 := v.Args[1] 36772 if v_1.Op != OpConstBool || v_1.AuxInt != 1 { 36773 break 36774 } 36775 v.reset(OpNot) 36776 v.AddArg(x) 36777 return true 36778 } 36779 // match: (NeqB (Not x) (Not y)) 36780 // result: (NeqB x y) 36781 for { 36782 _ = v.Args[1] 36783 v_0 := v.Args[0] 36784 if v_0.Op != OpNot { 36785 break 36786 } 36787 x := v_0.Args[0] 36788 v_1 := v.Args[1] 36789 if v_1.Op != OpNot { 36790 break 36791 } 36792 y := v_1.Args[0] 36793 v.reset(OpNeqB) 36794 v.AddArg(x) 36795 v.AddArg(y) 36796 return true 36797 } 36798 // match: (NeqB (Not y) (Not x)) 36799 // result: (NeqB x y) 36800 for { 36801 _ = v.Args[1] 36802 v_0 := v.Args[0] 36803 if v_0.Op != OpNot { 36804 break 36805 } 36806 y := v_0.Args[0] 36807 v_1 := v.Args[1] 36808 if v_1.Op != OpNot { 36809 break 36810 } 36811 x := v_1.Args[0] 36812 v.reset(OpNeqB) 36813 v.AddArg(x) 36814 v.AddArg(y) 36815 return true 36816 } 36817 return false 36818 } 36819 func rewriteValuegeneric_OpNeqInter_0(v *Value) bool { 36820 b := v.Block 36821 typ := &b.Func.Config.Types 36822 // match: (NeqInter x y) 36823 // result: (NeqPtr (ITab x) (ITab y)) 36824 for { 36825 y := v.Args[1] 36826 x := v.Args[0] 36827 v.reset(OpNeqPtr) 36828 v0 := b.NewValue0(v.Pos, OpITab, typ.Uintptr) 36829 v0.AddArg(x) 36830 v.AddArg(v0) 36831 v1 := b.NewValue0(v.Pos, OpITab, typ.Uintptr) 36832 v1.AddArg(y) 36833 v.AddArg(v1) 36834 return true 36835 } 36836 } 36837 func rewriteValuegeneric_OpNeqPtr_0(v *Value) bool { 36838 // match: (NeqPtr x x) 36839 // result: (ConstBool [0]) 36840 for { 36841 x := v.Args[1] 36842 if x != v.Args[0] { 36843 break 36844 } 36845 v.reset(OpConstBool) 36846 v.AuxInt = 0 36847 return true 36848 } 36849 // match: (NeqPtr (Addr {a} _) (Addr {b} _)) 36850 // result: (ConstBool [b2i(a != b)]) 36851 for { 36852 _ = v.Args[1] 36853 v_0 := v.Args[0] 36854 if v_0.Op != OpAddr { 36855 break 36856 } 36857 a := v_0.Aux 36858 v_1 := v.Args[1] 36859 if v_1.Op != OpAddr { 36860 break 36861 } 36862 b := v_1.Aux 36863 v.reset(OpConstBool) 36864 v.AuxInt = b2i(a != b) 36865 return true 36866 } 36867 // match: (NeqPtr (Addr {b} _) (Addr {a} _)) 36868 // result: (ConstBool [b2i(a != b)]) 36869 for { 36870 _ = v.Args[1] 36871 v_0 := v.Args[0] 36872 if v_0.Op != OpAddr { 36873 break 36874 } 36875 b := v_0.Aux 36876 v_1 := v.Args[1] 36877 if v_1.Op != OpAddr { 36878 break 36879 } 36880 a := v_1.Aux 36881 v.reset(OpConstBool) 36882 v.AuxInt = b2i(a != b) 36883 return true 36884 } 36885 // match: (NeqPtr (Addr {a} _) (OffPtr [o] (Addr {b} _))) 36886 // result: (ConstBool [b2i(a != b || o != 0)]) 36887 for { 36888 _ = v.Args[1] 36889 v_0 := v.Args[0] 36890 if v_0.Op != OpAddr { 36891 break 36892 } 36893 a := v_0.Aux 36894 v_1 := v.Args[1] 36895 if v_1.Op != OpOffPtr { 36896 break 36897 } 36898 o := v_1.AuxInt 36899 v_1_0 := v_1.Args[0] 36900 if v_1_0.Op != OpAddr { 36901 break 36902 } 36903 b := v_1_0.Aux 36904 v.reset(OpConstBool) 36905 v.AuxInt = b2i(a != b || o != 0) 36906 return true 36907 } 36908 // match: (NeqPtr (OffPtr [o] (Addr {b} _)) (Addr {a} _)) 36909 // result: (ConstBool [b2i(a != b || o != 0)]) 36910 for { 36911 _ = v.Args[1] 36912 v_0 := v.Args[0] 36913 if v_0.Op != OpOffPtr { 36914 break 36915 } 36916 o := v_0.AuxInt 36917 v_0_0 := v_0.Args[0] 36918 if v_0_0.Op != OpAddr { 36919 break 36920 } 36921 b := v_0_0.Aux 36922 v_1 := v.Args[1] 36923 if v_1.Op != OpAddr { 36924 break 36925 } 36926 a := v_1.Aux 36927 v.reset(OpConstBool) 36928 v.AuxInt = b2i(a != b || o != 0) 36929 return true 36930 } 36931 // match: (NeqPtr (OffPtr [o1] (Addr {a} _)) (OffPtr [o2] (Addr {b} _))) 36932 // result: (ConstBool [b2i(a != b || o1 != o2)]) 36933 for { 36934 _ = v.Args[1] 36935 v_0 := v.Args[0] 36936 if v_0.Op != OpOffPtr { 36937 break 36938 } 36939 o1 := v_0.AuxInt 36940 v_0_0 := v_0.Args[0] 36941 if v_0_0.Op != OpAddr { 36942 break 36943 } 36944 a := v_0_0.Aux 36945 v_1 := v.Args[1] 36946 if v_1.Op != OpOffPtr { 36947 break 36948 } 36949 o2 := v_1.AuxInt 36950 v_1_0 := v_1.Args[0] 36951 if v_1_0.Op != OpAddr { 36952 break 36953 } 36954 b := v_1_0.Aux 36955 v.reset(OpConstBool) 36956 v.AuxInt = b2i(a != b || o1 != o2) 36957 return true 36958 } 36959 // match: (NeqPtr (OffPtr [o2] (Addr {b} _)) (OffPtr [o1] (Addr {a} _))) 36960 // result: (ConstBool [b2i(a != b || o1 != o2)]) 36961 for { 36962 _ = v.Args[1] 36963 v_0 := v.Args[0] 36964 if v_0.Op != OpOffPtr { 36965 break 36966 } 36967 o2 := v_0.AuxInt 36968 v_0_0 := v_0.Args[0] 36969 if v_0_0.Op != OpAddr { 36970 break 36971 } 36972 b := v_0_0.Aux 36973 v_1 := v.Args[1] 36974 if v_1.Op != OpOffPtr { 36975 break 36976 } 36977 o1 := v_1.AuxInt 36978 v_1_0 := v_1.Args[0] 36979 if v_1_0.Op != OpAddr { 36980 break 36981 } 36982 a := v_1_0.Aux 36983 v.reset(OpConstBool) 36984 v.AuxInt = b2i(a != b || o1 != o2) 36985 return true 36986 } 36987 // match: (NeqPtr (LocalAddr {a} _ _) (LocalAddr {b} _ _)) 36988 // result: (ConstBool [b2i(a != b)]) 36989 for { 36990 _ = v.Args[1] 36991 v_0 := v.Args[0] 36992 if v_0.Op != OpLocalAddr { 36993 break 36994 } 36995 a := v_0.Aux 36996 _ = v_0.Args[1] 36997 v_1 := v.Args[1] 36998 if v_1.Op != OpLocalAddr { 36999 break 37000 } 37001 b := v_1.Aux 37002 _ = v_1.Args[1] 37003 v.reset(OpConstBool) 37004 v.AuxInt = b2i(a != b) 37005 return true 37006 } 37007 // match: (NeqPtr (LocalAddr {b} _ _) (LocalAddr {a} _ _)) 37008 // result: (ConstBool [b2i(a != b)]) 37009 for { 37010 _ = v.Args[1] 37011 v_0 := v.Args[0] 37012 if v_0.Op != OpLocalAddr { 37013 break 37014 } 37015 b := v_0.Aux 37016 _ = v_0.Args[1] 37017 v_1 := v.Args[1] 37018 if v_1.Op != OpLocalAddr { 37019 break 37020 } 37021 a := v_1.Aux 37022 _ = v_1.Args[1] 37023 v.reset(OpConstBool) 37024 v.AuxInt = b2i(a != b) 37025 return true 37026 } 37027 // match: (NeqPtr (LocalAddr {a} _ _) (OffPtr [o] (LocalAddr {b} _ _))) 37028 // result: (ConstBool [b2i(a != b || o != 0)]) 37029 for { 37030 _ = v.Args[1] 37031 v_0 := v.Args[0] 37032 if v_0.Op != OpLocalAddr { 37033 break 37034 } 37035 a := v_0.Aux 37036 _ = v_0.Args[1] 37037 v_1 := v.Args[1] 37038 if v_1.Op != OpOffPtr { 37039 break 37040 } 37041 o := v_1.AuxInt 37042 v_1_0 := v_1.Args[0] 37043 if v_1_0.Op != OpLocalAddr { 37044 break 37045 } 37046 b := v_1_0.Aux 37047 _ = v_1_0.Args[1] 37048 v.reset(OpConstBool) 37049 v.AuxInt = b2i(a != b || o != 0) 37050 return true 37051 } 37052 return false 37053 } 37054 func rewriteValuegeneric_OpNeqPtr_10(v *Value) bool { 37055 // match: (NeqPtr (OffPtr [o] (LocalAddr {b} _ _)) (LocalAddr {a} _ _)) 37056 // result: (ConstBool [b2i(a != b || o != 0)]) 37057 for { 37058 _ = v.Args[1] 37059 v_0 := v.Args[0] 37060 if v_0.Op != OpOffPtr { 37061 break 37062 } 37063 o := v_0.AuxInt 37064 v_0_0 := v_0.Args[0] 37065 if v_0_0.Op != OpLocalAddr { 37066 break 37067 } 37068 b := v_0_0.Aux 37069 _ = v_0_0.Args[1] 37070 v_1 := v.Args[1] 37071 if v_1.Op != OpLocalAddr { 37072 break 37073 } 37074 a := v_1.Aux 37075 _ = v_1.Args[1] 37076 v.reset(OpConstBool) 37077 v.AuxInt = b2i(a != b || o != 0) 37078 return true 37079 } 37080 // match: (NeqPtr (OffPtr [o1] (LocalAddr {a} _ _)) (OffPtr [o2] (LocalAddr {b} _ _))) 37081 // result: (ConstBool [b2i(a != b || o1 != o2)]) 37082 for { 37083 _ = v.Args[1] 37084 v_0 := v.Args[0] 37085 if v_0.Op != OpOffPtr { 37086 break 37087 } 37088 o1 := v_0.AuxInt 37089 v_0_0 := v_0.Args[0] 37090 if v_0_0.Op != OpLocalAddr { 37091 break 37092 } 37093 a := v_0_0.Aux 37094 _ = v_0_0.Args[1] 37095 v_1 := v.Args[1] 37096 if v_1.Op != OpOffPtr { 37097 break 37098 } 37099 o2 := v_1.AuxInt 37100 v_1_0 := v_1.Args[0] 37101 if v_1_0.Op != OpLocalAddr { 37102 break 37103 } 37104 b := v_1_0.Aux 37105 _ = v_1_0.Args[1] 37106 v.reset(OpConstBool) 37107 v.AuxInt = b2i(a != b || o1 != o2) 37108 return true 37109 } 37110 // match: (NeqPtr (OffPtr [o2] (LocalAddr {b} _ _)) (OffPtr [o1] (LocalAddr {a} _ _))) 37111 // result: (ConstBool [b2i(a != b || o1 != o2)]) 37112 for { 37113 _ = v.Args[1] 37114 v_0 := v.Args[0] 37115 if v_0.Op != OpOffPtr { 37116 break 37117 } 37118 o2 := v_0.AuxInt 37119 v_0_0 := v_0.Args[0] 37120 if v_0_0.Op != OpLocalAddr { 37121 break 37122 } 37123 b := v_0_0.Aux 37124 _ = v_0_0.Args[1] 37125 v_1 := v.Args[1] 37126 if v_1.Op != OpOffPtr { 37127 break 37128 } 37129 o1 := v_1.AuxInt 37130 v_1_0 := v_1.Args[0] 37131 if v_1_0.Op != OpLocalAddr { 37132 break 37133 } 37134 a := v_1_0.Aux 37135 _ = v_1_0.Args[1] 37136 v.reset(OpConstBool) 37137 v.AuxInt = b2i(a != b || o1 != o2) 37138 return true 37139 } 37140 // match: (NeqPtr (OffPtr [o1] p1) p2) 37141 // cond: isSamePtr(p1, p2) 37142 // result: (ConstBool [b2i(o1 != 0)]) 37143 for { 37144 p2 := v.Args[1] 37145 v_0 := v.Args[0] 37146 if v_0.Op != OpOffPtr { 37147 break 37148 } 37149 o1 := v_0.AuxInt 37150 p1 := v_0.Args[0] 37151 if !(isSamePtr(p1, p2)) { 37152 break 37153 } 37154 v.reset(OpConstBool) 37155 v.AuxInt = b2i(o1 != 0) 37156 return true 37157 } 37158 // match: (NeqPtr p2 (OffPtr [o1] p1)) 37159 // cond: isSamePtr(p1, p2) 37160 // result: (ConstBool [b2i(o1 != 0)]) 37161 for { 37162 _ = v.Args[1] 37163 p2 := v.Args[0] 37164 v_1 := v.Args[1] 37165 if v_1.Op != OpOffPtr { 37166 break 37167 } 37168 o1 := v_1.AuxInt 37169 p1 := v_1.Args[0] 37170 if !(isSamePtr(p1, p2)) { 37171 break 37172 } 37173 v.reset(OpConstBool) 37174 v.AuxInt = b2i(o1 != 0) 37175 return true 37176 } 37177 // match: (NeqPtr (OffPtr [o1] p1) (OffPtr [o2] p2)) 37178 // cond: isSamePtr(p1, p2) 37179 // result: (ConstBool [b2i(o1 != o2)]) 37180 for { 37181 _ = v.Args[1] 37182 v_0 := v.Args[0] 37183 if v_0.Op != OpOffPtr { 37184 break 37185 } 37186 o1 := v_0.AuxInt 37187 p1 := v_0.Args[0] 37188 v_1 := v.Args[1] 37189 if v_1.Op != OpOffPtr { 37190 break 37191 } 37192 o2 := v_1.AuxInt 37193 p2 := v_1.Args[0] 37194 if !(isSamePtr(p1, p2)) { 37195 break 37196 } 37197 v.reset(OpConstBool) 37198 v.AuxInt = b2i(o1 != o2) 37199 return true 37200 } 37201 // match: (NeqPtr (OffPtr [o2] p2) (OffPtr [o1] p1)) 37202 // cond: isSamePtr(p1, p2) 37203 // result: (ConstBool [b2i(o1 != o2)]) 37204 for { 37205 _ = v.Args[1] 37206 v_0 := v.Args[0] 37207 if v_0.Op != OpOffPtr { 37208 break 37209 } 37210 o2 := v_0.AuxInt 37211 p2 := v_0.Args[0] 37212 v_1 := v.Args[1] 37213 if v_1.Op != OpOffPtr { 37214 break 37215 } 37216 o1 := v_1.AuxInt 37217 p1 := v_1.Args[0] 37218 if !(isSamePtr(p1, p2)) { 37219 break 37220 } 37221 v.reset(OpConstBool) 37222 v.AuxInt = b2i(o1 != o2) 37223 return true 37224 } 37225 // match: (NeqPtr (Const32 [c]) (Const32 [d])) 37226 // result: (ConstBool [b2i(c != d)]) 37227 for { 37228 _ = v.Args[1] 37229 v_0 := v.Args[0] 37230 if v_0.Op != OpConst32 { 37231 break 37232 } 37233 c := v_0.AuxInt 37234 v_1 := v.Args[1] 37235 if v_1.Op != OpConst32 { 37236 break 37237 } 37238 d := v_1.AuxInt 37239 v.reset(OpConstBool) 37240 v.AuxInt = b2i(c != d) 37241 return true 37242 } 37243 // match: (NeqPtr (Const32 [d]) (Const32 [c])) 37244 // result: (ConstBool [b2i(c != d)]) 37245 for { 37246 _ = v.Args[1] 37247 v_0 := v.Args[0] 37248 if v_0.Op != OpConst32 { 37249 break 37250 } 37251 d := v_0.AuxInt 37252 v_1 := v.Args[1] 37253 if v_1.Op != OpConst32 { 37254 break 37255 } 37256 c := v_1.AuxInt 37257 v.reset(OpConstBool) 37258 v.AuxInt = b2i(c != d) 37259 return true 37260 } 37261 // match: (NeqPtr (Const64 [c]) (Const64 [d])) 37262 // result: (ConstBool [b2i(c != d)]) 37263 for { 37264 _ = v.Args[1] 37265 v_0 := v.Args[0] 37266 if v_0.Op != OpConst64 { 37267 break 37268 } 37269 c := v_0.AuxInt 37270 v_1 := v.Args[1] 37271 if v_1.Op != OpConst64 { 37272 break 37273 } 37274 d := v_1.AuxInt 37275 v.reset(OpConstBool) 37276 v.AuxInt = b2i(c != d) 37277 return true 37278 } 37279 return false 37280 } 37281 func rewriteValuegeneric_OpNeqPtr_20(v *Value) bool { 37282 // match: (NeqPtr (Const64 [d]) (Const64 [c])) 37283 // result: (ConstBool [b2i(c != d)]) 37284 for { 37285 _ = v.Args[1] 37286 v_0 := v.Args[0] 37287 if v_0.Op != OpConst64 { 37288 break 37289 } 37290 d := v_0.AuxInt 37291 v_1 := v.Args[1] 37292 if v_1.Op != OpConst64 { 37293 break 37294 } 37295 c := v_1.AuxInt 37296 v.reset(OpConstBool) 37297 v.AuxInt = b2i(c != d) 37298 return true 37299 } 37300 // match: (NeqPtr (LocalAddr _ _) (Addr _)) 37301 // result: (ConstBool [1]) 37302 for { 37303 _ = v.Args[1] 37304 v_0 := v.Args[0] 37305 if v_0.Op != OpLocalAddr { 37306 break 37307 } 37308 _ = v_0.Args[1] 37309 v_1 := v.Args[1] 37310 if v_1.Op != OpAddr { 37311 break 37312 } 37313 v.reset(OpConstBool) 37314 v.AuxInt = 1 37315 return true 37316 } 37317 // match: (NeqPtr (Addr _) (LocalAddr _ _)) 37318 // result: (ConstBool [1]) 37319 for { 37320 _ = v.Args[1] 37321 v_0 := v.Args[0] 37322 if v_0.Op != OpAddr { 37323 break 37324 } 37325 v_1 := v.Args[1] 37326 if v_1.Op != OpLocalAddr { 37327 break 37328 } 37329 _ = v_1.Args[1] 37330 v.reset(OpConstBool) 37331 v.AuxInt = 1 37332 return true 37333 } 37334 // match: (NeqPtr (OffPtr (LocalAddr _ _)) (Addr _)) 37335 // result: (ConstBool [1]) 37336 for { 37337 _ = v.Args[1] 37338 v_0 := v.Args[0] 37339 if v_0.Op != OpOffPtr { 37340 break 37341 } 37342 v_0_0 := v_0.Args[0] 37343 if v_0_0.Op != OpLocalAddr { 37344 break 37345 } 37346 _ = v_0_0.Args[1] 37347 v_1 := v.Args[1] 37348 if v_1.Op != OpAddr { 37349 break 37350 } 37351 v.reset(OpConstBool) 37352 v.AuxInt = 1 37353 return true 37354 } 37355 // match: (NeqPtr (Addr _) (OffPtr (LocalAddr _ _))) 37356 // result: (ConstBool [1]) 37357 for { 37358 _ = v.Args[1] 37359 v_0 := v.Args[0] 37360 if v_0.Op != OpAddr { 37361 break 37362 } 37363 v_1 := v.Args[1] 37364 if v_1.Op != OpOffPtr { 37365 break 37366 } 37367 v_1_0 := v_1.Args[0] 37368 if v_1_0.Op != OpLocalAddr { 37369 break 37370 } 37371 _ = v_1_0.Args[1] 37372 v.reset(OpConstBool) 37373 v.AuxInt = 1 37374 return true 37375 } 37376 // match: (NeqPtr (LocalAddr _ _) (OffPtr (Addr _))) 37377 // result: (ConstBool [1]) 37378 for { 37379 _ = v.Args[1] 37380 v_0 := v.Args[0] 37381 if v_0.Op != OpLocalAddr { 37382 break 37383 } 37384 _ = v_0.Args[1] 37385 v_1 := v.Args[1] 37386 if v_1.Op != OpOffPtr { 37387 break 37388 } 37389 v_1_0 := v_1.Args[0] 37390 if v_1_0.Op != OpAddr { 37391 break 37392 } 37393 v.reset(OpConstBool) 37394 v.AuxInt = 1 37395 return true 37396 } 37397 // match: (NeqPtr (OffPtr (Addr _)) (LocalAddr _ _)) 37398 // result: (ConstBool [1]) 37399 for { 37400 _ = v.Args[1] 37401 v_0 := v.Args[0] 37402 if v_0.Op != OpOffPtr { 37403 break 37404 } 37405 v_0_0 := v_0.Args[0] 37406 if v_0_0.Op != OpAddr { 37407 break 37408 } 37409 v_1 := v.Args[1] 37410 if v_1.Op != OpLocalAddr { 37411 break 37412 } 37413 _ = v_1.Args[1] 37414 v.reset(OpConstBool) 37415 v.AuxInt = 1 37416 return true 37417 } 37418 // match: (NeqPtr (OffPtr (LocalAddr _ _)) (OffPtr (Addr _))) 37419 // result: (ConstBool [1]) 37420 for { 37421 _ = v.Args[1] 37422 v_0 := v.Args[0] 37423 if v_0.Op != OpOffPtr { 37424 break 37425 } 37426 v_0_0 := v_0.Args[0] 37427 if v_0_0.Op != OpLocalAddr { 37428 break 37429 } 37430 _ = v_0_0.Args[1] 37431 v_1 := v.Args[1] 37432 if v_1.Op != OpOffPtr { 37433 break 37434 } 37435 v_1_0 := v_1.Args[0] 37436 if v_1_0.Op != OpAddr { 37437 break 37438 } 37439 v.reset(OpConstBool) 37440 v.AuxInt = 1 37441 return true 37442 } 37443 // match: (NeqPtr (OffPtr (Addr _)) (OffPtr (LocalAddr _ _))) 37444 // result: (ConstBool [1]) 37445 for { 37446 _ = v.Args[1] 37447 v_0 := v.Args[0] 37448 if v_0.Op != OpOffPtr { 37449 break 37450 } 37451 v_0_0 := v_0.Args[0] 37452 if v_0_0.Op != OpAddr { 37453 break 37454 } 37455 v_1 := v.Args[1] 37456 if v_1.Op != OpOffPtr { 37457 break 37458 } 37459 v_1_0 := v_1.Args[0] 37460 if v_1_0.Op != OpLocalAddr { 37461 break 37462 } 37463 _ = v_1_0.Args[1] 37464 v.reset(OpConstBool) 37465 v.AuxInt = 1 37466 return true 37467 } 37468 // match: (NeqPtr (AddPtr p1 o1) p2) 37469 // cond: isSamePtr(p1, p2) 37470 // result: (IsNonNil o1) 37471 for { 37472 p2 := v.Args[1] 37473 v_0 := v.Args[0] 37474 if v_0.Op != OpAddPtr { 37475 break 37476 } 37477 o1 := v_0.Args[1] 37478 p1 := v_0.Args[0] 37479 if !(isSamePtr(p1, p2)) { 37480 break 37481 } 37482 v.reset(OpIsNonNil) 37483 v.AddArg(o1) 37484 return true 37485 } 37486 return false 37487 } 37488 func rewriteValuegeneric_OpNeqPtr_30(v *Value) bool { 37489 // match: (NeqPtr p2 (AddPtr p1 o1)) 37490 // cond: isSamePtr(p1, p2) 37491 // result: (IsNonNil o1) 37492 for { 37493 _ = v.Args[1] 37494 p2 := v.Args[0] 37495 v_1 := v.Args[1] 37496 if v_1.Op != OpAddPtr { 37497 break 37498 } 37499 o1 := v_1.Args[1] 37500 p1 := v_1.Args[0] 37501 if !(isSamePtr(p1, p2)) { 37502 break 37503 } 37504 v.reset(OpIsNonNil) 37505 v.AddArg(o1) 37506 return true 37507 } 37508 // match: (NeqPtr (Const32 [0]) p) 37509 // result: (IsNonNil p) 37510 for { 37511 p := v.Args[1] 37512 v_0 := v.Args[0] 37513 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 37514 break 37515 } 37516 v.reset(OpIsNonNil) 37517 v.AddArg(p) 37518 return true 37519 } 37520 // match: (NeqPtr p (Const32 [0])) 37521 // result: (IsNonNil p) 37522 for { 37523 _ = v.Args[1] 37524 p := v.Args[0] 37525 v_1 := v.Args[1] 37526 if v_1.Op != OpConst32 || v_1.AuxInt != 0 { 37527 break 37528 } 37529 v.reset(OpIsNonNil) 37530 v.AddArg(p) 37531 return true 37532 } 37533 // match: (NeqPtr (Const64 [0]) p) 37534 // result: (IsNonNil p) 37535 for { 37536 p := v.Args[1] 37537 v_0 := v.Args[0] 37538 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 37539 break 37540 } 37541 v.reset(OpIsNonNil) 37542 v.AddArg(p) 37543 return true 37544 } 37545 // match: (NeqPtr p (Const64 [0])) 37546 // result: (IsNonNil p) 37547 for { 37548 _ = v.Args[1] 37549 p := v.Args[0] 37550 v_1 := v.Args[1] 37551 if v_1.Op != OpConst64 || v_1.AuxInt != 0 { 37552 break 37553 } 37554 v.reset(OpIsNonNil) 37555 v.AddArg(p) 37556 return true 37557 } 37558 // match: (NeqPtr (ConstNil) p) 37559 // result: (IsNonNil p) 37560 for { 37561 p := v.Args[1] 37562 v_0 := v.Args[0] 37563 if v_0.Op != OpConstNil { 37564 break 37565 } 37566 v.reset(OpIsNonNil) 37567 v.AddArg(p) 37568 return true 37569 } 37570 // match: (NeqPtr p (ConstNil)) 37571 // result: (IsNonNil p) 37572 for { 37573 _ = v.Args[1] 37574 p := v.Args[0] 37575 v_1 := v.Args[1] 37576 if v_1.Op != OpConstNil { 37577 break 37578 } 37579 v.reset(OpIsNonNil) 37580 v.AddArg(p) 37581 return true 37582 } 37583 return false 37584 } 37585 func rewriteValuegeneric_OpNeqSlice_0(v *Value) bool { 37586 b := v.Block 37587 typ := &b.Func.Config.Types 37588 // match: (NeqSlice x y) 37589 // result: (NeqPtr (SlicePtr x) (SlicePtr y)) 37590 for { 37591 y := v.Args[1] 37592 x := v.Args[0] 37593 v.reset(OpNeqPtr) 37594 v0 := b.NewValue0(v.Pos, OpSlicePtr, typ.BytePtr) 37595 v0.AddArg(x) 37596 v.AddArg(v0) 37597 v1 := b.NewValue0(v.Pos, OpSlicePtr, typ.BytePtr) 37598 v1.AddArg(y) 37599 v.AddArg(v1) 37600 return true 37601 } 37602 } 37603 func rewriteValuegeneric_OpNilCheck_0(v *Value) bool { 37604 b := v.Block 37605 config := b.Func.Config 37606 fe := b.Func.fe 37607 // match: (NilCheck (GetG mem) mem) 37608 // result: mem 37609 for { 37610 mem := v.Args[1] 37611 v_0 := v.Args[0] 37612 if v_0.Op != OpGetG || mem != v_0.Args[0] { 37613 break 37614 } 37615 v.reset(OpCopy) 37616 v.Type = mem.Type 37617 v.AddArg(mem) 37618 return true 37619 } 37620 // match: (NilCheck (Load (OffPtr [c] (SP)) (StaticCall {sym} _)) _) 37621 // cond: isSameSym(sym, "runtime.newobject") && c == config.ctxt.FixedFrameSize() + config.RegSize && warnRule(fe.Debug_checknil(), v, "removed nil check") 37622 // result: (Invalid) 37623 for { 37624 _ = v.Args[1] 37625 v_0 := v.Args[0] 37626 if v_0.Op != OpLoad { 37627 break 37628 } 37629 _ = v_0.Args[1] 37630 v_0_0 := v_0.Args[0] 37631 if v_0_0.Op != OpOffPtr { 37632 break 37633 } 37634 c := v_0_0.AuxInt 37635 v_0_0_0 := v_0_0.Args[0] 37636 if v_0_0_0.Op != OpSP { 37637 break 37638 } 37639 v_0_1 := v_0.Args[1] 37640 if v_0_1.Op != OpStaticCall { 37641 break 37642 } 37643 sym := v_0_1.Aux 37644 if !(isSameSym(sym, "runtime.newobject") && c == config.ctxt.FixedFrameSize()+config.RegSize && warnRule(fe.Debug_checknil(), v, "removed nil check")) { 37645 break 37646 } 37647 v.reset(OpInvalid) 37648 return true 37649 } 37650 // match: (NilCheck (OffPtr (Load (OffPtr [c] (SP)) (StaticCall {sym} _))) _) 37651 // cond: isSameSym(sym, "runtime.newobject") && c == config.ctxt.FixedFrameSize() + config.RegSize && warnRule(fe.Debug_checknil(), v, "removed nil check") 37652 // result: (Invalid) 37653 for { 37654 _ = v.Args[1] 37655 v_0 := v.Args[0] 37656 if v_0.Op != OpOffPtr { 37657 break 37658 } 37659 v_0_0 := v_0.Args[0] 37660 if v_0_0.Op != OpLoad { 37661 break 37662 } 37663 _ = v_0_0.Args[1] 37664 v_0_0_0 := v_0_0.Args[0] 37665 if v_0_0_0.Op != OpOffPtr { 37666 break 37667 } 37668 c := v_0_0_0.AuxInt 37669 v_0_0_0_0 := v_0_0_0.Args[0] 37670 if v_0_0_0_0.Op != OpSP { 37671 break 37672 } 37673 v_0_0_1 := v_0_0.Args[1] 37674 if v_0_0_1.Op != OpStaticCall { 37675 break 37676 } 37677 sym := v_0_0_1.Aux 37678 if !(isSameSym(sym, "runtime.newobject") && c == config.ctxt.FixedFrameSize()+config.RegSize && warnRule(fe.Debug_checknil(), v, "removed nil check")) { 37679 break 37680 } 37681 v.reset(OpInvalid) 37682 return true 37683 } 37684 return false 37685 } 37686 func rewriteValuegeneric_OpNot_0(v *Value) bool { 37687 // match: (Not (ConstBool [c])) 37688 // result: (ConstBool [1-c]) 37689 for { 37690 v_0 := v.Args[0] 37691 if v_0.Op != OpConstBool { 37692 break 37693 } 37694 c := v_0.AuxInt 37695 v.reset(OpConstBool) 37696 v.AuxInt = 1 - c 37697 return true 37698 } 37699 // match: (Not (Eq64 x y)) 37700 // result: (Neq64 x y) 37701 for { 37702 v_0 := v.Args[0] 37703 if v_0.Op != OpEq64 { 37704 break 37705 } 37706 y := v_0.Args[1] 37707 x := v_0.Args[0] 37708 v.reset(OpNeq64) 37709 v.AddArg(x) 37710 v.AddArg(y) 37711 return true 37712 } 37713 // match: (Not (Eq32 x y)) 37714 // result: (Neq32 x y) 37715 for { 37716 v_0 := v.Args[0] 37717 if v_0.Op != OpEq32 { 37718 break 37719 } 37720 y := v_0.Args[1] 37721 x := v_0.Args[0] 37722 v.reset(OpNeq32) 37723 v.AddArg(x) 37724 v.AddArg(y) 37725 return true 37726 } 37727 // match: (Not (Eq16 x y)) 37728 // result: (Neq16 x y) 37729 for { 37730 v_0 := v.Args[0] 37731 if v_0.Op != OpEq16 { 37732 break 37733 } 37734 y := v_0.Args[1] 37735 x := v_0.Args[0] 37736 v.reset(OpNeq16) 37737 v.AddArg(x) 37738 v.AddArg(y) 37739 return true 37740 } 37741 // match: (Not (Eq8 x y)) 37742 // result: (Neq8 x y) 37743 for { 37744 v_0 := v.Args[0] 37745 if v_0.Op != OpEq8 { 37746 break 37747 } 37748 y := v_0.Args[1] 37749 x := v_0.Args[0] 37750 v.reset(OpNeq8) 37751 v.AddArg(x) 37752 v.AddArg(y) 37753 return true 37754 } 37755 // match: (Not (EqB x y)) 37756 // result: (NeqB x y) 37757 for { 37758 v_0 := v.Args[0] 37759 if v_0.Op != OpEqB { 37760 break 37761 } 37762 y := v_0.Args[1] 37763 x := v_0.Args[0] 37764 v.reset(OpNeqB) 37765 v.AddArg(x) 37766 v.AddArg(y) 37767 return true 37768 } 37769 // match: (Not (EqPtr x y)) 37770 // result: (NeqPtr x y) 37771 for { 37772 v_0 := v.Args[0] 37773 if v_0.Op != OpEqPtr { 37774 break 37775 } 37776 y := v_0.Args[1] 37777 x := v_0.Args[0] 37778 v.reset(OpNeqPtr) 37779 v.AddArg(x) 37780 v.AddArg(y) 37781 return true 37782 } 37783 // match: (Not (Eq64F x y)) 37784 // result: (Neq64F x y) 37785 for { 37786 v_0 := v.Args[0] 37787 if v_0.Op != OpEq64F { 37788 break 37789 } 37790 y := v_0.Args[1] 37791 x := v_0.Args[0] 37792 v.reset(OpNeq64F) 37793 v.AddArg(x) 37794 v.AddArg(y) 37795 return true 37796 } 37797 // match: (Not (Eq32F x y)) 37798 // result: (Neq32F x y) 37799 for { 37800 v_0 := v.Args[0] 37801 if v_0.Op != OpEq32F { 37802 break 37803 } 37804 y := v_0.Args[1] 37805 x := v_0.Args[0] 37806 v.reset(OpNeq32F) 37807 v.AddArg(x) 37808 v.AddArg(y) 37809 return true 37810 } 37811 // match: (Not (Neq64 x y)) 37812 // result: (Eq64 x y) 37813 for { 37814 v_0 := v.Args[0] 37815 if v_0.Op != OpNeq64 { 37816 break 37817 } 37818 y := v_0.Args[1] 37819 x := v_0.Args[0] 37820 v.reset(OpEq64) 37821 v.AddArg(x) 37822 v.AddArg(y) 37823 return true 37824 } 37825 return false 37826 } 37827 func rewriteValuegeneric_OpNot_10(v *Value) bool { 37828 // match: (Not (Neq32 x y)) 37829 // result: (Eq32 x y) 37830 for { 37831 v_0 := v.Args[0] 37832 if v_0.Op != OpNeq32 { 37833 break 37834 } 37835 y := v_0.Args[1] 37836 x := v_0.Args[0] 37837 v.reset(OpEq32) 37838 v.AddArg(x) 37839 v.AddArg(y) 37840 return true 37841 } 37842 // match: (Not (Neq16 x y)) 37843 // result: (Eq16 x y) 37844 for { 37845 v_0 := v.Args[0] 37846 if v_0.Op != OpNeq16 { 37847 break 37848 } 37849 y := v_0.Args[1] 37850 x := v_0.Args[0] 37851 v.reset(OpEq16) 37852 v.AddArg(x) 37853 v.AddArg(y) 37854 return true 37855 } 37856 // match: (Not (Neq8 x y)) 37857 // result: (Eq8 x y) 37858 for { 37859 v_0 := v.Args[0] 37860 if v_0.Op != OpNeq8 { 37861 break 37862 } 37863 y := v_0.Args[1] 37864 x := v_0.Args[0] 37865 v.reset(OpEq8) 37866 v.AddArg(x) 37867 v.AddArg(y) 37868 return true 37869 } 37870 // match: (Not (NeqB x y)) 37871 // result: (EqB x y) 37872 for { 37873 v_0 := v.Args[0] 37874 if v_0.Op != OpNeqB { 37875 break 37876 } 37877 y := v_0.Args[1] 37878 x := v_0.Args[0] 37879 v.reset(OpEqB) 37880 v.AddArg(x) 37881 v.AddArg(y) 37882 return true 37883 } 37884 // match: (Not (NeqPtr x y)) 37885 // result: (EqPtr x y) 37886 for { 37887 v_0 := v.Args[0] 37888 if v_0.Op != OpNeqPtr { 37889 break 37890 } 37891 y := v_0.Args[1] 37892 x := v_0.Args[0] 37893 v.reset(OpEqPtr) 37894 v.AddArg(x) 37895 v.AddArg(y) 37896 return true 37897 } 37898 // match: (Not (Neq64F x y)) 37899 // result: (Eq64F x y) 37900 for { 37901 v_0 := v.Args[0] 37902 if v_0.Op != OpNeq64F { 37903 break 37904 } 37905 y := v_0.Args[1] 37906 x := v_0.Args[0] 37907 v.reset(OpEq64F) 37908 v.AddArg(x) 37909 v.AddArg(y) 37910 return true 37911 } 37912 // match: (Not (Neq32F x y)) 37913 // result: (Eq32F x y) 37914 for { 37915 v_0 := v.Args[0] 37916 if v_0.Op != OpNeq32F { 37917 break 37918 } 37919 y := v_0.Args[1] 37920 x := v_0.Args[0] 37921 v.reset(OpEq32F) 37922 v.AddArg(x) 37923 v.AddArg(y) 37924 return true 37925 } 37926 // match: (Not (Greater64 x y)) 37927 // result: (Leq64 x y) 37928 for { 37929 v_0 := v.Args[0] 37930 if v_0.Op != OpGreater64 { 37931 break 37932 } 37933 y := v_0.Args[1] 37934 x := v_0.Args[0] 37935 v.reset(OpLeq64) 37936 v.AddArg(x) 37937 v.AddArg(y) 37938 return true 37939 } 37940 // match: (Not (Greater32 x y)) 37941 // result: (Leq32 x y) 37942 for { 37943 v_0 := v.Args[0] 37944 if v_0.Op != OpGreater32 { 37945 break 37946 } 37947 y := v_0.Args[1] 37948 x := v_0.Args[0] 37949 v.reset(OpLeq32) 37950 v.AddArg(x) 37951 v.AddArg(y) 37952 return true 37953 } 37954 // match: (Not (Greater16 x y)) 37955 // result: (Leq16 x y) 37956 for { 37957 v_0 := v.Args[0] 37958 if v_0.Op != OpGreater16 { 37959 break 37960 } 37961 y := v_0.Args[1] 37962 x := v_0.Args[0] 37963 v.reset(OpLeq16) 37964 v.AddArg(x) 37965 v.AddArg(y) 37966 return true 37967 } 37968 return false 37969 } 37970 func rewriteValuegeneric_OpNot_20(v *Value) bool { 37971 // match: (Not (Greater8 x y)) 37972 // result: (Leq8 x y) 37973 for { 37974 v_0 := v.Args[0] 37975 if v_0.Op != OpGreater8 { 37976 break 37977 } 37978 y := v_0.Args[1] 37979 x := v_0.Args[0] 37980 v.reset(OpLeq8) 37981 v.AddArg(x) 37982 v.AddArg(y) 37983 return true 37984 } 37985 // match: (Not (Greater64U x y)) 37986 // result: (Leq64U x y) 37987 for { 37988 v_0 := v.Args[0] 37989 if v_0.Op != OpGreater64U { 37990 break 37991 } 37992 y := v_0.Args[1] 37993 x := v_0.Args[0] 37994 v.reset(OpLeq64U) 37995 v.AddArg(x) 37996 v.AddArg(y) 37997 return true 37998 } 37999 // match: (Not (Greater32U x y)) 38000 // result: (Leq32U x y) 38001 for { 38002 v_0 := v.Args[0] 38003 if v_0.Op != OpGreater32U { 38004 break 38005 } 38006 y := v_0.Args[1] 38007 x := v_0.Args[0] 38008 v.reset(OpLeq32U) 38009 v.AddArg(x) 38010 v.AddArg(y) 38011 return true 38012 } 38013 // match: (Not (Greater16U x y)) 38014 // result: (Leq16U x y) 38015 for { 38016 v_0 := v.Args[0] 38017 if v_0.Op != OpGreater16U { 38018 break 38019 } 38020 y := v_0.Args[1] 38021 x := v_0.Args[0] 38022 v.reset(OpLeq16U) 38023 v.AddArg(x) 38024 v.AddArg(y) 38025 return true 38026 } 38027 // match: (Not (Greater8U x y)) 38028 // result: (Leq8U x y) 38029 for { 38030 v_0 := v.Args[0] 38031 if v_0.Op != OpGreater8U { 38032 break 38033 } 38034 y := v_0.Args[1] 38035 x := v_0.Args[0] 38036 v.reset(OpLeq8U) 38037 v.AddArg(x) 38038 v.AddArg(y) 38039 return true 38040 } 38041 // match: (Not (Geq64 x y)) 38042 // result: (Less64 x y) 38043 for { 38044 v_0 := v.Args[0] 38045 if v_0.Op != OpGeq64 { 38046 break 38047 } 38048 y := v_0.Args[1] 38049 x := v_0.Args[0] 38050 v.reset(OpLess64) 38051 v.AddArg(x) 38052 v.AddArg(y) 38053 return true 38054 } 38055 // match: (Not (Geq32 x y)) 38056 // result: (Less32 x y) 38057 for { 38058 v_0 := v.Args[0] 38059 if v_0.Op != OpGeq32 { 38060 break 38061 } 38062 y := v_0.Args[1] 38063 x := v_0.Args[0] 38064 v.reset(OpLess32) 38065 v.AddArg(x) 38066 v.AddArg(y) 38067 return true 38068 } 38069 // match: (Not (Geq16 x y)) 38070 // result: (Less16 x y) 38071 for { 38072 v_0 := v.Args[0] 38073 if v_0.Op != OpGeq16 { 38074 break 38075 } 38076 y := v_0.Args[1] 38077 x := v_0.Args[0] 38078 v.reset(OpLess16) 38079 v.AddArg(x) 38080 v.AddArg(y) 38081 return true 38082 } 38083 // match: (Not (Geq8 x y)) 38084 // result: (Less8 x y) 38085 for { 38086 v_0 := v.Args[0] 38087 if v_0.Op != OpGeq8 { 38088 break 38089 } 38090 y := v_0.Args[1] 38091 x := v_0.Args[0] 38092 v.reset(OpLess8) 38093 v.AddArg(x) 38094 v.AddArg(y) 38095 return true 38096 } 38097 // match: (Not (Geq64U x y)) 38098 // result: (Less64U x y) 38099 for { 38100 v_0 := v.Args[0] 38101 if v_0.Op != OpGeq64U { 38102 break 38103 } 38104 y := v_0.Args[1] 38105 x := v_0.Args[0] 38106 v.reset(OpLess64U) 38107 v.AddArg(x) 38108 v.AddArg(y) 38109 return true 38110 } 38111 return false 38112 } 38113 func rewriteValuegeneric_OpNot_30(v *Value) bool { 38114 // match: (Not (Geq32U x y)) 38115 // result: (Less32U x y) 38116 for { 38117 v_0 := v.Args[0] 38118 if v_0.Op != OpGeq32U { 38119 break 38120 } 38121 y := v_0.Args[1] 38122 x := v_0.Args[0] 38123 v.reset(OpLess32U) 38124 v.AddArg(x) 38125 v.AddArg(y) 38126 return true 38127 } 38128 // match: (Not (Geq16U x y)) 38129 // result: (Less16U x y) 38130 for { 38131 v_0 := v.Args[0] 38132 if v_0.Op != OpGeq16U { 38133 break 38134 } 38135 y := v_0.Args[1] 38136 x := v_0.Args[0] 38137 v.reset(OpLess16U) 38138 v.AddArg(x) 38139 v.AddArg(y) 38140 return true 38141 } 38142 // match: (Not (Geq8U x y)) 38143 // result: (Less8U x y) 38144 for { 38145 v_0 := v.Args[0] 38146 if v_0.Op != OpGeq8U { 38147 break 38148 } 38149 y := v_0.Args[1] 38150 x := v_0.Args[0] 38151 v.reset(OpLess8U) 38152 v.AddArg(x) 38153 v.AddArg(y) 38154 return true 38155 } 38156 // match: (Not (Less64 x y)) 38157 // result: (Geq64 x y) 38158 for { 38159 v_0 := v.Args[0] 38160 if v_0.Op != OpLess64 { 38161 break 38162 } 38163 y := v_0.Args[1] 38164 x := v_0.Args[0] 38165 v.reset(OpGeq64) 38166 v.AddArg(x) 38167 v.AddArg(y) 38168 return true 38169 } 38170 // match: (Not (Less32 x y)) 38171 // result: (Geq32 x y) 38172 for { 38173 v_0 := v.Args[0] 38174 if v_0.Op != OpLess32 { 38175 break 38176 } 38177 y := v_0.Args[1] 38178 x := v_0.Args[0] 38179 v.reset(OpGeq32) 38180 v.AddArg(x) 38181 v.AddArg(y) 38182 return true 38183 } 38184 // match: (Not (Less16 x y)) 38185 // result: (Geq16 x y) 38186 for { 38187 v_0 := v.Args[0] 38188 if v_0.Op != OpLess16 { 38189 break 38190 } 38191 y := v_0.Args[1] 38192 x := v_0.Args[0] 38193 v.reset(OpGeq16) 38194 v.AddArg(x) 38195 v.AddArg(y) 38196 return true 38197 } 38198 // match: (Not (Less8 x y)) 38199 // result: (Geq8 x y) 38200 for { 38201 v_0 := v.Args[0] 38202 if v_0.Op != OpLess8 { 38203 break 38204 } 38205 y := v_0.Args[1] 38206 x := v_0.Args[0] 38207 v.reset(OpGeq8) 38208 v.AddArg(x) 38209 v.AddArg(y) 38210 return true 38211 } 38212 // match: (Not (Less64U x y)) 38213 // result: (Geq64U x y) 38214 for { 38215 v_0 := v.Args[0] 38216 if v_0.Op != OpLess64U { 38217 break 38218 } 38219 y := v_0.Args[1] 38220 x := v_0.Args[0] 38221 v.reset(OpGeq64U) 38222 v.AddArg(x) 38223 v.AddArg(y) 38224 return true 38225 } 38226 // match: (Not (Less32U x y)) 38227 // result: (Geq32U x y) 38228 for { 38229 v_0 := v.Args[0] 38230 if v_0.Op != OpLess32U { 38231 break 38232 } 38233 y := v_0.Args[1] 38234 x := v_0.Args[0] 38235 v.reset(OpGeq32U) 38236 v.AddArg(x) 38237 v.AddArg(y) 38238 return true 38239 } 38240 // match: (Not (Less16U x y)) 38241 // result: (Geq16U x y) 38242 for { 38243 v_0 := v.Args[0] 38244 if v_0.Op != OpLess16U { 38245 break 38246 } 38247 y := v_0.Args[1] 38248 x := v_0.Args[0] 38249 v.reset(OpGeq16U) 38250 v.AddArg(x) 38251 v.AddArg(y) 38252 return true 38253 } 38254 return false 38255 } 38256 func rewriteValuegeneric_OpNot_40(v *Value) bool { 38257 // match: (Not (Less8U x y)) 38258 // result: (Geq8U x y) 38259 for { 38260 v_0 := v.Args[0] 38261 if v_0.Op != OpLess8U { 38262 break 38263 } 38264 y := v_0.Args[1] 38265 x := v_0.Args[0] 38266 v.reset(OpGeq8U) 38267 v.AddArg(x) 38268 v.AddArg(y) 38269 return true 38270 } 38271 // match: (Not (Leq64 x y)) 38272 // result: (Greater64 x y) 38273 for { 38274 v_0 := v.Args[0] 38275 if v_0.Op != OpLeq64 { 38276 break 38277 } 38278 y := v_0.Args[1] 38279 x := v_0.Args[0] 38280 v.reset(OpGreater64) 38281 v.AddArg(x) 38282 v.AddArg(y) 38283 return true 38284 } 38285 // match: (Not (Leq32 x y)) 38286 // result: (Greater32 x y) 38287 for { 38288 v_0 := v.Args[0] 38289 if v_0.Op != OpLeq32 { 38290 break 38291 } 38292 y := v_0.Args[1] 38293 x := v_0.Args[0] 38294 v.reset(OpGreater32) 38295 v.AddArg(x) 38296 v.AddArg(y) 38297 return true 38298 } 38299 // match: (Not (Leq16 x y)) 38300 // result: (Greater16 x y) 38301 for { 38302 v_0 := v.Args[0] 38303 if v_0.Op != OpLeq16 { 38304 break 38305 } 38306 y := v_0.Args[1] 38307 x := v_0.Args[0] 38308 v.reset(OpGreater16) 38309 v.AddArg(x) 38310 v.AddArg(y) 38311 return true 38312 } 38313 // match: (Not (Leq8 x y)) 38314 // result: (Greater8 x y) 38315 for { 38316 v_0 := v.Args[0] 38317 if v_0.Op != OpLeq8 { 38318 break 38319 } 38320 y := v_0.Args[1] 38321 x := v_0.Args[0] 38322 v.reset(OpGreater8) 38323 v.AddArg(x) 38324 v.AddArg(y) 38325 return true 38326 } 38327 // match: (Not (Leq64U x y)) 38328 // result: (Greater64U x y) 38329 for { 38330 v_0 := v.Args[0] 38331 if v_0.Op != OpLeq64U { 38332 break 38333 } 38334 y := v_0.Args[1] 38335 x := v_0.Args[0] 38336 v.reset(OpGreater64U) 38337 v.AddArg(x) 38338 v.AddArg(y) 38339 return true 38340 } 38341 // match: (Not (Leq32U x y)) 38342 // result: (Greater32U x y) 38343 for { 38344 v_0 := v.Args[0] 38345 if v_0.Op != OpLeq32U { 38346 break 38347 } 38348 y := v_0.Args[1] 38349 x := v_0.Args[0] 38350 v.reset(OpGreater32U) 38351 v.AddArg(x) 38352 v.AddArg(y) 38353 return true 38354 } 38355 // match: (Not (Leq16U x y)) 38356 // result: (Greater16U x y) 38357 for { 38358 v_0 := v.Args[0] 38359 if v_0.Op != OpLeq16U { 38360 break 38361 } 38362 y := v_0.Args[1] 38363 x := v_0.Args[0] 38364 v.reset(OpGreater16U) 38365 v.AddArg(x) 38366 v.AddArg(y) 38367 return true 38368 } 38369 // match: (Not (Leq8U x y)) 38370 // result: (Greater8U x y) 38371 for { 38372 v_0 := v.Args[0] 38373 if v_0.Op != OpLeq8U { 38374 break 38375 } 38376 y := v_0.Args[1] 38377 x := v_0.Args[0] 38378 v.reset(OpGreater8U) 38379 v.AddArg(x) 38380 v.AddArg(y) 38381 return true 38382 } 38383 return false 38384 } 38385 func rewriteValuegeneric_OpOffPtr_0(v *Value) bool { 38386 // match: (OffPtr (OffPtr p [b]) [a]) 38387 // result: (OffPtr p [a+b]) 38388 for { 38389 a := v.AuxInt 38390 v_0 := v.Args[0] 38391 if v_0.Op != OpOffPtr { 38392 break 38393 } 38394 b := v_0.AuxInt 38395 p := v_0.Args[0] 38396 v.reset(OpOffPtr) 38397 v.AuxInt = a + b 38398 v.AddArg(p) 38399 return true 38400 } 38401 // match: (OffPtr p [0]) 38402 // cond: v.Type.Compare(p.Type) == types.CMPeq 38403 // result: p 38404 for { 38405 if v.AuxInt != 0 { 38406 break 38407 } 38408 p := v.Args[0] 38409 if !(v.Type.Compare(p.Type) == types.CMPeq) { 38410 break 38411 } 38412 v.reset(OpCopy) 38413 v.Type = p.Type 38414 v.AddArg(p) 38415 return true 38416 } 38417 return false 38418 } 38419 func rewriteValuegeneric_OpOr16_0(v *Value) bool { 38420 // match: (Or16 (Const16 [c]) (Const16 [d])) 38421 // result: (Const16 [int64(int16(c|d))]) 38422 for { 38423 _ = v.Args[1] 38424 v_0 := v.Args[0] 38425 if v_0.Op != OpConst16 { 38426 break 38427 } 38428 c := v_0.AuxInt 38429 v_1 := v.Args[1] 38430 if v_1.Op != OpConst16 { 38431 break 38432 } 38433 d := v_1.AuxInt 38434 v.reset(OpConst16) 38435 v.AuxInt = int64(int16(c | d)) 38436 return true 38437 } 38438 // match: (Or16 (Const16 [d]) (Const16 [c])) 38439 // result: (Const16 [int64(int16(c|d))]) 38440 for { 38441 _ = v.Args[1] 38442 v_0 := v.Args[0] 38443 if v_0.Op != OpConst16 { 38444 break 38445 } 38446 d := v_0.AuxInt 38447 v_1 := v.Args[1] 38448 if v_1.Op != OpConst16 { 38449 break 38450 } 38451 c := v_1.AuxInt 38452 v.reset(OpConst16) 38453 v.AuxInt = int64(int16(c | d)) 38454 return true 38455 } 38456 // match: (Or16 x x) 38457 // result: x 38458 for { 38459 x := v.Args[1] 38460 if x != v.Args[0] { 38461 break 38462 } 38463 v.reset(OpCopy) 38464 v.Type = x.Type 38465 v.AddArg(x) 38466 return true 38467 } 38468 // match: (Or16 (Const16 [0]) x) 38469 // result: x 38470 for { 38471 x := v.Args[1] 38472 v_0 := v.Args[0] 38473 if v_0.Op != OpConst16 || v_0.AuxInt != 0 { 38474 break 38475 } 38476 v.reset(OpCopy) 38477 v.Type = x.Type 38478 v.AddArg(x) 38479 return true 38480 } 38481 // match: (Or16 x (Const16 [0])) 38482 // result: x 38483 for { 38484 _ = v.Args[1] 38485 x := v.Args[0] 38486 v_1 := v.Args[1] 38487 if v_1.Op != OpConst16 || v_1.AuxInt != 0 { 38488 break 38489 } 38490 v.reset(OpCopy) 38491 v.Type = x.Type 38492 v.AddArg(x) 38493 return true 38494 } 38495 // match: (Or16 (Const16 [-1]) _) 38496 // result: (Const16 [-1]) 38497 for { 38498 _ = v.Args[1] 38499 v_0 := v.Args[0] 38500 if v_0.Op != OpConst16 || v_0.AuxInt != -1 { 38501 break 38502 } 38503 v.reset(OpConst16) 38504 v.AuxInt = -1 38505 return true 38506 } 38507 // match: (Or16 _ (Const16 [-1])) 38508 // result: (Const16 [-1]) 38509 for { 38510 _ = v.Args[1] 38511 v_1 := v.Args[1] 38512 if v_1.Op != OpConst16 || v_1.AuxInt != -1 { 38513 break 38514 } 38515 v.reset(OpConst16) 38516 v.AuxInt = -1 38517 return true 38518 } 38519 // match: (Or16 x (Or16 x y)) 38520 // result: (Or16 x y) 38521 for { 38522 _ = v.Args[1] 38523 x := v.Args[0] 38524 v_1 := v.Args[1] 38525 if v_1.Op != OpOr16 { 38526 break 38527 } 38528 y := v_1.Args[1] 38529 if x != v_1.Args[0] { 38530 break 38531 } 38532 v.reset(OpOr16) 38533 v.AddArg(x) 38534 v.AddArg(y) 38535 return true 38536 } 38537 // match: (Or16 x (Or16 y x)) 38538 // result: (Or16 x y) 38539 for { 38540 _ = v.Args[1] 38541 x := v.Args[0] 38542 v_1 := v.Args[1] 38543 if v_1.Op != OpOr16 { 38544 break 38545 } 38546 _ = v_1.Args[1] 38547 y := v_1.Args[0] 38548 if x != v_1.Args[1] { 38549 break 38550 } 38551 v.reset(OpOr16) 38552 v.AddArg(x) 38553 v.AddArg(y) 38554 return true 38555 } 38556 // match: (Or16 (Or16 x y) x) 38557 // result: (Or16 x y) 38558 for { 38559 x := v.Args[1] 38560 v_0 := v.Args[0] 38561 if v_0.Op != OpOr16 { 38562 break 38563 } 38564 y := v_0.Args[1] 38565 if x != v_0.Args[0] { 38566 break 38567 } 38568 v.reset(OpOr16) 38569 v.AddArg(x) 38570 v.AddArg(y) 38571 return true 38572 } 38573 return false 38574 } 38575 func rewriteValuegeneric_OpOr16_10(v *Value) bool { 38576 b := v.Block 38577 // match: (Or16 (Or16 y x) x) 38578 // result: (Or16 x y) 38579 for { 38580 x := v.Args[1] 38581 v_0 := v.Args[0] 38582 if v_0.Op != OpOr16 { 38583 break 38584 } 38585 _ = v_0.Args[1] 38586 y := v_0.Args[0] 38587 if x != v_0.Args[1] { 38588 break 38589 } 38590 v.reset(OpOr16) 38591 v.AddArg(x) 38592 v.AddArg(y) 38593 return true 38594 } 38595 // match: (Or16 (And16 x (Const16 [c2])) (Const16 <t> [c1])) 38596 // cond: ^(c1 | c2) == 0 38597 // result: (Or16 (Const16 <t> [c1]) x) 38598 for { 38599 _ = v.Args[1] 38600 v_0 := v.Args[0] 38601 if v_0.Op != OpAnd16 { 38602 break 38603 } 38604 _ = v_0.Args[1] 38605 x := v_0.Args[0] 38606 v_0_1 := v_0.Args[1] 38607 if v_0_1.Op != OpConst16 { 38608 break 38609 } 38610 c2 := v_0_1.AuxInt 38611 v_1 := v.Args[1] 38612 if v_1.Op != OpConst16 { 38613 break 38614 } 38615 t := v_1.Type 38616 c1 := v_1.AuxInt 38617 if !(^(c1 | c2) == 0) { 38618 break 38619 } 38620 v.reset(OpOr16) 38621 v0 := b.NewValue0(v.Pos, OpConst16, t) 38622 v0.AuxInt = c1 38623 v.AddArg(v0) 38624 v.AddArg(x) 38625 return true 38626 } 38627 // match: (Or16 (And16 (Const16 [c2]) x) (Const16 <t> [c1])) 38628 // cond: ^(c1 | c2) == 0 38629 // result: (Or16 (Const16 <t> [c1]) x) 38630 for { 38631 _ = v.Args[1] 38632 v_0 := v.Args[0] 38633 if v_0.Op != OpAnd16 { 38634 break 38635 } 38636 x := v_0.Args[1] 38637 v_0_0 := v_0.Args[0] 38638 if v_0_0.Op != OpConst16 { 38639 break 38640 } 38641 c2 := v_0_0.AuxInt 38642 v_1 := v.Args[1] 38643 if v_1.Op != OpConst16 { 38644 break 38645 } 38646 t := v_1.Type 38647 c1 := v_1.AuxInt 38648 if !(^(c1 | c2) == 0) { 38649 break 38650 } 38651 v.reset(OpOr16) 38652 v0 := b.NewValue0(v.Pos, OpConst16, t) 38653 v0.AuxInt = c1 38654 v.AddArg(v0) 38655 v.AddArg(x) 38656 return true 38657 } 38658 // match: (Or16 (Const16 <t> [c1]) (And16 x (Const16 [c2]))) 38659 // cond: ^(c1 | c2) == 0 38660 // result: (Or16 (Const16 <t> [c1]) x) 38661 for { 38662 _ = v.Args[1] 38663 v_0 := v.Args[0] 38664 if v_0.Op != OpConst16 { 38665 break 38666 } 38667 t := v_0.Type 38668 c1 := v_0.AuxInt 38669 v_1 := v.Args[1] 38670 if v_1.Op != OpAnd16 { 38671 break 38672 } 38673 _ = v_1.Args[1] 38674 x := v_1.Args[0] 38675 v_1_1 := v_1.Args[1] 38676 if v_1_1.Op != OpConst16 { 38677 break 38678 } 38679 c2 := v_1_1.AuxInt 38680 if !(^(c1 | c2) == 0) { 38681 break 38682 } 38683 v.reset(OpOr16) 38684 v0 := b.NewValue0(v.Pos, OpConst16, t) 38685 v0.AuxInt = c1 38686 v.AddArg(v0) 38687 v.AddArg(x) 38688 return true 38689 } 38690 // match: (Or16 (Const16 <t> [c1]) (And16 (Const16 [c2]) x)) 38691 // cond: ^(c1 | c2) == 0 38692 // result: (Or16 (Const16 <t> [c1]) x) 38693 for { 38694 _ = v.Args[1] 38695 v_0 := v.Args[0] 38696 if v_0.Op != OpConst16 { 38697 break 38698 } 38699 t := v_0.Type 38700 c1 := v_0.AuxInt 38701 v_1 := v.Args[1] 38702 if v_1.Op != OpAnd16 { 38703 break 38704 } 38705 x := v_1.Args[1] 38706 v_1_0 := v_1.Args[0] 38707 if v_1_0.Op != OpConst16 { 38708 break 38709 } 38710 c2 := v_1_0.AuxInt 38711 if !(^(c1 | c2) == 0) { 38712 break 38713 } 38714 v.reset(OpOr16) 38715 v0 := b.NewValue0(v.Pos, OpConst16, t) 38716 v0.AuxInt = c1 38717 v.AddArg(v0) 38718 v.AddArg(x) 38719 return true 38720 } 38721 // match: (Or16 (Or16 i:(Const16 <t>) z) x) 38722 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 38723 // result: (Or16 i (Or16 <t> z x)) 38724 for { 38725 x := v.Args[1] 38726 v_0 := v.Args[0] 38727 if v_0.Op != OpOr16 { 38728 break 38729 } 38730 z := v_0.Args[1] 38731 i := v_0.Args[0] 38732 if i.Op != OpConst16 { 38733 break 38734 } 38735 t := i.Type 38736 if !(z.Op != OpConst16 && x.Op != OpConst16) { 38737 break 38738 } 38739 v.reset(OpOr16) 38740 v.AddArg(i) 38741 v0 := b.NewValue0(v.Pos, OpOr16, t) 38742 v0.AddArg(z) 38743 v0.AddArg(x) 38744 v.AddArg(v0) 38745 return true 38746 } 38747 // match: (Or16 (Or16 z i:(Const16 <t>)) x) 38748 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 38749 // result: (Or16 i (Or16 <t> z x)) 38750 for { 38751 x := v.Args[1] 38752 v_0 := v.Args[0] 38753 if v_0.Op != OpOr16 { 38754 break 38755 } 38756 _ = v_0.Args[1] 38757 z := v_0.Args[0] 38758 i := v_0.Args[1] 38759 if i.Op != OpConst16 { 38760 break 38761 } 38762 t := i.Type 38763 if !(z.Op != OpConst16 && x.Op != OpConst16) { 38764 break 38765 } 38766 v.reset(OpOr16) 38767 v.AddArg(i) 38768 v0 := b.NewValue0(v.Pos, OpOr16, t) 38769 v0.AddArg(z) 38770 v0.AddArg(x) 38771 v.AddArg(v0) 38772 return true 38773 } 38774 // match: (Or16 x (Or16 i:(Const16 <t>) z)) 38775 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 38776 // result: (Or16 i (Or16 <t> z x)) 38777 for { 38778 _ = v.Args[1] 38779 x := v.Args[0] 38780 v_1 := v.Args[1] 38781 if v_1.Op != OpOr16 { 38782 break 38783 } 38784 z := v_1.Args[1] 38785 i := v_1.Args[0] 38786 if i.Op != OpConst16 { 38787 break 38788 } 38789 t := i.Type 38790 if !(z.Op != OpConst16 && x.Op != OpConst16) { 38791 break 38792 } 38793 v.reset(OpOr16) 38794 v.AddArg(i) 38795 v0 := b.NewValue0(v.Pos, OpOr16, t) 38796 v0.AddArg(z) 38797 v0.AddArg(x) 38798 v.AddArg(v0) 38799 return true 38800 } 38801 // match: (Or16 x (Or16 z i:(Const16 <t>))) 38802 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 38803 // result: (Or16 i (Or16 <t> z x)) 38804 for { 38805 _ = v.Args[1] 38806 x := v.Args[0] 38807 v_1 := v.Args[1] 38808 if v_1.Op != OpOr16 { 38809 break 38810 } 38811 _ = v_1.Args[1] 38812 z := v_1.Args[0] 38813 i := v_1.Args[1] 38814 if i.Op != OpConst16 { 38815 break 38816 } 38817 t := i.Type 38818 if !(z.Op != OpConst16 && x.Op != OpConst16) { 38819 break 38820 } 38821 v.reset(OpOr16) 38822 v.AddArg(i) 38823 v0 := b.NewValue0(v.Pos, OpOr16, t) 38824 v0.AddArg(z) 38825 v0.AddArg(x) 38826 v.AddArg(v0) 38827 return true 38828 } 38829 // match: (Or16 (Const16 <t> [c]) (Or16 (Const16 <t> [d]) x)) 38830 // result: (Or16 (Const16 <t> [int64(int16(c|d))]) x) 38831 for { 38832 _ = v.Args[1] 38833 v_0 := v.Args[0] 38834 if v_0.Op != OpConst16 { 38835 break 38836 } 38837 t := v_0.Type 38838 c := v_0.AuxInt 38839 v_1 := v.Args[1] 38840 if v_1.Op != OpOr16 { 38841 break 38842 } 38843 x := v_1.Args[1] 38844 v_1_0 := v_1.Args[0] 38845 if v_1_0.Op != OpConst16 || v_1_0.Type != t { 38846 break 38847 } 38848 d := v_1_0.AuxInt 38849 v.reset(OpOr16) 38850 v0 := b.NewValue0(v.Pos, OpConst16, t) 38851 v0.AuxInt = int64(int16(c | d)) 38852 v.AddArg(v0) 38853 v.AddArg(x) 38854 return true 38855 } 38856 return false 38857 } 38858 func rewriteValuegeneric_OpOr16_20(v *Value) bool { 38859 b := v.Block 38860 // match: (Or16 (Const16 <t> [c]) (Or16 x (Const16 <t> [d]))) 38861 // result: (Or16 (Const16 <t> [int64(int16(c|d))]) x) 38862 for { 38863 _ = v.Args[1] 38864 v_0 := v.Args[0] 38865 if v_0.Op != OpConst16 { 38866 break 38867 } 38868 t := v_0.Type 38869 c := v_0.AuxInt 38870 v_1 := v.Args[1] 38871 if v_1.Op != OpOr16 { 38872 break 38873 } 38874 _ = v_1.Args[1] 38875 x := v_1.Args[0] 38876 v_1_1 := v_1.Args[1] 38877 if v_1_1.Op != OpConst16 || v_1_1.Type != t { 38878 break 38879 } 38880 d := v_1_1.AuxInt 38881 v.reset(OpOr16) 38882 v0 := b.NewValue0(v.Pos, OpConst16, t) 38883 v0.AuxInt = int64(int16(c | d)) 38884 v.AddArg(v0) 38885 v.AddArg(x) 38886 return true 38887 } 38888 // match: (Or16 (Or16 (Const16 <t> [d]) x) (Const16 <t> [c])) 38889 // result: (Or16 (Const16 <t> [int64(int16(c|d))]) x) 38890 for { 38891 _ = v.Args[1] 38892 v_0 := v.Args[0] 38893 if v_0.Op != OpOr16 { 38894 break 38895 } 38896 x := v_0.Args[1] 38897 v_0_0 := v_0.Args[0] 38898 if v_0_0.Op != OpConst16 { 38899 break 38900 } 38901 t := v_0_0.Type 38902 d := v_0_0.AuxInt 38903 v_1 := v.Args[1] 38904 if v_1.Op != OpConst16 || v_1.Type != t { 38905 break 38906 } 38907 c := v_1.AuxInt 38908 v.reset(OpOr16) 38909 v0 := b.NewValue0(v.Pos, OpConst16, t) 38910 v0.AuxInt = int64(int16(c | d)) 38911 v.AddArg(v0) 38912 v.AddArg(x) 38913 return true 38914 } 38915 // match: (Or16 (Or16 x (Const16 <t> [d])) (Const16 <t> [c])) 38916 // result: (Or16 (Const16 <t> [int64(int16(c|d))]) x) 38917 for { 38918 _ = v.Args[1] 38919 v_0 := v.Args[0] 38920 if v_0.Op != OpOr16 { 38921 break 38922 } 38923 _ = v_0.Args[1] 38924 x := v_0.Args[0] 38925 v_0_1 := v_0.Args[1] 38926 if v_0_1.Op != OpConst16 { 38927 break 38928 } 38929 t := v_0_1.Type 38930 d := v_0_1.AuxInt 38931 v_1 := v.Args[1] 38932 if v_1.Op != OpConst16 || v_1.Type != t { 38933 break 38934 } 38935 c := v_1.AuxInt 38936 v.reset(OpOr16) 38937 v0 := b.NewValue0(v.Pos, OpConst16, t) 38938 v0.AuxInt = int64(int16(c | d)) 38939 v.AddArg(v0) 38940 v.AddArg(x) 38941 return true 38942 } 38943 return false 38944 } 38945 func rewriteValuegeneric_OpOr32_0(v *Value) bool { 38946 // match: (Or32 (Const32 [c]) (Const32 [d])) 38947 // result: (Const32 [int64(int32(c|d))]) 38948 for { 38949 _ = v.Args[1] 38950 v_0 := v.Args[0] 38951 if v_0.Op != OpConst32 { 38952 break 38953 } 38954 c := v_0.AuxInt 38955 v_1 := v.Args[1] 38956 if v_1.Op != OpConst32 { 38957 break 38958 } 38959 d := v_1.AuxInt 38960 v.reset(OpConst32) 38961 v.AuxInt = int64(int32(c | d)) 38962 return true 38963 } 38964 // match: (Or32 (Const32 [d]) (Const32 [c])) 38965 // result: (Const32 [int64(int32(c|d))]) 38966 for { 38967 _ = v.Args[1] 38968 v_0 := v.Args[0] 38969 if v_0.Op != OpConst32 { 38970 break 38971 } 38972 d := v_0.AuxInt 38973 v_1 := v.Args[1] 38974 if v_1.Op != OpConst32 { 38975 break 38976 } 38977 c := v_1.AuxInt 38978 v.reset(OpConst32) 38979 v.AuxInt = int64(int32(c | d)) 38980 return true 38981 } 38982 // match: (Or32 x x) 38983 // result: x 38984 for { 38985 x := v.Args[1] 38986 if x != v.Args[0] { 38987 break 38988 } 38989 v.reset(OpCopy) 38990 v.Type = x.Type 38991 v.AddArg(x) 38992 return true 38993 } 38994 // match: (Or32 (Const32 [0]) x) 38995 // result: x 38996 for { 38997 x := v.Args[1] 38998 v_0 := v.Args[0] 38999 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 39000 break 39001 } 39002 v.reset(OpCopy) 39003 v.Type = x.Type 39004 v.AddArg(x) 39005 return true 39006 } 39007 // match: (Or32 x (Const32 [0])) 39008 // result: x 39009 for { 39010 _ = v.Args[1] 39011 x := v.Args[0] 39012 v_1 := v.Args[1] 39013 if v_1.Op != OpConst32 || v_1.AuxInt != 0 { 39014 break 39015 } 39016 v.reset(OpCopy) 39017 v.Type = x.Type 39018 v.AddArg(x) 39019 return true 39020 } 39021 // match: (Or32 (Const32 [-1]) _) 39022 // result: (Const32 [-1]) 39023 for { 39024 _ = v.Args[1] 39025 v_0 := v.Args[0] 39026 if v_0.Op != OpConst32 || v_0.AuxInt != -1 { 39027 break 39028 } 39029 v.reset(OpConst32) 39030 v.AuxInt = -1 39031 return true 39032 } 39033 // match: (Or32 _ (Const32 [-1])) 39034 // result: (Const32 [-1]) 39035 for { 39036 _ = v.Args[1] 39037 v_1 := v.Args[1] 39038 if v_1.Op != OpConst32 || v_1.AuxInt != -1 { 39039 break 39040 } 39041 v.reset(OpConst32) 39042 v.AuxInt = -1 39043 return true 39044 } 39045 // match: (Or32 x (Or32 x y)) 39046 // result: (Or32 x y) 39047 for { 39048 _ = v.Args[1] 39049 x := v.Args[0] 39050 v_1 := v.Args[1] 39051 if v_1.Op != OpOr32 { 39052 break 39053 } 39054 y := v_1.Args[1] 39055 if x != v_1.Args[0] { 39056 break 39057 } 39058 v.reset(OpOr32) 39059 v.AddArg(x) 39060 v.AddArg(y) 39061 return true 39062 } 39063 // match: (Or32 x (Or32 y x)) 39064 // result: (Or32 x y) 39065 for { 39066 _ = v.Args[1] 39067 x := v.Args[0] 39068 v_1 := v.Args[1] 39069 if v_1.Op != OpOr32 { 39070 break 39071 } 39072 _ = v_1.Args[1] 39073 y := v_1.Args[0] 39074 if x != v_1.Args[1] { 39075 break 39076 } 39077 v.reset(OpOr32) 39078 v.AddArg(x) 39079 v.AddArg(y) 39080 return true 39081 } 39082 // match: (Or32 (Or32 x y) x) 39083 // result: (Or32 x y) 39084 for { 39085 x := v.Args[1] 39086 v_0 := v.Args[0] 39087 if v_0.Op != OpOr32 { 39088 break 39089 } 39090 y := v_0.Args[1] 39091 if x != v_0.Args[0] { 39092 break 39093 } 39094 v.reset(OpOr32) 39095 v.AddArg(x) 39096 v.AddArg(y) 39097 return true 39098 } 39099 return false 39100 } 39101 func rewriteValuegeneric_OpOr32_10(v *Value) bool { 39102 b := v.Block 39103 // match: (Or32 (Or32 y x) x) 39104 // result: (Or32 x y) 39105 for { 39106 x := v.Args[1] 39107 v_0 := v.Args[0] 39108 if v_0.Op != OpOr32 { 39109 break 39110 } 39111 _ = v_0.Args[1] 39112 y := v_0.Args[0] 39113 if x != v_0.Args[1] { 39114 break 39115 } 39116 v.reset(OpOr32) 39117 v.AddArg(x) 39118 v.AddArg(y) 39119 return true 39120 } 39121 // match: (Or32 (And32 x (Const32 [c2])) (Const32 <t> [c1])) 39122 // cond: ^(c1 | c2) == 0 39123 // result: (Or32 (Const32 <t> [c1]) x) 39124 for { 39125 _ = v.Args[1] 39126 v_0 := v.Args[0] 39127 if v_0.Op != OpAnd32 { 39128 break 39129 } 39130 _ = v_0.Args[1] 39131 x := v_0.Args[0] 39132 v_0_1 := v_0.Args[1] 39133 if v_0_1.Op != OpConst32 { 39134 break 39135 } 39136 c2 := v_0_1.AuxInt 39137 v_1 := v.Args[1] 39138 if v_1.Op != OpConst32 { 39139 break 39140 } 39141 t := v_1.Type 39142 c1 := v_1.AuxInt 39143 if !(^(c1 | c2) == 0) { 39144 break 39145 } 39146 v.reset(OpOr32) 39147 v0 := b.NewValue0(v.Pos, OpConst32, t) 39148 v0.AuxInt = c1 39149 v.AddArg(v0) 39150 v.AddArg(x) 39151 return true 39152 } 39153 // match: (Or32 (And32 (Const32 [c2]) x) (Const32 <t> [c1])) 39154 // cond: ^(c1 | c2) == 0 39155 // result: (Or32 (Const32 <t> [c1]) x) 39156 for { 39157 _ = v.Args[1] 39158 v_0 := v.Args[0] 39159 if v_0.Op != OpAnd32 { 39160 break 39161 } 39162 x := v_0.Args[1] 39163 v_0_0 := v_0.Args[0] 39164 if v_0_0.Op != OpConst32 { 39165 break 39166 } 39167 c2 := v_0_0.AuxInt 39168 v_1 := v.Args[1] 39169 if v_1.Op != OpConst32 { 39170 break 39171 } 39172 t := v_1.Type 39173 c1 := v_1.AuxInt 39174 if !(^(c1 | c2) == 0) { 39175 break 39176 } 39177 v.reset(OpOr32) 39178 v0 := b.NewValue0(v.Pos, OpConst32, t) 39179 v0.AuxInt = c1 39180 v.AddArg(v0) 39181 v.AddArg(x) 39182 return true 39183 } 39184 // match: (Or32 (Const32 <t> [c1]) (And32 x (Const32 [c2]))) 39185 // cond: ^(c1 | c2) == 0 39186 // result: (Or32 (Const32 <t> [c1]) x) 39187 for { 39188 _ = v.Args[1] 39189 v_0 := v.Args[0] 39190 if v_0.Op != OpConst32 { 39191 break 39192 } 39193 t := v_0.Type 39194 c1 := v_0.AuxInt 39195 v_1 := v.Args[1] 39196 if v_1.Op != OpAnd32 { 39197 break 39198 } 39199 _ = v_1.Args[1] 39200 x := v_1.Args[0] 39201 v_1_1 := v_1.Args[1] 39202 if v_1_1.Op != OpConst32 { 39203 break 39204 } 39205 c2 := v_1_1.AuxInt 39206 if !(^(c1 | c2) == 0) { 39207 break 39208 } 39209 v.reset(OpOr32) 39210 v0 := b.NewValue0(v.Pos, OpConst32, t) 39211 v0.AuxInt = c1 39212 v.AddArg(v0) 39213 v.AddArg(x) 39214 return true 39215 } 39216 // match: (Or32 (Const32 <t> [c1]) (And32 (Const32 [c2]) x)) 39217 // cond: ^(c1 | c2) == 0 39218 // result: (Or32 (Const32 <t> [c1]) x) 39219 for { 39220 _ = v.Args[1] 39221 v_0 := v.Args[0] 39222 if v_0.Op != OpConst32 { 39223 break 39224 } 39225 t := v_0.Type 39226 c1 := v_0.AuxInt 39227 v_1 := v.Args[1] 39228 if v_1.Op != OpAnd32 { 39229 break 39230 } 39231 x := v_1.Args[1] 39232 v_1_0 := v_1.Args[0] 39233 if v_1_0.Op != OpConst32 { 39234 break 39235 } 39236 c2 := v_1_0.AuxInt 39237 if !(^(c1 | c2) == 0) { 39238 break 39239 } 39240 v.reset(OpOr32) 39241 v0 := b.NewValue0(v.Pos, OpConst32, t) 39242 v0.AuxInt = c1 39243 v.AddArg(v0) 39244 v.AddArg(x) 39245 return true 39246 } 39247 // match: (Or32 (Or32 i:(Const32 <t>) z) x) 39248 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 39249 // result: (Or32 i (Or32 <t> z x)) 39250 for { 39251 x := v.Args[1] 39252 v_0 := v.Args[0] 39253 if v_0.Op != OpOr32 { 39254 break 39255 } 39256 z := v_0.Args[1] 39257 i := v_0.Args[0] 39258 if i.Op != OpConst32 { 39259 break 39260 } 39261 t := i.Type 39262 if !(z.Op != OpConst32 && x.Op != OpConst32) { 39263 break 39264 } 39265 v.reset(OpOr32) 39266 v.AddArg(i) 39267 v0 := b.NewValue0(v.Pos, OpOr32, t) 39268 v0.AddArg(z) 39269 v0.AddArg(x) 39270 v.AddArg(v0) 39271 return true 39272 } 39273 // match: (Or32 (Or32 z i:(Const32 <t>)) x) 39274 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 39275 // result: (Or32 i (Or32 <t> z x)) 39276 for { 39277 x := v.Args[1] 39278 v_0 := v.Args[0] 39279 if v_0.Op != OpOr32 { 39280 break 39281 } 39282 _ = v_0.Args[1] 39283 z := v_0.Args[0] 39284 i := v_0.Args[1] 39285 if i.Op != OpConst32 { 39286 break 39287 } 39288 t := i.Type 39289 if !(z.Op != OpConst32 && x.Op != OpConst32) { 39290 break 39291 } 39292 v.reset(OpOr32) 39293 v.AddArg(i) 39294 v0 := b.NewValue0(v.Pos, OpOr32, t) 39295 v0.AddArg(z) 39296 v0.AddArg(x) 39297 v.AddArg(v0) 39298 return true 39299 } 39300 // match: (Or32 x (Or32 i:(Const32 <t>) z)) 39301 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 39302 // result: (Or32 i (Or32 <t> z x)) 39303 for { 39304 _ = v.Args[1] 39305 x := v.Args[0] 39306 v_1 := v.Args[1] 39307 if v_1.Op != OpOr32 { 39308 break 39309 } 39310 z := v_1.Args[1] 39311 i := v_1.Args[0] 39312 if i.Op != OpConst32 { 39313 break 39314 } 39315 t := i.Type 39316 if !(z.Op != OpConst32 && x.Op != OpConst32) { 39317 break 39318 } 39319 v.reset(OpOr32) 39320 v.AddArg(i) 39321 v0 := b.NewValue0(v.Pos, OpOr32, t) 39322 v0.AddArg(z) 39323 v0.AddArg(x) 39324 v.AddArg(v0) 39325 return true 39326 } 39327 // match: (Or32 x (Or32 z i:(Const32 <t>))) 39328 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 39329 // result: (Or32 i (Or32 <t> z x)) 39330 for { 39331 _ = v.Args[1] 39332 x := v.Args[0] 39333 v_1 := v.Args[1] 39334 if v_1.Op != OpOr32 { 39335 break 39336 } 39337 _ = v_1.Args[1] 39338 z := v_1.Args[0] 39339 i := v_1.Args[1] 39340 if i.Op != OpConst32 { 39341 break 39342 } 39343 t := i.Type 39344 if !(z.Op != OpConst32 && x.Op != OpConst32) { 39345 break 39346 } 39347 v.reset(OpOr32) 39348 v.AddArg(i) 39349 v0 := b.NewValue0(v.Pos, OpOr32, t) 39350 v0.AddArg(z) 39351 v0.AddArg(x) 39352 v.AddArg(v0) 39353 return true 39354 } 39355 // match: (Or32 (Const32 <t> [c]) (Or32 (Const32 <t> [d]) x)) 39356 // result: (Or32 (Const32 <t> [int64(int32(c|d))]) x) 39357 for { 39358 _ = v.Args[1] 39359 v_0 := v.Args[0] 39360 if v_0.Op != OpConst32 { 39361 break 39362 } 39363 t := v_0.Type 39364 c := v_0.AuxInt 39365 v_1 := v.Args[1] 39366 if v_1.Op != OpOr32 { 39367 break 39368 } 39369 x := v_1.Args[1] 39370 v_1_0 := v_1.Args[0] 39371 if v_1_0.Op != OpConst32 || v_1_0.Type != t { 39372 break 39373 } 39374 d := v_1_0.AuxInt 39375 v.reset(OpOr32) 39376 v0 := b.NewValue0(v.Pos, OpConst32, t) 39377 v0.AuxInt = int64(int32(c | d)) 39378 v.AddArg(v0) 39379 v.AddArg(x) 39380 return true 39381 } 39382 return false 39383 } 39384 func rewriteValuegeneric_OpOr32_20(v *Value) bool { 39385 b := v.Block 39386 // match: (Or32 (Const32 <t> [c]) (Or32 x (Const32 <t> [d]))) 39387 // result: (Or32 (Const32 <t> [int64(int32(c|d))]) x) 39388 for { 39389 _ = v.Args[1] 39390 v_0 := v.Args[0] 39391 if v_0.Op != OpConst32 { 39392 break 39393 } 39394 t := v_0.Type 39395 c := v_0.AuxInt 39396 v_1 := v.Args[1] 39397 if v_1.Op != OpOr32 { 39398 break 39399 } 39400 _ = v_1.Args[1] 39401 x := v_1.Args[0] 39402 v_1_1 := v_1.Args[1] 39403 if v_1_1.Op != OpConst32 || v_1_1.Type != t { 39404 break 39405 } 39406 d := v_1_1.AuxInt 39407 v.reset(OpOr32) 39408 v0 := b.NewValue0(v.Pos, OpConst32, t) 39409 v0.AuxInt = int64(int32(c | d)) 39410 v.AddArg(v0) 39411 v.AddArg(x) 39412 return true 39413 } 39414 // match: (Or32 (Or32 (Const32 <t> [d]) x) (Const32 <t> [c])) 39415 // result: (Or32 (Const32 <t> [int64(int32(c|d))]) x) 39416 for { 39417 _ = v.Args[1] 39418 v_0 := v.Args[0] 39419 if v_0.Op != OpOr32 { 39420 break 39421 } 39422 x := v_0.Args[1] 39423 v_0_0 := v_0.Args[0] 39424 if v_0_0.Op != OpConst32 { 39425 break 39426 } 39427 t := v_0_0.Type 39428 d := v_0_0.AuxInt 39429 v_1 := v.Args[1] 39430 if v_1.Op != OpConst32 || v_1.Type != t { 39431 break 39432 } 39433 c := v_1.AuxInt 39434 v.reset(OpOr32) 39435 v0 := b.NewValue0(v.Pos, OpConst32, t) 39436 v0.AuxInt = int64(int32(c | d)) 39437 v.AddArg(v0) 39438 v.AddArg(x) 39439 return true 39440 } 39441 // match: (Or32 (Or32 x (Const32 <t> [d])) (Const32 <t> [c])) 39442 // result: (Or32 (Const32 <t> [int64(int32(c|d))]) x) 39443 for { 39444 _ = v.Args[1] 39445 v_0 := v.Args[0] 39446 if v_0.Op != OpOr32 { 39447 break 39448 } 39449 _ = v_0.Args[1] 39450 x := v_0.Args[0] 39451 v_0_1 := v_0.Args[1] 39452 if v_0_1.Op != OpConst32 { 39453 break 39454 } 39455 t := v_0_1.Type 39456 d := v_0_1.AuxInt 39457 v_1 := v.Args[1] 39458 if v_1.Op != OpConst32 || v_1.Type != t { 39459 break 39460 } 39461 c := v_1.AuxInt 39462 v.reset(OpOr32) 39463 v0 := b.NewValue0(v.Pos, OpConst32, t) 39464 v0.AuxInt = int64(int32(c | d)) 39465 v.AddArg(v0) 39466 v.AddArg(x) 39467 return true 39468 } 39469 return false 39470 } 39471 func rewriteValuegeneric_OpOr64_0(v *Value) bool { 39472 // match: (Or64 (Const64 [c]) (Const64 [d])) 39473 // result: (Const64 [c|d]) 39474 for { 39475 _ = v.Args[1] 39476 v_0 := v.Args[0] 39477 if v_0.Op != OpConst64 { 39478 break 39479 } 39480 c := v_0.AuxInt 39481 v_1 := v.Args[1] 39482 if v_1.Op != OpConst64 { 39483 break 39484 } 39485 d := v_1.AuxInt 39486 v.reset(OpConst64) 39487 v.AuxInt = c | d 39488 return true 39489 } 39490 // match: (Or64 (Const64 [d]) (Const64 [c])) 39491 // result: (Const64 [c|d]) 39492 for { 39493 _ = v.Args[1] 39494 v_0 := v.Args[0] 39495 if v_0.Op != OpConst64 { 39496 break 39497 } 39498 d := v_0.AuxInt 39499 v_1 := v.Args[1] 39500 if v_1.Op != OpConst64 { 39501 break 39502 } 39503 c := v_1.AuxInt 39504 v.reset(OpConst64) 39505 v.AuxInt = c | d 39506 return true 39507 } 39508 // match: (Or64 x x) 39509 // result: x 39510 for { 39511 x := v.Args[1] 39512 if x != v.Args[0] { 39513 break 39514 } 39515 v.reset(OpCopy) 39516 v.Type = x.Type 39517 v.AddArg(x) 39518 return true 39519 } 39520 // match: (Or64 (Const64 [0]) x) 39521 // result: x 39522 for { 39523 x := v.Args[1] 39524 v_0 := v.Args[0] 39525 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 39526 break 39527 } 39528 v.reset(OpCopy) 39529 v.Type = x.Type 39530 v.AddArg(x) 39531 return true 39532 } 39533 // match: (Or64 x (Const64 [0])) 39534 // result: x 39535 for { 39536 _ = v.Args[1] 39537 x := v.Args[0] 39538 v_1 := v.Args[1] 39539 if v_1.Op != OpConst64 || v_1.AuxInt != 0 { 39540 break 39541 } 39542 v.reset(OpCopy) 39543 v.Type = x.Type 39544 v.AddArg(x) 39545 return true 39546 } 39547 // match: (Or64 (Const64 [-1]) _) 39548 // result: (Const64 [-1]) 39549 for { 39550 _ = v.Args[1] 39551 v_0 := v.Args[0] 39552 if v_0.Op != OpConst64 || v_0.AuxInt != -1 { 39553 break 39554 } 39555 v.reset(OpConst64) 39556 v.AuxInt = -1 39557 return true 39558 } 39559 // match: (Or64 _ (Const64 [-1])) 39560 // result: (Const64 [-1]) 39561 for { 39562 _ = v.Args[1] 39563 v_1 := v.Args[1] 39564 if v_1.Op != OpConst64 || v_1.AuxInt != -1 { 39565 break 39566 } 39567 v.reset(OpConst64) 39568 v.AuxInt = -1 39569 return true 39570 } 39571 // match: (Or64 x (Or64 x y)) 39572 // result: (Or64 x y) 39573 for { 39574 _ = v.Args[1] 39575 x := v.Args[0] 39576 v_1 := v.Args[1] 39577 if v_1.Op != OpOr64 { 39578 break 39579 } 39580 y := v_1.Args[1] 39581 if x != v_1.Args[0] { 39582 break 39583 } 39584 v.reset(OpOr64) 39585 v.AddArg(x) 39586 v.AddArg(y) 39587 return true 39588 } 39589 // match: (Or64 x (Or64 y x)) 39590 // result: (Or64 x y) 39591 for { 39592 _ = v.Args[1] 39593 x := v.Args[0] 39594 v_1 := v.Args[1] 39595 if v_1.Op != OpOr64 { 39596 break 39597 } 39598 _ = v_1.Args[1] 39599 y := v_1.Args[0] 39600 if x != v_1.Args[1] { 39601 break 39602 } 39603 v.reset(OpOr64) 39604 v.AddArg(x) 39605 v.AddArg(y) 39606 return true 39607 } 39608 // match: (Or64 (Or64 x y) x) 39609 // result: (Or64 x y) 39610 for { 39611 x := v.Args[1] 39612 v_0 := v.Args[0] 39613 if v_0.Op != OpOr64 { 39614 break 39615 } 39616 y := v_0.Args[1] 39617 if x != v_0.Args[0] { 39618 break 39619 } 39620 v.reset(OpOr64) 39621 v.AddArg(x) 39622 v.AddArg(y) 39623 return true 39624 } 39625 return false 39626 } 39627 func rewriteValuegeneric_OpOr64_10(v *Value) bool { 39628 b := v.Block 39629 // match: (Or64 (Or64 y x) x) 39630 // result: (Or64 x y) 39631 for { 39632 x := v.Args[1] 39633 v_0 := v.Args[0] 39634 if v_0.Op != OpOr64 { 39635 break 39636 } 39637 _ = v_0.Args[1] 39638 y := v_0.Args[0] 39639 if x != v_0.Args[1] { 39640 break 39641 } 39642 v.reset(OpOr64) 39643 v.AddArg(x) 39644 v.AddArg(y) 39645 return true 39646 } 39647 // match: (Or64 (And64 x (Const64 [c2])) (Const64 <t> [c1])) 39648 // cond: ^(c1 | c2) == 0 39649 // result: (Or64 (Const64 <t> [c1]) x) 39650 for { 39651 _ = v.Args[1] 39652 v_0 := v.Args[0] 39653 if v_0.Op != OpAnd64 { 39654 break 39655 } 39656 _ = v_0.Args[1] 39657 x := v_0.Args[0] 39658 v_0_1 := v_0.Args[1] 39659 if v_0_1.Op != OpConst64 { 39660 break 39661 } 39662 c2 := v_0_1.AuxInt 39663 v_1 := v.Args[1] 39664 if v_1.Op != OpConst64 { 39665 break 39666 } 39667 t := v_1.Type 39668 c1 := v_1.AuxInt 39669 if !(^(c1 | c2) == 0) { 39670 break 39671 } 39672 v.reset(OpOr64) 39673 v0 := b.NewValue0(v.Pos, OpConst64, t) 39674 v0.AuxInt = c1 39675 v.AddArg(v0) 39676 v.AddArg(x) 39677 return true 39678 } 39679 // match: (Or64 (And64 (Const64 [c2]) x) (Const64 <t> [c1])) 39680 // cond: ^(c1 | c2) == 0 39681 // result: (Or64 (Const64 <t> [c1]) x) 39682 for { 39683 _ = v.Args[1] 39684 v_0 := v.Args[0] 39685 if v_0.Op != OpAnd64 { 39686 break 39687 } 39688 x := v_0.Args[1] 39689 v_0_0 := v_0.Args[0] 39690 if v_0_0.Op != OpConst64 { 39691 break 39692 } 39693 c2 := v_0_0.AuxInt 39694 v_1 := v.Args[1] 39695 if v_1.Op != OpConst64 { 39696 break 39697 } 39698 t := v_1.Type 39699 c1 := v_1.AuxInt 39700 if !(^(c1 | c2) == 0) { 39701 break 39702 } 39703 v.reset(OpOr64) 39704 v0 := b.NewValue0(v.Pos, OpConst64, t) 39705 v0.AuxInt = c1 39706 v.AddArg(v0) 39707 v.AddArg(x) 39708 return true 39709 } 39710 // match: (Or64 (Const64 <t> [c1]) (And64 x (Const64 [c2]))) 39711 // cond: ^(c1 | c2) == 0 39712 // result: (Or64 (Const64 <t> [c1]) x) 39713 for { 39714 _ = v.Args[1] 39715 v_0 := v.Args[0] 39716 if v_0.Op != OpConst64 { 39717 break 39718 } 39719 t := v_0.Type 39720 c1 := v_0.AuxInt 39721 v_1 := v.Args[1] 39722 if v_1.Op != OpAnd64 { 39723 break 39724 } 39725 _ = v_1.Args[1] 39726 x := v_1.Args[0] 39727 v_1_1 := v_1.Args[1] 39728 if v_1_1.Op != OpConst64 { 39729 break 39730 } 39731 c2 := v_1_1.AuxInt 39732 if !(^(c1 | c2) == 0) { 39733 break 39734 } 39735 v.reset(OpOr64) 39736 v0 := b.NewValue0(v.Pos, OpConst64, t) 39737 v0.AuxInt = c1 39738 v.AddArg(v0) 39739 v.AddArg(x) 39740 return true 39741 } 39742 // match: (Or64 (Const64 <t> [c1]) (And64 (Const64 [c2]) x)) 39743 // cond: ^(c1 | c2) == 0 39744 // result: (Or64 (Const64 <t> [c1]) x) 39745 for { 39746 _ = v.Args[1] 39747 v_0 := v.Args[0] 39748 if v_0.Op != OpConst64 { 39749 break 39750 } 39751 t := v_0.Type 39752 c1 := v_0.AuxInt 39753 v_1 := v.Args[1] 39754 if v_1.Op != OpAnd64 { 39755 break 39756 } 39757 x := v_1.Args[1] 39758 v_1_0 := v_1.Args[0] 39759 if v_1_0.Op != OpConst64 { 39760 break 39761 } 39762 c2 := v_1_0.AuxInt 39763 if !(^(c1 | c2) == 0) { 39764 break 39765 } 39766 v.reset(OpOr64) 39767 v0 := b.NewValue0(v.Pos, OpConst64, t) 39768 v0.AuxInt = c1 39769 v.AddArg(v0) 39770 v.AddArg(x) 39771 return true 39772 } 39773 // match: (Or64 (Or64 i:(Const64 <t>) z) x) 39774 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 39775 // result: (Or64 i (Or64 <t> z x)) 39776 for { 39777 x := v.Args[1] 39778 v_0 := v.Args[0] 39779 if v_0.Op != OpOr64 { 39780 break 39781 } 39782 z := v_0.Args[1] 39783 i := v_0.Args[0] 39784 if i.Op != OpConst64 { 39785 break 39786 } 39787 t := i.Type 39788 if !(z.Op != OpConst64 && x.Op != OpConst64) { 39789 break 39790 } 39791 v.reset(OpOr64) 39792 v.AddArg(i) 39793 v0 := b.NewValue0(v.Pos, OpOr64, t) 39794 v0.AddArg(z) 39795 v0.AddArg(x) 39796 v.AddArg(v0) 39797 return true 39798 } 39799 // match: (Or64 (Or64 z i:(Const64 <t>)) x) 39800 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 39801 // result: (Or64 i (Or64 <t> z x)) 39802 for { 39803 x := v.Args[1] 39804 v_0 := v.Args[0] 39805 if v_0.Op != OpOr64 { 39806 break 39807 } 39808 _ = v_0.Args[1] 39809 z := v_0.Args[0] 39810 i := v_0.Args[1] 39811 if i.Op != OpConst64 { 39812 break 39813 } 39814 t := i.Type 39815 if !(z.Op != OpConst64 && x.Op != OpConst64) { 39816 break 39817 } 39818 v.reset(OpOr64) 39819 v.AddArg(i) 39820 v0 := b.NewValue0(v.Pos, OpOr64, t) 39821 v0.AddArg(z) 39822 v0.AddArg(x) 39823 v.AddArg(v0) 39824 return true 39825 } 39826 // match: (Or64 x (Or64 i:(Const64 <t>) z)) 39827 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 39828 // result: (Or64 i (Or64 <t> z x)) 39829 for { 39830 _ = v.Args[1] 39831 x := v.Args[0] 39832 v_1 := v.Args[1] 39833 if v_1.Op != OpOr64 { 39834 break 39835 } 39836 z := v_1.Args[1] 39837 i := v_1.Args[0] 39838 if i.Op != OpConst64 { 39839 break 39840 } 39841 t := i.Type 39842 if !(z.Op != OpConst64 && x.Op != OpConst64) { 39843 break 39844 } 39845 v.reset(OpOr64) 39846 v.AddArg(i) 39847 v0 := b.NewValue0(v.Pos, OpOr64, t) 39848 v0.AddArg(z) 39849 v0.AddArg(x) 39850 v.AddArg(v0) 39851 return true 39852 } 39853 // match: (Or64 x (Or64 z i:(Const64 <t>))) 39854 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 39855 // result: (Or64 i (Or64 <t> z x)) 39856 for { 39857 _ = v.Args[1] 39858 x := v.Args[0] 39859 v_1 := v.Args[1] 39860 if v_1.Op != OpOr64 { 39861 break 39862 } 39863 _ = v_1.Args[1] 39864 z := v_1.Args[0] 39865 i := v_1.Args[1] 39866 if i.Op != OpConst64 { 39867 break 39868 } 39869 t := i.Type 39870 if !(z.Op != OpConst64 && x.Op != OpConst64) { 39871 break 39872 } 39873 v.reset(OpOr64) 39874 v.AddArg(i) 39875 v0 := b.NewValue0(v.Pos, OpOr64, t) 39876 v0.AddArg(z) 39877 v0.AddArg(x) 39878 v.AddArg(v0) 39879 return true 39880 } 39881 // match: (Or64 (Const64 <t> [c]) (Or64 (Const64 <t> [d]) x)) 39882 // result: (Or64 (Const64 <t> [c|d]) x) 39883 for { 39884 _ = v.Args[1] 39885 v_0 := v.Args[0] 39886 if v_0.Op != OpConst64 { 39887 break 39888 } 39889 t := v_0.Type 39890 c := v_0.AuxInt 39891 v_1 := v.Args[1] 39892 if v_1.Op != OpOr64 { 39893 break 39894 } 39895 x := v_1.Args[1] 39896 v_1_0 := v_1.Args[0] 39897 if v_1_0.Op != OpConst64 || v_1_0.Type != t { 39898 break 39899 } 39900 d := v_1_0.AuxInt 39901 v.reset(OpOr64) 39902 v0 := b.NewValue0(v.Pos, OpConst64, t) 39903 v0.AuxInt = c | d 39904 v.AddArg(v0) 39905 v.AddArg(x) 39906 return true 39907 } 39908 return false 39909 } 39910 func rewriteValuegeneric_OpOr64_20(v *Value) bool { 39911 b := v.Block 39912 // match: (Or64 (Const64 <t> [c]) (Or64 x (Const64 <t> [d]))) 39913 // result: (Or64 (Const64 <t> [c|d]) x) 39914 for { 39915 _ = v.Args[1] 39916 v_0 := v.Args[0] 39917 if v_0.Op != OpConst64 { 39918 break 39919 } 39920 t := v_0.Type 39921 c := v_0.AuxInt 39922 v_1 := v.Args[1] 39923 if v_1.Op != OpOr64 { 39924 break 39925 } 39926 _ = v_1.Args[1] 39927 x := v_1.Args[0] 39928 v_1_1 := v_1.Args[1] 39929 if v_1_1.Op != OpConst64 || v_1_1.Type != t { 39930 break 39931 } 39932 d := v_1_1.AuxInt 39933 v.reset(OpOr64) 39934 v0 := b.NewValue0(v.Pos, OpConst64, t) 39935 v0.AuxInt = c | d 39936 v.AddArg(v0) 39937 v.AddArg(x) 39938 return true 39939 } 39940 // match: (Or64 (Or64 (Const64 <t> [d]) x) (Const64 <t> [c])) 39941 // result: (Or64 (Const64 <t> [c|d]) x) 39942 for { 39943 _ = v.Args[1] 39944 v_0 := v.Args[0] 39945 if v_0.Op != OpOr64 { 39946 break 39947 } 39948 x := v_0.Args[1] 39949 v_0_0 := v_0.Args[0] 39950 if v_0_0.Op != OpConst64 { 39951 break 39952 } 39953 t := v_0_0.Type 39954 d := v_0_0.AuxInt 39955 v_1 := v.Args[1] 39956 if v_1.Op != OpConst64 || v_1.Type != t { 39957 break 39958 } 39959 c := v_1.AuxInt 39960 v.reset(OpOr64) 39961 v0 := b.NewValue0(v.Pos, OpConst64, t) 39962 v0.AuxInt = c | d 39963 v.AddArg(v0) 39964 v.AddArg(x) 39965 return true 39966 } 39967 // match: (Or64 (Or64 x (Const64 <t> [d])) (Const64 <t> [c])) 39968 // result: (Or64 (Const64 <t> [c|d]) x) 39969 for { 39970 _ = v.Args[1] 39971 v_0 := v.Args[0] 39972 if v_0.Op != OpOr64 { 39973 break 39974 } 39975 _ = v_0.Args[1] 39976 x := v_0.Args[0] 39977 v_0_1 := v_0.Args[1] 39978 if v_0_1.Op != OpConst64 { 39979 break 39980 } 39981 t := v_0_1.Type 39982 d := v_0_1.AuxInt 39983 v_1 := v.Args[1] 39984 if v_1.Op != OpConst64 || v_1.Type != t { 39985 break 39986 } 39987 c := v_1.AuxInt 39988 v.reset(OpOr64) 39989 v0 := b.NewValue0(v.Pos, OpConst64, t) 39990 v0.AuxInt = c | d 39991 v.AddArg(v0) 39992 v.AddArg(x) 39993 return true 39994 } 39995 return false 39996 } 39997 func rewriteValuegeneric_OpOr8_0(v *Value) bool { 39998 // match: (Or8 (Const8 [c]) (Const8 [d])) 39999 // result: (Const8 [int64(int8(c|d))]) 40000 for { 40001 _ = v.Args[1] 40002 v_0 := v.Args[0] 40003 if v_0.Op != OpConst8 { 40004 break 40005 } 40006 c := v_0.AuxInt 40007 v_1 := v.Args[1] 40008 if v_1.Op != OpConst8 { 40009 break 40010 } 40011 d := v_1.AuxInt 40012 v.reset(OpConst8) 40013 v.AuxInt = int64(int8(c | d)) 40014 return true 40015 } 40016 // match: (Or8 (Const8 [d]) (Const8 [c])) 40017 // result: (Const8 [int64(int8(c|d))]) 40018 for { 40019 _ = v.Args[1] 40020 v_0 := v.Args[0] 40021 if v_0.Op != OpConst8 { 40022 break 40023 } 40024 d := v_0.AuxInt 40025 v_1 := v.Args[1] 40026 if v_1.Op != OpConst8 { 40027 break 40028 } 40029 c := v_1.AuxInt 40030 v.reset(OpConst8) 40031 v.AuxInt = int64(int8(c | d)) 40032 return true 40033 } 40034 // match: (Or8 x x) 40035 // result: x 40036 for { 40037 x := v.Args[1] 40038 if x != v.Args[0] { 40039 break 40040 } 40041 v.reset(OpCopy) 40042 v.Type = x.Type 40043 v.AddArg(x) 40044 return true 40045 } 40046 // match: (Or8 (Const8 [0]) x) 40047 // result: x 40048 for { 40049 x := v.Args[1] 40050 v_0 := v.Args[0] 40051 if v_0.Op != OpConst8 || v_0.AuxInt != 0 { 40052 break 40053 } 40054 v.reset(OpCopy) 40055 v.Type = x.Type 40056 v.AddArg(x) 40057 return true 40058 } 40059 // match: (Or8 x (Const8 [0])) 40060 // result: x 40061 for { 40062 _ = v.Args[1] 40063 x := v.Args[0] 40064 v_1 := v.Args[1] 40065 if v_1.Op != OpConst8 || v_1.AuxInt != 0 { 40066 break 40067 } 40068 v.reset(OpCopy) 40069 v.Type = x.Type 40070 v.AddArg(x) 40071 return true 40072 } 40073 // match: (Or8 (Const8 [-1]) _) 40074 // result: (Const8 [-1]) 40075 for { 40076 _ = v.Args[1] 40077 v_0 := v.Args[0] 40078 if v_0.Op != OpConst8 || v_0.AuxInt != -1 { 40079 break 40080 } 40081 v.reset(OpConst8) 40082 v.AuxInt = -1 40083 return true 40084 } 40085 // match: (Or8 _ (Const8 [-1])) 40086 // result: (Const8 [-1]) 40087 for { 40088 _ = v.Args[1] 40089 v_1 := v.Args[1] 40090 if v_1.Op != OpConst8 || v_1.AuxInt != -1 { 40091 break 40092 } 40093 v.reset(OpConst8) 40094 v.AuxInt = -1 40095 return true 40096 } 40097 // match: (Or8 x (Or8 x y)) 40098 // result: (Or8 x y) 40099 for { 40100 _ = v.Args[1] 40101 x := v.Args[0] 40102 v_1 := v.Args[1] 40103 if v_1.Op != OpOr8 { 40104 break 40105 } 40106 y := v_1.Args[1] 40107 if x != v_1.Args[0] { 40108 break 40109 } 40110 v.reset(OpOr8) 40111 v.AddArg(x) 40112 v.AddArg(y) 40113 return true 40114 } 40115 // match: (Or8 x (Or8 y x)) 40116 // result: (Or8 x y) 40117 for { 40118 _ = v.Args[1] 40119 x := v.Args[0] 40120 v_1 := v.Args[1] 40121 if v_1.Op != OpOr8 { 40122 break 40123 } 40124 _ = v_1.Args[1] 40125 y := v_1.Args[0] 40126 if x != v_1.Args[1] { 40127 break 40128 } 40129 v.reset(OpOr8) 40130 v.AddArg(x) 40131 v.AddArg(y) 40132 return true 40133 } 40134 // match: (Or8 (Or8 x y) x) 40135 // result: (Or8 x y) 40136 for { 40137 x := v.Args[1] 40138 v_0 := v.Args[0] 40139 if v_0.Op != OpOr8 { 40140 break 40141 } 40142 y := v_0.Args[1] 40143 if x != v_0.Args[0] { 40144 break 40145 } 40146 v.reset(OpOr8) 40147 v.AddArg(x) 40148 v.AddArg(y) 40149 return true 40150 } 40151 return false 40152 } 40153 func rewriteValuegeneric_OpOr8_10(v *Value) bool { 40154 b := v.Block 40155 // match: (Or8 (Or8 y x) x) 40156 // result: (Or8 x y) 40157 for { 40158 x := v.Args[1] 40159 v_0 := v.Args[0] 40160 if v_0.Op != OpOr8 { 40161 break 40162 } 40163 _ = v_0.Args[1] 40164 y := v_0.Args[0] 40165 if x != v_0.Args[1] { 40166 break 40167 } 40168 v.reset(OpOr8) 40169 v.AddArg(x) 40170 v.AddArg(y) 40171 return true 40172 } 40173 // match: (Or8 (And8 x (Const8 [c2])) (Const8 <t> [c1])) 40174 // cond: ^(c1 | c2) == 0 40175 // result: (Or8 (Const8 <t> [c1]) x) 40176 for { 40177 _ = v.Args[1] 40178 v_0 := v.Args[0] 40179 if v_0.Op != OpAnd8 { 40180 break 40181 } 40182 _ = v_0.Args[1] 40183 x := v_0.Args[0] 40184 v_0_1 := v_0.Args[1] 40185 if v_0_1.Op != OpConst8 { 40186 break 40187 } 40188 c2 := v_0_1.AuxInt 40189 v_1 := v.Args[1] 40190 if v_1.Op != OpConst8 { 40191 break 40192 } 40193 t := v_1.Type 40194 c1 := v_1.AuxInt 40195 if !(^(c1 | c2) == 0) { 40196 break 40197 } 40198 v.reset(OpOr8) 40199 v0 := b.NewValue0(v.Pos, OpConst8, t) 40200 v0.AuxInt = c1 40201 v.AddArg(v0) 40202 v.AddArg(x) 40203 return true 40204 } 40205 // match: (Or8 (And8 (Const8 [c2]) x) (Const8 <t> [c1])) 40206 // cond: ^(c1 | c2) == 0 40207 // result: (Or8 (Const8 <t> [c1]) x) 40208 for { 40209 _ = v.Args[1] 40210 v_0 := v.Args[0] 40211 if v_0.Op != OpAnd8 { 40212 break 40213 } 40214 x := v_0.Args[1] 40215 v_0_0 := v_0.Args[0] 40216 if v_0_0.Op != OpConst8 { 40217 break 40218 } 40219 c2 := v_0_0.AuxInt 40220 v_1 := v.Args[1] 40221 if v_1.Op != OpConst8 { 40222 break 40223 } 40224 t := v_1.Type 40225 c1 := v_1.AuxInt 40226 if !(^(c1 | c2) == 0) { 40227 break 40228 } 40229 v.reset(OpOr8) 40230 v0 := b.NewValue0(v.Pos, OpConst8, t) 40231 v0.AuxInt = c1 40232 v.AddArg(v0) 40233 v.AddArg(x) 40234 return true 40235 } 40236 // match: (Or8 (Const8 <t> [c1]) (And8 x (Const8 [c2]))) 40237 // cond: ^(c1 | c2) == 0 40238 // result: (Or8 (Const8 <t> [c1]) x) 40239 for { 40240 _ = v.Args[1] 40241 v_0 := v.Args[0] 40242 if v_0.Op != OpConst8 { 40243 break 40244 } 40245 t := v_0.Type 40246 c1 := v_0.AuxInt 40247 v_1 := v.Args[1] 40248 if v_1.Op != OpAnd8 { 40249 break 40250 } 40251 _ = v_1.Args[1] 40252 x := v_1.Args[0] 40253 v_1_1 := v_1.Args[1] 40254 if v_1_1.Op != OpConst8 { 40255 break 40256 } 40257 c2 := v_1_1.AuxInt 40258 if !(^(c1 | c2) == 0) { 40259 break 40260 } 40261 v.reset(OpOr8) 40262 v0 := b.NewValue0(v.Pos, OpConst8, t) 40263 v0.AuxInt = c1 40264 v.AddArg(v0) 40265 v.AddArg(x) 40266 return true 40267 } 40268 // match: (Or8 (Const8 <t> [c1]) (And8 (Const8 [c2]) x)) 40269 // cond: ^(c1 | c2) == 0 40270 // result: (Or8 (Const8 <t> [c1]) x) 40271 for { 40272 _ = v.Args[1] 40273 v_0 := v.Args[0] 40274 if v_0.Op != OpConst8 { 40275 break 40276 } 40277 t := v_0.Type 40278 c1 := v_0.AuxInt 40279 v_1 := v.Args[1] 40280 if v_1.Op != OpAnd8 { 40281 break 40282 } 40283 x := v_1.Args[1] 40284 v_1_0 := v_1.Args[0] 40285 if v_1_0.Op != OpConst8 { 40286 break 40287 } 40288 c2 := v_1_0.AuxInt 40289 if !(^(c1 | c2) == 0) { 40290 break 40291 } 40292 v.reset(OpOr8) 40293 v0 := b.NewValue0(v.Pos, OpConst8, t) 40294 v0.AuxInt = c1 40295 v.AddArg(v0) 40296 v.AddArg(x) 40297 return true 40298 } 40299 // match: (Or8 (Or8 i:(Const8 <t>) z) x) 40300 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 40301 // result: (Or8 i (Or8 <t> z x)) 40302 for { 40303 x := v.Args[1] 40304 v_0 := v.Args[0] 40305 if v_0.Op != OpOr8 { 40306 break 40307 } 40308 z := v_0.Args[1] 40309 i := v_0.Args[0] 40310 if i.Op != OpConst8 { 40311 break 40312 } 40313 t := i.Type 40314 if !(z.Op != OpConst8 && x.Op != OpConst8) { 40315 break 40316 } 40317 v.reset(OpOr8) 40318 v.AddArg(i) 40319 v0 := b.NewValue0(v.Pos, OpOr8, t) 40320 v0.AddArg(z) 40321 v0.AddArg(x) 40322 v.AddArg(v0) 40323 return true 40324 } 40325 // match: (Or8 (Or8 z i:(Const8 <t>)) x) 40326 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 40327 // result: (Or8 i (Or8 <t> z x)) 40328 for { 40329 x := v.Args[1] 40330 v_0 := v.Args[0] 40331 if v_0.Op != OpOr8 { 40332 break 40333 } 40334 _ = v_0.Args[1] 40335 z := v_0.Args[0] 40336 i := v_0.Args[1] 40337 if i.Op != OpConst8 { 40338 break 40339 } 40340 t := i.Type 40341 if !(z.Op != OpConst8 && x.Op != OpConst8) { 40342 break 40343 } 40344 v.reset(OpOr8) 40345 v.AddArg(i) 40346 v0 := b.NewValue0(v.Pos, OpOr8, t) 40347 v0.AddArg(z) 40348 v0.AddArg(x) 40349 v.AddArg(v0) 40350 return true 40351 } 40352 // match: (Or8 x (Or8 i:(Const8 <t>) z)) 40353 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 40354 // result: (Or8 i (Or8 <t> z x)) 40355 for { 40356 _ = v.Args[1] 40357 x := v.Args[0] 40358 v_1 := v.Args[1] 40359 if v_1.Op != OpOr8 { 40360 break 40361 } 40362 z := v_1.Args[1] 40363 i := v_1.Args[0] 40364 if i.Op != OpConst8 { 40365 break 40366 } 40367 t := i.Type 40368 if !(z.Op != OpConst8 && x.Op != OpConst8) { 40369 break 40370 } 40371 v.reset(OpOr8) 40372 v.AddArg(i) 40373 v0 := b.NewValue0(v.Pos, OpOr8, t) 40374 v0.AddArg(z) 40375 v0.AddArg(x) 40376 v.AddArg(v0) 40377 return true 40378 } 40379 // match: (Or8 x (Or8 z i:(Const8 <t>))) 40380 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 40381 // result: (Or8 i (Or8 <t> z x)) 40382 for { 40383 _ = v.Args[1] 40384 x := v.Args[0] 40385 v_1 := v.Args[1] 40386 if v_1.Op != OpOr8 { 40387 break 40388 } 40389 _ = v_1.Args[1] 40390 z := v_1.Args[0] 40391 i := v_1.Args[1] 40392 if i.Op != OpConst8 { 40393 break 40394 } 40395 t := i.Type 40396 if !(z.Op != OpConst8 && x.Op != OpConst8) { 40397 break 40398 } 40399 v.reset(OpOr8) 40400 v.AddArg(i) 40401 v0 := b.NewValue0(v.Pos, OpOr8, t) 40402 v0.AddArg(z) 40403 v0.AddArg(x) 40404 v.AddArg(v0) 40405 return true 40406 } 40407 // match: (Or8 (Const8 <t> [c]) (Or8 (Const8 <t> [d]) x)) 40408 // result: (Or8 (Const8 <t> [int64(int8(c|d))]) x) 40409 for { 40410 _ = v.Args[1] 40411 v_0 := v.Args[0] 40412 if v_0.Op != OpConst8 { 40413 break 40414 } 40415 t := v_0.Type 40416 c := v_0.AuxInt 40417 v_1 := v.Args[1] 40418 if v_1.Op != OpOr8 { 40419 break 40420 } 40421 x := v_1.Args[1] 40422 v_1_0 := v_1.Args[0] 40423 if v_1_0.Op != OpConst8 || v_1_0.Type != t { 40424 break 40425 } 40426 d := v_1_0.AuxInt 40427 v.reset(OpOr8) 40428 v0 := b.NewValue0(v.Pos, OpConst8, t) 40429 v0.AuxInt = int64(int8(c | d)) 40430 v.AddArg(v0) 40431 v.AddArg(x) 40432 return true 40433 } 40434 return false 40435 } 40436 func rewriteValuegeneric_OpOr8_20(v *Value) bool { 40437 b := v.Block 40438 // match: (Or8 (Const8 <t> [c]) (Or8 x (Const8 <t> [d]))) 40439 // result: (Or8 (Const8 <t> [int64(int8(c|d))]) x) 40440 for { 40441 _ = v.Args[1] 40442 v_0 := v.Args[0] 40443 if v_0.Op != OpConst8 { 40444 break 40445 } 40446 t := v_0.Type 40447 c := v_0.AuxInt 40448 v_1 := v.Args[1] 40449 if v_1.Op != OpOr8 { 40450 break 40451 } 40452 _ = v_1.Args[1] 40453 x := v_1.Args[0] 40454 v_1_1 := v_1.Args[1] 40455 if v_1_1.Op != OpConst8 || v_1_1.Type != t { 40456 break 40457 } 40458 d := v_1_1.AuxInt 40459 v.reset(OpOr8) 40460 v0 := b.NewValue0(v.Pos, OpConst8, t) 40461 v0.AuxInt = int64(int8(c | d)) 40462 v.AddArg(v0) 40463 v.AddArg(x) 40464 return true 40465 } 40466 // match: (Or8 (Or8 (Const8 <t> [d]) x) (Const8 <t> [c])) 40467 // result: (Or8 (Const8 <t> [int64(int8(c|d))]) x) 40468 for { 40469 _ = v.Args[1] 40470 v_0 := v.Args[0] 40471 if v_0.Op != OpOr8 { 40472 break 40473 } 40474 x := v_0.Args[1] 40475 v_0_0 := v_0.Args[0] 40476 if v_0_0.Op != OpConst8 { 40477 break 40478 } 40479 t := v_0_0.Type 40480 d := v_0_0.AuxInt 40481 v_1 := v.Args[1] 40482 if v_1.Op != OpConst8 || v_1.Type != t { 40483 break 40484 } 40485 c := v_1.AuxInt 40486 v.reset(OpOr8) 40487 v0 := b.NewValue0(v.Pos, OpConst8, t) 40488 v0.AuxInt = int64(int8(c | d)) 40489 v.AddArg(v0) 40490 v.AddArg(x) 40491 return true 40492 } 40493 // match: (Or8 (Or8 x (Const8 <t> [d])) (Const8 <t> [c])) 40494 // result: (Or8 (Const8 <t> [int64(int8(c|d))]) x) 40495 for { 40496 _ = v.Args[1] 40497 v_0 := v.Args[0] 40498 if v_0.Op != OpOr8 { 40499 break 40500 } 40501 _ = v_0.Args[1] 40502 x := v_0.Args[0] 40503 v_0_1 := v_0.Args[1] 40504 if v_0_1.Op != OpConst8 { 40505 break 40506 } 40507 t := v_0_1.Type 40508 d := v_0_1.AuxInt 40509 v_1 := v.Args[1] 40510 if v_1.Op != OpConst8 || v_1.Type != t { 40511 break 40512 } 40513 c := v_1.AuxInt 40514 v.reset(OpOr8) 40515 v0 := b.NewValue0(v.Pos, OpConst8, t) 40516 v0.AuxInt = int64(int8(c | d)) 40517 v.AddArg(v0) 40518 v.AddArg(x) 40519 return true 40520 } 40521 return false 40522 } 40523 func rewriteValuegeneric_OpPhi_0(v *Value) bool { 40524 // match: (Phi (Const8 [c]) (Const8 [c])) 40525 // result: (Const8 [c]) 40526 for { 40527 _ = v.Args[1] 40528 v_0 := v.Args[0] 40529 if v_0.Op != OpConst8 { 40530 break 40531 } 40532 c := v_0.AuxInt 40533 v_1 := v.Args[1] 40534 if v_1.Op != OpConst8 || v_1.AuxInt != c || len(v.Args) != 2 { 40535 break 40536 } 40537 v.reset(OpConst8) 40538 v.AuxInt = c 40539 return true 40540 } 40541 // match: (Phi (Const16 [c]) (Const16 [c])) 40542 // result: (Const16 [c]) 40543 for { 40544 _ = v.Args[1] 40545 v_0 := v.Args[0] 40546 if v_0.Op != OpConst16 { 40547 break 40548 } 40549 c := v_0.AuxInt 40550 v_1 := v.Args[1] 40551 if v_1.Op != OpConst16 || v_1.AuxInt != c || len(v.Args) != 2 { 40552 break 40553 } 40554 v.reset(OpConst16) 40555 v.AuxInt = c 40556 return true 40557 } 40558 // match: (Phi (Const32 [c]) (Const32 [c])) 40559 // result: (Const32 [c]) 40560 for { 40561 _ = v.Args[1] 40562 v_0 := v.Args[0] 40563 if v_0.Op != OpConst32 { 40564 break 40565 } 40566 c := v_0.AuxInt 40567 v_1 := v.Args[1] 40568 if v_1.Op != OpConst32 || v_1.AuxInt != c || len(v.Args) != 2 { 40569 break 40570 } 40571 v.reset(OpConst32) 40572 v.AuxInt = c 40573 return true 40574 } 40575 // match: (Phi (Const64 [c]) (Const64 [c])) 40576 // result: (Const64 [c]) 40577 for { 40578 _ = v.Args[1] 40579 v_0 := v.Args[0] 40580 if v_0.Op != OpConst64 { 40581 break 40582 } 40583 c := v_0.AuxInt 40584 v_1 := v.Args[1] 40585 if v_1.Op != OpConst64 || v_1.AuxInt != c || len(v.Args) != 2 { 40586 break 40587 } 40588 v.reset(OpConst64) 40589 v.AuxInt = c 40590 return true 40591 } 40592 return false 40593 } 40594 func rewriteValuegeneric_OpPtrIndex_0(v *Value) bool { 40595 b := v.Block 40596 config := b.Func.Config 40597 typ := &b.Func.Config.Types 40598 // match: (PtrIndex <t> ptr idx) 40599 // cond: config.PtrSize == 4 40600 // result: (AddPtr ptr (Mul32 <typ.Int> idx (Const32 <typ.Int> [t.Elem().Size()]))) 40601 for { 40602 t := v.Type 40603 idx := v.Args[1] 40604 ptr := v.Args[0] 40605 if !(config.PtrSize == 4) { 40606 break 40607 } 40608 v.reset(OpAddPtr) 40609 v.AddArg(ptr) 40610 v0 := b.NewValue0(v.Pos, OpMul32, typ.Int) 40611 v0.AddArg(idx) 40612 v1 := b.NewValue0(v.Pos, OpConst32, typ.Int) 40613 v1.AuxInt = t.Elem().Size() 40614 v0.AddArg(v1) 40615 v.AddArg(v0) 40616 return true 40617 } 40618 // match: (PtrIndex <t> ptr idx) 40619 // cond: config.PtrSize == 8 40620 // result: (AddPtr ptr (Mul64 <typ.Int> idx (Const64 <typ.Int> [t.Elem().Size()]))) 40621 for { 40622 t := v.Type 40623 idx := v.Args[1] 40624 ptr := v.Args[0] 40625 if !(config.PtrSize == 8) { 40626 break 40627 } 40628 v.reset(OpAddPtr) 40629 v.AddArg(ptr) 40630 v0 := b.NewValue0(v.Pos, OpMul64, typ.Int) 40631 v0.AddArg(idx) 40632 v1 := b.NewValue0(v.Pos, OpConst64, typ.Int) 40633 v1.AuxInt = t.Elem().Size() 40634 v0.AddArg(v1) 40635 v.AddArg(v0) 40636 return true 40637 } 40638 return false 40639 } 40640 func rewriteValuegeneric_OpRotateLeft16_0(v *Value) bool { 40641 // match: (RotateLeft16 x (Const16 [c])) 40642 // cond: c%16 == 0 40643 // result: x 40644 for { 40645 _ = v.Args[1] 40646 x := v.Args[0] 40647 v_1 := v.Args[1] 40648 if v_1.Op != OpConst16 { 40649 break 40650 } 40651 c := v_1.AuxInt 40652 if !(c%16 == 0) { 40653 break 40654 } 40655 v.reset(OpCopy) 40656 v.Type = x.Type 40657 v.AddArg(x) 40658 return true 40659 } 40660 return false 40661 } 40662 func rewriteValuegeneric_OpRotateLeft32_0(v *Value) bool { 40663 // match: (RotateLeft32 x (Const32 [c])) 40664 // cond: c%32 == 0 40665 // result: x 40666 for { 40667 _ = v.Args[1] 40668 x := v.Args[0] 40669 v_1 := v.Args[1] 40670 if v_1.Op != OpConst32 { 40671 break 40672 } 40673 c := v_1.AuxInt 40674 if !(c%32 == 0) { 40675 break 40676 } 40677 v.reset(OpCopy) 40678 v.Type = x.Type 40679 v.AddArg(x) 40680 return true 40681 } 40682 return false 40683 } 40684 func rewriteValuegeneric_OpRotateLeft64_0(v *Value) bool { 40685 // match: (RotateLeft64 x (Const64 [c])) 40686 // cond: c%64 == 0 40687 // result: x 40688 for { 40689 _ = v.Args[1] 40690 x := v.Args[0] 40691 v_1 := v.Args[1] 40692 if v_1.Op != OpConst64 { 40693 break 40694 } 40695 c := v_1.AuxInt 40696 if !(c%64 == 0) { 40697 break 40698 } 40699 v.reset(OpCopy) 40700 v.Type = x.Type 40701 v.AddArg(x) 40702 return true 40703 } 40704 return false 40705 } 40706 func rewriteValuegeneric_OpRotateLeft8_0(v *Value) bool { 40707 // match: (RotateLeft8 x (Const8 [c])) 40708 // cond: c%8 == 0 40709 // result: x 40710 for { 40711 _ = v.Args[1] 40712 x := v.Args[0] 40713 v_1 := v.Args[1] 40714 if v_1.Op != OpConst8 { 40715 break 40716 } 40717 c := v_1.AuxInt 40718 if !(c%8 == 0) { 40719 break 40720 } 40721 v.reset(OpCopy) 40722 v.Type = x.Type 40723 v.AddArg(x) 40724 return true 40725 } 40726 return false 40727 } 40728 func rewriteValuegeneric_OpRound32F_0(v *Value) bool { 40729 // match: (Round32F x:(Const32F)) 40730 // result: x 40731 for { 40732 x := v.Args[0] 40733 if x.Op != OpConst32F { 40734 break 40735 } 40736 v.reset(OpCopy) 40737 v.Type = x.Type 40738 v.AddArg(x) 40739 return true 40740 } 40741 return false 40742 } 40743 func rewriteValuegeneric_OpRound64F_0(v *Value) bool { 40744 // match: (Round64F x:(Const64F)) 40745 // result: x 40746 for { 40747 x := v.Args[0] 40748 if x.Op != OpConst64F { 40749 break 40750 } 40751 v.reset(OpCopy) 40752 v.Type = x.Type 40753 v.AddArg(x) 40754 return true 40755 } 40756 return false 40757 } 40758 func rewriteValuegeneric_OpRsh16Ux16_0(v *Value) bool { 40759 b := v.Block 40760 // match: (Rsh16Ux16 <t> x (Const16 [c])) 40761 // result: (Rsh16Ux64 x (Const64 <t> [int64(uint16(c))])) 40762 for { 40763 t := v.Type 40764 _ = v.Args[1] 40765 x := v.Args[0] 40766 v_1 := v.Args[1] 40767 if v_1.Op != OpConst16 { 40768 break 40769 } 40770 c := v_1.AuxInt 40771 v.reset(OpRsh16Ux64) 40772 v.AddArg(x) 40773 v0 := b.NewValue0(v.Pos, OpConst64, t) 40774 v0.AuxInt = int64(uint16(c)) 40775 v.AddArg(v0) 40776 return true 40777 } 40778 // match: (Rsh16Ux16 (Const16 [0]) _) 40779 // result: (Const16 [0]) 40780 for { 40781 _ = v.Args[1] 40782 v_0 := v.Args[0] 40783 if v_0.Op != OpConst16 || v_0.AuxInt != 0 { 40784 break 40785 } 40786 v.reset(OpConst16) 40787 v.AuxInt = 0 40788 return true 40789 } 40790 return false 40791 } 40792 func rewriteValuegeneric_OpRsh16Ux32_0(v *Value) bool { 40793 b := v.Block 40794 // match: (Rsh16Ux32 <t> x (Const32 [c])) 40795 // result: (Rsh16Ux64 x (Const64 <t> [int64(uint32(c))])) 40796 for { 40797 t := v.Type 40798 _ = v.Args[1] 40799 x := v.Args[0] 40800 v_1 := v.Args[1] 40801 if v_1.Op != OpConst32 { 40802 break 40803 } 40804 c := v_1.AuxInt 40805 v.reset(OpRsh16Ux64) 40806 v.AddArg(x) 40807 v0 := b.NewValue0(v.Pos, OpConst64, t) 40808 v0.AuxInt = int64(uint32(c)) 40809 v.AddArg(v0) 40810 return true 40811 } 40812 // match: (Rsh16Ux32 (Const16 [0]) _) 40813 // result: (Const16 [0]) 40814 for { 40815 _ = v.Args[1] 40816 v_0 := v.Args[0] 40817 if v_0.Op != OpConst16 || v_0.AuxInt != 0 { 40818 break 40819 } 40820 v.reset(OpConst16) 40821 v.AuxInt = 0 40822 return true 40823 } 40824 return false 40825 } 40826 func rewriteValuegeneric_OpRsh16Ux64_0(v *Value) bool { 40827 b := v.Block 40828 typ := &b.Func.Config.Types 40829 // match: (Rsh16Ux64 (Const16 [c]) (Const64 [d])) 40830 // result: (Const16 [int64(int16(uint16(c) >> uint64(d)))]) 40831 for { 40832 _ = v.Args[1] 40833 v_0 := v.Args[0] 40834 if v_0.Op != OpConst16 { 40835 break 40836 } 40837 c := v_0.AuxInt 40838 v_1 := v.Args[1] 40839 if v_1.Op != OpConst64 { 40840 break 40841 } 40842 d := v_1.AuxInt 40843 v.reset(OpConst16) 40844 v.AuxInt = int64(int16(uint16(c) >> uint64(d))) 40845 return true 40846 } 40847 // match: (Rsh16Ux64 x (Const64 [0])) 40848 // result: x 40849 for { 40850 _ = v.Args[1] 40851 x := v.Args[0] 40852 v_1 := v.Args[1] 40853 if v_1.Op != OpConst64 || v_1.AuxInt != 0 { 40854 break 40855 } 40856 v.reset(OpCopy) 40857 v.Type = x.Type 40858 v.AddArg(x) 40859 return true 40860 } 40861 // match: (Rsh16Ux64 (Const16 [0]) _) 40862 // result: (Const16 [0]) 40863 for { 40864 _ = v.Args[1] 40865 v_0 := v.Args[0] 40866 if v_0.Op != OpConst16 || v_0.AuxInt != 0 { 40867 break 40868 } 40869 v.reset(OpConst16) 40870 v.AuxInt = 0 40871 return true 40872 } 40873 // match: (Rsh16Ux64 _ (Const64 [c])) 40874 // cond: uint64(c) >= 16 40875 // result: (Const16 [0]) 40876 for { 40877 _ = v.Args[1] 40878 v_1 := v.Args[1] 40879 if v_1.Op != OpConst64 { 40880 break 40881 } 40882 c := v_1.AuxInt 40883 if !(uint64(c) >= 16) { 40884 break 40885 } 40886 v.reset(OpConst16) 40887 v.AuxInt = 0 40888 return true 40889 } 40890 // match: (Rsh16Ux64 <t> (Rsh16Ux64 x (Const64 [c])) (Const64 [d])) 40891 // cond: !uaddOvf(c,d) 40892 // result: (Rsh16Ux64 x (Const64 <t> [c+d])) 40893 for { 40894 t := v.Type 40895 _ = v.Args[1] 40896 v_0 := v.Args[0] 40897 if v_0.Op != OpRsh16Ux64 { 40898 break 40899 } 40900 _ = v_0.Args[1] 40901 x := v_0.Args[0] 40902 v_0_1 := v_0.Args[1] 40903 if v_0_1.Op != OpConst64 { 40904 break 40905 } 40906 c := v_0_1.AuxInt 40907 v_1 := v.Args[1] 40908 if v_1.Op != OpConst64 { 40909 break 40910 } 40911 d := v_1.AuxInt 40912 if !(!uaddOvf(c, d)) { 40913 break 40914 } 40915 v.reset(OpRsh16Ux64) 40916 v.AddArg(x) 40917 v0 := b.NewValue0(v.Pos, OpConst64, t) 40918 v0.AuxInt = c + d 40919 v.AddArg(v0) 40920 return true 40921 } 40922 // match: (Rsh16Ux64 (Rsh16x64 x _) (Const64 <t> [15])) 40923 // result: (Rsh16Ux64 x (Const64 <t> [15])) 40924 for { 40925 _ = v.Args[1] 40926 v_0 := v.Args[0] 40927 if v_0.Op != OpRsh16x64 { 40928 break 40929 } 40930 _ = v_0.Args[1] 40931 x := v_0.Args[0] 40932 v_1 := v.Args[1] 40933 if v_1.Op != OpConst64 { 40934 break 40935 } 40936 t := v_1.Type 40937 if v_1.AuxInt != 15 { 40938 break 40939 } 40940 v.reset(OpRsh16Ux64) 40941 v.AddArg(x) 40942 v0 := b.NewValue0(v.Pos, OpConst64, t) 40943 v0.AuxInt = 15 40944 v.AddArg(v0) 40945 return true 40946 } 40947 // match: (Rsh16Ux64 (Lsh16x64 (Rsh16Ux64 x (Const64 [c1])) (Const64 [c2])) (Const64 [c3])) 40948 // cond: uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3) 40949 // result: (Rsh16Ux64 x (Const64 <typ.UInt64> [c1-c2+c3])) 40950 for { 40951 _ = v.Args[1] 40952 v_0 := v.Args[0] 40953 if v_0.Op != OpLsh16x64 { 40954 break 40955 } 40956 _ = v_0.Args[1] 40957 v_0_0 := v_0.Args[0] 40958 if v_0_0.Op != OpRsh16Ux64 { 40959 break 40960 } 40961 _ = v_0_0.Args[1] 40962 x := v_0_0.Args[0] 40963 v_0_0_1 := v_0_0.Args[1] 40964 if v_0_0_1.Op != OpConst64 { 40965 break 40966 } 40967 c1 := v_0_0_1.AuxInt 40968 v_0_1 := v_0.Args[1] 40969 if v_0_1.Op != OpConst64 { 40970 break 40971 } 40972 c2 := v_0_1.AuxInt 40973 v_1 := v.Args[1] 40974 if v_1.Op != OpConst64 { 40975 break 40976 } 40977 c3 := v_1.AuxInt 40978 if !(uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)) { 40979 break 40980 } 40981 v.reset(OpRsh16Ux64) 40982 v.AddArg(x) 40983 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 40984 v0.AuxInt = c1 - c2 + c3 40985 v.AddArg(v0) 40986 return true 40987 } 40988 // match: (Rsh16Ux64 (Lsh16x64 x (Const64 [8])) (Const64 [8])) 40989 // result: (ZeroExt8to16 (Trunc16to8 <typ.UInt8> x)) 40990 for { 40991 _ = v.Args[1] 40992 v_0 := v.Args[0] 40993 if v_0.Op != OpLsh16x64 { 40994 break 40995 } 40996 _ = v_0.Args[1] 40997 x := v_0.Args[0] 40998 v_0_1 := v_0.Args[1] 40999 if v_0_1.Op != OpConst64 || v_0_1.AuxInt != 8 { 41000 break 41001 } 41002 v_1 := v.Args[1] 41003 if v_1.Op != OpConst64 || v_1.AuxInt != 8 { 41004 break 41005 } 41006 v.reset(OpZeroExt8to16) 41007 v0 := b.NewValue0(v.Pos, OpTrunc16to8, typ.UInt8) 41008 v0.AddArg(x) 41009 v.AddArg(v0) 41010 return true 41011 } 41012 return false 41013 } 41014 func rewriteValuegeneric_OpRsh16Ux8_0(v *Value) bool { 41015 b := v.Block 41016 // match: (Rsh16Ux8 <t> x (Const8 [c])) 41017 // result: (Rsh16Ux64 x (Const64 <t> [int64(uint8(c))])) 41018 for { 41019 t := v.Type 41020 _ = v.Args[1] 41021 x := v.Args[0] 41022 v_1 := v.Args[1] 41023 if v_1.Op != OpConst8 { 41024 break 41025 } 41026 c := v_1.AuxInt 41027 v.reset(OpRsh16Ux64) 41028 v.AddArg(x) 41029 v0 := b.NewValue0(v.Pos, OpConst64, t) 41030 v0.AuxInt = int64(uint8(c)) 41031 v.AddArg(v0) 41032 return true 41033 } 41034 // match: (Rsh16Ux8 (Const16 [0]) _) 41035 // result: (Const16 [0]) 41036 for { 41037 _ = v.Args[1] 41038 v_0 := v.Args[0] 41039 if v_0.Op != OpConst16 || v_0.AuxInt != 0 { 41040 break 41041 } 41042 v.reset(OpConst16) 41043 v.AuxInt = 0 41044 return true 41045 } 41046 return false 41047 } 41048 func rewriteValuegeneric_OpRsh16x16_0(v *Value) bool { 41049 b := v.Block 41050 // match: (Rsh16x16 <t> x (Const16 [c])) 41051 // result: (Rsh16x64 x (Const64 <t> [int64(uint16(c))])) 41052 for { 41053 t := v.Type 41054 _ = v.Args[1] 41055 x := v.Args[0] 41056 v_1 := v.Args[1] 41057 if v_1.Op != OpConst16 { 41058 break 41059 } 41060 c := v_1.AuxInt 41061 v.reset(OpRsh16x64) 41062 v.AddArg(x) 41063 v0 := b.NewValue0(v.Pos, OpConst64, t) 41064 v0.AuxInt = int64(uint16(c)) 41065 v.AddArg(v0) 41066 return true 41067 } 41068 // match: (Rsh16x16 (Const16 [0]) _) 41069 // result: (Const16 [0]) 41070 for { 41071 _ = v.Args[1] 41072 v_0 := v.Args[0] 41073 if v_0.Op != OpConst16 || v_0.AuxInt != 0 { 41074 break 41075 } 41076 v.reset(OpConst16) 41077 v.AuxInt = 0 41078 return true 41079 } 41080 return false 41081 } 41082 func rewriteValuegeneric_OpRsh16x32_0(v *Value) bool { 41083 b := v.Block 41084 // match: (Rsh16x32 <t> x (Const32 [c])) 41085 // result: (Rsh16x64 x (Const64 <t> [int64(uint32(c))])) 41086 for { 41087 t := v.Type 41088 _ = v.Args[1] 41089 x := v.Args[0] 41090 v_1 := v.Args[1] 41091 if v_1.Op != OpConst32 { 41092 break 41093 } 41094 c := v_1.AuxInt 41095 v.reset(OpRsh16x64) 41096 v.AddArg(x) 41097 v0 := b.NewValue0(v.Pos, OpConst64, t) 41098 v0.AuxInt = int64(uint32(c)) 41099 v.AddArg(v0) 41100 return true 41101 } 41102 // match: (Rsh16x32 (Const16 [0]) _) 41103 // result: (Const16 [0]) 41104 for { 41105 _ = v.Args[1] 41106 v_0 := v.Args[0] 41107 if v_0.Op != OpConst16 || v_0.AuxInt != 0 { 41108 break 41109 } 41110 v.reset(OpConst16) 41111 v.AuxInt = 0 41112 return true 41113 } 41114 return false 41115 } 41116 func rewriteValuegeneric_OpRsh16x64_0(v *Value) bool { 41117 b := v.Block 41118 typ := &b.Func.Config.Types 41119 // match: (Rsh16x64 (Const16 [c]) (Const64 [d])) 41120 // result: (Const16 [int64(int16(c) >> uint64(d))]) 41121 for { 41122 _ = v.Args[1] 41123 v_0 := v.Args[0] 41124 if v_0.Op != OpConst16 { 41125 break 41126 } 41127 c := v_0.AuxInt 41128 v_1 := v.Args[1] 41129 if v_1.Op != OpConst64 { 41130 break 41131 } 41132 d := v_1.AuxInt 41133 v.reset(OpConst16) 41134 v.AuxInt = int64(int16(c) >> uint64(d)) 41135 return true 41136 } 41137 // match: (Rsh16x64 x (Const64 [0])) 41138 // result: x 41139 for { 41140 _ = v.Args[1] 41141 x := v.Args[0] 41142 v_1 := v.Args[1] 41143 if v_1.Op != OpConst64 || v_1.AuxInt != 0 { 41144 break 41145 } 41146 v.reset(OpCopy) 41147 v.Type = x.Type 41148 v.AddArg(x) 41149 return true 41150 } 41151 // match: (Rsh16x64 (Const16 [0]) _) 41152 // result: (Const16 [0]) 41153 for { 41154 _ = v.Args[1] 41155 v_0 := v.Args[0] 41156 if v_0.Op != OpConst16 || v_0.AuxInt != 0 { 41157 break 41158 } 41159 v.reset(OpConst16) 41160 v.AuxInt = 0 41161 return true 41162 } 41163 // match: (Rsh16x64 <t> (Rsh16x64 x (Const64 [c])) (Const64 [d])) 41164 // cond: !uaddOvf(c,d) 41165 // result: (Rsh16x64 x (Const64 <t> [c+d])) 41166 for { 41167 t := v.Type 41168 _ = v.Args[1] 41169 v_0 := v.Args[0] 41170 if v_0.Op != OpRsh16x64 { 41171 break 41172 } 41173 _ = v_0.Args[1] 41174 x := v_0.Args[0] 41175 v_0_1 := v_0.Args[1] 41176 if v_0_1.Op != OpConst64 { 41177 break 41178 } 41179 c := v_0_1.AuxInt 41180 v_1 := v.Args[1] 41181 if v_1.Op != OpConst64 { 41182 break 41183 } 41184 d := v_1.AuxInt 41185 if !(!uaddOvf(c, d)) { 41186 break 41187 } 41188 v.reset(OpRsh16x64) 41189 v.AddArg(x) 41190 v0 := b.NewValue0(v.Pos, OpConst64, t) 41191 v0.AuxInt = c + d 41192 v.AddArg(v0) 41193 return true 41194 } 41195 // match: (Rsh16x64 (Lsh16x64 x (Const64 [8])) (Const64 [8])) 41196 // result: (SignExt8to16 (Trunc16to8 <typ.Int8> x)) 41197 for { 41198 _ = v.Args[1] 41199 v_0 := v.Args[0] 41200 if v_0.Op != OpLsh16x64 { 41201 break 41202 } 41203 _ = v_0.Args[1] 41204 x := v_0.Args[0] 41205 v_0_1 := v_0.Args[1] 41206 if v_0_1.Op != OpConst64 || v_0_1.AuxInt != 8 { 41207 break 41208 } 41209 v_1 := v.Args[1] 41210 if v_1.Op != OpConst64 || v_1.AuxInt != 8 { 41211 break 41212 } 41213 v.reset(OpSignExt8to16) 41214 v0 := b.NewValue0(v.Pos, OpTrunc16to8, typ.Int8) 41215 v0.AddArg(x) 41216 v.AddArg(v0) 41217 return true 41218 } 41219 return false 41220 } 41221 func rewriteValuegeneric_OpRsh16x8_0(v *Value) bool { 41222 b := v.Block 41223 // match: (Rsh16x8 <t> x (Const8 [c])) 41224 // result: (Rsh16x64 x (Const64 <t> [int64(uint8(c))])) 41225 for { 41226 t := v.Type 41227 _ = v.Args[1] 41228 x := v.Args[0] 41229 v_1 := v.Args[1] 41230 if v_1.Op != OpConst8 { 41231 break 41232 } 41233 c := v_1.AuxInt 41234 v.reset(OpRsh16x64) 41235 v.AddArg(x) 41236 v0 := b.NewValue0(v.Pos, OpConst64, t) 41237 v0.AuxInt = int64(uint8(c)) 41238 v.AddArg(v0) 41239 return true 41240 } 41241 // match: (Rsh16x8 (Const16 [0]) _) 41242 // result: (Const16 [0]) 41243 for { 41244 _ = v.Args[1] 41245 v_0 := v.Args[0] 41246 if v_0.Op != OpConst16 || v_0.AuxInt != 0 { 41247 break 41248 } 41249 v.reset(OpConst16) 41250 v.AuxInt = 0 41251 return true 41252 } 41253 return false 41254 } 41255 func rewriteValuegeneric_OpRsh32Ux16_0(v *Value) bool { 41256 b := v.Block 41257 // match: (Rsh32Ux16 <t> x (Const16 [c])) 41258 // result: (Rsh32Ux64 x (Const64 <t> [int64(uint16(c))])) 41259 for { 41260 t := v.Type 41261 _ = v.Args[1] 41262 x := v.Args[0] 41263 v_1 := v.Args[1] 41264 if v_1.Op != OpConst16 { 41265 break 41266 } 41267 c := v_1.AuxInt 41268 v.reset(OpRsh32Ux64) 41269 v.AddArg(x) 41270 v0 := b.NewValue0(v.Pos, OpConst64, t) 41271 v0.AuxInt = int64(uint16(c)) 41272 v.AddArg(v0) 41273 return true 41274 } 41275 // match: (Rsh32Ux16 (Const32 [0]) _) 41276 // result: (Const32 [0]) 41277 for { 41278 _ = v.Args[1] 41279 v_0 := v.Args[0] 41280 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 41281 break 41282 } 41283 v.reset(OpConst32) 41284 v.AuxInt = 0 41285 return true 41286 } 41287 return false 41288 } 41289 func rewriteValuegeneric_OpRsh32Ux32_0(v *Value) bool { 41290 b := v.Block 41291 // match: (Rsh32Ux32 <t> x (Const32 [c])) 41292 // result: (Rsh32Ux64 x (Const64 <t> [int64(uint32(c))])) 41293 for { 41294 t := v.Type 41295 _ = v.Args[1] 41296 x := v.Args[0] 41297 v_1 := v.Args[1] 41298 if v_1.Op != OpConst32 { 41299 break 41300 } 41301 c := v_1.AuxInt 41302 v.reset(OpRsh32Ux64) 41303 v.AddArg(x) 41304 v0 := b.NewValue0(v.Pos, OpConst64, t) 41305 v0.AuxInt = int64(uint32(c)) 41306 v.AddArg(v0) 41307 return true 41308 } 41309 // match: (Rsh32Ux32 (Const32 [0]) _) 41310 // result: (Const32 [0]) 41311 for { 41312 _ = v.Args[1] 41313 v_0 := v.Args[0] 41314 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 41315 break 41316 } 41317 v.reset(OpConst32) 41318 v.AuxInt = 0 41319 return true 41320 } 41321 return false 41322 } 41323 func rewriteValuegeneric_OpRsh32Ux64_0(v *Value) bool { 41324 b := v.Block 41325 typ := &b.Func.Config.Types 41326 // match: (Rsh32Ux64 (Const32 [c]) (Const64 [d])) 41327 // result: (Const32 [int64(int32(uint32(c) >> uint64(d)))]) 41328 for { 41329 _ = v.Args[1] 41330 v_0 := v.Args[0] 41331 if v_0.Op != OpConst32 { 41332 break 41333 } 41334 c := v_0.AuxInt 41335 v_1 := v.Args[1] 41336 if v_1.Op != OpConst64 { 41337 break 41338 } 41339 d := v_1.AuxInt 41340 v.reset(OpConst32) 41341 v.AuxInt = int64(int32(uint32(c) >> uint64(d))) 41342 return true 41343 } 41344 // match: (Rsh32Ux64 x (Const64 [0])) 41345 // result: x 41346 for { 41347 _ = v.Args[1] 41348 x := v.Args[0] 41349 v_1 := v.Args[1] 41350 if v_1.Op != OpConst64 || v_1.AuxInt != 0 { 41351 break 41352 } 41353 v.reset(OpCopy) 41354 v.Type = x.Type 41355 v.AddArg(x) 41356 return true 41357 } 41358 // match: (Rsh32Ux64 (Const32 [0]) _) 41359 // result: (Const32 [0]) 41360 for { 41361 _ = v.Args[1] 41362 v_0 := v.Args[0] 41363 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 41364 break 41365 } 41366 v.reset(OpConst32) 41367 v.AuxInt = 0 41368 return true 41369 } 41370 // match: (Rsh32Ux64 _ (Const64 [c])) 41371 // cond: uint64(c) >= 32 41372 // result: (Const32 [0]) 41373 for { 41374 _ = v.Args[1] 41375 v_1 := v.Args[1] 41376 if v_1.Op != OpConst64 { 41377 break 41378 } 41379 c := v_1.AuxInt 41380 if !(uint64(c) >= 32) { 41381 break 41382 } 41383 v.reset(OpConst32) 41384 v.AuxInt = 0 41385 return true 41386 } 41387 // match: (Rsh32Ux64 <t> (Rsh32Ux64 x (Const64 [c])) (Const64 [d])) 41388 // cond: !uaddOvf(c,d) 41389 // result: (Rsh32Ux64 x (Const64 <t> [c+d])) 41390 for { 41391 t := v.Type 41392 _ = v.Args[1] 41393 v_0 := v.Args[0] 41394 if v_0.Op != OpRsh32Ux64 { 41395 break 41396 } 41397 _ = v_0.Args[1] 41398 x := v_0.Args[0] 41399 v_0_1 := v_0.Args[1] 41400 if v_0_1.Op != OpConst64 { 41401 break 41402 } 41403 c := v_0_1.AuxInt 41404 v_1 := v.Args[1] 41405 if v_1.Op != OpConst64 { 41406 break 41407 } 41408 d := v_1.AuxInt 41409 if !(!uaddOvf(c, d)) { 41410 break 41411 } 41412 v.reset(OpRsh32Ux64) 41413 v.AddArg(x) 41414 v0 := b.NewValue0(v.Pos, OpConst64, t) 41415 v0.AuxInt = c + d 41416 v.AddArg(v0) 41417 return true 41418 } 41419 // match: (Rsh32Ux64 (Rsh32x64 x _) (Const64 <t> [31])) 41420 // result: (Rsh32Ux64 x (Const64 <t> [31])) 41421 for { 41422 _ = v.Args[1] 41423 v_0 := v.Args[0] 41424 if v_0.Op != OpRsh32x64 { 41425 break 41426 } 41427 _ = v_0.Args[1] 41428 x := v_0.Args[0] 41429 v_1 := v.Args[1] 41430 if v_1.Op != OpConst64 { 41431 break 41432 } 41433 t := v_1.Type 41434 if v_1.AuxInt != 31 { 41435 break 41436 } 41437 v.reset(OpRsh32Ux64) 41438 v.AddArg(x) 41439 v0 := b.NewValue0(v.Pos, OpConst64, t) 41440 v0.AuxInt = 31 41441 v.AddArg(v0) 41442 return true 41443 } 41444 // match: (Rsh32Ux64 (Lsh32x64 (Rsh32Ux64 x (Const64 [c1])) (Const64 [c2])) (Const64 [c3])) 41445 // cond: uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3) 41446 // result: (Rsh32Ux64 x (Const64 <typ.UInt64> [c1-c2+c3])) 41447 for { 41448 _ = v.Args[1] 41449 v_0 := v.Args[0] 41450 if v_0.Op != OpLsh32x64 { 41451 break 41452 } 41453 _ = v_0.Args[1] 41454 v_0_0 := v_0.Args[0] 41455 if v_0_0.Op != OpRsh32Ux64 { 41456 break 41457 } 41458 _ = v_0_0.Args[1] 41459 x := v_0_0.Args[0] 41460 v_0_0_1 := v_0_0.Args[1] 41461 if v_0_0_1.Op != OpConst64 { 41462 break 41463 } 41464 c1 := v_0_0_1.AuxInt 41465 v_0_1 := v_0.Args[1] 41466 if v_0_1.Op != OpConst64 { 41467 break 41468 } 41469 c2 := v_0_1.AuxInt 41470 v_1 := v.Args[1] 41471 if v_1.Op != OpConst64 { 41472 break 41473 } 41474 c3 := v_1.AuxInt 41475 if !(uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)) { 41476 break 41477 } 41478 v.reset(OpRsh32Ux64) 41479 v.AddArg(x) 41480 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 41481 v0.AuxInt = c1 - c2 + c3 41482 v.AddArg(v0) 41483 return true 41484 } 41485 // match: (Rsh32Ux64 (Lsh32x64 x (Const64 [24])) (Const64 [24])) 41486 // result: (ZeroExt8to32 (Trunc32to8 <typ.UInt8> x)) 41487 for { 41488 _ = v.Args[1] 41489 v_0 := v.Args[0] 41490 if v_0.Op != OpLsh32x64 { 41491 break 41492 } 41493 _ = v_0.Args[1] 41494 x := v_0.Args[0] 41495 v_0_1 := v_0.Args[1] 41496 if v_0_1.Op != OpConst64 || v_0_1.AuxInt != 24 { 41497 break 41498 } 41499 v_1 := v.Args[1] 41500 if v_1.Op != OpConst64 || v_1.AuxInt != 24 { 41501 break 41502 } 41503 v.reset(OpZeroExt8to32) 41504 v0 := b.NewValue0(v.Pos, OpTrunc32to8, typ.UInt8) 41505 v0.AddArg(x) 41506 v.AddArg(v0) 41507 return true 41508 } 41509 // match: (Rsh32Ux64 (Lsh32x64 x (Const64 [16])) (Const64 [16])) 41510 // result: (ZeroExt16to32 (Trunc32to16 <typ.UInt16> x)) 41511 for { 41512 _ = v.Args[1] 41513 v_0 := v.Args[0] 41514 if v_0.Op != OpLsh32x64 { 41515 break 41516 } 41517 _ = v_0.Args[1] 41518 x := v_0.Args[0] 41519 v_0_1 := v_0.Args[1] 41520 if v_0_1.Op != OpConst64 || v_0_1.AuxInt != 16 { 41521 break 41522 } 41523 v_1 := v.Args[1] 41524 if v_1.Op != OpConst64 || v_1.AuxInt != 16 { 41525 break 41526 } 41527 v.reset(OpZeroExt16to32) 41528 v0 := b.NewValue0(v.Pos, OpTrunc32to16, typ.UInt16) 41529 v0.AddArg(x) 41530 v.AddArg(v0) 41531 return true 41532 } 41533 return false 41534 } 41535 func rewriteValuegeneric_OpRsh32Ux8_0(v *Value) bool { 41536 b := v.Block 41537 // match: (Rsh32Ux8 <t> x (Const8 [c])) 41538 // result: (Rsh32Ux64 x (Const64 <t> [int64(uint8(c))])) 41539 for { 41540 t := v.Type 41541 _ = v.Args[1] 41542 x := v.Args[0] 41543 v_1 := v.Args[1] 41544 if v_1.Op != OpConst8 { 41545 break 41546 } 41547 c := v_1.AuxInt 41548 v.reset(OpRsh32Ux64) 41549 v.AddArg(x) 41550 v0 := b.NewValue0(v.Pos, OpConst64, t) 41551 v0.AuxInt = int64(uint8(c)) 41552 v.AddArg(v0) 41553 return true 41554 } 41555 // match: (Rsh32Ux8 (Const32 [0]) _) 41556 // result: (Const32 [0]) 41557 for { 41558 _ = v.Args[1] 41559 v_0 := v.Args[0] 41560 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 41561 break 41562 } 41563 v.reset(OpConst32) 41564 v.AuxInt = 0 41565 return true 41566 } 41567 return false 41568 } 41569 func rewriteValuegeneric_OpRsh32x16_0(v *Value) bool { 41570 b := v.Block 41571 // match: (Rsh32x16 <t> x (Const16 [c])) 41572 // result: (Rsh32x64 x (Const64 <t> [int64(uint16(c))])) 41573 for { 41574 t := v.Type 41575 _ = v.Args[1] 41576 x := v.Args[0] 41577 v_1 := v.Args[1] 41578 if v_1.Op != OpConst16 { 41579 break 41580 } 41581 c := v_1.AuxInt 41582 v.reset(OpRsh32x64) 41583 v.AddArg(x) 41584 v0 := b.NewValue0(v.Pos, OpConst64, t) 41585 v0.AuxInt = int64(uint16(c)) 41586 v.AddArg(v0) 41587 return true 41588 } 41589 // match: (Rsh32x16 (Const32 [0]) _) 41590 // result: (Const32 [0]) 41591 for { 41592 _ = v.Args[1] 41593 v_0 := v.Args[0] 41594 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 41595 break 41596 } 41597 v.reset(OpConst32) 41598 v.AuxInt = 0 41599 return true 41600 } 41601 return false 41602 } 41603 func rewriteValuegeneric_OpRsh32x32_0(v *Value) bool { 41604 b := v.Block 41605 // match: (Rsh32x32 <t> x (Const32 [c])) 41606 // result: (Rsh32x64 x (Const64 <t> [int64(uint32(c))])) 41607 for { 41608 t := v.Type 41609 _ = v.Args[1] 41610 x := v.Args[0] 41611 v_1 := v.Args[1] 41612 if v_1.Op != OpConst32 { 41613 break 41614 } 41615 c := v_1.AuxInt 41616 v.reset(OpRsh32x64) 41617 v.AddArg(x) 41618 v0 := b.NewValue0(v.Pos, OpConst64, t) 41619 v0.AuxInt = int64(uint32(c)) 41620 v.AddArg(v0) 41621 return true 41622 } 41623 // match: (Rsh32x32 (Const32 [0]) _) 41624 // result: (Const32 [0]) 41625 for { 41626 _ = v.Args[1] 41627 v_0 := v.Args[0] 41628 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 41629 break 41630 } 41631 v.reset(OpConst32) 41632 v.AuxInt = 0 41633 return true 41634 } 41635 return false 41636 } 41637 func rewriteValuegeneric_OpRsh32x64_0(v *Value) bool { 41638 b := v.Block 41639 typ := &b.Func.Config.Types 41640 // match: (Rsh32x64 (Const32 [c]) (Const64 [d])) 41641 // result: (Const32 [int64(int32(c) >> uint64(d))]) 41642 for { 41643 _ = v.Args[1] 41644 v_0 := v.Args[0] 41645 if v_0.Op != OpConst32 { 41646 break 41647 } 41648 c := v_0.AuxInt 41649 v_1 := v.Args[1] 41650 if v_1.Op != OpConst64 { 41651 break 41652 } 41653 d := v_1.AuxInt 41654 v.reset(OpConst32) 41655 v.AuxInt = int64(int32(c) >> uint64(d)) 41656 return true 41657 } 41658 // match: (Rsh32x64 x (Const64 [0])) 41659 // result: x 41660 for { 41661 _ = v.Args[1] 41662 x := v.Args[0] 41663 v_1 := v.Args[1] 41664 if v_1.Op != OpConst64 || v_1.AuxInt != 0 { 41665 break 41666 } 41667 v.reset(OpCopy) 41668 v.Type = x.Type 41669 v.AddArg(x) 41670 return true 41671 } 41672 // match: (Rsh32x64 (Const32 [0]) _) 41673 // result: (Const32 [0]) 41674 for { 41675 _ = v.Args[1] 41676 v_0 := v.Args[0] 41677 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 41678 break 41679 } 41680 v.reset(OpConst32) 41681 v.AuxInt = 0 41682 return true 41683 } 41684 // match: (Rsh32x64 <t> (Rsh32x64 x (Const64 [c])) (Const64 [d])) 41685 // cond: !uaddOvf(c,d) 41686 // result: (Rsh32x64 x (Const64 <t> [c+d])) 41687 for { 41688 t := v.Type 41689 _ = v.Args[1] 41690 v_0 := v.Args[0] 41691 if v_0.Op != OpRsh32x64 { 41692 break 41693 } 41694 _ = v_0.Args[1] 41695 x := v_0.Args[0] 41696 v_0_1 := v_0.Args[1] 41697 if v_0_1.Op != OpConst64 { 41698 break 41699 } 41700 c := v_0_1.AuxInt 41701 v_1 := v.Args[1] 41702 if v_1.Op != OpConst64 { 41703 break 41704 } 41705 d := v_1.AuxInt 41706 if !(!uaddOvf(c, d)) { 41707 break 41708 } 41709 v.reset(OpRsh32x64) 41710 v.AddArg(x) 41711 v0 := b.NewValue0(v.Pos, OpConst64, t) 41712 v0.AuxInt = c + d 41713 v.AddArg(v0) 41714 return true 41715 } 41716 // match: (Rsh32x64 (Lsh32x64 x (Const64 [24])) (Const64 [24])) 41717 // result: (SignExt8to32 (Trunc32to8 <typ.Int8> x)) 41718 for { 41719 _ = v.Args[1] 41720 v_0 := v.Args[0] 41721 if v_0.Op != OpLsh32x64 { 41722 break 41723 } 41724 _ = v_0.Args[1] 41725 x := v_0.Args[0] 41726 v_0_1 := v_0.Args[1] 41727 if v_0_1.Op != OpConst64 || v_0_1.AuxInt != 24 { 41728 break 41729 } 41730 v_1 := v.Args[1] 41731 if v_1.Op != OpConst64 || v_1.AuxInt != 24 { 41732 break 41733 } 41734 v.reset(OpSignExt8to32) 41735 v0 := b.NewValue0(v.Pos, OpTrunc32to8, typ.Int8) 41736 v0.AddArg(x) 41737 v.AddArg(v0) 41738 return true 41739 } 41740 // match: (Rsh32x64 (Lsh32x64 x (Const64 [16])) (Const64 [16])) 41741 // result: (SignExt16to32 (Trunc32to16 <typ.Int16> x)) 41742 for { 41743 _ = v.Args[1] 41744 v_0 := v.Args[0] 41745 if v_0.Op != OpLsh32x64 { 41746 break 41747 } 41748 _ = v_0.Args[1] 41749 x := v_0.Args[0] 41750 v_0_1 := v_0.Args[1] 41751 if v_0_1.Op != OpConst64 || v_0_1.AuxInt != 16 { 41752 break 41753 } 41754 v_1 := v.Args[1] 41755 if v_1.Op != OpConst64 || v_1.AuxInt != 16 { 41756 break 41757 } 41758 v.reset(OpSignExt16to32) 41759 v0 := b.NewValue0(v.Pos, OpTrunc32to16, typ.Int16) 41760 v0.AddArg(x) 41761 v.AddArg(v0) 41762 return true 41763 } 41764 return false 41765 } 41766 func rewriteValuegeneric_OpRsh32x8_0(v *Value) bool { 41767 b := v.Block 41768 // match: (Rsh32x8 <t> x (Const8 [c])) 41769 // result: (Rsh32x64 x (Const64 <t> [int64(uint8(c))])) 41770 for { 41771 t := v.Type 41772 _ = v.Args[1] 41773 x := v.Args[0] 41774 v_1 := v.Args[1] 41775 if v_1.Op != OpConst8 { 41776 break 41777 } 41778 c := v_1.AuxInt 41779 v.reset(OpRsh32x64) 41780 v.AddArg(x) 41781 v0 := b.NewValue0(v.Pos, OpConst64, t) 41782 v0.AuxInt = int64(uint8(c)) 41783 v.AddArg(v0) 41784 return true 41785 } 41786 // match: (Rsh32x8 (Const32 [0]) _) 41787 // result: (Const32 [0]) 41788 for { 41789 _ = v.Args[1] 41790 v_0 := v.Args[0] 41791 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 41792 break 41793 } 41794 v.reset(OpConst32) 41795 v.AuxInt = 0 41796 return true 41797 } 41798 return false 41799 } 41800 func rewriteValuegeneric_OpRsh64Ux16_0(v *Value) bool { 41801 b := v.Block 41802 // match: (Rsh64Ux16 <t> x (Const16 [c])) 41803 // result: (Rsh64Ux64 x (Const64 <t> [int64(uint16(c))])) 41804 for { 41805 t := v.Type 41806 _ = v.Args[1] 41807 x := v.Args[0] 41808 v_1 := v.Args[1] 41809 if v_1.Op != OpConst16 { 41810 break 41811 } 41812 c := v_1.AuxInt 41813 v.reset(OpRsh64Ux64) 41814 v.AddArg(x) 41815 v0 := b.NewValue0(v.Pos, OpConst64, t) 41816 v0.AuxInt = int64(uint16(c)) 41817 v.AddArg(v0) 41818 return true 41819 } 41820 // match: (Rsh64Ux16 (Const64 [0]) _) 41821 // result: (Const64 [0]) 41822 for { 41823 _ = v.Args[1] 41824 v_0 := v.Args[0] 41825 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 41826 break 41827 } 41828 v.reset(OpConst64) 41829 v.AuxInt = 0 41830 return true 41831 } 41832 return false 41833 } 41834 func rewriteValuegeneric_OpRsh64Ux32_0(v *Value) bool { 41835 b := v.Block 41836 // match: (Rsh64Ux32 <t> x (Const32 [c])) 41837 // result: (Rsh64Ux64 x (Const64 <t> [int64(uint32(c))])) 41838 for { 41839 t := v.Type 41840 _ = v.Args[1] 41841 x := v.Args[0] 41842 v_1 := v.Args[1] 41843 if v_1.Op != OpConst32 { 41844 break 41845 } 41846 c := v_1.AuxInt 41847 v.reset(OpRsh64Ux64) 41848 v.AddArg(x) 41849 v0 := b.NewValue0(v.Pos, OpConst64, t) 41850 v0.AuxInt = int64(uint32(c)) 41851 v.AddArg(v0) 41852 return true 41853 } 41854 // match: (Rsh64Ux32 (Const64 [0]) _) 41855 // result: (Const64 [0]) 41856 for { 41857 _ = v.Args[1] 41858 v_0 := v.Args[0] 41859 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 41860 break 41861 } 41862 v.reset(OpConst64) 41863 v.AuxInt = 0 41864 return true 41865 } 41866 return false 41867 } 41868 func rewriteValuegeneric_OpRsh64Ux64_0(v *Value) bool { 41869 b := v.Block 41870 typ := &b.Func.Config.Types 41871 // match: (Rsh64Ux64 (Const64 [c]) (Const64 [d])) 41872 // result: (Const64 [int64(uint64(c) >> uint64(d))]) 41873 for { 41874 _ = v.Args[1] 41875 v_0 := v.Args[0] 41876 if v_0.Op != OpConst64 { 41877 break 41878 } 41879 c := v_0.AuxInt 41880 v_1 := v.Args[1] 41881 if v_1.Op != OpConst64 { 41882 break 41883 } 41884 d := v_1.AuxInt 41885 v.reset(OpConst64) 41886 v.AuxInt = int64(uint64(c) >> uint64(d)) 41887 return true 41888 } 41889 // match: (Rsh64Ux64 x (Const64 [0])) 41890 // result: x 41891 for { 41892 _ = v.Args[1] 41893 x := v.Args[0] 41894 v_1 := v.Args[1] 41895 if v_1.Op != OpConst64 || v_1.AuxInt != 0 { 41896 break 41897 } 41898 v.reset(OpCopy) 41899 v.Type = x.Type 41900 v.AddArg(x) 41901 return true 41902 } 41903 // match: (Rsh64Ux64 (Const64 [0]) _) 41904 // result: (Const64 [0]) 41905 for { 41906 _ = v.Args[1] 41907 v_0 := v.Args[0] 41908 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 41909 break 41910 } 41911 v.reset(OpConst64) 41912 v.AuxInt = 0 41913 return true 41914 } 41915 // match: (Rsh64Ux64 _ (Const64 [c])) 41916 // cond: uint64(c) >= 64 41917 // result: (Const64 [0]) 41918 for { 41919 _ = v.Args[1] 41920 v_1 := v.Args[1] 41921 if v_1.Op != OpConst64 { 41922 break 41923 } 41924 c := v_1.AuxInt 41925 if !(uint64(c) >= 64) { 41926 break 41927 } 41928 v.reset(OpConst64) 41929 v.AuxInt = 0 41930 return true 41931 } 41932 // match: (Rsh64Ux64 <t> (Rsh64Ux64 x (Const64 [c])) (Const64 [d])) 41933 // cond: !uaddOvf(c,d) 41934 // result: (Rsh64Ux64 x (Const64 <t> [c+d])) 41935 for { 41936 t := v.Type 41937 _ = v.Args[1] 41938 v_0 := v.Args[0] 41939 if v_0.Op != OpRsh64Ux64 { 41940 break 41941 } 41942 _ = v_0.Args[1] 41943 x := v_0.Args[0] 41944 v_0_1 := v_0.Args[1] 41945 if v_0_1.Op != OpConst64 { 41946 break 41947 } 41948 c := v_0_1.AuxInt 41949 v_1 := v.Args[1] 41950 if v_1.Op != OpConst64 { 41951 break 41952 } 41953 d := v_1.AuxInt 41954 if !(!uaddOvf(c, d)) { 41955 break 41956 } 41957 v.reset(OpRsh64Ux64) 41958 v.AddArg(x) 41959 v0 := b.NewValue0(v.Pos, OpConst64, t) 41960 v0.AuxInt = c + d 41961 v.AddArg(v0) 41962 return true 41963 } 41964 // match: (Rsh64Ux64 (Rsh64x64 x _) (Const64 <t> [63])) 41965 // result: (Rsh64Ux64 x (Const64 <t> [63])) 41966 for { 41967 _ = v.Args[1] 41968 v_0 := v.Args[0] 41969 if v_0.Op != OpRsh64x64 { 41970 break 41971 } 41972 _ = v_0.Args[1] 41973 x := v_0.Args[0] 41974 v_1 := v.Args[1] 41975 if v_1.Op != OpConst64 { 41976 break 41977 } 41978 t := v_1.Type 41979 if v_1.AuxInt != 63 { 41980 break 41981 } 41982 v.reset(OpRsh64Ux64) 41983 v.AddArg(x) 41984 v0 := b.NewValue0(v.Pos, OpConst64, t) 41985 v0.AuxInt = 63 41986 v.AddArg(v0) 41987 return true 41988 } 41989 // match: (Rsh64Ux64 (Lsh64x64 (Rsh64Ux64 x (Const64 [c1])) (Const64 [c2])) (Const64 [c3])) 41990 // cond: uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3) 41991 // result: (Rsh64Ux64 x (Const64 <typ.UInt64> [c1-c2+c3])) 41992 for { 41993 _ = v.Args[1] 41994 v_0 := v.Args[0] 41995 if v_0.Op != OpLsh64x64 { 41996 break 41997 } 41998 _ = v_0.Args[1] 41999 v_0_0 := v_0.Args[0] 42000 if v_0_0.Op != OpRsh64Ux64 { 42001 break 42002 } 42003 _ = v_0_0.Args[1] 42004 x := v_0_0.Args[0] 42005 v_0_0_1 := v_0_0.Args[1] 42006 if v_0_0_1.Op != OpConst64 { 42007 break 42008 } 42009 c1 := v_0_0_1.AuxInt 42010 v_0_1 := v_0.Args[1] 42011 if v_0_1.Op != OpConst64 { 42012 break 42013 } 42014 c2 := v_0_1.AuxInt 42015 v_1 := v.Args[1] 42016 if v_1.Op != OpConst64 { 42017 break 42018 } 42019 c3 := v_1.AuxInt 42020 if !(uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)) { 42021 break 42022 } 42023 v.reset(OpRsh64Ux64) 42024 v.AddArg(x) 42025 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 42026 v0.AuxInt = c1 - c2 + c3 42027 v.AddArg(v0) 42028 return true 42029 } 42030 // match: (Rsh64Ux64 (Lsh64x64 x (Const64 [56])) (Const64 [56])) 42031 // result: (ZeroExt8to64 (Trunc64to8 <typ.UInt8> x)) 42032 for { 42033 _ = v.Args[1] 42034 v_0 := v.Args[0] 42035 if v_0.Op != OpLsh64x64 { 42036 break 42037 } 42038 _ = v_0.Args[1] 42039 x := v_0.Args[0] 42040 v_0_1 := v_0.Args[1] 42041 if v_0_1.Op != OpConst64 || v_0_1.AuxInt != 56 { 42042 break 42043 } 42044 v_1 := v.Args[1] 42045 if v_1.Op != OpConst64 || v_1.AuxInt != 56 { 42046 break 42047 } 42048 v.reset(OpZeroExt8to64) 42049 v0 := b.NewValue0(v.Pos, OpTrunc64to8, typ.UInt8) 42050 v0.AddArg(x) 42051 v.AddArg(v0) 42052 return true 42053 } 42054 // match: (Rsh64Ux64 (Lsh64x64 x (Const64 [48])) (Const64 [48])) 42055 // result: (ZeroExt16to64 (Trunc64to16 <typ.UInt16> x)) 42056 for { 42057 _ = v.Args[1] 42058 v_0 := v.Args[0] 42059 if v_0.Op != OpLsh64x64 { 42060 break 42061 } 42062 _ = v_0.Args[1] 42063 x := v_0.Args[0] 42064 v_0_1 := v_0.Args[1] 42065 if v_0_1.Op != OpConst64 || v_0_1.AuxInt != 48 { 42066 break 42067 } 42068 v_1 := v.Args[1] 42069 if v_1.Op != OpConst64 || v_1.AuxInt != 48 { 42070 break 42071 } 42072 v.reset(OpZeroExt16to64) 42073 v0 := b.NewValue0(v.Pos, OpTrunc64to16, typ.UInt16) 42074 v0.AddArg(x) 42075 v.AddArg(v0) 42076 return true 42077 } 42078 // match: (Rsh64Ux64 (Lsh64x64 x (Const64 [32])) (Const64 [32])) 42079 // result: (ZeroExt32to64 (Trunc64to32 <typ.UInt32> x)) 42080 for { 42081 _ = v.Args[1] 42082 v_0 := v.Args[0] 42083 if v_0.Op != OpLsh64x64 { 42084 break 42085 } 42086 _ = v_0.Args[1] 42087 x := v_0.Args[0] 42088 v_0_1 := v_0.Args[1] 42089 if v_0_1.Op != OpConst64 || v_0_1.AuxInt != 32 { 42090 break 42091 } 42092 v_1 := v.Args[1] 42093 if v_1.Op != OpConst64 || v_1.AuxInt != 32 { 42094 break 42095 } 42096 v.reset(OpZeroExt32to64) 42097 v0 := b.NewValue0(v.Pos, OpTrunc64to32, typ.UInt32) 42098 v0.AddArg(x) 42099 v.AddArg(v0) 42100 return true 42101 } 42102 return false 42103 } 42104 func rewriteValuegeneric_OpRsh64Ux8_0(v *Value) bool { 42105 b := v.Block 42106 // match: (Rsh64Ux8 <t> x (Const8 [c])) 42107 // result: (Rsh64Ux64 x (Const64 <t> [int64(uint8(c))])) 42108 for { 42109 t := v.Type 42110 _ = v.Args[1] 42111 x := v.Args[0] 42112 v_1 := v.Args[1] 42113 if v_1.Op != OpConst8 { 42114 break 42115 } 42116 c := v_1.AuxInt 42117 v.reset(OpRsh64Ux64) 42118 v.AddArg(x) 42119 v0 := b.NewValue0(v.Pos, OpConst64, t) 42120 v0.AuxInt = int64(uint8(c)) 42121 v.AddArg(v0) 42122 return true 42123 } 42124 // match: (Rsh64Ux8 (Const64 [0]) _) 42125 // result: (Const64 [0]) 42126 for { 42127 _ = v.Args[1] 42128 v_0 := v.Args[0] 42129 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 42130 break 42131 } 42132 v.reset(OpConst64) 42133 v.AuxInt = 0 42134 return true 42135 } 42136 return false 42137 } 42138 func rewriteValuegeneric_OpRsh64x16_0(v *Value) bool { 42139 b := v.Block 42140 // match: (Rsh64x16 <t> x (Const16 [c])) 42141 // result: (Rsh64x64 x (Const64 <t> [int64(uint16(c))])) 42142 for { 42143 t := v.Type 42144 _ = v.Args[1] 42145 x := v.Args[0] 42146 v_1 := v.Args[1] 42147 if v_1.Op != OpConst16 { 42148 break 42149 } 42150 c := v_1.AuxInt 42151 v.reset(OpRsh64x64) 42152 v.AddArg(x) 42153 v0 := b.NewValue0(v.Pos, OpConst64, t) 42154 v0.AuxInt = int64(uint16(c)) 42155 v.AddArg(v0) 42156 return true 42157 } 42158 // match: (Rsh64x16 (Const64 [0]) _) 42159 // result: (Const64 [0]) 42160 for { 42161 _ = v.Args[1] 42162 v_0 := v.Args[0] 42163 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 42164 break 42165 } 42166 v.reset(OpConst64) 42167 v.AuxInt = 0 42168 return true 42169 } 42170 return false 42171 } 42172 func rewriteValuegeneric_OpRsh64x32_0(v *Value) bool { 42173 b := v.Block 42174 // match: (Rsh64x32 <t> x (Const32 [c])) 42175 // result: (Rsh64x64 x (Const64 <t> [int64(uint32(c))])) 42176 for { 42177 t := v.Type 42178 _ = v.Args[1] 42179 x := v.Args[0] 42180 v_1 := v.Args[1] 42181 if v_1.Op != OpConst32 { 42182 break 42183 } 42184 c := v_1.AuxInt 42185 v.reset(OpRsh64x64) 42186 v.AddArg(x) 42187 v0 := b.NewValue0(v.Pos, OpConst64, t) 42188 v0.AuxInt = int64(uint32(c)) 42189 v.AddArg(v0) 42190 return true 42191 } 42192 // match: (Rsh64x32 (Const64 [0]) _) 42193 // result: (Const64 [0]) 42194 for { 42195 _ = v.Args[1] 42196 v_0 := v.Args[0] 42197 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 42198 break 42199 } 42200 v.reset(OpConst64) 42201 v.AuxInt = 0 42202 return true 42203 } 42204 return false 42205 } 42206 func rewriteValuegeneric_OpRsh64x64_0(v *Value) bool { 42207 b := v.Block 42208 typ := &b.Func.Config.Types 42209 // match: (Rsh64x64 (Const64 [c]) (Const64 [d])) 42210 // result: (Const64 [c >> uint64(d)]) 42211 for { 42212 _ = v.Args[1] 42213 v_0 := v.Args[0] 42214 if v_0.Op != OpConst64 { 42215 break 42216 } 42217 c := v_0.AuxInt 42218 v_1 := v.Args[1] 42219 if v_1.Op != OpConst64 { 42220 break 42221 } 42222 d := v_1.AuxInt 42223 v.reset(OpConst64) 42224 v.AuxInt = c >> uint64(d) 42225 return true 42226 } 42227 // match: (Rsh64x64 x (Const64 [0])) 42228 // result: x 42229 for { 42230 _ = v.Args[1] 42231 x := v.Args[0] 42232 v_1 := v.Args[1] 42233 if v_1.Op != OpConst64 || v_1.AuxInt != 0 { 42234 break 42235 } 42236 v.reset(OpCopy) 42237 v.Type = x.Type 42238 v.AddArg(x) 42239 return true 42240 } 42241 // match: (Rsh64x64 (Const64 [0]) _) 42242 // result: (Const64 [0]) 42243 for { 42244 _ = v.Args[1] 42245 v_0 := v.Args[0] 42246 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 42247 break 42248 } 42249 v.reset(OpConst64) 42250 v.AuxInt = 0 42251 return true 42252 } 42253 // match: (Rsh64x64 <t> (Rsh64x64 x (Const64 [c])) (Const64 [d])) 42254 // cond: !uaddOvf(c,d) 42255 // result: (Rsh64x64 x (Const64 <t> [c+d])) 42256 for { 42257 t := v.Type 42258 _ = v.Args[1] 42259 v_0 := v.Args[0] 42260 if v_0.Op != OpRsh64x64 { 42261 break 42262 } 42263 _ = v_0.Args[1] 42264 x := v_0.Args[0] 42265 v_0_1 := v_0.Args[1] 42266 if v_0_1.Op != OpConst64 { 42267 break 42268 } 42269 c := v_0_1.AuxInt 42270 v_1 := v.Args[1] 42271 if v_1.Op != OpConst64 { 42272 break 42273 } 42274 d := v_1.AuxInt 42275 if !(!uaddOvf(c, d)) { 42276 break 42277 } 42278 v.reset(OpRsh64x64) 42279 v.AddArg(x) 42280 v0 := b.NewValue0(v.Pos, OpConst64, t) 42281 v0.AuxInt = c + d 42282 v.AddArg(v0) 42283 return true 42284 } 42285 // match: (Rsh64x64 (Lsh64x64 x (Const64 [56])) (Const64 [56])) 42286 // result: (SignExt8to64 (Trunc64to8 <typ.Int8> x)) 42287 for { 42288 _ = v.Args[1] 42289 v_0 := v.Args[0] 42290 if v_0.Op != OpLsh64x64 { 42291 break 42292 } 42293 _ = v_0.Args[1] 42294 x := v_0.Args[0] 42295 v_0_1 := v_0.Args[1] 42296 if v_0_1.Op != OpConst64 || v_0_1.AuxInt != 56 { 42297 break 42298 } 42299 v_1 := v.Args[1] 42300 if v_1.Op != OpConst64 || v_1.AuxInt != 56 { 42301 break 42302 } 42303 v.reset(OpSignExt8to64) 42304 v0 := b.NewValue0(v.Pos, OpTrunc64to8, typ.Int8) 42305 v0.AddArg(x) 42306 v.AddArg(v0) 42307 return true 42308 } 42309 // match: (Rsh64x64 (Lsh64x64 x (Const64 [48])) (Const64 [48])) 42310 // result: (SignExt16to64 (Trunc64to16 <typ.Int16> x)) 42311 for { 42312 _ = v.Args[1] 42313 v_0 := v.Args[0] 42314 if v_0.Op != OpLsh64x64 { 42315 break 42316 } 42317 _ = v_0.Args[1] 42318 x := v_0.Args[0] 42319 v_0_1 := v_0.Args[1] 42320 if v_0_1.Op != OpConst64 || v_0_1.AuxInt != 48 { 42321 break 42322 } 42323 v_1 := v.Args[1] 42324 if v_1.Op != OpConst64 || v_1.AuxInt != 48 { 42325 break 42326 } 42327 v.reset(OpSignExt16to64) 42328 v0 := b.NewValue0(v.Pos, OpTrunc64to16, typ.Int16) 42329 v0.AddArg(x) 42330 v.AddArg(v0) 42331 return true 42332 } 42333 // match: (Rsh64x64 (Lsh64x64 x (Const64 [32])) (Const64 [32])) 42334 // result: (SignExt32to64 (Trunc64to32 <typ.Int32> x)) 42335 for { 42336 _ = v.Args[1] 42337 v_0 := v.Args[0] 42338 if v_0.Op != OpLsh64x64 { 42339 break 42340 } 42341 _ = v_0.Args[1] 42342 x := v_0.Args[0] 42343 v_0_1 := v_0.Args[1] 42344 if v_0_1.Op != OpConst64 || v_0_1.AuxInt != 32 { 42345 break 42346 } 42347 v_1 := v.Args[1] 42348 if v_1.Op != OpConst64 || v_1.AuxInt != 32 { 42349 break 42350 } 42351 v.reset(OpSignExt32to64) 42352 v0 := b.NewValue0(v.Pos, OpTrunc64to32, typ.Int32) 42353 v0.AddArg(x) 42354 v.AddArg(v0) 42355 return true 42356 } 42357 return false 42358 } 42359 func rewriteValuegeneric_OpRsh64x8_0(v *Value) bool { 42360 b := v.Block 42361 // match: (Rsh64x8 <t> x (Const8 [c])) 42362 // result: (Rsh64x64 x (Const64 <t> [int64(uint8(c))])) 42363 for { 42364 t := v.Type 42365 _ = v.Args[1] 42366 x := v.Args[0] 42367 v_1 := v.Args[1] 42368 if v_1.Op != OpConst8 { 42369 break 42370 } 42371 c := v_1.AuxInt 42372 v.reset(OpRsh64x64) 42373 v.AddArg(x) 42374 v0 := b.NewValue0(v.Pos, OpConst64, t) 42375 v0.AuxInt = int64(uint8(c)) 42376 v.AddArg(v0) 42377 return true 42378 } 42379 // match: (Rsh64x8 (Const64 [0]) _) 42380 // result: (Const64 [0]) 42381 for { 42382 _ = v.Args[1] 42383 v_0 := v.Args[0] 42384 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 42385 break 42386 } 42387 v.reset(OpConst64) 42388 v.AuxInt = 0 42389 return true 42390 } 42391 return false 42392 } 42393 func rewriteValuegeneric_OpRsh8Ux16_0(v *Value) bool { 42394 b := v.Block 42395 // match: (Rsh8Ux16 <t> x (Const16 [c])) 42396 // result: (Rsh8Ux64 x (Const64 <t> [int64(uint16(c))])) 42397 for { 42398 t := v.Type 42399 _ = v.Args[1] 42400 x := v.Args[0] 42401 v_1 := v.Args[1] 42402 if v_1.Op != OpConst16 { 42403 break 42404 } 42405 c := v_1.AuxInt 42406 v.reset(OpRsh8Ux64) 42407 v.AddArg(x) 42408 v0 := b.NewValue0(v.Pos, OpConst64, t) 42409 v0.AuxInt = int64(uint16(c)) 42410 v.AddArg(v0) 42411 return true 42412 } 42413 // match: (Rsh8Ux16 (Const8 [0]) _) 42414 // result: (Const8 [0]) 42415 for { 42416 _ = v.Args[1] 42417 v_0 := v.Args[0] 42418 if v_0.Op != OpConst8 || v_0.AuxInt != 0 { 42419 break 42420 } 42421 v.reset(OpConst8) 42422 v.AuxInt = 0 42423 return true 42424 } 42425 return false 42426 } 42427 func rewriteValuegeneric_OpRsh8Ux32_0(v *Value) bool { 42428 b := v.Block 42429 // match: (Rsh8Ux32 <t> x (Const32 [c])) 42430 // result: (Rsh8Ux64 x (Const64 <t> [int64(uint32(c))])) 42431 for { 42432 t := v.Type 42433 _ = v.Args[1] 42434 x := v.Args[0] 42435 v_1 := v.Args[1] 42436 if v_1.Op != OpConst32 { 42437 break 42438 } 42439 c := v_1.AuxInt 42440 v.reset(OpRsh8Ux64) 42441 v.AddArg(x) 42442 v0 := b.NewValue0(v.Pos, OpConst64, t) 42443 v0.AuxInt = int64(uint32(c)) 42444 v.AddArg(v0) 42445 return true 42446 } 42447 // match: (Rsh8Ux32 (Const8 [0]) _) 42448 // result: (Const8 [0]) 42449 for { 42450 _ = v.Args[1] 42451 v_0 := v.Args[0] 42452 if v_0.Op != OpConst8 || v_0.AuxInt != 0 { 42453 break 42454 } 42455 v.reset(OpConst8) 42456 v.AuxInt = 0 42457 return true 42458 } 42459 return false 42460 } 42461 func rewriteValuegeneric_OpRsh8Ux64_0(v *Value) bool { 42462 b := v.Block 42463 typ := &b.Func.Config.Types 42464 // match: (Rsh8Ux64 (Const8 [c]) (Const64 [d])) 42465 // result: (Const8 [int64(int8(uint8(c) >> uint64(d)))]) 42466 for { 42467 _ = v.Args[1] 42468 v_0 := v.Args[0] 42469 if v_0.Op != OpConst8 { 42470 break 42471 } 42472 c := v_0.AuxInt 42473 v_1 := v.Args[1] 42474 if v_1.Op != OpConst64 { 42475 break 42476 } 42477 d := v_1.AuxInt 42478 v.reset(OpConst8) 42479 v.AuxInt = int64(int8(uint8(c) >> uint64(d))) 42480 return true 42481 } 42482 // match: (Rsh8Ux64 x (Const64 [0])) 42483 // result: x 42484 for { 42485 _ = v.Args[1] 42486 x := v.Args[0] 42487 v_1 := v.Args[1] 42488 if v_1.Op != OpConst64 || v_1.AuxInt != 0 { 42489 break 42490 } 42491 v.reset(OpCopy) 42492 v.Type = x.Type 42493 v.AddArg(x) 42494 return true 42495 } 42496 // match: (Rsh8Ux64 (Const8 [0]) _) 42497 // result: (Const8 [0]) 42498 for { 42499 _ = v.Args[1] 42500 v_0 := v.Args[0] 42501 if v_0.Op != OpConst8 || v_0.AuxInt != 0 { 42502 break 42503 } 42504 v.reset(OpConst8) 42505 v.AuxInt = 0 42506 return true 42507 } 42508 // match: (Rsh8Ux64 _ (Const64 [c])) 42509 // cond: uint64(c) >= 8 42510 // result: (Const8 [0]) 42511 for { 42512 _ = v.Args[1] 42513 v_1 := v.Args[1] 42514 if v_1.Op != OpConst64 { 42515 break 42516 } 42517 c := v_1.AuxInt 42518 if !(uint64(c) >= 8) { 42519 break 42520 } 42521 v.reset(OpConst8) 42522 v.AuxInt = 0 42523 return true 42524 } 42525 // match: (Rsh8Ux64 <t> (Rsh8Ux64 x (Const64 [c])) (Const64 [d])) 42526 // cond: !uaddOvf(c,d) 42527 // result: (Rsh8Ux64 x (Const64 <t> [c+d])) 42528 for { 42529 t := v.Type 42530 _ = v.Args[1] 42531 v_0 := v.Args[0] 42532 if v_0.Op != OpRsh8Ux64 { 42533 break 42534 } 42535 _ = v_0.Args[1] 42536 x := v_0.Args[0] 42537 v_0_1 := v_0.Args[1] 42538 if v_0_1.Op != OpConst64 { 42539 break 42540 } 42541 c := v_0_1.AuxInt 42542 v_1 := v.Args[1] 42543 if v_1.Op != OpConst64 { 42544 break 42545 } 42546 d := v_1.AuxInt 42547 if !(!uaddOvf(c, d)) { 42548 break 42549 } 42550 v.reset(OpRsh8Ux64) 42551 v.AddArg(x) 42552 v0 := b.NewValue0(v.Pos, OpConst64, t) 42553 v0.AuxInt = c + d 42554 v.AddArg(v0) 42555 return true 42556 } 42557 // match: (Rsh8Ux64 (Rsh8x64 x _) (Const64 <t> [7])) 42558 // result: (Rsh8Ux64 x (Const64 <t> [7] )) 42559 for { 42560 _ = v.Args[1] 42561 v_0 := v.Args[0] 42562 if v_0.Op != OpRsh8x64 { 42563 break 42564 } 42565 _ = v_0.Args[1] 42566 x := v_0.Args[0] 42567 v_1 := v.Args[1] 42568 if v_1.Op != OpConst64 { 42569 break 42570 } 42571 t := v_1.Type 42572 if v_1.AuxInt != 7 { 42573 break 42574 } 42575 v.reset(OpRsh8Ux64) 42576 v.AddArg(x) 42577 v0 := b.NewValue0(v.Pos, OpConst64, t) 42578 v0.AuxInt = 7 42579 v.AddArg(v0) 42580 return true 42581 } 42582 // match: (Rsh8Ux64 (Lsh8x64 (Rsh8Ux64 x (Const64 [c1])) (Const64 [c2])) (Const64 [c3])) 42583 // cond: uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3) 42584 // result: (Rsh8Ux64 x (Const64 <typ.UInt64> [c1-c2+c3])) 42585 for { 42586 _ = v.Args[1] 42587 v_0 := v.Args[0] 42588 if v_0.Op != OpLsh8x64 { 42589 break 42590 } 42591 _ = v_0.Args[1] 42592 v_0_0 := v_0.Args[0] 42593 if v_0_0.Op != OpRsh8Ux64 { 42594 break 42595 } 42596 _ = v_0_0.Args[1] 42597 x := v_0_0.Args[0] 42598 v_0_0_1 := v_0_0.Args[1] 42599 if v_0_0_1.Op != OpConst64 { 42600 break 42601 } 42602 c1 := v_0_0_1.AuxInt 42603 v_0_1 := v_0.Args[1] 42604 if v_0_1.Op != OpConst64 { 42605 break 42606 } 42607 c2 := v_0_1.AuxInt 42608 v_1 := v.Args[1] 42609 if v_1.Op != OpConst64 { 42610 break 42611 } 42612 c3 := v_1.AuxInt 42613 if !(uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)) { 42614 break 42615 } 42616 v.reset(OpRsh8Ux64) 42617 v.AddArg(x) 42618 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64) 42619 v0.AuxInt = c1 - c2 + c3 42620 v.AddArg(v0) 42621 return true 42622 } 42623 return false 42624 } 42625 func rewriteValuegeneric_OpRsh8Ux8_0(v *Value) bool { 42626 b := v.Block 42627 // match: (Rsh8Ux8 <t> x (Const8 [c])) 42628 // result: (Rsh8Ux64 x (Const64 <t> [int64(uint8(c))])) 42629 for { 42630 t := v.Type 42631 _ = v.Args[1] 42632 x := v.Args[0] 42633 v_1 := v.Args[1] 42634 if v_1.Op != OpConst8 { 42635 break 42636 } 42637 c := v_1.AuxInt 42638 v.reset(OpRsh8Ux64) 42639 v.AddArg(x) 42640 v0 := b.NewValue0(v.Pos, OpConst64, t) 42641 v0.AuxInt = int64(uint8(c)) 42642 v.AddArg(v0) 42643 return true 42644 } 42645 // match: (Rsh8Ux8 (Const8 [0]) _) 42646 // result: (Const8 [0]) 42647 for { 42648 _ = v.Args[1] 42649 v_0 := v.Args[0] 42650 if v_0.Op != OpConst8 || v_0.AuxInt != 0 { 42651 break 42652 } 42653 v.reset(OpConst8) 42654 v.AuxInt = 0 42655 return true 42656 } 42657 return false 42658 } 42659 func rewriteValuegeneric_OpRsh8x16_0(v *Value) bool { 42660 b := v.Block 42661 // match: (Rsh8x16 <t> x (Const16 [c])) 42662 // result: (Rsh8x64 x (Const64 <t> [int64(uint16(c))])) 42663 for { 42664 t := v.Type 42665 _ = v.Args[1] 42666 x := v.Args[0] 42667 v_1 := v.Args[1] 42668 if v_1.Op != OpConst16 { 42669 break 42670 } 42671 c := v_1.AuxInt 42672 v.reset(OpRsh8x64) 42673 v.AddArg(x) 42674 v0 := b.NewValue0(v.Pos, OpConst64, t) 42675 v0.AuxInt = int64(uint16(c)) 42676 v.AddArg(v0) 42677 return true 42678 } 42679 // match: (Rsh8x16 (Const8 [0]) _) 42680 // result: (Const8 [0]) 42681 for { 42682 _ = v.Args[1] 42683 v_0 := v.Args[0] 42684 if v_0.Op != OpConst8 || v_0.AuxInt != 0 { 42685 break 42686 } 42687 v.reset(OpConst8) 42688 v.AuxInt = 0 42689 return true 42690 } 42691 return false 42692 } 42693 func rewriteValuegeneric_OpRsh8x32_0(v *Value) bool { 42694 b := v.Block 42695 // match: (Rsh8x32 <t> x (Const32 [c])) 42696 // result: (Rsh8x64 x (Const64 <t> [int64(uint32(c))])) 42697 for { 42698 t := v.Type 42699 _ = v.Args[1] 42700 x := v.Args[0] 42701 v_1 := v.Args[1] 42702 if v_1.Op != OpConst32 { 42703 break 42704 } 42705 c := v_1.AuxInt 42706 v.reset(OpRsh8x64) 42707 v.AddArg(x) 42708 v0 := b.NewValue0(v.Pos, OpConst64, t) 42709 v0.AuxInt = int64(uint32(c)) 42710 v.AddArg(v0) 42711 return true 42712 } 42713 // match: (Rsh8x32 (Const8 [0]) _) 42714 // result: (Const8 [0]) 42715 for { 42716 _ = v.Args[1] 42717 v_0 := v.Args[0] 42718 if v_0.Op != OpConst8 || v_0.AuxInt != 0 { 42719 break 42720 } 42721 v.reset(OpConst8) 42722 v.AuxInt = 0 42723 return true 42724 } 42725 return false 42726 } 42727 func rewriteValuegeneric_OpRsh8x64_0(v *Value) bool { 42728 b := v.Block 42729 // match: (Rsh8x64 (Const8 [c]) (Const64 [d])) 42730 // result: (Const8 [int64(int8(c) >> uint64(d))]) 42731 for { 42732 _ = v.Args[1] 42733 v_0 := v.Args[0] 42734 if v_0.Op != OpConst8 { 42735 break 42736 } 42737 c := v_0.AuxInt 42738 v_1 := v.Args[1] 42739 if v_1.Op != OpConst64 { 42740 break 42741 } 42742 d := v_1.AuxInt 42743 v.reset(OpConst8) 42744 v.AuxInt = int64(int8(c) >> uint64(d)) 42745 return true 42746 } 42747 // match: (Rsh8x64 x (Const64 [0])) 42748 // result: x 42749 for { 42750 _ = v.Args[1] 42751 x := v.Args[0] 42752 v_1 := v.Args[1] 42753 if v_1.Op != OpConst64 || v_1.AuxInt != 0 { 42754 break 42755 } 42756 v.reset(OpCopy) 42757 v.Type = x.Type 42758 v.AddArg(x) 42759 return true 42760 } 42761 // match: (Rsh8x64 (Const8 [0]) _) 42762 // result: (Const8 [0]) 42763 for { 42764 _ = v.Args[1] 42765 v_0 := v.Args[0] 42766 if v_0.Op != OpConst8 || v_0.AuxInt != 0 { 42767 break 42768 } 42769 v.reset(OpConst8) 42770 v.AuxInt = 0 42771 return true 42772 } 42773 // match: (Rsh8x64 <t> (Rsh8x64 x (Const64 [c])) (Const64 [d])) 42774 // cond: !uaddOvf(c,d) 42775 // result: (Rsh8x64 x (Const64 <t> [c+d])) 42776 for { 42777 t := v.Type 42778 _ = v.Args[1] 42779 v_0 := v.Args[0] 42780 if v_0.Op != OpRsh8x64 { 42781 break 42782 } 42783 _ = v_0.Args[1] 42784 x := v_0.Args[0] 42785 v_0_1 := v_0.Args[1] 42786 if v_0_1.Op != OpConst64 { 42787 break 42788 } 42789 c := v_0_1.AuxInt 42790 v_1 := v.Args[1] 42791 if v_1.Op != OpConst64 { 42792 break 42793 } 42794 d := v_1.AuxInt 42795 if !(!uaddOvf(c, d)) { 42796 break 42797 } 42798 v.reset(OpRsh8x64) 42799 v.AddArg(x) 42800 v0 := b.NewValue0(v.Pos, OpConst64, t) 42801 v0.AuxInt = c + d 42802 v.AddArg(v0) 42803 return true 42804 } 42805 return false 42806 } 42807 func rewriteValuegeneric_OpRsh8x8_0(v *Value) bool { 42808 b := v.Block 42809 // match: (Rsh8x8 <t> x (Const8 [c])) 42810 // result: (Rsh8x64 x (Const64 <t> [int64(uint8(c))])) 42811 for { 42812 t := v.Type 42813 _ = v.Args[1] 42814 x := v.Args[0] 42815 v_1 := v.Args[1] 42816 if v_1.Op != OpConst8 { 42817 break 42818 } 42819 c := v_1.AuxInt 42820 v.reset(OpRsh8x64) 42821 v.AddArg(x) 42822 v0 := b.NewValue0(v.Pos, OpConst64, t) 42823 v0.AuxInt = int64(uint8(c)) 42824 v.AddArg(v0) 42825 return true 42826 } 42827 // match: (Rsh8x8 (Const8 [0]) _) 42828 // result: (Const8 [0]) 42829 for { 42830 _ = v.Args[1] 42831 v_0 := v.Args[0] 42832 if v_0.Op != OpConst8 || v_0.AuxInt != 0 { 42833 break 42834 } 42835 v.reset(OpConst8) 42836 v.AuxInt = 0 42837 return true 42838 } 42839 return false 42840 } 42841 func rewriteValuegeneric_OpSelect0_0(v *Value) bool { 42842 // match: (Select0 (Div128u (Const64 [0]) lo y)) 42843 // result: (Div64u lo y) 42844 for { 42845 v_0 := v.Args[0] 42846 if v_0.Op != OpDiv128u { 42847 break 42848 } 42849 y := v_0.Args[2] 42850 v_0_0 := v_0.Args[0] 42851 if v_0_0.Op != OpConst64 || v_0_0.AuxInt != 0 { 42852 break 42853 } 42854 lo := v_0.Args[1] 42855 v.reset(OpDiv64u) 42856 v.AddArg(lo) 42857 v.AddArg(y) 42858 return true 42859 } 42860 return false 42861 } 42862 func rewriteValuegeneric_OpSelect1_0(v *Value) bool { 42863 // match: (Select1 (Div128u (Const64 [0]) lo y)) 42864 // result: (Mod64u lo y) 42865 for { 42866 v_0 := v.Args[0] 42867 if v_0.Op != OpDiv128u { 42868 break 42869 } 42870 y := v_0.Args[2] 42871 v_0_0 := v_0.Args[0] 42872 if v_0_0.Op != OpConst64 || v_0_0.AuxInt != 0 { 42873 break 42874 } 42875 lo := v_0.Args[1] 42876 v.reset(OpMod64u) 42877 v.AddArg(lo) 42878 v.AddArg(y) 42879 return true 42880 } 42881 return false 42882 } 42883 func rewriteValuegeneric_OpSignExt16to32_0(v *Value) bool { 42884 // match: (SignExt16to32 (Const16 [c])) 42885 // result: (Const32 [int64( int16(c))]) 42886 for { 42887 v_0 := v.Args[0] 42888 if v_0.Op != OpConst16 { 42889 break 42890 } 42891 c := v_0.AuxInt 42892 v.reset(OpConst32) 42893 v.AuxInt = int64(int16(c)) 42894 return true 42895 } 42896 // match: (SignExt16to32 (Trunc32to16 x:(Rsh32x64 _ (Const64 [s])))) 42897 // cond: s >= 16 42898 // result: x 42899 for { 42900 v_0 := v.Args[0] 42901 if v_0.Op != OpTrunc32to16 { 42902 break 42903 } 42904 x := v_0.Args[0] 42905 if x.Op != OpRsh32x64 { 42906 break 42907 } 42908 _ = x.Args[1] 42909 x_1 := x.Args[1] 42910 if x_1.Op != OpConst64 { 42911 break 42912 } 42913 s := x_1.AuxInt 42914 if !(s >= 16) { 42915 break 42916 } 42917 v.reset(OpCopy) 42918 v.Type = x.Type 42919 v.AddArg(x) 42920 return true 42921 } 42922 return false 42923 } 42924 func rewriteValuegeneric_OpSignExt16to64_0(v *Value) bool { 42925 // match: (SignExt16to64 (Const16 [c])) 42926 // result: (Const64 [int64( int16(c))]) 42927 for { 42928 v_0 := v.Args[0] 42929 if v_0.Op != OpConst16 { 42930 break 42931 } 42932 c := v_0.AuxInt 42933 v.reset(OpConst64) 42934 v.AuxInt = int64(int16(c)) 42935 return true 42936 } 42937 // match: (SignExt16to64 (Trunc64to16 x:(Rsh64x64 _ (Const64 [s])))) 42938 // cond: s >= 48 42939 // result: x 42940 for { 42941 v_0 := v.Args[0] 42942 if v_0.Op != OpTrunc64to16 { 42943 break 42944 } 42945 x := v_0.Args[0] 42946 if x.Op != OpRsh64x64 { 42947 break 42948 } 42949 _ = x.Args[1] 42950 x_1 := x.Args[1] 42951 if x_1.Op != OpConst64 { 42952 break 42953 } 42954 s := x_1.AuxInt 42955 if !(s >= 48) { 42956 break 42957 } 42958 v.reset(OpCopy) 42959 v.Type = x.Type 42960 v.AddArg(x) 42961 return true 42962 } 42963 return false 42964 } 42965 func rewriteValuegeneric_OpSignExt32to64_0(v *Value) bool { 42966 // match: (SignExt32to64 (Const32 [c])) 42967 // result: (Const64 [int64( int32(c))]) 42968 for { 42969 v_0 := v.Args[0] 42970 if v_0.Op != OpConst32 { 42971 break 42972 } 42973 c := v_0.AuxInt 42974 v.reset(OpConst64) 42975 v.AuxInt = int64(int32(c)) 42976 return true 42977 } 42978 // match: (SignExt32to64 (Trunc64to32 x:(Rsh64x64 _ (Const64 [s])))) 42979 // cond: s >= 32 42980 // result: x 42981 for { 42982 v_0 := v.Args[0] 42983 if v_0.Op != OpTrunc64to32 { 42984 break 42985 } 42986 x := v_0.Args[0] 42987 if x.Op != OpRsh64x64 { 42988 break 42989 } 42990 _ = x.Args[1] 42991 x_1 := x.Args[1] 42992 if x_1.Op != OpConst64 { 42993 break 42994 } 42995 s := x_1.AuxInt 42996 if !(s >= 32) { 42997 break 42998 } 42999 v.reset(OpCopy) 43000 v.Type = x.Type 43001 v.AddArg(x) 43002 return true 43003 } 43004 return false 43005 } 43006 func rewriteValuegeneric_OpSignExt8to16_0(v *Value) bool { 43007 // match: (SignExt8to16 (Const8 [c])) 43008 // result: (Const16 [int64( int8(c))]) 43009 for { 43010 v_0 := v.Args[0] 43011 if v_0.Op != OpConst8 { 43012 break 43013 } 43014 c := v_0.AuxInt 43015 v.reset(OpConst16) 43016 v.AuxInt = int64(int8(c)) 43017 return true 43018 } 43019 // match: (SignExt8to16 (Trunc16to8 x:(Rsh16x64 _ (Const64 [s])))) 43020 // cond: s >= 8 43021 // result: x 43022 for { 43023 v_0 := v.Args[0] 43024 if v_0.Op != OpTrunc16to8 { 43025 break 43026 } 43027 x := v_0.Args[0] 43028 if x.Op != OpRsh16x64 { 43029 break 43030 } 43031 _ = x.Args[1] 43032 x_1 := x.Args[1] 43033 if x_1.Op != OpConst64 { 43034 break 43035 } 43036 s := x_1.AuxInt 43037 if !(s >= 8) { 43038 break 43039 } 43040 v.reset(OpCopy) 43041 v.Type = x.Type 43042 v.AddArg(x) 43043 return true 43044 } 43045 return false 43046 } 43047 func rewriteValuegeneric_OpSignExt8to32_0(v *Value) bool { 43048 // match: (SignExt8to32 (Const8 [c])) 43049 // result: (Const32 [int64( int8(c))]) 43050 for { 43051 v_0 := v.Args[0] 43052 if v_0.Op != OpConst8 { 43053 break 43054 } 43055 c := v_0.AuxInt 43056 v.reset(OpConst32) 43057 v.AuxInt = int64(int8(c)) 43058 return true 43059 } 43060 // match: (SignExt8to32 (Trunc32to8 x:(Rsh32x64 _ (Const64 [s])))) 43061 // cond: s >= 24 43062 // result: x 43063 for { 43064 v_0 := v.Args[0] 43065 if v_0.Op != OpTrunc32to8 { 43066 break 43067 } 43068 x := v_0.Args[0] 43069 if x.Op != OpRsh32x64 { 43070 break 43071 } 43072 _ = x.Args[1] 43073 x_1 := x.Args[1] 43074 if x_1.Op != OpConst64 { 43075 break 43076 } 43077 s := x_1.AuxInt 43078 if !(s >= 24) { 43079 break 43080 } 43081 v.reset(OpCopy) 43082 v.Type = x.Type 43083 v.AddArg(x) 43084 return true 43085 } 43086 return false 43087 } 43088 func rewriteValuegeneric_OpSignExt8to64_0(v *Value) bool { 43089 // match: (SignExt8to64 (Const8 [c])) 43090 // result: (Const64 [int64( int8(c))]) 43091 for { 43092 v_0 := v.Args[0] 43093 if v_0.Op != OpConst8 { 43094 break 43095 } 43096 c := v_0.AuxInt 43097 v.reset(OpConst64) 43098 v.AuxInt = int64(int8(c)) 43099 return true 43100 } 43101 // match: (SignExt8to64 (Trunc64to8 x:(Rsh64x64 _ (Const64 [s])))) 43102 // cond: s >= 56 43103 // result: x 43104 for { 43105 v_0 := v.Args[0] 43106 if v_0.Op != OpTrunc64to8 { 43107 break 43108 } 43109 x := v_0.Args[0] 43110 if x.Op != OpRsh64x64 { 43111 break 43112 } 43113 _ = x.Args[1] 43114 x_1 := x.Args[1] 43115 if x_1.Op != OpConst64 { 43116 break 43117 } 43118 s := x_1.AuxInt 43119 if !(s >= 56) { 43120 break 43121 } 43122 v.reset(OpCopy) 43123 v.Type = x.Type 43124 v.AddArg(x) 43125 return true 43126 } 43127 return false 43128 } 43129 func rewriteValuegeneric_OpSliceCap_0(v *Value) bool { 43130 // match: (SliceCap (SliceMake _ _ (Const64 <t> [c]))) 43131 // result: (Const64 <t> [c]) 43132 for { 43133 v_0 := v.Args[0] 43134 if v_0.Op != OpSliceMake { 43135 break 43136 } 43137 _ = v_0.Args[2] 43138 v_0_2 := v_0.Args[2] 43139 if v_0_2.Op != OpConst64 { 43140 break 43141 } 43142 t := v_0_2.Type 43143 c := v_0_2.AuxInt 43144 v.reset(OpConst64) 43145 v.Type = t 43146 v.AuxInt = c 43147 return true 43148 } 43149 // match: (SliceCap (SliceMake _ _ (Const32 <t> [c]))) 43150 // result: (Const32 <t> [c]) 43151 for { 43152 v_0 := v.Args[0] 43153 if v_0.Op != OpSliceMake { 43154 break 43155 } 43156 _ = v_0.Args[2] 43157 v_0_2 := v_0.Args[2] 43158 if v_0_2.Op != OpConst32 { 43159 break 43160 } 43161 t := v_0_2.Type 43162 c := v_0_2.AuxInt 43163 v.reset(OpConst32) 43164 v.Type = t 43165 v.AuxInt = c 43166 return true 43167 } 43168 // match: (SliceCap (SliceMake _ _ (SliceCap x))) 43169 // result: (SliceCap x) 43170 for { 43171 v_0 := v.Args[0] 43172 if v_0.Op != OpSliceMake { 43173 break 43174 } 43175 _ = v_0.Args[2] 43176 v_0_2 := v_0.Args[2] 43177 if v_0_2.Op != OpSliceCap { 43178 break 43179 } 43180 x := v_0_2.Args[0] 43181 v.reset(OpSliceCap) 43182 v.AddArg(x) 43183 return true 43184 } 43185 // match: (SliceCap (SliceMake _ _ (SliceLen x))) 43186 // result: (SliceLen x) 43187 for { 43188 v_0 := v.Args[0] 43189 if v_0.Op != OpSliceMake { 43190 break 43191 } 43192 _ = v_0.Args[2] 43193 v_0_2 := v_0.Args[2] 43194 if v_0_2.Op != OpSliceLen { 43195 break 43196 } 43197 x := v_0_2.Args[0] 43198 v.reset(OpSliceLen) 43199 v.AddArg(x) 43200 return true 43201 } 43202 return false 43203 } 43204 func rewriteValuegeneric_OpSliceLen_0(v *Value) bool { 43205 // match: (SliceLen (SliceMake _ (Const64 <t> [c]) _)) 43206 // result: (Const64 <t> [c]) 43207 for { 43208 v_0 := v.Args[0] 43209 if v_0.Op != OpSliceMake { 43210 break 43211 } 43212 _ = v_0.Args[2] 43213 v_0_1 := v_0.Args[1] 43214 if v_0_1.Op != OpConst64 { 43215 break 43216 } 43217 t := v_0_1.Type 43218 c := v_0_1.AuxInt 43219 v.reset(OpConst64) 43220 v.Type = t 43221 v.AuxInt = c 43222 return true 43223 } 43224 // match: (SliceLen (SliceMake _ (Const32 <t> [c]) _)) 43225 // result: (Const32 <t> [c]) 43226 for { 43227 v_0 := v.Args[0] 43228 if v_0.Op != OpSliceMake { 43229 break 43230 } 43231 _ = v_0.Args[2] 43232 v_0_1 := v_0.Args[1] 43233 if v_0_1.Op != OpConst32 { 43234 break 43235 } 43236 t := v_0_1.Type 43237 c := v_0_1.AuxInt 43238 v.reset(OpConst32) 43239 v.Type = t 43240 v.AuxInt = c 43241 return true 43242 } 43243 // match: (SliceLen (SliceMake _ (SliceLen x) _)) 43244 // result: (SliceLen x) 43245 for { 43246 v_0 := v.Args[0] 43247 if v_0.Op != OpSliceMake { 43248 break 43249 } 43250 _ = v_0.Args[2] 43251 v_0_1 := v_0.Args[1] 43252 if v_0_1.Op != OpSliceLen { 43253 break 43254 } 43255 x := v_0_1.Args[0] 43256 v.reset(OpSliceLen) 43257 v.AddArg(x) 43258 return true 43259 } 43260 return false 43261 } 43262 func rewriteValuegeneric_OpSlicePtr_0(v *Value) bool { 43263 // match: (SlicePtr (SliceMake (SlicePtr x) _ _)) 43264 // result: (SlicePtr x) 43265 for { 43266 v_0 := v.Args[0] 43267 if v_0.Op != OpSliceMake { 43268 break 43269 } 43270 _ = v_0.Args[2] 43271 v_0_0 := v_0.Args[0] 43272 if v_0_0.Op != OpSlicePtr { 43273 break 43274 } 43275 x := v_0_0.Args[0] 43276 v.reset(OpSlicePtr) 43277 v.AddArg(x) 43278 return true 43279 } 43280 return false 43281 } 43282 func rewriteValuegeneric_OpSlicemask_0(v *Value) bool { 43283 // match: (Slicemask (Const32 [x])) 43284 // cond: x > 0 43285 // result: (Const32 [-1]) 43286 for { 43287 v_0 := v.Args[0] 43288 if v_0.Op != OpConst32 { 43289 break 43290 } 43291 x := v_0.AuxInt 43292 if !(x > 0) { 43293 break 43294 } 43295 v.reset(OpConst32) 43296 v.AuxInt = -1 43297 return true 43298 } 43299 // match: (Slicemask (Const32 [0])) 43300 // result: (Const32 [0]) 43301 for { 43302 v_0 := v.Args[0] 43303 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 43304 break 43305 } 43306 v.reset(OpConst32) 43307 v.AuxInt = 0 43308 return true 43309 } 43310 // match: (Slicemask (Const64 [x])) 43311 // cond: x > 0 43312 // result: (Const64 [-1]) 43313 for { 43314 v_0 := v.Args[0] 43315 if v_0.Op != OpConst64 { 43316 break 43317 } 43318 x := v_0.AuxInt 43319 if !(x > 0) { 43320 break 43321 } 43322 v.reset(OpConst64) 43323 v.AuxInt = -1 43324 return true 43325 } 43326 // match: (Slicemask (Const64 [0])) 43327 // result: (Const64 [0]) 43328 for { 43329 v_0 := v.Args[0] 43330 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 43331 break 43332 } 43333 v.reset(OpConst64) 43334 v.AuxInt = 0 43335 return true 43336 } 43337 return false 43338 } 43339 func rewriteValuegeneric_OpSqrt_0(v *Value) bool { 43340 // match: (Sqrt (Const64F [c])) 43341 // result: (Const64F [auxFrom64F(math.Sqrt(auxTo64F(c)))]) 43342 for { 43343 v_0 := v.Args[0] 43344 if v_0.Op != OpConst64F { 43345 break 43346 } 43347 c := v_0.AuxInt 43348 v.reset(OpConst64F) 43349 v.AuxInt = auxFrom64F(math.Sqrt(auxTo64F(c))) 43350 return true 43351 } 43352 return false 43353 } 43354 func rewriteValuegeneric_OpStaticCall_0(v *Value) bool { 43355 b := v.Block 43356 config := b.Func.Config 43357 // match: (StaticCall {sym} s1:(Store _ (Const64 [sz]) s2:(Store _ src s3:(Store {t} _ dst mem)))) 43358 // cond: isSameSym(sym,"runtime.memmove") && t.(*types.Type).IsPtr() && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst,src,sz,config) && clobber(s1) && clobber(s2) && clobber(s3) 43359 // result: (Move {t.(*types.Type).Elem()} [sz] dst src mem) 43360 for { 43361 sym := v.Aux 43362 s1 := v.Args[0] 43363 if s1.Op != OpStore { 43364 break 43365 } 43366 _ = s1.Args[2] 43367 s1_1 := s1.Args[1] 43368 if s1_1.Op != OpConst64 { 43369 break 43370 } 43371 sz := s1_1.AuxInt 43372 s2 := s1.Args[2] 43373 if s2.Op != OpStore { 43374 break 43375 } 43376 _ = s2.Args[2] 43377 src := s2.Args[1] 43378 s3 := s2.Args[2] 43379 if s3.Op != OpStore { 43380 break 43381 } 43382 t := s3.Aux 43383 mem := s3.Args[2] 43384 dst := s3.Args[1] 43385 if !(isSameSym(sym, "runtime.memmove") && t.(*types.Type).IsPtr() && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(s1) && clobber(s2) && clobber(s3)) { 43386 break 43387 } 43388 v.reset(OpMove) 43389 v.AuxInt = sz 43390 v.Aux = t.(*types.Type).Elem() 43391 v.AddArg(dst) 43392 v.AddArg(src) 43393 v.AddArg(mem) 43394 return true 43395 } 43396 // match: (StaticCall {sym} s1:(Store _ (Const32 [sz]) s2:(Store _ src s3:(Store {t} _ dst mem)))) 43397 // cond: isSameSym(sym,"runtime.memmove") && t.(*types.Type).IsPtr() && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst,src,sz,config) && clobber(s1) && clobber(s2) && clobber(s3) 43398 // result: (Move {t.(*types.Type).Elem()} [sz] dst src mem) 43399 for { 43400 sym := v.Aux 43401 s1 := v.Args[0] 43402 if s1.Op != OpStore { 43403 break 43404 } 43405 _ = s1.Args[2] 43406 s1_1 := s1.Args[1] 43407 if s1_1.Op != OpConst32 { 43408 break 43409 } 43410 sz := s1_1.AuxInt 43411 s2 := s1.Args[2] 43412 if s2.Op != OpStore { 43413 break 43414 } 43415 _ = s2.Args[2] 43416 src := s2.Args[1] 43417 s3 := s2.Args[2] 43418 if s3.Op != OpStore { 43419 break 43420 } 43421 t := s3.Aux 43422 mem := s3.Args[2] 43423 dst := s3.Args[1] 43424 if !(isSameSym(sym, "runtime.memmove") && t.(*types.Type).IsPtr() && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(s1) && clobber(s2) && clobber(s3)) { 43425 break 43426 } 43427 v.reset(OpMove) 43428 v.AuxInt = sz 43429 v.Aux = t.(*types.Type).Elem() 43430 v.AddArg(dst) 43431 v.AddArg(src) 43432 v.AddArg(mem) 43433 return true 43434 } 43435 // match: (StaticCall {sym} x) 43436 // cond: needRaceCleanup(sym,v) 43437 // result: x 43438 for { 43439 sym := v.Aux 43440 x := v.Args[0] 43441 if !(needRaceCleanup(sym, v)) { 43442 break 43443 } 43444 v.reset(OpCopy) 43445 v.Type = x.Type 43446 v.AddArg(x) 43447 return true 43448 } 43449 return false 43450 } 43451 func rewriteValuegeneric_OpStore_0(v *Value) bool { 43452 b := v.Block 43453 // match: (Store {t1} p1 (Load <t2> p2 mem) mem) 43454 // cond: isSamePtr(p1, p2) && t2.Size() == sizeof(t1) 43455 // result: mem 43456 for { 43457 t1 := v.Aux 43458 mem := v.Args[2] 43459 p1 := v.Args[0] 43460 v_1 := v.Args[1] 43461 if v_1.Op != OpLoad { 43462 break 43463 } 43464 t2 := v_1.Type 43465 _ = v_1.Args[1] 43466 p2 := v_1.Args[0] 43467 if mem != v_1.Args[1] || !(isSamePtr(p1, p2) && t2.Size() == sizeof(t1)) { 43468 break 43469 } 43470 v.reset(OpCopy) 43471 v.Type = mem.Type 43472 v.AddArg(mem) 43473 return true 43474 } 43475 // match: (Store {t1} p1 (Load <t2> p2 oldmem) mem:(Store {t3} p3 _ oldmem)) 43476 // cond: isSamePtr(p1, p2) && t2.Size() == sizeof(t1) && disjoint(p1, sizeof(t1), p3, sizeof(t3)) 43477 // result: mem 43478 for { 43479 t1 := v.Aux 43480 _ = v.Args[2] 43481 p1 := v.Args[0] 43482 v_1 := v.Args[1] 43483 if v_1.Op != OpLoad { 43484 break 43485 } 43486 t2 := v_1.Type 43487 oldmem := v_1.Args[1] 43488 p2 := v_1.Args[0] 43489 mem := v.Args[2] 43490 if mem.Op != OpStore { 43491 break 43492 } 43493 t3 := mem.Aux 43494 _ = mem.Args[2] 43495 p3 := mem.Args[0] 43496 if oldmem != mem.Args[2] || !(isSamePtr(p1, p2) && t2.Size() == sizeof(t1) && disjoint(p1, sizeof(t1), p3, sizeof(t3))) { 43497 break 43498 } 43499 v.reset(OpCopy) 43500 v.Type = mem.Type 43501 v.AddArg(mem) 43502 return true 43503 } 43504 // match: (Store {t1} p1 (Load <t2> p2 oldmem) mem:(Store {t3} p3 _ (Store {t4} p4 _ oldmem))) 43505 // cond: isSamePtr(p1, p2) && t2.Size() == sizeof(t1) && disjoint(p1, sizeof(t1), p3, sizeof(t3)) && disjoint(p1, sizeof(t1), p4, sizeof(t4)) 43506 // result: mem 43507 for { 43508 t1 := v.Aux 43509 _ = v.Args[2] 43510 p1 := v.Args[0] 43511 v_1 := v.Args[1] 43512 if v_1.Op != OpLoad { 43513 break 43514 } 43515 t2 := v_1.Type 43516 oldmem := v_1.Args[1] 43517 p2 := v_1.Args[0] 43518 mem := v.Args[2] 43519 if mem.Op != OpStore { 43520 break 43521 } 43522 t3 := mem.Aux 43523 _ = mem.Args[2] 43524 p3 := mem.Args[0] 43525 mem_2 := mem.Args[2] 43526 if mem_2.Op != OpStore { 43527 break 43528 } 43529 t4 := mem_2.Aux 43530 _ = mem_2.Args[2] 43531 p4 := mem_2.Args[0] 43532 if oldmem != mem_2.Args[2] || !(isSamePtr(p1, p2) && t2.Size() == sizeof(t1) && disjoint(p1, sizeof(t1), p3, sizeof(t3)) && disjoint(p1, sizeof(t1), p4, sizeof(t4))) { 43533 break 43534 } 43535 v.reset(OpCopy) 43536 v.Type = mem.Type 43537 v.AddArg(mem) 43538 return true 43539 } 43540 // match: (Store {t1} p1 (Load <t2> p2 oldmem) mem:(Store {t3} p3 _ (Store {t4} p4 _ (Store {t5} p5 _ oldmem)))) 43541 // cond: isSamePtr(p1, p2) && t2.Size() == sizeof(t1) && disjoint(p1, sizeof(t1), p3, sizeof(t3)) && disjoint(p1, sizeof(t1), p4, sizeof(t4)) && disjoint(p1, sizeof(t1), p5, sizeof(t5)) 43542 // result: mem 43543 for { 43544 t1 := v.Aux 43545 _ = v.Args[2] 43546 p1 := v.Args[0] 43547 v_1 := v.Args[1] 43548 if v_1.Op != OpLoad { 43549 break 43550 } 43551 t2 := v_1.Type 43552 oldmem := v_1.Args[1] 43553 p2 := v_1.Args[0] 43554 mem := v.Args[2] 43555 if mem.Op != OpStore { 43556 break 43557 } 43558 t3 := mem.Aux 43559 _ = mem.Args[2] 43560 p3 := mem.Args[0] 43561 mem_2 := mem.Args[2] 43562 if mem_2.Op != OpStore { 43563 break 43564 } 43565 t4 := mem_2.Aux 43566 _ = mem_2.Args[2] 43567 p4 := mem_2.Args[0] 43568 mem_2_2 := mem_2.Args[2] 43569 if mem_2_2.Op != OpStore { 43570 break 43571 } 43572 t5 := mem_2_2.Aux 43573 _ = mem_2_2.Args[2] 43574 p5 := mem_2_2.Args[0] 43575 if oldmem != mem_2_2.Args[2] || !(isSamePtr(p1, p2) && t2.Size() == sizeof(t1) && disjoint(p1, sizeof(t1), p3, sizeof(t3)) && disjoint(p1, sizeof(t1), p4, sizeof(t4)) && disjoint(p1, sizeof(t1), p5, sizeof(t5))) { 43576 break 43577 } 43578 v.reset(OpCopy) 43579 v.Type = mem.Type 43580 v.AddArg(mem) 43581 return true 43582 } 43583 // match: (Store {t} (OffPtr [o] p1) x mem:(Zero [n] p2 _)) 43584 // cond: isConstZero(x) && o >= 0 && sizeof(t) + o <= n && isSamePtr(p1, p2) 43585 // result: mem 43586 for { 43587 t := v.Aux 43588 _ = v.Args[2] 43589 v_0 := v.Args[0] 43590 if v_0.Op != OpOffPtr { 43591 break 43592 } 43593 o := v_0.AuxInt 43594 p1 := v_0.Args[0] 43595 x := v.Args[1] 43596 mem := v.Args[2] 43597 if mem.Op != OpZero { 43598 break 43599 } 43600 n := mem.AuxInt 43601 _ = mem.Args[1] 43602 p2 := mem.Args[0] 43603 if !(isConstZero(x) && o >= 0 && sizeof(t)+o <= n && isSamePtr(p1, p2)) { 43604 break 43605 } 43606 v.reset(OpCopy) 43607 v.Type = mem.Type 43608 v.AddArg(mem) 43609 return true 43610 } 43611 // match: (Store {t1} op:(OffPtr [o1] p1) x mem:(Store {t2} p2 _ (Zero [n] p3 _))) 43612 // cond: isConstZero(x) && o1 >= 0 && sizeof(t1) + o1 <= n && isSamePtr(p1, p3) && disjoint(op, sizeof(t1), p2, sizeof(t2)) 43613 // result: mem 43614 for { 43615 t1 := v.Aux 43616 _ = v.Args[2] 43617 op := v.Args[0] 43618 if op.Op != OpOffPtr { 43619 break 43620 } 43621 o1 := op.AuxInt 43622 p1 := op.Args[0] 43623 x := v.Args[1] 43624 mem := v.Args[2] 43625 if mem.Op != OpStore { 43626 break 43627 } 43628 t2 := mem.Aux 43629 _ = mem.Args[2] 43630 p2 := mem.Args[0] 43631 mem_2 := mem.Args[2] 43632 if mem_2.Op != OpZero { 43633 break 43634 } 43635 n := mem_2.AuxInt 43636 _ = mem_2.Args[1] 43637 p3 := mem_2.Args[0] 43638 if !(isConstZero(x) && o1 >= 0 && sizeof(t1)+o1 <= n && isSamePtr(p1, p3) && disjoint(op, sizeof(t1), p2, sizeof(t2))) { 43639 break 43640 } 43641 v.reset(OpCopy) 43642 v.Type = mem.Type 43643 v.AddArg(mem) 43644 return true 43645 } 43646 // match: (Store {t1} op:(OffPtr [o1] p1) x mem:(Store {t2} p2 _ (Store {t3} p3 _ (Zero [n] p4 _)))) 43647 // cond: isConstZero(x) && o1 >= 0 && sizeof(t1) + o1 <= n && isSamePtr(p1, p4) && disjoint(op, sizeof(t1), p2, sizeof(t2)) && disjoint(op, sizeof(t1), p3, sizeof(t3)) 43648 // result: mem 43649 for { 43650 t1 := v.Aux 43651 _ = v.Args[2] 43652 op := v.Args[0] 43653 if op.Op != OpOffPtr { 43654 break 43655 } 43656 o1 := op.AuxInt 43657 p1 := op.Args[0] 43658 x := v.Args[1] 43659 mem := v.Args[2] 43660 if mem.Op != OpStore { 43661 break 43662 } 43663 t2 := mem.Aux 43664 _ = mem.Args[2] 43665 p2 := mem.Args[0] 43666 mem_2 := mem.Args[2] 43667 if mem_2.Op != OpStore { 43668 break 43669 } 43670 t3 := mem_2.Aux 43671 _ = mem_2.Args[2] 43672 p3 := mem_2.Args[0] 43673 mem_2_2 := mem_2.Args[2] 43674 if mem_2_2.Op != OpZero { 43675 break 43676 } 43677 n := mem_2_2.AuxInt 43678 _ = mem_2_2.Args[1] 43679 p4 := mem_2_2.Args[0] 43680 if !(isConstZero(x) && o1 >= 0 && sizeof(t1)+o1 <= n && isSamePtr(p1, p4) && disjoint(op, sizeof(t1), p2, sizeof(t2)) && disjoint(op, sizeof(t1), p3, sizeof(t3))) { 43681 break 43682 } 43683 v.reset(OpCopy) 43684 v.Type = mem.Type 43685 v.AddArg(mem) 43686 return true 43687 } 43688 // match: (Store {t1} op:(OffPtr [o1] p1) x mem:(Store {t2} p2 _ (Store {t3} p3 _ (Store {t4} p4 _ (Zero [n] p5 _))))) 43689 // cond: isConstZero(x) && o1 >= 0 && sizeof(t1) + o1 <= n && isSamePtr(p1, p5) && disjoint(op, sizeof(t1), p2, sizeof(t2)) && disjoint(op, sizeof(t1), p3, sizeof(t3)) && disjoint(op, sizeof(t1), p4, sizeof(t4)) 43690 // result: mem 43691 for { 43692 t1 := v.Aux 43693 _ = v.Args[2] 43694 op := v.Args[0] 43695 if op.Op != OpOffPtr { 43696 break 43697 } 43698 o1 := op.AuxInt 43699 p1 := op.Args[0] 43700 x := v.Args[1] 43701 mem := v.Args[2] 43702 if mem.Op != OpStore { 43703 break 43704 } 43705 t2 := mem.Aux 43706 _ = mem.Args[2] 43707 p2 := mem.Args[0] 43708 mem_2 := mem.Args[2] 43709 if mem_2.Op != OpStore { 43710 break 43711 } 43712 t3 := mem_2.Aux 43713 _ = mem_2.Args[2] 43714 p3 := mem_2.Args[0] 43715 mem_2_2 := mem_2.Args[2] 43716 if mem_2_2.Op != OpStore { 43717 break 43718 } 43719 t4 := mem_2_2.Aux 43720 _ = mem_2_2.Args[2] 43721 p4 := mem_2_2.Args[0] 43722 mem_2_2_2 := mem_2_2.Args[2] 43723 if mem_2_2_2.Op != OpZero { 43724 break 43725 } 43726 n := mem_2_2_2.AuxInt 43727 _ = mem_2_2_2.Args[1] 43728 p5 := mem_2_2_2.Args[0] 43729 if !(isConstZero(x) && o1 >= 0 && sizeof(t1)+o1 <= n && isSamePtr(p1, p5) && disjoint(op, sizeof(t1), p2, sizeof(t2)) && disjoint(op, sizeof(t1), p3, sizeof(t3)) && disjoint(op, sizeof(t1), p4, sizeof(t4))) { 43730 break 43731 } 43732 v.reset(OpCopy) 43733 v.Type = mem.Type 43734 v.AddArg(mem) 43735 return true 43736 } 43737 // match: (Store _ (StructMake0) mem) 43738 // result: mem 43739 for { 43740 mem := v.Args[2] 43741 v_1 := v.Args[1] 43742 if v_1.Op != OpStructMake0 { 43743 break 43744 } 43745 v.reset(OpCopy) 43746 v.Type = mem.Type 43747 v.AddArg(mem) 43748 return true 43749 } 43750 // match: (Store dst (StructMake1 <t> f0) mem) 43751 // result: (Store {t.FieldType(0)} (OffPtr <t.FieldType(0).PtrTo()> [0] dst) f0 mem) 43752 for { 43753 mem := v.Args[2] 43754 dst := v.Args[0] 43755 v_1 := v.Args[1] 43756 if v_1.Op != OpStructMake1 { 43757 break 43758 } 43759 t := v_1.Type 43760 f0 := v_1.Args[0] 43761 v.reset(OpStore) 43762 v.Aux = t.FieldType(0) 43763 v0 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(0).PtrTo()) 43764 v0.AuxInt = 0 43765 v0.AddArg(dst) 43766 v.AddArg(v0) 43767 v.AddArg(f0) 43768 v.AddArg(mem) 43769 return true 43770 } 43771 return false 43772 } 43773 func rewriteValuegeneric_OpStore_10(v *Value) bool { 43774 b := v.Block 43775 config := b.Func.Config 43776 fe := b.Func.fe 43777 // match: (Store dst (StructMake2 <t> f0 f1) mem) 43778 // result: (Store {t.FieldType(1)} (OffPtr <t.FieldType(1).PtrTo()> [t.FieldOff(1)] dst) f1 (Store {t.FieldType(0)} (OffPtr <t.FieldType(0).PtrTo()> [0] dst) f0 mem)) 43779 for { 43780 mem := v.Args[2] 43781 dst := v.Args[0] 43782 v_1 := v.Args[1] 43783 if v_1.Op != OpStructMake2 { 43784 break 43785 } 43786 t := v_1.Type 43787 f1 := v_1.Args[1] 43788 f0 := v_1.Args[0] 43789 v.reset(OpStore) 43790 v.Aux = t.FieldType(1) 43791 v0 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(1).PtrTo()) 43792 v0.AuxInt = t.FieldOff(1) 43793 v0.AddArg(dst) 43794 v.AddArg(v0) 43795 v.AddArg(f1) 43796 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 43797 v1.Aux = t.FieldType(0) 43798 v2 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(0).PtrTo()) 43799 v2.AuxInt = 0 43800 v2.AddArg(dst) 43801 v1.AddArg(v2) 43802 v1.AddArg(f0) 43803 v1.AddArg(mem) 43804 v.AddArg(v1) 43805 return true 43806 } 43807 // match: (Store dst (StructMake3 <t> f0 f1 f2) mem) 43808 // result: (Store {t.FieldType(2)} (OffPtr <t.FieldType(2).PtrTo()> [t.FieldOff(2)] dst) f2 (Store {t.FieldType(1)} (OffPtr <t.FieldType(1).PtrTo()> [t.FieldOff(1)] dst) f1 (Store {t.FieldType(0)} (OffPtr <t.FieldType(0).PtrTo()> [0] dst) f0 mem))) 43809 for { 43810 mem := v.Args[2] 43811 dst := v.Args[0] 43812 v_1 := v.Args[1] 43813 if v_1.Op != OpStructMake3 { 43814 break 43815 } 43816 t := v_1.Type 43817 f2 := v_1.Args[2] 43818 f0 := v_1.Args[0] 43819 f1 := v_1.Args[1] 43820 v.reset(OpStore) 43821 v.Aux = t.FieldType(2) 43822 v0 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(2).PtrTo()) 43823 v0.AuxInt = t.FieldOff(2) 43824 v0.AddArg(dst) 43825 v.AddArg(v0) 43826 v.AddArg(f2) 43827 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 43828 v1.Aux = t.FieldType(1) 43829 v2 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(1).PtrTo()) 43830 v2.AuxInt = t.FieldOff(1) 43831 v2.AddArg(dst) 43832 v1.AddArg(v2) 43833 v1.AddArg(f1) 43834 v3 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 43835 v3.Aux = t.FieldType(0) 43836 v4 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(0).PtrTo()) 43837 v4.AuxInt = 0 43838 v4.AddArg(dst) 43839 v3.AddArg(v4) 43840 v3.AddArg(f0) 43841 v3.AddArg(mem) 43842 v1.AddArg(v3) 43843 v.AddArg(v1) 43844 return true 43845 } 43846 // match: (Store dst (StructMake4 <t> f0 f1 f2 f3) mem) 43847 // result: (Store {t.FieldType(3)} (OffPtr <t.FieldType(3).PtrTo()> [t.FieldOff(3)] dst) f3 (Store {t.FieldType(2)} (OffPtr <t.FieldType(2).PtrTo()> [t.FieldOff(2)] dst) f2 (Store {t.FieldType(1)} (OffPtr <t.FieldType(1).PtrTo()> [t.FieldOff(1)] dst) f1 (Store {t.FieldType(0)} (OffPtr <t.FieldType(0).PtrTo()> [0] dst) f0 mem)))) 43848 for { 43849 mem := v.Args[2] 43850 dst := v.Args[0] 43851 v_1 := v.Args[1] 43852 if v_1.Op != OpStructMake4 { 43853 break 43854 } 43855 t := v_1.Type 43856 f3 := v_1.Args[3] 43857 f0 := v_1.Args[0] 43858 f1 := v_1.Args[1] 43859 f2 := v_1.Args[2] 43860 v.reset(OpStore) 43861 v.Aux = t.FieldType(3) 43862 v0 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(3).PtrTo()) 43863 v0.AuxInt = t.FieldOff(3) 43864 v0.AddArg(dst) 43865 v.AddArg(v0) 43866 v.AddArg(f3) 43867 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 43868 v1.Aux = t.FieldType(2) 43869 v2 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(2).PtrTo()) 43870 v2.AuxInt = t.FieldOff(2) 43871 v2.AddArg(dst) 43872 v1.AddArg(v2) 43873 v1.AddArg(f2) 43874 v3 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 43875 v3.Aux = t.FieldType(1) 43876 v4 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(1).PtrTo()) 43877 v4.AuxInt = t.FieldOff(1) 43878 v4.AddArg(dst) 43879 v3.AddArg(v4) 43880 v3.AddArg(f1) 43881 v5 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 43882 v5.Aux = t.FieldType(0) 43883 v6 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(0).PtrTo()) 43884 v6.AuxInt = 0 43885 v6.AddArg(dst) 43886 v5.AddArg(v6) 43887 v5.AddArg(f0) 43888 v5.AddArg(mem) 43889 v3.AddArg(v5) 43890 v1.AddArg(v3) 43891 v.AddArg(v1) 43892 return true 43893 } 43894 // match: (Store {t} dst (Load src mem) mem) 43895 // cond: !fe.CanSSA(t.(*types.Type)) 43896 // result: (Move {t} [sizeof(t)] dst src mem) 43897 for { 43898 t := v.Aux 43899 mem := v.Args[2] 43900 dst := v.Args[0] 43901 v_1 := v.Args[1] 43902 if v_1.Op != OpLoad { 43903 break 43904 } 43905 _ = v_1.Args[1] 43906 src := v_1.Args[0] 43907 if mem != v_1.Args[1] || !(!fe.CanSSA(t.(*types.Type))) { 43908 break 43909 } 43910 v.reset(OpMove) 43911 v.AuxInt = sizeof(t) 43912 v.Aux = t 43913 v.AddArg(dst) 43914 v.AddArg(src) 43915 v.AddArg(mem) 43916 return true 43917 } 43918 // match: (Store {t} dst (Load src mem) (VarDef {x} mem)) 43919 // cond: !fe.CanSSA(t.(*types.Type)) 43920 // result: (Move {t} [sizeof(t)] dst src (VarDef {x} mem)) 43921 for { 43922 t := v.Aux 43923 _ = v.Args[2] 43924 dst := v.Args[0] 43925 v_1 := v.Args[1] 43926 if v_1.Op != OpLoad { 43927 break 43928 } 43929 mem := v_1.Args[1] 43930 src := v_1.Args[0] 43931 v_2 := v.Args[2] 43932 if v_2.Op != OpVarDef { 43933 break 43934 } 43935 x := v_2.Aux 43936 if mem != v_2.Args[0] || !(!fe.CanSSA(t.(*types.Type))) { 43937 break 43938 } 43939 v.reset(OpMove) 43940 v.AuxInt = sizeof(t) 43941 v.Aux = t 43942 v.AddArg(dst) 43943 v.AddArg(src) 43944 v0 := b.NewValue0(v.Pos, OpVarDef, types.TypeMem) 43945 v0.Aux = x 43946 v0.AddArg(mem) 43947 v.AddArg(v0) 43948 return true 43949 } 43950 // match: (Store _ (ArrayMake0) mem) 43951 // result: mem 43952 for { 43953 mem := v.Args[2] 43954 v_1 := v.Args[1] 43955 if v_1.Op != OpArrayMake0 { 43956 break 43957 } 43958 v.reset(OpCopy) 43959 v.Type = mem.Type 43960 v.AddArg(mem) 43961 return true 43962 } 43963 // match: (Store dst (ArrayMake1 e) mem) 43964 // result: (Store {e.Type} dst e mem) 43965 for { 43966 mem := v.Args[2] 43967 dst := v.Args[0] 43968 v_1 := v.Args[1] 43969 if v_1.Op != OpArrayMake1 { 43970 break 43971 } 43972 e := v_1.Args[0] 43973 v.reset(OpStore) 43974 v.Aux = e.Type 43975 v.AddArg(dst) 43976 v.AddArg(e) 43977 v.AddArg(mem) 43978 return true 43979 } 43980 // match: (Store (Load (OffPtr [c] (SP)) mem) x mem) 43981 // cond: isConstZero(x) && mem.Op == OpStaticCall && isSameSym(mem.Aux, "runtime.newobject") && c == config.ctxt.FixedFrameSize() + config.RegSize 43982 // result: mem 43983 for { 43984 mem := v.Args[2] 43985 v_0 := v.Args[0] 43986 if v_0.Op != OpLoad { 43987 break 43988 } 43989 _ = v_0.Args[1] 43990 v_0_0 := v_0.Args[0] 43991 if v_0_0.Op != OpOffPtr { 43992 break 43993 } 43994 c := v_0_0.AuxInt 43995 v_0_0_0 := v_0_0.Args[0] 43996 if v_0_0_0.Op != OpSP || mem != v_0.Args[1] { 43997 break 43998 } 43999 x := v.Args[1] 44000 if !(isConstZero(x) && mem.Op == OpStaticCall && isSameSym(mem.Aux, "runtime.newobject") && c == config.ctxt.FixedFrameSize()+config.RegSize) { 44001 break 44002 } 44003 v.reset(OpCopy) 44004 v.Type = mem.Type 44005 v.AddArg(mem) 44006 return true 44007 } 44008 // match: (Store (OffPtr (Load (OffPtr [c] (SP)) mem)) x mem) 44009 // cond: isConstZero(x) && mem.Op == OpStaticCall && isSameSym(mem.Aux, "runtime.newobject") && c == config.ctxt.FixedFrameSize() + config.RegSize 44010 // result: mem 44011 for { 44012 mem := v.Args[2] 44013 v_0 := v.Args[0] 44014 if v_0.Op != OpOffPtr { 44015 break 44016 } 44017 v_0_0 := v_0.Args[0] 44018 if v_0_0.Op != OpLoad { 44019 break 44020 } 44021 _ = v_0_0.Args[1] 44022 v_0_0_0 := v_0_0.Args[0] 44023 if v_0_0_0.Op != OpOffPtr { 44024 break 44025 } 44026 c := v_0_0_0.AuxInt 44027 v_0_0_0_0 := v_0_0_0.Args[0] 44028 if v_0_0_0_0.Op != OpSP || mem != v_0_0.Args[1] { 44029 break 44030 } 44031 x := v.Args[1] 44032 if !(isConstZero(x) && mem.Op == OpStaticCall && isSameSym(mem.Aux, "runtime.newobject") && c == config.ctxt.FixedFrameSize()+config.RegSize) { 44033 break 44034 } 44035 v.reset(OpCopy) 44036 v.Type = mem.Type 44037 v.AddArg(mem) 44038 return true 44039 } 44040 // match: (Store {t1} op1:(OffPtr [o1] p1) d1 m2:(Store {t2} op2:(OffPtr [0] p2) d2 m3:(Move [n] p3 _ mem))) 44041 // cond: m2.Uses == 1 && m3.Uses == 1 && o1 == sizeof(t2) && n == sizeof(t2) + sizeof(t1) && isSamePtr(p1, p2) && isSamePtr(p2, p3) && clobber(m2) && clobber(m3) 44042 // result: (Store {t1} op1 d1 (Store {t2} op2 d2 mem)) 44043 for { 44044 t1 := v.Aux 44045 _ = v.Args[2] 44046 op1 := v.Args[0] 44047 if op1.Op != OpOffPtr { 44048 break 44049 } 44050 o1 := op1.AuxInt 44051 p1 := op1.Args[0] 44052 d1 := v.Args[1] 44053 m2 := v.Args[2] 44054 if m2.Op != OpStore { 44055 break 44056 } 44057 t2 := m2.Aux 44058 _ = m2.Args[2] 44059 op2 := m2.Args[0] 44060 if op2.Op != OpOffPtr || op2.AuxInt != 0 { 44061 break 44062 } 44063 p2 := op2.Args[0] 44064 d2 := m2.Args[1] 44065 m3 := m2.Args[2] 44066 if m3.Op != OpMove { 44067 break 44068 } 44069 n := m3.AuxInt 44070 mem := m3.Args[2] 44071 p3 := m3.Args[0] 44072 if !(m2.Uses == 1 && m3.Uses == 1 && o1 == sizeof(t2) && n == sizeof(t2)+sizeof(t1) && isSamePtr(p1, p2) && isSamePtr(p2, p3) && clobber(m2) && clobber(m3)) { 44073 break 44074 } 44075 v.reset(OpStore) 44076 v.Aux = t1 44077 v.AddArg(op1) 44078 v.AddArg(d1) 44079 v0 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 44080 v0.Aux = t2 44081 v0.AddArg(op2) 44082 v0.AddArg(d2) 44083 v0.AddArg(mem) 44084 v.AddArg(v0) 44085 return true 44086 } 44087 return false 44088 } 44089 func rewriteValuegeneric_OpStore_20(v *Value) bool { 44090 b := v.Block 44091 // match: (Store {t1} op1:(OffPtr [o1] p1) d1 m2:(Store {t2} op2:(OffPtr [o2] p2) d2 m3:(Store {t3} op3:(OffPtr [0] p3) d3 m4:(Move [n] p4 _ mem)))) 44092 // cond: m2.Uses == 1 && m3.Uses == 1 && m4.Uses == 1 && o2 == sizeof(t3) && o1-o2 == sizeof(t2) && n == sizeof(t3) + sizeof(t2) + sizeof(t1) && isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && clobber(m2) && clobber(m3) && clobber(m4) 44093 // result: (Store {t1} op1 d1 (Store {t2} op2 d2 (Store {t3} op3 d3 mem))) 44094 for { 44095 t1 := v.Aux 44096 _ = v.Args[2] 44097 op1 := v.Args[0] 44098 if op1.Op != OpOffPtr { 44099 break 44100 } 44101 o1 := op1.AuxInt 44102 p1 := op1.Args[0] 44103 d1 := v.Args[1] 44104 m2 := v.Args[2] 44105 if m2.Op != OpStore { 44106 break 44107 } 44108 t2 := m2.Aux 44109 _ = m2.Args[2] 44110 op2 := m2.Args[0] 44111 if op2.Op != OpOffPtr { 44112 break 44113 } 44114 o2 := op2.AuxInt 44115 p2 := op2.Args[0] 44116 d2 := m2.Args[1] 44117 m3 := m2.Args[2] 44118 if m3.Op != OpStore { 44119 break 44120 } 44121 t3 := m3.Aux 44122 _ = m3.Args[2] 44123 op3 := m3.Args[0] 44124 if op3.Op != OpOffPtr || op3.AuxInt != 0 { 44125 break 44126 } 44127 p3 := op3.Args[0] 44128 d3 := m3.Args[1] 44129 m4 := m3.Args[2] 44130 if m4.Op != OpMove { 44131 break 44132 } 44133 n := m4.AuxInt 44134 mem := m4.Args[2] 44135 p4 := m4.Args[0] 44136 if !(m2.Uses == 1 && m3.Uses == 1 && m4.Uses == 1 && o2 == sizeof(t3) && o1-o2 == sizeof(t2) && n == sizeof(t3)+sizeof(t2)+sizeof(t1) && isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && clobber(m2) && clobber(m3) && clobber(m4)) { 44137 break 44138 } 44139 v.reset(OpStore) 44140 v.Aux = t1 44141 v.AddArg(op1) 44142 v.AddArg(d1) 44143 v0 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 44144 v0.Aux = t2 44145 v0.AddArg(op2) 44146 v0.AddArg(d2) 44147 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 44148 v1.Aux = t3 44149 v1.AddArg(op3) 44150 v1.AddArg(d3) 44151 v1.AddArg(mem) 44152 v0.AddArg(v1) 44153 v.AddArg(v0) 44154 return true 44155 } 44156 // match: (Store {t1} op1:(OffPtr [o1] p1) d1 m2:(Store {t2} op2:(OffPtr [o2] p2) d2 m3:(Store {t3} op3:(OffPtr [o3] p3) d3 m4:(Store {t4} op4:(OffPtr [0] p4) d4 m5:(Move [n] p5 _ mem))))) 44157 // cond: m2.Uses == 1 && m3.Uses == 1 && m4.Uses == 1 && m5.Uses == 1 && o3 == sizeof(t4) && o2-o3 == sizeof(t3) && o1-o2 == sizeof(t2) && n == sizeof(t4) + sizeof(t3) + sizeof(t2) + sizeof(t1) && isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && clobber(m2) && clobber(m3) && clobber(m4) && clobber(m5) 44158 // result: (Store {t1} op1 d1 (Store {t2} op2 d2 (Store {t3} op3 d3 (Store {t4} op4 d4 mem)))) 44159 for { 44160 t1 := v.Aux 44161 _ = v.Args[2] 44162 op1 := v.Args[0] 44163 if op1.Op != OpOffPtr { 44164 break 44165 } 44166 o1 := op1.AuxInt 44167 p1 := op1.Args[0] 44168 d1 := v.Args[1] 44169 m2 := v.Args[2] 44170 if m2.Op != OpStore { 44171 break 44172 } 44173 t2 := m2.Aux 44174 _ = m2.Args[2] 44175 op2 := m2.Args[0] 44176 if op2.Op != OpOffPtr { 44177 break 44178 } 44179 o2 := op2.AuxInt 44180 p2 := op2.Args[0] 44181 d2 := m2.Args[1] 44182 m3 := m2.Args[2] 44183 if m3.Op != OpStore { 44184 break 44185 } 44186 t3 := m3.Aux 44187 _ = m3.Args[2] 44188 op3 := m3.Args[0] 44189 if op3.Op != OpOffPtr { 44190 break 44191 } 44192 o3 := op3.AuxInt 44193 p3 := op3.Args[0] 44194 d3 := m3.Args[1] 44195 m4 := m3.Args[2] 44196 if m4.Op != OpStore { 44197 break 44198 } 44199 t4 := m4.Aux 44200 _ = m4.Args[2] 44201 op4 := m4.Args[0] 44202 if op4.Op != OpOffPtr || op4.AuxInt != 0 { 44203 break 44204 } 44205 p4 := op4.Args[0] 44206 d4 := m4.Args[1] 44207 m5 := m4.Args[2] 44208 if m5.Op != OpMove { 44209 break 44210 } 44211 n := m5.AuxInt 44212 mem := m5.Args[2] 44213 p5 := m5.Args[0] 44214 if !(m2.Uses == 1 && m3.Uses == 1 && m4.Uses == 1 && m5.Uses == 1 && o3 == sizeof(t4) && o2-o3 == sizeof(t3) && o1-o2 == sizeof(t2) && n == sizeof(t4)+sizeof(t3)+sizeof(t2)+sizeof(t1) && isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && clobber(m2) && clobber(m3) && clobber(m4) && clobber(m5)) { 44215 break 44216 } 44217 v.reset(OpStore) 44218 v.Aux = t1 44219 v.AddArg(op1) 44220 v.AddArg(d1) 44221 v0 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 44222 v0.Aux = t2 44223 v0.AddArg(op2) 44224 v0.AddArg(d2) 44225 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 44226 v1.Aux = t3 44227 v1.AddArg(op3) 44228 v1.AddArg(d3) 44229 v2 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 44230 v2.Aux = t4 44231 v2.AddArg(op4) 44232 v2.AddArg(d4) 44233 v2.AddArg(mem) 44234 v1.AddArg(v2) 44235 v0.AddArg(v1) 44236 v.AddArg(v0) 44237 return true 44238 } 44239 // match: (Store {t1} op1:(OffPtr [o1] p1) d1 m2:(Store {t2} op2:(OffPtr [0] p2) d2 m3:(Zero [n] p3 mem))) 44240 // cond: m2.Uses == 1 && m3.Uses == 1 && o1 == sizeof(t2) && n == sizeof(t2) + sizeof(t1) && isSamePtr(p1, p2) && isSamePtr(p2, p3) && clobber(m2) && clobber(m3) 44241 // result: (Store {t1} op1 d1 (Store {t2} op2 d2 mem)) 44242 for { 44243 t1 := v.Aux 44244 _ = v.Args[2] 44245 op1 := v.Args[0] 44246 if op1.Op != OpOffPtr { 44247 break 44248 } 44249 o1 := op1.AuxInt 44250 p1 := op1.Args[0] 44251 d1 := v.Args[1] 44252 m2 := v.Args[2] 44253 if m2.Op != OpStore { 44254 break 44255 } 44256 t2 := m2.Aux 44257 _ = m2.Args[2] 44258 op2 := m2.Args[0] 44259 if op2.Op != OpOffPtr || op2.AuxInt != 0 { 44260 break 44261 } 44262 p2 := op2.Args[0] 44263 d2 := m2.Args[1] 44264 m3 := m2.Args[2] 44265 if m3.Op != OpZero { 44266 break 44267 } 44268 n := m3.AuxInt 44269 mem := m3.Args[1] 44270 p3 := m3.Args[0] 44271 if !(m2.Uses == 1 && m3.Uses == 1 && o1 == sizeof(t2) && n == sizeof(t2)+sizeof(t1) && isSamePtr(p1, p2) && isSamePtr(p2, p3) && clobber(m2) && clobber(m3)) { 44272 break 44273 } 44274 v.reset(OpStore) 44275 v.Aux = t1 44276 v.AddArg(op1) 44277 v.AddArg(d1) 44278 v0 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 44279 v0.Aux = t2 44280 v0.AddArg(op2) 44281 v0.AddArg(d2) 44282 v0.AddArg(mem) 44283 v.AddArg(v0) 44284 return true 44285 } 44286 // match: (Store {t1} op1:(OffPtr [o1] p1) d1 m2:(Store {t2} op2:(OffPtr [o2] p2) d2 m3:(Store {t3} op3:(OffPtr [0] p3) d3 m4:(Zero [n] p4 mem)))) 44287 // cond: m2.Uses == 1 && m3.Uses == 1 && m4.Uses == 1 && o2 == sizeof(t3) && o1-o2 == sizeof(t2) && n == sizeof(t3) + sizeof(t2) + sizeof(t1) && isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && clobber(m2) && clobber(m3) && clobber(m4) 44288 // result: (Store {t1} op1 d1 (Store {t2} op2 d2 (Store {t3} op3 d3 mem))) 44289 for { 44290 t1 := v.Aux 44291 _ = v.Args[2] 44292 op1 := v.Args[0] 44293 if op1.Op != OpOffPtr { 44294 break 44295 } 44296 o1 := op1.AuxInt 44297 p1 := op1.Args[0] 44298 d1 := v.Args[1] 44299 m2 := v.Args[2] 44300 if m2.Op != OpStore { 44301 break 44302 } 44303 t2 := m2.Aux 44304 _ = m2.Args[2] 44305 op2 := m2.Args[0] 44306 if op2.Op != OpOffPtr { 44307 break 44308 } 44309 o2 := op2.AuxInt 44310 p2 := op2.Args[0] 44311 d2 := m2.Args[1] 44312 m3 := m2.Args[2] 44313 if m3.Op != OpStore { 44314 break 44315 } 44316 t3 := m3.Aux 44317 _ = m3.Args[2] 44318 op3 := m3.Args[0] 44319 if op3.Op != OpOffPtr || op3.AuxInt != 0 { 44320 break 44321 } 44322 p3 := op3.Args[0] 44323 d3 := m3.Args[1] 44324 m4 := m3.Args[2] 44325 if m4.Op != OpZero { 44326 break 44327 } 44328 n := m4.AuxInt 44329 mem := m4.Args[1] 44330 p4 := m4.Args[0] 44331 if !(m2.Uses == 1 && m3.Uses == 1 && m4.Uses == 1 && o2 == sizeof(t3) && o1-o2 == sizeof(t2) && n == sizeof(t3)+sizeof(t2)+sizeof(t1) && isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && clobber(m2) && clobber(m3) && clobber(m4)) { 44332 break 44333 } 44334 v.reset(OpStore) 44335 v.Aux = t1 44336 v.AddArg(op1) 44337 v.AddArg(d1) 44338 v0 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 44339 v0.Aux = t2 44340 v0.AddArg(op2) 44341 v0.AddArg(d2) 44342 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 44343 v1.Aux = t3 44344 v1.AddArg(op3) 44345 v1.AddArg(d3) 44346 v1.AddArg(mem) 44347 v0.AddArg(v1) 44348 v.AddArg(v0) 44349 return true 44350 } 44351 // match: (Store {t1} op1:(OffPtr [o1] p1) d1 m2:(Store {t2} op2:(OffPtr [o2] p2) d2 m3:(Store {t3} op3:(OffPtr [o3] p3) d3 m4:(Store {t4} op4:(OffPtr [0] p4) d4 m5:(Zero [n] p5 mem))))) 44352 // cond: m2.Uses == 1 && m3.Uses == 1 && m4.Uses == 1 && m5.Uses == 1 && o3 == sizeof(t4) && o2-o3 == sizeof(t3) && o1-o2 == sizeof(t2) && n == sizeof(t4) + sizeof(t3) + sizeof(t2) + sizeof(t1) && isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && clobber(m2) && clobber(m3) && clobber(m4) && clobber(m5) 44353 // result: (Store {t1} op1 d1 (Store {t2} op2 d2 (Store {t3} op3 d3 (Store {t4} op4 d4 mem)))) 44354 for { 44355 t1 := v.Aux 44356 _ = v.Args[2] 44357 op1 := v.Args[0] 44358 if op1.Op != OpOffPtr { 44359 break 44360 } 44361 o1 := op1.AuxInt 44362 p1 := op1.Args[0] 44363 d1 := v.Args[1] 44364 m2 := v.Args[2] 44365 if m2.Op != OpStore { 44366 break 44367 } 44368 t2 := m2.Aux 44369 _ = m2.Args[2] 44370 op2 := m2.Args[0] 44371 if op2.Op != OpOffPtr { 44372 break 44373 } 44374 o2 := op2.AuxInt 44375 p2 := op2.Args[0] 44376 d2 := m2.Args[1] 44377 m3 := m2.Args[2] 44378 if m3.Op != OpStore { 44379 break 44380 } 44381 t3 := m3.Aux 44382 _ = m3.Args[2] 44383 op3 := m3.Args[0] 44384 if op3.Op != OpOffPtr { 44385 break 44386 } 44387 o3 := op3.AuxInt 44388 p3 := op3.Args[0] 44389 d3 := m3.Args[1] 44390 m4 := m3.Args[2] 44391 if m4.Op != OpStore { 44392 break 44393 } 44394 t4 := m4.Aux 44395 _ = m4.Args[2] 44396 op4 := m4.Args[0] 44397 if op4.Op != OpOffPtr || op4.AuxInt != 0 { 44398 break 44399 } 44400 p4 := op4.Args[0] 44401 d4 := m4.Args[1] 44402 m5 := m4.Args[2] 44403 if m5.Op != OpZero { 44404 break 44405 } 44406 n := m5.AuxInt 44407 mem := m5.Args[1] 44408 p5 := m5.Args[0] 44409 if !(m2.Uses == 1 && m3.Uses == 1 && m4.Uses == 1 && m5.Uses == 1 && o3 == sizeof(t4) && o2-o3 == sizeof(t3) && o1-o2 == sizeof(t2) && n == sizeof(t4)+sizeof(t3)+sizeof(t2)+sizeof(t1) && isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && clobber(m2) && clobber(m3) && clobber(m4) && clobber(m5)) { 44410 break 44411 } 44412 v.reset(OpStore) 44413 v.Aux = t1 44414 v.AddArg(op1) 44415 v.AddArg(d1) 44416 v0 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 44417 v0.Aux = t2 44418 v0.AddArg(op2) 44419 v0.AddArg(d2) 44420 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 44421 v1.Aux = t3 44422 v1.AddArg(op3) 44423 v1.AddArg(d3) 44424 v2 := b.NewValue0(v.Pos, OpStore, types.TypeMem) 44425 v2.Aux = t4 44426 v2.AddArg(op4) 44427 v2.AddArg(d4) 44428 v2.AddArg(mem) 44429 v1.AddArg(v2) 44430 v0.AddArg(v1) 44431 v.AddArg(v0) 44432 return true 44433 } 44434 return false 44435 } 44436 func rewriteValuegeneric_OpStringLen_0(v *Value) bool { 44437 // match: (StringLen (StringMake _ (Const64 <t> [c]))) 44438 // result: (Const64 <t> [c]) 44439 for { 44440 v_0 := v.Args[0] 44441 if v_0.Op != OpStringMake { 44442 break 44443 } 44444 _ = v_0.Args[1] 44445 v_0_1 := v_0.Args[1] 44446 if v_0_1.Op != OpConst64 { 44447 break 44448 } 44449 t := v_0_1.Type 44450 c := v_0_1.AuxInt 44451 v.reset(OpConst64) 44452 v.Type = t 44453 v.AuxInt = c 44454 return true 44455 } 44456 return false 44457 } 44458 func rewriteValuegeneric_OpStringPtr_0(v *Value) bool { 44459 // match: (StringPtr (StringMake (Addr <t> {s} base) _)) 44460 // result: (Addr <t> {s} base) 44461 for { 44462 v_0 := v.Args[0] 44463 if v_0.Op != OpStringMake { 44464 break 44465 } 44466 _ = v_0.Args[1] 44467 v_0_0 := v_0.Args[0] 44468 if v_0_0.Op != OpAddr { 44469 break 44470 } 44471 t := v_0_0.Type 44472 s := v_0_0.Aux 44473 base := v_0_0.Args[0] 44474 v.reset(OpAddr) 44475 v.Type = t 44476 v.Aux = s 44477 v.AddArg(base) 44478 return true 44479 } 44480 return false 44481 } 44482 func rewriteValuegeneric_OpStructSelect_0(v *Value) bool { 44483 // match: (StructSelect (StructMake1 x)) 44484 // result: x 44485 for { 44486 v_0 := v.Args[0] 44487 if v_0.Op != OpStructMake1 { 44488 break 44489 } 44490 x := v_0.Args[0] 44491 v.reset(OpCopy) 44492 v.Type = x.Type 44493 v.AddArg(x) 44494 return true 44495 } 44496 // match: (StructSelect [0] (StructMake2 x _)) 44497 // result: x 44498 for { 44499 if v.AuxInt != 0 { 44500 break 44501 } 44502 v_0 := v.Args[0] 44503 if v_0.Op != OpStructMake2 { 44504 break 44505 } 44506 _ = v_0.Args[1] 44507 x := v_0.Args[0] 44508 v.reset(OpCopy) 44509 v.Type = x.Type 44510 v.AddArg(x) 44511 return true 44512 } 44513 // match: (StructSelect [1] (StructMake2 _ x)) 44514 // result: x 44515 for { 44516 if v.AuxInt != 1 { 44517 break 44518 } 44519 v_0 := v.Args[0] 44520 if v_0.Op != OpStructMake2 { 44521 break 44522 } 44523 x := v_0.Args[1] 44524 v.reset(OpCopy) 44525 v.Type = x.Type 44526 v.AddArg(x) 44527 return true 44528 } 44529 // match: (StructSelect [0] (StructMake3 x _ _)) 44530 // result: x 44531 for { 44532 if v.AuxInt != 0 { 44533 break 44534 } 44535 v_0 := v.Args[0] 44536 if v_0.Op != OpStructMake3 { 44537 break 44538 } 44539 _ = v_0.Args[2] 44540 x := v_0.Args[0] 44541 v.reset(OpCopy) 44542 v.Type = x.Type 44543 v.AddArg(x) 44544 return true 44545 } 44546 // match: (StructSelect [1] (StructMake3 _ x _)) 44547 // result: x 44548 for { 44549 if v.AuxInt != 1 { 44550 break 44551 } 44552 v_0 := v.Args[0] 44553 if v_0.Op != OpStructMake3 { 44554 break 44555 } 44556 _ = v_0.Args[2] 44557 x := v_0.Args[1] 44558 v.reset(OpCopy) 44559 v.Type = x.Type 44560 v.AddArg(x) 44561 return true 44562 } 44563 // match: (StructSelect [2] (StructMake3 _ _ x)) 44564 // result: x 44565 for { 44566 if v.AuxInt != 2 { 44567 break 44568 } 44569 v_0 := v.Args[0] 44570 if v_0.Op != OpStructMake3 { 44571 break 44572 } 44573 x := v_0.Args[2] 44574 v.reset(OpCopy) 44575 v.Type = x.Type 44576 v.AddArg(x) 44577 return true 44578 } 44579 // match: (StructSelect [0] (StructMake4 x _ _ _)) 44580 // result: x 44581 for { 44582 if v.AuxInt != 0 { 44583 break 44584 } 44585 v_0 := v.Args[0] 44586 if v_0.Op != OpStructMake4 { 44587 break 44588 } 44589 _ = v_0.Args[3] 44590 x := v_0.Args[0] 44591 v.reset(OpCopy) 44592 v.Type = x.Type 44593 v.AddArg(x) 44594 return true 44595 } 44596 // match: (StructSelect [1] (StructMake4 _ x _ _)) 44597 // result: x 44598 for { 44599 if v.AuxInt != 1 { 44600 break 44601 } 44602 v_0 := v.Args[0] 44603 if v_0.Op != OpStructMake4 { 44604 break 44605 } 44606 _ = v_0.Args[3] 44607 x := v_0.Args[1] 44608 v.reset(OpCopy) 44609 v.Type = x.Type 44610 v.AddArg(x) 44611 return true 44612 } 44613 // match: (StructSelect [2] (StructMake4 _ _ x _)) 44614 // result: x 44615 for { 44616 if v.AuxInt != 2 { 44617 break 44618 } 44619 v_0 := v.Args[0] 44620 if v_0.Op != OpStructMake4 { 44621 break 44622 } 44623 _ = v_0.Args[3] 44624 x := v_0.Args[2] 44625 v.reset(OpCopy) 44626 v.Type = x.Type 44627 v.AddArg(x) 44628 return true 44629 } 44630 // match: (StructSelect [3] (StructMake4 _ _ _ x)) 44631 // result: x 44632 for { 44633 if v.AuxInt != 3 { 44634 break 44635 } 44636 v_0 := v.Args[0] 44637 if v_0.Op != OpStructMake4 { 44638 break 44639 } 44640 x := v_0.Args[3] 44641 v.reset(OpCopy) 44642 v.Type = x.Type 44643 v.AddArg(x) 44644 return true 44645 } 44646 return false 44647 } 44648 func rewriteValuegeneric_OpStructSelect_10(v *Value) bool { 44649 b := v.Block 44650 fe := b.Func.fe 44651 // match: (StructSelect [i] x:(Load <t> ptr mem)) 44652 // cond: !fe.CanSSA(t) 44653 // result: @x.Block (Load <v.Type> (OffPtr <v.Type.PtrTo()> [t.FieldOff(int(i))] ptr) mem) 44654 for { 44655 i := v.AuxInt 44656 x := v.Args[0] 44657 if x.Op != OpLoad { 44658 break 44659 } 44660 t := x.Type 44661 mem := x.Args[1] 44662 ptr := x.Args[0] 44663 if !(!fe.CanSSA(t)) { 44664 break 44665 } 44666 b = x.Block 44667 v0 := b.NewValue0(v.Pos, OpLoad, v.Type) 44668 v.reset(OpCopy) 44669 v.AddArg(v0) 44670 v1 := b.NewValue0(v.Pos, OpOffPtr, v.Type.PtrTo()) 44671 v1.AuxInt = t.FieldOff(int(i)) 44672 v1.AddArg(ptr) 44673 v0.AddArg(v1) 44674 v0.AddArg(mem) 44675 return true 44676 } 44677 // match: (StructSelect [0] (IData x)) 44678 // result: (IData x) 44679 for { 44680 if v.AuxInt != 0 { 44681 break 44682 } 44683 v_0 := v.Args[0] 44684 if v_0.Op != OpIData { 44685 break 44686 } 44687 x := v_0.Args[0] 44688 v.reset(OpIData) 44689 v.AddArg(x) 44690 return true 44691 } 44692 return false 44693 } 44694 func rewriteValuegeneric_OpSub16_0(v *Value) bool { 44695 b := v.Block 44696 // match: (Sub16 (Const16 [c]) (Const16 [d])) 44697 // result: (Const16 [int64(int16(c-d))]) 44698 for { 44699 _ = v.Args[1] 44700 v_0 := v.Args[0] 44701 if v_0.Op != OpConst16 { 44702 break 44703 } 44704 c := v_0.AuxInt 44705 v_1 := v.Args[1] 44706 if v_1.Op != OpConst16 { 44707 break 44708 } 44709 d := v_1.AuxInt 44710 v.reset(OpConst16) 44711 v.AuxInt = int64(int16(c - d)) 44712 return true 44713 } 44714 // match: (Sub16 x (Const16 <t> [c])) 44715 // cond: x.Op != OpConst16 44716 // result: (Add16 (Const16 <t> [int64(int16(-c))]) x) 44717 for { 44718 _ = v.Args[1] 44719 x := v.Args[0] 44720 v_1 := v.Args[1] 44721 if v_1.Op != OpConst16 { 44722 break 44723 } 44724 t := v_1.Type 44725 c := v_1.AuxInt 44726 if !(x.Op != OpConst16) { 44727 break 44728 } 44729 v.reset(OpAdd16) 44730 v0 := b.NewValue0(v.Pos, OpConst16, t) 44731 v0.AuxInt = int64(int16(-c)) 44732 v.AddArg(v0) 44733 v.AddArg(x) 44734 return true 44735 } 44736 // match: (Sub16 <t> (Mul16 x y) (Mul16 x z)) 44737 // result: (Mul16 x (Sub16 <t> y z)) 44738 for { 44739 t := v.Type 44740 _ = v.Args[1] 44741 v_0 := v.Args[0] 44742 if v_0.Op != OpMul16 { 44743 break 44744 } 44745 y := v_0.Args[1] 44746 x := v_0.Args[0] 44747 v_1 := v.Args[1] 44748 if v_1.Op != OpMul16 { 44749 break 44750 } 44751 z := v_1.Args[1] 44752 if x != v_1.Args[0] { 44753 break 44754 } 44755 v.reset(OpMul16) 44756 v.AddArg(x) 44757 v0 := b.NewValue0(v.Pos, OpSub16, t) 44758 v0.AddArg(y) 44759 v0.AddArg(z) 44760 v.AddArg(v0) 44761 return true 44762 } 44763 // match: (Sub16 <t> (Mul16 y x) (Mul16 x z)) 44764 // result: (Mul16 x (Sub16 <t> y z)) 44765 for { 44766 t := v.Type 44767 _ = v.Args[1] 44768 v_0 := v.Args[0] 44769 if v_0.Op != OpMul16 { 44770 break 44771 } 44772 x := v_0.Args[1] 44773 y := v_0.Args[0] 44774 v_1 := v.Args[1] 44775 if v_1.Op != OpMul16 { 44776 break 44777 } 44778 z := v_1.Args[1] 44779 if x != v_1.Args[0] { 44780 break 44781 } 44782 v.reset(OpMul16) 44783 v.AddArg(x) 44784 v0 := b.NewValue0(v.Pos, OpSub16, t) 44785 v0.AddArg(y) 44786 v0.AddArg(z) 44787 v.AddArg(v0) 44788 return true 44789 } 44790 // match: (Sub16 <t> (Mul16 x y) (Mul16 z x)) 44791 // result: (Mul16 x (Sub16 <t> y z)) 44792 for { 44793 t := v.Type 44794 _ = v.Args[1] 44795 v_0 := v.Args[0] 44796 if v_0.Op != OpMul16 { 44797 break 44798 } 44799 y := v_0.Args[1] 44800 x := v_0.Args[0] 44801 v_1 := v.Args[1] 44802 if v_1.Op != OpMul16 { 44803 break 44804 } 44805 _ = v_1.Args[1] 44806 z := v_1.Args[0] 44807 if x != v_1.Args[1] { 44808 break 44809 } 44810 v.reset(OpMul16) 44811 v.AddArg(x) 44812 v0 := b.NewValue0(v.Pos, OpSub16, t) 44813 v0.AddArg(y) 44814 v0.AddArg(z) 44815 v.AddArg(v0) 44816 return true 44817 } 44818 // match: (Sub16 <t> (Mul16 y x) (Mul16 z x)) 44819 // result: (Mul16 x (Sub16 <t> y z)) 44820 for { 44821 t := v.Type 44822 _ = v.Args[1] 44823 v_0 := v.Args[0] 44824 if v_0.Op != OpMul16 { 44825 break 44826 } 44827 x := v_0.Args[1] 44828 y := v_0.Args[0] 44829 v_1 := v.Args[1] 44830 if v_1.Op != OpMul16 { 44831 break 44832 } 44833 _ = v_1.Args[1] 44834 z := v_1.Args[0] 44835 if x != v_1.Args[1] { 44836 break 44837 } 44838 v.reset(OpMul16) 44839 v.AddArg(x) 44840 v0 := b.NewValue0(v.Pos, OpSub16, t) 44841 v0.AddArg(y) 44842 v0.AddArg(z) 44843 v.AddArg(v0) 44844 return true 44845 } 44846 // match: (Sub16 x x) 44847 // result: (Const16 [0]) 44848 for { 44849 x := v.Args[1] 44850 if x != v.Args[0] { 44851 break 44852 } 44853 v.reset(OpConst16) 44854 v.AuxInt = 0 44855 return true 44856 } 44857 // match: (Sub16 (Add16 x y) x) 44858 // result: y 44859 for { 44860 x := v.Args[1] 44861 v_0 := v.Args[0] 44862 if v_0.Op != OpAdd16 { 44863 break 44864 } 44865 y := v_0.Args[1] 44866 if x != v_0.Args[0] { 44867 break 44868 } 44869 v.reset(OpCopy) 44870 v.Type = y.Type 44871 v.AddArg(y) 44872 return true 44873 } 44874 // match: (Sub16 (Add16 y x) x) 44875 // result: y 44876 for { 44877 x := v.Args[1] 44878 v_0 := v.Args[0] 44879 if v_0.Op != OpAdd16 { 44880 break 44881 } 44882 _ = v_0.Args[1] 44883 y := v_0.Args[0] 44884 if x != v_0.Args[1] { 44885 break 44886 } 44887 v.reset(OpCopy) 44888 v.Type = y.Type 44889 v.AddArg(y) 44890 return true 44891 } 44892 // match: (Sub16 (Add16 x y) y) 44893 // result: x 44894 for { 44895 y := v.Args[1] 44896 v_0 := v.Args[0] 44897 if v_0.Op != OpAdd16 { 44898 break 44899 } 44900 _ = v_0.Args[1] 44901 x := v_0.Args[0] 44902 if y != v_0.Args[1] { 44903 break 44904 } 44905 v.reset(OpCopy) 44906 v.Type = x.Type 44907 v.AddArg(x) 44908 return true 44909 } 44910 return false 44911 } 44912 func rewriteValuegeneric_OpSub16_10(v *Value) bool { 44913 b := v.Block 44914 // match: (Sub16 (Add16 y x) y) 44915 // result: x 44916 for { 44917 y := v.Args[1] 44918 v_0 := v.Args[0] 44919 if v_0.Op != OpAdd16 { 44920 break 44921 } 44922 x := v_0.Args[1] 44923 if y != v_0.Args[0] { 44924 break 44925 } 44926 v.reset(OpCopy) 44927 v.Type = x.Type 44928 v.AddArg(x) 44929 return true 44930 } 44931 // match: (Sub16 x (Sub16 i:(Const16 <t>) z)) 44932 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 44933 // result: (Sub16 (Add16 <t> x z) i) 44934 for { 44935 _ = v.Args[1] 44936 x := v.Args[0] 44937 v_1 := v.Args[1] 44938 if v_1.Op != OpSub16 { 44939 break 44940 } 44941 z := v_1.Args[1] 44942 i := v_1.Args[0] 44943 if i.Op != OpConst16 { 44944 break 44945 } 44946 t := i.Type 44947 if !(z.Op != OpConst16 && x.Op != OpConst16) { 44948 break 44949 } 44950 v.reset(OpSub16) 44951 v0 := b.NewValue0(v.Pos, OpAdd16, t) 44952 v0.AddArg(x) 44953 v0.AddArg(z) 44954 v.AddArg(v0) 44955 v.AddArg(i) 44956 return true 44957 } 44958 // match: (Sub16 x (Sub16 z i:(Const16 <t>))) 44959 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 44960 // result: (Add16 i (Sub16 <t> x z)) 44961 for { 44962 _ = v.Args[1] 44963 x := v.Args[0] 44964 v_1 := v.Args[1] 44965 if v_1.Op != OpSub16 { 44966 break 44967 } 44968 _ = v_1.Args[1] 44969 z := v_1.Args[0] 44970 i := v_1.Args[1] 44971 if i.Op != OpConst16 { 44972 break 44973 } 44974 t := i.Type 44975 if !(z.Op != OpConst16 && x.Op != OpConst16) { 44976 break 44977 } 44978 v.reset(OpAdd16) 44979 v.AddArg(i) 44980 v0 := b.NewValue0(v.Pos, OpSub16, t) 44981 v0.AddArg(x) 44982 v0.AddArg(z) 44983 v.AddArg(v0) 44984 return true 44985 } 44986 // match: (Sub16 (Const16 <t> [c]) (Sub16 x (Const16 <t> [d]))) 44987 // result: (Sub16 (Const16 <t> [int64(int16(c+d))]) x) 44988 for { 44989 _ = v.Args[1] 44990 v_0 := v.Args[0] 44991 if v_0.Op != OpConst16 { 44992 break 44993 } 44994 t := v_0.Type 44995 c := v_0.AuxInt 44996 v_1 := v.Args[1] 44997 if v_1.Op != OpSub16 { 44998 break 44999 } 45000 _ = v_1.Args[1] 45001 x := v_1.Args[0] 45002 v_1_1 := v_1.Args[1] 45003 if v_1_1.Op != OpConst16 || v_1_1.Type != t { 45004 break 45005 } 45006 d := v_1_1.AuxInt 45007 v.reset(OpSub16) 45008 v0 := b.NewValue0(v.Pos, OpConst16, t) 45009 v0.AuxInt = int64(int16(c + d)) 45010 v.AddArg(v0) 45011 v.AddArg(x) 45012 return true 45013 } 45014 // match: (Sub16 (Const16 <t> [c]) (Sub16 (Const16 <t> [d]) x)) 45015 // result: (Add16 (Const16 <t> [int64(int16(c-d))]) x) 45016 for { 45017 _ = v.Args[1] 45018 v_0 := v.Args[0] 45019 if v_0.Op != OpConst16 { 45020 break 45021 } 45022 t := v_0.Type 45023 c := v_0.AuxInt 45024 v_1 := v.Args[1] 45025 if v_1.Op != OpSub16 { 45026 break 45027 } 45028 x := v_1.Args[1] 45029 v_1_0 := v_1.Args[0] 45030 if v_1_0.Op != OpConst16 || v_1_0.Type != t { 45031 break 45032 } 45033 d := v_1_0.AuxInt 45034 v.reset(OpAdd16) 45035 v0 := b.NewValue0(v.Pos, OpConst16, t) 45036 v0.AuxInt = int64(int16(c - d)) 45037 v.AddArg(v0) 45038 v.AddArg(x) 45039 return true 45040 } 45041 return false 45042 } 45043 func rewriteValuegeneric_OpSub32_0(v *Value) bool { 45044 b := v.Block 45045 // match: (Sub32 (Const32 [c]) (Const32 [d])) 45046 // result: (Const32 [int64(int32(c-d))]) 45047 for { 45048 _ = v.Args[1] 45049 v_0 := v.Args[0] 45050 if v_0.Op != OpConst32 { 45051 break 45052 } 45053 c := v_0.AuxInt 45054 v_1 := v.Args[1] 45055 if v_1.Op != OpConst32 { 45056 break 45057 } 45058 d := v_1.AuxInt 45059 v.reset(OpConst32) 45060 v.AuxInt = int64(int32(c - d)) 45061 return true 45062 } 45063 // match: (Sub32 x (Const32 <t> [c])) 45064 // cond: x.Op != OpConst32 45065 // result: (Add32 (Const32 <t> [int64(int32(-c))]) x) 45066 for { 45067 _ = v.Args[1] 45068 x := v.Args[0] 45069 v_1 := v.Args[1] 45070 if v_1.Op != OpConst32 { 45071 break 45072 } 45073 t := v_1.Type 45074 c := v_1.AuxInt 45075 if !(x.Op != OpConst32) { 45076 break 45077 } 45078 v.reset(OpAdd32) 45079 v0 := b.NewValue0(v.Pos, OpConst32, t) 45080 v0.AuxInt = int64(int32(-c)) 45081 v.AddArg(v0) 45082 v.AddArg(x) 45083 return true 45084 } 45085 // match: (Sub32 <t> (Mul32 x y) (Mul32 x z)) 45086 // result: (Mul32 x (Sub32 <t> y z)) 45087 for { 45088 t := v.Type 45089 _ = v.Args[1] 45090 v_0 := v.Args[0] 45091 if v_0.Op != OpMul32 { 45092 break 45093 } 45094 y := v_0.Args[1] 45095 x := v_0.Args[0] 45096 v_1 := v.Args[1] 45097 if v_1.Op != OpMul32 { 45098 break 45099 } 45100 z := v_1.Args[1] 45101 if x != v_1.Args[0] { 45102 break 45103 } 45104 v.reset(OpMul32) 45105 v.AddArg(x) 45106 v0 := b.NewValue0(v.Pos, OpSub32, t) 45107 v0.AddArg(y) 45108 v0.AddArg(z) 45109 v.AddArg(v0) 45110 return true 45111 } 45112 // match: (Sub32 <t> (Mul32 y x) (Mul32 x z)) 45113 // result: (Mul32 x (Sub32 <t> y z)) 45114 for { 45115 t := v.Type 45116 _ = v.Args[1] 45117 v_0 := v.Args[0] 45118 if v_0.Op != OpMul32 { 45119 break 45120 } 45121 x := v_0.Args[1] 45122 y := v_0.Args[0] 45123 v_1 := v.Args[1] 45124 if v_1.Op != OpMul32 { 45125 break 45126 } 45127 z := v_1.Args[1] 45128 if x != v_1.Args[0] { 45129 break 45130 } 45131 v.reset(OpMul32) 45132 v.AddArg(x) 45133 v0 := b.NewValue0(v.Pos, OpSub32, t) 45134 v0.AddArg(y) 45135 v0.AddArg(z) 45136 v.AddArg(v0) 45137 return true 45138 } 45139 // match: (Sub32 <t> (Mul32 x y) (Mul32 z x)) 45140 // result: (Mul32 x (Sub32 <t> y z)) 45141 for { 45142 t := v.Type 45143 _ = v.Args[1] 45144 v_0 := v.Args[0] 45145 if v_0.Op != OpMul32 { 45146 break 45147 } 45148 y := v_0.Args[1] 45149 x := v_0.Args[0] 45150 v_1 := v.Args[1] 45151 if v_1.Op != OpMul32 { 45152 break 45153 } 45154 _ = v_1.Args[1] 45155 z := v_1.Args[0] 45156 if x != v_1.Args[1] { 45157 break 45158 } 45159 v.reset(OpMul32) 45160 v.AddArg(x) 45161 v0 := b.NewValue0(v.Pos, OpSub32, t) 45162 v0.AddArg(y) 45163 v0.AddArg(z) 45164 v.AddArg(v0) 45165 return true 45166 } 45167 // match: (Sub32 <t> (Mul32 y x) (Mul32 z x)) 45168 // result: (Mul32 x (Sub32 <t> y z)) 45169 for { 45170 t := v.Type 45171 _ = v.Args[1] 45172 v_0 := v.Args[0] 45173 if v_0.Op != OpMul32 { 45174 break 45175 } 45176 x := v_0.Args[1] 45177 y := v_0.Args[0] 45178 v_1 := v.Args[1] 45179 if v_1.Op != OpMul32 { 45180 break 45181 } 45182 _ = v_1.Args[1] 45183 z := v_1.Args[0] 45184 if x != v_1.Args[1] { 45185 break 45186 } 45187 v.reset(OpMul32) 45188 v.AddArg(x) 45189 v0 := b.NewValue0(v.Pos, OpSub32, t) 45190 v0.AddArg(y) 45191 v0.AddArg(z) 45192 v.AddArg(v0) 45193 return true 45194 } 45195 // match: (Sub32 x x) 45196 // result: (Const32 [0]) 45197 for { 45198 x := v.Args[1] 45199 if x != v.Args[0] { 45200 break 45201 } 45202 v.reset(OpConst32) 45203 v.AuxInt = 0 45204 return true 45205 } 45206 // match: (Sub32 (Add32 x y) x) 45207 // result: y 45208 for { 45209 x := v.Args[1] 45210 v_0 := v.Args[0] 45211 if v_0.Op != OpAdd32 { 45212 break 45213 } 45214 y := v_0.Args[1] 45215 if x != v_0.Args[0] { 45216 break 45217 } 45218 v.reset(OpCopy) 45219 v.Type = y.Type 45220 v.AddArg(y) 45221 return true 45222 } 45223 // match: (Sub32 (Add32 y x) x) 45224 // result: y 45225 for { 45226 x := v.Args[1] 45227 v_0 := v.Args[0] 45228 if v_0.Op != OpAdd32 { 45229 break 45230 } 45231 _ = v_0.Args[1] 45232 y := v_0.Args[0] 45233 if x != v_0.Args[1] { 45234 break 45235 } 45236 v.reset(OpCopy) 45237 v.Type = y.Type 45238 v.AddArg(y) 45239 return true 45240 } 45241 // match: (Sub32 (Add32 x y) y) 45242 // result: x 45243 for { 45244 y := v.Args[1] 45245 v_0 := v.Args[0] 45246 if v_0.Op != OpAdd32 { 45247 break 45248 } 45249 _ = v_0.Args[1] 45250 x := v_0.Args[0] 45251 if y != v_0.Args[1] { 45252 break 45253 } 45254 v.reset(OpCopy) 45255 v.Type = x.Type 45256 v.AddArg(x) 45257 return true 45258 } 45259 return false 45260 } 45261 func rewriteValuegeneric_OpSub32_10(v *Value) bool { 45262 b := v.Block 45263 // match: (Sub32 (Add32 y x) y) 45264 // result: x 45265 for { 45266 y := v.Args[1] 45267 v_0 := v.Args[0] 45268 if v_0.Op != OpAdd32 { 45269 break 45270 } 45271 x := v_0.Args[1] 45272 if y != v_0.Args[0] { 45273 break 45274 } 45275 v.reset(OpCopy) 45276 v.Type = x.Type 45277 v.AddArg(x) 45278 return true 45279 } 45280 // match: (Sub32 x (Sub32 i:(Const32 <t>) z)) 45281 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 45282 // result: (Sub32 (Add32 <t> x z) i) 45283 for { 45284 _ = v.Args[1] 45285 x := v.Args[0] 45286 v_1 := v.Args[1] 45287 if v_1.Op != OpSub32 { 45288 break 45289 } 45290 z := v_1.Args[1] 45291 i := v_1.Args[0] 45292 if i.Op != OpConst32 { 45293 break 45294 } 45295 t := i.Type 45296 if !(z.Op != OpConst32 && x.Op != OpConst32) { 45297 break 45298 } 45299 v.reset(OpSub32) 45300 v0 := b.NewValue0(v.Pos, OpAdd32, t) 45301 v0.AddArg(x) 45302 v0.AddArg(z) 45303 v.AddArg(v0) 45304 v.AddArg(i) 45305 return true 45306 } 45307 // match: (Sub32 x (Sub32 z i:(Const32 <t>))) 45308 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 45309 // result: (Add32 i (Sub32 <t> x z)) 45310 for { 45311 _ = v.Args[1] 45312 x := v.Args[0] 45313 v_1 := v.Args[1] 45314 if v_1.Op != OpSub32 { 45315 break 45316 } 45317 _ = v_1.Args[1] 45318 z := v_1.Args[0] 45319 i := v_1.Args[1] 45320 if i.Op != OpConst32 { 45321 break 45322 } 45323 t := i.Type 45324 if !(z.Op != OpConst32 && x.Op != OpConst32) { 45325 break 45326 } 45327 v.reset(OpAdd32) 45328 v.AddArg(i) 45329 v0 := b.NewValue0(v.Pos, OpSub32, t) 45330 v0.AddArg(x) 45331 v0.AddArg(z) 45332 v.AddArg(v0) 45333 return true 45334 } 45335 // match: (Sub32 (Const32 <t> [c]) (Sub32 x (Const32 <t> [d]))) 45336 // result: (Sub32 (Const32 <t> [int64(int32(c+d))]) x) 45337 for { 45338 _ = v.Args[1] 45339 v_0 := v.Args[0] 45340 if v_0.Op != OpConst32 { 45341 break 45342 } 45343 t := v_0.Type 45344 c := v_0.AuxInt 45345 v_1 := v.Args[1] 45346 if v_1.Op != OpSub32 { 45347 break 45348 } 45349 _ = v_1.Args[1] 45350 x := v_1.Args[0] 45351 v_1_1 := v_1.Args[1] 45352 if v_1_1.Op != OpConst32 || v_1_1.Type != t { 45353 break 45354 } 45355 d := v_1_1.AuxInt 45356 v.reset(OpSub32) 45357 v0 := b.NewValue0(v.Pos, OpConst32, t) 45358 v0.AuxInt = int64(int32(c + d)) 45359 v.AddArg(v0) 45360 v.AddArg(x) 45361 return true 45362 } 45363 // match: (Sub32 (Const32 <t> [c]) (Sub32 (Const32 <t> [d]) x)) 45364 // result: (Add32 (Const32 <t> [int64(int32(c-d))]) x) 45365 for { 45366 _ = v.Args[1] 45367 v_0 := v.Args[0] 45368 if v_0.Op != OpConst32 { 45369 break 45370 } 45371 t := v_0.Type 45372 c := v_0.AuxInt 45373 v_1 := v.Args[1] 45374 if v_1.Op != OpSub32 { 45375 break 45376 } 45377 x := v_1.Args[1] 45378 v_1_0 := v_1.Args[0] 45379 if v_1_0.Op != OpConst32 || v_1_0.Type != t { 45380 break 45381 } 45382 d := v_1_0.AuxInt 45383 v.reset(OpAdd32) 45384 v0 := b.NewValue0(v.Pos, OpConst32, t) 45385 v0.AuxInt = int64(int32(c - d)) 45386 v.AddArg(v0) 45387 v.AddArg(x) 45388 return true 45389 } 45390 return false 45391 } 45392 func rewriteValuegeneric_OpSub32F_0(v *Value) bool { 45393 // match: (Sub32F (Const32F [c]) (Const32F [d])) 45394 // result: (Const32F [auxFrom32F(auxTo32F(c) - auxTo32F(d))]) 45395 for { 45396 _ = v.Args[1] 45397 v_0 := v.Args[0] 45398 if v_0.Op != OpConst32F { 45399 break 45400 } 45401 c := v_0.AuxInt 45402 v_1 := v.Args[1] 45403 if v_1.Op != OpConst32F { 45404 break 45405 } 45406 d := v_1.AuxInt 45407 v.reset(OpConst32F) 45408 v.AuxInt = auxFrom32F(auxTo32F(c) - auxTo32F(d)) 45409 return true 45410 } 45411 return false 45412 } 45413 func rewriteValuegeneric_OpSub64_0(v *Value) bool { 45414 b := v.Block 45415 // match: (Sub64 (Const64 [c]) (Const64 [d])) 45416 // result: (Const64 [c-d]) 45417 for { 45418 _ = v.Args[1] 45419 v_0 := v.Args[0] 45420 if v_0.Op != OpConst64 { 45421 break 45422 } 45423 c := v_0.AuxInt 45424 v_1 := v.Args[1] 45425 if v_1.Op != OpConst64 { 45426 break 45427 } 45428 d := v_1.AuxInt 45429 v.reset(OpConst64) 45430 v.AuxInt = c - d 45431 return true 45432 } 45433 // match: (Sub64 x (Const64 <t> [c])) 45434 // cond: x.Op != OpConst64 45435 // result: (Add64 (Const64 <t> [-c]) x) 45436 for { 45437 _ = v.Args[1] 45438 x := v.Args[0] 45439 v_1 := v.Args[1] 45440 if v_1.Op != OpConst64 { 45441 break 45442 } 45443 t := v_1.Type 45444 c := v_1.AuxInt 45445 if !(x.Op != OpConst64) { 45446 break 45447 } 45448 v.reset(OpAdd64) 45449 v0 := b.NewValue0(v.Pos, OpConst64, t) 45450 v0.AuxInt = -c 45451 v.AddArg(v0) 45452 v.AddArg(x) 45453 return true 45454 } 45455 // match: (Sub64 <t> (Mul64 x y) (Mul64 x z)) 45456 // result: (Mul64 x (Sub64 <t> y z)) 45457 for { 45458 t := v.Type 45459 _ = v.Args[1] 45460 v_0 := v.Args[0] 45461 if v_0.Op != OpMul64 { 45462 break 45463 } 45464 y := v_0.Args[1] 45465 x := v_0.Args[0] 45466 v_1 := v.Args[1] 45467 if v_1.Op != OpMul64 { 45468 break 45469 } 45470 z := v_1.Args[1] 45471 if x != v_1.Args[0] { 45472 break 45473 } 45474 v.reset(OpMul64) 45475 v.AddArg(x) 45476 v0 := b.NewValue0(v.Pos, OpSub64, t) 45477 v0.AddArg(y) 45478 v0.AddArg(z) 45479 v.AddArg(v0) 45480 return true 45481 } 45482 // match: (Sub64 <t> (Mul64 y x) (Mul64 x z)) 45483 // result: (Mul64 x (Sub64 <t> y z)) 45484 for { 45485 t := v.Type 45486 _ = v.Args[1] 45487 v_0 := v.Args[0] 45488 if v_0.Op != OpMul64 { 45489 break 45490 } 45491 x := v_0.Args[1] 45492 y := v_0.Args[0] 45493 v_1 := v.Args[1] 45494 if v_1.Op != OpMul64 { 45495 break 45496 } 45497 z := v_1.Args[1] 45498 if x != v_1.Args[0] { 45499 break 45500 } 45501 v.reset(OpMul64) 45502 v.AddArg(x) 45503 v0 := b.NewValue0(v.Pos, OpSub64, t) 45504 v0.AddArg(y) 45505 v0.AddArg(z) 45506 v.AddArg(v0) 45507 return true 45508 } 45509 // match: (Sub64 <t> (Mul64 x y) (Mul64 z x)) 45510 // result: (Mul64 x (Sub64 <t> y z)) 45511 for { 45512 t := v.Type 45513 _ = v.Args[1] 45514 v_0 := v.Args[0] 45515 if v_0.Op != OpMul64 { 45516 break 45517 } 45518 y := v_0.Args[1] 45519 x := v_0.Args[0] 45520 v_1 := v.Args[1] 45521 if v_1.Op != OpMul64 { 45522 break 45523 } 45524 _ = v_1.Args[1] 45525 z := v_1.Args[0] 45526 if x != v_1.Args[1] { 45527 break 45528 } 45529 v.reset(OpMul64) 45530 v.AddArg(x) 45531 v0 := b.NewValue0(v.Pos, OpSub64, t) 45532 v0.AddArg(y) 45533 v0.AddArg(z) 45534 v.AddArg(v0) 45535 return true 45536 } 45537 // match: (Sub64 <t> (Mul64 y x) (Mul64 z x)) 45538 // result: (Mul64 x (Sub64 <t> y z)) 45539 for { 45540 t := v.Type 45541 _ = v.Args[1] 45542 v_0 := v.Args[0] 45543 if v_0.Op != OpMul64 { 45544 break 45545 } 45546 x := v_0.Args[1] 45547 y := v_0.Args[0] 45548 v_1 := v.Args[1] 45549 if v_1.Op != OpMul64 { 45550 break 45551 } 45552 _ = v_1.Args[1] 45553 z := v_1.Args[0] 45554 if x != v_1.Args[1] { 45555 break 45556 } 45557 v.reset(OpMul64) 45558 v.AddArg(x) 45559 v0 := b.NewValue0(v.Pos, OpSub64, t) 45560 v0.AddArg(y) 45561 v0.AddArg(z) 45562 v.AddArg(v0) 45563 return true 45564 } 45565 // match: (Sub64 x x) 45566 // result: (Const64 [0]) 45567 for { 45568 x := v.Args[1] 45569 if x != v.Args[0] { 45570 break 45571 } 45572 v.reset(OpConst64) 45573 v.AuxInt = 0 45574 return true 45575 } 45576 // match: (Sub64 (Add64 x y) x) 45577 // result: y 45578 for { 45579 x := v.Args[1] 45580 v_0 := v.Args[0] 45581 if v_0.Op != OpAdd64 { 45582 break 45583 } 45584 y := v_0.Args[1] 45585 if x != v_0.Args[0] { 45586 break 45587 } 45588 v.reset(OpCopy) 45589 v.Type = y.Type 45590 v.AddArg(y) 45591 return true 45592 } 45593 // match: (Sub64 (Add64 y x) x) 45594 // result: y 45595 for { 45596 x := v.Args[1] 45597 v_0 := v.Args[0] 45598 if v_0.Op != OpAdd64 { 45599 break 45600 } 45601 _ = v_0.Args[1] 45602 y := v_0.Args[0] 45603 if x != v_0.Args[1] { 45604 break 45605 } 45606 v.reset(OpCopy) 45607 v.Type = y.Type 45608 v.AddArg(y) 45609 return true 45610 } 45611 // match: (Sub64 (Add64 x y) y) 45612 // result: x 45613 for { 45614 y := v.Args[1] 45615 v_0 := v.Args[0] 45616 if v_0.Op != OpAdd64 { 45617 break 45618 } 45619 _ = v_0.Args[1] 45620 x := v_0.Args[0] 45621 if y != v_0.Args[1] { 45622 break 45623 } 45624 v.reset(OpCopy) 45625 v.Type = x.Type 45626 v.AddArg(x) 45627 return true 45628 } 45629 return false 45630 } 45631 func rewriteValuegeneric_OpSub64_10(v *Value) bool { 45632 b := v.Block 45633 // match: (Sub64 (Add64 y x) y) 45634 // result: x 45635 for { 45636 y := v.Args[1] 45637 v_0 := v.Args[0] 45638 if v_0.Op != OpAdd64 { 45639 break 45640 } 45641 x := v_0.Args[1] 45642 if y != v_0.Args[0] { 45643 break 45644 } 45645 v.reset(OpCopy) 45646 v.Type = x.Type 45647 v.AddArg(x) 45648 return true 45649 } 45650 // match: (Sub64 x (Sub64 i:(Const64 <t>) z)) 45651 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 45652 // result: (Sub64 (Add64 <t> x z) i) 45653 for { 45654 _ = v.Args[1] 45655 x := v.Args[0] 45656 v_1 := v.Args[1] 45657 if v_1.Op != OpSub64 { 45658 break 45659 } 45660 z := v_1.Args[1] 45661 i := v_1.Args[0] 45662 if i.Op != OpConst64 { 45663 break 45664 } 45665 t := i.Type 45666 if !(z.Op != OpConst64 && x.Op != OpConst64) { 45667 break 45668 } 45669 v.reset(OpSub64) 45670 v0 := b.NewValue0(v.Pos, OpAdd64, t) 45671 v0.AddArg(x) 45672 v0.AddArg(z) 45673 v.AddArg(v0) 45674 v.AddArg(i) 45675 return true 45676 } 45677 // match: (Sub64 x (Sub64 z i:(Const64 <t>))) 45678 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 45679 // result: (Add64 i (Sub64 <t> x z)) 45680 for { 45681 _ = v.Args[1] 45682 x := v.Args[0] 45683 v_1 := v.Args[1] 45684 if v_1.Op != OpSub64 { 45685 break 45686 } 45687 _ = v_1.Args[1] 45688 z := v_1.Args[0] 45689 i := v_1.Args[1] 45690 if i.Op != OpConst64 { 45691 break 45692 } 45693 t := i.Type 45694 if !(z.Op != OpConst64 && x.Op != OpConst64) { 45695 break 45696 } 45697 v.reset(OpAdd64) 45698 v.AddArg(i) 45699 v0 := b.NewValue0(v.Pos, OpSub64, t) 45700 v0.AddArg(x) 45701 v0.AddArg(z) 45702 v.AddArg(v0) 45703 return true 45704 } 45705 // match: (Sub64 (Const64 <t> [c]) (Sub64 x (Const64 <t> [d]))) 45706 // result: (Sub64 (Const64 <t> [c+d]) x) 45707 for { 45708 _ = v.Args[1] 45709 v_0 := v.Args[0] 45710 if v_0.Op != OpConst64 { 45711 break 45712 } 45713 t := v_0.Type 45714 c := v_0.AuxInt 45715 v_1 := v.Args[1] 45716 if v_1.Op != OpSub64 { 45717 break 45718 } 45719 _ = v_1.Args[1] 45720 x := v_1.Args[0] 45721 v_1_1 := v_1.Args[1] 45722 if v_1_1.Op != OpConst64 || v_1_1.Type != t { 45723 break 45724 } 45725 d := v_1_1.AuxInt 45726 v.reset(OpSub64) 45727 v0 := b.NewValue0(v.Pos, OpConst64, t) 45728 v0.AuxInt = c + d 45729 v.AddArg(v0) 45730 v.AddArg(x) 45731 return true 45732 } 45733 // match: (Sub64 (Const64 <t> [c]) (Sub64 (Const64 <t> [d]) x)) 45734 // result: (Add64 (Const64 <t> [c-d]) x) 45735 for { 45736 _ = v.Args[1] 45737 v_0 := v.Args[0] 45738 if v_0.Op != OpConst64 { 45739 break 45740 } 45741 t := v_0.Type 45742 c := v_0.AuxInt 45743 v_1 := v.Args[1] 45744 if v_1.Op != OpSub64 { 45745 break 45746 } 45747 x := v_1.Args[1] 45748 v_1_0 := v_1.Args[0] 45749 if v_1_0.Op != OpConst64 || v_1_0.Type != t { 45750 break 45751 } 45752 d := v_1_0.AuxInt 45753 v.reset(OpAdd64) 45754 v0 := b.NewValue0(v.Pos, OpConst64, t) 45755 v0.AuxInt = c - d 45756 v.AddArg(v0) 45757 v.AddArg(x) 45758 return true 45759 } 45760 return false 45761 } 45762 func rewriteValuegeneric_OpSub64F_0(v *Value) bool { 45763 // match: (Sub64F (Const64F [c]) (Const64F [d])) 45764 // result: (Const64F [auxFrom64F(auxTo64F(c) - auxTo64F(d))]) 45765 for { 45766 _ = v.Args[1] 45767 v_0 := v.Args[0] 45768 if v_0.Op != OpConst64F { 45769 break 45770 } 45771 c := v_0.AuxInt 45772 v_1 := v.Args[1] 45773 if v_1.Op != OpConst64F { 45774 break 45775 } 45776 d := v_1.AuxInt 45777 v.reset(OpConst64F) 45778 v.AuxInt = auxFrom64F(auxTo64F(c) - auxTo64F(d)) 45779 return true 45780 } 45781 return false 45782 } 45783 func rewriteValuegeneric_OpSub8_0(v *Value) bool { 45784 b := v.Block 45785 // match: (Sub8 (Const8 [c]) (Const8 [d])) 45786 // result: (Const8 [int64(int8(c-d))]) 45787 for { 45788 _ = v.Args[1] 45789 v_0 := v.Args[0] 45790 if v_0.Op != OpConst8 { 45791 break 45792 } 45793 c := v_0.AuxInt 45794 v_1 := v.Args[1] 45795 if v_1.Op != OpConst8 { 45796 break 45797 } 45798 d := v_1.AuxInt 45799 v.reset(OpConst8) 45800 v.AuxInt = int64(int8(c - d)) 45801 return true 45802 } 45803 // match: (Sub8 x (Const8 <t> [c])) 45804 // cond: x.Op != OpConst8 45805 // result: (Add8 (Const8 <t> [int64(int8(-c))]) x) 45806 for { 45807 _ = v.Args[1] 45808 x := v.Args[0] 45809 v_1 := v.Args[1] 45810 if v_1.Op != OpConst8 { 45811 break 45812 } 45813 t := v_1.Type 45814 c := v_1.AuxInt 45815 if !(x.Op != OpConst8) { 45816 break 45817 } 45818 v.reset(OpAdd8) 45819 v0 := b.NewValue0(v.Pos, OpConst8, t) 45820 v0.AuxInt = int64(int8(-c)) 45821 v.AddArg(v0) 45822 v.AddArg(x) 45823 return true 45824 } 45825 // match: (Sub8 <t> (Mul8 x y) (Mul8 x z)) 45826 // result: (Mul8 x (Sub8 <t> y z)) 45827 for { 45828 t := v.Type 45829 _ = v.Args[1] 45830 v_0 := v.Args[0] 45831 if v_0.Op != OpMul8 { 45832 break 45833 } 45834 y := v_0.Args[1] 45835 x := v_0.Args[0] 45836 v_1 := v.Args[1] 45837 if v_1.Op != OpMul8 { 45838 break 45839 } 45840 z := v_1.Args[1] 45841 if x != v_1.Args[0] { 45842 break 45843 } 45844 v.reset(OpMul8) 45845 v.AddArg(x) 45846 v0 := b.NewValue0(v.Pos, OpSub8, t) 45847 v0.AddArg(y) 45848 v0.AddArg(z) 45849 v.AddArg(v0) 45850 return true 45851 } 45852 // match: (Sub8 <t> (Mul8 y x) (Mul8 x z)) 45853 // result: (Mul8 x (Sub8 <t> y z)) 45854 for { 45855 t := v.Type 45856 _ = v.Args[1] 45857 v_0 := v.Args[0] 45858 if v_0.Op != OpMul8 { 45859 break 45860 } 45861 x := v_0.Args[1] 45862 y := v_0.Args[0] 45863 v_1 := v.Args[1] 45864 if v_1.Op != OpMul8 { 45865 break 45866 } 45867 z := v_1.Args[1] 45868 if x != v_1.Args[0] { 45869 break 45870 } 45871 v.reset(OpMul8) 45872 v.AddArg(x) 45873 v0 := b.NewValue0(v.Pos, OpSub8, t) 45874 v0.AddArg(y) 45875 v0.AddArg(z) 45876 v.AddArg(v0) 45877 return true 45878 } 45879 // match: (Sub8 <t> (Mul8 x y) (Mul8 z x)) 45880 // result: (Mul8 x (Sub8 <t> y z)) 45881 for { 45882 t := v.Type 45883 _ = v.Args[1] 45884 v_0 := v.Args[0] 45885 if v_0.Op != OpMul8 { 45886 break 45887 } 45888 y := v_0.Args[1] 45889 x := v_0.Args[0] 45890 v_1 := v.Args[1] 45891 if v_1.Op != OpMul8 { 45892 break 45893 } 45894 _ = v_1.Args[1] 45895 z := v_1.Args[0] 45896 if x != v_1.Args[1] { 45897 break 45898 } 45899 v.reset(OpMul8) 45900 v.AddArg(x) 45901 v0 := b.NewValue0(v.Pos, OpSub8, t) 45902 v0.AddArg(y) 45903 v0.AddArg(z) 45904 v.AddArg(v0) 45905 return true 45906 } 45907 // match: (Sub8 <t> (Mul8 y x) (Mul8 z x)) 45908 // result: (Mul8 x (Sub8 <t> y z)) 45909 for { 45910 t := v.Type 45911 _ = v.Args[1] 45912 v_0 := v.Args[0] 45913 if v_0.Op != OpMul8 { 45914 break 45915 } 45916 x := v_0.Args[1] 45917 y := v_0.Args[0] 45918 v_1 := v.Args[1] 45919 if v_1.Op != OpMul8 { 45920 break 45921 } 45922 _ = v_1.Args[1] 45923 z := v_1.Args[0] 45924 if x != v_1.Args[1] { 45925 break 45926 } 45927 v.reset(OpMul8) 45928 v.AddArg(x) 45929 v0 := b.NewValue0(v.Pos, OpSub8, t) 45930 v0.AddArg(y) 45931 v0.AddArg(z) 45932 v.AddArg(v0) 45933 return true 45934 } 45935 // match: (Sub8 x x) 45936 // result: (Const8 [0]) 45937 for { 45938 x := v.Args[1] 45939 if x != v.Args[0] { 45940 break 45941 } 45942 v.reset(OpConst8) 45943 v.AuxInt = 0 45944 return true 45945 } 45946 // match: (Sub8 (Add8 x y) x) 45947 // result: y 45948 for { 45949 x := v.Args[1] 45950 v_0 := v.Args[0] 45951 if v_0.Op != OpAdd8 { 45952 break 45953 } 45954 y := v_0.Args[1] 45955 if x != v_0.Args[0] { 45956 break 45957 } 45958 v.reset(OpCopy) 45959 v.Type = y.Type 45960 v.AddArg(y) 45961 return true 45962 } 45963 // match: (Sub8 (Add8 y x) x) 45964 // result: y 45965 for { 45966 x := v.Args[1] 45967 v_0 := v.Args[0] 45968 if v_0.Op != OpAdd8 { 45969 break 45970 } 45971 _ = v_0.Args[1] 45972 y := v_0.Args[0] 45973 if x != v_0.Args[1] { 45974 break 45975 } 45976 v.reset(OpCopy) 45977 v.Type = y.Type 45978 v.AddArg(y) 45979 return true 45980 } 45981 // match: (Sub8 (Add8 x y) y) 45982 // result: x 45983 for { 45984 y := v.Args[1] 45985 v_0 := v.Args[0] 45986 if v_0.Op != OpAdd8 { 45987 break 45988 } 45989 _ = v_0.Args[1] 45990 x := v_0.Args[0] 45991 if y != v_0.Args[1] { 45992 break 45993 } 45994 v.reset(OpCopy) 45995 v.Type = x.Type 45996 v.AddArg(x) 45997 return true 45998 } 45999 return false 46000 } 46001 func rewriteValuegeneric_OpSub8_10(v *Value) bool { 46002 b := v.Block 46003 // match: (Sub8 (Add8 y x) y) 46004 // result: x 46005 for { 46006 y := v.Args[1] 46007 v_0 := v.Args[0] 46008 if v_0.Op != OpAdd8 { 46009 break 46010 } 46011 x := v_0.Args[1] 46012 if y != v_0.Args[0] { 46013 break 46014 } 46015 v.reset(OpCopy) 46016 v.Type = x.Type 46017 v.AddArg(x) 46018 return true 46019 } 46020 // match: (Sub8 x (Sub8 i:(Const8 <t>) z)) 46021 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 46022 // result: (Sub8 (Add8 <t> x z) i) 46023 for { 46024 _ = v.Args[1] 46025 x := v.Args[0] 46026 v_1 := v.Args[1] 46027 if v_1.Op != OpSub8 { 46028 break 46029 } 46030 z := v_1.Args[1] 46031 i := v_1.Args[0] 46032 if i.Op != OpConst8 { 46033 break 46034 } 46035 t := i.Type 46036 if !(z.Op != OpConst8 && x.Op != OpConst8) { 46037 break 46038 } 46039 v.reset(OpSub8) 46040 v0 := b.NewValue0(v.Pos, OpAdd8, t) 46041 v0.AddArg(x) 46042 v0.AddArg(z) 46043 v.AddArg(v0) 46044 v.AddArg(i) 46045 return true 46046 } 46047 // match: (Sub8 x (Sub8 z i:(Const8 <t>))) 46048 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 46049 // result: (Add8 i (Sub8 <t> x z)) 46050 for { 46051 _ = v.Args[1] 46052 x := v.Args[0] 46053 v_1 := v.Args[1] 46054 if v_1.Op != OpSub8 { 46055 break 46056 } 46057 _ = v_1.Args[1] 46058 z := v_1.Args[0] 46059 i := v_1.Args[1] 46060 if i.Op != OpConst8 { 46061 break 46062 } 46063 t := i.Type 46064 if !(z.Op != OpConst8 && x.Op != OpConst8) { 46065 break 46066 } 46067 v.reset(OpAdd8) 46068 v.AddArg(i) 46069 v0 := b.NewValue0(v.Pos, OpSub8, t) 46070 v0.AddArg(x) 46071 v0.AddArg(z) 46072 v.AddArg(v0) 46073 return true 46074 } 46075 // match: (Sub8 (Const8 <t> [c]) (Sub8 x (Const8 <t> [d]))) 46076 // result: (Sub8 (Const8 <t> [int64(int8(c+d))]) x) 46077 for { 46078 _ = v.Args[1] 46079 v_0 := v.Args[0] 46080 if v_0.Op != OpConst8 { 46081 break 46082 } 46083 t := v_0.Type 46084 c := v_0.AuxInt 46085 v_1 := v.Args[1] 46086 if v_1.Op != OpSub8 { 46087 break 46088 } 46089 _ = v_1.Args[1] 46090 x := v_1.Args[0] 46091 v_1_1 := v_1.Args[1] 46092 if v_1_1.Op != OpConst8 || v_1_1.Type != t { 46093 break 46094 } 46095 d := v_1_1.AuxInt 46096 v.reset(OpSub8) 46097 v0 := b.NewValue0(v.Pos, OpConst8, t) 46098 v0.AuxInt = int64(int8(c + d)) 46099 v.AddArg(v0) 46100 v.AddArg(x) 46101 return true 46102 } 46103 // match: (Sub8 (Const8 <t> [c]) (Sub8 (Const8 <t> [d]) x)) 46104 // result: (Add8 (Const8 <t> [int64(int8(c-d))]) x) 46105 for { 46106 _ = v.Args[1] 46107 v_0 := v.Args[0] 46108 if v_0.Op != OpConst8 { 46109 break 46110 } 46111 t := v_0.Type 46112 c := v_0.AuxInt 46113 v_1 := v.Args[1] 46114 if v_1.Op != OpSub8 { 46115 break 46116 } 46117 x := v_1.Args[1] 46118 v_1_0 := v_1.Args[0] 46119 if v_1_0.Op != OpConst8 || v_1_0.Type != t { 46120 break 46121 } 46122 d := v_1_0.AuxInt 46123 v.reset(OpAdd8) 46124 v0 := b.NewValue0(v.Pos, OpConst8, t) 46125 v0.AuxInt = int64(int8(c - d)) 46126 v.AddArg(v0) 46127 v.AddArg(x) 46128 return true 46129 } 46130 return false 46131 } 46132 func rewriteValuegeneric_OpTrunc16to8_0(v *Value) bool { 46133 // match: (Trunc16to8 (Const16 [c])) 46134 // result: (Const8 [int64(int8(c))]) 46135 for { 46136 v_0 := v.Args[0] 46137 if v_0.Op != OpConst16 { 46138 break 46139 } 46140 c := v_0.AuxInt 46141 v.reset(OpConst8) 46142 v.AuxInt = int64(int8(c)) 46143 return true 46144 } 46145 // match: (Trunc16to8 (ZeroExt8to16 x)) 46146 // result: x 46147 for { 46148 v_0 := v.Args[0] 46149 if v_0.Op != OpZeroExt8to16 { 46150 break 46151 } 46152 x := v_0.Args[0] 46153 v.reset(OpCopy) 46154 v.Type = x.Type 46155 v.AddArg(x) 46156 return true 46157 } 46158 // match: (Trunc16to8 (SignExt8to16 x)) 46159 // result: x 46160 for { 46161 v_0 := v.Args[0] 46162 if v_0.Op != OpSignExt8to16 { 46163 break 46164 } 46165 x := v_0.Args[0] 46166 v.reset(OpCopy) 46167 v.Type = x.Type 46168 v.AddArg(x) 46169 return true 46170 } 46171 // match: (Trunc16to8 (And16 (Const16 [y]) x)) 46172 // cond: y&0xFF == 0xFF 46173 // result: (Trunc16to8 x) 46174 for { 46175 v_0 := v.Args[0] 46176 if v_0.Op != OpAnd16 { 46177 break 46178 } 46179 x := v_0.Args[1] 46180 v_0_0 := v_0.Args[0] 46181 if v_0_0.Op != OpConst16 { 46182 break 46183 } 46184 y := v_0_0.AuxInt 46185 if !(y&0xFF == 0xFF) { 46186 break 46187 } 46188 v.reset(OpTrunc16to8) 46189 v.AddArg(x) 46190 return true 46191 } 46192 // match: (Trunc16to8 (And16 x (Const16 [y]))) 46193 // cond: y&0xFF == 0xFF 46194 // result: (Trunc16to8 x) 46195 for { 46196 v_0 := v.Args[0] 46197 if v_0.Op != OpAnd16 { 46198 break 46199 } 46200 _ = v_0.Args[1] 46201 x := v_0.Args[0] 46202 v_0_1 := v_0.Args[1] 46203 if v_0_1.Op != OpConst16 { 46204 break 46205 } 46206 y := v_0_1.AuxInt 46207 if !(y&0xFF == 0xFF) { 46208 break 46209 } 46210 v.reset(OpTrunc16to8) 46211 v.AddArg(x) 46212 return true 46213 } 46214 return false 46215 } 46216 func rewriteValuegeneric_OpTrunc32to16_0(v *Value) bool { 46217 // match: (Trunc32to16 (Const32 [c])) 46218 // result: (Const16 [int64(int16(c))]) 46219 for { 46220 v_0 := v.Args[0] 46221 if v_0.Op != OpConst32 { 46222 break 46223 } 46224 c := v_0.AuxInt 46225 v.reset(OpConst16) 46226 v.AuxInt = int64(int16(c)) 46227 return true 46228 } 46229 // match: (Trunc32to16 (ZeroExt8to32 x)) 46230 // result: (ZeroExt8to16 x) 46231 for { 46232 v_0 := v.Args[0] 46233 if v_0.Op != OpZeroExt8to32 { 46234 break 46235 } 46236 x := v_0.Args[0] 46237 v.reset(OpZeroExt8to16) 46238 v.AddArg(x) 46239 return true 46240 } 46241 // match: (Trunc32to16 (ZeroExt16to32 x)) 46242 // result: x 46243 for { 46244 v_0 := v.Args[0] 46245 if v_0.Op != OpZeroExt16to32 { 46246 break 46247 } 46248 x := v_0.Args[0] 46249 v.reset(OpCopy) 46250 v.Type = x.Type 46251 v.AddArg(x) 46252 return true 46253 } 46254 // match: (Trunc32to16 (SignExt8to32 x)) 46255 // result: (SignExt8to16 x) 46256 for { 46257 v_0 := v.Args[0] 46258 if v_0.Op != OpSignExt8to32 { 46259 break 46260 } 46261 x := v_0.Args[0] 46262 v.reset(OpSignExt8to16) 46263 v.AddArg(x) 46264 return true 46265 } 46266 // match: (Trunc32to16 (SignExt16to32 x)) 46267 // result: x 46268 for { 46269 v_0 := v.Args[0] 46270 if v_0.Op != OpSignExt16to32 { 46271 break 46272 } 46273 x := v_0.Args[0] 46274 v.reset(OpCopy) 46275 v.Type = x.Type 46276 v.AddArg(x) 46277 return true 46278 } 46279 // match: (Trunc32to16 (And32 (Const32 [y]) x)) 46280 // cond: y&0xFFFF == 0xFFFF 46281 // result: (Trunc32to16 x) 46282 for { 46283 v_0 := v.Args[0] 46284 if v_0.Op != OpAnd32 { 46285 break 46286 } 46287 x := v_0.Args[1] 46288 v_0_0 := v_0.Args[0] 46289 if v_0_0.Op != OpConst32 { 46290 break 46291 } 46292 y := v_0_0.AuxInt 46293 if !(y&0xFFFF == 0xFFFF) { 46294 break 46295 } 46296 v.reset(OpTrunc32to16) 46297 v.AddArg(x) 46298 return true 46299 } 46300 // match: (Trunc32to16 (And32 x (Const32 [y]))) 46301 // cond: y&0xFFFF == 0xFFFF 46302 // result: (Trunc32to16 x) 46303 for { 46304 v_0 := v.Args[0] 46305 if v_0.Op != OpAnd32 { 46306 break 46307 } 46308 _ = v_0.Args[1] 46309 x := v_0.Args[0] 46310 v_0_1 := v_0.Args[1] 46311 if v_0_1.Op != OpConst32 { 46312 break 46313 } 46314 y := v_0_1.AuxInt 46315 if !(y&0xFFFF == 0xFFFF) { 46316 break 46317 } 46318 v.reset(OpTrunc32to16) 46319 v.AddArg(x) 46320 return true 46321 } 46322 return false 46323 } 46324 func rewriteValuegeneric_OpTrunc32to8_0(v *Value) bool { 46325 // match: (Trunc32to8 (Const32 [c])) 46326 // result: (Const8 [int64(int8(c))]) 46327 for { 46328 v_0 := v.Args[0] 46329 if v_0.Op != OpConst32 { 46330 break 46331 } 46332 c := v_0.AuxInt 46333 v.reset(OpConst8) 46334 v.AuxInt = int64(int8(c)) 46335 return true 46336 } 46337 // match: (Trunc32to8 (ZeroExt8to32 x)) 46338 // result: x 46339 for { 46340 v_0 := v.Args[0] 46341 if v_0.Op != OpZeroExt8to32 { 46342 break 46343 } 46344 x := v_0.Args[0] 46345 v.reset(OpCopy) 46346 v.Type = x.Type 46347 v.AddArg(x) 46348 return true 46349 } 46350 // match: (Trunc32to8 (SignExt8to32 x)) 46351 // result: x 46352 for { 46353 v_0 := v.Args[0] 46354 if v_0.Op != OpSignExt8to32 { 46355 break 46356 } 46357 x := v_0.Args[0] 46358 v.reset(OpCopy) 46359 v.Type = x.Type 46360 v.AddArg(x) 46361 return true 46362 } 46363 // match: (Trunc32to8 (And32 (Const32 [y]) x)) 46364 // cond: y&0xFF == 0xFF 46365 // result: (Trunc32to8 x) 46366 for { 46367 v_0 := v.Args[0] 46368 if v_0.Op != OpAnd32 { 46369 break 46370 } 46371 x := v_0.Args[1] 46372 v_0_0 := v_0.Args[0] 46373 if v_0_0.Op != OpConst32 { 46374 break 46375 } 46376 y := v_0_0.AuxInt 46377 if !(y&0xFF == 0xFF) { 46378 break 46379 } 46380 v.reset(OpTrunc32to8) 46381 v.AddArg(x) 46382 return true 46383 } 46384 // match: (Trunc32to8 (And32 x (Const32 [y]))) 46385 // cond: y&0xFF == 0xFF 46386 // result: (Trunc32to8 x) 46387 for { 46388 v_0 := v.Args[0] 46389 if v_0.Op != OpAnd32 { 46390 break 46391 } 46392 _ = v_0.Args[1] 46393 x := v_0.Args[0] 46394 v_0_1 := v_0.Args[1] 46395 if v_0_1.Op != OpConst32 { 46396 break 46397 } 46398 y := v_0_1.AuxInt 46399 if !(y&0xFF == 0xFF) { 46400 break 46401 } 46402 v.reset(OpTrunc32to8) 46403 v.AddArg(x) 46404 return true 46405 } 46406 return false 46407 } 46408 func rewriteValuegeneric_OpTrunc64to16_0(v *Value) bool { 46409 // match: (Trunc64to16 (Const64 [c])) 46410 // result: (Const16 [int64(int16(c))]) 46411 for { 46412 v_0 := v.Args[0] 46413 if v_0.Op != OpConst64 { 46414 break 46415 } 46416 c := v_0.AuxInt 46417 v.reset(OpConst16) 46418 v.AuxInt = int64(int16(c)) 46419 return true 46420 } 46421 // match: (Trunc64to16 (ZeroExt8to64 x)) 46422 // result: (ZeroExt8to16 x) 46423 for { 46424 v_0 := v.Args[0] 46425 if v_0.Op != OpZeroExt8to64 { 46426 break 46427 } 46428 x := v_0.Args[0] 46429 v.reset(OpZeroExt8to16) 46430 v.AddArg(x) 46431 return true 46432 } 46433 // match: (Trunc64to16 (ZeroExt16to64 x)) 46434 // result: x 46435 for { 46436 v_0 := v.Args[0] 46437 if v_0.Op != OpZeroExt16to64 { 46438 break 46439 } 46440 x := v_0.Args[0] 46441 v.reset(OpCopy) 46442 v.Type = x.Type 46443 v.AddArg(x) 46444 return true 46445 } 46446 // match: (Trunc64to16 (SignExt8to64 x)) 46447 // result: (SignExt8to16 x) 46448 for { 46449 v_0 := v.Args[0] 46450 if v_0.Op != OpSignExt8to64 { 46451 break 46452 } 46453 x := v_0.Args[0] 46454 v.reset(OpSignExt8to16) 46455 v.AddArg(x) 46456 return true 46457 } 46458 // match: (Trunc64to16 (SignExt16to64 x)) 46459 // result: x 46460 for { 46461 v_0 := v.Args[0] 46462 if v_0.Op != OpSignExt16to64 { 46463 break 46464 } 46465 x := v_0.Args[0] 46466 v.reset(OpCopy) 46467 v.Type = x.Type 46468 v.AddArg(x) 46469 return true 46470 } 46471 // match: (Trunc64to16 (And64 (Const64 [y]) x)) 46472 // cond: y&0xFFFF == 0xFFFF 46473 // result: (Trunc64to16 x) 46474 for { 46475 v_0 := v.Args[0] 46476 if v_0.Op != OpAnd64 { 46477 break 46478 } 46479 x := v_0.Args[1] 46480 v_0_0 := v_0.Args[0] 46481 if v_0_0.Op != OpConst64 { 46482 break 46483 } 46484 y := v_0_0.AuxInt 46485 if !(y&0xFFFF == 0xFFFF) { 46486 break 46487 } 46488 v.reset(OpTrunc64to16) 46489 v.AddArg(x) 46490 return true 46491 } 46492 // match: (Trunc64to16 (And64 x (Const64 [y]))) 46493 // cond: y&0xFFFF == 0xFFFF 46494 // result: (Trunc64to16 x) 46495 for { 46496 v_0 := v.Args[0] 46497 if v_0.Op != OpAnd64 { 46498 break 46499 } 46500 _ = v_0.Args[1] 46501 x := v_0.Args[0] 46502 v_0_1 := v_0.Args[1] 46503 if v_0_1.Op != OpConst64 { 46504 break 46505 } 46506 y := v_0_1.AuxInt 46507 if !(y&0xFFFF == 0xFFFF) { 46508 break 46509 } 46510 v.reset(OpTrunc64to16) 46511 v.AddArg(x) 46512 return true 46513 } 46514 return false 46515 } 46516 func rewriteValuegeneric_OpTrunc64to32_0(v *Value) bool { 46517 // match: (Trunc64to32 (Const64 [c])) 46518 // result: (Const32 [int64(int32(c))]) 46519 for { 46520 v_0 := v.Args[0] 46521 if v_0.Op != OpConst64 { 46522 break 46523 } 46524 c := v_0.AuxInt 46525 v.reset(OpConst32) 46526 v.AuxInt = int64(int32(c)) 46527 return true 46528 } 46529 // match: (Trunc64to32 (ZeroExt8to64 x)) 46530 // result: (ZeroExt8to32 x) 46531 for { 46532 v_0 := v.Args[0] 46533 if v_0.Op != OpZeroExt8to64 { 46534 break 46535 } 46536 x := v_0.Args[0] 46537 v.reset(OpZeroExt8to32) 46538 v.AddArg(x) 46539 return true 46540 } 46541 // match: (Trunc64to32 (ZeroExt16to64 x)) 46542 // result: (ZeroExt16to32 x) 46543 for { 46544 v_0 := v.Args[0] 46545 if v_0.Op != OpZeroExt16to64 { 46546 break 46547 } 46548 x := v_0.Args[0] 46549 v.reset(OpZeroExt16to32) 46550 v.AddArg(x) 46551 return true 46552 } 46553 // match: (Trunc64to32 (ZeroExt32to64 x)) 46554 // result: x 46555 for { 46556 v_0 := v.Args[0] 46557 if v_0.Op != OpZeroExt32to64 { 46558 break 46559 } 46560 x := v_0.Args[0] 46561 v.reset(OpCopy) 46562 v.Type = x.Type 46563 v.AddArg(x) 46564 return true 46565 } 46566 // match: (Trunc64to32 (SignExt8to64 x)) 46567 // result: (SignExt8to32 x) 46568 for { 46569 v_0 := v.Args[0] 46570 if v_0.Op != OpSignExt8to64 { 46571 break 46572 } 46573 x := v_0.Args[0] 46574 v.reset(OpSignExt8to32) 46575 v.AddArg(x) 46576 return true 46577 } 46578 // match: (Trunc64to32 (SignExt16to64 x)) 46579 // result: (SignExt16to32 x) 46580 for { 46581 v_0 := v.Args[0] 46582 if v_0.Op != OpSignExt16to64 { 46583 break 46584 } 46585 x := v_0.Args[0] 46586 v.reset(OpSignExt16to32) 46587 v.AddArg(x) 46588 return true 46589 } 46590 // match: (Trunc64to32 (SignExt32to64 x)) 46591 // result: x 46592 for { 46593 v_0 := v.Args[0] 46594 if v_0.Op != OpSignExt32to64 { 46595 break 46596 } 46597 x := v_0.Args[0] 46598 v.reset(OpCopy) 46599 v.Type = x.Type 46600 v.AddArg(x) 46601 return true 46602 } 46603 // match: (Trunc64to32 (And64 (Const64 [y]) x)) 46604 // cond: y&0xFFFFFFFF == 0xFFFFFFFF 46605 // result: (Trunc64to32 x) 46606 for { 46607 v_0 := v.Args[0] 46608 if v_0.Op != OpAnd64 { 46609 break 46610 } 46611 x := v_0.Args[1] 46612 v_0_0 := v_0.Args[0] 46613 if v_0_0.Op != OpConst64 { 46614 break 46615 } 46616 y := v_0_0.AuxInt 46617 if !(y&0xFFFFFFFF == 0xFFFFFFFF) { 46618 break 46619 } 46620 v.reset(OpTrunc64to32) 46621 v.AddArg(x) 46622 return true 46623 } 46624 // match: (Trunc64to32 (And64 x (Const64 [y]))) 46625 // cond: y&0xFFFFFFFF == 0xFFFFFFFF 46626 // result: (Trunc64to32 x) 46627 for { 46628 v_0 := v.Args[0] 46629 if v_0.Op != OpAnd64 { 46630 break 46631 } 46632 _ = v_0.Args[1] 46633 x := v_0.Args[0] 46634 v_0_1 := v_0.Args[1] 46635 if v_0_1.Op != OpConst64 { 46636 break 46637 } 46638 y := v_0_1.AuxInt 46639 if !(y&0xFFFFFFFF == 0xFFFFFFFF) { 46640 break 46641 } 46642 v.reset(OpTrunc64to32) 46643 v.AddArg(x) 46644 return true 46645 } 46646 return false 46647 } 46648 func rewriteValuegeneric_OpTrunc64to8_0(v *Value) bool { 46649 // match: (Trunc64to8 (Const64 [c])) 46650 // result: (Const8 [int64(int8(c))]) 46651 for { 46652 v_0 := v.Args[0] 46653 if v_0.Op != OpConst64 { 46654 break 46655 } 46656 c := v_0.AuxInt 46657 v.reset(OpConst8) 46658 v.AuxInt = int64(int8(c)) 46659 return true 46660 } 46661 // match: (Trunc64to8 (ZeroExt8to64 x)) 46662 // result: x 46663 for { 46664 v_0 := v.Args[0] 46665 if v_0.Op != OpZeroExt8to64 { 46666 break 46667 } 46668 x := v_0.Args[0] 46669 v.reset(OpCopy) 46670 v.Type = x.Type 46671 v.AddArg(x) 46672 return true 46673 } 46674 // match: (Trunc64to8 (SignExt8to64 x)) 46675 // result: x 46676 for { 46677 v_0 := v.Args[0] 46678 if v_0.Op != OpSignExt8to64 { 46679 break 46680 } 46681 x := v_0.Args[0] 46682 v.reset(OpCopy) 46683 v.Type = x.Type 46684 v.AddArg(x) 46685 return true 46686 } 46687 // match: (Trunc64to8 (And64 (Const64 [y]) x)) 46688 // cond: y&0xFF == 0xFF 46689 // result: (Trunc64to8 x) 46690 for { 46691 v_0 := v.Args[0] 46692 if v_0.Op != OpAnd64 { 46693 break 46694 } 46695 x := v_0.Args[1] 46696 v_0_0 := v_0.Args[0] 46697 if v_0_0.Op != OpConst64 { 46698 break 46699 } 46700 y := v_0_0.AuxInt 46701 if !(y&0xFF == 0xFF) { 46702 break 46703 } 46704 v.reset(OpTrunc64to8) 46705 v.AddArg(x) 46706 return true 46707 } 46708 // match: (Trunc64to8 (And64 x (Const64 [y]))) 46709 // cond: y&0xFF == 0xFF 46710 // result: (Trunc64to8 x) 46711 for { 46712 v_0 := v.Args[0] 46713 if v_0.Op != OpAnd64 { 46714 break 46715 } 46716 _ = v_0.Args[1] 46717 x := v_0.Args[0] 46718 v_0_1 := v_0.Args[1] 46719 if v_0_1.Op != OpConst64 { 46720 break 46721 } 46722 y := v_0_1.AuxInt 46723 if !(y&0xFF == 0xFF) { 46724 break 46725 } 46726 v.reset(OpTrunc64to8) 46727 v.AddArg(x) 46728 return true 46729 } 46730 return false 46731 } 46732 func rewriteValuegeneric_OpXor16_0(v *Value) bool { 46733 b := v.Block 46734 // match: (Xor16 (Const16 [c]) (Const16 [d])) 46735 // result: (Const16 [int64(int16(c^d))]) 46736 for { 46737 _ = v.Args[1] 46738 v_0 := v.Args[0] 46739 if v_0.Op != OpConst16 { 46740 break 46741 } 46742 c := v_0.AuxInt 46743 v_1 := v.Args[1] 46744 if v_1.Op != OpConst16 { 46745 break 46746 } 46747 d := v_1.AuxInt 46748 v.reset(OpConst16) 46749 v.AuxInt = int64(int16(c ^ d)) 46750 return true 46751 } 46752 // match: (Xor16 (Const16 [d]) (Const16 [c])) 46753 // result: (Const16 [int64(int16(c^d))]) 46754 for { 46755 _ = v.Args[1] 46756 v_0 := v.Args[0] 46757 if v_0.Op != OpConst16 { 46758 break 46759 } 46760 d := v_0.AuxInt 46761 v_1 := v.Args[1] 46762 if v_1.Op != OpConst16 { 46763 break 46764 } 46765 c := v_1.AuxInt 46766 v.reset(OpConst16) 46767 v.AuxInt = int64(int16(c ^ d)) 46768 return true 46769 } 46770 // match: (Xor16 x x) 46771 // result: (Const16 [0]) 46772 for { 46773 x := v.Args[1] 46774 if x != v.Args[0] { 46775 break 46776 } 46777 v.reset(OpConst16) 46778 v.AuxInt = 0 46779 return true 46780 } 46781 // match: (Xor16 (Const16 [0]) x) 46782 // result: x 46783 for { 46784 x := v.Args[1] 46785 v_0 := v.Args[0] 46786 if v_0.Op != OpConst16 || v_0.AuxInt != 0 { 46787 break 46788 } 46789 v.reset(OpCopy) 46790 v.Type = x.Type 46791 v.AddArg(x) 46792 return true 46793 } 46794 // match: (Xor16 x (Const16 [0])) 46795 // result: x 46796 for { 46797 _ = v.Args[1] 46798 x := v.Args[0] 46799 v_1 := v.Args[1] 46800 if v_1.Op != OpConst16 || v_1.AuxInt != 0 { 46801 break 46802 } 46803 v.reset(OpCopy) 46804 v.Type = x.Type 46805 v.AddArg(x) 46806 return true 46807 } 46808 // match: (Xor16 x (Xor16 x y)) 46809 // result: y 46810 for { 46811 _ = v.Args[1] 46812 x := v.Args[0] 46813 v_1 := v.Args[1] 46814 if v_1.Op != OpXor16 { 46815 break 46816 } 46817 y := v_1.Args[1] 46818 if x != v_1.Args[0] { 46819 break 46820 } 46821 v.reset(OpCopy) 46822 v.Type = y.Type 46823 v.AddArg(y) 46824 return true 46825 } 46826 // match: (Xor16 x (Xor16 y x)) 46827 // result: y 46828 for { 46829 _ = v.Args[1] 46830 x := v.Args[0] 46831 v_1 := v.Args[1] 46832 if v_1.Op != OpXor16 { 46833 break 46834 } 46835 _ = v_1.Args[1] 46836 y := v_1.Args[0] 46837 if x != v_1.Args[1] { 46838 break 46839 } 46840 v.reset(OpCopy) 46841 v.Type = y.Type 46842 v.AddArg(y) 46843 return true 46844 } 46845 // match: (Xor16 (Xor16 x y) x) 46846 // result: y 46847 for { 46848 x := v.Args[1] 46849 v_0 := v.Args[0] 46850 if v_0.Op != OpXor16 { 46851 break 46852 } 46853 y := v_0.Args[1] 46854 if x != v_0.Args[0] { 46855 break 46856 } 46857 v.reset(OpCopy) 46858 v.Type = y.Type 46859 v.AddArg(y) 46860 return true 46861 } 46862 // match: (Xor16 (Xor16 y x) x) 46863 // result: y 46864 for { 46865 x := v.Args[1] 46866 v_0 := v.Args[0] 46867 if v_0.Op != OpXor16 { 46868 break 46869 } 46870 _ = v_0.Args[1] 46871 y := v_0.Args[0] 46872 if x != v_0.Args[1] { 46873 break 46874 } 46875 v.reset(OpCopy) 46876 v.Type = y.Type 46877 v.AddArg(y) 46878 return true 46879 } 46880 // match: (Xor16 (Xor16 i:(Const16 <t>) z) x) 46881 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 46882 // result: (Xor16 i (Xor16 <t> z x)) 46883 for { 46884 x := v.Args[1] 46885 v_0 := v.Args[0] 46886 if v_0.Op != OpXor16 { 46887 break 46888 } 46889 z := v_0.Args[1] 46890 i := v_0.Args[0] 46891 if i.Op != OpConst16 { 46892 break 46893 } 46894 t := i.Type 46895 if !(z.Op != OpConst16 && x.Op != OpConst16) { 46896 break 46897 } 46898 v.reset(OpXor16) 46899 v.AddArg(i) 46900 v0 := b.NewValue0(v.Pos, OpXor16, t) 46901 v0.AddArg(z) 46902 v0.AddArg(x) 46903 v.AddArg(v0) 46904 return true 46905 } 46906 return false 46907 } 46908 func rewriteValuegeneric_OpXor16_10(v *Value) bool { 46909 b := v.Block 46910 // match: (Xor16 (Xor16 z i:(Const16 <t>)) x) 46911 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 46912 // result: (Xor16 i (Xor16 <t> z x)) 46913 for { 46914 x := v.Args[1] 46915 v_0 := v.Args[0] 46916 if v_0.Op != OpXor16 { 46917 break 46918 } 46919 _ = v_0.Args[1] 46920 z := v_0.Args[0] 46921 i := v_0.Args[1] 46922 if i.Op != OpConst16 { 46923 break 46924 } 46925 t := i.Type 46926 if !(z.Op != OpConst16 && x.Op != OpConst16) { 46927 break 46928 } 46929 v.reset(OpXor16) 46930 v.AddArg(i) 46931 v0 := b.NewValue0(v.Pos, OpXor16, t) 46932 v0.AddArg(z) 46933 v0.AddArg(x) 46934 v.AddArg(v0) 46935 return true 46936 } 46937 // match: (Xor16 x (Xor16 i:(Const16 <t>) z)) 46938 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 46939 // result: (Xor16 i (Xor16 <t> z x)) 46940 for { 46941 _ = v.Args[1] 46942 x := v.Args[0] 46943 v_1 := v.Args[1] 46944 if v_1.Op != OpXor16 { 46945 break 46946 } 46947 z := v_1.Args[1] 46948 i := v_1.Args[0] 46949 if i.Op != OpConst16 { 46950 break 46951 } 46952 t := i.Type 46953 if !(z.Op != OpConst16 && x.Op != OpConst16) { 46954 break 46955 } 46956 v.reset(OpXor16) 46957 v.AddArg(i) 46958 v0 := b.NewValue0(v.Pos, OpXor16, t) 46959 v0.AddArg(z) 46960 v0.AddArg(x) 46961 v.AddArg(v0) 46962 return true 46963 } 46964 // match: (Xor16 x (Xor16 z i:(Const16 <t>))) 46965 // cond: (z.Op != OpConst16 && x.Op != OpConst16) 46966 // result: (Xor16 i (Xor16 <t> z x)) 46967 for { 46968 _ = v.Args[1] 46969 x := v.Args[0] 46970 v_1 := v.Args[1] 46971 if v_1.Op != OpXor16 { 46972 break 46973 } 46974 _ = v_1.Args[1] 46975 z := v_1.Args[0] 46976 i := v_1.Args[1] 46977 if i.Op != OpConst16 { 46978 break 46979 } 46980 t := i.Type 46981 if !(z.Op != OpConst16 && x.Op != OpConst16) { 46982 break 46983 } 46984 v.reset(OpXor16) 46985 v.AddArg(i) 46986 v0 := b.NewValue0(v.Pos, OpXor16, t) 46987 v0.AddArg(z) 46988 v0.AddArg(x) 46989 v.AddArg(v0) 46990 return true 46991 } 46992 // match: (Xor16 (Const16 <t> [c]) (Xor16 (Const16 <t> [d]) x)) 46993 // result: (Xor16 (Const16 <t> [int64(int16(c^d))]) x) 46994 for { 46995 _ = v.Args[1] 46996 v_0 := v.Args[0] 46997 if v_0.Op != OpConst16 { 46998 break 46999 } 47000 t := v_0.Type 47001 c := v_0.AuxInt 47002 v_1 := v.Args[1] 47003 if v_1.Op != OpXor16 { 47004 break 47005 } 47006 x := v_1.Args[1] 47007 v_1_0 := v_1.Args[0] 47008 if v_1_0.Op != OpConst16 || v_1_0.Type != t { 47009 break 47010 } 47011 d := v_1_0.AuxInt 47012 v.reset(OpXor16) 47013 v0 := b.NewValue0(v.Pos, OpConst16, t) 47014 v0.AuxInt = int64(int16(c ^ d)) 47015 v.AddArg(v0) 47016 v.AddArg(x) 47017 return true 47018 } 47019 // match: (Xor16 (Const16 <t> [c]) (Xor16 x (Const16 <t> [d]))) 47020 // result: (Xor16 (Const16 <t> [int64(int16(c^d))]) x) 47021 for { 47022 _ = v.Args[1] 47023 v_0 := v.Args[0] 47024 if v_0.Op != OpConst16 { 47025 break 47026 } 47027 t := v_0.Type 47028 c := v_0.AuxInt 47029 v_1 := v.Args[1] 47030 if v_1.Op != OpXor16 { 47031 break 47032 } 47033 _ = v_1.Args[1] 47034 x := v_1.Args[0] 47035 v_1_1 := v_1.Args[1] 47036 if v_1_1.Op != OpConst16 || v_1_1.Type != t { 47037 break 47038 } 47039 d := v_1_1.AuxInt 47040 v.reset(OpXor16) 47041 v0 := b.NewValue0(v.Pos, OpConst16, t) 47042 v0.AuxInt = int64(int16(c ^ d)) 47043 v.AddArg(v0) 47044 v.AddArg(x) 47045 return true 47046 } 47047 // match: (Xor16 (Xor16 (Const16 <t> [d]) x) (Const16 <t> [c])) 47048 // result: (Xor16 (Const16 <t> [int64(int16(c^d))]) x) 47049 for { 47050 _ = v.Args[1] 47051 v_0 := v.Args[0] 47052 if v_0.Op != OpXor16 { 47053 break 47054 } 47055 x := v_0.Args[1] 47056 v_0_0 := v_0.Args[0] 47057 if v_0_0.Op != OpConst16 { 47058 break 47059 } 47060 t := v_0_0.Type 47061 d := v_0_0.AuxInt 47062 v_1 := v.Args[1] 47063 if v_1.Op != OpConst16 || v_1.Type != t { 47064 break 47065 } 47066 c := v_1.AuxInt 47067 v.reset(OpXor16) 47068 v0 := b.NewValue0(v.Pos, OpConst16, t) 47069 v0.AuxInt = int64(int16(c ^ d)) 47070 v.AddArg(v0) 47071 v.AddArg(x) 47072 return true 47073 } 47074 // match: (Xor16 (Xor16 x (Const16 <t> [d])) (Const16 <t> [c])) 47075 // result: (Xor16 (Const16 <t> [int64(int16(c^d))]) x) 47076 for { 47077 _ = v.Args[1] 47078 v_0 := v.Args[0] 47079 if v_0.Op != OpXor16 { 47080 break 47081 } 47082 _ = v_0.Args[1] 47083 x := v_0.Args[0] 47084 v_0_1 := v_0.Args[1] 47085 if v_0_1.Op != OpConst16 { 47086 break 47087 } 47088 t := v_0_1.Type 47089 d := v_0_1.AuxInt 47090 v_1 := v.Args[1] 47091 if v_1.Op != OpConst16 || v_1.Type != t { 47092 break 47093 } 47094 c := v_1.AuxInt 47095 v.reset(OpXor16) 47096 v0 := b.NewValue0(v.Pos, OpConst16, t) 47097 v0.AuxInt = int64(int16(c ^ d)) 47098 v.AddArg(v0) 47099 v.AddArg(x) 47100 return true 47101 } 47102 return false 47103 } 47104 func rewriteValuegeneric_OpXor32_0(v *Value) bool { 47105 b := v.Block 47106 // match: (Xor32 (Const32 [c]) (Const32 [d])) 47107 // result: (Const32 [int64(int32(c^d))]) 47108 for { 47109 _ = v.Args[1] 47110 v_0 := v.Args[0] 47111 if v_0.Op != OpConst32 { 47112 break 47113 } 47114 c := v_0.AuxInt 47115 v_1 := v.Args[1] 47116 if v_1.Op != OpConst32 { 47117 break 47118 } 47119 d := v_1.AuxInt 47120 v.reset(OpConst32) 47121 v.AuxInt = int64(int32(c ^ d)) 47122 return true 47123 } 47124 // match: (Xor32 (Const32 [d]) (Const32 [c])) 47125 // result: (Const32 [int64(int32(c^d))]) 47126 for { 47127 _ = v.Args[1] 47128 v_0 := v.Args[0] 47129 if v_0.Op != OpConst32 { 47130 break 47131 } 47132 d := v_0.AuxInt 47133 v_1 := v.Args[1] 47134 if v_1.Op != OpConst32 { 47135 break 47136 } 47137 c := v_1.AuxInt 47138 v.reset(OpConst32) 47139 v.AuxInt = int64(int32(c ^ d)) 47140 return true 47141 } 47142 // match: (Xor32 x x) 47143 // result: (Const32 [0]) 47144 for { 47145 x := v.Args[1] 47146 if x != v.Args[0] { 47147 break 47148 } 47149 v.reset(OpConst32) 47150 v.AuxInt = 0 47151 return true 47152 } 47153 // match: (Xor32 (Const32 [0]) x) 47154 // result: x 47155 for { 47156 x := v.Args[1] 47157 v_0 := v.Args[0] 47158 if v_0.Op != OpConst32 || v_0.AuxInt != 0 { 47159 break 47160 } 47161 v.reset(OpCopy) 47162 v.Type = x.Type 47163 v.AddArg(x) 47164 return true 47165 } 47166 // match: (Xor32 x (Const32 [0])) 47167 // result: x 47168 for { 47169 _ = v.Args[1] 47170 x := v.Args[0] 47171 v_1 := v.Args[1] 47172 if v_1.Op != OpConst32 || v_1.AuxInt != 0 { 47173 break 47174 } 47175 v.reset(OpCopy) 47176 v.Type = x.Type 47177 v.AddArg(x) 47178 return true 47179 } 47180 // match: (Xor32 x (Xor32 x y)) 47181 // result: y 47182 for { 47183 _ = v.Args[1] 47184 x := v.Args[0] 47185 v_1 := v.Args[1] 47186 if v_1.Op != OpXor32 { 47187 break 47188 } 47189 y := v_1.Args[1] 47190 if x != v_1.Args[0] { 47191 break 47192 } 47193 v.reset(OpCopy) 47194 v.Type = y.Type 47195 v.AddArg(y) 47196 return true 47197 } 47198 // match: (Xor32 x (Xor32 y x)) 47199 // result: y 47200 for { 47201 _ = v.Args[1] 47202 x := v.Args[0] 47203 v_1 := v.Args[1] 47204 if v_1.Op != OpXor32 { 47205 break 47206 } 47207 _ = v_1.Args[1] 47208 y := v_1.Args[0] 47209 if x != v_1.Args[1] { 47210 break 47211 } 47212 v.reset(OpCopy) 47213 v.Type = y.Type 47214 v.AddArg(y) 47215 return true 47216 } 47217 // match: (Xor32 (Xor32 x y) x) 47218 // result: y 47219 for { 47220 x := v.Args[1] 47221 v_0 := v.Args[0] 47222 if v_0.Op != OpXor32 { 47223 break 47224 } 47225 y := v_0.Args[1] 47226 if x != v_0.Args[0] { 47227 break 47228 } 47229 v.reset(OpCopy) 47230 v.Type = y.Type 47231 v.AddArg(y) 47232 return true 47233 } 47234 // match: (Xor32 (Xor32 y x) x) 47235 // result: y 47236 for { 47237 x := v.Args[1] 47238 v_0 := v.Args[0] 47239 if v_0.Op != OpXor32 { 47240 break 47241 } 47242 _ = v_0.Args[1] 47243 y := v_0.Args[0] 47244 if x != v_0.Args[1] { 47245 break 47246 } 47247 v.reset(OpCopy) 47248 v.Type = y.Type 47249 v.AddArg(y) 47250 return true 47251 } 47252 // match: (Xor32 (Xor32 i:(Const32 <t>) z) x) 47253 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 47254 // result: (Xor32 i (Xor32 <t> z x)) 47255 for { 47256 x := v.Args[1] 47257 v_0 := v.Args[0] 47258 if v_0.Op != OpXor32 { 47259 break 47260 } 47261 z := v_0.Args[1] 47262 i := v_0.Args[0] 47263 if i.Op != OpConst32 { 47264 break 47265 } 47266 t := i.Type 47267 if !(z.Op != OpConst32 && x.Op != OpConst32) { 47268 break 47269 } 47270 v.reset(OpXor32) 47271 v.AddArg(i) 47272 v0 := b.NewValue0(v.Pos, OpXor32, t) 47273 v0.AddArg(z) 47274 v0.AddArg(x) 47275 v.AddArg(v0) 47276 return true 47277 } 47278 return false 47279 } 47280 func rewriteValuegeneric_OpXor32_10(v *Value) bool { 47281 b := v.Block 47282 // match: (Xor32 (Xor32 z i:(Const32 <t>)) x) 47283 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 47284 // result: (Xor32 i (Xor32 <t> z x)) 47285 for { 47286 x := v.Args[1] 47287 v_0 := v.Args[0] 47288 if v_0.Op != OpXor32 { 47289 break 47290 } 47291 _ = v_0.Args[1] 47292 z := v_0.Args[0] 47293 i := v_0.Args[1] 47294 if i.Op != OpConst32 { 47295 break 47296 } 47297 t := i.Type 47298 if !(z.Op != OpConst32 && x.Op != OpConst32) { 47299 break 47300 } 47301 v.reset(OpXor32) 47302 v.AddArg(i) 47303 v0 := b.NewValue0(v.Pos, OpXor32, t) 47304 v0.AddArg(z) 47305 v0.AddArg(x) 47306 v.AddArg(v0) 47307 return true 47308 } 47309 // match: (Xor32 x (Xor32 i:(Const32 <t>) z)) 47310 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 47311 // result: (Xor32 i (Xor32 <t> z x)) 47312 for { 47313 _ = v.Args[1] 47314 x := v.Args[0] 47315 v_1 := v.Args[1] 47316 if v_1.Op != OpXor32 { 47317 break 47318 } 47319 z := v_1.Args[1] 47320 i := v_1.Args[0] 47321 if i.Op != OpConst32 { 47322 break 47323 } 47324 t := i.Type 47325 if !(z.Op != OpConst32 && x.Op != OpConst32) { 47326 break 47327 } 47328 v.reset(OpXor32) 47329 v.AddArg(i) 47330 v0 := b.NewValue0(v.Pos, OpXor32, t) 47331 v0.AddArg(z) 47332 v0.AddArg(x) 47333 v.AddArg(v0) 47334 return true 47335 } 47336 // match: (Xor32 x (Xor32 z i:(Const32 <t>))) 47337 // cond: (z.Op != OpConst32 && x.Op != OpConst32) 47338 // result: (Xor32 i (Xor32 <t> z x)) 47339 for { 47340 _ = v.Args[1] 47341 x := v.Args[0] 47342 v_1 := v.Args[1] 47343 if v_1.Op != OpXor32 { 47344 break 47345 } 47346 _ = v_1.Args[1] 47347 z := v_1.Args[0] 47348 i := v_1.Args[1] 47349 if i.Op != OpConst32 { 47350 break 47351 } 47352 t := i.Type 47353 if !(z.Op != OpConst32 && x.Op != OpConst32) { 47354 break 47355 } 47356 v.reset(OpXor32) 47357 v.AddArg(i) 47358 v0 := b.NewValue0(v.Pos, OpXor32, t) 47359 v0.AddArg(z) 47360 v0.AddArg(x) 47361 v.AddArg(v0) 47362 return true 47363 } 47364 // match: (Xor32 (Const32 <t> [c]) (Xor32 (Const32 <t> [d]) x)) 47365 // result: (Xor32 (Const32 <t> [int64(int32(c^d))]) x) 47366 for { 47367 _ = v.Args[1] 47368 v_0 := v.Args[0] 47369 if v_0.Op != OpConst32 { 47370 break 47371 } 47372 t := v_0.Type 47373 c := v_0.AuxInt 47374 v_1 := v.Args[1] 47375 if v_1.Op != OpXor32 { 47376 break 47377 } 47378 x := v_1.Args[1] 47379 v_1_0 := v_1.Args[0] 47380 if v_1_0.Op != OpConst32 || v_1_0.Type != t { 47381 break 47382 } 47383 d := v_1_0.AuxInt 47384 v.reset(OpXor32) 47385 v0 := b.NewValue0(v.Pos, OpConst32, t) 47386 v0.AuxInt = int64(int32(c ^ d)) 47387 v.AddArg(v0) 47388 v.AddArg(x) 47389 return true 47390 } 47391 // match: (Xor32 (Const32 <t> [c]) (Xor32 x (Const32 <t> [d]))) 47392 // result: (Xor32 (Const32 <t> [int64(int32(c^d))]) x) 47393 for { 47394 _ = v.Args[1] 47395 v_0 := v.Args[0] 47396 if v_0.Op != OpConst32 { 47397 break 47398 } 47399 t := v_0.Type 47400 c := v_0.AuxInt 47401 v_1 := v.Args[1] 47402 if v_1.Op != OpXor32 { 47403 break 47404 } 47405 _ = v_1.Args[1] 47406 x := v_1.Args[0] 47407 v_1_1 := v_1.Args[1] 47408 if v_1_1.Op != OpConst32 || v_1_1.Type != t { 47409 break 47410 } 47411 d := v_1_1.AuxInt 47412 v.reset(OpXor32) 47413 v0 := b.NewValue0(v.Pos, OpConst32, t) 47414 v0.AuxInt = int64(int32(c ^ d)) 47415 v.AddArg(v0) 47416 v.AddArg(x) 47417 return true 47418 } 47419 // match: (Xor32 (Xor32 (Const32 <t> [d]) x) (Const32 <t> [c])) 47420 // result: (Xor32 (Const32 <t> [int64(int32(c^d))]) x) 47421 for { 47422 _ = v.Args[1] 47423 v_0 := v.Args[0] 47424 if v_0.Op != OpXor32 { 47425 break 47426 } 47427 x := v_0.Args[1] 47428 v_0_0 := v_0.Args[0] 47429 if v_0_0.Op != OpConst32 { 47430 break 47431 } 47432 t := v_0_0.Type 47433 d := v_0_0.AuxInt 47434 v_1 := v.Args[1] 47435 if v_1.Op != OpConst32 || v_1.Type != t { 47436 break 47437 } 47438 c := v_1.AuxInt 47439 v.reset(OpXor32) 47440 v0 := b.NewValue0(v.Pos, OpConst32, t) 47441 v0.AuxInt = int64(int32(c ^ d)) 47442 v.AddArg(v0) 47443 v.AddArg(x) 47444 return true 47445 } 47446 // match: (Xor32 (Xor32 x (Const32 <t> [d])) (Const32 <t> [c])) 47447 // result: (Xor32 (Const32 <t> [int64(int32(c^d))]) x) 47448 for { 47449 _ = v.Args[1] 47450 v_0 := v.Args[0] 47451 if v_0.Op != OpXor32 { 47452 break 47453 } 47454 _ = v_0.Args[1] 47455 x := v_0.Args[0] 47456 v_0_1 := v_0.Args[1] 47457 if v_0_1.Op != OpConst32 { 47458 break 47459 } 47460 t := v_0_1.Type 47461 d := v_0_1.AuxInt 47462 v_1 := v.Args[1] 47463 if v_1.Op != OpConst32 || v_1.Type != t { 47464 break 47465 } 47466 c := v_1.AuxInt 47467 v.reset(OpXor32) 47468 v0 := b.NewValue0(v.Pos, OpConst32, t) 47469 v0.AuxInt = int64(int32(c ^ d)) 47470 v.AddArg(v0) 47471 v.AddArg(x) 47472 return true 47473 } 47474 return false 47475 } 47476 func rewriteValuegeneric_OpXor64_0(v *Value) bool { 47477 b := v.Block 47478 // match: (Xor64 (Const64 [c]) (Const64 [d])) 47479 // result: (Const64 [c^d]) 47480 for { 47481 _ = v.Args[1] 47482 v_0 := v.Args[0] 47483 if v_0.Op != OpConst64 { 47484 break 47485 } 47486 c := v_0.AuxInt 47487 v_1 := v.Args[1] 47488 if v_1.Op != OpConst64 { 47489 break 47490 } 47491 d := v_1.AuxInt 47492 v.reset(OpConst64) 47493 v.AuxInt = c ^ d 47494 return true 47495 } 47496 // match: (Xor64 (Const64 [d]) (Const64 [c])) 47497 // result: (Const64 [c^d]) 47498 for { 47499 _ = v.Args[1] 47500 v_0 := v.Args[0] 47501 if v_0.Op != OpConst64 { 47502 break 47503 } 47504 d := v_0.AuxInt 47505 v_1 := v.Args[1] 47506 if v_1.Op != OpConst64 { 47507 break 47508 } 47509 c := v_1.AuxInt 47510 v.reset(OpConst64) 47511 v.AuxInt = c ^ d 47512 return true 47513 } 47514 // match: (Xor64 x x) 47515 // result: (Const64 [0]) 47516 for { 47517 x := v.Args[1] 47518 if x != v.Args[0] { 47519 break 47520 } 47521 v.reset(OpConst64) 47522 v.AuxInt = 0 47523 return true 47524 } 47525 // match: (Xor64 (Const64 [0]) x) 47526 // result: x 47527 for { 47528 x := v.Args[1] 47529 v_0 := v.Args[0] 47530 if v_0.Op != OpConst64 || v_0.AuxInt != 0 { 47531 break 47532 } 47533 v.reset(OpCopy) 47534 v.Type = x.Type 47535 v.AddArg(x) 47536 return true 47537 } 47538 // match: (Xor64 x (Const64 [0])) 47539 // result: x 47540 for { 47541 _ = v.Args[1] 47542 x := v.Args[0] 47543 v_1 := v.Args[1] 47544 if v_1.Op != OpConst64 || v_1.AuxInt != 0 { 47545 break 47546 } 47547 v.reset(OpCopy) 47548 v.Type = x.Type 47549 v.AddArg(x) 47550 return true 47551 } 47552 // match: (Xor64 x (Xor64 x y)) 47553 // result: y 47554 for { 47555 _ = v.Args[1] 47556 x := v.Args[0] 47557 v_1 := v.Args[1] 47558 if v_1.Op != OpXor64 { 47559 break 47560 } 47561 y := v_1.Args[1] 47562 if x != v_1.Args[0] { 47563 break 47564 } 47565 v.reset(OpCopy) 47566 v.Type = y.Type 47567 v.AddArg(y) 47568 return true 47569 } 47570 // match: (Xor64 x (Xor64 y x)) 47571 // result: y 47572 for { 47573 _ = v.Args[1] 47574 x := v.Args[0] 47575 v_1 := v.Args[1] 47576 if v_1.Op != OpXor64 { 47577 break 47578 } 47579 _ = v_1.Args[1] 47580 y := v_1.Args[0] 47581 if x != v_1.Args[1] { 47582 break 47583 } 47584 v.reset(OpCopy) 47585 v.Type = y.Type 47586 v.AddArg(y) 47587 return true 47588 } 47589 // match: (Xor64 (Xor64 x y) x) 47590 // result: y 47591 for { 47592 x := v.Args[1] 47593 v_0 := v.Args[0] 47594 if v_0.Op != OpXor64 { 47595 break 47596 } 47597 y := v_0.Args[1] 47598 if x != v_0.Args[0] { 47599 break 47600 } 47601 v.reset(OpCopy) 47602 v.Type = y.Type 47603 v.AddArg(y) 47604 return true 47605 } 47606 // match: (Xor64 (Xor64 y x) x) 47607 // result: y 47608 for { 47609 x := v.Args[1] 47610 v_0 := v.Args[0] 47611 if v_0.Op != OpXor64 { 47612 break 47613 } 47614 _ = v_0.Args[1] 47615 y := v_0.Args[0] 47616 if x != v_0.Args[1] { 47617 break 47618 } 47619 v.reset(OpCopy) 47620 v.Type = y.Type 47621 v.AddArg(y) 47622 return true 47623 } 47624 // match: (Xor64 (Xor64 i:(Const64 <t>) z) x) 47625 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 47626 // result: (Xor64 i (Xor64 <t> z x)) 47627 for { 47628 x := v.Args[1] 47629 v_0 := v.Args[0] 47630 if v_0.Op != OpXor64 { 47631 break 47632 } 47633 z := v_0.Args[1] 47634 i := v_0.Args[0] 47635 if i.Op != OpConst64 { 47636 break 47637 } 47638 t := i.Type 47639 if !(z.Op != OpConst64 && x.Op != OpConst64) { 47640 break 47641 } 47642 v.reset(OpXor64) 47643 v.AddArg(i) 47644 v0 := b.NewValue0(v.Pos, OpXor64, t) 47645 v0.AddArg(z) 47646 v0.AddArg(x) 47647 v.AddArg(v0) 47648 return true 47649 } 47650 return false 47651 } 47652 func rewriteValuegeneric_OpXor64_10(v *Value) bool { 47653 b := v.Block 47654 // match: (Xor64 (Xor64 z i:(Const64 <t>)) x) 47655 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 47656 // result: (Xor64 i (Xor64 <t> z x)) 47657 for { 47658 x := v.Args[1] 47659 v_0 := v.Args[0] 47660 if v_0.Op != OpXor64 { 47661 break 47662 } 47663 _ = v_0.Args[1] 47664 z := v_0.Args[0] 47665 i := v_0.Args[1] 47666 if i.Op != OpConst64 { 47667 break 47668 } 47669 t := i.Type 47670 if !(z.Op != OpConst64 && x.Op != OpConst64) { 47671 break 47672 } 47673 v.reset(OpXor64) 47674 v.AddArg(i) 47675 v0 := b.NewValue0(v.Pos, OpXor64, t) 47676 v0.AddArg(z) 47677 v0.AddArg(x) 47678 v.AddArg(v0) 47679 return true 47680 } 47681 // match: (Xor64 x (Xor64 i:(Const64 <t>) z)) 47682 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 47683 // result: (Xor64 i (Xor64 <t> z x)) 47684 for { 47685 _ = v.Args[1] 47686 x := v.Args[0] 47687 v_1 := v.Args[1] 47688 if v_1.Op != OpXor64 { 47689 break 47690 } 47691 z := v_1.Args[1] 47692 i := v_1.Args[0] 47693 if i.Op != OpConst64 { 47694 break 47695 } 47696 t := i.Type 47697 if !(z.Op != OpConst64 && x.Op != OpConst64) { 47698 break 47699 } 47700 v.reset(OpXor64) 47701 v.AddArg(i) 47702 v0 := b.NewValue0(v.Pos, OpXor64, t) 47703 v0.AddArg(z) 47704 v0.AddArg(x) 47705 v.AddArg(v0) 47706 return true 47707 } 47708 // match: (Xor64 x (Xor64 z i:(Const64 <t>))) 47709 // cond: (z.Op != OpConst64 && x.Op != OpConst64) 47710 // result: (Xor64 i (Xor64 <t> z x)) 47711 for { 47712 _ = v.Args[1] 47713 x := v.Args[0] 47714 v_1 := v.Args[1] 47715 if v_1.Op != OpXor64 { 47716 break 47717 } 47718 _ = v_1.Args[1] 47719 z := v_1.Args[0] 47720 i := v_1.Args[1] 47721 if i.Op != OpConst64 { 47722 break 47723 } 47724 t := i.Type 47725 if !(z.Op != OpConst64 && x.Op != OpConst64) { 47726 break 47727 } 47728 v.reset(OpXor64) 47729 v.AddArg(i) 47730 v0 := b.NewValue0(v.Pos, OpXor64, t) 47731 v0.AddArg(z) 47732 v0.AddArg(x) 47733 v.AddArg(v0) 47734 return true 47735 } 47736 // match: (Xor64 (Const64 <t> [c]) (Xor64 (Const64 <t> [d]) x)) 47737 // result: (Xor64 (Const64 <t> [c^d]) x) 47738 for { 47739 _ = v.Args[1] 47740 v_0 := v.Args[0] 47741 if v_0.Op != OpConst64 { 47742 break 47743 } 47744 t := v_0.Type 47745 c := v_0.AuxInt 47746 v_1 := v.Args[1] 47747 if v_1.Op != OpXor64 { 47748 break 47749 } 47750 x := v_1.Args[1] 47751 v_1_0 := v_1.Args[0] 47752 if v_1_0.Op != OpConst64 || v_1_0.Type != t { 47753 break 47754 } 47755 d := v_1_0.AuxInt 47756 v.reset(OpXor64) 47757 v0 := b.NewValue0(v.Pos, OpConst64, t) 47758 v0.AuxInt = c ^ d 47759 v.AddArg(v0) 47760 v.AddArg(x) 47761 return true 47762 } 47763 // match: (Xor64 (Const64 <t> [c]) (Xor64 x (Const64 <t> [d]))) 47764 // result: (Xor64 (Const64 <t> [c^d]) x) 47765 for { 47766 _ = v.Args[1] 47767 v_0 := v.Args[0] 47768 if v_0.Op != OpConst64 { 47769 break 47770 } 47771 t := v_0.Type 47772 c := v_0.AuxInt 47773 v_1 := v.Args[1] 47774 if v_1.Op != OpXor64 { 47775 break 47776 } 47777 _ = v_1.Args[1] 47778 x := v_1.Args[0] 47779 v_1_1 := v_1.Args[1] 47780 if v_1_1.Op != OpConst64 || v_1_1.Type != t { 47781 break 47782 } 47783 d := v_1_1.AuxInt 47784 v.reset(OpXor64) 47785 v0 := b.NewValue0(v.Pos, OpConst64, t) 47786 v0.AuxInt = c ^ d 47787 v.AddArg(v0) 47788 v.AddArg(x) 47789 return true 47790 } 47791 // match: (Xor64 (Xor64 (Const64 <t> [d]) x) (Const64 <t> [c])) 47792 // result: (Xor64 (Const64 <t> [c^d]) x) 47793 for { 47794 _ = v.Args[1] 47795 v_0 := v.Args[0] 47796 if v_0.Op != OpXor64 { 47797 break 47798 } 47799 x := v_0.Args[1] 47800 v_0_0 := v_0.Args[0] 47801 if v_0_0.Op != OpConst64 { 47802 break 47803 } 47804 t := v_0_0.Type 47805 d := v_0_0.AuxInt 47806 v_1 := v.Args[1] 47807 if v_1.Op != OpConst64 || v_1.Type != t { 47808 break 47809 } 47810 c := v_1.AuxInt 47811 v.reset(OpXor64) 47812 v0 := b.NewValue0(v.Pos, OpConst64, t) 47813 v0.AuxInt = c ^ d 47814 v.AddArg(v0) 47815 v.AddArg(x) 47816 return true 47817 } 47818 // match: (Xor64 (Xor64 x (Const64 <t> [d])) (Const64 <t> [c])) 47819 // result: (Xor64 (Const64 <t> [c^d]) x) 47820 for { 47821 _ = v.Args[1] 47822 v_0 := v.Args[0] 47823 if v_0.Op != OpXor64 { 47824 break 47825 } 47826 _ = v_0.Args[1] 47827 x := v_0.Args[0] 47828 v_0_1 := v_0.Args[1] 47829 if v_0_1.Op != OpConst64 { 47830 break 47831 } 47832 t := v_0_1.Type 47833 d := v_0_1.AuxInt 47834 v_1 := v.Args[1] 47835 if v_1.Op != OpConst64 || v_1.Type != t { 47836 break 47837 } 47838 c := v_1.AuxInt 47839 v.reset(OpXor64) 47840 v0 := b.NewValue0(v.Pos, OpConst64, t) 47841 v0.AuxInt = c ^ d 47842 v.AddArg(v0) 47843 v.AddArg(x) 47844 return true 47845 } 47846 return false 47847 } 47848 func rewriteValuegeneric_OpXor8_0(v *Value) bool { 47849 b := v.Block 47850 // match: (Xor8 (Const8 [c]) (Const8 [d])) 47851 // result: (Const8 [int64(int8(c^d))]) 47852 for { 47853 _ = v.Args[1] 47854 v_0 := v.Args[0] 47855 if v_0.Op != OpConst8 { 47856 break 47857 } 47858 c := v_0.AuxInt 47859 v_1 := v.Args[1] 47860 if v_1.Op != OpConst8 { 47861 break 47862 } 47863 d := v_1.AuxInt 47864 v.reset(OpConst8) 47865 v.AuxInt = int64(int8(c ^ d)) 47866 return true 47867 } 47868 // match: (Xor8 (Const8 [d]) (Const8 [c])) 47869 // result: (Const8 [int64(int8(c^d))]) 47870 for { 47871 _ = v.Args[1] 47872 v_0 := v.Args[0] 47873 if v_0.Op != OpConst8 { 47874 break 47875 } 47876 d := v_0.AuxInt 47877 v_1 := v.Args[1] 47878 if v_1.Op != OpConst8 { 47879 break 47880 } 47881 c := v_1.AuxInt 47882 v.reset(OpConst8) 47883 v.AuxInt = int64(int8(c ^ d)) 47884 return true 47885 } 47886 // match: (Xor8 x x) 47887 // result: (Const8 [0]) 47888 for { 47889 x := v.Args[1] 47890 if x != v.Args[0] { 47891 break 47892 } 47893 v.reset(OpConst8) 47894 v.AuxInt = 0 47895 return true 47896 } 47897 // match: (Xor8 (Const8 [0]) x) 47898 // result: x 47899 for { 47900 x := v.Args[1] 47901 v_0 := v.Args[0] 47902 if v_0.Op != OpConst8 || v_0.AuxInt != 0 { 47903 break 47904 } 47905 v.reset(OpCopy) 47906 v.Type = x.Type 47907 v.AddArg(x) 47908 return true 47909 } 47910 // match: (Xor8 x (Const8 [0])) 47911 // result: x 47912 for { 47913 _ = v.Args[1] 47914 x := v.Args[0] 47915 v_1 := v.Args[1] 47916 if v_1.Op != OpConst8 || v_1.AuxInt != 0 { 47917 break 47918 } 47919 v.reset(OpCopy) 47920 v.Type = x.Type 47921 v.AddArg(x) 47922 return true 47923 } 47924 // match: (Xor8 x (Xor8 x y)) 47925 // result: y 47926 for { 47927 _ = v.Args[1] 47928 x := v.Args[0] 47929 v_1 := v.Args[1] 47930 if v_1.Op != OpXor8 { 47931 break 47932 } 47933 y := v_1.Args[1] 47934 if x != v_1.Args[0] { 47935 break 47936 } 47937 v.reset(OpCopy) 47938 v.Type = y.Type 47939 v.AddArg(y) 47940 return true 47941 } 47942 // match: (Xor8 x (Xor8 y x)) 47943 // result: y 47944 for { 47945 _ = v.Args[1] 47946 x := v.Args[0] 47947 v_1 := v.Args[1] 47948 if v_1.Op != OpXor8 { 47949 break 47950 } 47951 _ = v_1.Args[1] 47952 y := v_1.Args[0] 47953 if x != v_1.Args[1] { 47954 break 47955 } 47956 v.reset(OpCopy) 47957 v.Type = y.Type 47958 v.AddArg(y) 47959 return true 47960 } 47961 // match: (Xor8 (Xor8 x y) x) 47962 // result: y 47963 for { 47964 x := v.Args[1] 47965 v_0 := v.Args[0] 47966 if v_0.Op != OpXor8 { 47967 break 47968 } 47969 y := v_0.Args[1] 47970 if x != v_0.Args[0] { 47971 break 47972 } 47973 v.reset(OpCopy) 47974 v.Type = y.Type 47975 v.AddArg(y) 47976 return true 47977 } 47978 // match: (Xor8 (Xor8 y x) x) 47979 // result: y 47980 for { 47981 x := v.Args[1] 47982 v_0 := v.Args[0] 47983 if v_0.Op != OpXor8 { 47984 break 47985 } 47986 _ = v_0.Args[1] 47987 y := v_0.Args[0] 47988 if x != v_0.Args[1] { 47989 break 47990 } 47991 v.reset(OpCopy) 47992 v.Type = y.Type 47993 v.AddArg(y) 47994 return true 47995 } 47996 // match: (Xor8 (Xor8 i:(Const8 <t>) z) x) 47997 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 47998 // result: (Xor8 i (Xor8 <t> z x)) 47999 for { 48000 x := v.Args[1] 48001 v_0 := v.Args[0] 48002 if v_0.Op != OpXor8 { 48003 break 48004 } 48005 z := v_0.Args[1] 48006 i := v_0.Args[0] 48007 if i.Op != OpConst8 { 48008 break 48009 } 48010 t := i.Type 48011 if !(z.Op != OpConst8 && x.Op != OpConst8) { 48012 break 48013 } 48014 v.reset(OpXor8) 48015 v.AddArg(i) 48016 v0 := b.NewValue0(v.Pos, OpXor8, t) 48017 v0.AddArg(z) 48018 v0.AddArg(x) 48019 v.AddArg(v0) 48020 return true 48021 } 48022 return false 48023 } 48024 func rewriteValuegeneric_OpXor8_10(v *Value) bool { 48025 b := v.Block 48026 // match: (Xor8 (Xor8 z i:(Const8 <t>)) x) 48027 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 48028 // result: (Xor8 i (Xor8 <t> z x)) 48029 for { 48030 x := v.Args[1] 48031 v_0 := v.Args[0] 48032 if v_0.Op != OpXor8 { 48033 break 48034 } 48035 _ = v_0.Args[1] 48036 z := v_0.Args[0] 48037 i := v_0.Args[1] 48038 if i.Op != OpConst8 { 48039 break 48040 } 48041 t := i.Type 48042 if !(z.Op != OpConst8 && x.Op != OpConst8) { 48043 break 48044 } 48045 v.reset(OpXor8) 48046 v.AddArg(i) 48047 v0 := b.NewValue0(v.Pos, OpXor8, t) 48048 v0.AddArg(z) 48049 v0.AddArg(x) 48050 v.AddArg(v0) 48051 return true 48052 } 48053 // match: (Xor8 x (Xor8 i:(Const8 <t>) z)) 48054 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 48055 // result: (Xor8 i (Xor8 <t> z x)) 48056 for { 48057 _ = v.Args[1] 48058 x := v.Args[0] 48059 v_1 := v.Args[1] 48060 if v_1.Op != OpXor8 { 48061 break 48062 } 48063 z := v_1.Args[1] 48064 i := v_1.Args[0] 48065 if i.Op != OpConst8 { 48066 break 48067 } 48068 t := i.Type 48069 if !(z.Op != OpConst8 && x.Op != OpConst8) { 48070 break 48071 } 48072 v.reset(OpXor8) 48073 v.AddArg(i) 48074 v0 := b.NewValue0(v.Pos, OpXor8, t) 48075 v0.AddArg(z) 48076 v0.AddArg(x) 48077 v.AddArg(v0) 48078 return true 48079 } 48080 // match: (Xor8 x (Xor8 z i:(Const8 <t>))) 48081 // cond: (z.Op != OpConst8 && x.Op != OpConst8) 48082 // result: (Xor8 i (Xor8 <t> z x)) 48083 for { 48084 _ = v.Args[1] 48085 x := v.Args[0] 48086 v_1 := v.Args[1] 48087 if v_1.Op != OpXor8 { 48088 break 48089 } 48090 _ = v_1.Args[1] 48091 z := v_1.Args[0] 48092 i := v_1.Args[1] 48093 if i.Op != OpConst8 { 48094 break 48095 } 48096 t := i.Type 48097 if !(z.Op != OpConst8 && x.Op != OpConst8) { 48098 break 48099 } 48100 v.reset(OpXor8) 48101 v.AddArg(i) 48102 v0 := b.NewValue0(v.Pos, OpXor8, t) 48103 v0.AddArg(z) 48104 v0.AddArg(x) 48105 v.AddArg(v0) 48106 return true 48107 } 48108 // match: (Xor8 (Const8 <t> [c]) (Xor8 (Const8 <t> [d]) x)) 48109 // result: (Xor8 (Const8 <t> [int64(int8(c^d))]) x) 48110 for { 48111 _ = v.Args[1] 48112 v_0 := v.Args[0] 48113 if v_0.Op != OpConst8 { 48114 break 48115 } 48116 t := v_0.Type 48117 c := v_0.AuxInt 48118 v_1 := v.Args[1] 48119 if v_1.Op != OpXor8 { 48120 break 48121 } 48122 x := v_1.Args[1] 48123 v_1_0 := v_1.Args[0] 48124 if v_1_0.Op != OpConst8 || v_1_0.Type != t { 48125 break 48126 } 48127 d := v_1_0.AuxInt 48128 v.reset(OpXor8) 48129 v0 := b.NewValue0(v.Pos, OpConst8, t) 48130 v0.AuxInt = int64(int8(c ^ d)) 48131 v.AddArg(v0) 48132 v.AddArg(x) 48133 return true 48134 } 48135 // match: (Xor8 (Const8 <t> [c]) (Xor8 x (Const8 <t> [d]))) 48136 // result: (Xor8 (Const8 <t> [int64(int8(c^d))]) x) 48137 for { 48138 _ = v.Args[1] 48139 v_0 := v.Args[0] 48140 if v_0.Op != OpConst8 { 48141 break 48142 } 48143 t := v_0.Type 48144 c := v_0.AuxInt 48145 v_1 := v.Args[1] 48146 if v_1.Op != OpXor8 { 48147 break 48148 } 48149 _ = v_1.Args[1] 48150 x := v_1.Args[0] 48151 v_1_1 := v_1.Args[1] 48152 if v_1_1.Op != OpConst8 || v_1_1.Type != t { 48153 break 48154 } 48155 d := v_1_1.AuxInt 48156 v.reset(OpXor8) 48157 v0 := b.NewValue0(v.Pos, OpConst8, t) 48158 v0.AuxInt = int64(int8(c ^ d)) 48159 v.AddArg(v0) 48160 v.AddArg(x) 48161 return true 48162 } 48163 // match: (Xor8 (Xor8 (Const8 <t> [d]) x) (Const8 <t> [c])) 48164 // result: (Xor8 (Const8 <t> [int64(int8(c^d))]) x) 48165 for { 48166 _ = v.Args[1] 48167 v_0 := v.Args[0] 48168 if v_0.Op != OpXor8 { 48169 break 48170 } 48171 x := v_0.Args[1] 48172 v_0_0 := v_0.Args[0] 48173 if v_0_0.Op != OpConst8 { 48174 break 48175 } 48176 t := v_0_0.Type 48177 d := v_0_0.AuxInt 48178 v_1 := v.Args[1] 48179 if v_1.Op != OpConst8 || v_1.Type != t { 48180 break 48181 } 48182 c := v_1.AuxInt 48183 v.reset(OpXor8) 48184 v0 := b.NewValue0(v.Pos, OpConst8, t) 48185 v0.AuxInt = int64(int8(c ^ d)) 48186 v.AddArg(v0) 48187 v.AddArg(x) 48188 return true 48189 } 48190 // match: (Xor8 (Xor8 x (Const8 <t> [d])) (Const8 <t> [c])) 48191 // result: (Xor8 (Const8 <t> [int64(int8(c^d))]) x) 48192 for { 48193 _ = v.Args[1] 48194 v_0 := v.Args[0] 48195 if v_0.Op != OpXor8 { 48196 break 48197 } 48198 _ = v_0.Args[1] 48199 x := v_0.Args[0] 48200 v_0_1 := v_0.Args[1] 48201 if v_0_1.Op != OpConst8 { 48202 break 48203 } 48204 t := v_0_1.Type 48205 d := v_0_1.AuxInt 48206 v_1 := v.Args[1] 48207 if v_1.Op != OpConst8 || v_1.Type != t { 48208 break 48209 } 48210 c := v_1.AuxInt 48211 v.reset(OpXor8) 48212 v0 := b.NewValue0(v.Pos, OpConst8, t) 48213 v0.AuxInt = int64(int8(c ^ d)) 48214 v.AddArg(v0) 48215 v.AddArg(x) 48216 return true 48217 } 48218 return false 48219 } 48220 func rewriteValuegeneric_OpZero_0(v *Value) bool { 48221 b := v.Block 48222 config := b.Func.Config 48223 // match: (Zero (Load (OffPtr [c] (SP)) mem) mem) 48224 // cond: mem.Op == OpStaticCall && isSameSym(mem.Aux, "runtime.newobject") && c == config.ctxt.FixedFrameSize() + config.RegSize 48225 // result: mem 48226 for { 48227 mem := v.Args[1] 48228 v_0 := v.Args[0] 48229 if v_0.Op != OpLoad { 48230 break 48231 } 48232 _ = v_0.Args[1] 48233 v_0_0 := v_0.Args[0] 48234 if v_0_0.Op != OpOffPtr { 48235 break 48236 } 48237 c := v_0_0.AuxInt 48238 v_0_0_0 := v_0_0.Args[0] 48239 if v_0_0_0.Op != OpSP || mem != v_0.Args[1] || !(mem.Op == OpStaticCall && isSameSym(mem.Aux, "runtime.newobject") && c == config.ctxt.FixedFrameSize()+config.RegSize) { 48240 break 48241 } 48242 v.reset(OpCopy) 48243 v.Type = mem.Type 48244 v.AddArg(mem) 48245 return true 48246 } 48247 // match: (Zero {t1} [n] p1 store:(Store {t2} (OffPtr [o2] p2) _ mem)) 48248 // cond: isSamePtr(p1, p2) && store.Uses == 1 && n >= o2 + sizeof(t2) && clobber(store) 48249 // result: (Zero {t1} [n] p1 mem) 48250 for { 48251 n := v.AuxInt 48252 t1 := v.Aux 48253 _ = v.Args[1] 48254 p1 := v.Args[0] 48255 store := v.Args[1] 48256 if store.Op != OpStore { 48257 break 48258 } 48259 t2 := store.Aux 48260 mem := store.Args[2] 48261 store_0 := store.Args[0] 48262 if store_0.Op != OpOffPtr { 48263 break 48264 } 48265 o2 := store_0.AuxInt 48266 p2 := store_0.Args[0] 48267 if !(isSamePtr(p1, p2) && store.Uses == 1 && n >= o2+sizeof(t2) && clobber(store)) { 48268 break 48269 } 48270 v.reset(OpZero) 48271 v.AuxInt = n 48272 v.Aux = t1 48273 v.AddArg(p1) 48274 v.AddArg(mem) 48275 return true 48276 } 48277 // match: (Zero {t} [n] dst1 move:(Move {t} [n] dst2 _ mem)) 48278 // cond: move.Uses == 1 && isSamePtr(dst1, dst2) && clobber(move) 48279 // result: (Zero {t} [n] dst1 mem) 48280 for { 48281 n := v.AuxInt 48282 t := v.Aux 48283 _ = v.Args[1] 48284 dst1 := v.Args[0] 48285 move := v.Args[1] 48286 if move.Op != OpMove || move.AuxInt != n || move.Aux != t { 48287 break 48288 } 48289 mem := move.Args[2] 48290 dst2 := move.Args[0] 48291 if !(move.Uses == 1 && isSamePtr(dst1, dst2) && clobber(move)) { 48292 break 48293 } 48294 v.reset(OpZero) 48295 v.AuxInt = n 48296 v.Aux = t 48297 v.AddArg(dst1) 48298 v.AddArg(mem) 48299 return true 48300 } 48301 // match: (Zero {t} [n] dst1 vardef:(VarDef {x} move:(Move {t} [n] dst2 _ mem))) 48302 // cond: move.Uses == 1 && vardef.Uses == 1 && isSamePtr(dst1, dst2) && clobber(move) && clobber(vardef) 48303 // result: (Zero {t} [n] dst1 (VarDef {x} mem)) 48304 for { 48305 n := v.AuxInt 48306 t := v.Aux 48307 _ = v.Args[1] 48308 dst1 := v.Args[0] 48309 vardef := v.Args[1] 48310 if vardef.Op != OpVarDef { 48311 break 48312 } 48313 x := vardef.Aux 48314 move := vardef.Args[0] 48315 if move.Op != OpMove || move.AuxInt != n || move.Aux != t { 48316 break 48317 } 48318 mem := move.Args[2] 48319 dst2 := move.Args[0] 48320 if !(move.Uses == 1 && vardef.Uses == 1 && isSamePtr(dst1, dst2) && clobber(move) && clobber(vardef)) { 48321 break 48322 } 48323 v.reset(OpZero) 48324 v.AuxInt = n 48325 v.Aux = t 48326 v.AddArg(dst1) 48327 v0 := b.NewValue0(v.Pos, OpVarDef, types.TypeMem) 48328 v0.Aux = x 48329 v0.AddArg(mem) 48330 v.AddArg(v0) 48331 return true 48332 } 48333 return false 48334 } 48335 func rewriteValuegeneric_OpZeroExt16to32_0(v *Value) bool { 48336 // match: (ZeroExt16to32 (Const16 [c])) 48337 // result: (Const32 [int64(uint16(c))]) 48338 for { 48339 v_0 := v.Args[0] 48340 if v_0.Op != OpConst16 { 48341 break 48342 } 48343 c := v_0.AuxInt 48344 v.reset(OpConst32) 48345 v.AuxInt = int64(uint16(c)) 48346 return true 48347 } 48348 // match: (ZeroExt16to32 (Trunc32to16 x:(Rsh32Ux64 _ (Const64 [s])))) 48349 // cond: s >= 16 48350 // result: x 48351 for { 48352 v_0 := v.Args[0] 48353 if v_0.Op != OpTrunc32to16 { 48354 break 48355 } 48356 x := v_0.Args[0] 48357 if x.Op != OpRsh32Ux64 { 48358 break 48359 } 48360 _ = x.Args[1] 48361 x_1 := x.Args[1] 48362 if x_1.Op != OpConst64 { 48363 break 48364 } 48365 s := x_1.AuxInt 48366 if !(s >= 16) { 48367 break 48368 } 48369 v.reset(OpCopy) 48370 v.Type = x.Type 48371 v.AddArg(x) 48372 return true 48373 } 48374 return false 48375 } 48376 func rewriteValuegeneric_OpZeroExt16to64_0(v *Value) bool { 48377 // match: (ZeroExt16to64 (Const16 [c])) 48378 // result: (Const64 [int64(uint16(c))]) 48379 for { 48380 v_0 := v.Args[0] 48381 if v_0.Op != OpConst16 { 48382 break 48383 } 48384 c := v_0.AuxInt 48385 v.reset(OpConst64) 48386 v.AuxInt = int64(uint16(c)) 48387 return true 48388 } 48389 // match: (ZeroExt16to64 (Trunc64to16 x:(Rsh64Ux64 _ (Const64 [s])))) 48390 // cond: s >= 48 48391 // result: x 48392 for { 48393 v_0 := v.Args[0] 48394 if v_0.Op != OpTrunc64to16 { 48395 break 48396 } 48397 x := v_0.Args[0] 48398 if x.Op != OpRsh64Ux64 { 48399 break 48400 } 48401 _ = x.Args[1] 48402 x_1 := x.Args[1] 48403 if x_1.Op != OpConst64 { 48404 break 48405 } 48406 s := x_1.AuxInt 48407 if !(s >= 48) { 48408 break 48409 } 48410 v.reset(OpCopy) 48411 v.Type = x.Type 48412 v.AddArg(x) 48413 return true 48414 } 48415 return false 48416 } 48417 func rewriteValuegeneric_OpZeroExt32to64_0(v *Value) bool { 48418 // match: (ZeroExt32to64 (Const32 [c])) 48419 // result: (Const64 [int64(uint32(c))]) 48420 for { 48421 v_0 := v.Args[0] 48422 if v_0.Op != OpConst32 { 48423 break 48424 } 48425 c := v_0.AuxInt 48426 v.reset(OpConst64) 48427 v.AuxInt = int64(uint32(c)) 48428 return true 48429 } 48430 // match: (ZeroExt32to64 (Trunc64to32 x:(Rsh64Ux64 _ (Const64 [s])))) 48431 // cond: s >= 32 48432 // result: x 48433 for { 48434 v_0 := v.Args[0] 48435 if v_0.Op != OpTrunc64to32 { 48436 break 48437 } 48438 x := v_0.Args[0] 48439 if x.Op != OpRsh64Ux64 { 48440 break 48441 } 48442 _ = x.Args[1] 48443 x_1 := x.Args[1] 48444 if x_1.Op != OpConst64 { 48445 break 48446 } 48447 s := x_1.AuxInt 48448 if !(s >= 32) { 48449 break 48450 } 48451 v.reset(OpCopy) 48452 v.Type = x.Type 48453 v.AddArg(x) 48454 return true 48455 } 48456 return false 48457 } 48458 func rewriteValuegeneric_OpZeroExt8to16_0(v *Value) bool { 48459 // match: (ZeroExt8to16 (Const8 [c])) 48460 // result: (Const16 [int64( uint8(c))]) 48461 for { 48462 v_0 := v.Args[0] 48463 if v_0.Op != OpConst8 { 48464 break 48465 } 48466 c := v_0.AuxInt 48467 v.reset(OpConst16) 48468 v.AuxInt = int64(uint8(c)) 48469 return true 48470 } 48471 // match: (ZeroExt8to16 (Trunc16to8 x:(Rsh16Ux64 _ (Const64 [s])))) 48472 // cond: s >= 8 48473 // result: x 48474 for { 48475 v_0 := v.Args[0] 48476 if v_0.Op != OpTrunc16to8 { 48477 break 48478 } 48479 x := v_0.Args[0] 48480 if x.Op != OpRsh16Ux64 { 48481 break 48482 } 48483 _ = x.Args[1] 48484 x_1 := x.Args[1] 48485 if x_1.Op != OpConst64 { 48486 break 48487 } 48488 s := x_1.AuxInt 48489 if !(s >= 8) { 48490 break 48491 } 48492 v.reset(OpCopy) 48493 v.Type = x.Type 48494 v.AddArg(x) 48495 return true 48496 } 48497 return false 48498 } 48499 func rewriteValuegeneric_OpZeroExt8to32_0(v *Value) bool { 48500 // match: (ZeroExt8to32 (Const8 [c])) 48501 // result: (Const32 [int64( uint8(c))]) 48502 for { 48503 v_0 := v.Args[0] 48504 if v_0.Op != OpConst8 { 48505 break 48506 } 48507 c := v_0.AuxInt 48508 v.reset(OpConst32) 48509 v.AuxInt = int64(uint8(c)) 48510 return true 48511 } 48512 // match: (ZeroExt8to32 (Trunc32to8 x:(Rsh32Ux64 _ (Const64 [s])))) 48513 // cond: s >= 24 48514 // result: x 48515 for { 48516 v_0 := v.Args[0] 48517 if v_0.Op != OpTrunc32to8 { 48518 break 48519 } 48520 x := v_0.Args[0] 48521 if x.Op != OpRsh32Ux64 { 48522 break 48523 } 48524 _ = x.Args[1] 48525 x_1 := x.Args[1] 48526 if x_1.Op != OpConst64 { 48527 break 48528 } 48529 s := x_1.AuxInt 48530 if !(s >= 24) { 48531 break 48532 } 48533 v.reset(OpCopy) 48534 v.Type = x.Type 48535 v.AddArg(x) 48536 return true 48537 } 48538 return false 48539 } 48540 func rewriteValuegeneric_OpZeroExt8to64_0(v *Value) bool { 48541 // match: (ZeroExt8to64 (Const8 [c])) 48542 // result: (Const64 [int64( uint8(c))]) 48543 for { 48544 v_0 := v.Args[0] 48545 if v_0.Op != OpConst8 { 48546 break 48547 } 48548 c := v_0.AuxInt 48549 v.reset(OpConst64) 48550 v.AuxInt = int64(uint8(c)) 48551 return true 48552 } 48553 // match: (ZeroExt8to64 (Trunc64to8 x:(Rsh64Ux64 _ (Const64 [s])))) 48554 // cond: s >= 56 48555 // result: x 48556 for { 48557 v_0 := v.Args[0] 48558 if v_0.Op != OpTrunc64to8 { 48559 break 48560 } 48561 x := v_0.Args[0] 48562 if x.Op != OpRsh64Ux64 { 48563 break 48564 } 48565 _ = x.Args[1] 48566 x_1 := x.Args[1] 48567 if x_1.Op != OpConst64 { 48568 break 48569 } 48570 s := x_1.AuxInt 48571 if !(s >= 56) { 48572 break 48573 } 48574 v.reset(OpCopy) 48575 v.Type = x.Type 48576 v.AddArg(x) 48577 return true 48578 } 48579 return false 48580 } 48581 func rewriteBlockgeneric(b *Block) bool { 48582 switch b.Kind { 48583 case BlockIf: 48584 // match: (If (Not cond) yes no) 48585 // result: (If cond no yes) 48586 for b.Controls[0].Op == OpNot { 48587 v_0 := b.Controls[0] 48588 cond := v_0.Args[0] 48589 b.Reset(BlockIf) 48590 b.AddControl(cond) 48591 b.swapSuccessors() 48592 return true 48593 } 48594 // match: (If (ConstBool [c]) yes no) 48595 // cond: c == 1 48596 // result: (First yes no) 48597 for b.Controls[0].Op == OpConstBool { 48598 v_0 := b.Controls[0] 48599 c := v_0.AuxInt 48600 if !(c == 1) { 48601 break 48602 } 48603 b.Reset(BlockFirst) 48604 return true 48605 } 48606 // match: (If (ConstBool [c]) yes no) 48607 // cond: c == 0 48608 // result: (First no yes) 48609 for b.Controls[0].Op == OpConstBool { 48610 v_0 := b.Controls[0] 48611 c := v_0.AuxInt 48612 if !(c == 0) { 48613 break 48614 } 48615 b.Reset(BlockFirst) 48616 b.swapSuccessors() 48617 return true 48618 } 48619 } 48620 return false 48621 }