github.com/bir3/gocompiler@v0.3.205/src/cmd/compile/internal/ssa/rewritePPC64.go (about) 1 // Code generated from _gen/PPC64.rules; DO NOT EDIT. 2 // generated with: cd _gen; go run . 3 4 package ssa 5 6 import "github.com/bir3/gocompiler/src/internal/buildcfg" 7 import "math" 8 import "github.com/bir3/gocompiler/src/cmd/compile/internal/types" 9 10 func rewriteValuePPC64(v *Value) bool { 11 switch v.Op { 12 case OpAbs: 13 v.Op = OpPPC64FABS 14 return true 15 case OpAdd16: 16 v.Op = OpPPC64ADD 17 return true 18 case OpAdd32: 19 v.Op = OpPPC64ADD 20 return true 21 case OpAdd32F: 22 v.Op = OpPPC64FADDS 23 return true 24 case OpAdd64: 25 v.Op = OpPPC64ADD 26 return true 27 case OpAdd64F: 28 v.Op = OpPPC64FADD 29 return true 30 case OpAdd8: 31 v.Op = OpPPC64ADD 32 return true 33 case OpAddPtr: 34 v.Op = OpPPC64ADD 35 return true 36 case OpAddr: 37 return rewriteValuePPC64_OpAddr(v) 38 case OpAnd16: 39 v.Op = OpPPC64AND 40 return true 41 case OpAnd32: 42 v.Op = OpPPC64AND 43 return true 44 case OpAnd64: 45 v.Op = OpPPC64AND 46 return true 47 case OpAnd8: 48 v.Op = OpPPC64AND 49 return true 50 case OpAndB: 51 v.Op = OpPPC64AND 52 return true 53 case OpAtomicAdd32: 54 v.Op = OpPPC64LoweredAtomicAdd32 55 return true 56 case OpAtomicAdd64: 57 v.Op = OpPPC64LoweredAtomicAdd64 58 return true 59 case OpAtomicAnd32: 60 v.Op = OpPPC64LoweredAtomicAnd32 61 return true 62 case OpAtomicAnd8: 63 v.Op = OpPPC64LoweredAtomicAnd8 64 return true 65 case OpAtomicCompareAndSwap32: 66 return rewriteValuePPC64_OpAtomicCompareAndSwap32(v) 67 case OpAtomicCompareAndSwap64: 68 return rewriteValuePPC64_OpAtomicCompareAndSwap64(v) 69 case OpAtomicCompareAndSwapRel32: 70 return rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v) 71 case OpAtomicExchange32: 72 v.Op = OpPPC64LoweredAtomicExchange32 73 return true 74 case OpAtomicExchange64: 75 v.Op = OpPPC64LoweredAtomicExchange64 76 return true 77 case OpAtomicLoad32: 78 return rewriteValuePPC64_OpAtomicLoad32(v) 79 case OpAtomicLoad64: 80 return rewriteValuePPC64_OpAtomicLoad64(v) 81 case OpAtomicLoad8: 82 return rewriteValuePPC64_OpAtomicLoad8(v) 83 case OpAtomicLoadAcq32: 84 return rewriteValuePPC64_OpAtomicLoadAcq32(v) 85 case OpAtomicLoadAcq64: 86 return rewriteValuePPC64_OpAtomicLoadAcq64(v) 87 case OpAtomicLoadPtr: 88 return rewriteValuePPC64_OpAtomicLoadPtr(v) 89 case OpAtomicOr32: 90 v.Op = OpPPC64LoweredAtomicOr32 91 return true 92 case OpAtomicOr8: 93 v.Op = OpPPC64LoweredAtomicOr8 94 return true 95 case OpAtomicStore32: 96 return rewriteValuePPC64_OpAtomicStore32(v) 97 case OpAtomicStore64: 98 return rewriteValuePPC64_OpAtomicStore64(v) 99 case OpAtomicStore8: 100 return rewriteValuePPC64_OpAtomicStore8(v) 101 case OpAtomicStoreRel32: 102 return rewriteValuePPC64_OpAtomicStoreRel32(v) 103 case OpAtomicStoreRel64: 104 return rewriteValuePPC64_OpAtomicStoreRel64(v) 105 case OpAvg64u: 106 return rewriteValuePPC64_OpAvg64u(v) 107 case OpBitLen32: 108 return rewriteValuePPC64_OpBitLen32(v) 109 case OpBitLen64: 110 return rewriteValuePPC64_OpBitLen64(v) 111 case OpCeil: 112 v.Op = OpPPC64FCEIL 113 return true 114 case OpClosureCall: 115 v.Op = OpPPC64CALLclosure 116 return true 117 case OpCom16: 118 return rewriteValuePPC64_OpCom16(v) 119 case OpCom32: 120 return rewriteValuePPC64_OpCom32(v) 121 case OpCom64: 122 return rewriteValuePPC64_OpCom64(v) 123 case OpCom8: 124 return rewriteValuePPC64_OpCom8(v) 125 case OpCondSelect: 126 return rewriteValuePPC64_OpCondSelect(v) 127 case OpConst16: 128 return rewriteValuePPC64_OpConst16(v) 129 case OpConst32: 130 return rewriteValuePPC64_OpConst32(v) 131 case OpConst32F: 132 v.Op = OpPPC64FMOVSconst 133 return true 134 case OpConst64: 135 return rewriteValuePPC64_OpConst64(v) 136 case OpConst64F: 137 v.Op = OpPPC64FMOVDconst 138 return true 139 case OpConst8: 140 return rewriteValuePPC64_OpConst8(v) 141 case OpConstBool: 142 return rewriteValuePPC64_OpConstBool(v) 143 case OpConstNil: 144 return rewriteValuePPC64_OpConstNil(v) 145 case OpCopysign: 146 return rewriteValuePPC64_OpCopysign(v) 147 case OpCtz16: 148 return rewriteValuePPC64_OpCtz16(v) 149 case OpCtz32: 150 return rewriteValuePPC64_OpCtz32(v) 151 case OpCtz32NonZero: 152 v.Op = OpCtz32 153 return true 154 case OpCtz64: 155 return rewriteValuePPC64_OpCtz64(v) 156 case OpCtz64NonZero: 157 v.Op = OpCtz64 158 return true 159 case OpCtz8: 160 return rewriteValuePPC64_OpCtz8(v) 161 case OpCvt32Fto32: 162 return rewriteValuePPC64_OpCvt32Fto32(v) 163 case OpCvt32Fto64: 164 return rewriteValuePPC64_OpCvt32Fto64(v) 165 case OpCvt32Fto64F: 166 v.Op = OpCopy 167 return true 168 case OpCvt32to32F: 169 return rewriteValuePPC64_OpCvt32to32F(v) 170 case OpCvt32to64F: 171 return rewriteValuePPC64_OpCvt32to64F(v) 172 case OpCvt64Fto32: 173 return rewriteValuePPC64_OpCvt64Fto32(v) 174 case OpCvt64Fto32F: 175 v.Op = OpPPC64FRSP 176 return true 177 case OpCvt64Fto64: 178 return rewriteValuePPC64_OpCvt64Fto64(v) 179 case OpCvt64to32F: 180 return rewriteValuePPC64_OpCvt64to32F(v) 181 case OpCvt64to64F: 182 return rewriteValuePPC64_OpCvt64to64F(v) 183 case OpCvtBoolToUint8: 184 v.Op = OpCopy 185 return true 186 case OpDiv16: 187 return rewriteValuePPC64_OpDiv16(v) 188 case OpDiv16u: 189 return rewriteValuePPC64_OpDiv16u(v) 190 case OpDiv32: 191 return rewriteValuePPC64_OpDiv32(v) 192 case OpDiv32F: 193 v.Op = OpPPC64FDIVS 194 return true 195 case OpDiv32u: 196 v.Op = OpPPC64DIVWU 197 return true 198 case OpDiv64: 199 return rewriteValuePPC64_OpDiv64(v) 200 case OpDiv64F: 201 v.Op = OpPPC64FDIV 202 return true 203 case OpDiv64u: 204 v.Op = OpPPC64DIVDU 205 return true 206 case OpDiv8: 207 return rewriteValuePPC64_OpDiv8(v) 208 case OpDiv8u: 209 return rewriteValuePPC64_OpDiv8u(v) 210 case OpEq16: 211 return rewriteValuePPC64_OpEq16(v) 212 case OpEq32: 213 return rewriteValuePPC64_OpEq32(v) 214 case OpEq32F: 215 return rewriteValuePPC64_OpEq32F(v) 216 case OpEq64: 217 return rewriteValuePPC64_OpEq64(v) 218 case OpEq64F: 219 return rewriteValuePPC64_OpEq64F(v) 220 case OpEq8: 221 return rewriteValuePPC64_OpEq8(v) 222 case OpEqB: 223 return rewriteValuePPC64_OpEqB(v) 224 case OpEqPtr: 225 return rewriteValuePPC64_OpEqPtr(v) 226 case OpFMA: 227 v.Op = OpPPC64FMADD 228 return true 229 case OpFloor: 230 v.Op = OpPPC64FFLOOR 231 return true 232 case OpGetCallerPC: 233 v.Op = OpPPC64LoweredGetCallerPC 234 return true 235 case OpGetCallerSP: 236 v.Op = OpPPC64LoweredGetCallerSP 237 return true 238 case OpGetClosurePtr: 239 v.Op = OpPPC64LoweredGetClosurePtr 240 return true 241 case OpHmul32: 242 v.Op = OpPPC64MULHW 243 return true 244 case OpHmul32u: 245 v.Op = OpPPC64MULHWU 246 return true 247 case OpHmul64: 248 v.Op = OpPPC64MULHD 249 return true 250 case OpHmul64u: 251 v.Op = OpPPC64MULHDU 252 return true 253 case OpInterCall: 254 v.Op = OpPPC64CALLinter 255 return true 256 case OpIsInBounds: 257 return rewriteValuePPC64_OpIsInBounds(v) 258 case OpIsNonNil: 259 return rewriteValuePPC64_OpIsNonNil(v) 260 case OpIsSliceInBounds: 261 return rewriteValuePPC64_OpIsSliceInBounds(v) 262 case OpLeq16: 263 return rewriteValuePPC64_OpLeq16(v) 264 case OpLeq16U: 265 return rewriteValuePPC64_OpLeq16U(v) 266 case OpLeq32: 267 return rewriteValuePPC64_OpLeq32(v) 268 case OpLeq32F: 269 return rewriteValuePPC64_OpLeq32F(v) 270 case OpLeq32U: 271 return rewriteValuePPC64_OpLeq32U(v) 272 case OpLeq64: 273 return rewriteValuePPC64_OpLeq64(v) 274 case OpLeq64F: 275 return rewriteValuePPC64_OpLeq64F(v) 276 case OpLeq64U: 277 return rewriteValuePPC64_OpLeq64U(v) 278 case OpLeq8: 279 return rewriteValuePPC64_OpLeq8(v) 280 case OpLeq8U: 281 return rewriteValuePPC64_OpLeq8U(v) 282 case OpLess16: 283 return rewriteValuePPC64_OpLess16(v) 284 case OpLess16U: 285 return rewriteValuePPC64_OpLess16U(v) 286 case OpLess32: 287 return rewriteValuePPC64_OpLess32(v) 288 case OpLess32F: 289 return rewriteValuePPC64_OpLess32F(v) 290 case OpLess32U: 291 return rewriteValuePPC64_OpLess32U(v) 292 case OpLess64: 293 return rewriteValuePPC64_OpLess64(v) 294 case OpLess64F: 295 return rewriteValuePPC64_OpLess64F(v) 296 case OpLess64U: 297 return rewriteValuePPC64_OpLess64U(v) 298 case OpLess8: 299 return rewriteValuePPC64_OpLess8(v) 300 case OpLess8U: 301 return rewriteValuePPC64_OpLess8U(v) 302 case OpLoad: 303 return rewriteValuePPC64_OpLoad(v) 304 case OpLocalAddr: 305 return rewriteValuePPC64_OpLocalAddr(v) 306 case OpLsh16x16: 307 return rewriteValuePPC64_OpLsh16x16(v) 308 case OpLsh16x32: 309 return rewriteValuePPC64_OpLsh16x32(v) 310 case OpLsh16x64: 311 return rewriteValuePPC64_OpLsh16x64(v) 312 case OpLsh16x8: 313 return rewriteValuePPC64_OpLsh16x8(v) 314 case OpLsh32x16: 315 return rewriteValuePPC64_OpLsh32x16(v) 316 case OpLsh32x32: 317 return rewriteValuePPC64_OpLsh32x32(v) 318 case OpLsh32x64: 319 return rewriteValuePPC64_OpLsh32x64(v) 320 case OpLsh32x8: 321 return rewriteValuePPC64_OpLsh32x8(v) 322 case OpLsh64x16: 323 return rewriteValuePPC64_OpLsh64x16(v) 324 case OpLsh64x32: 325 return rewriteValuePPC64_OpLsh64x32(v) 326 case OpLsh64x64: 327 return rewriteValuePPC64_OpLsh64x64(v) 328 case OpLsh64x8: 329 return rewriteValuePPC64_OpLsh64x8(v) 330 case OpLsh8x16: 331 return rewriteValuePPC64_OpLsh8x16(v) 332 case OpLsh8x32: 333 return rewriteValuePPC64_OpLsh8x32(v) 334 case OpLsh8x64: 335 return rewriteValuePPC64_OpLsh8x64(v) 336 case OpLsh8x8: 337 return rewriteValuePPC64_OpLsh8x8(v) 338 case OpMod16: 339 return rewriteValuePPC64_OpMod16(v) 340 case OpMod16u: 341 return rewriteValuePPC64_OpMod16u(v) 342 case OpMod32: 343 return rewriteValuePPC64_OpMod32(v) 344 case OpMod32u: 345 return rewriteValuePPC64_OpMod32u(v) 346 case OpMod64: 347 return rewriteValuePPC64_OpMod64(v) 348 case OpMod64u: 349 return rewriteValuePPC64_OpMod64u(v) 350 case OpMod8: 351 return rewriteValuePPC64_OpMod8(v) 352 case OpMod8u: 353 return rewriteValuePPC64_OpMod8u(v) 354 case OpMove: 355 return rewriteValuePPC64_OpMove(v) 356 case OpMul16: 357 v.Op = OpPPC64MULLW 358 return true 359 case OpMul32: 360 v.Op = OpPPC64MULLW 361 return true 362 case OpMul32F: 363 v.Op = OpPPC64FMULS 364 return true 365 case OpMul64: 366 v.Op = OpPPC64MULLD 367 return true 368 case OpMul64F: 369 v.Op = OpPPC64FMUL 370 return true 371 case OpMul8: 372 v.Op = OpPPC64MULLW 373 return true 374 case OpNeg16: 375 v.Op = OpPPC64NEG 376 return true 377 case OpNeg32: 378 v.Op = OpPPC64NEG 379 return true 380 case OpNeg32F: 381 v.Op = OpPPC64FNEG 382 return true 383 case OpNeg64: 384 v.Op = OpPPC64NEG 385 return true 386 case OpNeg64F: 387 v.Op = OpPPC64FNEG 388 return true 389 case OpNeg8: 390 v.Op = OpPPC64NEG 391 return true 392 case OpNeq16: 393 return rewriteValuePPC64_OpNeq16(v) 394 case OpNeq32: 395 return rewriteValuePPC64_OpNeq32(v) 396 case OpNeq32F: 397 return rewriteValuePPC64_OpNeq32F(v) 398 case OpNeq64: 399 return rewriteValuePPC64_OpNeq64(v) 400 case OpNeq64F: 401 return rewriteValuePPC64_OpNeq64F(v) 402 case OpNeq8: 403 return rewriteValuePPC64_OpNeq8(v) 404 case OpNeqB: 405 v.Op = OpPPC64XOR 406 return true 407 case OpNeqPtr: 408 return rewriteValuePPC64_OpNeqPtr(v) 409 case OpNilCheck: 410 v.Op = OpPPC64LoweredNilCheck 411 return true 412 case OpNot: 413 return rewriteValuePPC64_OpNot(v) 414 case OpOffPtr: 415 return rewriteValuePPC64_OpOffPtr(v) 416 case OpOr16: 417 v.Op = OpPPC64OR 418 return true 419 case OpOr32: 420 v.Op = OpPPC64OR 421 return true 422 case OpOr64: 423 v.Op = OpPPC64OR 424 return true 425 case OpOr8: 426 v.Op = OpPPC64OR 427 return true 428 case OpOrB: 429 v.Op = OpPPC64OR 430 return true 431 case OpPPC64ADD: 432 return rewriteValuePPC64_OpPPC64ADD(v) 433 case OpPPC64ADDE: 434 return rewriteValuePPC64_OpPPC64ADDE(v) 435 case OpPPC64ADDconst: 436 return rewriteValuePPC64_OpPPC64ADDconst(v) 437 case OpPPC64AND: 438 return rewriteValuePPC64_OpPPC64AND(v) 439 case OpPPC64ANDN: 440 return rewriteValuePPC64_OpPPC64ANDN(v) 441 case OpPPC64CLRLSLDI: 442 return rewriteValuePPC64_OpPPC64CLRLSLDI(v) 443 case OpPPC64CMP: 444 return rewriteValuePPC64_OpPPC64CMP(v) 445 case OpPPC64CMPU: 446 return rewriteValuePPC64_OpPPC64CMPU(v) 447 case OpPPC64CMPUconst: 448 return rewriteValuePPC64_OpPPC64CMPUconst(v) 449 case OpPPC64CMPW: 450 return rewriteValuePPC64_OpPPC64CMPW(v) 451 case OpPPC64CMPWU: 452 return rewriteValuePPC64_OpPPC64CMPWU(v) 453 case OpPPC64CMPWUconst: 454 return rewriteValuePPC64_OpPPC64CMPWUconst(v) 455 case OpPPC64CMPWconst: 456 return rewriteValuePPC64_OpPPC64CMPWconst(v) 457 case OpPPC64CMPconst: 458 return rewriteValuePPC64_OpPPC64CMPconst(v) 459 case OpPPC64Equal: 460 return rewriteValuePPC64_OpPPC64Equal(v) 461 case OpPPC64FABS: 462 return rewriteValuePPC64_OpPPC64FABS(v) 463 case OpPPC64FADD: 464 return rewriteValuePPC64_OpPPC64FADD(v) 465 case OpPPC64FADDS: 466 return rewriteValuePPC64_OpPPC64FADDS(v) 467 case OpPPC64FCEIL: 468 return rewriteValuePPC64_OpPPC64FCEIL(v) 469 case OpPPC64FFLOOR: 470 return rewriteValuePPC64_OpPPC64FFLOOR(v) 471 case OpPPC64FGreaterEqual: 472 return rewriteValuePPC64_OpPPC64FGreaterEqual(v) 473 case OpPPC64FGreaterThan: 474 return rewriteValuePPC64_OpPPC64FGreaterThan(v) 475 case OpPPC64FLessEqual: 476 return rewriteValuePPC64_OpPPC64FLessEqual(v) 477 case OpPPC64FLessThan: 478 return rewriteValuePPC64_OpPPC64FLessThan(v) 479 case OpPPC64FMOVDload: 480 return rewriteValuePPC64_OpPPC64FMOVDload(v) 481 case OpPPC64FMOVDstore: 482 return rewriteValuePPC64_OpPPC64FMOVDstore(v) 483 case OpPPC64FMOVSload: 484 return rewriteValuePPC64_OpPPC64FMOVSload(v) 485 case OpPPC64FMOVSstore: 486 return rewriteValuePPC64_OpPPC64FMOVSstore(v) 487 case OpPPC64FNEG: 488 return rewriteValuePPC64_OpPPC64FNEG(v) 489 case OpPPC64FSQRT: 490 return rewriteValuePPC64_OpPPC64FSQRT(v) 491 case OpPPC64FSUB: 492 return rewriteValuePPC64_OpPPC64FSUB(v) 493 case OpPPC64FSUBS: 494 return rewriteValuePPC64_OpPPC64FSUBS(v) 495 case OpPPC64FTRUNC: 496 return rewriteValuePPC64_OpPPC64FTRUNC(v) 497 case OpPPC64GreaterEqual: 498 return rewriteValuePPC64_OpPPC64GreaterEqual(v) 499 case OpPPC64GreaterThan: 500 return rewriteValuePPC64_OpPPC64GreaterThan(v) 501 case OpPPC64ISEL: 502 return rewriteValuePPC64_OpPPC64ISEL(v) 503 case OpPPC64ISELB: 504 return rewriteValuePPC64_OpPPC64ISELB(v) 505 case OpPPC64LessEqual: 506 return rewriteValuePPC64_OpPPC64LessEqual(v) 507 case OpPPC64LessThan: 508 return rewriteValuePPC64_OpPPC64LessThan(v) 509 case OpPPC64MFVSRD: 510 return rewriteValuePPC64_OpPPC64MFVSRD(v) 511 case OpPPC64MOVBZload: 512 return rewriteValuePPC64_OpPPC64MOVBZload(v) 513 case OpPPC64MOVBZloadidx: 514 return rewriteValuePPC64_OpPPC64MOVBZloadidx(v) 515 case OpPPC64MOVBZreg: 516 return rewriteValuePPC64_OpPPC64MOVBZreg(v) 517 case OpPPC64MOVBreg: 518 return rewriteValuePPC64_OpPPC64MOVBreg(v) 519 case OpPPC64MOVBstore: 520 return rewriteValuePPC64_OpPPC64MOVBstore(v) 521 case OpPPC64MOVBstoreidx: 522 return rewriteValuePPC64_OpPPC64MOVBstoreidx(v) 523 case OpPPC64MOVBstorezero: 524 return rewriteValuePPC64_OpPPC64MOVBstorezero(v) 525 case OpPPC64MOVDload: 526 return rewriteValuePPC64_OpPPC64MOVDload(v) 527 case OpPPC64MOVDloadidx: 528 return rewriteValuePPC64_OpPPC64MOVDloadidx(v) 529 case OpPPC64MOVDstore: 530 return rewriteValuePPC64_OpPPC64MOVDstore(v) 531 case OpPPC64MOVDstoreidx: 532 return rewriteValuePPC64_OpPPC64MOVDstoreidx(v) 533 case OpPPC64MOVDstorezero: 534 return rewriteValuePPC64_OpPPC64MOVDstorezero(v) 535 case OpPPC64MOVHBRstore: 536 return rewriteValuePPC64_OpPPC64MOVHBRstore(v) 537 case OpPPC64MOVHZload: 538 return rewriteValuePPC64_OpPPC64MOVHZload(v) 539 case OpPPC64MOVHZloadidx: 540 return rewriteValuePPC64_OpPPC64MOVHZloadidx(v) 541 case OpPPC64MOVHZreg: 542 return rewriteValuePPC64_OpPPC64MOVHZreg(v) 543 case OpPPC64MOVHload: 544 return rewriteValuePPC64_OpPPC64MOVHload(v) 545 case OpPPC64MOVHloadidx: 546 return rewriteValuePPC64_OpPPC64MOVHloadidx(v) 547 case OpPPC64MOVHreg: 548 return rewriteValuePPC64_OpPPC64MOVHreg(v) 549 case OpPPC64MOVHstore: 550 return rewriteValuePPC64_OpPPC64MOVHstore(v) 551 case OpPPC64MOVHstoreidx: 552 return rewriteValuePPC64_OpPPC64MOVHstoreidx(v) 553 case OpPPC64MOVHstorezero: 554 return rewriteValuePPC64_OpPPC64MOVHstorezero(v) 555 case OpPPC64MOVWBRstore: 556 return rewriteValuePPC64_OpPPC64MOVWBRstore(v) 557 case OpPPC64MOVWZload: 558 return rewriteValuePPC64_OpPPC64MOVWZload(v) 559 case OpPPC64MOVWZloadidx: 560 return rewriteValuePPC64_OpPPC64MOVWZloadidx(v) 561 case OpPPC64MOVWZreg: 562 return rewriteValuePPC64_OpPPC64MOVWZreg(v) 563 case OpPPC64MOVWload: 564 return rewriteValuePPC64_OpPPC64MOVWload(v) 565 case OpPPC64MOVWloadidx: 566 return rewriteValuePPC64_OpPPC64MOVWloadidx(v) 567 case OpPPC64MOVWreg: 568 return rewriteValuePPC64_OpPPC64MOVWreg(v) 569 case OpPPC64MOVWstore: 570 return rewriteValuePPC64_OpPPC64MOVWstore(v) 571 case OpPPC64MOVWstoreidx: 572 return rewriteValuePPC64_OpPPC64MOVWstoreidx(v) 573 case OpPPC64MOVWstorezero: 574 return rewriteValuePPC64_OpPPC64MOVWstorezero(v) 575 case OpPPC64MTVSRD: 576 return rewriteValuePPC64_OpPPC64MTVSRD(v) 577 case OpPPC64MULLD: 578 return rewriteValuePPC64_OpPPC64MULLD(v) 579 case OpPPC64MULLW: 580 return rewriteValuePPC64_OpPPC64MULLW(v) 581 case OpPPC64NEG: 582 return rewriteValuePPC64_OpPPC64NEG(v) 583 case OpPPC64NOR: 584 return rewriteValuePPC64_OpPPC64NOR(v) 585 case OpPPC64NotEqual: 586 return rewriteValuePPC64_OpPPC64NotEqual(v) 587 case OpPPC64OR: 588 return rewriteValuePPC64_OpPPC64OR(v) 589 case OpPPC64ORN: 590 return rewriteValuePPC64_OpPPC64ORN(v) 591 case OpPPC64ORconst: 592 return rewriteValuePPC64_OpPPC64ORconst(v) 593 case OpPPC64ROTL: 594 return rewriteValuePPC64_OpPPC64ROTL(v) 595 case OpPPC64ROTLW: 596 return rewriteValuePPC64_OpPPC64ROTLW(v) 597 case OpPPC64ROTLWconst: 598 return rewriteValuePPC64_OpPPC64ROTLWconst(v) 599 case OpPPC64SLD: 600 return rewriteValuePPC64_OpPPC64SLD(v) 601 case OpPPC64SLDconst: 602 return rewriteValuePPC64_OpPPC64SLDconst(v) 603 case OpPPC64SLW: 604 return rewriteValuePPC64_OpPPC64SLW(v) 605 case OpPPC64SLWconst: 606 return rewriteValuePPC64_OpPPC64SLWconst(v) 607 case OpPPC64SRAD: 608 return rewriteValuePPC64_OpPPC64SRAD(v) 609 case OpPPC64SRAW: 610 return rewriteValuePPC64_OpPPC64SRAW(v) 611 case OpPPC64SRD: 612 return rewriteValuePPC64_OpPPC64SRD(v) 613 case OpPPC64SRW: 614 return rewriteValuePPC64_OpPPC64SRW(v) 615 case OpPPC64SRWconst: 616 return rewriteValuePPC64_OpPPC64SRWconst(v) 617 case OpPPC64SUB: 618 return rewriteValuePPC64_OpPPC64SUB(v) 619 case OpPPC64SUBE: 620 return rewriteValuePPC64_OpPPC64SUBE(v) 621 case OpPPC64SUBFCconst: 622 return rewriteValuePPC64_OpPPC64SUBFCconst(v) 623 case OpPPC64XOR: 624 return rewriteValuePPC64_OpPPC64XOR(v) 625 case OpPPC64XORconst: 626 return rewriteValuePPC64_OpPPC64XORconst(v) 627 case OpPanicBounds: 628 return rewriteValuePPC64_OpPanicBounds(v) 629 case OpPopCount16: 630 return rewriteValuePPC64_OpPopCount16(v) 631 case OpPopCount32: 632 return rewriteValuePPC64_OpPopCount32(v) 633 case OpPopCount64: 634 v.Op = OpPPC64POPCNTD 635 return true 636 case OpPopCount8: 637 return rewriteValuePPC64_OpPopCount8(v) 638 case OpPrefetchCache: 639 return rewriteValuePPC64_OpPrefetchCache(v) 640 case OpPrefetchCacheStreamed: 641 return rewriteValuePPC64_OpPrefetchCacheStreamed(v) 642 case OpPubBarrier: 643 v.Op = OpPPC64LoweredPubBarrier 644 return true 645 case OpRotateLeft16: 646 return rewriteValuePPC64_OpRotateLeft16(v) 647 case OpRotateLeft32: 648 v.Op = OpPPC64ROTLW 649 return true 650 case OpRotateLeft64: 651 v.Op = OpPPC64ROTL 652 return true 653 case OpRotateLeft8: 654 return rewriteValuePPC64_OpRotateLeft8(v) 655 case OpRound: 656 v.Op = OpPPC64FROUND 657 return true 658 case OpRound32F: 659 v.Op = OpPPC64LoweredRound32F 660 return true 661 case OpRound64F: 662 v.Op = OpPPC64LoweredRound64F 663 return true 664 case OpRsh16Ux16: 665 return rewriteValuePPC64_OpRsh16Ux16(v) 666 case OpRsh16Ux32: 667 return rewriteValuePPC64_OpRsh16Ux32(v) 668 case OpRsh16Ux64: 669 return rewriteValuePPC64_OpRsh16Ux64(v) 670 case OpRsh16Ux8: 671 return rewriteValuePPC64_OpRsh16Ux8(v) 672 case OpRsh16x16: 673 return rewriteValuePPC64_OpRsh16x16(v) 674 case OpRsh16x32: 675 return rewriteValuePPC64_OpRsh16x32(v) 676 case OpRsh16x64: 677 return rewriteValuePPC64_OpRsh16x64(v) 678 case OpRsh16x8: 679 return rewriteValuePPC64_OpRsh16x8(v) 680 case OpRsh32Ux16: 681 return rewriteValuePPC64_OpRsh32Ux16(v) 682 case OpRsh32Ux32: 683 return rewriteValuePPC64_OpRsh32Ux32(v) 684 case OpRsh32Ux64: 685 return rewriteValuePPC64_OpRsh32Ux64(v) 686 case OpRsh32Ux8: 687 return rewriteValuePPC64_OpRsh32Ux8(v) 688 case OpRsh32x16: 689 return rewriteValuePPC64_OpRsh32x16(v) 690 case OpRsh32x32: 691 return rewriteValuePPC64_OpRsh32x32(v) 692 case OpRsh32x64: 693 return rewriteValuePPC64_OpRsh32x64(v) 694 case OpRsh32x8: 695 return rewriteValuePPC64_OpRsh32x8(v) 696 case OpRsh64Ux16: 697 return rewriteValuePPC64_OpRsh64Ux16(v) 698 case OpRsh64Ux32: 699 return rewriteValuePPC64_OpRsh64Ux32(v) 700 case OpRsh64Ux64: 701 return rewriteValuePPC64_OpRsh64Ux64(v) 702 case OpRsh64Ux8: 703 return rewriteValuePPC64_OpRsh64Ux8(v) 704 case OpRsh64x16: 705 return rewriteValuePPC64_OpRsh64x16(v) 706 case OpRsh64x32: 707 return rewriteValuePPC64_OpRsh64x32(v) 708 case OpRsh64x64: 709 return rewriteValuePPC64_OpRsh64x64(v) 710 case OpRsh64x8: 711 return rewriteValuePPC64_OpRsh64x8(v) 712 case OpRsh8Ux16: 713 return rewriteValuePPC64_OpRsh8Ux16(v) 714 case OpRsh8Ux32: 715 return rewriteValuePPC64_OpRsh8Ux32(v) 716 case OpRsh8Ux64: 717 return rewriteValuePPC64_OpRsh8Ux64(v) 718 case OpRsh8Ux8: 719 return rewriteValuePPC64_OpRsh8Ux8(v) 720 case OpRsh8x16: 721 return rewriteValuePPC64_OpRsh8x16(v) 722 case OpRsh8x32: 723 return rewriteValuePPC64_OpRsh8x32(v) 724 case OpRsh8x64: 725 return rewriteValuePPC64_OpRsh8x64(v) 726 case OpRsh8x8: 727 return rewriteValuePPC64_OpRsh8x8(v) 728 case OpSelect0: 729 return rewriteValuePPC64_OpSelect0(v) 730 case OpSelect1: 731 return rewriteValuePPC64_OpSelect1(v) 732 case OpSelectN: 733 return rewriteValuePPC64_OpSelectN(v) 734 case OpSignExt16to32: 735 v.Op = OpPPC64MOVHreg 736 return true 737 case OpSignExt16to64: 738 v.Op = OpPPC64MOVHreg 739 return true 740 case OpSignExt32to64: 741 v.Op = OpPPC64MOVWreg 742 return true 743 case OpSignExt8to16: 744 v.Op = OpPPC64MOVBreg 745 return true 746 case OpSignExt8to32: 747 v.Op = OpPPC64MOVBreg 748 return true 749 case OpSignExt8to64: 750 v.Op = OpPPC64MOVBreg 751 return true 752 case OpSlicemask: 753 return rewriteValuePPC64_OpSlicemask(v) 754 case OpSqrt: 755 v.Op = OpPPC64FSQRT 756 return true 757 case OpSqrt32: 758 v.Op = OpPPC64FSQRTS 759 return true 760 case OpStaticCall: 761 v.Op = OpPPC64CALLstatic 762 return true 763 case OpStore: 764 return rewriteValuePPC64_OpStore(v) 765 case OpSub16: 766 v.Op = OpPPC64SUB 767 return true 768 case OpSub32: 769 v.Op = OpPPC64SUB 770 return true 771 case OpSub32F: 772 v.Op = OpPPC64FSUBS 773 return true 774 case OpSub64: 775 v.Op = OpPPC64SUB 776 return true 777 case OpSub64F: 778 v.Op = OpPPC64FSUB 779 return true 780 case OpSub8: 781 v.Op = OpPPC64SUB 782 return true 783 case OpSubPtr: 784 v.Op = OpPPC64SUB 785 return true 786 case OpTailCall: 787 v.Op = OpPPC64CALLtail 788 return true 789 case OpTrunc: 790 v.Op = OpPPC64FTRUNC 791 return true 792 case OpTrunc16to8: 793 return rewriteValuePPC64_OpTrunc16to8(v) 794 case OpTrunc32to16: 795 return rewriteValuePPC64_OpTrunc32to16(v) 796 case OpTrunc32to8: 797 return rewriteValuePPC64_OpTrunc32to8(v) 798 case OpTrunc64to16: 799 return rewriteValuePPC64_OpTrunc64to16(v) 800 case OpTrunc64to32: 801 return rewriteValuePPC64_OpTrunc64to32(v) 802 case OpTrunc64to8: 803 return rewriteValuePPC64_OpTrunc64to8(v) 804 case OpWB: 805 v.Op = OpPPC64LoweredWB 806 return true 807 case OpXor16: 808 v.Op = OpPPC64XOR 809 return true 810 case OpXor32: 811 v.Op = OpPPC64XOR 812 return true 813 case OpXor64: 814 v.Op = OpPPC64XOR 815 return true 816 case OpXor8: 817 v.Op = OpPPC64XOR 818 return true 819 case OpZero: 820 return rewriteValuePPC64_OpZero(v) 821 case OpZeroExt16to32: 822 v.Op = OpPPC64MOVHZreg 823 return true 824 case OpZeroExt16to64: 825 v.Op = OpPPC64MOVHZreg 826 return true 827 case OpZeroExt32to64: 828 v.Op = OpPPC64MOVWZreg 829 return true 830 case OpZeroExt8to16: 831 v.Op = OpPPC64MOVBZreg 832 return true 833 case OpZeroExt8to32: 834 v.Op = OpPPC64MOVBZreg 835 return true 836 case OpZeroExt8to64: 837 v.Op = OpPPC64MOVBZreg 838 return true 839 } 840 return false 841 } 842 func rewriteValuePPC64_OpAddr(v *Value) bool { 843 v_0 := v.Args[0] 844 // match: (Addr {sym} base) 845 // result: (MOVDaddr {sym} [0] base) 846 for { 847 sym := auxToSym(v.Aux) 848 base := v_0 849 v.reset(OpPPC64MOVDaddr) 850 v.AuxInt = int32ToAuxInt(0) 851 v.Aux = symToAux(sym) 852 v.AddArg(base) 853 return true 854 } 855 } 856 func rewriteValuePPC64_OpAtomicCompareAndSwap32(v *Value) bool { 857 v_3 := v.Args[3] 858 v_2 := v.Args[2] 859 v_1 := v.Args[1] 860 v_0 := v.Args[0] 861 // match: (AtomicCompareAndSwap32 ptr old new_ mem) 862 // result: (LoweredAtomicCas32 [1] ptr old new_ mem) 863 for { 864 ptr := v_0 865 old := v_1 866 new_ := v_2 867 mem := v_3 868 v.reset(OpPPC64LoweredAtomicCas32) 869 v.AuxInt = int64ToAuxInt(1) 870 v.AddArg4(ptr, old, new_, mem) 871 return true 872 } 873 } 874 func rewriteValuePPC64_OpAtomicCompareAndSwap64(v *Value) bool { 875 v_3 := v.Args[3] 876 v_2 := v.Args[2] 877 v_1 := v.Args[1] 878 v_0 := v.Args[0] 879 // match: (AtomicCompareAndSwap64 ptr old new_ mem) 880 // result: (LoweredAtomicCas64 [1] ptr old new_ mem) 881 for { 882 ptr := v_0 883 old := v_1 884 new_ := v_2 885 mem := v_3 886 v.reset(OpPPC64LoweredAtomicCas64) 887 v.AuxInt = int64ToAuxInt(1) 888 v.AddArg4(ptr, old, new_, mem) 889 return true 890 } 891 } 892 func rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v *Value) bool { 893 v_3 := v.Args[3] 894 v_2 := v.Args[2] 895 v_1 := v.Args[1] 896 v_0 := v.Args[0] 897 // match: (AtomicCompareAndSwapRel32 ptr old new_ mem) 898 // result: (LoweredAtomicCas32 [0] ptr old new_ mem) 899 for { 900 ptr := v_0 901 old := v_1 902 new_ := v_2 903 mem := v_3 904 v.reset(OpPPC64LoweredAtomicCas32) 905 v.AuxInt = int64ToAuxInt(0) 906 v.AddArg4(ptr, old, new_, mem) 907 return true 908 } 909 } 910 func rewriteValuePPC64_OpAtomicLoad32(v *Value) bool { 911 v_1 := v.Args[1] 912 v_0 := v.Args[0] 913 // match: (AtomicLoad32 ptr mem) 914 // result: (LoweredAtomicLoad32 [1] ptr mem) 915 for { 916 ptr := v_0 917 mem := v_1 918 v.reset(OpPPC64LoweredAtomicLoad32) 919 v.AuxInt = int64ToAuxInt(1) 920 v.AddArg2(ptr, mem) 921 return true 922 } 923 } 924 func rewriteValuePPC64_OpAtomicLoad64(v *Value) bool { 925 v_1 := v.Args[1] 926 v_0 := v.Args[0] 927 // match: (AtomicLoad64 ptr mem) 928 // result: (LoweredAtomicLoad64 [1] ptr mem) 929 for { 930 ptr := v_0 931 mem := v_1 932 v.reset(OpPPC64LoweredAtomicLoad64) 933 v.AuxInt = int64ToAuxInt(1) 934 v.AddArg2(ptr, mem) 935 return true 936 } 937 } 938 func rewriteValuePPC64_OpAtomicLoad8(v *Value) bool { 939 v_1 := v.Args[1] 940 v_0 := v.Args[0] 941 // match: (AtomicLoad8 ptr mem) 942 // result: (LoweredAtomicLoad8 [1] ptr mem) 943 for { 944 ptr := v_0 945 mem := v_1 946 v.reset(OpPPC64LoweredAtomicLoad8) 947 v.AuxInt = int64ToAuxInt(1) 948 v.AddArg2(ptr, mem) 949 return true 950 } 951 } 952 func rewriteValuePPC64_OpAtomicLoadAcq32(v *Value) bool { 953 v_1 := v.Args[1] 954 v_0 := v.Args[0] 955 // match: (AtomicLoadAcq32 ptr mem) 956 // result: (LoweredAtomicLoad32 [0] ptr mem) 957 for { 958 ptr := v_0 959 mem := v_1 960 v.reset(OpPPC64LoweredAtomicLoad32) 961 v.AuxInt = int64ToAuxInt(0) 962 v.AddArg2(ptr, mem) 963 return true 964 } 965 } 966 func rewriteValuePPC64_OpAtomicLoadAcq64(v *Value) bool { 967 v_1 := v.Args[1] 968 v_0 := v.Args[0] 969 // match: (AtomicLoadAcq64 ptr mem) 970 // result: (LoweredAtomicLoad64 [0] ptr mem) 971 for { 972 ptr := v_0 973 mem := v_1 974 v.reset(OpPPC64LoweredAtomicLoad64) 975 v.AuxInt = int64ToAuxInt(0) 976 v.AddArg2(ptr, mem) 977 return true 978 } 979 } 980 func rewriteValuePPC64_OpAtomicLoadPtr(v *Value) bool { 981 v_1 := v.Args[1] 982 v_0 := v.Args[0] 983 // match: (AtomicLoadPtr ptr mem) 984 // result: (LoweredAtomicLoadPtr [1] ptr mem) 985 for { 986 ptr := v_0 987 mem := v_1 988 v.reset(OpPPC64LoweredAtomicLoadPtr) 989 v.AuxInt = int64ToAuxInt(1) 990 v.AddArg2(ptr, mem) 991 return true 992 } 993 } 994 func rewriteValuePPC64_OpAtomicStore32(v *Value) bool { 995 v_2 := v.Args[2] 996 v_1 := v.Args[1] 997 v_0 := v.Args[0] 998 // match: (AtomicStore32 ptr val mem) 999 // result: (LoweredAtomicStore32 [1] ptr val mem) 1000 for { 1001 ptr := v_0 1002 val := v_1 1003 mem := v_2 1004 v.reset(OpPPC64LoweredAtomicStore32) 1005 v.AuxInt = int64ToAuxInt(1) 1006 v.AddArg3(ptr, val, mem) 1007 return true 1008 } 1009 } 1010 func rewriteValuePPC64_OpAtomicStore64(v *Value) bool { 1011 v_2 := v.Args[2] 1012 v_1 := v.Args[1] 1013 v_0 := v.Args[0] 1014 // match: (AtomicStore64 ptr val mem) 1015 // result: (LoweredAtomicStore64 [1] ptr val mem) 1016 for { 1017 ptr := v_0 1018 val := v_1 1019 mem := v_2 1020 v.reset(OpPPC64LoweredAtomicStore64) 1021 v.AuxInt = int64ToAuxInt(1) 1022 v.AddArg3(ptr, val, mem) 1023 return true 1024 } 1025 } 1026 func rewriteValuePPC64_OpAtomicStore8(v *Value) bool { 1027 v_2 := v.Args[2] 1028 v_1 := v.Args[1] 1029 v_0 := v.Args[0] 1030 // match: (AtomicStore8 ptr val mem) 1031 // result: (LoweredAtomicStore8 [1] ptr val mem) 1032 for { 1033 ptr := v_0 1034 val := v_1 1035 mem := v_2 1036 v.reset(OpPPC64LoweredAtomicStore8) 1037 v.AuxInt = int64ToAuxInt(1) 1038 v.AddArg3(ptr, val, mem) 1039 return true 1040 } 1041 } 1042 func rewriteValuePPC64_OpAtomicStoreRel32(v *Value) bool { 1043 v_2 := v.Args[2] 1044 v_1 := v.Args[1] 1045 v_0 := v.Args[0] 1046 // match: (AtomicStoreRel32 ptr val mem) 1047 // result: (LoweredAtomicStore32 [0] ptr val mem) 1048 for { 1049 ptr := v_0 1050 val := v_1 1051 mem := v_2 1052 v.reset(OpPPC64LoweredAtomicStore32) 1053 v.AuxInt = int64ToAuxInt(0) 1054 v.AddArg3(ptr, val, mem) 1055 return true 1056 } 1057 } 1058 func rewriteValuePPC64_OpAtomicStoreRel64(v *Value) bool { 1059 v_2 := v.Args[2] 1060 v_1 := v.Args[1] 1061 v_0 := v.Args[0] 1062 // match: (AtomicStoreRel64 ptr val mem) 1063 // result: (LoweredAtomicStore64 [0] ptr val mem) 1064 for { 1065 ptr := v_0 1066 val := v_1 1067 mem := v_2 1068 v.reset(OpPPC64LoweredAtomicStore64) 1069 v.AuxInt = int64ToAuxInt(0) 1070 v.AddArg3(ptr, val, mem) 1071 return true 1072 } 1073 } 1074 func rewriteValuePPC64_OpAvg64u(v *Value) bool { 1075 v_1 := v.Args[1] 1076 v_0 := v.Args[0] 1077 b := v.Block 1078 // match: (Avg64u <t> x y) 1079 // result: (ADD (SRDconst <t> (SUB <t> x y) [1]) y) 1080 for { 1081 t := v.Type 1082 x := v_0 1083 y := v_1 1084 v.reset(OpPPC64ADD) 1085 v0 := b.NewValue0(v.Pos, OpPPC64SRDconst, t) 1086 v0.AuxInt = int64ToAuxInt(1) 1087 v1 := b.NewValue0(v.Pos, OpPPC64SUB, t) 1088 v1.AddArg2(x, y) 1089 v0.AddArg(v1) 1090 v.AddArg2(v0, y) 1091 return true 1092 } 1093 } 1094 func rewriteValuePPC64_OpBitLen32(v *Value) bool { 1095 v_0 := v.Args[0] 1096 b := v.Block 1097 typ := &b.Func.Config.Types 1098 // match: (BitLen32 x) 1099 // result: (SUBFCconst [32] (CNTLZW <typ.Int> x)) 1100 for { 1101 x := v_0 1102 v.reset(OpPPC64SUBFCconst) 1103 v.AuxInt = int64ToAuxInt(32) 1104 v0 := b.NewValue0(v.Pos, OpPPC64CNTLZW, typ.Int) 1105 v0.AddArg(x) 1106 v.AddArg(v0) 1107 return true 1108 } 1109 } 1110 func rewriteValuePPC64_OpBitLen64(v *Value) bool { 1111 v_0 := v.Args[0] 1112 b := v.Block 1113 typ := &b.Func.Config.Types 1114 // match: (BitLen64 x) 1115 // result: (SUBFCconst [64] (CNTLZD <typ.Int> x)) 1116 for { 1117 x := v_0 1118 v.reset(OpPPC64SUBFCconst) 1119 v.AuxInt = int64ToAuxInt(64) 1120 v0 := b.NewValue0(v.Pos, OpPPC64CNTLZD, typ.Int) 1121 v0.AddArg(x) 1122 v.AddArg(v0) 1123 return true 1124 } 1125 } 1126 func rewriteValuePPC64_OpCom16(v *Value) bool { 1127 v_0 := v.Args[0] 1128 // match: (Com16 x) 1129 // result: (NOR x x) 1130 for { 1131 x := v_0 1132 v.reset(OpPPC64NOR) 1133 v.AddArg2(x, x) 1134 return true 1135 } 1136 } 1137 func rewriteValuePPC64_OpCom32(v *Value) bool { 1138 v_0 := v.Args[0] 1139 // match: (Com32 x) 1140 // result: (NOR x x) 1141 for { 1142 x := v_0 1143 v.reset(OpPPC64NOR) 1144 v.AddArg2(x, x) 1145 return true 1146 } 1147 } 1148 func rewriteValuePPC64_OpCom64(v *Value) bool { 1149 v_0 := v.Args[0] 1150 // match: (Com64 x) 1151 // result: (NOR x x) 1152 for { 1153 x := v_0 1154 v.reset(OpPPC64NOR) 1155 v.AddArg2(x, x) 1156 return true 1157 } 1158 } 1159 func rewriteValuePPC64_OpCom8(v *Value) bool { 1160 v_0 := v.Args[0] 1161 // match: (Com8 x) 1162 // result: (NOR x x) 1163 for { 1164 x := v_0 1165 v.reset(OpPPC64NOR) 1166 v.AddArg2(x, x) 1167 return true 1168 } 1169 } 1170 func rewriteValuePPC64_OpCondSelect(v *Value) bool { 1171 v_2 := v.Args[2] 1172 v_1 := v.Args[1] 1173 v_0 := v.Args[0] 1174 b := v.Block 1175 typ := &b.Func.Config.Types 1176 // match: (CondSelect x y bool) 1177 // cond: flagArg(bool) == nil 1178 // result: (ISEL [6] x y (Select1 <types.TypeFlags> (ANDCCconst [1] bool))) 1179 for { 1180 x := v_0 1181 y := v_1 1182 bool := v_2 1183 if !(flagArg(bool) == nil) { 1184 break 1185 } 1186 v.reset(OpPPC64ISEL) 1187 v.AuxInt = int32ToAuxInt(6) 1188 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags) 1189 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 1190 v1.AuxInt = int64ToAuxInt(1) 1191 v1.AddArg(bool) 1192 v0.AddArg(v1) 1193 v.AddArg3(x, y, v0) 1194 return true 1195 } 1196 return false 1197 } 1198 func rewriteValuePPC64_OpConst16(v *Value) bool { 1199 // match: (Const16 [val]) 1200 // result: (MOVDconst [int64(val)]) 1201 for { 1202 val := auxIntToInt16(v.AuxInt) 1203 v.reset(OpPPC64MOVDconst) 1204 v.AuxInt = int64ToAuxInt(int64(val)) 1205 return true 1206 } 1207 } 1208 func rewriteValuePPC64_OpConst32(v *Value) bool { 1209 // match: (Const32 [val]) 1210 // result: (MOVDconst [int64(val)]) 1211 for { 1212 val := auxIntToInt32(v.AuxInt) 1213 v.reset(OpPPC64MOVDconst) 1214 v.AuxInt = int64ToAuxInt(int64(val)) 1215 return true 1216 } 1217 } 1218 func rewriteValuePPC64_OpConst64(v *Value) bool { 1219 // match: (Const64 [val]) 1220 // result: (MOVDconst [int64(val)]) 1221 for { 1222 val := auxIntToInt64(v.AuxInt) 1223 v.reset(OpPPC64MOVDconst) 1224 v.AuxInt = int64ToAuxInt(int64(val)) 1225 return true 1226 } 1227 } 1228 func rewriteValuePPC64_OpConst8(v *Value) bool { 1229 // match: (Const8 [val]) 1230 // result: (MOVDconst [int64(val)]) 1231 for { 1232 val := auxIntToInt8(v.AuxInt) 1233 v.reset(OpPPC64MOVDconst) 1234 v.AuxInt = int64ToAuxInt(int64(val)) 1235 return true 1236 } 1237 } 1238 func rewriteValuePPC64_OpConstBool(v *Value) bool { 1239 // match: (ConstBool [t]) 1240 // result: (MOVDconst [b2i(t)]) 1241 for { 1242 t := auxIntToBool(v.AuxInt) 1243 v.reset(OpPPC64MOVDconst) 1244 v.AuxInt = int64ToAuxInt(b2i(t)) 1245 return true 1246 } 1247 } 1248 func rewriteValuePPC64_OpConstNil(v *Value) bool { 1249 // match: (ConstNil) 1250 // result: (MOVDconst [0]) 1251 for { 1252 v.reset(OpPPC64MOVDconst) 1253 v.AuxInt = int64ToAuxInt(0) 1254 return true 1255 } 1256 } 1257 func rewriteValuePPC64_OpCopysign(v *Value) bool { 1258 v_1 := v.Args[1] 1259 v_0 := v.Args[0] 1260 // match: (Copysign x y) 1261 // result: (FCPSGN y x) 1262 for { 1263 x := v_0 1264 y := v_1 1265 v.reset(OpPPC64FCPSGN) 1266 v.AddArg2(y, x) 1267 return true 1268 } 1269 } 1270 func rewriteValuePPC64_OpCtz16(v *Value) bool { 1271 v_0 := v.Args[0] 1272 b := v.Block 1273 typ := &b.Func.Config.Types 1274 // match: (Ctz16 x) 1275 // result: (POPCNTW (MOVHZreg (ANDN <typ.Int16> (ADDconst <typ.Int16> [-1] x) x))) 1276 for { 1277 x := v_0 1278 v.reset(OpPPC64POPCNTW) 1279 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64) 1280 v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int16) 1281 v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int16) 1282 v2.AuxInt = int64ToAuxInt(-1) 1283 v2.AddArg(x) 1284 v1.AddArg2(v2, x) 1285 v0.AddArg(v1) 1286 v.AddArg(v0) 1287 return true 1288 } 1289 } 1290 func rewriteValuePPC64_OpCtz32(v *Value) bool { 1291 v_0 := v.Args[0] 1292 b := v.Block 1293 typ := &b.Func.Config.Types 1294 // match: (Ctz32 x) 1295 // cond: buildcfg.GOPPC64<=8 1296 // result: (POPCNTW (MOVWZreg (ANDN <typ.Int> (ADDconst <typ.Int> [-1] x) x))) 1297 for { 1298 x := v_0 1299 if !(buildcfg.GOPPC64 <= 8) { 1300 break 1301 } 1302 v.reset(OpPPC64POPCNTW) 1303 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64) 1304 v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int) 1305 v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int) 1306 v2.AuxInt = int64ToAuxInt(-1) 1307 v2.AddArg(x) 1308 v1.AddArg2(v2, x) 1309 v0.AddArg(v1) 1310 v.AddArg(v0) 1311 return true 1312 } 1313 // match: (Ctz32 x) 1314 // result: (CNTTZW (MOVWZreg x)) 1315 for { 1316 x := v_0 1317 v.reset(OpPPC64CNTTZW) 1318 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64) 1319 v0.AddArg(x) 1320 v.AddArg(v0) 1321 return true 1322 } 1323 } 1324 func rewriteValuePPC64_OpCtz64(v *Value) bool { 1325 v_0 := v.Args[0] 1326 b := v.Block 1327 typ := &b.Func.Config.Types 1328 // match: (Ctz64 x) 1329 // cond: buildcfg.GOPPC64<=8 1330 // result: (POPCNTD (ANDN <typ.Int64> (ADDconst <typ.Int64> [-1] x) x)) 1331 for { 1332 x := v_0 1333 if !(buildcfg.GOPPC64 <= 8) { 1334 break 1335 } 1336 v.reset(OpPPC64POPCNTD) 1337 v0 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int64) 1338 v1 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int64) 1339 v1.AuxInt = int64ToAuxInt(-1) 1340 v1.AddArg(x) 1341 v0.AddArg2(v1, x) 1342 v.AddArg(v0) 1343 return true 1344 } 1345 // match: (Ctz64 x) 1346 // result: (CNTTZD x) 1347 for { 1348 x := v_0 1349 v.reset(OpPPC64CNTTZD) 1350 v.AddArg(x) 1351 return true 1352 } 1353 } 1354 func rewriteValuePPC64_OpCtz8(v *Value) bool { 1355 v_0 := v.Args[0] 1356 b := v.Block 1357 typ := &b.Func.Config.Types 1358 // match: (Ctz8 x) 1359 // result: (POPCNTB (MOVBZreg (ANDN <typ.UInt8> (ADDconst <typ.UInt8> [-1] x) x))) 1360 for { 1361 x := v_0 1362 v.reset(OpPPC64POPCNTB) 1363 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64) 1364 v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.UInt8) 1365 v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.UInt8) 1366 v2.AuxInt = int64ToAuxInt(-1) 1367 v2.AddArg(x) 1368 v1.AddArg2(v2, x) 1369 v0.AddArg(v1) 1370 v.AddArg(v0) 1371 return true 1372 } 1373 } 1374 func rewriteValuePPC64_OpCvt32Fto32(v *Value) bool { 1375 v_0 := v.Args[0] 1376 b := v.Block 1377 typ := &b.Func.Config.Types 1378 // match: (Cvt32Fto32 x) 1379 // result: (MFVSRD (FCTIWZ x)) 1380 for { 1381 x := v_0 1382 v.reset(OpPPC64MFVSRD) 1383 v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64) 1384 v0.AddArg(x) 1385 v.AddArg(v0) 1386 return true 1387 } 1388 } 1389 func rewriteValuePPC64_OpCvt32Fto64(v *Value) bool { 1390 v_0 := v.Args[0] 1391 b := v.Block 1392 typ := &b.Func.Config.Types 1393 // match: (Cvt32Fto64 x) 1394 // result: (MFVSRD (FCTIDZ x)) 1395 for { 1396 x := v_0 1397 v.reset(OpPPC64MFVSRD) 1398 v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64) 1399 v0.AddArg(x) 1400 v.AddArg(v0) 1401 return true 1402 } 1403 } 1404 func rewriteValuePPC64_OpCvt32to32F(v *Value) bool { 1405 v_0 := v.Args[0] 1406 b := v.Block 1407 typ := &b.Func.Config.Types 1408 // match: (Cvt32to32F x) 1409 // result: (FCFIDS (MTVSRD (SignExt32to64 x))) 1410 for { 1411 x := v_0 1412 v.reset(OpPPC64FCFIDS) 1413 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64) 1414 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 1415 v1.AddArg(x) 1416 v0.AddArg(v1) 1417 v.AddArg(v0) 1418 return true 1419 } 1420 } 1421 func rewriteValuePPC64_OpCvt32to64F(v *Value) bool { 1422 v_0 := v.Args[0] 1423 b := v.Block 1424 typ := &b.Func.Config.Types 1425 // match: (Cvt32to64F x) 1426 // result: (FCFID (MTVSRD (SignExt32to64 x))) 1427 for { 1428 x := v_0 1429 v.reset(OpPPC64FCFID) 1430 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64) 1431 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 1432 v1.AddArg(x) 1433 v0.AddArg(v1) 1434 v.AddArg(v0) 1435 return true 1436 } 1437 } 1438 func rewriteValuePPC64_OpCvt64Fto32(v *Value) bool { 1439 v_0 := v.Args[0] 1440 b := v.Block 1441 typ := &b.Func.Config.Types 1442 // match: (Cvt64Fto32 x) 1443 // result: (MFVSRD (FCTIWZ x)) 1444 for { 1445 x := v_0 1446 v.reset(OpPPC64MFVSRD) 1447 v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64) 1448 v0.AddArg(x) 1449 v.AddArg(v0) 1450 return true 1451 } 1452 } 1453 func rewriteValuePPC64_OpCvt64Fto64(v *Value) bool { 1454 v_0 := v.Args[0] 1455 b := v.Block 1456 typ := &b.Func.Config.Types 1457 // match: (Cvt64Fto64 x) 1458 // result: (MFVSRD (FCTIDZ x)) 1459 for { 1460 x := v_0 1461 v.reset(OpPPC64MFVSRD) 1462 v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64) 1463 v0.AddArg(x) 1464 v.AddArg(v0) 1465 return true 1466 } 1467 } 1468 func rewriteValuePPC64_OpCvt64to32F(v *Value) bool { 1469 v_0 := v.Args[0] 1470 b := v.Block 1471 typ := &b.Func.Config.Types 1472 // match: (Cvt64to32F x) 1473 // result: (FCFIDS (MTVSRD x)) 1474 for { 1475 x := v_0 1476 v.reset(OpPPC64FCFIDS) 1477 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64) 1478 v0.AddArg(x) 1479 v.AddArg(v0) 1480 return true 1481 } 1482 } 1483 func rewriteValuePPC64_OpCvt64to64F(v *Value) bool { 1484 v_0 := v.Args[0] 1485 b := v.Block 1486 typ := &b.Func.Config.Types 1487 // match: (Cvt64to64F x) 1488 // result: (FCFID (MTVSRD x)) 1489 for { 1490 x := v_0 1491 v.reset(OpPPC64FCFID) 1492 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64) 1493 v0.AddArg(x) 1494 v.AddArg(v0) 1495 return true 1496 } 1497 } 1498 func rewriteValuePPC64_OpDiv16(v *Value) bool { 1499 v_1 := v.Args[1] 1500 v_0 := v.Args[0] 1501 b := v.Block 1502 typ := &b.Func.Config.Types 1503 // match: (Div16 [false] x y) 1504 // result: (DIVW (SignExt16to32 x) (SignExt16to32 y)) 1505 for { 1506 if auxIntToBool(v.AuxInt) != false { 1507 break 1508 } 1509 x := v_0 1510 y := v_1 1511 v.reset(OpPPC64DIVW) 1512 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 1513 v0.AddArg(x) 1514 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 1515 v1.AddArg(y) 1516 v.AddArg2(v0, v1) 1517 return true 1518 } 1519 return false 1520 } 1521 func rewriteValuePPC64_OpDiv16u(v *Value) bool { 1522 v_1 := v.Args[1] 1523 v_0 := v.Args[0] 1524 b := v.Block 1525 typ := &b.Func.Config.Types 1526 // match: (Div16u x y) 1527 // result: (DIVWU (ZeroExt16to32 x) (ZeroExt16to32 y)) 1528 for { 1529 x := v_0 1530 y := v_1 1531 v.reset(OpPPC64DIVWU) 1532 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 1533 v0.AddArg(x) 1534 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 1535 v1.AddArg(y) 1536 v.AddArg2(v0, v1) 1537 return true 1538 } 1539 } 1540 func rewriteValuePPC64_OpDiv32(v *Value) bool { 1541 v_1 := v.Args[1] 1542 v_0 := v.Args[0] 1543 // match: (Div32 [false] x y) 1544 // result: (DIVW x y) 1545 for { 1546 if auxIntToBool(v.AuxInt) != false { 1547 break 1548 } 1549 x := v_0 1550 y := v_1 1551 v.reset(OpPPC64DIVW) 1552 v.AddArg2(x, y) 1553 return true 1554 } 1555 return false 1556 } 1557 func rewriteValuePPC64_OpDiv64(v *Value) bool { 1558 v_1 := v.Args[1] 1559 v_0 := v.Args[0] 1560 // match: (Div64 [false] x y) 1561 // result: (DIVD x y) 1562 for { 1563 if auxIntToBool(v.AuxInt) != false { 1564 break 1565 } 1566 x := v_0 1567 y := v_1 1568 v.reset(OpPPC64DIVD) 1569 v.AddArg2(x, y) 1570 return true 1571 } 1572 return false 1573 } 1574 func rewriteValuePPC64_OpDiv8(v *Value) bool { 1575 v_1 := v.Args[1] 1576 v_0 := v.Args[0] 1577 b := v.Block 1578 typ := &b.Func.Config.Types 1579 // match: (Div8 x y) 1580 // result: (DIVW (SignExt8to32 x) (SignExt8to32 y)) 1581 for { 1582 x := v_0 1583 y := v_1 1584 v.reset(OpPPC64DIVW) 1585 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 1586 v0.AddArg(x) 1587 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 1588 v1.AddArg(y) 1589 v.AddArg2(v0, v1) 1590 return true 1591 } 1592 } 1593 func rewriteValuePPC64_OpDiv8u(v *Value) bool { 1594 v_1 := v.Args[1] 1595 v_0 := v.Args[0] 1596 b := v.Block 1597 typ := &b.Func.Config.Types 1598 // match: (Div8u x y) 1599 // result: (DIVWU (ZeroExt8to32 x) (ZeroExt8to32 y)) 1600 for { 1601 x := v_0 1602 y := v_1 1603 v.reset(OpPPC64DIVWU) 1604 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 1605 v0.AddArg(x) 1606 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 1607 v1.AddArg(y) 1608 v.AddArg2(v0, v1) 1609 return true 1610 } 1611 } 1612 func rewriteValuePPC64_OpEq16(v *Value) bool { 1613 v_1 := v.Args[1] 1614 v_0 := v.Args[0] 1615 b := v.Block 1616 typ := &b.Func.Config.Types 1617 // match: (Eq16 x y) 1618 // cond: isSigned(x.Type) && isSigned(y.Type) 1619 // result: (Equal (CMPW (SignExt16to32 x) (SignExt16to32 y))) 1620 for { 1621 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 1622 x := v_0 1623 y := v_1 1624 if !(isSigned(x.Type) && isSigned(y.Type)) { 1625 continue 1626 } 1627 v.reset(OpPPC64Equal) 1628 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags) 1629 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 1630 v1.AddArg(x) 1631 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 1632 v2.AddArg(y) 1633 v0.AddArg2(v1, v2) 1634 v.AddArg(v0) 1635 return true 1636 } 1637 break 1638 } 1639 // match: (Eq16 x y) 1640 // result: (Equal (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y))) 1641 for { 1642 x := v_0 1643 y := v_1 1644 v.reset(OpPPC64Equal) 1645 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags) 1646 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 1647 v1.AddArg(x) 1648 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 1649 v2.AddArg(y) 1650 v0.AddArg2(v1, v2) 1651 v.AddArg(v0) 1652 return true 1653 } 1654 } 1655 func rewriteValuePPC64_OpEq32(v *Value) bool { 1656 v_1 := v.Args[1] 1657 v_0 := v.Args[0] 1658 b := v.Block 1659 // match: (Eq32 x y) 1660 // result: (Equal (CMPW x y)) 1661 for { 1662 x := v_0 1663 y := v_1 1664 v.reset(OpPPC64Equal) 1665 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags) 1666 v0.AddArg2(x, y) 1667 v.AddArg(v0) 1668 return true 1669 } 1670 } 1671 func rewriteValuePPC64_OpEq32F(v *Value) bool { 1672 v_1 := v.Args[1] 1673 v_0 := v.Args[0] 1674 b := v.Block 1675 // match: (Eq32F x y) 1676 // result: (Equal (FCMPU x y)) 1677 for { 1678 x := v_0 1679 y := v_1 1680 v.reset(OpPPC64Equal) 1681 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags) 1682 v0.AddArg2(x, y) 1683 v.AddArg(v0) 1684 return true 1685 } 1686 } 1687 func rewriteValuePPC64_OpEq64(v *Value) bool { 1688 v_1 := v.Args[1] 1689 v_0 := v.Args[0] 1690 b := v.Block 1691 // match: (Eq64 x y) 1692 // result: (Equal (CMP x y)) 1693 for { 1694 x := v_0 1695 y := v_1 1696 v.reset(OpPPC64Equal) 1697 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags) 1698 v0.AddArg2(x, y) 1699 v.AddArg(v0) 1700 return true 1701 } 1702 } 1703 func rewriteValuePPC64_OpEq64F(v *Value) bool { 1704 v_1 := v.Args[1] 1705 v_0 := v.Args[0] 1706 b := v.Block 1707 // match: (Eq64F x y) 1708 // result: (Equal (FCMPU x y)) 1709 for { 1710 x := v_0 1711 y := v_1 1712 v.reset(OpPPC64Equal) 1713 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags) 1714 v0.AddArg2(x, y) 1715 v.AddArg(v0) 1716 return true 1717 } 1718 } 1719 func rewriteValuePPC64_OpEq8(v *Value) bool { 1720 v_1 := v.Args[1] 1721 v_0 := v.Args[0] 1722 b := v.Block 1723 typ := &b.Func.Config.Types 1724 // match: (Eq8 x y) 1725 // cond: isSigned(x.Type) && isSigned(y.Type) 1726 // result: (Equal (CMPW (SignExt8to32 x) (SignExt8to32 y))) 1727 for { 1728 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 1729 x := v_0 1730 y := v_1 1731 if !(isSigned(x.Type) && isSigned(y.Type)) { 1732 continue 1733 } 1734 v.reset(OpPPC64Equal) 1735 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags) 1736 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 1737 v1.AddArg(x) 1738 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 1739 v2.AddArg(y) 1740 v0.AddArg2(v1, v2) 1741 v.AddArg(v0) 1742 return true 1743 } 1744 break 1745 } 1746 // match: (Eq8 x y) 1747 // result: (Equal (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y))) 1748 for { 1749 x := v_0 1750 y := v_1 1751 v.reset(OpPPC64Equal) 1752 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags) 1753 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 1754 v1.AddArg(x) 1755 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 1756 v2.AddArg(y) 1757 v0.AddArg2(v1, v2) 1758 v.AddArg(v0) 1759 return true 1760 } 1761 } 1762 func rewriteValuePPC64_OpEqB(v *Value) bool { 1763 v_1 := v.Args[1] 1764 v_0 := v.Args[0] 1765 b := v.Block 1766 typ := &b.Func.Config.Types 1767 // match: (EqB x y) 1768 // result: (Select0 <typ.Int> (ANDCCconst [1] (EQV x y))) 1769 for { 1770 x := v_0 1771 y := v_1 1772 v.reset(OpSelect0) 1773 v.Type = typ.Int 1774 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 1775 v0.AuxInt = int64ToAuxInt(1) 1776 v1 := b.NewValue0(v.Pos, OpPPC64EQV, typ.Int64) 1777 v1.AddArg2(x, y) 1778 v0.AddArg(v1) 1779 v.AddArg(v0) 1780 return true 1781 } 1782 } 1783 func rewriteValuePPC64_OpEqPtr(v *Value) bool { 1784 v_1 := v.Args[1] 1785 v_0 := v.Args[0] 1786 b := v.Block 1787 // match: (EqPtr x y) 1788 // result: (Equal (CMP x y)) 1789 for { 1790 x := v_0 1791 y := v_1 1792 v.reset(OpPPC64Equal) 1793 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags) 1794 v0.AddArg2(x, y) 1795 v.AddArg(v0) 1796 return true 1797 } 1798 } 1799 func rewriteValuePPC64_OpIsInBounds(v *Value) bool { 1800 v_1 := v.Args[1] 1801 v_0 := v.Args[0] 1802 b := v.Block 1803 // match: (IsInBounds idx len) 1804 // result: (LessThan (CMPU idx len)) 1805 for { 1806 idx := v_0 1807 len := v_1 1808 v.reset(OpPPC64LessThan) 1809 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 1810 v0.AddArg2(idx, len) 1811 v.AddArg(v0) 1812 return true 1813 } 1814 } 1815 func rewriteValuePPC64_OpIsNonNil(v *Value) bool { 1816 v_0 := v.Args[0] 1817 b := v.Block 1818 // match: (IsNonNil ptr) 1819 // result: (NotEqual (CMPconst [0] ptr)) 1820 for { 1821 ptr := v_0 1822 v.reset(OpPPC64NotEqual) 1823 v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags) 1824 v0.AuxInt = int64ToAuxInt(0) 1825 v0.AddArg(ptr) 1826 v.AddArg(v0) 1827 return true 1828 } 1829 } 1830 func rewriteValuePPC64_OpIsSliceInBounds(v *Value) bool { 1831 v_1 := v.Args[1] 1832 v_0 := v.Args[0] 1833 b := v.Block 1834 // match: (IsSliceInBounds idx len) 1835 // result: (LessEqual (CMPU idx len)) 1836 for { 1837 idx := v_0 1838 len := v_1 1839 v.reset(OpPPC64LessEqual) 1840 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 1841 v0.AddArg2(idx, len) 1842 v.AddArg(v0) 1843 return true 1844 } 1845 } 1846 func rewriteValuePPC64_OpLeq16(v *Value) bool { 1847 v_1 := v.Args[1] 1848 v_0 := v.Args[0] 1849 b := v.Block 1850 typ := &b.Func.Config.Types 1851 // match: (Leq16 x y) 1852 // result: (LessEqual (CMPW (SignExt16to32 x) (SignExt16to32 y))) 1853 for { 1854 x := v_0 1855 y := v_1 1856 v.reset(OpPPC64LessEqual) 1857 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags) 1858 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 1859 v1.AddArg(x) 1860 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 1861 v2.AddArg(y) 1862 v0.AddArg2(v1, v2) 1863 v.AddArg(v0) 1864 return true 1865 } 1866 } 1867 func rewriteValuePPC64_OpLeq16U(v *Value) bool { 1868 v_1 := v.Args[1] 1869 v_0 := v.Args[0] 1870 b := v.Block 1871 typ := &b.Func.Config.Types 1872 // match: (Leq16U x y) 1873 // result: (LessEqual (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y))) 1874 for { 1875 x := v_0 1876 y := v_1 1877 v.reset(OpPPC64LessEqual) 1878 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags) 1879 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 1880 v1.AddArg(x) 1881 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 1882 v2.AddArg(y) 1883 v0.AddArg2(v1, v2) 1884 v.AddArg(v0) 1885 return true 1886 } 1887 } 1888 func rewriteValuePPC64_OpLeq32(v *Value) bool { 1889 v_1 := v.Args[1] 1890 v_0 := v.Args[0] 1891 b := v.Block 1892 // match: (Leq32 x y) 1893 // result: (LessEqual (CMPW x y)) 1894 for { 1895 x := v_0 1896 y := v_1 1897 v.reset(OpPPC64LessEqual) 1898 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags) 1899 v0.AddArg2(x, y) 1900 v.AddArg(v0) 1901 return true 1902 } 1903 } 1904 func rewriteValuePPC64_OpLeq32F(v *Value) bool { 1905 v_1 := v.Args[1] 1906 v_0 := v.Args[0] 1907 b := v.Block 1908 // match: (Leq32F x y) 1909 // result: (FLessEqual (FCMPU x y)) 1910 for { 1911 x := v_0 1912 y := v_1 1913 v.reset(OpPPC64FLessEqual) 1914 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags) 1915 v0.AddArg2(x, y) 1916 v.AddArg(v0) 1917 return true 1918 } 1919 } 1920 func rewriteValuePPC64_OpLeq32U(v *Value) bool { 1921 v_1 := v.Args[1] 1922 v_0 := v.Args[0] 1923 b := v.Block 1924 // match: (Leq32U x y) 1925 // result: (LessEqual (CMPWU x y)) 1926 for { 1927 x := v_0 1928 y := v_1 1929 v.reset(OpPPC64LessEqual) 1930 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags) 1931 v0.AddArg2(x, y) 1932 v.AddArg(v0) 1933 return true 1934 } 1935 } 1936 func rewriteValuePPC64_OpLeq64(v *Value) bool { 1937 v_1 := v.Args[1] 1938 v_0 := v.Args[0] 1939 b := v.Block 1940 // match: (Leq64 x y) 1941 // result: (LessEqual (CMP x y)) 1942 for { 1943 x := v_0 1944 y := v_1 1945 v.reset(OpPPC64LessEqual) 1946 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags) 1947 v0.AddArg2(x, y) 1948 v.AddArg(v0) 1949 return true 1950 } 1951 } 1952 func rewriteValuePPC64_OpLeq64F(v *Value) bool { 1953 v_1 := v.Args[1] 1954 v_0 := v.Args[0] 1955 b := v.Block 1956 // match: (Leq64F x y) 1957 // result: (FLessEqual (FCMPU x y)) 1958 for { 1959 x := v_0 1960 y := v_1 1961 v.reset(OpPPC64FLessEqual) 1962 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags) 1963 v0.AddArg2(x, y) 1964 v.AddArg(v0) 1965 return true 1966 } 1967 } 1968 func rewriteValuePPC64_OpLeq64U(v *Value) bool { 1969 v_1 := v.Args[1] 1970 v_0 := v.Args[0] 1971 b := v.Block 1972 // match: (Leq64U x y) 1973 // result: (LessEqual (CMPU x y)) 1974 for { 1975 x := v_0 1976 y := v_1 1977 v.reset(OpPPC64LessEqual) 1978 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 1979 v0.AddArg2(x, y) 1980 v.AddArg(v0) 1981 return true 1982 } 1983 } 1984 func rewriteValuePPC64_OpLeq8(v *Value) bool { 1985 v_1 := v.Args[1] 1986 v_0 := v.Args[0] 1987 b := v.Block 1988 typ := &b.Func.Config.Types 1989 // match: (Leq8 x y) 1990 // result: (LessEqual (CMPW (SignExt8to32 x) (SignExt8to32 y))) 1991 for { 1992 x := v_0 1993 y := v_1 1994 v.reset(OpPPC64LessEqual) 1995 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags) 1996 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 1997 v1.AddArg(x) 1998 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 1999 v2.AddArg(y) 2000 v0.AddArg2(v1, v2) 2001 v.AddArg(v0) 2002 return true 2003 } 2004 } 2005 func rewriteValuePPC64_OpLeq8U(v *Value) bool { 2006 v_1 := v.Args[1] 2007 v_0 := v.Args[0] 2008 b := v.Block 2009 typ := &b.Func.Config.Types 2010 // match: (Leq8U x y) 2011 // result: (LessEqual (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y))) 2012 for { 2013 x := v_0 2014 y := v_1 2015 v.reset(OpPPC64LessEqual) 2016 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags) 2017 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 2018 v1.AddArg(x) 2019 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 2020 v2.AddArg(y) 2021 v0.AddArg2(v1, v2) 2022 v.AddArg(v0) 2023 return true 2024 } 2025 } 2026 func rewriteValuePPC64_OpLess16(v *Value) bool { 2027 v_1 := v.Args[1] 2028 v_0 := v.Args[0] 2029 b := v.Block 2030 typ := &b.Func.Config.Types 2031 // match: (Less16 x y) 2032 // result: (LessThan (CMPW (SignExt16to32 x) (SignExt16to32 y))) 2033 for { 2034 x := v_0 2035 y := v_1 2036 v.reset(OpPPC64LessThan) 2037 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags) 2038 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 2039 v1.AddArg(x) 2040 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 2041 v2.AddArg(y) 2042 v0.AddArg2(v1, v2) 2043 v.AddArg(v0) 2044 return true 2045 } 2046 } 2047 func rewriteValuePPC64_OpLess16U(v *Value) bool { 2048 v_1 := v.Args[1] 2049 v_0 := v.Args[0] 2050 b := v.Block 2051 typ := &b.Func.Config.Types 2052 // match: (Less16U x y) 2053 // result: (LessThan (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y))) 2054 for { 2055 x := v_0 2056 y := v_1 2057 v.reset(OpPPC64LessThan) 2058 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags) 2059 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 2060 v1.AddArg(x) 2061 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 2062 v2.AddArg(y) 2063 v0.AddArg2(v1, v2) 2064 v.AddArg(v0) 2065 return true 2066 } 2067 } 2068 func rewriteValuePPC64_OpLess32(v *Value) bool { 2069 v_1 := v.Args[1] 2070 v_0 := v.Args[0] 2071 b := v.Block 2072 // match: (Less32 x y) 2073 // result: (LessThan (CMPW x y)) 2074 for { 2075 x := v_0 2076 y := v_1 2077 v.reset(OpPPC64LessThan) 2078 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags) 2079 v0.AddArg2(x, y) 2080 v.AddArg(v0) 2081 return true 2082 } 2083 } 2084 func rewriteValuePPC64_OpLess32F(v *Value) bool { 2085 v_1 := v.Args[1] 2086 v_0 := v.Args[0] 2087 b := v.Block 2088 // match: (Less32F x y) 2089 // result: (FLessThan (FCMPU x y)) 2090 for { 2091 x := v_0 2092 y := v_1 2093 v.reset(OpPPC64FLessThan) 2094 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags) 2095 v0.AddArg2(x, y) 2096 v.AddArg(v0) 2097 return true 2098 } 2099 } 2100 func rewriteValuePPC64_OpLess32U(v *Value) bool { 2101 v_1 := v.Args[1] 2102 v_0 := v.Args[0] 2103 b := v.Block 2104 // match: (Less32U x y) 2105 // result: (LessThan (CMPWU x y)) 2106 for { 2107 x := v_0 2108 y := v_1 2109 v.reset(OpPPC64LessThan) 2110 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags) 2111 v0.AddArg2(x, y) 2112 v.AddArg(v0) 2113 return true 2114 } 2115 } 2116 func rewriteValuePPC64_OpLess64(v *Value) bool { 2117 v_1 := v.Args[1] 2118 v_0 := v.Args[0] 2119 b := v.Block 2120 // match: (Less64 x y) 2121 // result: (LessThan (CMP x y)) 2122 for { 2123 x := v_0 2124 y := v_1 2125 v.reset(OpPPC64LessThan) 2126 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags) 2127 v0.AddArg2(x, y) 2128 v.AddArg(v0) 2129 return true 2130 } 2131 } 2132 func rewriteValuePPC64_OpLess64F(v *Value) bool { 2133 v_1 := v.Args[1] 2134 v_0 := v.Args[0] 2135 b := v.Block 2136 // match: (Less64F x y) 2137 // result: (FLessThan (FCMPU x y)) 2138 for { 2139 x := v_0 2140 y := v_1 2141 v.reset(OpPPC64FLessThan) 2142 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags) 2143 v0.AddArg2(x, y) 2144 v.AddArg(v0) 2145 return true 2146 } 2147 } 2148 func rewriteValuePPC64_OpLess64U(v *Value) bool { 2149 v_1 := v.Args[1] 2150 v_0 := v.Args[0] 2151 b := v.Block 2152 // match: (Less64U x y) 2153 // result: (LessThan (CMPU x y)) 2154 for { 2155 x := v_0 2156 y := v_1 2157 v.reset(OpPPC64LessThan) 2158 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 2159 v0.AddArg2(x, y) 2160 v.AddArg(v0) 2161 return true 2162 } 2163 } 2164 func rewriteValuePPC64_OpLess8(v *Value) bool { 2165 v_1 := v.Args[1] 2166 v_0 := v.Args[0] 2167 b := v.Block 2168 typ := &b.Func.Config.Types 2169 // match: (Less8 x y) 2170 // result: (LessThan (CMPW (SignExt8to32 x) (SignExt8to32 y))) 2171 for { 2172 x := v_0 2173 y := v_1 2174 v.reset(OpPPC64LessThan) 2175 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags) 2176 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 2177 v1.AddArg(x) 2178 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 2179 v2.AddArg(y) 2180 v0.AddArg2(v1, v2) 2181 v.AddArg(v0) 2182 return true 2183 } 2184 } 2185 func rewriteValuePPC64_OpLess8U(v *Value) bool { 2186 v_1 := v.Args[1] 2187 v_0 := v.Args[0] 2188 b := v.Block 2189 typ := &b.Func.Config.Types 2190 // match: (Less8U x y) 2191 // result: (LessThan (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y))) 2192 for { 2193 x := v_0 2194 y := v_1 2195 v.reset(OpPPC64LessThan) 2196 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags) 2197 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 2198 v1.AddArg(x) 2199 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 2200 v2.AddArg(y) 2201 v0.AddArg2(v1, v2) 2202 v.AddArg(v0) 2203 return true 2204 } 2205 } 2206 func rewriteValuePPC64_OpLoad(v *Value) bool { 2207 v_1 := v.Args[1] 2208 v_0 := v.Args[0] 2209 b := v.Block 2210 typ := &b.Func.Config.Types 2211 // match: (Load <t> ptr mem) 2212 // cond: (is64BitInt(t) || isPtr(t)) 2213 // result: (MOVDload ptr mem) 2214 for { 2215 t := v.Type 2216 ptr := v_0 2217 mem := v_1 2218 if !(is64BitInt(t) || isPtr(t)) { 2219 break 2220 } 2221 v.reset(OpPPC64MOVDload) 2222 v.AddArg2(ptr, mem) 2223 return true 2224 } 2225 // match: (Load <t> ptr mem) 2226 // cond: is32BitInt(t) && isSigned(t) 2227 // result: (MOVWload ptr mem) 2228 for { 2229 t := v.Type 2230 ptr := v_0 2231 mem := v_1 2232 if !(is32BitInt(t) && isSigned(t)) { 2233 break 2234 } 2235 v.reset(OpPPC64MOVWload) 2236 v.AddArg2(ptr, mem) 2237 return true 2238 } 2239 // match: (Load <t> ptr mem) 2240 // cond: is32BitInt(t) && !isSigned(t) 2241 // result: (MOVWZload ptr mem) 2242 for { 2243 t := v.Type 2244 ptr := v_0 2245 mem := v_1 2246 if !(is32BitInt(t) && !isSigned(t)) { 2247 break 2248 } 2249 v.reset(OpPPC64MOVWZload) 2250 v.AddArg2(ptr, mem) 2251 return true 2252 } 2253 // match: (Load <t> ptr mem) 2254 // cond: is16BitInt(t) && isSigned(t) 2255 // result: (MOVHload ptr mem) 2256 for { 2257 t := v.Type 2258 ptr := v_0 2259 mem := v_1 2260 if !(is16BitInt(t) && isSigned(t)) { 2261 break 2262 } 2263 v.reset(OpPPC64MOVHload) 2264 v.AddArg2(ptr, mem) 2265 return true 2266 } 2267 // match: (Load <t> ptr mem) 2268 // cond: is16BitInt(t) && !isSigned(t) 2269 // result: (MOVHZload ptr mem) 2270 for { 2271 t := v.Type 2272 ptr := v_0 2273 mem := v_1 2274 if !(is16BitInt(t) && !isSigned(t)) { 2275 break 2276 } 2277 v.reset(OpPPC64MOVHZload) 2278 v.AddArg2(ptr, mem) 2279 return true 2280 } 2281 // match: (Load <t> ptr mem) 2282 // cond: t.IsBoolean() 2283 // result: (MOVBZload ptr mem) 2284 for { 2285 t := v.Type 2286 ptr := v_0 2287 mem := v_1 2288 if !(t.IsBoolean()) { 2289 break 2290 } 2291 v.reset(OpPPC64MOVBZload) 2292 v.AddArg2(ptr, mem) 2293 return true 2294 } 2295 // match: (Load <t> ptr mem) 2296 // cond: is8BitInt(t) && isSigned(t) 2297 // result: (MOVBreg (MOVBZload ptr mem)) 2298 for { 2299 t := v.Type 2300 ptr := v_0 2301 mem := v_1 2302 if !(is8BitInt(t) && isSigned(t)) { 2303 break 2304 } 2305 v.reset(OpPPC64MOVBreg) 2306 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8) 2307 v0.AddArg2(ptr, mem) 2308 v.AddArg(v0) 2309 return true 2310 } 2311 // match: (Load <t> ptr mem) 2312 // cond: is8BitInt(t) && !isSigned(t) 2313 // result: (MOVBZload ptr mem) 2314 for { 2315 t := v.Type 2316 ptr := v_0 2317 mem := v_1 2318 if !(is8BitInt(t) && !isSigned(t)) { 2319 break 2320 } 2321 v.reset(OpPPC64MOVBZload) 2322 v.AddArg2(ptr, mem) 2323 return true 2324 } 2325 // match: (Load <t> ptr mem) 2326 // cond: is32BitFloat(t) 2327 // result: (FMOVSload ptr mem) 2328 for { 2329 t := v.Type 2330 ptr := v_0 2331 mem := v_1 2332 if !(is32BitFloat(t)) { 2333 break 2334 } 2335 v.reset(OpPPC64FMOVSload) 2336 v.AddArg2(ptr, mem) 2337 return true 2338 } 2339 // match: (Load <t> ptr mem) 2340 // cond: is64BitFloat(t) 2341 // result: (FMOVDload ptr mem) 2342 for { 2343 t := v.Type 2344 ptr := v_0 2345 mem := v_1 2346 if !(is64BitFloat(t)) { 2347 break 2348 } 2349 v.reset(OpPPC64FMOVDload) 2350 v.AddArg2(ptr, mem) 2351 return true 2352 } 2353 return false 2354 } 2355 func rewriteValuePPC64_OpLocalAddr(v *Value) bool { 2356 v_0 := v.Args[0] 2357 // match: (LocalAddr {sym} base _) 2358 // result: (MOVDaddr {sym} base) 2359 for { 2360 sym := auxToSym(v.Aux) 2361 base := v_0 2362 v.reset(OpPPC64MOVDaddr) 2363 v.Aux = symToAux(sym) 2364 v.AddArg(base) 2365 return true 2366 } 2367 } 2368 func rewriteValuePPC64_OpLsh16x16(v *Value) bool { 2369 v_1 := v.Args[1] 2370 v_0 := v.Args[0] 2371 b := v.Block 2372 typ := &b.Func.Config.Types 2373 // match: (Lsh16x16 x y) 2374 // cond: shiftIsBounded(v) 2375 // result: (SLW x y) 2376 for { 2377 x := v_0 2378 y := v_1 2379 if !(shiftIsBounded(v)) { 2380 break 2381 } 2382 v.reset(OpPPC64SLW) 2383 v.AddArg2(x, y) 2384 return true 2385 } 2386 // match: (Lsh16x16 x y) 2387 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [16])))) 2388 for { 2389 x := v_0 2390 y := v_1 2391 v.reset(OpPPC64SLW) 2392 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 2393 v0.AuxInt = int32ToAuxInt(0) 2394 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2395 v1.AuxInt = int64ToAuxInt(-1) 2396 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 2397 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 2398 v3.AddArg(y) 2399 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2400 v4.AuxInt = int64ToAuxInt(16) 2401 v2.AddArg2(v3, v4) 2402 v0.AddArg3(y, v1, v2) 2403 v.AddArg2(x, v0) 2404 return true 2405 } 2406 } 2407 func rewriteValuePPC64_OpLsh16x32(v *Value) bool { 2408 v_1 := v.Args[1] 2409 v_0 := v.Args[0] 2410 b := v.Block 2411 typ := &b.Func.Config.Types 2412 // match: (Lsh16x32 x y) 2413 // cond: shiftIsBounded(v) 2414 // result: (SLW x y) 2415 for { 2416 x := v_0 2417 y := v_1 2418 if !(shiftIsBounded(v)) { 2419 break 2420 } 2421 v.reset(OpPPC64SLW) 2422 v.AddArg2(x, y) 2423 return true 2424 } 2425 // match: (Lsh16x32 x y) 2426 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [16])))) 2427 for { 2428 x := v_0 2429 y := v_1 2430 v.reset(OpPPC64SLW) 2431 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 2432 v0.AuxInt = int32ToAuxInt(0) 2433 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2434 v1.AuxInt = int64ToAuxInt(-1) 2435 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 2436 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2437 v3.AuxInt = int64ToAuxInt(16) 2438 v2.AddArg2(y, v3) 2439 v0.AddArg3(y, v1, v2) 2440 v.AddArg2(x, v0) 2441 return true 2442 } 2443 } 2444 func rewriteValuePPC64_OpLsh16x64(v *Value) bool { 2445 v_1 := v.Args[1] 2446 v_0 := v.Args[0] 2447 b := v.Block 2448 typ := &b.Func.Config.Types 2449 // match: (Lsh16x64 x (MOVDconst [c])) 2450 // cond: uint64(c) < 16 2451 // result: (SLWconst x [c]) 2452 for { 2453 x := v_0 2454 if v_1.Op != OpPPC64MOVDconst { 2455 break 2456 } 2457 c := auxIntToInt64(v_1.AuxInt) 2458 if !(uint64(c) < 16) { 2459 break 2460 } 2461 v.reset(OpPPC64SLWconst) 2462 v.AuxInt = int64ToAuxInt(c) 2463 v.AddArg(x) 2464 return true 2465 } 2466 // match: (Lsh16x64 x y) 2467 // cond: shiftIsBounded(v) 2468 // result: (SLW x y) 2469 for { 2470 x := v_0 2471 y := v_1 2472 if !(shiftIsBounded(v)) { 2473 break 2474 } 2475 v.reset(OpPPC64SLW) 2476 v.AddArg2(x, y) 2477 return true 2478 } 2479 // match: (Lsh16x64 x y) 2480 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [16])))) 2481 for { 2482 x := v_0 2483 y := v_1 2484 v.reset(OpPPC64SLW) 2485 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 2486 v0.AuxInt = int32ToAuxInt(0) 2487 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2488 v1.AuxInt = int64ToAuxInt(-1) 2489 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 2490 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2491 v3.AuxInt = int64ToAuxInt(16) 2492 v2.AddArg2(y, v3) 2493 v0.AddArg3(y, v1, v2) 2494 v.AddArg2(x, v0) 2495 return true 2496 } 2497 } 2498 func rewriteValuePPC64_OpLsh16x8(v *Value) bool { 2499 v_1 := v.Args[1] 2500 v_0 := v.Args[0] 2501 b := v.Block 2502 typ := &b.Func.Config.Types 2503 // match: (Lsh16x8 x y) 2504 // cond: shiftIsBounded(v) 2505 // result: (SLW x y) 2506 for { 2507 x := v_0 2508 y := v_1 2509 if !(shiftIsBounded(v)) { 2510 break 2511 } 2512 v.reset(OpPPC64SLW) 2513 v.AddArg2(x, y) 2514 return true 2515 } 2516 // match: (Lsh16x8 x y) 2517 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [16])))) 2518 for { 2519 x := v_0 2520 y := v_1 2521 v.reset(OpPPC64SLW) 2522 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 2523 v0.AuxInt = int32ToAuxInt(0) 2524 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2525 v1.AuxInt = int64ToAuxInt(-1) 2526 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 2527 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 2528 v3.AddArg(y) 2529 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2530 v4.AuxInt = int64ToAuxInt(16) 2531 v2.AddArg2(v3, v4) 2532 v0.AddArg3(y, v1, v2) 2533 v.AddArg2(x, v0) 2534 return true 2535 } 2536 } 2537 func rewriteValuePPC64_OpLsh32x16(v *Value) bool { 2538 v_1 := v.Args[1] 2539 v_0 := v.Args[0] 2540 b := v.Block 2541 typ := &b.Func.Config.Types 2542 // match: (Lsh32x16 x y) 2543 // cond: shiftIsBounded(v) 2544 // result: (SLW x y) 2545 for { 2546 x := v_0 2547 y := v_1 2548 if !(shiftIsBounded(v)) { 2549 break 2550 } 2551 v.reset(OpPPC64SLW) 2552 v.AddArg2(x, y) 2553 return true 2554 } 2555 // match: (Lsh32x16 x y) 2556 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [32])))) 2557 for { 2558 x := v_0 2559 y := v_1 2560 v.reset(OpPPC64SLW) 2561 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 2562 v0.AuxInt = int32ToAuxInt(0) 2563 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2564 v1.AuxInt = int64ToAuxInt(-1) 2565 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 2566 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 2567 v3.AddArg(y) 2568 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2569 v4.AuxInt = int64ToAuxInt(32) 2570 v2.AddArg2(v3, v4) 2571 v0.AddArg3(y, v1, v2) 2572 v.AddArg2(x, v0) 2573 return true 2574 } 2575 } 2576 func rewriteValuePPC64_OpLsh32x32(v *Value) bool { 2577 v_1 := v.Args[1] 2578 v_0 := v.Args[0] 2579 b := v.Block 2580 typ := &b.Func.Config.Types 2581 // match: (Lsh32x32 x y) 2582 // cond: shiftIsBounded(v) 2583 // result: (SLW x y) 2584 for { 2585 x := v_0 2586 y := v_1 2587 if !(shiftIsBounded(v)) { 2588 break 2589 } 2590 v.reset(OpPPC64SLW) 2591 v.AddArg2(x, y) 2592 return true 2593 } 2594 // match: (Lsh32x32 x y) 2595 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [32])))) 2596 for { 2597 x := v_0 2598 y := v_1 2599 v.reset(OpPPC64SLW) 2600 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 2601 v0.AuxInt = int32ToAuxInt(0) 2602 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2603 v1.AuxInt = int64ToAuxInt(-1) 2604 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 2605 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2606 v3.AuxInt = int64ToAuxInt(32) 2607 v2.AddArg2(y, v3) 2608 v0.AddArg3(y, v1, v2) 2609 v.AddArg2(x, v0) 2610 return true 2611 } 2612 } 2613 func rewriteValuePPC64_OpLsh32x64(v *Value) bool { 2614 v_1 := v.Args[1] 2615 v_0 := v.Args[0] 2616 b := v.Block 2617 typ := &b.Func.Config.Types 2618 // match: (Lsh32x64 x (MOVDconst [c])) 2619 // cond: uint64(c) < 32 2620 // result: (SLWconst x [c]) 2621 for { 2622 x := v_0 2623 if v_1.Op != OpPPC64MOVDconst { 2624 break 2625 } 2626 c := auxIntToInt64(v_1.AuxInt) 2627 if !(uint64(c) < 32) { 2628 break 2629 } 2630 v.reset(OpPPC64SLWconst) 2631 v.AuxInt = int64ToAuxInt(c) 2632 v.AddArg(x) 2633 return true 2634 } 2635 // match: (Lsh32x64 x y) 2636 // cond: shiftIsBounded(v) 2637 // result: (SLW x y) 2638 for { 2639 x := v_0 2640 y := v_1 2641 if !(shiftIsBounded(v)) { 2642 break 2643 } 2644 v.reset(OpPPC64SLW) 2645 v.AddArg2(x, y) 2646 return true 2647 } 2648 // match: (Lsh32x64 x y) 2649 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [32])))) 2650 for { 2651 x := v_0 2652 y := v_1 2653 v.reset(OpPPC64SLW) 2654 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 2655 v0.AuxInt = int32ToAuxInt(0) 2656 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2657 v1.AuxInt = int64ToAuxInt(-1) 2658 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 2659 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2660 v3.AuxInt = int64ToAuxInt(32) 2661 v2.AddArg2(y, v3) 2662 v0.AddArg3(y, v1, v2) 2663 v.AddArg2(x, v0) 2664 return true 2665 } 2666 } 2667 func rewriteValuePPC64_OpLsh32x8(v *Value) bool { 2668 v_1 := v.Args[1] 2669 v_0 := v.Args[0] 2670 b := v.Block 2671 typ := &b.Func.Config.Types 2672 // match: (Lsh32x8 x y) 2673 // cond: shiftIsBounded(v) 2674 // result: (SLW x y) 2675 for { 2676 x := v_0 2677 y := v_1 2678 if !(shiftIsBounded(v)) { 2679 break 2680 } 2681 v.reset(OpPPC64SLW) 2682 v.AddArg2(x, y) 2683 return true 2684 } 2685 // match: (Lsh32x8 x y) 2686 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [32])))) 2687 for { 2688 x := v_0 2689 y := v_1 2690 v.reset(OpPPC64SLW) 2691 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 2692 v0.AuxInt = int32ToAuxInt(0) 2693 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2694 v1.AuxInt = int64ToAuxInt(-1) 2695 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 2696 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 2697 v3.AddArg(y) 2698 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2699 v4.AuxInt = int64ToAuxInt(32) 2700 v2.AddArg2(v3, v4) 2701 v0.AddArg3(y, v1, v2) 2702 v.AddArg2(x, v0) 2703 return true 2704 } 2705 } 2706 func rewriteValuePPC64_OpLsh64x16(v *Value) bool { 2707 v_1 := v.Args[1] 2708 v_0 := v.Args[0] 2709 b := v.Block 2710 typ := &b.Func.Config.Types 2711 // match: (Lsh64x16 x y) 2712 // cond: shiftIsBounded(v) 2713 // result: (SLD x y) 2714 for { 2715 x := v_0 2716 y := v_1 2717 if !(shiftIsBounded(v)) { 2718 break 2719 } 2720 v.reset(OpPPC64SLD) 2721 v.AddArg2(x, y) 2722 return true 2723 } 2724 // match: (Lsh64x16 x y) 2725 // result: (SLD x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [64])))) 2726 for { 2727 x := v_0 2728 y := v_1 2729 v.reset(OpPPC64SLD) 2730 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 2731 v0.AuxInt = int32ToAuxInt(0) 2732 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2733 v1.AuxInt = int64ToAuxInt(-1) 2734 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 2735 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 2736 v3.AddArg(y) 2737 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2738 v4.AuxInt = int64ToAuxInt(64) 2739 v2.AddArg2(v3, v4) 2740 v0.AddArg3(y, v1, v2) 2741 v.AddArg2(x, v0) 2742 return true 2743 } 2744 } 2745 func rewriteValuePPC64_OpLsh64x32(v *Value) bool { 2746 v_1 := v.Args[1] 2747 v_0 := v.Args[0] 2748 b := v.Block 2749 typ := &b.Func.Config.Types 2750 // match: (Lsh64x32 x y) 2751 // cond: shiftIsBounded(v) 2752 // result: (SLD x y) 2753 for { 2754 x := v_0 2755 y := v_1 2756 if !(shiftIsBounded(v)) { 2757 break 2758 } 2759 v.reset(OpPPC64SLD) 2760 v.AddArg2(x, y) 2761 return true 2762 } 2763 // match: (Lsh64x32 x y) 2764 // result: (SLD x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [64])))) 2765 for { 2766 x := v_0 2767 y := v_1 2768 v.reset(OpPPC64SLD) 2769 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 2770 v0.AuxInt = int32ToAuxInt(0) 2771 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2772 v1.AuxInt = int64ToAuxInt(-1) 2773 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 2774 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2775 v3.AuxInt = int64ToAuxInt(64) 2776 v2.AddArg2(y, v3) 2777 v0.AddArg3(y, v1, v2) 2778 v.AddArg2(x, v0) 2779 return true 2780 } 2781 } 2782 func rewriteValuePPC64_OpLsh64x64(v *Value) bool { 2783 v_1 := v.Args[1] 2784 v_0 := v.Args[0] 2785 b := v.Block 2786 typ := &b.Func.Config.Types 2787 // match: (Lsh64x64 x (MOVDconst [c])) 2788 // cond: uint64(c) < 64 2789 // result: (SLDconst x [c]) 2790 for { 2791 x := v_0 2792 if v_1.Op != OpPPC64MOVDconst { 2793 break 2794 } 2795 c := auxIntToInt64(v_1.AuxInt) 2796 if !(uint64(c) < 64) { 2797 break 2798 } 2799 v.reset(OpPPC64SLDconst) 2800 v.AuxInt = int64ToAuxInt(c) 2801 v.AddArg(x) 2802 return true 2803 } 2804 // match: (Lsh64x64 x y) 2805 // cond: shiftIsBounded(v) 2806 // result: (SLD x y) 2807 for { 2808 x := v_0 2809 y := v_1 2810 if !(shiftIsBounded(v)) { 2811 break 2812 } 2813 v.reset(OpPPC64SLD) 2814 v.AddArg2(x, y) 2815 return true 2816 } 2817 // match: (Lsh64x64 x y) 2818 // result: (SLD x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [64])))) 2819 for { 2820 x := v_0 2821 y := v_1 2822 v.reset(OpPPC64SLD) 2823 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 2824 v0.AuxInt = int32ToAuxInt(0) 2825 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2826 v1.AuxInt = int64ToAuxInt(-1) 2827 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 2828 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2829 v3.AuxInt = int64ToAuxInt(64) 2830 v2.AddArg2(y, v3) 2831 v0.AddArg3(y, v1, v2) 2832 v.AddArg2(x, v0) 2833 return true 2834 } 2835 } 2836 func rewriteValuePPC64_OpLsh64x8(v *Value) bool { 2837 v_1 := v.Args[1] 2838 v_0 := v.Args[0] 2839 b := v.Block 2840 typ := &b.Func.Config.Types 2841 // match: (Lsh64x8 x y) 2842 // cond: shiftIsBounded(v) 2843 // result: (SLD x y) 2844 for { 2845 x := v_0 2846 y := v_1 2847 if !(shiftIsBounded(v)) { 2848 break 2849 } 2850 v.reset(OpPPC64SLD) 2851 v.AddArg2(x, y) 2852 return true 2853 } 2854 // match: (Lsh64x8 x y) 2855 // result: (SLD x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [64])))) 2856 for { 2857 x := v_0 2858 y := v_1 2859 v.reset(OpPPC64SLD) 2860 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 2861 v0.AuxInt = int32ToAuxInt(0) 2862 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2863 v1.AuxInt = int64ToAuxInt(-1) 2864 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 2865 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 2866 v3.AddArg(y) 2867 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2868 v4.AuxInt = int64ToAuxInt(64) 2869 v2.AddArg2(v3, v4) 2870 v0.AddArg3(y, v1, v2) 2871 v.AddArg2(x, v0) 2872 return true 2873 } 2874 } 2875 func rewriteValuePPC64_OpLsh8x16(v *Value) bool { 2876 v_1 := v.Args[1] 2877 v_0 := v.Args[0] 2878 b := v.Block 2879 typ := &b.Func.Config.Types 2880 // match: (Lsh8x16 x y) 2881 // cond: shiftIsBounded(v) 2882 // result: (SLW x y) 2883 for { 2884 x := v_0 2885 y := v_1 2886 if !(shiftIsBounded(v)) { 2887 break 2888 } 2889 v.reset(OpPPC64SLW) 2890 v.AddArg2(x, y) 2891 return true 2892 } 2893 // match: (Lsh8x16 x y) 2894 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [8])))) 2895 for { 2896 x := v_0 2897 y := v_1 2898 v.reset(OpPPC64SLW) 2899 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 2900 v0.AuxInt = int32ToAuxInt(0) 2901 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2902 v1.AuxInt = int64ToAuxInt(-1) 2903 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 2904 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 2905 v3.AddArg(y) 2906 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2907 v4.AuxInt = int64ToAuxInt(8) 2908 v2.AddArg2(v3, v4) 2909 v0.AddArg3(y, v1, v2) 2910 v.AddArg2(x, v0) 2911 return true 2912 } 2913 } 2914 func rewriteValuePPC64_OpLsh8x32(v *Value) bool { 2915 v_1 := v.Args[1] 2916 v_0 := v.Args[0] 2917 b := v.Block 2918 typ := &b.Func.Config.Types 2919 // match: (Lsh8x32 x y) 2920 // cond: shiftIsBounded(v) 2921 // result: (SLW x y) 2922 for { 2923 x := v_0 2924 y := v_1 2925 if !(shiftIsBounded(v)) { 2926 break 2927 } 2928 v.reset(OpPPC64SLW) 2929 v.AddArg2(x, y) 2930 return true 2931 } 2932 // match: (Lsh8x32 x y) 2933 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [8])))) 2934 for { 2935 x := v_0 2936 y := v_1 2937 v.reset(OpPPC64SLW) 2938 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 2939 v0.AuxInt = int32ToAuxInt(0) 2940 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2941 v1.AuxInt = int64ToAuxInt(-1) 2942 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 2943 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2944 v3.AuxInt = int64ToAuxInt(8) 2945 v2.AddArg2(y, v3) 2946 v0.AddArg3(y, v1, v2) 2947 v.AddArg2(x, v0) 2948 return true 2949 } 2950 } 2951 func rewriteValuePPC64_OpLsh8x64(v *Value) bool { 2952 v_1 := v.Args[1] 2953 v_0 := v.Args[0] 2954 b := v.Block 2955 typ := &b.Func.Config.Types 2956 // match: (Lsh8x64 x (MOVDconst [c])) 2957 // cond: uint64(c) < 8 2958 // result: (SLWconst x [c]) 2959 for { 2960 x := v_0 2961 if v_1.Op != OpPPC64MOVDconst { 2962 break 2963 } 2964 c := auxIntToInt64(v_1.AuxInt) 2965 if !(uint64(c) < 8) { 2966 break 2967 } 2968 v.reset(OpPPC64SLWconst) 2969 v.AuxInt = int64ToAuxInt(c) 2970 v.AddArg(x) 2971 return true 2972 } 2973 // match: (Lsh8x64 x y) 2974 // cond: shiftIsBounded(v) 2975 // result: (SLW x y) 2976 for { 2977 x := v_0 2978 y := v_1 2979 if !(shiftIsBounded(v)) { 2980 break 2981 } 2982 v.reset(OpPPC64SLW) 2983 v.AddArg2(x, y) 2984 return true 2985 } 2986 // match: (Lsh8x64 x y) 2987 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [8])))) 2988 for { 2989 x := v_0 2990 y := v_1 2991 v.reset(OpPPC64SLW) 2992 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 2993 v0.AuxInt = int32ToAuxInt(0) 2994 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2995 v1.AuxInt = int64ToAuxInt(-1) 2996 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 2997 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 2998 v3.AuxInt = int64ToAuxInt(8) 2999 v2.AddArg2(y, v3) 3000 v0.AddArg3(y, v1, v2) 3001 v.AddArg2(x, v0) 3002 return true 3003 } 3004 } 3005 func rewriteValuePPC64_OpLsh8x8(v *Value) bool { 3006 v_1 := v.Args[1] 3007 v_0 := v.Args[0] 3008 b := v.Block 3009 typ := &b.Func.Config.Types 3010 // match: (Lsh8x8 x y) 3011 // cond: shiftIsBounded(v) 3012 // result: (SLW x y) 3013 for { 3014 x := v_0 3015 y := v_1 3016 if !(shiftIsBounded(v)) { 3017 break 3018 } 3019 v.reset(OpPPC64SLW) 3020 v.AddArg2(x, y) 3021 return true 3022 } 3023 // match: (Lsh8x8 x y) 3024 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [8])))) 3025 for { 3026 x := v_0 3027 y := v_1 3028 v.reset(OpPPC64SLW) 3029 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 3030 v0.AuxInt = int32ToAuxInt(0) 3031 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 3032 v1.AuxInt = int64ToAuxInt(-1) 3033 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 3034 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 3035 v3.AddArg(y) 3036 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 3037 v4.AuxInt = int64ToAuxInt(8) 3038 v2.AddArg2(v3, v4) 3039 v0.AddArg3(y, v1, v2) 3040 v.AddArg2(x, v0) 3041 return true 3042 } 3043 } 3044 func rewriteValuePPC64_OpMod16(v *Value) bool { 3045 v_1 := v.Args[1] 3046 v_0 := v.Args[0] 3047 b := v.Block 3048 typ := &b.Func.Config.Types 3049 // match: (Mod16 x y) 3050 // result: (Mod32 (SignExt16to32 x) (SignExt16to32 y)) 3051 for { 3052 x := v_0 3053 y := v_1 3054 v.reset(OpMod32) 3055 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 3056 v0.AddArg(x) 3057 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 3058 v1.AddArg(y) 3059 v.AddArg2(v0, v1) 3060 return true 3061 } 3062 } 3063 func rewriteValuePPC64_OpMod16u(v *Value) bool { 3064 v_1 := v.Args[1] 3065 v_0 := v.Args[0] 3066 b := v.Block 3067 typ := &b.Func.Config.Types 3068 // match: (Mod16u x y) 3069 // result: (Mod32u (ZeroExt16to32 x) (ZeroExt16to32 y)) 3070 for { 3071 x := v_0 3072 y := v_1 3073 v.reset(OpMod32u) 3074 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 3075 v0.AddArg(x) 3076 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 3077 v1.AddArg(y) 3078 v.AddArg2(v0, v1) 3079 return true 3080 } 3081 } 3082 func rewriteValuePPC64_OpMod32(v *Value) bool { 3083 v_1 := v.Args[1] 3084 v_0 := v.Args[0] 3085 b := v.Block 3086 typ := &b.Func.Config.Types 3087 // match: (Mod32 x y) 3088 // cond: buildcfg.GOPPC64 >= 9 3089 // result: (MODSW x y) 3090 for { 3091 x := v_0 3092 y := v_1 3093 if !(buildcfg.GOPPC64 >= 9) { 3094 break 3095 } 3096 v.reset(OpPPC64MODSW) 3097 v.AddArg2(x, y) 3098 return true 3099 } 3100 // match: (Mod32 x y) 3101 // cond: buildcfg.GOPPC64 <= 8 3102 // result: (SUB x (MULLW y (DIVW x y))) 3103 for { 3104 x := v_0 3105 y := v_1 3106 if !(buildcfg.GOPPC64 <= 8) { 3107 break 3108 } 3109 v.reset(OpPPC64SUB) 3110 v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32) 3111 v1 := b.NewValue0(v.Pos, OpPPC64DIVW, typ.Int32) 3112 v1.AddArg2(x, y) 3113 v0.AddArg2(y, v1) 3114 v.AddArg2(x, v0) 3115 return true 3116 } 3117 return false 3118 } 3119 func rewriteValuePPC64_OpMod32u(v *Value) bool { 3120 v_1 := v.Args[1] 3121 v_0 := v.Args[0] 3122 b := v.Block 3123 typ := &b.Func.Config.Types 3124 // match: (Mod32u x y) 3125 // cond: buildcfg.GOPPC64 >= 9 3126 // result: (MODUW x y) 3127 for { 3128 x := v_0 3129 y := v_1 3130 if !(buildcfg.GOPPC64 >= 9) { 3131 break 3132 } 3133 v.reset(OpPPC64MODUW) 3134 v.AddArg2(x, y) 3135 return true 3136 } 3137 // match: (Mod32u x y) 3138 // cond: buildcfg.GOPPC64 <= 8 3139 // result: (SUB x (MULLW y (DIVWU x y))) 3140 for { 3141 x := v_0 3142 y := v_1 3143 if !(buildcfg.GOPPC64 <= 8) { 3144 break 3145 } 3146 v.reset(OpPPC64SUB) 3147 v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32) 3148 v1 := b.NewValue0(v.Pos, OpPPC64DIVWU, typ.Int32) 3149 v1.AddArg2(x, y) 3150 v0.AddArg2(y, v1) 3151 v.AddArg2(x, v0) 3152 return true 3153 } 3154 return false 3155 } 3156 func rewriteValuePPC64_OpMod64(v *Value) bool { 3157 v_1 := v.Args[1] 3158 v_0 := v.Args[0] 3159 b := v.Block 3160 typ := &b.Func.Config.Types 3161 // match: (Mod64 x y) 3162 // cond: buildcfg.GOPPC64 >=9 3163 // result: (MODSD x y) 3164 for { 3165 x := v_0 3166 y := v_1 3167 if !(buildcfg.GOPPC64 >= 9) { 3168 break 3169 } 3170 v.reset(OpPPC64MODSD) 3171 v.AddArg2(x, y) 3172 return true 3173 } 3174 // match: (Mod64 x y) 3175 // cond: buildcfg.GOPPC64 <=8 3176 // result: (SUB x (MULLD y (DIVD x y))) 3177 for { 3178 x := v_0 3179 y := v_1 3180 if !(buildcfg.GOPPC64 <= 8) { 3181 break 3182 } 3183 v.reset(OpPPC64SUB) 3184 v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64) 3185 v1 := b.NewValue0(v.Pos, OpPPC64DIVD, typ.Int64) 3186 v1.AddArg2(x, y) 3187 v0.AddArg2(y, v1) 3188 v.AddArg2(x, v0) 3189 return true 3190 } 3191 return false 3192 } 3193 func rewriteValuePPC64_OpMod64u(v *Value) bool { 3194 v_1 := v.Args[1] 3195 v_0 := v.Args[0] 3196 b := v.Block 3197 typ := &b.Func.Config.Types 3198 // match: (Mod64u x y) 3199 // cond: buildcfg.GOPPC64 >= 9 3200 // result: (MODUD x y) 3201 for { 3202 x := v_0 3203 y := v_1 3204 if !(buildcfg.GOPPC64 >= 9) { 3205 break 3206 } 3207 v.reset(OpPPC64MODUD) 3208 v.AddArg2(x, y) 3209 return true 3210 } 3211 // match: (Mod64u x y) 3212 // cond: buildcfg.GOPPC64 <= 8 3213 // result: (SUB x (MULLD y (DIVDU x y))) 3214 for { 3215 x := v_0 3216 y := v_1 3217 if !(buildcfg.GOPPC64 <= 8) { 3218 break 3219 } 3220 v.reset(OpPPC64SUB) 3221 v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64) 3222 v1 := b.NewValue0(v.Pos, OpPPC64DIVDU, typ.Int64) 3223 v1.AddArg2(x, y) 3224 v0.AddArg2(y, v1) 3225 v.AddArg2(x, v0) 3226 return true 3227 } 3228 return false 3229 } 3230 func rewriteValuePPC64_OpMod8(v *Value) bool { 3231 v_1 := v.Args[1] 3232 v_0 := v.Args[0] 3233 b := v.Block 3234 typ := &b.Func.Config.Types 3235 // match: (Mod8 x y) 3236 // result: (Mod32 (SignExt8to32 x) (SignExt8to32 y)) 3237 for { 3238 x := v_0 3239 y := v_1 3240 v.reset(OpMod32) 3241 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 3242 v0.AddArg(x) 3243 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 3244 v1.AddArg(y) 3245 v.AddArg2(v0, v1) 3246 return true 3247 } 3248 } 3249 func rewriteValuePPC64_OpMod8u(v *Value) bool { 3250 v_1 := v.Args[1] 3251 v_0 := v.Args[0] 3252 b := v.Block 3253 typ := &b.Func.Config.Types 3254 // match: (Mod8u x y) 3255 // result: (Mod32u (ZeroExt8to32 x) (ZeroExt8to32 y)) 3256 for { 3257 x := v_0 3258 y := v_1 3259 v.reset(OpMod32u) 3260 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 3261 v0.AddArg(x) 3262 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 3263 v1.AddArg(y) 3264 v.AddArg2(v0, v1) 3265 return true 3266 } 3267 } 3268 func rewriteValuePPC64_OpMove(v *Value) bool { 3269 v_2 := v.Args[2] 3270 v_1 := v.Args[1] 3271 v_0 := v.Args[0] 3272 b := v.Block 3273 typ := &b.Func.Config.Types 3274 // match: (Move [0] _ _ mem) 3275 // result: mem 3276 for { 3277 if auxIntToInt64(v.AuxInt) != 0 { 3278 break 3279 } 3280 mem := v_2 3281 v.copyOf(mem) 3282 return true 3283 } 3284 // match: (Move [1] dst src mem) 3285 // result: (MOVBstore dst (MOVBZload src mem) mem) 3286 for { 3287 if auxIntToInt64(v.AuxInt) != 1 { 3288 break 3289 } 3290 dst := v_0 3291 src := v_1 3292 mem := v_2 3293 v.reset(OpPPC64MOVBstore) 3294 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8) 3295 v0.AddArg2(src, mem) 3296 v.AddArg3(dst, v0, mem) 3297 return true 3298 } 3299 // match: (Move [2] dst src mem) 3300 // result: (MOVHstore dst (MOVHZload src mem) mem) 3301 for { 3302 if auxIntToInt64(v.AuxInt) != 2 { 3303 break 3304 } 3305 dst := v_0 3306 src := v_1 3307 mem := v_2 3308 v.reset(OpPPC64MOVHstore) 3309 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16) 3310 v0.AddArg2(src, mem) 3311 v.AddArg3(dst, v0, mem) 3312 return true 3313 } 3314 // match: (Move [4] dst src mem) 3315 // result: (MOVWstore dst (MOVWZload src mem) mem) 3316 for { 3317 if auxIntToInt64(v.AuxInt) != 4 { 3318 break 3319 } 3320 dst := v_0 3321 src := v_1 3322 mem := v_2 3323 v.reset(OpPPC64MOVWstore) 3324 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32) 3325 v0.AddArg2(src, mem) 3326 v.AddArg3(dst, v0, mem) 3327 return true 3328 } 3329 // match: (Move [8] {t} dst src mem) 3330 // result: (MOVDstore dst (MOVDload src mem) mem) 3331 for { 3332 if auxIntToInt64(v.AuxInt) != 8 { 3333 break 3334 } 3335 dst := v_0 3336 src := v_1 3337 mem := v_2 3338 v.reset(OpPPC64MOVDstore) 3339 v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, typ.Int64) 3340 v0.AddArg2(src, mem) 3341 v.AddArg3(dst, v0, mem) 3342 return true 3343 } 3344 // match: (Move [3] dst src mem) 3345 // result: (MOVBstore [2] dst (MOVBZload [2] src mem) (MOVHstore dst (MOVHload src mem) mem)) 3346 for { 3347 if auxIntToInt64(v.AuxInt) != 3 { 3348 break 3349 } 3350 dst := v_0 3351 src := v_1 3352 mem := v_2 3353 v.reset(OpPPC64MOVBstore) 3354 v.AuxInt = int32ToAuxInt(2) 3355 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8) 3356 v0.AuxInt = int32ToAuxInt(2) 3357 v0.AddArg2(src, mem) 3358 v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem) 3359 v2 := b.NewValue0(v.Pos, OpPPC64MOVHload, typ.Int16) 3360 v2.AddArg2(src, mem) 3361 v1.AddArg3(dst, v2, mem) 3362 v.AddArg3(dst, v0, v1) 3363 return true 3364 } 3365 // match: (Move [5] dst src mem) 3366 // result: (MOVBstore [4] dst (MOVBZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem)) 3367 for { 3368 if auxIntToInt64(v.AuxInt) != 5 { 3369 break 3370 } 3371 dst := v_0 3372 src := v_1 3373 mem := v_2 3374 v.reset(OpPPC64MOVBstore) 3375 v.AuxInt = int32ToAuxInt(4) 3376 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8) 3377 v0.AuxInt = int32ToAuxInt(4) 3378 v0.AddArg2(src, mem) 3379 v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem) 3380 v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32) 3381 v2.AddArg2(src, mem) 3382 v1.AddArg3(dst, v2, mem) 3383 v.AddArg3(dst, v0, v1) 3384 return true 3385 } 3386 // match: (Move [6] dst src mem) 3387 // result: (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem)) 3388 for { 3389 if auxIntToInt64(v.AuxInt) != 6 { 3390 break 3391 } 3392 dst := v_0 3393 src := v_1 3394 mem := v_2 3395 v.reset(OpPPC64MOVHstore) 3396 v.AuxInt = int32ToAuxInt(4) 3397 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16) 3398 v0.AuxInt = int32ToAuxInt(4) 3399 v0.AddArg2(src, mem) 3400 v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem) 3401 v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32) 3402 v2.AddArg2(src, mem) 3403 v1.AddArg3(dst, v2, mem) 3404 v.AddArg3(dst, v0, v1) 3405 return true 3406 } 3407 // match: (Move [7] dst src mem) 3408 // result: (MOVBstore [6] dst (MOVBZload [6] src mem) (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))) 3409 for { 3410 if auxIntToInt64(v.AuxInt) != 7 { 3411 break 3412 } 3413 dst := v_0 3414 src := v_1 3415 mem := v_2 3416 v.reset(OpPPC64MOVBstore) 3417 v.AuxInt = int32ToAuxInt(6) 3418 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8) 3419 v0.AuxInt = int32ToAuxInt(6) 3420 v0.AddArg2(src, mem) 3421 v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem) 3422 v1.AuxInt = int32ToAuxInt(4) 3423 v2 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16) 3424 v2.AuxInt = int32ToAuxInt(4) 3425 v2.AddArg2(src, mem) 3426 v3 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem) 3427 v4 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32) 3428 v4.AddArg2(src, mem) 3429 v3.AddArg3(dst, v4, mem) 3430 v1.AddArg3(dst, v2, v3) 3431 v.AddArg3(dst, v0, v1) 3432 return true 3433 } 3434 // match: (Move [s] dst src mem) 3435 // cond: s > 8 && buildcfg.GOPPC64 <= 8 && logLargeCopy(v, s) 3436 // result: (LoweredMove [s] dst src mem) 3437 for { 3438 s := auxIntToInt64(v.AuxInt) 3439 dst := v_0 3440 src := v_1 3441 mem := v_2 3442 if !(s > 8 && buildcfg.GOPPC64 <= 8 && logLargeCopy(v, s)) { 3443 break 3444 } 3445 v.reset(OpPPC64LoweredMove) 3446 v.AuxInt = int64ToAuxInt(s) 3447 v.AddArg3(dst, src, mem) 3448 return true 3449 } 3450 // match: (Move [s] dst src mem) 3451 // cond: s > 8 && s <= 64 && buildcfg.GOPPC64 >= 9 3452 // result: (LoweredQuadMoveShort [s] dst src mem) 3453 for { 3454 s := auxIntToInt64(v.AuxInt) 3455 dst := v_0 3456 src := v_1 3457 mem := v_2 3458 if !(s > 8 && s <= 64 && buildcfg.GOPPC64 >= 9) { 3459 break 3460 } 3461 v.reset(OpPPC64LoweredQuadMoveShort) 3462 v.AuxInt = int64ToAuxInt(s) 3463 v.AddArg3(dst, src, mem) 3464 return true 3465 } 3466 // match: (Move [s] dst src mem) 3467 // cond: s > 8 && buildcfg.GOPPC64 >= 9 && logLargeCopy(v, s) 3468 // result: (LoweredQuadMove [s] dst src mem) 3469 for { 3470 s := auxIntToInt64(v.AuxInt) 3471 dst := v_0 3472 src := v_1 3473 mem := v_2 3474 if !(s > 8 && buildcfg.GOPPC64 >= 9 && logLargeCopy(v, s)) { 3475 break 3476 } 3477 v.reset(OpPPC64LoweredQuadMove) 3478 v.AuxInt = int64ToAuxInt(s) 3479 v.AddArg3(dst, src, mem) 3480 return true 3481 } 3482 return false 3483 } 3484 func rewriteValuePPC64_OpNeq16(v *Value) bool { 3485 v_1 := v.Args[1] 3486 v_0 := v.Args[0] 3487 b := v.Block 3488 typ := &b.Func.Config.Types 3489 // match: (Neq16 x y) 3490 // cond: isSigned(x.Type) && isSigned(y.Type) 3491 // result: (NotEqual (CMPW (SignExt16to32 x) (SignExt16to32 y))) 3492 for { 3493 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 3494 x := v_0 3495 y := v_1 3496 if !(isSigned(x.Type) && isSigned(y.Type)) { 3497 continue 3498 } 3499 v.reset(OpPPC64NotEqual) 3500 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags) 3501 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 3502 v1.AddArg(x) 3503 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 3504 v2.AddArg(y) 3505 v0.AddArg2(v1, v2) 3506 v.AddArg(v0) 3507 return true 3508 } 3509 break 3510 } 3511 // match: (Neq16 x y) 3512 // result: (NotEqual (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y))) 3513 for { 3514 x := v_0 3515 y := v_1 3516 v.reset(OpPPC64NotEqual) 3517 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags) 3518 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 3519 v1.AddArg(x) 3520 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 3521 v2.AddArg(y) 3522 v0.AddArg2(v1, v2) 3523 v.AddArg(v0) 3524 return true 3525 } 3526 } 3527 func rewriteValuePPC64_OpNeq32(v *Value) bool { 3528 v_1 := v.Args[1] 3529 v_0 := v.Args[0] 3530 b := v.Block 3531 // match: (Neq32 x y) 3532 // result: (NotEqual (CMPW x y)) 3533 for { 3534 x := v_0 3535 y := v_1 3536 v.reset(OpPPC64NotEqual) 3537 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags) 3538 v0.AddArg2(x, y) 3539 v.AddArg(v0) 3540 return true 3541 } 3542 } 3543 func rewriteValuePPC64_OpNeq32F(v *Value) bool { 3544 v_1 := v.Args[1] 3545 v_0 := v.Args[0] 3546 b := v.Block 3547 // match: (Neq32F x y) 3548 // result: (NotEqual (FCMPU x y)) 3549 for { 3550 x := v_0 3551 y := v_1 3552 v.reset(OpPPC64NotEqual) 3553 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags) 3554 v0.AddArg2(x, y) 3555 v.AddArg(v0) 3556 return true 3557 } 3558 } 3559 func rewriteValuePPC64_OpNeq64(v *Value) bool { 3560 v_1 := v.Args[1] 3561 v_0 := v.Args[0] 3562 b := v.Block 3563 // match: (Neq64 x y) 3564 // result: (NotEqual (CMP x y)) 3565 for { 3566 x := v_0 3567 y := v_1 3568 v.reset(OpPPC64NotEqual) 3569 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags) 3570 v0.AddArg2(x, y) 3571 v.AddArg(v0) 3572 return true 3573 } 3574 } 3575 func rewriteValuePPC64_OpNeq64F(v *Value) bool { 3576 v_1 := v.Args[1] 3577 v_0 := v.Args[0] 3578 b := v.Block 3579 // match: (Neq64F x y) 3580 // result: (NotEqual (FCMPU x y)) 3581 for { 3582 x := v_0 3583 y := v_1 3584 v.reset(OpPPC64NotEqual) 3585 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags) 3586 v0.AddArg2(x, y) 3587 v.AddArg(v0) 3588 return true 3589 } 3590 } 3591 func rewriteValuePPC64_OpNeq8(v *Value) bool { 3592 v_1 := v.Args[1] 3593 v_0 := v.Args[0] 3594 b := v.Block 3595 typ := &b.Func.Config.Types 3596 // match: (Neq8 x y) 3597 // cond: isSigned(x.Type) && isSigned(y.Type) 3598 // result: (NotEqual (CMPW (SignExt8to32 x) (SignExt8to32 y))) 3599 for { 3600 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 3601 x := v_0 3602 y := v_1 3603 if !(isSigned(x.Type) && isSigned(y.Type)) { 3604 continue 3605 } 3606 v.reset(OpPPC64NotEqual) 3607 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags) 3608 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 3609 v1.AddArg(x) 3610 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 3611 v2.AddArg(y) 3612 v0.AddArg2(v1, v2) 3613 v.AddArg(v0) 3614 return true 3615 } 3616 break 3617 } 3618 // match: (Neq8 x y) 3619 // result: (NotEqual (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y))) 3620 for { 3621 x := v_0 3622 y := v_1 3623 v.reset(OpPPC64NotEqual) 3624 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags) 3625 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 3626 v1.AddArg(x) 3627 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 3628 v2.AddArg(y) 3629 v0.AddArg2(v1, v2) 3630 v.AddArg(v0) 3631 return true 3632 } 3633 } 3634 func rewriteValuePPC64_OpNeqPtr(v *Value) bool { 3635 v_1 := v.Args[1] 3636 v_0 := v.Args[0] 3637 b := v.Block 3638 // match: (NeqPtr x y) 3639 // result: (NotEqual (CMP x y)) 3640 for { 3641 x := v_0 3642 y := v_1 3643 v.reset(OpPPC64NotEqual) 3644 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags) 3645 v0.AddArg2(x, y) 3646 v.AddArg(v0) 3647 return true 3648 } 3649 } 3650 func rewriteValuePPC64_OpNot(v *Value) bool { 3651 v_0 := v.Args[0] 3652 // match: (Not x) 3653 // result: (XORconst [1] x) 3654 for { 3655 x := v_0 3656 v.reset(OpPPC64XORconst) 3657 v.AuxInt = int64ToAuxInt(1) 3658 v.AddArg(x) 3659 return true 3660 } 3661 } 3662 func rewriteValuePPC64_OpOffPtr(v *Value) bool { 3663 v_0 := v.Args[0] 3664 b := v.Block 3665 typ := &b.Func.Config.Types 3666 // match: (OffPtr [off] ptr) 3667 // result: (ADD (MOVDconst <typ.Int64> [off]) ptr) 3668 for { 3669 off := auxIntToInt64(v.AuxInt) 3670 ptr := v_0 3671 v.reset(OpPPC64ADD) 3672 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 3673 v0.AuxInt = int64ToAuxInt(off) 3674 v.AddArg2(v0, ptr) 3675 return true 3676 } 3677 } 3678 func rewriteValuePPC64_OpPPC64ADD(v *Value) bool { 3679 v_1 := v.Args[1] 3680 v_0 := v.Args[0] 3681 // match: (ADD l:(MULLD x y) z) 3682 // cond: buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l) 3683 // result: (MADDLD x y z) 3684 for { 3685 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 3686 l := v_0 3687 if l.Op != OpPPC64MULLD { 3688 continue 3689 } 3690 y := l.Args[1] 3691 x := l.Args[0] 3692 z := v_1 3693 if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) { 3694 continue 3695 } 3696 v.reset(OpPPC64MADDLD) 3697 v.AddArg3(x, y, z) 3698 return true 3699 } 3700 break 3701 } 3702 // match: (ADD x (MOVDconst [c])) 3703 // cond: is32Bit(c) 3704 // result: (ADDconst [c] x) 3705 for { 3706 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 3707 x := v_0 3708 if v_1.Op != OpPPC64MOVDconst { 3709 continue 3710 } 3711 c := auxIntToInt64(v_1.AuxInt) 3712 if !(is32Bit(c)) { 3713 continue 3714 } 3715 v.reset(OpPPC64ADDconst) 3716 v.AuxInt = int64ToAuxInt(c) 3717 v.AddArg(x) 3718 return true 3719 } 3720 break 3721 } 3722 return false 3723 } 3724 func rewriteValuePPC64_OpPPC64ADDE(v *Value) bool { 3725 v_2 := v.Args[2] 3726 v_1 := v.Args[1] 3727 v_0 := v.Args[0] 3728 b := v.Block 3729 typ := &b.Func.Config.Types 3730 // match: (ADDE x y (Select1 <typ.UInt64> (ADDCconst (MOVDconst [0]) [-1]))) 3731 // result: (ADDC x y) 3732 for { 3733 x := v_0 3734 y := v_1 3735 if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 { 3736 break 3737 } 3738 v_2_0 := v_2.Args[0] 3739 if v_2_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_2_0.AuxInt) != -1 { 3740 break 3741 } 3742 v_2_0_0 := v_2_0.Args[0] 3743 if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 { 3744 break 3745 } 3746 v.reset(OpPPC64ADDC) 3747 v.AddArg2(x, y) 3748 return true 3749 } 3750 return false 3751 } 3752 func rewriteValuePPC64_OpPPC64ADDconst(v *Value) bool { 3753 v_0 := v.Args[0] 3754 // match: (ADDconst [c] (ADDconst [d] x)) 3755 // cond: is32Bit(c+d) 3756 // result: (ADDconst [c+d] x) 3757 for { 3758 c := auxIntToInt64(v.AuxInt) 3759 if v_0.Op != OpPPC64ADDconst { 3760 break 3761 } 3762 d := auxIntToInt64(v_0.AuxInt) 3763 x := v_0.Args[0] 3764 if !(is32Bit(c + d)) { 3765 break 3766 } 3767 v.reset(OpPPC64ADDconst) 3768 v.AuxInt = int64ToAuxInt(c + d) 3769 v.AddArg(x) 3770 return true 3771 } 3772 // match: (ADDconst [0] x) 3773 // result: x 3774 for { 3775 if auxIntToInt64(v.AuxInt) != 0 { 3776 break 3777 } 3778 x := v_0 3779 v.copyOf(x) 3780 return true 3781 } 3782 // match: (ADDconst [c] (MOVDaddr [d] {sym} x)) 3783 // cond: is32Bit(c+int64(d)) 3784 // result: (MOVDaddr [int32(c+int64(d))] {sym} x) 3785 for { 3786 c := auxIntToInt64(v.AuxInt) 3787 if v_0.Op != OpPPC64MOVDaddr { 3788 break 3789 } 3790 d := auxIntToInt32(v_0.AuxInt) 3791 sym := auxToSym(v_0.Aux) 3792 x := v_0.Args[0] 3793 if !(is32Bit(c + int64(d))) { 3794 break 3795 } 3796 v.reset(OpPPC64MOVDaddr) 3797 v.AuxInt = int32ToAuxInt(int32(c + int64(d))) 3798 v.Aux = symToAux(sym) 3799 v.AddArg(x) 3800 return true 3801 } 3802 // match: (ADDconst [c] x:(SP)) 3803 // cond: is32Bit(c) 3804 // result: (MOVDaddr [int32(c)] x) 3805 for { 3806 c := auxIntToInt64(v.AuxInt) 3807 x := v_0 3808 if x.Op != OpSP || !(is32Bit(c)) { 3809 break 3810 } 3811 v.reset(OpPPC64MOVDaddr) 3812 v.AuxInt = int32ToAuxInt(int32(c)) 3813 v.AddArg(x) 3814 return true 3815 } 3816 // match: (ADDconst [c] (SUBFCconst [d] x)) 3817 // cond: is32Bit(c+d) 3818 // result: (SUBFCconst [c+d] x) 3819 for { 3820 c := auxIntToInt64(v.AuxInt) 3821 if v_0.Op != OpPPC64SUBFCconst { 3822 break 3823 } 3824 d := auxIntToInt64(v_0.AuxInt) 3825 x := v_0.Args[0] 3826 if !(is32Bit(c + d)) { 3827 break 3828 } 3829 v.reset(OpPPC64SUBFCconst) 3830 v.AuxInt = int64ToAuxInt(c + d) 3831 v.AddArg(x) 3832 return true 3833 } 3834 return false 3835 } 3836 func rewriteValuePPC64_OpPPC64AND(v *Value) bool { 3837 v_1 := v.Args[1] 3838 v_0 := v.Args[0] 3839 b := v.Block 3840 typ := &b.Func.Config.Types 3841 // match: (AND (MOVDconst [m]) (ROTLWconst [r] x)) 3842 // cond: isPPC64WordRotateMask(m) 3843 // result: (RLWINM [encodePPC64RotateMask(r,m,32)] x) 3844 for { 3845 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 3846 if v_0.Op != OpPPC64MOVDconst { 3847 continue 3848 } 3849 m := auxIntToInt64(v_0.AuxInt) 3850 if v_1.Op != OpPPC64ROTLWconst { 3851 continue 3852 } 3853 r := auxIntToInt64(v_1.AuxInt) 3854 x := v_1.Args[0] 3855 if !(isPPC64WordRotateMask(m)) { 3856 continue 3857 } 3858 v.reset(OpPPC64RLWINM) 3859 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32)) 3860 v.AddArg(x) 3861 return true 3862 } 3863 break 3864 } 3865 // match: (AND (MOVDconst [m]) (ROTLW x r)) 3866 // cond: isPPC64WordRotateMask(m) 3867 // result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r) 3868 for { 3869 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 3870 if v_0.Op != OpPPC64MOVDconst { 3871 continue 3872 } 3873 m := auxIntToInt64(v_0.AuxInt) 3874 if v_1.Op != OpPPC64ROTLW { 3875 continue 3876 } 3877 r := v_1.Args[1] 3878 x := v_1.Args[0] 3879 if !(isPPC64WordRotateMask(m)) { 3880 continue 3881 } 3882 v.reset(OpPPC64RLWNM) 3883 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32)) 3884 v.AddArg2(x, r) 3885 return true 3886 } 3887 break 3888 } 3889 // match: (AND (MOVDconst [m]) (SRWconst x [s])) 3890 // cond: mergePPC64RShiftMask(m,s,32) == 0 3891 // result: (MOVDconst [0]) 3892 for { 3893 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 3894 if v_0.Op != OpPPC64MOVDconst { 3895 continue 3896 } 3897 m := auxIntToInt64(v_0.AuxInt) 3898 if v_1.Op != OpPPC64SRWconst { 3899 continue 3900 } 3901 s := auxIntToInt64(v_1.AuxInt) 3902 if !(mergePPC64RShiftMask(m, s, 32) == 0) { 3903 continue 3904 } 3905 v.reset(OpPPC64MOVDconst) 3906 v.AuxInt = int64ToAuxInt(0) 3907 return true 3908 } 3909 break 3910 } 3911 // match: (AND (MOVDconst [m]) (SRWconst x [s])) 3912 // cond: mergePPC64AndSrwi(m,s) != 0 3913 // result: (RLWINM [mergePPC64AndSrwi(m,s)] x) 3914 for { 3915 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 3916 if v_0.Op != OpPPC64MOVDconst { 3917 continue 3918 } 3919 m := auxIntToInt64(v_0.AuxInt) 3920 if v_1.Op != OpPPC64SRWconst { 3921 continue 3922 } 3923 s := auxIntToInt64(v_1.AuxInt) 3924 x := v_1.Args[0] 3925 if !(mergePPC64AndSrwi(m, s) != 0) { 3926 continue 3927 } 3928 v.reset(OpPPC64RLWINM) 3929 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s)) 3930 v.AddArg(x) 3931 return true 3932 } 3933 break 3934 } 3935 // match: (AND x (NOR y y)) 3936 // result: (ANDN x y) 3937 for { 3938 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 3939 x := v_0 3940 if v_1.Op != OpPPC64NOR { 3941 continue 3942 } 3943 y := v_1.Args[1] 3944 if y != v_1.Args[0] { 3945 continue 3946 } 3947 v.reset(OpPPC64ANDN) 3948 v.AddArg2(x, y) 3949 return true 3950 } 3951 break 3952 } 3953 // match: (AND (MOVDconst [c]) (MOVDconst [d])) 3954 // result: (MOVDconst [c&d]) 3955 for { 3956 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 3957 if v_0.Op != OpPPC64MOVDconst { 3958 continue 3959 } 3960 c := auxIntToInt64(v_0.AuxInt) 3961 if v_1.Op != OpPPC64MOVDconst { 3962 continue 3963 } 3964 d := auxIntToInt64(v_1.AuxInt) 3965 v.reset(OpPPC64MOVDconst) 3966 v.AuxInt = int64ToAuxInt(c & d) 3967 return true 3968 } 3969 break 3970 } 3971 // match: (AND x (MOVDconst [c])) 3972 // cond: isU16Bit(c) 3973 // result: (Select0 (ANDCCconst [c] x)) 3974 for { 3975 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 3976 x := v_0 3977 if v_1.Op != OpPPC64MOVDconst { 3978 continue 3979 } 3980 c := auxIntToInt64(v_1.AuxInt) 3981 if !(isU16Bit(c)) { 3982 continue 3983 } 3984 v.reset(OpSelect0) 3985 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 3986 v0.AuxInt = int64ToAuxInt(c) 3987 v0.AddArg(x) 3988 v.AddArg(v0) 3989 return true 3990 } 3991 break 3992 } 3993 // match: (AND (MOVDconst [c]) y:(MOVWZreg _)) 3994 // cond: c&0xFFFFFFFF == 0xFFFFFFFF 3995 // result: y 3996 for { 3997 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 3998 if v_0.Op != OpPPC64MOVDconst { 3999 continue 4000 } 4001 c := auxIntToInt64(v_0.AuxInt) 4002 y := v_1 4003 if y.Op != OpPPC64MOVWZreg || !(c&0xFFFFFFFF == 0xFFFFFFFF) { 4004 continue 4005 } 4006 v.copyOf(y) 4007 return true 4008 } 4009 break 4010 } 4011 // match: (AND (MOVDconst [0xFFFFFFFF]) y:(MOVWreg x)) 4012 // result: (MOVWZreg x) 4013 for { 4014 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 4015 if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0xFFFFFFFF { 4016 continue 4017 } 4018 y := v_1 4019 if y.Op != OpPPC64MOVWreg { 4020 continue 4021 } 4022 x := y.Args[0] 4023 v.reset(OpPPC64MOVWZreg) 4024 v.AddArg(x) 4025 return true 4026 } 4027 break 4028 } 4029 // match: (AND (MOVDconst [c]) x:(MOVBZload _ _)) 4030 // result: (Select0 (ANDCCconst [c&0xFF] x)) 4031 for { 4032 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 4033 if v_0.Op != OpPPC64MOVDconst { 4034 continue 4035 } 4036 c := auxIntToInt64(v_0.AuxInt) 4037 x := v_1 4038 if x.Op != OpPPC64MOVBZload { 4039 continue 4040 } 4041 v.reset(OpSelect0) 4042 v0 := b.NewValue0(x.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 4043 v0.AuxInt = int64ToAuxInt(c & 0xFF) 4044 v0.AddArg(x) 4045 v.AddArg(v0) 4046 return true 4047 } 4048 break 4049 } 4050 return false 4051 } 4052 func rewriteValuePPC64_OpPPC64ANDN(v *Value) bool { 4053 v_1 := v.Args[1] 4054 v_0 := v.Args[0] 4055 // match: (ANDN (MOVDconst [c]) (MOVDconst [d])) 4056 // result: (MOVDconst [c&^d]) 4057 for { 4058 if v_0.Op != OpPPC64MOVDconst { 4059 break 4060 } 4061 c := auxIntToInt64(v_0.AuxInt) 4062 if v_1.Op != OpPPC64MOVDconst { 4063 break 4064 } 4065 d := auxIntToInt64(v_1.AuxInt) 4066 v.reset(OpPPC64MOVDconst) 4067 v.AuxInt = int64ToAuxInt(c &^ d) 4068 return true 4069 } 4070 return false 4071 } 4072 func rewriteValuePPC64_OpPPC64CLRLSLDI(v *Value) bool { 4073 v_0 := v.Args[0] 4074 // match: (CLRLSLDI [c] (SRWconst [s] x)) 4075 // cond: mergePPC64ClrlsldiSrw(int64(c),s) != 0 4076 // result: (RLWINM [mergePPC64ClrlsldiSrw(int64(c),s)] x) 4077 for { 4078 c := auxIntToInt32(v.AuxInt) 4079 if v_0.Op != OpPPC64SRWconst { 4080 break 4081 } 4082 s := auxIntToInt64(v_0.AuxInt) 4083 x := v_0.Args[0] 4084 if !(mergePPC64ClrlsldiSrw(int64(c), s) != 0) { 4085 break 4086 } 4087 v.reset(OpPPC64RLWINM) 4088 v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiSrw(int64(c), s)) 4089 v.AddArg(x) 4090 return true 4091 } 4092 // match: (CLRLSLDI [c] i:(RLWINM [s] x)) 4093 // cond: mergePPC64ClrlsldiRlwinm(c,s) != 0 4094 // result: (RLWINM [mergePPC64ClrlsldiRlwinm(c,s)] x) 4095 for { 4096 c := auxIntToInt32(v.AuxInt) 4097 i := v_0 4098 if i.Op != OpPPC64RLWINM { 4099 break 4100 } 4101 s := auxIntToInt64(i.AuxInt) 4102 x := i.Args[0] 4103 if !(mergePPC64ClrlsldiRlwinm(c, s) != 0) { 4104 break 4105 } 4106 v.reset(OpPPC64RLWINM) 4107 v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiRlwinm(c, s)) 4108 v.AddArg(x) 4109 return true 4110 } 4111 return false 4112 } 4113 func rewriteValuePPC64_OpPPC64CMP(v *Value) bool { 4114 v_1 := v.Args[1] 4115 v_0 := v.Args[0] 4116 b := v.Block 4117 // match: (CMP x (MOVDconst [c])) 4118 // cond: is16Bit(c) 4119 // result: (CMPconst x [c]) 4120 for { 4121 x := v_0 4122 if v_1.Op != OpPPC64MOVDconst { 4123 break 4124 } 4125 c := auxIntToInt64(v_1.AuxInt) 4126 if !(is16Bit(c)) { 4127 break 4128 } 4129 v.reset(OpPPC64CMPconst) 4130 v.AuxInt = int64ToAuxInt(c) 4131 v.AddArg(x) 4132 return true 4133 } 4134 // match: (CMP (MOVDconst [c]) y) 4135 // cond: is16Bit(c) 4136 // result: (InvertFlags (CMPconst y [c])) 4137 for { 4138 if v_0.Op != OpPPC64MOVDconst { 4139 break 4140 } 4141 c := auxIntToInt64(v_0.AuxInt) 4142 y := v_1 4143 if !(is16Bit(c)) { 4144 break 4145 } 4146 v.reset(OpPPC64InvertFlags) 4147 v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags) 4148 v0.AuxInt = int64ToAuxInt(c) 4149 v0.AddArg(y) 4150 v.AddArg(v0) 4151 return true 4152 } 4153 // match: (CMP x y) 4154 // cond: canonLessThan(x,y) 4155 // result: (InvertFlags (CMP y x)) 4156 for { 4157 x := v_0 4158 y := v_1 4159 if !(canonLessThan(x, y)) { 4160 break 4161 } 4162 v.reset(OpPPC64InvertFlags) 4163 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags) 4164 v0.AddArg2(y, x) 4165 v.AddArg(v0) 4166 return true 4167 } 4168 return false 4169 } 4170 func rewriteValuePPC64_OpPPC64CMPU(v *Value) bool { 4171 v_1 := v.Args[1] 4172 v_0 := v.Args[0] 4173 b := v.Block 4174 // match: (CMPU x (MOVDconst [c])) 4175 // cond: isU16Bit(c) 4176 // result: (CMPUconst x [c]) 4177 for { 4178 x := v_0 4179 if v_1.Op != OpPPC64MOVDconst { 4180 break 4181 } 4182 c := auxIntToInt64(v_1.AuxInt) 4183 if !(isU16Bit(c)) { 4184 break 4185 } 4186 v.reset(OpPPC64CMPUconst) 4187 v.AuxInt = int64ToAuxInt(c) 4188 v.AddArg(x) 4189 return true 4190 } 4191 // match: (CMPU (MOVDconst [c]) y) 4192 // cond: isU16Bit(c) 4193 // result: (InvertFlags (CMPUconst y [c])) 4194 for { 4195 if v_0.Op != OpPPC64MOVDconst { 4196 break 4197 } 4198 c := auxIntToInt64(v_0.AuxInt) 4199 y := v_1 4200 if !(isU16Bit(c)) { 4201 break 4202 } 4203 v.reset(OpPPC64InvertFlags) 4204 v0 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags) 4205 v0.AuxInt = int64ToAuxInt(c) 4206 v0.AddArg(y) 4207 v.AddArg(v0) 4208 return true 4209 } 4210 // match: (CMPU x y) 4211 // cond: canonLessThan(x,y) 4212 // result: (InvertFlags (CMPU y x)) 4213 for { 4214 x := v_0 4215 y := v_1 4216 if !(canonLessThan(x, y)) { 4217 break 4218 } 4219 v.reset(OpPPC64InvertFlags) 4220 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 4221 v0.AddArg2(y, x) 4222 v.AddArg(v0) 4223 return true 4224 } 4225 return false 4226 } 4227 func rewriteValuePPC64_OpPPC64CMPUconst(v *Value) bool { 4228 v_0 := v.Args[0] 4229 // match: (CMPUconst (MOVDconst [x]) [y]) 4230 // cond: x==y 4231 // result: (FlagEQ) 4232 for { 4233 y := auxIntToInt64(v.AuxInt) 4234 if v_0.Op != OpPPC64MOVDconst { 4235 break 4236 } 4237 x := auxIntToInt64(v_0.AuxInt) 4238 if !(x == y) { 4239 break 4240 } 4241 v.reset(OpPPC64FlagEQ) 4242 return true 4243 } 4244 // match: (CMPUconst (MOVDconst [x]) [y]) 4245 // cond: uint64(x)<uint64(y) 4246 // result: (FlagLT) 4247 for { 4248 y := auxIntToInt64(v.AuxInt) 4249 if v_0.Op != OpPPC64MOVDconst { 4250 break 4251 } 4252 x := auxIntToInt64(v_0.AuxInt) 4253 if !(uint64(x) < uint64(y)) { 4254 break 4255 } 4256 v.reset(OpPPC64FlagLT) 4257 return true 4258 } 4259 // match: (CMPUconst (MOVDconst [x]) [y]) 4260 // cond: uint64(x)>uint64(y) 4261 // result: (FlagGT) 4262 for { 4263 y := auxIntToInt64(v.AuxInt) 4264 if v_0.Op != OpPPC64MOVDconst { 4265 break 4266 } 4267 x := auxIntToInt64(v_0.AuxInt) 4268 if !(uint64(x) > uint64(y)) { 4269 break 4270 } 4271 v.reset(OpPPC64FlagGT) 4272 return true 4273 } 4274 return false 4275 } 4276 func rewriteValuePPC64_OpPPC64CMPW(v *Value) bool { 4277 v_1 := v.Args[1] 4278 v_0 := v.Args[0] 4279 b := v.Block 4280 // match: (CMPW x (MOVWreg y)) 4281 // result: (CMPW x y) 4282 for { 4283 x := v_0 4284 if v_1.Op != OpPPC64MOVWreg { 4285 break 4286 } 4287 y := v_1.Args[0] 4288 v.reset(OpPPC64CMPW) 4289 v.AddArg2(x, y) 4290 return true 4291 } 4292 // match: (CMPW (MOVWreg x) y) 4293 // result: (CMPW x y) 4294 for { 4295 if v_0.Op != OpPPC64MOVWreg { 4296 break 4297 } 4298 x := v_0.Args[0] 4299 y := v_1 4300 v.reset(OpPPC64CMPW) 4301 v.AddArg2(x, y) 4302 return true 4303 } 4304 // match: (CMPW x (MOVDconst [c])) 4305 // cond: is16Bit(c) 4306 // result: (CMPWconst x [int32(c)]) 4307 for { 4308 x := v_0 4309 if v_1.Op != OpPPC64MOVDconst { 4310 break 4311 } 4312 c := auxIntToInt64(v_1.AuxInt) 4313 if !(is16Bit(c)) { 4314 break 4315 } 4316 v.reset(OpPPC64CMPWconst) 4317 v.AuxInt = int32ToAuxInt(int32(c)) 4318 v.AddArg(x) 4319 return true 4320 } 4321 // match: (CMPW (MOVDconst [c]) y) 4322 // cond: is16Bit(c) 4323 // result: (InvertFlags (CMPWconst y [int32(c)])) 4324 for { 4325 if v_0.Op != OpPPC64MOVDconst { 4326 break 4327 } 4328 c := auxIntToInt64(v_0.AuxInt) 4329 y := v_1 4330 if !(is16Bit(c)) { 4331 break 4332 } 4333 v.reset(OpPPC64InvertFlags) 4334 v0 := b.NewValue0(v.Pos, OpPPC64CMPWconst, types.TypeFlags) 4335 v0.AuxInt = int32ToAuxInt(int32(c)) 4336 v0.AddArg(y) 4337 v.AddArg(v0) 4338 return true 4339 } 4340 // match: (CMPW x y) 4341 // cond: canonLessThan(x,y) 4342 // result: (InvertFlags (CMPW y x)) 4343 for { 4344 x := v_0 4345 y := v_1 4346 if !(canonLessThan(x, y)) { 4347 break 4348 } 4349 v.reset(OpPPC64InvertFlags) 4350 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags) 4351 v0.AddArg2(y, x) 4352 v.AddArg(v0) 4353 return true 4354 } 4355 return false 4356 } 4357 func rewriteValuePPC64_OpPPC64CMPWU(v *Value) bool { 4358 v_1 := v.Args[1] 4359 v_0 := v.Args[0] 4360 b := v.Block 4361 // match: (CMPWU x (MOVWZreg y)) 4362 // result: (CMPWU x y) 4363 for { 4364 x := v_0 4365 if v_1.Op != OpPPC64MOVWZreg { 4366 break 4367 } 4368 y := v_1.Args[0] 4369 v.reset(OpPPC64CMPWU) 4370 v.AddArg2(x, y) 4371 return true 4372 } 4373 // match: (CMPWU (MOVWZreg x) y) 4374 // result: (CMPWU x y) 4375 for { 4376 if v_0.Op != OpPPC64MOVWZreg { 4377 break 4378 } 4379 x := v_0.Args[0] 4380 y := v_1 4381 v.reset(OpPPC64CMPWU) 4382 v.AddArg2(x, y) 4383 return true 4384 } 4385 // match: (CMPWU x (MOVDconst [c])) 4386 // cond: isU16Bit(c) 4387 // result: (CMPWUconst x [int32(c)]) 4388 for { 4389 x := v_0 4390 if v_1.Op != OpPPC64MOVDconst { 4391 break 4392 } 4393 c := auxIntToInt64(v_1.AuxInt) 4394 if !(isU16Bit(c)) { 4395 break 4396 } 4397 v.reset(OpPPC64CMPWUconst) 4398 v.AuxInt = int32ToAuxInt(int32(c)) 4399 v.AddArg(x) 4400 return true 4401 } 4402 // match: (CMPWU (MOVDconst [c]) y) 4403 // cond: isU16Bit(c) 4404 // result: (InvertFlags (CMPWUconst y [int32(c)])) 4405 for { 4406 if v_0.Op != OpPPC64MOVDconst { 4407 break 4408 } 4409 c := auxIntToInt64(v_0.AuxInt) 4410 y := v_1 4411 if !(isU16Bit(c)) { 4412 break 4413 } 4414 v.reset(OpPPC64InvertFlags) 4415 v0 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags) 4416 v0.AuxInt = int32ToAuxInt(int32(c)) 4417 v0.AddArg(y) 4418 v.AddArg(v0) 4419 return true 4420 } 4421 // match: (CMPWU x y) 4422 // cond: canonLessThan(x,y) 4423 // result: (InvertFlags (CMPWU y x)) 4424 for { 4425 x := v_0 4426 y := v_1 4427 if !(canonLessThan(x, y)) { 4428 break 4429 } 4430 v.reset(OpPPC64InvertFlags) 4431 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags) 4432 v0.AddArg2(y, x) 4433 v.AddArg(v0) 4434 return true 4435 } 4436 return false 4437 } 4438 func rewriteValuePPC64_OpPPC64CMPWUconst(v *Value) bool { 4439 v_0 := v.Args[0] 4440 // match: (CMPWUconst (MOVDconst [x]) [y]) 4441 // cond: int32(x)==int32(y) 4442 // result: (FlagEQ) 4443 for { 4444 y := auxIntToInt32(v.AuxInt) 4445 if v_0.Op != OpPPC64MOVDconst { 4446 break 4447 } 4448 x := auxIntToInt64(v_0.AuxInt) 4449 if !(int32(x) == int32(y)) { 4450 break 4451 } 4452 v.reset(OpPPC64FlagEQ) 4453 return true 4454 } 4455 // match: (CMPWUconst (MOVDconst [x]) [y]) 4456 // cond: uint32(x)<uint32(y) 4457 // result: (FlagLT) 4458 for { 4459 y := auxIntToInt32(v.AuxInt) 4460 if v_0.Op != OpPPC64MOVDconst { 4461 break 4462 } 4463 x := auxIntToInt64(v_0.AuxInt) 4464 if !(uint32(x) < uint32(y)) { 4465 break 4466 } 4467 v.reset(OpPPC64FlagLT) 4468 return true 4469 } 4470 // match: (CMPWUconst (MOVDconst [x]) [y]) 4471 // cond: uint32(x)>uint32(y) 4472 // result: (FlagGT) 4473 for { 4474 y := auxIntToInt32(v.AuxInt) 4475 if v_0.Op != OpPPC64MOVDconst { 4476 break 4477 } 4478 x := auxIntToInt64(v_0.AuxInt) 4479 if !(uint32(x) > uint32(y)) { 4480 break 4481 } 4482 v.reset(OpPPC64FlagGT) 4483 return true 4484 } 4485 return false 4486 } 4487 func rewriteValuePPC64_OpPPC64CMPWconst(v *Value) bool { 4488 v_0 := v.Args[0] 4489 // match: (CMPWconst (MOVDconst [x]) [y]) 4490 // cond: int32(x)==int32(y) 4491 // result: (FlagEQ) 4492 for { 4493 y := auxIntToInt32(v.AuxInt) 4494 if v_0.Op != OpPPC64MOVDconst { 4495 break 4496 } 4497 x := auxIntToInt64(v_0.AuxInt) 4498 if !(int32(x) == int32(y)) { 4499 break 4500 } 4501 v.reset(OpPPC64FlagEQ) 4502 return true 4503 } 4504 // match: (CMPWconst (MOVDconst [x]) [y]) 4505 // cond: int32(x)<int32(y) 4506 // result: (FlagLT) 4507 for { 4508 y := auxIntToInt32(v.AuxInt) 4509 if v_0.Op != OpPPC64MOVDconst { 4510 break 4511 } 4512 x := auxIntToInt64(v_0.AuxInt) 4513 if !(int32(x) < int32(y)) { 4514 break 4515 } 4516 v.reset(OpPPC64FlagLT) 4517 return true 4518 } 4519 // match: (CMPWconst (MOVDconst [x]) [y]) 4520 // cond: int32(x)>int32(y) 4521 // result: (FlagGT) 4522 for { 4523 y := auxIntToInt32(v.AuxInt) 4524 if v_0.Op != OpPPC64MOVDconst { 4525 break 4526 } 4527 x := auxIntToInt64(v_0.AuxInt) 4528 if !(int32(x) > int32(y)) { 4529 break 4530 } 4531 v.reset(OpPPC64FlagGT) 4532 return true 4533 } 4534 return false 4535 } 4536 func rewriteValuePPC64_OpPPC64CMPconst(v *Value) bool { 4537 v_0 := v.Args[0] 4538 // match: (CMPconst (MOVDconst [x]) [y]) 4539 // cond: x==y 4540 // result: (FlagEQ) 4541 for { 4542 y := auxIntToInt64(v.AuxInt) 4543 if v_0.Op != OpPPC64MOVDconst { 4544 break 4545 } 4546 x := auxIntToInt64(v_0.AuxInt) 4547 if !(x == y) { 4548 break 4549 } 4550 v.reset(OpPPC64FlagEQ) 4551 return true 4552 } 4553 // match: (CMPconst (MOVDconst [x]) [y]) 4554 // cond: x<y 4555 // result: (FlagLT) 4556 for { 4557 y := auxIntToInt64(v.AuxInt) 4558 if v_0.Op != OpPPC64MOVDconst { 4559 break 4560 } 4561 x := auxIntToInt64(v_0.AuxInt) 4562 if !(x < y) { 4563 break 4564 } 4565 v.reset(OpPPC64FlagLT) 4566 return true 4567 } 4568 // match: (CMPconst (MOVDconst [x]) [y]) 4569 // cond: x>y 4570 // result: (FlagGT) 4571 for { 4572 y := auxIntToInt64(v.AuxInt) 4573 if v_0.Op != OpPPC64MOVDconst { 4574 break 4575 } 4576 x := auxIntToInt64(v_0.AuxInt) 4577 if !(x > y) { 4578 break 4579 } 4580 v.reset(OpPPC64FlagGT) 4581 return true 4582 } 4583 return false 4584 } 4585 func rewriteValuePPC64_OpPPC64Equal(v *Value) bool { 4586 v_0 := v.Args[0] 4587 b := v.Block 4588 typ := &b.Func.Config.Types 4589 // match: (Equal (FlagEQ)) 4590 // result: (MOVDconst [1]) 4591 for { 4592 if v_0.Op != OpPPC64FlagEQ { 4593 break 4594 } 4595 v.reset(OpPPC64MOVDconst) 4596 v.AuxInt = int64ToAuxInt(1) 4597 return true 4598 } 4599 // match: (Equal (FlagLT)) 4600 // result: (MOVDconst [0]) 4601 for { 4602 if v_0.Op != OpPPC64FlagLT { 4603 break 4604 } 4605 v.reset(OpPPC64MOVDconst) 4606 v.AuxInt = int64ToAuxInt(0) 4607 return true 4608 } 4609 // match: (Equal (FlagGT)) 4610 // result: (MOVDconst [0]) 4611 for { 4612 if v_0.Op != OpPPC64FlagGT { 4613 break 4614 } 4615 v.reset(OpPPC64MOVDconst) 4616 v.AuxInt = int64ToAuxInt(0) 4617 return true 4618 } 4619 // match: (Equal (InvertFlags x)) 4620 // result: (Equal x) 4621 for { 4622 if v_0.Op != OpPPC64InvertFlags { 4623 break 4624 } 4625 x := v_0.Args[0] 4626 v.reset(OpPPC64Equal) 4627 v.AddArg(x) 4628 return true 4629 } 4630 // match: (Equal cmp) 4631 // result: (ISELB [2] (MOVDconst [1]) cmp) 4632 for { 4633 cmp := v_0 4634 v.reset(OpPPC64ISELB) 4635 v.AuxInt = int32ToAuxInt(2) 4636 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 4637 v0.AuxInt = int64ToAuxInt(1) 4638 v.AddArg2(v0, cmp) 4639 return true 4640 } 4641 } 4642 func rewriteValuePPC64_OpPPC64FABS(v *Value) bool { 4643 v_0 := v.Args[0] 4644 // match: (FABS (FMOVDconst [x])) 4645 // result: (FMOVDconst [math.Abs(x)]) 4646 for { 4647 if v_0.Op != OpPPC64FMOVDconst { 4648 break 4649 } 4650 x := auxIntToFloat64(v_0.AuxInt) 4651 v.reset(OpPPC64FMOVDconst) 4652 v.AuxInt = float64ToAuxInt(math.Abs(x)) 4653 return true 4654 } 4655 return false 4656 } 4657 func rewriteValuePPC64_OpPPC64FADD(v *Value) bool { 4658 v_1 := v.Args[1] 4659 v_0 := v.Args[0] 4660 // match: (FADD (FMUL x y) z) 4661 // cond: x.Block.Func.useFMA(v) 4662 // result: (FMADD x y z) 4663 for { 4664 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 4665 if v_0.Op != OpPPC64FMUL { 4666 continue 4667 } 4668 _ = v_0.Args[1] 4669 v_0_0 := v_0.Args[0] 4670 v_0_1 := v_0.Args[1] 4671 for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 { 4672 x := v_0_0 4673 y := v_0_1 4674 z := v_1 4675 if !(x.Block.Func.useFMA(v)) { 4676 continue 4677 } 4678 v.reset(OpPPC64FMADD) 4679 v.AddArg3(x, y, z) 4680 return true 4681 } 4682 } 4683 break 4684 } 4685 return false 4686 } 4687 func rewriteValuePPC64_OpPPC64FADDS(v *Value) bool { 4688 v_1 := v.Args[1] 4689 v_0 := v.Args[0] 4690 // match: (FADDS (FMULS x y) z) 4691 // cond: x.Block.Func.useFMA(v) 4692 // result: (FMADDS x y z) 4693 for { 4694 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 4695 if v_0.Op != OpPPC64FMULS { 4696 continue 4697 } 4698 _ = v_0.Args[1] 4699 v_0_0 := v_0.Args[0] 4700 v_0_1 := v_0.Args[1] 4701 for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 { 4702 x := v_0_0 4703 y := v_0_1 4704 z := v_1 4705 if !(x.Block.Func.useFMA(v)) { 4706 continue 4707 } 4708 v.reset(OpPPC64FMADDS) 4709 v.AddArg3(x, y, z) 4710 return true 4711 } 4712 } 4713 break 4714 } 4715 return false 4716 } 4717 func rewriteValuePPC64_OpPPC64FCEIL(v *Value) bool { 4718 v_0 := v.Args[0] 4719 // match: (FCEIL (FMOVDconst [x])) 4720 // result: (FMOVDconst [math.Ceil(x)]) 4721 for { 4722 if v_0.Op != OpPPC64FMOVDconst { 4723 break 4724 } 4725 x := auxIntToFloat64(v_0.AuxInt) 4726 v.reset(OpPPC64FMOVDconst) 4727 v.AuxInt = float64ToAuxInt(math.Ceil(x)) 4728 return true 4729 } 4730 return false 4731 } 4732 func rewriteValuePPC64_OpPPC64FFLOOR(v *Value) bool { 4733 v_0 := v.Args[0] 4734 // match: (FFLOOR (FMOVDconst [x])) 4735 // result: (FMOVDconst [math.Floor(x)]) 4736 for { 4737 if v_0.Op != OpPPC64FMOVDconst { 4738 break 4739 } 4740 x := auxIntToFloat64(v_0.AuxInt) 4741 v.reset(OpPPC64FMOVDconst) 4742 v.AuxInt = float64ToAuxInt(math.Floor(x)) 4743 return true 4744 } 4745 return false 4746 } 4747 func rewriteValuePPC64_OpPPC64FGreaterEqual(v *Value) bool { 4748 v_0 := v.Args[0] 4749 b := v.Block 4750 typ := &b.Func.Config.Types 4751 // match: (FGreaterEqual cmp) 4752 // result: (ISEL [2] (MOVDconst [1]) (ISELB [1] (MOVDconst [1]) cmp) cmp) 4753 for { 4754 cmp := v_0 4755 v.reset(OpPPC64ISEL) 4756 v.AuxInt = int32ToAuxInt(2) 4757 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 4758 v0.AuxInt = int64ToAuxInt(1) 4759 v1 := b.NewValue0(v.Pos, OpPPC64ISELB, typ.Int32) 4760 v1.AuxInt = int32ToAuxInt(1) 4761 v1.AddArg2(v0, cmp) 4762 v.AddArg3(v0, v1, cmp) 4763 return true 4764 } 4765 } 4766 func rewriteValuePPC64_OpPPC64FGreaterThan(v *Value) bool { 4767 v_0 := v.Args[0] 4768 b := v.Block 4769 typ := &b.Func.Config.Types 4770 // match: (FGreaterThan cmp) 4771 // result: (ISELB [1] (MOVDconst [1]) cmp) 4772 for { 4773 cmp := v_0 4774 v.reset(OpPPC64ISELB) 4775 v.AuxInt = int32ToAuxInt(1) 4776 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 4777 v0.AuxInt = int64ToAuxInt(1) 4778 v.AddArg2(v0, cmp) 4779 return true 4780 } 4781 } 4782 func rewriteValuePPC64_OpPPC64FLessEqual(v *Value) bool { 4783 v_0 := v.Args[0] 4784 b := v.Block 4785 typ := &b.Func.Config.Types 4786 // match: (FLessEqual cmp) 4787 // result: (ISEL [2] (MOVDconst [1]) (ISELB [0] (MOVDconst [1]) cmp) cmp) 4788 for { 4789 cmp := v_0 4790 v.reset(OpPPC64ISEL) 4791 v.AuxInt = int32ToAuxInt(2) 4792 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 4793 v0.AuxInt = int64ToAuxInt(1) 4794 v1 := b.NewValue0(v.Pos, OpPPC64ISELB, typ.Int32) 4795 v1.AuxInt = int32ToAuxInt(0) 4796 v1.AddArg2(v0, cmp) 4797 v.AddArg3(v0, v1, cmp) 4798 return true 4799 } 4800 } 4801 func rewriteValuePPC64_OpPPC64FLessThan(v *Value) bool { 4802 v_0 := v.Args[0] 4803 b := v.Block 4804 typ := &b.Func.Config.Types 4805 // match: (FLessThan cmp) 4806 // result: (ISELB [0] (MOVDconst [1]) cmp) 4807 for { 4808 cmp := v_0 4809 v.reset(OpPPC64ISELB) 4810 v.AuxInt = int32ToAuxInt(0) 4811 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 4812 v0.AuxInt = int64ToAuxInt(1) 4813 v.AddArg2(v0, cmp) 4814 return true 4815 } 4816 } 4817 func rewriteValuePPC64_OpPPC64FMOVDload(v *Value) bool { 4818 v_1 := v.Args[1] 4819 v_0 := v.Args[0] 4820 // match: (FMOVDload [off] {sym} ptr (MOVDstore [off] {sym} ptr x _)) 4821 // result: (MTVSRD x) 4822 for { 4823 off := auxIntToInt32(v.AuxInt) 4824 sym := auxToSym(v.Aux) 4825 ptr := v_0 4826 if v_1.Op != OpPPC64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym { 4827 break 4828 } 4829 x := v_1.Args[1] 4830 if ptr != v_1.Args[0] { 4831 break 4832 } 4833 v.reset(OpPPC64MTVSRD) 4834 v.AddArg(x) 4835 return true 4836 } 4837 // match: (FMOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem) 4838 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1) 4839 // result: (FMOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem) 4840 for { 4841 off1 := auxIntToInt32(v.AuxInt) 4842 sym1 := auxToSym(v.Aux) 4843 p := v_0 4844 if p.Op != OpPPC64MOVDaddr { 4845 break 4846 } 4847 off2 := auxIntToInt32(p.AuxInt) 4848 sym2 := auxToSym(p.Aux) 4849 ptr := p.Args[0] 4850 mem := v_1 4851 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) { 4852 break 4853 } 4854 v.reset(OpPPC64FMOVDload) 4855 v.AuxInt = int32ToAuxInt(off1 + off2) 4856 v.Aux = symToAux(mergeSym(sym1, sym2)) 4857 v.AddArg2(ptr, mem) 4858 return true 4859 } 4860 // match: (FMOVDload [off1] {sym} (ADDconst [off2] ptr) mem) 4861 // cond: is16Bit(int64(off1)+off2) 4862 // result: (FMOVDload [off1+int32(off2)] {sym} ptr mem) 4863 for { 4864 off1 := auxIntToInt32(v.AuxInt) 4865 sym := auxToSym(v.Aux) 4866 if v_0.Op != OpPPC64ADDconst { 4867 break 4868 } 4869 off2 := auxIntToInt64(v_0.AuxInt) 4870 ptr := v_0.Args[0] 4871 mem := v_1 4872 if !(is16Bit(int64(off1) + off2)) { 4873 break 4874 } 4875 v.reset(OpPPC64FMOVDload) 4876 v.AuxInt = int32ToAuxInt(off1 + int32(off2)) 4877 v.Aux = symToAux(sym) 4878 v.AddArg2(ptr, mem) 4879 return true 4880 } 4881 return false 4882 } 4883 func rewriteValuePPC64_OpPPC64FMOVDstore(v *Value) bool { 4884 v_2 := v.Args[2] 4885 v_1 := v.Args[1] 4886 v_0 := v.Args[0] 4887 // match: (FMOVDstore [off] {sym} ptr (MTVSRD x) mem) 4888 // result: (MOVDstore [off] {sym} ptr x mem) 4889 for { 4890 off := auxIntToInt32(v.AuxInt) 4891 sym := auxToSym(v.Aux) 4892 ptr := v_0 4893 if v_1.Op != OpPPC64MTVSRD { 4894 break 4895 } 4896 x := v_1.Args[0] 4897 mem := v_2 4898 v.reset(OpPPC64MOVDstore) 4899 v.AuxInt = int32ToAuxInt(off) 4900 v.Aux = symToAux(sym) 4901 v.AddArg3(ptr, x, mem) 4902 return true 4903 } 4904 // match: (FMOVDstore [off1] {sym} (ADDconst [off2] ptr) val mem) 4905 // cond: is16Bit(int64(off1)+off2) 4906 // result: (FMOVDstore [off1+int32(off2)] {sym} ptr val mem) 4907 for { 4908 off1 := auxIntToInt32(v.AuxInt) 4909 sym := auxToSym(v.Aux) 4910 if v_0.Op != OpPPC64ADDconst { 4911 break 4912 } 4913 off2 := auxIntToInt64(v_0.AuxInt) 4914 ptr := v_0.Args[0] 4915 val := v_1 4916 mem := v_2 4917 if !(is16Bit(int64(off1) + off2)) { 4918 break 4919 } 4920 v.reset(OpPPC64FMOVDstore) 4921 v.AuxInt = int32ToAuxInt(off1 + int32(off2)) 4922 v.Aux = symToAux(sym) 4923 v.AddArg3(ptr, val, mem) 4924 return true 4925 } 4926 // match: (FMOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem) 4927 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1) 4928 // result: (FMOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem) 4929 for { 4930 off1 := auxIntToInt32(v.AuxInt) 4931 sym1 := auxToSym(v.Aux) 4932 p := v_0 4933 if p.Op != OpPPC64MOVDaddr { 4934 break 4935 } 4936 off2 := auxIntToInt32(p.AuxInt) 4937 sym2 := auxToSym(p.Aux) 4938 ptr := p.Args[0] 4939 val := v_1 4940 mem := v_2 4941 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) { 4942 break 4943 } 4944 v.reset(OpPPC64FMOVDstore) 4945 v.AuxInt = int32ToAuxInt(off1 + off2) 4946 v.Aux = symToAux(mergeSym(sym1, sym2)) 4947 v.AddArg3(ptr, val, mem) 4948 return true 4949 } 4950 return false 4951 } 4952 func rewriteValuePPC64_OpPPC64FMOVSload(v *Value) bool { 4953 v_1 := v.Args[1] 4954 v_0 := v.Args[0] 4955 // match: (FMOVSload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem) 4956 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1) 4957 // result: (FMOVSload [off1+off2] {mergeSym(sym1,sym2)} ptr mem) 4958 for { 4959 off1 := auxIntToInt32(v.AuxInt) 4960 sym1 := auxToSym(v.Aux) 4961 p := v_0 4962 if p.Op != OpPPC64MOVDaddr { 4963 break 4964 } 4965 off2 := auxIntToInt32(p.AuxInt) 4966 sym2 := auxToSym(p.Aux) 4967 ptr := p.Args[0] 4968 mem := v_1 4969 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) { 4970 break 4971 } 4972 v.reset(OpPPC64FMOVSload) 4973 v.AuxInt = int32ToAuxInt(off1 + off2) 4974 v.Aux = symToAux(mergeSym(sym1, sym2)) 4975 v.AddArg2(ptr, mem) 4976 return true 4977 } 4978 // match: (FMOVSload [off1] {sym} (ADDconst [off2] ptr) mem) 4979 // cond: is16Bit(int64(off1)+off2) 4980 // result: (FMOVSload [off1+int32(off2)] {sym} ptr mem) 4981 for { 4982 off1 := auxIntToInt32(v.AuxInt) 4983 sym := auxToSym(v.Aux) 4984 if v_0.Op != OpPPC64ADDconst { 4985 break 4986 } 4987 off2 := auxIntToInt64(v_0.AuxInt) 4988 ptr := v_0.Args[0] 4989 mem := v_1 4990 if !(is16Bit(int64(off1) + off2)) { 4991 break 4992 } 4993 v.reset(OpPPC64FMOVSload) 4994 v.AuxInt = int32ToAuxInt(off1 + int32(off2)) 4995 v.Aux = symToAux(sym) 4996 v.AddArg2(ptr, mem) 4997 return true 4998 } 4999 return false 5000 } 5001 func rewriteValuePPC64_OpPPC64FMOVSstore(v *Value) bool { 5002 v_2 := v.Args[2] 5003 v_1 := v.Args[1] 5004 v_0 := v.Args[0] 5005 // match: (FMOVSstore [off1] {sym} (ADDconst [off2] ptr) val mem) 5006 // cond: is16Bit(int64(off1)+off2) 5007 // result: (FMOVSstore [off1+int32(off2)] {sym} ptr val mem) 5008 for { 5009 off1 := auxIntToInt32(v.AuxInt) 5010 sym := auxToSym(v.Aux) 5011 if v_0.Op != OpPPC64ADDconst { 5012 break 5013 } 5014 off2 := auxIntToInt64(v_0.AuxInt) 5015 ptr := v_0.Args[0] 5016 val := v_1 5017 mem := v_2 5018 if !(is16Bit(int64(off1) + off2)) { 5019 break 5020 } 5021 v.reset(OpPPC64FMOVSstore) 5022 v.AuxInt = int32ToAuxInt(off1 + int32(off2)) 5023 v.Aux = symToAux(sym) 5024 v.AddArg3(ptr, val, mem) 5025 return true 5026 } 5027 // match: (FMOVSstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem) 5028 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1) 5029 // result: (FMOVSstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem) 5030 for { 5031 off1 := auxIntToInt32(v.AuxInt) 5032 sym1 := auxToSym(v.Aux) 5033 p := v_0 5034 if p.Op != OpPPC64MOVDaddr { 5035 break 5036 } 5037 off2 := auxIntToInt32(p.AuxInt) 5038 sym2 := auxToSym(p.Aux) 5039 ptr := p.Args[0] 5040 val := v_1 5041 mem := v_2 5042 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) { 5043 break 5044 } 5045 v.reset(OpPPC64FMOVSstore) 5046 v.AuxInt = int32ToAuxInt(off1 + off2) 5047 v.Aux = symToAux(mergeSym(sym1, sym2)) 5048 v.AddArg3(ptr, val, mem) 5049 return true 5050 } 5051 return false 5052 } 5053 func rewriteValuePPC64_OpPPC64FNEG(v *Value) bool { 5054 v_0 := v.Args[0] 5055 // match: (FNEG (FABS x)) 5056 // result: (FNABS x) 5057 for { 5058 if v_0.Op != OpPPC64FABS { 5059 break 5060 } 5061 x := v_0.Args[0] 5062 v.reset(OpPPC64FNABS) 5063 v.AddArg(x) 5064 return true 5065 } 5066 // match: (FNEG (FNABS x)) 5067 // result: (FABS x) 5068 for { 5069 if v_0.Op != OpPPC64FNABS { 5070 break 5071 } 5072 x := v_0.Args[0] 5073 v.reset(OpPPC64FABS) 5074 v.AddArg(x) 5075 return true 5076 } 5077 return false 5078 } 5079 func rewriteValuePPC64_OpPPC64FSQRT(v *Value) bool { 5080 v_0 := v.Args[0] 5081 // match: (FSQRT (FMOVDconst [x])) 5082 // cond: x >= 0 5083 // result: (FMOVDconst [math.Sqrt(x)]) 5084 for { 5085 if v_0.Op != OpPPC64FMOVDconst { 5086 break 5087 } 5088 x := auxIntToFloat64(v_0.AuxInt) 5089 if !(x >= 0) { 5090 break 5091 } 5092 v.reset(OpPPC64FMOVDconst) 5093 v.AuxInt = float64ToAuxInt(math.Sqrt(x)) 5094 return true 5095 } 5096 return false 5097 } 5098 func rewriteValuePPC64_OpPPC64FSUB(v *Value) bool { 5099 v_1 := v.Args[1] 5100 v_0 := v.Args[0] 5101 // match: (FSUB (FMUL x y) z) 5102 // cond: x.Block.Func.useFMA(v) 5103 // result: (FMSUB x y z) 5104 for { 5105 if v_0.Op != OpPPC64FMUL { 5106 break 5107 } 5108 _ = v_0.Args[1] 5109 v_0_0 := v_0.Args[0] 5110 v_0_1 := v_0.Args[1] 5111 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 5112 x := v_0_0 5113 y := v_0_1 5114 z := v_1 5115 if !(x.Block.Func.useFMA(v)) { 5116 continue 5117 } 5118 v.reset(OpPPC64FMSUB) 5119 v.AddArg3(x, y, z) 5120 return true 5121 } 5122 break 5123 } 5124 return false 5125 } 5126 func rewriteValuePPC64_OpPPC64FSUBS(v *Value) bool { 5127 v_1 := v.Args[1] 5128 v_0 := v.Args[0] 5129 // match: (FSUBS (FMULS x y) z) 5130 // cond: x.Block.Func.useFMA(v) 5131 // result: (FMSUBS x y z) 5132 for { 5133 if v_0.Op != OpPPC64FMULS { 5134 break 5135 } 5136 _ = v_0.Args[1] 5137 v_0_0 := v_0.Args[0] 5138 v_0_1 := v_0.Args[1] 5139 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 5140 x := v_0_0 5141 y := v_0_1 5142 z := v_1 5143 if !(x.Block.Func.useFMA(v)) { 5144 continue 5145 } 5146 v.reset(OpPPC64FMSUBS) 5147 v.AddArg3(x, y, z) 5148 return true 5149 } 5150 break 5151 } 5152 return false 5153 } 5154 func rewriteValuePPC64_OpPPC64FTRUNC(v *Value) bool { 5155 v_0 := v.Args[0] 5156 // match: (FTRUNC (FMOVDconst [x])) 5157 // result: (FMOVDconst [math.Trunc(x)]) 5158 for { 5159 if v_0.Op != OpPPC64FMOVDconst { 5160 break 5161 } 5162 x := auxIntToFloat64(v_0.AuxInt) 5163 v.reset(OpPPC64FMOVDconst) 5164 v.AuxInt = float64ToAuxInt(math.Trunc(x)) 5165 return true 5166 } 5167 return false 5168 } 5169 func rewriteValuePPC64_OpPPC64GreaterEqual(v *Value) bool { 5170 v_0 := v.Args[0] 5171 b := v.Block 5172 typ := &b.Func.Config.Types 5173 // match: (GreaterEqual (FlagEQ)) 5174 // result: (MOVDconst [1]) 5175 for { 5176 if v_0.Op != OpPPC64FlagEQ { 5177 break 5178 } 5179 v.reset(OpPPC64MOVDconst) 5180 v.AuxInt = int64ToAuxInt(1) 5181 return true 5182 } 5183 // match: (GreaterEqual (FlagLT)) 5184 // result: (MOVDconst [0]) 5185 for { 5186 if v_0.Op != OpPPC64FlagLT { 5187 break 5188 } 5189 v.reset(OpPPC64MOVDconst) 5190 v.AuxInt = int64ToAuxInt(0) 5191 return true 5192 } 5193 // match: (GreaterEqual (FlagGT)) 5194 // result: (MOVDconst [1]) 5195 for { 5196 if v_0.Op != OpPPC64FlagGT { 5197 break 5198 } 5199 v.reset(OpPPC64MOVDconst) 5200 v.AuxInt = int64ToAuxInt(1) 5201 return true 5202 } 5203 // match: (GreaterEqual (InvertFlags x)) 5204 // result: (LessEqual x) 5205 for { 5206 if v_0.Op != OpPPC64InvertFlags { 5207 break 5208 } 5209 x := v_0.Args[0] 5210 v.reset(OpPPC64LessEqual) 5211 v.AddArg(x) 5212 return true 5213 } 5214 // match: (GreaterEqual cmp) 5215 // result: (ISELB [4] (MOVDconst [1]) cmp) 5216 for { 5217 cmp := v_0 5218 v.reset(OpPPC64ISELB) 5219 v.AuxInt = int32ToAuxInt(4) 5220 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 5221 v0.AuxInt = int64ToAuxInt(1) 5222 v.AddArg2(v0, cmp) 5223 return true 5224 } 5225 } 5226 func rewriteValuePPC64_OpPPC64GreaterThan(v *Value) bool { 5227 v_0 := v.Args[0] 5228 b := v.Block 5229 typ := &b.Func.Config.Types 5230 // match: (GreaterThan (FlagEQ)) 5231 // result: (MOVDconst [0]) 5232 for { 5233 if v_0.Op != OpPPC64FlagEQ { 5234 break 5235 } 5236 v.reset(OpPPC64MOVDconst) 5237 v.AuxInt = int64ToAuxInt(0) 5238 return true 5239 } 5240 // match: (GreaterThan (FlagLT)) 5241 // result: (MOVDconst [0]) 5242 for { 5243 if v_0.Op != OpPPC64FlagLT { 5244 break 5245 } 5246 v.reset(OpPPC64MOVDconst) 5247 v.AuxInt = int64ToAuxInt(0) 5248 return true 5249 } 5250 // match: (GreaterThan (FlagGT)) 5251 // result: (MOVDconst [1]) 5252 for { 5253 if v_0.Op != OpPPC64FlagGT { 5254 break 5255 } 5256 v.reset(OpPPC64MOVDconst) 5257 v.AuxInt = int64ToAuxInt(1) 5258 return true 5259 } 5260 // match: (GreaterThan (InvertFlags x)) 5261 // result: (LessThan x) 5262 for { 5263 if v_0.Op != OpPPC64InvertFlags { 5264 break 5265 } 5266 x := v_0.Args[0] 5267 v.reset(OpPPC64LessThan) 5268 v.AddArg(x) 5269 return true 5270 } 5271 // match: (GreaterThan cmp) 5272 // result: (ISELB [1] (MOVDconst [1]) cmp) 5273 for { 5274 cmp := v_0 5275 v.reset(OpPPC64ISELB) 5276 v.AuxInt = int32ToAuxInt(1) 5277 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 5278 v0.AuxInt = int64ToAuxInt(1) 5279 v.AddArg2(v0, cmp) 5280 return true 5281 } 5282 } 5283 func rewriteValuePPC64_OpPPC64ISEL(v *Value) bool { 5284 v_2 := v.Args[2] 5285 v_1 := v.Args[1] 5286 v_0 := v.Args[0] 5287 b := v.Block 5288 typ := &b.Func.Config.Types 5289 // match: (ISEL [0] (Select0 (ANDCCconst [d] y)) (MOVDconst [-1]) (CMPU (Select0 (ANDCCconst [d] y)) (MOVDconst [c]))) 5290 // cond: c >= d 5291 // result: (Select0 (ANDCCconst [d] y)) 5292 for { 5293 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpSelect0 { 5294 break 5295 } 5296 v_0_0 := v_0.Args[0] 5297 if v_0_0.Op != OpPPC64ANDCCconst { 5298 break 5299 } 5300 d := auxIntToInt64(v_0_0.AuxInt) 5301 y := v_0_0.Args[0] 5302 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 || v_2.Op != OpPPC64CMPU { 5303 break 5304 } 5305 _ = v_2.Args[1] 5306 v_2_0 := v_2.Args[0] 5307 if v_2_0.Op != OpSelect0 { 5308 break 5309 } 5310 v_2_0_0 := v_2_0.Args[0] 5311 if v_2_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_2_0_0.AuxInt) != d || y != v_2_0_0.Args[0] { 5312 break 5313 } 5314 v_2_1 := v_2.Args[1] 5315 if v_2_1.Op != OpPPC64MOVDconst { 5316 break 5317 } 5318 c := auxIntToInt64(v_2_1.AuxInt) 5319 if !(c >= d) { 5320 break 5321 } 5322 v.reset(OpSelect0) 5323 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 5324 v0.AuxInt = int64ToAuxInt(d) 5325 v0.AddArg(y) 5326 v.AddArg(v0) 5327 return true 5328 } 5329 // match: (ISEL [0] (Select0 (ANDCCconst [d] y)) (MOVDconst [-1]) (CMPUconst [c] (Select0 (ANDCCconst [d] y)))) 5330 // cond: c >= d 5331 // result: (Select0 (ANDCCconst [d] y)) 5332 for { 5333 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpSelect0 { 5334 break 5335 } 5336 v_0_0 := v_0.Args[0] 5337 if v_0_0.Op != OpPPC64ANDCCconst { 5338 break 5339 } 5340 d := auxIntToInt64(v_0_0.AuxInt) 5341 y := v_0_0.Args[0] 5342 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 || v_2.Op != OpPPC64CMPUconst { 5343 break 5344 } 5345 c := auxIntToInt64(v_2.AuxInt) 5346 v_2_0 := v_2.Args[0] 5347 if v_2_0.Op != OpSelect0 { 5348 break 5349 } 5350 v_2_0_0 := v_2_0.Args[0] 5351 if v_2_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_2_0_0.AuxInt) != d || y != v_2_0_0.Args[0] || !(c >= d) { 5352 break 5353 } 5354 v.reset(OpSelect0) 5355 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 5356 v0.AuxInt = int64ToAuxInt(d) 5357 v0.AddArg(y) 5358 v.AddArg(v0) 5359 return true 5360 } 5361 // match: (ISEL [6] x y (Select1 (ANDCCconst [1] (ISELB [c] one cmp)))) 5362 // result: (ISEL [c] x y cmp) 5363 for { 5364 if auxIntToInt32(v.AuxInt) != 6 { 5365 break 5366 } 5367 x := v_0 5368 y := v_1 5369 if v_2.Op != OpSelect1 { 5370 break 5371 } 5372 v_2_0 := v_2.Args[0] 5373 if v_2_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_2_0.AuxInt) != 1 { 5374 break 5375 } 5376 v_2_0_0 := v_2_0.Args[0] 5377 if v_2_0_0.Op != OpPPC64ISELB { 5378 break 5379 } 5380 c := auxIntToInt32(v_2_0_0.AuxInt) 5381 cmp := v_2_0_0.Args[1] 5382 v.reset(OpPPC64ISEL) 5383 v.AuxInt = int32ToAuxInt(c) 5384 v.AddArg3(x, y, cmp) 5385 return true 5386 } 5387 // match: (ISEL [2] x _ (FlagEQ)) 5388 // result: x 5389 for { 5390 if auxIntToInt32(v.AuxInt) != 2 { 5391 break 5392 } 5393 x := v_0 5394 if v_2.Op != OpPPC64FlagEQ { 5395 break 5396 } 5397 v.copyOf(x) 5398 return true 5399 } 5400 // match: (ISEL [2] _ y (FlagLT)) 5401 // result: y 5402 for { 5403 if auxIntToInt32(v.AuxInt) != 2 { 5404 break 5405 } 5406 y := v_1 5407 if v_2.Op != OpPPC64FlagLT { 5408 break 5409 } 5410 v.copyOf(y) 5411 return true 5412 } 5413 // match: (ISEL [2] _ y (FlagGT)) 5414 // result: y 5415 for { 5416 if auxIntToInt32(v.AuxInt) != 2 { 5417 break 5418 } 5419 y := v_1 5420 if v_2.Op != OpPPC64FlagGT { 5421 break 5422 } 5423 v.copyOf(y) 5424 return true 5425 } 5426 // match: (ISEL [6] _ y (FlagEQ)) 5427 // result: y 5428 for { 5429 if auxIntToInt32(v.AuxInt) != 6 { 5430 break 5431 } 5432 y := v_1 5433 if v_2.Op != OpPPC64FlagEQ { 5434 break 5435 } 5436 v.copyOf(y) 5437 return true 5438 } 5439 // match: (ISEL [6] x _ (FlagLT)) 5440 // result: x 5441 for { 5442 if auxIntToInt32(v.AuxInt) != 6 { 5443 break 5444 } 5445 x := v_0 5446 if v_2.Op != OpPPC64FlagLT { 5447 break 5448 } 5449 v.copyOf(x) 5450 return true 5451 } 5452 // match: (ISEL [6] x _ (FlagGT)) 5453 // result: x 5454 for { 5455 if auxIntToInt32(v.AuxInt) != 6 { 5456 break 5457 } 5458 x := v_0 5459 if v_2.Op != OpPPC64FlagGT { 5460 break 5461 } 5462 v.copyOf(x) 5463 return true 5464 } 5465 // match: (ISEL [0] _ y (FlagEQ)) 5466 // result: y 5467 for { 5468 if auxIntToInt32(v.AuxInt) != 0 { 5469 break 5470 } 5471 y := v_1 5472 if v_2.Op != OpPPC64FlagEQ { 5473 break 5474 } 5475 v.copyOf(y) 5476 return true 5477 } 5478 // match: (ISEL [0] _ y (FlagGT)) 5479 // result: y 5480 for { 5481 if auxIntToInt32(v.AuxInt) != 0 { 5482 break 5483 } 5484 y := v_1 5485 if v_2.Op != OpPPC64FlagGT { 5486 break 5487 } 5488 v.copyOf(y) 5489 return true 5490 } 5491 // match: (ISEL [0] x _ (FlagLT)) 5492 // result: x 5493 for { 5494 if auxIntToInt32(v.AuxInt) != 0 { 5495 break 5496 } 5497 x := v_0 5498 if v_2.Op != OpPPC64FlagLT { 5499 break 5500 } 5501 v.copyOf(x) 5502 return true 5503 } 5504 // match: (ISEL [5] _ x (FlagEQ)) 5505 // result: x 5506 for { 5507 if auxIntToInt32(v.AuxInt) != 5 { 5508 break 5509 } 5510 x := v_1 5511 if v_2.Op != OpPPC64FlagEQ { 5512 break 5513 } 5514 v.copyOf(x) 5515 return true 5516 } 5517 // match: (ISEL [5] _ x (FlagLT)) 5518 // result: x 5519 for { 5520 if auxIntToInt32(v.AuxInt) != 5 { 5521 break 5522 } 5523 x := v_1 5524 if v_2.Op != OpPPC64FlagLT { 5525 break 5526 } 5527 v.copyOf(x) 5528 return true 5529 } 5530 // match: (ISEL [5] y _ (FlagGT)) 5531 // result: y 5532 for { 5533 if auxIntToInt32(v.AuxInt) != 5 { 5534 break 5535 } 5536 y := v_0 5537 if v_2.Op != OpPPC64FlagGT { 5538 break 5539 } 5540 v.copyOf(y) 5541 return true 5542 } 5543 // match: (ISEL [1] _ y (FlagEQ)) 5544 // result: y 5545 for { 5546 if auxIntToInt32(v.AuxInt) != 1 { 5547 break 5548 } 5549 y := v_1 5550 if v_2.Op != OpPPC64FlagEQ { 5551 break 5552 } 5553 v.copyOf(y) 5554 return true 5555 } 5556 // match: (ISEL [1] _ y (FlagLT)) 5557 // result: y 5558 for { 5559 if auxIntToInt32(v.AuxInt) != 1 { 5560 break 5561 } 5562 y := v_1 5563 if v_2.Op != OpPPC64FlagLT { 5564 break 5565 } 5566 v.copyOf(y) 5567 return true 5568 } 5569 // match: (ISEL [1] x _ (FlagGT)) 5570 // result: x 5571 for { 5572 if auxIntToInt32(v.AuxInt) != 1 { 5573 break 5574 } 5575 x := v_0 5576 if v_2.Op != OpPPC64FlagGT { 5577 break 5578 } 5579 v.copyOf(x) 5580 return true 5581 } 5582 // match: (ISEL [4] x _ (FlagEQ)) 5583 // result: x 5584 for { 5585 if auxIntToInt32(v.AuxInt) != 4 { 5586 break 5587 } 5588 x := v_0 5589 if v_2.Op != OpPPC64FlagEQ { 5590 break 5591 } 5592 v.copyOf(x) 5593 return true 5594 } 5595 // match: (ISEL [4] x _ (FlagGT)) 5596 // result: x 5597 for { 5598 if auxIntToInt32(v.AuxInt) != 4 { 5599 break 5600 } 5601 x := v_0 5602 if v_2.Op != OpPPC64FlagGT { 5603 break 5604 } 5605 v.copyOf(x) 5606 return true 5607 } 5608 // match: (ISEL [4] _ y (FlagLT)) 5609 // result: y 5610 for { 5611 if auxIntToInt32(v.AuxInt) != 4 { 5612 break 5613 } 5614 y := v_1 5615 if v_2.Op != OpPPC64FlagLT { 5616 break 5617 } 5618 v.copyOf(y) 5619 return true 5620 } 5621 // match: (ISEL [2] x y (CMPconst [0] (Select0 (ANDCCconst [n] z)))) 5622 // result: (ISEL [2] x y (Select1 <types.TypeFlags> (ANDCCconst [n] z ))) 5623 for { 5624 if auxIntToInt32(v.AuxInt) != 2 { 5625 break 5626 } 5627 x := v_0 5628 y := v_1 5629 if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 { 5630 break 5631 } 5632 v_2_0 := v_2.Args[0] 5633 if v_2_0.Op != OpSelect0 { 5634 break 5635 } 5636 v_2_0_0 := v_2_0.Args[0] 5637 if v_2_0_0.Op != OpPPC64ANDCCconst { 5638 break 5639 } 5640 n := auxIntToInt64(v_2_0_0.AuxInt) 5641 z := v_2_0_0.Args[0] 5642 v.reset(OpPPC64ISEL) 5643 v.AuxInt = int32ToAuxInt(2) 5644 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags) 5645 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 5646 v1.AuxInt = int64ToAuxInt(n) 5647 v1.AddArg(z) 5648 v0.AddArg(v1) 5649 v.AddArg3(x, y, v0) 5650 return true 5651 } 5652 // match: (ISEL [2] x y (CMPWconst [0] (Select0 (ANDCCconst [n] z)))) 5653 // result: (ISEL [2] x y (Select1 <types.TypeFlags> (ANDCCconst [n] z ))) 5654 for { 5655 if auxIntToInt32(v.AuxInt) != 2 { 5656 break 5657 } 5658 x := v_0 5659 y := v_1 5660 if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 { 5661 break 5662 } 5663 v_2_0 := v_2.Args[0] 5664 if v_2_0.Op != OpSelect0 { 5665 break 5666 } 5667 v_2_0_0 := v_2_0.Args[0] 5668 if v_2_0_0.Op != OpPPC64ANDCCconst { 5669 break 5670 } 5671 n := auxIntToInt64(v_2_0_0.AuxInt) 5672 z := v_2_0_0.Args[0] 5673 v.reset(OpPPC64ISEL) 5674 v.AuxInt = int32ToAuxInt(2) 5675 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags) 5676 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 5677 v1.AuxInt = int64ToAuxInt(n) 5678 v1.AddArg(z) 5679 v0.AddArg(v1) 5680 v.AddArg3(x, y, v0) 5681 return true 5682 } 5683 // match: (ISEL [6] x y (CMPconst [0] (Select0 (ANDCCconst [n] z)))) 5684 // result: (ISEL [6] x y (Select1 <types.TypeFlags> (ANDCCconst [n] z ))) 5685 for { 5686 if auxIntToInt32(v.AuxInt) != 6 { 5687 break 5688 } 5689 x := v_0 5690 y := v_1 5691 if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 { 5692 break 5693 } 5694 v_2_0 := v_2.Args[0] 5695 if v_2_0.Op != OpSelect0 { 5696 break 5697 } 5698 v_2_0_0 := v_2_0.Args[0] 5699 if v_2_0_0.Op != OpPPC64ANDCCconst { 5700 break 5701 } 5702 n := auxIntToInt64(v_2_0_0.AuxInt) 5703 z := v_2_0_0.Args[0] 5704 v.reset(OpPPC64ISEL) 5705 v.AuxInt = int32ToAuxInt(6) 5706 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags) 5707 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 5708 v1.AuxInt = int64ToAuxInt(n) 5709 v1.AddArg(z) 5710 v0.AddArg(v1) 5711 v.AddArg3(x, y, v0) 5712 return true 5713 } 5714 // match: (ISEL [6] x y (CMPWconst [0] (Select0 (ANDCCconst [n] z)))) 5715 // result: (ISEL [6] x y (Select1 <types.TypeFlags> (ANDCCconst [n] z ))) 5716 for { 5717 if auxIntToInt32(v.AuxInt) != 6 { 5718 break 5719 } 5720 x := v_0 5721 y := v_1 5722 if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 { 5723 break 5724 } 5725 v_2_0 := v_2.Args[0] 5726 if v_2_0.Op != OpSelect0 { 5727 break 5728 } 5729 v_2_0_0 := v_2_0.Args[0] 5730 if v_2_0_0.Op != OpPPC64ANDCCconst { 5731 break 5732 } 5733 n := auxIntToInt64(v_2_0_0.AuxInt) 5734 z := v_2_0_0.Args[0] 5735 v.reset(OpPPC64ISEL) 5736 v.AuxInt = int32ToAuxInt(6) 5737 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags) 5738 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 5739 v1.AuxInt = int64ToAuxInt(n) 5740 v1.AddArg(z) 5741 v0.AddArg(v1) 5742 v.AddArg3(x, y, v0) 5743 return true 5744 } 5745 // match: (ISEL [n] x y (InvertFlags bool)) 5746 // cond: n%4 == 0 5747 // result: (ISEL [n+1] x y bool) 5748 for { 5749 n := auxIntToInt32(v.AuxInt) 5750 x := v_0 5751 y := v_1 5752 if v_2.Op != OpPPC64InvertFlags { 5753 break 5754 } 5755 bool := v_2.Args[0] 5756 if !(n%4 == 0) { 5757 break 5758 } 5759 v.reset(OpPPC64ISEL) 5760 v.AuxInt = int32ToAuxInt(n + 1) 5761 v.AddArg3(x, y, bool) 5762 return true 5763 } 5764 // match: (ISEL [n] x y (InvertFlags bool)) 5765 // cond: n%4 == 1 5766 // result: (ISEL [n-1] x y bool) 5767 for { 5768 n := auxIntToInt32(v.AuxInt) 5769 x := v_0 5770 y := v_1 5771 if v_2.Op != OpPPC64InvertFlags { 5772 break 5773 } 5774 bool := v_2.Args[0] 5775 if !(n%4 == 1) { 5776 break 5777 } 5778 v.reset(OpPPC64ISEL) 5779 v.AuxInt = int32ToAuxInt(n - 1) 5780 v.AddArg3(x, y, bool) 5781 return true 5782 } 5783 // match: (ISEL [n] x y (InvertFlags bool)) 5784 // cond: n%4 == 2 5785 // result: (ISEL [n] x y bool) 5786 for { 5787 n := auxIntToInt32(v.AuxInt) 5788 x := v_0 5789 y := v_1 5790 if v_2.Op != OpPPC64InvertFlags { 5791 break 5792 } 5793 bool := v_2.Args[0] 5794 if !(n%4 == 2) { 5795 break 5796 } 5797 v.reset(OpPPC64ISEL) 5798 v.AuxInt = int32ToAuxInt(n) 5799 v.AddArg3(x, y, bool) 5800 return true 5801 } 5802 return false 5803 } 5804 func rewriteValuePPC64_OpPPC64ISELB(v *Value) bool { 5805 v_1 := v.Args[1] 5806 v_0 := v.Args[0] 5807 b := v.Block 5808 typ := &b.Func.Config.Types 5809 // match: (ISELB [0] _ (FlagLT)) 5810 // result: (MOVDconst [1]) 5811 for { 5812 if auxIntToInt32(v.AuxInt) != 0 || v_1.Op != OpPPC64FlagLT { 5813 break 5814 } 5815 v.reset(OpPPC64MOVDconst) 5816 v.AuxInt = int64ToAuxInt(1) 5817 return true 5818 } 5819 // match: (ISELB [0] _ (FlagGT)) 5820 // result: (MOVDconst [0]) 5821 for { 5822 if auxIntToInt32(v.AuxInt) != 0 || v_1.Op != OpPPC64FlagGT { 5823 break 5824 } 5825 v.reset(OpPPC64MOVDconst) 5826 v.AuxInt = int64ToAuxInt(0) 5827 return true 5828 } 5829 // match: (ISELB [0] _ (FlagEQ)) 5830 // result: (MOVDconst [0]) 5831 for { 5832 if auxIntToInt32(v.AuxInt) != 0 || v_1.Op != OpPPC64FlagEQ { 5833 break 5834 } 5835 v.reset(OpPPC64MOVDconst) 5836 v.AuxInt = int64ToAuxInt(0) 5837 return true 5838 } 5839 // match: (ISELB [1] _ (FlagGT)) 5840 // result: (MOVDconst [1]) 5841 for { 5842 if auxIntToInt32(v.AuxInt) != 1 || v_1.Op != OpPPC64FlagGT { 5843 break 5844 } 5845 v.reset(OpPPC64MOVDconst) 5846 v.AuxInt = int64ToAuxInt(1) 5847 return true 5848 } 5849 // match: (ISELB [1] _ (FlagLT)) 5850 // result: (MOVDconst [0]) 5851 for { 5852 if auxIntToInt32(v.AuxInt) != 1 || v_1.Op != OpPPC64FlagLT { 5853 break 5854 } 5855 v.reset(OpPPC64MOVDconst) 5856 v.AuxInt = int64ToAuxInt(0) 5857 return true 5858 } 5859 // match: (ISELB [1] _ (FlagEQ)) 5860 // result: (MOVDconst [0]) 5861 for { 5862 if auxIntToInt32(v.AuxInt) != 1 || v_1.Op != OpPPC64FlagEQ { 5863 break 5864 } 5865 v.reset(OpPPC64MOVDconst) 5866 v.AuxInt = int64ToAuxInt(0) 5867 return true 5868 } 5869 // match: (ISELB [2] _ (FlagEQ)) 5870 // result: (MOVDconst [1]) 5871 for { 5872 if auxIntToInt32(v.AuxInt) != 2 || v_1.Op != OpPPC64FlagEQ { 5873 break 5874 } 5875 v.reset(OpPPC64MOVDconst) 5876 v.AuxInt = int64ToAuxInt(1) 5877 return true 5878 } 5879 // match: (ISELB [2] _ (FlagLT)) 5880 // result: (MOVDconst [0]) 5881 for { 5882 if auxIntToInt32(v.AuxInt) != 2 || v_1.Op != OpPPC64FlagLT { 5883 break 5884 } 5885 v.reset(OpPPC64MOVDconst) 5886 v.AuxInt = int64ToAuxInt(0) 5887 return true 5888 } 5889 // match: (ISELB [2] _ (FlagGT)) 5890 // result: (MOVDconst [0]) 5891 for { 5892 if auxIntToInt32(v.AuxInt) != 2 || v_1.Op != OpPPC64FlagGT { 5893 break 5894 } 5895 v.reset(OpPPC64MOVDconst) 5896 v.AuxInt = int64ToAuxInt(0) 5897 return true 5898 } 5899 // match: (ISELB [4] _ (FlagLT)) 5900 // result: (MOVDconst [0]) 5901 for { 5902 if auxIntToInt32(v.AuxInt) != 4 || v_1.Op != OpPPC64FlagLT { 5903 break 5904 } 5905 v.reset(OpPPC64MOVDconst) 5906 v.AuxInt = int64ToAuxInt(0) 5907 return true 5908 } 5909 // match: (ISELB [4] _ (FlagGT)) 5910 // result: (MOVDconst [1]) 5911 for { 5912 if auxIntToInt32(v.AuxInt) != 4 || v_1.Op != OpPPC64FlagGT { 5913 break 5914 } 5915 v.reset(OpPPC64MOVDconst) 5916 v.AuxInt = int64ToAuxInt(1) 5917 return true 5918 } 5919 // match: (ISELB [4] _ (FlagEQ)) 5920 // result: (MOVDconst [1]) 5921 for { 5922 if auxIntToInt32(v.AuxInt) != 4 || v_1.Op != OpPPC64FlagEQ { 5923 break 5924 } 5925 v.reset(OpPPC64MOVDconst) 5926 v.AuxInt = int64ToAuxInt(1) 5927 return true 5928 } 5929 // match: (ISELB [5] _ (FlagGT)) 5930 // result: (MOVDconst [0]) 5931 for { 5932 if auxIntToInt32(v.AuxInt) != 5 || v_1.Op != OpPPC64FlagGT { 5933 break 5934 } 5935 v.reset(OpPPC64MOVDconst) 5936 v.AuxInt = int64ToAuxInt(0) 5937 return true 5938 } 5939 // match: (ISELB [5] _ (FlagLT)) 5940 // result: (MOVDconst [1]) 5941 for { 5942 if auxIntToInt32(v.AuxInt) != 5 || v_1.Op != OpPPC64FlagLT { 5943 break 5944 } 5945 v.reset(OpPPC64MOVDconst) 5946 v.AuxInt = int64ToAuxInt(1) 5947 return true 5948 } 5949 // match: (ISELB [5] _ (FlagEQ)) 5950 // result: (MOVDconst [1]) 5951 for { 5952 if auxIntToInt32(v.AuxInt) != 5 || v_1.Op != OpPPC64FlagEQ { 5953 break 5954 } 5955 v.reset(OpPPC64MOVDconst) 5956 v.AuxInt = int64ToAuxInt(1) 5957 return true 5958 } 5959 // match: (ISELB [6] _ (FlagEQ)) 5960 // result: (MOVDconst [0]) 5961 for { 5962 if auxIntToInt32(v.AuxInt) != 6 || v_1.Op != OpPPC64FlagEQ { 5963 break 5964 } 5965 v.reset(OpPPC64MOVDconst) 5966 v.AuxInt = int64ToAuxInt(0) 5967 return true 5968 } 5969 // match: (ISELB [6] _ (FlagLT)) 5970 // result: (MOVDconst [1]) 5971 for { 5972 if auxIntToInt32(v.AuxInt) != 6 || v_1.Op != OpPPC64FlagLT { 5973 break 5974 } 5975 v.reset(OpPPC64MOVDconst) 5976 v.AuxInt = int64ToAuxInt(1) 5977 return true 5978 } 5979 // match: (ISELB [6] _ (FlagGT)) 5980 // result: (MOVDconst [1]) 5981 for { 5982 if auxIntToInt32(v.AuxInt) != 6 || v_1.Op != OpPPC64FlagGT { 5983 break 5984 } 5985 v.reset(OpPPC64MOVDconst) 5986 v.AuxInt = int64ToAuxInt(1) 5987 return true 5988 } 5989 // match: (ISELB [2] x (CMPconst [0] (Select0 (ANDCCconst [1] z)))) 5990 // result: (XORconst [1] (Select0 <typ.UInt64> (ANDCCconst [1] z ))) 5991 for { 5992 if auxIntToInt32(v.AuxInt) != 2 { 5993 break 5994 } 5995 if v_1.Op != OpPPC64CMPconst || auxIntToInt64(v_1.AuxInt) != 0 { 5996 break 5997 } 5998 v_1_0 := v_1.Args[0] 5999 if v_1_0.Op != OpSelect0 { 6000 break 6001 } 6002 v_1_0_0 := v_1_0.Args[0] 6003 if v_1_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_1_0_0.AuxInt) != 1 { 6004 break 6005 } 6006 z := v_1_0_0.Args[0] 6007 v.reset(OpPPC64XORconst) 6008 v.AuxInt = int64ToAuxInt(1) 6009 v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64) 6010 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 6011 v1.AuxInt = int64ToAuxInt(1) 6012 v1.AddArg(z) 6013 v0.AddArg(v1) 6014 v.AddArg(v0) 6015 return true 6016 } 6017 // match: (ISELB [2] x (CMPWconst [0] (Select0 (ANDCCconst [1] z)))) 6018 // result: (XORconst [1] (Select0 <typ.UInt64> (ANDCCconst [1] z ))) 6019 for { 6020 if auxIntToInt32(v.AuxInt) != 2 { 6021 break 6022 } 6023 if v_1.Op != OpPPC64CMPWconst || auxIntToInt32(v_1.AuxInt) != 0 { 6024 break 6025 } 6026 v_1_0 := v_1.Args[0] 6027 if v_1_0.Op != OpSelect0 { 6028 break 6029 } 6030 v_1_0_0 := v_1_0.Args[0] 6031 if v_1_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_1_0_0.AuxInt) != 1 { 6032 break 6033 } 6034 z := v_1_0_0.Args[0] 6035 v.reset(OpPPC64XORconst) 6036 v.AuxInt = int64ToAuxInt(1) 6037 v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64) 6038 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 6039 v1.AuxInt = int64ToAuxInt(1) 6040 v1.AddArg(z) 6041 v0.AddArg(v1) 6042 v.AddArg(v0) 6043 return true 6044 } 6045 // match: (ISELB [6] x (CMPconst [0] (Select0 (ANDCCconst [1] z)))) 6046 // result: (Select0 <typ.UInt64> (ANDCCconst [1] z )) 6047 for { 6048 if auxIntToInt32(v.AuxInt) != 6 { 6049 break 6050 } 6051 if v_1.Op != OpPPC64CMPconst || auxIntToInt64(v_1.AuxInt) != 0 { 6052 break 6053 } 6054 v_1_0 := v_1.Args[0] 6055 if v_1_0.Op != OpSelect0 { 6056 break 6057 } 6058 v_1_0_0 := v_1_0.Args[0] 6059 if v_1_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_1_0_0.AuxInt) != 1 { 6060 break 6061 } 6062 z := v_1_0_0.Args[0] 6063 v.reset(OpSelect0) 6064 v.Type = typ.UInt64 6065 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 6066 v0.AuxInt = int64ToAuxInt(1) 6067 v0.AddArg(z) 6068 v.AddArg(v0) 6069 return true 6070 } 6071 // match: (ISELB [6] x (CMPWconst [0] (Select0 (ANDCCconst [1] z)))) 6072 // result: (Select0 <typ.UInt64> (ANDCCconst [1] z )) 6073 for { 6074 if auxIntToInt32(v.AuxInt) != 6 { 6075 break 6076 } 6077 if v_1.Op != OpPPC64CMPWconst || auxIntToInt32(v_1.AuxInt) != 0 { 6078 break 6079 } 6080 v_1_0 := v_1.Args[0] 6081 if v_1_0.Op != OpSelect0 { 6082 break 6083 } 6084 v_1_0_0 := v_1_0.Args[0] 6085 if v_1_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_1_0_0.AuxInt) != 1 { 6086 break 6087 } 6088 z := v_1_0_0.Args[0] 6089 v.reset(OpSelect0) 6090 v.Type = typ.UInt64 6091 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 6092 v0.AuxInt = int64ToAuxInt(1) 6093 v0.AddArg(z) 6094 v.AddArg(v0) 6095 return true 6096 } 6097 // match: (ISELB [2] x (CMPWconst [0] (Select0 (ANDCCconst [n] z)))) 6098 // result: (ISELB [2] x (Select1 <types.TypeFlags> (ANDCCconst [n] z ))) 6099 for { 6100 if auxIntToInt32(v.AuxInt) != 2 { 6101 break 6102 } 6103 x := v_0 6104 if v_1.Op != OpPPC64CMPWconst || auxIntToInt32(v_1.AuxInt) != 0 { 6105 break 6106 } 6107 v_1_0 := v_1.Args[0] 6108 if v_1_0.Op != OpSelect0 { 6109 break 6110 } 6111 v_1_0_0 := v_1_0.Args[0] 6112 if v_1_0_0.Op != OpPPC64ANDCCconst { 6113 break 6114 } 6115 n := auxIntToInt64(v_1_0_0.AuxInt) 6116 z := v_1_0_0.Args[0] 6117 v.reset(OpPPC64ISELB) 6118 v.AuxInt = int32ToAuxInt(2) 6119 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags) 6120 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 6121 v1.AuxInt = int64ToAuxInt(n) 6122 v1.AddArg(z) 6123 v0.AddArg(v1) 6124 v.AddArg2(x, v0) 6125 return true 6126 } 6127 // match: (ISELB [6] x (CMPWconst [0] (Select0 (ANDCCconst [n] z)))) 6128 // result: (ISELB [6] x (Select1 <types.TypeFlags> (ANDCCconst [n] z ))) 6129 for { 6130 if auxIntToInt32(v.AuxInt) != 6 { 6131 break 6132 } 6133 x := v_0 6134 if v_1.Op != OpPPC64CMPWconst || auxIntToInt32(v_1.AuxInt) != 0 { 6135 break 6136 } 6137 v_1_0 := v_1.Args[0] 6138 if v_1_0.Op != OpSelect0 { 6139 break 6140 } 6141 v_1_0_0 := v_1_0.Args[0] 6142 if v_1_0_0.Op != OpPPC64ANDCCconst { 6143 break 6144 } 6145 n := auxIntToInt64(v_1_0_0.AuxInt) 6146 z := v_1_0_0.Args[0] 6147 v.reset(OpPPC64ISELB) 6148 v.AuxInt = int32ToAuxInt(6) 6149 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags) 6150 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 6151 v1.AuxInt = int64ToAuxInt(n) 6152 v1.AddArg(z) 6153 v0.AddArg(v1) 6154 v.AddArg2(x, v0) 6155 return true 6156 } 6157 // match: (ISELB [2] x (CMPconst [0] a:(AND y z))) 6158 // cond: a.Uses == 1 6159 // result: (ISELB [2] x (Select1 <types.TypeFlags> (ANDCC y z ))) 6160 for { 6161 if auxIntToInt32(v.AuxInt) != 2 { 6162 break 6163 } 6164 x := v_0 6165 if v_1.Op != OpPPC64CMPconst || auxIntToInt64(v_1.AuxInt) != 0 { 6166 break 6167 } 6168 a := v_1.Args[0] 6169 if a.Op != OpPPC64AND { 6170 break 6171 } 6172 z := a.Args[1] 6173 y := a.Args[0] 6174 if !(a.Uses == 1) { 6175 break 6176 } 6177 v.reset(OpPPC64ISELB) 6178 v.AuxInt = int32ToAuxInt(2) 6179 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags) 6180 v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags)) 6181 v1.AddArg2(y, z) 6182 v0.AddArg(v1) 6183 v.AddArg2(x, v0) 6184 return true 6185 } 6186 // match: (ISELB [6] x (CMPconst [0] a:(AND y z))) 6187 // cond: a.Uses == 1 6188 // result: (ISELB [6] x (Select1 <types.TypeFlags> (ANDCC y z ))) 6189 for { 6190 if auxIntToInt32(v.AuxInt) != 6 { 6191 break 6192 } 6193 x := v_0 6194 if v_1.Op != OpPPC64CMPconst || auxIntToInt64(v_1.AuxInt) != 0 { 6195 break 6196 } 6197 a := v_1.Args[0] 6198 if a.Op != OpPPC64AND { 6199 break 6200 } 6201 z := a.Args[1] 6202 y := a.Args[0] 6203 if !(a.Uses == 1) { 6204 break 6205 } 6206 v.reset(OpPPC64ISELB) 6207 v.AuxInt = int32ToAuxInt(6) 6208 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags) 6209 v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags)) 6210 v1.AddArg2(y, z) 6211 v0.AddArg(v1) 6212 v.AddArg2(x, v0) 6213 return true 6214 } 6215 // match: (ISELB [2] x (CMPconst [0] o:(OR y z))) 6216 // cond: o.Uses == 1 6217 // result: (ISELB [2] x (Select1 <types.TypeFlags> (ORCC y z ))) 6218 for { 6219 if auxIntToInt32(v.AuxInt) != 2 { 6220 break 6221 } 6222 x := v_0 6223 if v_1.Op != OpPPC64CMPconst || auxIntToInt64(v_1.AuxInt) != 0 { 6224 break 6225 } 6226 o := v_1.Args[0] 6227 if o.Op != OpPPC64OR { 6228 break 6229 } 6230 z := o.Args[1] 6231 y := o.Args[0] 6232 if !(o.Uses == 1) { 6233 break 6234 } 6235 v.reset(OpPPC64ISELB) 6236 v.AuxInt = int32ToAuxInt(2) 6237 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags) 6238 v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags)) 6239 v1.AddArg2(y, z) 6240 v0.AddArg(v1) 6241 v.AddArg2(x, v0) 6242 return true 6243 } 6244 // match: (ISELB [6] x (CMPconst [0] o:(OR y z))) 6245 // cond: o.Uses == 1 6246 // result: (ISELB [6] x (Select1 <types.TypeFlags> (ORCC y z ))) 6247 for { 6248 if auxIntToInt32(v.AuxInt) != 6 { 6249 break 6250 } 6251 x := v_0 6252 if v_1.Op != OpPPC64CMPconst || auxIntToInt64(v_1.AuxInt) != 0 { 6253 break 6254 } 6255 o := v_1.Args[0] 6256 if o.Op != OpPPC64OR { 6257 break 6258 } 6259 z := o.Args[1] 6260 y := o.Args[0] 6261 if !(o.Uses == 1) { 6262 break 6263 } 6264 v.reset(OpPPC64ISELB) 6265 v.AuxInt = int32ToAuxInt(6) 6266 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags) 6267 v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags)) 6268 v1.AddArg2(y, z) 6269 v0.AddArg(v1) 6270 v.AddArg2(x, v0) 6271 return true 6272 } 6273 // match: (ISELB [2] x (CMPconst [0] a:(XOR y z))) 6274 // cond: a.Uses == 1 6275 // result: (ISELB [2] x (Select1 <types.TypeFlags> (XORCC y z ))) 6276 for { 6277 if auxIntToInt32(v.AuxInt) != 2 { 6278 break 6279 } 6280 x := v_0 6281 if v_1.Op != OpPPC64CMPconst || auxIntToInt64(v_1.AuxInt) != 0 { 6282 break 6283 } 6284 a := v_1.Args[0] 6285 if a.Op != OpPPC64XOR { 6286 break 6287 } 6288 z := a.Args[1] 6289 y := a.Args[0] 6290 if !(a.Uses == 1) { 6291 break 6292 } 6293 v.reset(OpPPC64ISELB) 6294 v.AuxInt = int32ToAuxInt(2) 6295 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags) 6296 v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags)) 6297 v1.AddArg2(y, z) 6298 v0.AddArg(v1) 6299 v.AddArg2(x, v0) 6300 return true 6301 } 6302 // match: (ISELB [6] x (CMPconst [0] a:(XOR y z))) 6303 // cond: a.Uses == 1 6304 // result: (ISELB [6] x (Select1 <types.TypeFlags> (XORCC y z ))) 6305 for { 6306 if auxIntToInt32(v.AuxInt) != 6 { 6307 break 6308 } 6309 x := v_0 6310 if v_1.Op != OpPPC64CMPconst || auxIntToInt64(v_1.AuxInt) != 0 { 6311 break 6312 } 6313 a := v_1.Args[0] 6314 if a.Op != OpPPC64XOR { 6315 break 6316 } 6317 z := a.Args[1] 6318 y := a.Args[0] 6319 if !(a.Uses == 1) { 6320 break 6321 } 6322 v.reset(OpPPC64ISELB) 6323 v.AuxInt = int32ToAuxInt(6) 6324 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags) 6325 v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags)) 6326 v1.AddArg2(y, z) 6327 v0.AddArg(v1) 6328 v.AddArg2(x, v0) 6329 return true 6330 } 6331 // match: (ISELB [n] (MOVDconst [1]) (InvertFlags bool)) 6332 // cond: n%4 == 0 6333 // result: (ISELB [n+1] (MOVDconst [1]) bool) 6334 for { 6335 n := auxIntToInt32(v.AuxInt) 6336 if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 || v_1.Op != OpPPC64InvertFlags { 6337 break 6338 } 6339 bool := v_1.Args[0] 6340 if !(n%4 == 0) { 6341 break 6342 } 6343 v.reset(OpPPC64ISELB) 6344 v.AuxInt = int32ToAuxInt(n + 1) 6345 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 6346 v0.AuxInt = int64ToAuxInt(1) 6347 v.AddArg2(v0, bool) 6348 return true 6349 } 6350 // match: (ISELB [n] (MOVDconst [1]) (InvertFlags bool)) 6351 // cond: n%4 == 1 6352 // result: (ISELB [n-1] (MOVDconst [1]) bool) 6353 for { 6354 n := auxIntToInt32(v.AuxInt) 6355 if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 || v_1.Op != OpPPC64InvertFlags { 6356 break 6357 } 6358 bool := v_1.Args[0] 6359 if !(n%4 == 1) { 6360 break 6361 } 6362 v.reset(OpPPC64ISELB) 6363 v.AuxInt = int32ToAuxInt(n - 1) 6364 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 6365 v0.AuxInt = int64ToAuxInt(1) 6366 v.AddArg2(v0, bool) 6367 return true 6368 } 6369 // match: (ISELB [n] (MOVDconst [1]) (InvertFlags bool)) 6370 // cond: n%4 == 2 6371 // result: (ISELB [n] (MOVDconst [1]) bool) 6372 for { 6373 n := auxIntToInt32(v.AuxInt) 6374 if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 || v_1.Op != OpPPC64InvertFlags { 6375 break 6376 } 6377 bool := v_1.Args[0] 6378 if !(n%4 == 2) { 6379 break 6380 } 6381 v.reset(OpPPC64ISELB) 6382 v.AuxInt = int32ToAuxInt(n) 6383 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 6384 v0.AuxInt = int64ToAuxInt(1) 6385 v.AddArg2(v0, bool) 6386 return true 6387 } 6388 return false 6389 } 6390 func rewriteValuePPC64_OpPPC64LessEqual(v *Value) bool { 6391 v_0 := v.Args[0] 6392 b := v.Block 6393 typ := &b.Func.Config.Types 6394 // match: (LessEqual (FlagEQ)) 6395 // result: (MOVDconst [1]) 6396 for { 6397 if v_0.Op != OpPPC64FlagEQ { 6398 break 6399 } 6400 v.reset(OpPPC64MOVDconst) 6401 v.AuxInt = int64ToAuxInt(1) 6402 return true 6403 } 6404 // match: (LessEqual (FlagLT)) 6405 // result: (MOVDconst [1]) 6406 for { 6407 if v_0.Op != OpPPC64FlagLT { 6408 break 6409 } 6410 v.reset(OpPPC64MOVDconst) 6411 v.AuxInt = int64ToAuxInt(1) 6412 return true 6413 } 6414 // match: (LessEqual (FlagGT)) 6415 // result: (MOVDconst [0]) 6416 for { 6417 if v_0.Op != OpPPC64FlagGT { 6418 break 6419 } 6420 v.reset(OpPPC64MOVDconst) 6421 v.AuxInt = int64ToAuxInt(0) 6422 return true 6423 } 6424 // match: (LessEqual (InvertFlags x)) 6425 // result: (GreaterEqual x) 6426 for { 6427 if v_0.Op != OpPPC64InvertFlags { 6428 break 6429 } 6430 x := v_0.Args[0] 6431 v.reset(OpPPC64GreaterEqual) 6432 v.AddArg(x) 6433 return true 6434 } 6435 // match: (LessEqual cmp) 6436 // result: (ISELB [5] (MOVDconst [1]) cmp) 6437 for { 6438 cmp := v_0 6439 v.reset(OpPPC64ISELB) 6440 v.AuxInt = int32ToAuxInt(5) 6441 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 6442 v0.AuxInt = int64ToAuxInt(1) 6443 v.AddArg2(v0, cmp) 6444 return true 6445 } 6446 } 6447 func rewriteValuePPC64_OpPPC64LessThan(v *Value) bool { 6448 v_0 := v.Args[0] 6449 b := v.Block 6450 typ := &b.Func.Config.Types 6451 // match: (LessThan (FlagEQ)) 6452 // result: (MOVDconst [0]) 6453 for { 6454 if v_0.Op != OpPPC64FlagEQ { 6455 break 6456 } 6457 v.reset(OpPPC64MOVDconst) 6458 v.AuxInt = int64ToAuxInt(0) 6459 return true 6460 } 6461 // match: (LessThan (FlagLT)) 6462 // result: (MOVDconst [1]) 6463 for { 6464 if v_0.Op != OpPPC64FlagLT { 6465 break 6466 } 6467 v.reset(OpPPC64MOVDconst) 6468 v.AuxInt = int64ToAuxInt(1) 6469 return true 6470 } 6471 // match: (LessThan (FlagGT)) 6472 // result: (MOVDconst [0]) 6473 for { 6474 if v_0.Op != OpPPC64FlagGT { 6475 break 6476 } 6477 v.reset(OpPPC64MOVDconst) 6478 v.AuxInt = int64ToAuxInt(0) 6479 return true 6480 } 6481 // match: (LessThan (InvertFlags x)) 6482 // result: (GreaterThan x) 6483 for { 6484 if v_0.Op != OpPPC64InvertFlags { 6485 break 6486 } 6487 x := v_0.Args[0] 6488 v.reset(OpPPC64GreaterThan) 6489 v.AddArg(x) 6490 return true 6491 } 6492 // match: (LessThan cmp) 6493 // result: (ISELB [0] (MOVDconst [1]) cmp) 6494 for { 6495 cmp := v_0 6496 v.reset(OpPPC64ISELB) 6497 v.AuxInt = int32ToAuxInt(0) 6498 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 6499 v0.AuxInt = int64ToAuxInt(1) 6500 v.AddArg2(v0, cmp) 6501 return true 6502 } 6503 } 6504 func rewriteValuePPC64_OpPPC64MFVSRD(v *Value) bool { 6505 v_0 := v.Args[0] 6506 b := v.Block 6507 typ := &b.Func.Config.Types 6508 // match: (MFVSRD (FMOVDconst [c])) 6509 // result: (MOVDconst [int64(math.Float64bits(c))]) 6510 for { 6511 if v_0.Op != OpPPC64FMOVDconst { 6512 break 6513 } 6514 c := auxIntToFloat64(v_0.AuxInt) 6515 v.reset(OpPPC64MOVDconst) 6516 v.AuxInt = int64ToAuxInt(int64(math.Float64bits(c))) 6517 return true 6518 } 6519 // match: (MFVSRD x:(FMOVDload [off] {sym} ptr mem)) 6520 // cond: x.Uses == 1 && clobber(x) 6521 // result: @x.Block (MOVDload [off] {sym} ptr mem) 6522 for { 6523 x := v_0 6524 if x.Op != OpPPC64FMOVDload { 6525 break 6526 } 6527 off := auxIntToInt32(x.AuxInt) 6528 sym := auxToSym(x.Aux) 6529 mem := x.Args[1] 6530 ptr := x.Args[0] 6531 if !(x.Uses == 1 && clobber(x)) { 6532 break 6533 } 6534 b = x.Block 6535 v0 := b.NewValue0(x.Pos, OpPPC64MOVDload, typ.Int64) 6536 v.copyOf(v0) 6537 v0.AuxInt = int32ToAuxInt(off) 6538 v0.Aux = symToAux(sym) 6539 v0.AddArg2(ptr, mem) 6540 return true 6541 } 6542 return false 6543 } 6544 func rewriteValuePPC64_OpPPC64MOVBZload(v *Value) bool { 6545 v_1 := v.Args[1] 6546 v_0 := v.Args[0] 6547 // match: (MOVBZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem) 6548 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1) 6549 // result: (MOVBZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem) 6550 for { 6551 off1 := auxIntToInt32(v.AuxInt) 6552 sym1 := auxToSym(v.Aux) 6553 p := v_0 6554 if p.Op != OpPPC64MOVDaddr { 6555 break 6556 } 6557 off2 := auxIntToInt32(p.AuxInt) 6558 sym2 := auxToSym(p.Aux) 6559 ptr := p.Args[0] 6560 mem := v_1 6561 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) { 6562 break 6563 } 6564 v.reset(OpPPC64MOVBZload) 6565 v.AuxInt = int32ToAuxInt(off1 + off2) 6566 v.Aux = symToAux(mergeSym(sym1, sym2)) 6567 v.AddArg2(ptr, mem) 6568 return true 6569 } 6570 // match: (MOVBZload [off1] {sym} (ADDconst [off2] x) mem) 6571 // cond: is16Bit(int64(off1)+off2) 6572 // result: (MOVBZload [off1+int32(off2)] {sym} x mem) 6573 for { 6574 off1 := auxIntToInt32(v.AuxInt) 6575 sym := auxToSym(v.Aux) 6576 if v_0.Op != OpPPC64ADDconst { 6577 break 6578 } 6579 off2 := auxIntToInt64(v_0.AuxInt) 6580 x := v_0.Args[0] 6581 mem := v_1 6582 if !(is16Bit(int64(off1) + off2)) { 6583 break 6584 } 6585 v.reset(OpPPC64MOVBZload) 6586 v.AuxInt = int32ToAuxInt(off1 + int32(off2)) 6587 v.Aux = symToAux(sym) 6588 v.AddArg2(x, mem) 6589 return true 6590 } 6591 // match: (MOVBZload [0] {sym} p:(ADD ptr idx) mem) 6592 // cond: sym == nil && p.Uses == 1 6593 // result: (MOVBZloadidx ptr idx mem) 6594 for { 6595 if auxIntToInt32(v.AuxInt) != 0 { 6596 break 6597 } 6598 sym := auxToSym(v.Aux) 6599 p := v_0 6600 if p.Op != OpPPC64ADD { 6601 break 6602 } 6603 idx := p.Args[1] 6604 ptr := p.Args[0] 6605 mem := v_1 6606 if !(sym == nil && p.Uses == 1) { 6607 break 6608 } 6609 v.reset(OpPPC64MOVBZloadidx) 6610 v.AddArg3(ptr, idx, mem) 6611 return true 6612 } 6613 return false 6614 } 6615 func rewriteValuePPC64_OpPPC64MOVBZloadidx(v *Value) bool { 6616 v_2 := v.Args[2] 6617 v_1 := v.Args[1] 6618 v_0 := v.Args[0] 6619 // match: (MOVBZloadidx ptr (MOVDconst [c]) mem) 6620 // cond: is16Bit(c) 6621 // result: (MOVBZload [int32(c)] ptr mem) 6622 for { 6623 ptr := v_0 6624 if v_1.Op != OpPPC64MOVDconst { 6625 break 6626 } 6627 c := auxIntToInt64(v_1.AuxInt) 6628 mem := v_2 6629 if !(is16Bit(c)) { 6630 break 6631 } 6632 v.reset(OpPPC64MOVBZload) 6633 v.AuxInt = int32ToAuxInt(int32(c)) 6634 v.AddArg2(ptr, mem) 6635 return true 6636 } 6637 // match: (MOVBZloadidx (MOVDconst [c]) ptr mem) 6638 // cond: is16Bit(c) 6639 // result: (MOVBZload [int32(c)] ptr mem) 6640 for { 6641 if v_0.Op != OpPPC64MOVDconst { 6642 break 6643 } 6644 c := auxIntToInt64(v_0.AuxInt) 6645 ptr := v_1 6646 mem := v_2 6647 if !(is16Bit(c)) { 6648 break 6649 } 6650 v.reset(OpPPC64MOVBZload) 6651 v.AuxInt = int32ToAuxInt(int32(c)) 6652 v.AddArg2(ptr, mem) 6653 return true 6654 } 6655 return false 6656 } 6657 func rewriteValuePPC64_OpPPC64MOVBZreg(v *Value) bool { 6658 v_0 := v.Args[0] 6659 b := v.Block 6660 typ := &b.Func.Config.Types 6661 // match: (MOVBZreg y:(Select0 (ANDCCconst [c] _))) 6662 // cond: uint64(c) <= 0xFF 6663 // result: y 6664 for { 6665 y := v_0 6666 if y.Op != OpSelect0 { 6667 break 6668 } 6669 y_0 := y.Args[0] 6670 if y_0.Op != OpPPC64ANDCCconst { 6671 break 6672 } 6673 c := auxIntToInt64(y_0.AuxInt) 6674 if !(uint64(c) <= 0xFF) { 6675 break 6676 } 6677 v.copyOf(y) 6678 return true 6679 } 6680 // match: (MOVBZreg (SRWconst [c] (MOVBZreg x))) 6681 // result: (SRWconst [c] (MOVBZreg x)) 6682 for { 6683 if v_0.Op != OpPPC64SRWconst { 6684 break 6685 } 6686 c := auxIntToInt64(v_0.AuxInt) 6687 v_0_0 := v_0.Args[0] 6688 if v_0_0.Op != OpPPC64MOVBZreg { 6689 break 6690 } 6691 x := v_0_0.Args[0] 6692 v.reset(OpPPC64SRWconst) 6693 v.AuxInt = int64ToAuxInt(c) 6694 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64) 6695 v0.AddArg(x) 6696 v.AddArg(v0) 6697 return true 6698 } 6699 // match: (MOVBZreg (SRWconst [c] x)) 6700 // cond: sizeof(x.Type) == 8 6701 // result: (SRWconst [c] x) 6702 for { 6703 if v_0.Op != OpPPC64SRWconst { 6704 break 6705 } 6706 c := auxIntToInt64(v_0.AuxInt) 6707 x := v_0.Args[0] 6708 if !(sizeof(x.Type) == 8) { 6709 break 6710 } 6711 v.reset(OpPPC64SRWconst) 6712 v.AuxInt = int64ToAuxInt(c) 6713 v.AddArg(x) 6714 return true 6715 } 6716 // match: (MOVBZreg (SRDconst [c] x)) 6717 // cond: c>=56 6718 // result: (SRDconst [c] x) 6719 for { 6720 if v_0.Op != OpPPC64SRDconst { 6721 break 6722 } 6723 c := auxIntToInt64(v_0.AuxInt) 6724 x := v_0.Args[0] 6725 if !(c >= 56) { 6726 break 6727 } 6728 v.reset(OpPPC64SRDconst) 6729 v.AuxInt = int64ToAuxInt(c) 6730 v.AddArg(x) 6731 return true 6732 } 6733 // match: (MOVBZreg (SRWconst [c] x)) 6734 // cond: c>=24 6735 // result: (SRWconst [c] x) 6736 for { 6737 if v_0.Op != OpPPC64SRWconst { 6738 break 6739 } 6740 c := auxIntToInt64(v_0.AuxInt) 6741 x := v_0.Args[0] 6742 if !(c >= 24) { 6743 break 6744 } 6745 v.reset(OpPPC64SRWconst) 6746 v.AuxInt = int64ToAuxInt(c) 6747 v.AddArg(x) 6748 return true 6749 } 6750 // match: (MOVBZreg y:(MOVBZreg _)) 6751 // result: y 6752 for { 6753 y := v_0 6754 if y.Op != OpPPC64MOVBZreg { 6755 break 6756 } 6757 v.copyOf(y) 6758 return true 6759 } 6760 // match: (MOVBZreg (MOVBreg x)) 6761 // result: (MOVBZreg x) 6762 for { 6763 if v_0.Op != OpPPC64MOVBreg { 6764 break 6765 } 6766 x := v_0.Args[0] 6767 v.reset(OpPPC64MOVBZreg) 6768 v.AddArg(x) 6769 return true 6770 } 6771 // match: (MOVBZreg (OR <t> x (MOVWZreg y))) 6772 // result: (MOVBZreg (OR <t> x y)) 6773 for { 6774 if v_0.Op != OpPPC64OR { 6775 break 6776 } 6777 t := v_0.Type 6778 _ = v_0.Args[1] 6779 v_0_0 := v_0.Args[0] 6780 v_0_1 := v_0.Args[1] 6781 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 6782 x := v_0_0 6783 if v_0_1.Op != OpPPC64MOVWZreg { 6784 continue 6785 } 6786 y := v_0_1.Args[0] 6787 v.reset(OpPPC64MOVBZreg) 6788 v0 := b.NewValue0(v.Pos, OpPPC64OR, t) 6789 v0.AddArg2(x, y) 6790 v.AddArg(v0) 6791 return true 6792 } 6793 break 6794 } 6795 // match: (MOVBZreg (XOR <t> x (MOVWZreg y))) 6796 // result: (MOVBZreg (XOR <t> x y)) 6797 for { 6798 if v_0.Op != OpPPC64XOR { 6799 break 6800 } 6801 t := v_0.Type 6802 _ = v_0.Args[1] 6803 v_0_0 := v_0.Args[0] 6804 v_0_1 := v_0.Args[1] 6805 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 6806 x := v_0_0 6807 if v_0_1.Op != OpPPC64MOVWZreg { 6808 continue 6809 } 6810 y := v_0_1.Args[0] 6811 v.reset(OpPPC64MOVBZreg) 6812 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t) 6813 v0.AddArg2(x, y) 6814 v.AddArg(v0) 6815 return true 6816 } 6817 break 6818 } 6819 // match: (MOVBZreg (AND <t> x (MOVWZreg y))) 6820 // result: (MOVBZreg (AND <t> x y)) 6821 for { 6822 if v_0.Op != OpPPC64AND { 6823 break 6824 } 6825 t := v_0.Type 6826 _ = v_0.Args[1] 6827 v_0_0 := v_0.Args[0] 6828 v_0_1 := v_0.Args[1] 6829 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 6830 x := v_0_0 6831 if v_0_1.Op != OpPPC64MOVWZreg { 6832 continue 6833 } 6834 y := v_0_1.Args[0] 6835 v.reset(OpPPC64MOVBZreg) 6836 v0 := b.NewValue0(v.Pos, OpPPC64AND, t) 6837 v0.AddArg2(x, y) 6838 v.AddArg(v0) 6839 return true 6840 } 6841 break 6842 } 6843 // match: (MOVBZreg (OR <t> x (MOVHZreg y))) 6844 // result: (MOVBZreg (OR <t> x y)) 6845 for { 6846 if v_0.Op != OpPPC64OR { 6847 break 6848 } 6849 t := v_0.Type 6850 _ = v_0.Args[1] 6851 v_0_0 := v_0.Args[0] 6852 v_0_1 := v_0.Args[1] 6853 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 6854 x := v_0_0 6855 if v_0_1.Op != OpPPC64MOVHZreg { 6856 continue 6857 } 6858 y := v_0_1.Args[0] 6859 v.reset(OpPPC64MOVBZreg) 6860 v0 := b.NewValue0(v.Pos, OpPPC64OR, t) 6861 v0.AddArg2(x, y) 6862 v.AddArg(v0) 6863 return true 6864 } 6865 break 6866 } 6867 // match: (MOVBZreg (XOR <t> x (MOVHZreg y))) 6868 // result: (MOVBZreg (XOR <t> x y)) 6869 for { 6870 if v_0.Op != OpPPC64XOR { 6871 break 6872 } 6873 t := v_0.Type 6874 _ = v_0.Args[1] 6875 v_0_0 := v_0.Args[0] 6876 v_0_1 := v_0.Args[1] 6877 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 6878 x := v_0_0 6879 if v_0_1.Op != OpPPC64MOVHZreg { 6880 continue 6881 } 6882 y := v_0_1.Args[0] 6883 v.reset(OpPPC64MOVBZreg) 6884 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t) 6885 v0.AddArg2(x, y) 6886 v.AddArg(v0) 6887 return true 6888 } 6889 break 6890 } 6891 // match: (MOVBZreg (AND <t> x (MOVHZreg y))) 6892 // result: (MOVBZreg (AND <t> x y)) 6893 for { 6894 if v_0.Op != OpPPC64AND { 6895 break 6896 } 6897 t := v_0.Type 6898 _ = v_0.Args[1] 6899 v_0_0 := v_0.Args[0] 6900 v_0_1 := v_0.Args[1] 6901 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 6902 x := v_0_0 6903 if v_0_1.Op != OpPPC64MOVHZreg { 6904 continue 6905 } 6906 y := v_0_1.Args[0] 6907 v.reset(OpPPC64MOVBZreg) 6908 v0 := b.NewValue0(v.Pos, OpPPC64AND, t) 6909 v0.AddArg2(x, y) 6910 v.AddArg(v0) 6911 return true 6912 } 6913 break 6914 } 6915 // match: (MOVBZreg (OR <t> x (MOVBZreg y))) 6916 // result: (MOVBZreg (OR <t> x y)) 6917 for { 6918 if v_0.Op != OpPPC64OR { 6919 break 6920 } 6921 t := v_0.Type 6922 _ = v_0.Args[1] 6923 v_0_0 := v_0.Args[0] 6924 v_0_1 := v_0.Args[1] 6925 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 6926 x := v_0_0 6927 if v_0_1.Op != OpPPC64MOVBZreg { 6928 continue 6929 } 6930 y := v_0_1.Args[0] 6931 v.reset(OpPPC64MOVBZreg) 6932 v0 := b.NewValue0(v.Pos, OpPPC64OR, t) 6933 v0.AddArg2(x, y) 6934 v.AddArg(v0) 6935 return true 6936 } 6937 break 6938 } 6939 // match: (MOVBZreg (XOR <t> x (MOVBZreg y))) 6940 // result: (MOVBZreg (XOR <t> x y)) 6941 for { 6942 if v_0.Op != OpPPC64XOR { 6943 break 6944 } 6945 t := v_0.Type 6946 _ = v_0.Args[1] 6947 v_0_0 := v_0.Args[0] 6948 v_0_1 := v_0.Args[1] 6949 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 6950 x := v_0_0 6951 if v_0_1.Op != OpPPC64MOVBZreg { 6952 continue 6953 } 6954 y := v_0_1.Args[0] 6955 v.reset(OpPPC64MOVBZreg) 6956 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t) 6957 v0.AddArg2(x, y) 6958 v.AddArg(v0) 6959 return true 6960 } 6961 break 6962 } 6963 // match: (MOVBZreg (AND <t> x (MOVBZreg y))) 6964 // result: (MOVBZreg (AND <t> x y)) 6965 for { 6966 if v_0.Op != OpPPC64AND { 6967 break 6968 } 6969 t := v_0.Type 6970 _ = v_0.Args[1] 6971 v_0_0 := v_0.Args[0] 6972 v_0_1 := v_0.Args[1] 6973 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 6974 x := v_0_0 6975 if v_0_1.Op != OpPPC64MOVBZreg { 6976 continue 6977 } 6978 y := v_0_1.Args[0] 6979 v.reset(OpPPC64MOVBZreg) 6980 v0 := b.NewValue0(v.Pos, OpPPC64AND, t) 6981 v0.AddArg2(x, y) 6982 v.AddArg(v0) 6983 return true 6984 } 6985 break 6986 } 6987 // match: (MOVBZreg z:(Select0 (ANDCCconst [c] (MOVBZload ptr x)))) 6988 // result: z 6989 for { 6990 z := v_0 6991 if z.Op != OpSelect0 { 6992 break 6993 } 6994 z_0 := z.Args[0] 6995 if z_0.Op != OpPPC64ANDCCconst { 6996 break 6997 } 6998 z_0_0 := z_0.Args[0] 6999 if z_0_0.Op != OpPPC64MOVBZload { 7000 break 7001 } 7002 v.copyOf(z) 7003 return true 7004 } 7005 // match: (MOVBZreg z:(AND y (MOVBZload ptr x))) 7006 // result: z 7007 for { 7008 z := v_0 7009 if z.Op != OpPPC64AND { 7010 break 7011 } 7012 _ = z.Args[1] 7013 z_0 := z.Args[0] 7014 z_1 := z.Args[1] 7015 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 7016 if z_1.Op != OpPPC64MOVBZload { 7017 continue 7018 } 7019 v.copyOf(z) 7020 return true 7021 } 7022 break 7023 } 7024 // match: (MOVBZreg x:(MOVBZload _ _)) 7025 // result: x 7026 for { 7027 x := v_0 7028 if x.Op != OpPPC64MOVBZload { 7029 break 7030 } 7031 v.copyOf(x) 7032 return true 7033 } 7034 // match: (MOVBZreg x:(MOVBZloadidx _ _ _)) 7035 // result: x 7036 for { 7037 x := v_0 7038 if x.Op != OpPPC64MOVBZloadidx { 7039 break 7040 } 7041 v.copyOf(x) 7042 return true 7043 } 7044 // match: (MOVBZreg x:(Select0 (LoweredAtomicLoad8 _ _))) 7045 // result: x 7046 for { 7047 x := v_0 7048 if x.Op != OpSelect0 { 7049 break 7050 } 7051 x_0 := x.Args[0] 7052 if x_0.Op != OpPPC64LoweredAtomicLoad8 { 7053 break 7054 } 7055 v.copyOf(x) 7056 return true 7057 } 7058 // match: (MOVBZreg x:(Arg <t>)) 7059 // cond: is8BitInt(t) && !isSigned(t) 7060 // result: x 7061 for { 7062 x := v_0 7063 if x.Op != OpArg { 7064 break 7065 } 7066 t := x.Type 7067 if !(is8BitInt(t) && !isSigned(t)) { 7068 break 7069 } 7070 v.copyOf(x) 7071 return true 7072 } 7073 // match: (MOVBZreg (MOVDconst [c])) 7074 // result: (MOVDconst [int64(uint8(c))]) 7075 for { 7076 if v_0.Op != OpPPC64MOVDconst { 7077 break 7078 } 7079 c := auxIntToInt64(v_0.AuxInt) 7080 v.reset(OpPPC64MOVDconst) 7081 v.AuxInt = int64ToAuxInt(int64(uint8(c))) 7082 return true 7083 } 7084 return false 7085 } 7086 func rewriteValuePPC64_OpPPC64MOVBreg(v *Value) bool { 7087 v_0 := v.Args[0] 7088 b := v.Block 7089 typ := &b.Func.Config.Types 7090 // match: (MOVBreg y:(Select0 (ANDCCconst [c] _))) 7091 // cond: uint64(c) <= 0x7F 7092 // result: y 7093 for { 7094 y := v_0 7095 if y.Op != OpSelect0 { 7096 break 7097 } 7098 y_0 := y.Args[0] 7099 if y_0.Op != OpPPC64ANDCCconst { 7100 break 7101 } 7102 c := auxIntToInt64(y_0.AuxInt) 7103 if !(uint64(c) <= 0x7F) { 7104 break 7105 } 7106 v.copyOf(y) 7107 return true 7108 } 7109 // match: (MOVBreg (SRAWconst [c] (MOVBreg x))) 7110 // result: (SRAWconst [c] (MOVBreg x)) 7111 for { 7112 if v_0.Op != OpPPC64SRAWconst { 7113 break 7114 } 7115 c := auxIntToInt64(v_0.AuxInt) 7116 v_0_0 := v_0.Args[0] 7117 if v_0_0.Op != OpPPC64MOVBreg { 7118 break 7119 } 7120 x := v_0_0.Args[0] 7121 v.reset(OpPPC64SRAWconst) 7122 v.AuxInt = int64ToAuxInt(c) 7123 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64) 7124 v0.AddArg(x) 7125 v.AddArg(v0) 7126 return true 7127 } 7128 // match: (MOVBreg (SRAWconst [c] x)) 7129 // cond: sizeof(x.Type) == 8 7130 // result: (SRAWconst [c] x) 7131 for { 7132 if v_0.Op != OpPPC64SRAWconst { 7133 break 7134 } 7135 c := auxIntToInt64(v_0.AuxInt) 7136 x := v_0.Args[0] 7137 if !(sizeof(x.Type) == 8) { 7138 break 7139 } 7140 v.reset(OpPPC64SRAWconst) 7141 v.AuxInt = int64ToAuxInt(c) 7142 v.AddArg(x) 7143 return true 7144 } 7145 // match: (MOVBreg (SRDconst [c] x)) 7146 // cond: c>56 7147 // result: (SRDconst [c] x) 7148 for { 7149 if v_0.Op != OpPPC64SRDconst { 7150 break 7151 } 7152 c := auxIntToInt64(v_0.AuxInt) 7153 x := v_0.Args[0] 7154 if !(c > 56) { 7155 break 7156 } 7157 v.reset(OpPPC64SRDconst) 7158 v.AuxInt = int64ToAuxInt(c) 7159 v.AddArg(x) 7160 return true 7161 } 7162 // match: (MOVBreg (SRDconst [c] x)) 7163 // cond: c==56 7164 // result: (SRADconst [c] x) 7165 for { 7166 if v_0.Op != OpPPC64SRDconst { 7167 break 7168 } 7169 c := auxIntToInt64(v_0.AuxInt) 7170 x := v_0.Args[0] 7171 if !(c == 56) { 7172 break 7173 } 7174 v.reset(OpPPC64SRADconst) 7175 v.AuxInt = int64ToAuxInt(c) 7176 v.AddArg(x) 7177 return true 7178 } 7179 // match: (MOVBreg (SRADconst [c] x)) 7180 // cond: c>=56 7181 // result: (SRADconst [c] x) 7182 for { 7183 if v_0.Op != OpPPC64SRADconst { 7184 break 7185 } 7186 c := auxIntToInt64(v_0.AuxInt) 7187 x := v_0.Args[0] 7188 if !(c >= 56) { 7189 break 7190 } 7191 v.reset(OpPPC64SRADconst) 7192 v.AuxInt = int64ToAuxInt(c) 7193 v.AddArg(x) 7194 return true 7195 } 7196 // match: (MOVBreg (SRWconst [c] x)) 7197 // cond: c>24 7198 // result: (SRWconst [c] x) 7199 for { 7200 if v_0.Op != OpPPC64SRWconst { 7201 break 7202 } 7203 c := auxIntToInt64(v_0.AuxInt) 7204 x := v_0.Args[0] 7205 if !(c > 24) { 7206 break 7207 } 7208 v.reset(OpPPC64SRWconst) 7209 v.AuxInt = int64ToAuxInt(c) 7210 v.AddArg(x) 7211 return true 7212 } 7213 // match: (MOVBreg (SRWconst [c] x)) 7214 // cond: c==24 7215 // result: (SRAWconst [c] x) 7216 for { 7217 if v_0.Op != OpPPC64SRWconst { 7218 break 7219 } 7220 c := auxIntToInt64(v_0.AuxInt) 7221 x := v_0.Args[0] 7222 if !(c == 24) { 7223 break 7224 } 7225 v.reset(OpPPC64SRAWconst) 7226 v.AuxInt = int64ToAuxInt(c) 7227 v.AddArg(x) 7228 return true 7229 } 7230 // match: (MOVBreg (SRAWconst [c] x)) 7231 // cond: c>=24 7232 // result: (SRAWconst [c] x) 7233 for { 7234 if v_0.Op != OpPPC64SRAWconst { 7235 break 7236 } 7237 c := auxIntToInt64(v_0.AuxInt) 7238 x := v_0.Args[0] 7239 if !(c >= 24) { 7240 break 7241 } 7242 v.reset(OpPPC64SRAWconst) 7243 v.AuxInt = int64ToAuxInt(c) 7244 v.AddArg(x) 7245 return true 7246 } 7247 // match: (MOVBreg y:(MOVBreg _)) 7248 // result: y 7249 for { 7250 y := v_0 7251 if y.Op != OpPPC64MOVBreg { 7252 break 7253 } 7254 v.copyOf(y) 7255 return true 7256 } 7257 // match: (MOVBreg (MOVBZreg x)) 7258 // result: (MOVBreg x) 7259 for { 7260 if v_0.Op != OpPPC64MOVBZreg { 7261 break 7262 } 7263 x := v_0.Args[0] 7264 v.reset(OpPPC64MOVBreg) 7265 v.AddArg(x) 7266 return true 7267 } 7268 // match: (MOVBreg x:(Arg <t>)) 7269 // cond: is8BitInt(t) && isSigned(t) 7270 // result: x 7271 for { 7272 x := v_0 7273 if x.Op != OpArg { 7274 break 7275 } 7276 t := x.Type 7277 if !(is8BitInt(t) && isSigned(t)) { 7278 break 7279 } 7280 v.copyOf(x) 7281 return true 7282 } 7283 // match: (MOVBreg (MOVDconst [c])) 7284 // result: (MOVDconst [int64(int8(c))]) 7285 for { 7286 if v_0.Op != OpPPC64MOVDconst { 7287 break 7288 } 7289 c := auxIntToInt64(v_0.AuxInt) 7290 v.reset(OpPPC64MOVDconst) 7291 v.AuxInt = int64ToAuxInt(int64(int8(c))) 7292 return true 7293 } 7294 return false 7295 } 7296 func rewriteValuePPC64_OpPPC64MOVBstore(v *Value) bool { 7297 v_2 := v.Args[2] 7298 v_1 := v.Args[1] 7299 v_0 := v.Args[0] 7300 b := v.Block 7301 config := b.Func.Config 7302 typ := &b.Func.Config.Types 7303 // match: (MOVBstore [off1] {sym} (ADDconst [off2] x) val mem) 7304 // cond: is16Bit(int64(off1)+off2) 7305 // result: (MOVBstore [off1+int32(off2)] {sym} x val mem) 7306 for { 7307 off1 := auxIntToInt32(v.AuxInt) 7308 sym := auxToSym(v.Aux) 7309 if v_0.Op != OpPPC64ADDconst { 7310 break 7311 } 7312 off2 := auxIntToInt64(v_0.AuxInt) 7313 x := v_0.Args[0] 7314 val := v_1 7315 mem := v_2 7316 if !(is16Bit(int64(off1) + off2)) { 7317 break 7318 } 7319 v.reset(OpPPC64MOVBstore) 7320 v.AuxInt = int32ToAuxInt(off1 + int32(off2)) 7321 v.Aux = symToAux(sym) 7322 v.AddArg3(x, val, mem) 7323 return true 7324 } 7325 // match: (MOVBstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem) 7326 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1) 7327 // result: (MOVBstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem) 7328 for { 7329 off1 := auxIntToInt32(v.AuxInt) 7330 sym1 := auxToSym(v.Aux) 7331 p := v_0 7332 if p.Op != OpPPC64MOVDaddr { 7333 break 7334 } 7335 off2 := auxIntToInt32(p.AuxInt) 7336 sym2 := auxToSym(p.Aux) 7337 ptr := p.Args[0] 7338 val := v_1 7339 mem := v_2 7340 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) { 7341 break 7342 } 7343 v.reset(OpPPC64MOVBstore) 7344 v.AuxInt = int32ToAuxInt(off1 + off2) 7345 v.Aux = symToAux(mergeSym(sym1, sym2)) 7346 v.AddArg3(ptr, val, mem) 7347 return true 7348 } 7349 // match: (MOVBstore [off] {sym} ptr (MOVDconst [0]) mem) 7350 // result: (MOVBstorezero [off] {sym} ptr mem) 7351 for { 7352 off := auxIntToInt32(v.AuxInt) 7353 sym := auxToSym(v.Aux) 7354 ptr := v_0 7355 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 { 7356 break 7357 } 7358 mem := v_2 7359 v.reset(OpPPC64MOVBstorezero) 7360 v.AuxInt = int32ToAuxInt(off) 7361 v.Aux = symToAux(sym) 7362 v.AddArg2(ptr, mem) 7363 return true 7364 } 7365 // match: (MOVBstore [0] {sym} p:(ADD ptr idx) val mem) 7366 // cond: sym == nil && p.Uses == 1 7367 // result: (MOVBstoreidx ptr idx val mem) 7368 for { 7369 if auxIntToInt32(v.AuxInt) != 0 { 7370 break 7371 } 7372 sym := auxToSym(v.Aux) 7373 p := v_0 7374 if p.Op != OpPPC64ADD { 7375 break 7376 } 7377 idx := p.Args[1] 7378 ptr := p.Args[0] 7379 val := v_1 7380 mem := v_2 7381 if !(sym == nil && p.Uses == 1) { 7382 break 7383 } 7384 v.reset(OpPPC64MOVBstoreidx) 7385 v.AddArg4(ptr, idx, val, mem) 7386 return true 7387 } 7388 // match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem) 7389 // result: (MOVBstore [off] {sym} ptr x mem) 7390 for { 7391 off := auxIntToInt32(v.AuxInt) 7392 sym := auxToSym(v.Aux) 7393 ptr := v_0 7394 if v_1.Op != OpPPC64MOVBreg { 7395 break 7396 } 7397 x := v_1.Args[0] 7398 mem := v_2 7399 v.reset(OpPPC64MOVBstore) 7400 v.AuxInt = int32ToAuxInt(off) 7401 v.Aux = symToAux(sym) 7402 v.AddArg3(ptr, x, mem) 7403 return true 7404 } 7405 // match: (MOVBstore [off] {sym} ptr (MOVBZreg x) mem) 7406 // result: (MOVBstore [off] {sym} ptr x mem) 7407 for { 7408 off := auxIntToInt32(v.AuxInt) 7409 sym := auxToSym(v.Aux) 7410 ptr := v_0 7411 if v_1.Op != OpPPC64MOVBZreg { 7412 break 7413 } 7414 x := v_1.Args[0] 7415 mem := v_2 7416 v.reset(OpPPC64MOVBstore) 7417 v.AuxInt = int32ToAuxInt(off) 7418 v.Aux = symToAux(sym) 7419 v.AddArg3(ptr, x, mem) 7420 return true 7421 } 7422 // match: (MOVBstore [off] {sym} ptr (MOVHreg x) mem) 7423 // result: (MOVBstore [off] {sym} ptr x mem) 7424 for { 7425 off := auxIntToInt32(v.AuxInt) 7426 sym := auxToSym(v.Aux) 7427 ptr := v_0 7428 if v_1.Op != OpPPC64MOVHreg { 7429 break 7430 } 7431 x := v_1.Args[0] 7432 mem := v_2 7433 v.reset(OpPPC64MOVBstore) 7434 v.AuxInt = int32ToAuxInt(off) 7435 v.Aux = symToAux(sym) 7436 v.AddArg3(ptr, x, mem) 7437 return true 7438 } 7439 // match: (MOVBstore [off] {sym} ptr (MOVHZreg x) mem) 7440 // result: (MOVBstore [off] {sym} ptr x mem) 7441 for { 7442 off := auxIntToInt32(v.AuxInt) 7443 sym := auxToSym(v.Aux) 7444 ptr := v_0 7445 if v_1.Op != OpPPC64MOVHZreg { 7446 break 7447 } 7448 x := v_1.Args[0] 7449 mem := v_2 7450 v.reset(OpPPC64MOVBstore) 7451 v.AuxInt = int32ToAuxInt(off) 7452 v.Aux = symToAux(sym) 7453 v.AddArg3(ptr, x, mem) 7454 return true 7455 } 7456 // match: (MOVBstore [off] {sym} ptr (MOVWreg x) mem) 7457 // result: (MOVBstore [off] {sym} ptr x mem) 7458 for { 7459 off := auxIntToInt32(v.AuxInt) 7460 sym := auxToSym(v.Aux) 7461 ptr := v_0 7462 if v_1.Op != OpPPC64MOVWreg { 7463 break 7464 } 7465 x := v_1.Args[0] 7466 mem := v_2 7467 v.reset(OpPPC64MOVBstore) 7468 v.AuxInt = int32ToAuxInt(off) 7469 v.Aux = symToAux(sym) 7470 v.AddArg3(ptr, x, mem) 7471 return true 7472 } 7473 // match: (MOVBstore [off] {sym} ptr (MOVWZreg x) mem) 7474 // result: (MOVBstore [off] {sym} ptr x mem) 7475 for { 7476 off := auxIntToInt32(v.AuxInt) 7477 sym := auxToSym(v.Aux) 7478 ptr := v_0 7479 if v_1.Op != OpPPC64MOVWZreg { 7480 break 7481 } 7482 x := v_1.Args[0] 7483 mem := v_2 7484 v.reset(OpPPC64MOVBstore) 7485 v.AuxInt = int32ToAuxInt(off) 7486 v.Aux = symToAux(sym) 7487 v.AddArg3(ptr, x, mem) 7488 return true 7489 } 7490 // match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHreg x) [c]) mem) 7491 // cond: c <= 8 7492 // result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem) 7493 for { 7494 off := auxIntToInt32(v.AuxInt) 7495 sym := auxToSym(v.Aux) 7496 ptr := v_0 7497 if v_1.Op != OpPPC64SRWconst { 7498 break 7499 } 7500 c := auxIntToInt64(v_1.AuxInt) 7501 v_1_0 := v_1.Args[0] 7502 if v_1_0.Op != OpPPC64MOVHreg { 7503 break 7504 } 7505 x := v_1_0.Args[0] 7506 mem := v_2 7507 if !(c <= 8) { 7508 break 7509 } 7510 v.reset(OpPPC64MOVBstore) 7511 v.AuxInt = int32ToAuxInt(off) 7512 v.Aux = symToAux(sym) 7513 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32) 7514 v0.AuxInt = int64ToAuxInt(c) 7515 v0.AddArg(x) 7516 v.AddArg3(ptr, v0, mem) 7517 return true 7518 } 7519 // match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHZreg x) [c]) mem) 7520 // cond: c <= 8 7521 // result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem) 7522 for { 7523 off := auxIntToInt32(v.AuxInt) 7524 sym := auxToSym(v.Aux) 7525 ptr := v_0 7526 if v_1.Op != OpPPC64SRWconst { 7527 break 7528 } 7529 c := auxIntToInt64(v_1.AuxInt) 7530 v_1_0 := v_1.Args[0] 7531 if v_1_0.Op != OpPPC64MOVHZreg { 7532 break 7533 } 7534 x := v_1_0.Args[0] 7535 mem := v_2 7536 if !(c <= 8) { 7537 break 7538 } 7539 v.reset(OpPPC64MOVBstore) 7540 v.AuxInt = int32ToAuxInt(off) 7541 v.Aux = symToAux(sym) 7542 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32) 7543 v0.AuxInt = int64ToAuxInt(c) 7544 v0.AddArg(x) 7545 v.AddArg3(ptr, v0, mem) 7546 return true 7547 } 7548 // match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWreg x) [c]) mem) 7549 // cond: c <= 24 7550 // result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem) 7551 for { 7552 off := auxIntToInt32(v.AuxInt) 7553 sym := auxToSym(v.Aux) 7554 ptr := v_0 7555 if v_1.Op != OpPPC64SRWconst { 7556 break 7557 } 7558 c := auxIntToInt64(v_1.AuxInt) 7559 v_1_0 := v_1.Args[0] 7560 if v_1_0.Op != OpPPC64MOVWreg { 7561 break 7562 } 7563 x := v_1_0.Args[0] 7564 mem := v_2 7565 if !(c <= 24) { 7566 break 7567 } 7568 v.reset(OpPPC64MOVBstore) 7569 v.AuxInt = int32ToAuxInt(off) 7570 v.Aux = symToAux(sym) 7571 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32) 7572 v0.AuxInt = int64ToAuxInt(c) 7573 v0.AddArg(x) 7574 v.AddArg3(ptr, v0, mem) 7575 return true 7576 } 7577 // match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWZreg x) [c]) mem) 7578 // cond: c <= 24 7579 // result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem) 7580 for { 7581 off := auxIntToInt32(v.AuxInt) 7582 sym := auxToSym(v.Aux) 7583 ptr := v_0 7584 if v_1.Op != OpPPC64SRWconst { 7585 break 7586 } 7587 c := auxIntToInt64(v_1.AuxInt) 7588 v_1_0 := v_1.Args[0] 7589 if v_1_0.Op != OpPPC64MOVWZreg { 7590 break 7591 } 7592 x := v_1_0.Args[0] 7593 mem := v_2 7594 if !(c <= 24) { 7595 break 7596 } 7597 v.reset(OpPPC64MOVBstore) 7598 v.AuxInt = int32ToAuxInt(off) 7599 v.Aux = symToAux(sym) 7600 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32) 7601 v0.AuxInt = int64ToAuxInt(c) 7602 v0.AddArg(x) 7603 v.AddArg3(ptr, v0, mem) 7604 return true 7605 } 7606 // match: (MOVBstore [i1] {s} p (SRWconst w [24]) x0:(MOVBstore [i0] {s} p (SRWconst w [16]) mem)) 7607 // cond: !config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0) 7608 // result: (MOVHstore [i0] {s} p (SRWconst <typ.UInt16> w [16]) mem) 7609 for { 7610 i1 := auxIntToInt32(v.AuxInt) 7611 s := auxToSym(v.Aux) 7612 p := v_0 7613 if v_1.Op != OpPPC64SRWconst || auxIntToInt64(v_1.AuxInt) != 24 { 7614 break 7615 } 7616 w := v_1.Args[0] 7617 x0 := v_2 7618 if x0.Op != OpPPC64MOVBstore { 7619 break 7620 } 7621 i0 := auxIntToInt32(x0.AuxInt) 7622 if auxToSym(x0.Aux) != s { 7623 break 7624 } 7625 mem := x0.Args[2] 7626 if p != x0.Args[0] { 7627 break 7628 } 7629 x0_1 := x0.Args[1] 7630 if x0_1.Op != OpPPC64SRWconst || auxIntToInt64(x0_1.AuxInt) != 16 || w != x0_1.Args[0] || !(!config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)) { 7631 break 7632 } 7633 v.reset(OpPPC64MOVHstore) 7634 v.AuxInt = int32ToAuxInt(i0) 7635 v.Aux = symToAux(s) 7636 v0 := b.NewValue0(x0.Pos, OpPPC64SRWconst, typ.UInt16) 7637 v0.AuxInt = int64ToAuxInt(16) 7638 v0.AddArg(w) 7639 v.AddArg3(p, v0, mem) 7640 return true 7641 } 7642 // match: (MOVBstore [i1] {s} p (SRDconst w [24]) x0:(MOVBstore [i0] {s} p (SRDconst w [16]) mem)) 7643 // cond: !config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0) 7644 // result: (MOVHstore [i0] {s} p (SRWconst <typ.UInt16> w [16]) mem) 7645 for { 7646 i1 := auxIntToInt32(v.AuxInt) 7647 s := auxToSym(v.Aux) 7648 p := v_0 7649 if v_1.Op != OpPPC64SRDconst || auxIntToInt64(v_1.AuxInt) != 24 { 7650 break 7651 } 7652 w := v_1.Args[0] 7653 x0 := v_2 7654 if x0.Op != OpPPC64MOVBstore { 7655 break 7656 } 7657 i0 := auxIntToInt32(x0.AuxInt) 7658 if auxToSym(x0.Aux) != s { 7659 break 7660 } 7661 mem := x0.Args[2] 7662 if p != x0.Args[0] { 7663 break 7664 } 7665 x0_1 := x0.Args[1] 7666 if x0_1.Op != OpPPC64SRDconst || auxIntToInt64(x0_1.AuxInt) != 16 || w != x0_1.Args[0] || !(!config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)) { 7667 break 7668 } 7669 v.reset(OpPPC64MOVHstore) 7670 v.AuxInt = int32ToAuxInt(i0) 7671 v.Aux = symToAux(s) 7672 v0 := b.NewValue0(x0.Pos, OpPPC64SRWconst, typ.UInt16) 7673 v0.AuxInt = int64ToAuxInt(16) 7674 v0.AddArg(w) 7675 v.AddArg3(p, v0, mem) 7676 return true 7677 } 7678 // match: (MOVBstore [i1] {s} p (SRWconst w [8]) x0:(MOVBstore [i0] {s} p w mem)) 7679 // cond: !config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0) 7680 // result: (MOVHstore [i0] {s} p w mem) 7681 for { 7682 i1 := auxIntToInt32(v.AuxInt) 7683 s := auxToSym(v.Aux) 7684 p := v_0 7685 if v_1.Op != OpPPC64SRWconst || auxIntToInt64(v_1.AuxInt) != 8 { 7686 break 7687 } 7688 w := v_1.Args[0] 7689 x0 := v_2 7690 if x0.Op != OpPPC64MOVBstore { 7691 break 7692 } 7693 i0 := auxIntToInt32(x0.AuxInt) 7694 if auxToSym(x0.Aux) != s { 7695 break 7696 } 7697 mem := x0.Args[2] 7698 if p != x0.Args[0] || w != x0.Args[1] || !(!config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)) { 7699 break 7700 } 7701 v.reset(OpPPC64MOVHstore) 7702 v.AuxInt = int32ToAuxInt(i0) 7703 v.Aux = symToAux(s) 7704 v.AddArg3(p, w, mem) 7705 return true 7706 } 7707 // match: (MOVBstore [i1] {s} p (SRDconst w [8]) x0:(MOVBstore [i0] {s} p w mem)) 7708 // cond: !config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0) 7709 // result: (MOVHstore [i0] {s} p w mem) 7710 for { 7711 i1 := auxIntToInt32(v.AuxInt) 7712 s := auxToSym(v.Aux) 7713 p := v_0 7714 if v_1.Op != OpPPC64SRDconst || auxIntToInt64(v_1.AuxInt) != 8 { 7715 break 7716 } 7717 w := v_1.Args[0] 7718 x0 := v_2 7719 if x0.Op != OpPPC64MOVBstore { 7720 break 7721 } 7722 i0 := auxIntToInt32(x0.AuxInt) 7723 if auxToSym(x0.Aux) != s { 7724 break 7725 } 7726 mem := x0.Args[2] 7727 if p != x0.Args[0] || w != x0.Args[1] || !(!config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)) { 7728 break 7729 } 7730 v.reset(OpPPC64MOVHstore) 7731 v.AuxInt = int32ToAuxInt(i0) 7732 v.Aux = symToAux(s) 7733 v.AddArg3(p, w, mem) 7734 return true 7735 } 7736 // match: (MOVBstore [i3] {s} p w x0:(MOVBstore [i2] {s} p (SRWconst w [8]) x1:(MOVBstore [i1] {s} p (SRWconst w [16]) x2:(MOVBstore [i0] {s} p (SRWconst w [24]) mem)))) 7737 // cond: !config.BigEndian && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && i1 == i0+1 && i2 == i0+2 && i3 == i0+3 && clobber(x0, x1, x2) 7738 // result: (MOVWBRstore (MOVDaddr <typ.Uintptr> [i0] {s} p) w mem) 7739 for { 7740 i3 := auxIntToInt32(v.AuxInt) 7741 s := auxToSym(v.Aux) 7742 p := v_0 7743 w := v_1 7744 x0 := v_2 7745 if x0.Op != OpPPC64MOVBstore { 7746 break 7747 } 7748 i2 := auxIntToInt32(x0.AuxInt) 7749 if auxToSym(x0.Aux) != s { 7750 break 7751 } 7752 _ = x0.Args[2] 7753 if p != x0.Args[0] { 7754 break 7755 } 7756 x0_1 := x0.Args[1] 7757 if x0_1.Op != OpPPC64SRWconst || auxIntToInt64(x0_1.AuxInt) != 8 || w != x0_1.Args[0] { 7758 break 7759 } 7760 x1 := x0.Args[2] 7761 if x1.Op != OpPPC64MOVBstore { 7762 break 7763 } 7764 i1 := auxIntToInt32(x1.AuxInt) 7765 if auxToSym(x1.Aux) != s { 7766 break 7767 } 7768 _ = x1.Args[2] 7769 if p != x1.Args[0] { 7770 break 7771 } 7772 x1_1 := x1.Args[1] 7773 if x1_1.Op != OpPPC64SRWconst || auxIntToInt64(x1_1.AuxInt) != 16 || w != x1_1.Args[0] { 7774 break 7775 } 7776 x2 := x1.Args[2] 7777 if x2.Op != OpPPC64MOVBstore { 7778 break 7779 } 7780 i0 := auxIntToInt32(x2.AuxInt) 7781 if auxToSym(x2.Aux) != s { 7782 break 7783 } 7784 mem := x2.Args[2] 7785 if p != x2.Args[0] { 7786 break 7787 } 7788 x2_1 := x2.Args[1] 7789 if x2_1.Op != OpPPC64SRWconst || auxIntToInt64(x2_1.AuxInt) != 24 || w != x2_1.Args[0] || !(!config.BigEndian && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && i1 == i0+1 && i2 == i0+2 && i3 == i0+3 && clobber(x0, x1, x2)) { 7790 break 7791 } 7792 v.reset(OpPPC64MOVWBRstore) 7793 v0 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr) 7794 v0.AuxInt = int32ToAuxInt(i0) 7795 v0.Aux = symToAux(s) 7796 v0.AddArg(p) 7797 v.AddArg3(v0, w, mem) 7798 return true 7799 } 7800 // match: (MOVBstore [i1] {s} p w x0:(MOVBstore [i0] {s} p (SRWconst w [8]) mem)) 7801 // cond: !config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0) 7802 // result: (MOVHBRstore (MOVDaddr <typ.Uintptr> [i0] {s} p) w mem) 7803 for { 7804 i1 := auxIntToInt32(v.AuxInt) 7805 s := auxToSym(v.Aux) 7806 p := v_0 7807 w := v_1 7808 x0 := v_2 7809 if x0.Op != OpPPC64MOVBstore { 7810 break 7811 } 7812 i0 := auxIntToInt32(x0.AuxInt) 7813 if auxToSym(x0.Aux) != s { 7814 break 7815 } 7816 mem := x0.Args[2] 7817 if p != x0.Args[0] { 7818 break 7819 } 7820 x0_1 := x0.Args[1] 7821 if x0_1.Op != OpPPC64SRWconst || auxIntToInt64(x0_1.AuxInt) != 8 || w != x0_1.Args[0] || !(!config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)) { 7822 break 7823 } 7824 v.reset(OpPPC64MOVHBRstore) 7825 v0 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) 7826 v0.AuxInt = int32ToAuxInt(i0) 7827 v0.Aux = symToAux(s) 7828 v0.AddArg(p) 7829 v.AddArg3(v0, w, mem) 7830 return true 7831 } 7832 // match: (MOVBstore [i7] {s} p (SRDconst w [56]) x0:(MOVBstore [i6] {s} p (SRDconst w [48]) x1:(MOVBstore [i5] {s} p (SRDconst w [40]) x2:(MOVBstore [i4] {s} p (SRDconst w [32]) x3:(MOVWstore [i0] {s} p w mem))))) 7833 // cond: !config.BigEndian && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && x3.Uses == 1 && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && clobber(x0, x1, x2, x3) 7834 // result: (MOVDstore [i0] {s} p w mem) 7835 for { 7836 i7 := auxIntToInt32(v.AuxInt) 7837 s := auxToSym(v.Aux) 7838 p := v_0 7839 if v_1.Op != OpPPC64SRDconst || auxIntToInt64(v_1.AuxInt) != 56 { 7840 break 7841 } 7842 w := v_1.Args[0] 7843 x0 := v_2 7844 if x0.Op != OpPPC64MOVBstore { 7845 break 7846 } 7847 i6 := auxIntToInt32(x0.AuxInt) 7848 if auxToSym(x0.Aux) != s { 7849 break 7850 } 7851 _ = x0.Args[2] 7852 if p != x0.Args[0] { 7853 break 7854 } 7855 x0_1 := x0.Args[1] 7856 if x0_1.Op != OpPPC64SRDconst || auxIntToInt64(x0_1.AuxInt) != 48 || w != x0_1.Args[0] { 7857 break 7858 } 7859 x1 := x0.Args[2] 7860 if x1.Op != OpPPC64MOVBstore { 7861 break 7862 } 7863 i5 := auxIntToInt32(x1.AuxInt) 7864 if auxToSym(x1.Aux) != s { 7865 break 7866 } 7867 _ = x1.Args[2] 7868 if p != x1.Args[0] { 7869 break 7870 } 7871 x1_1 := x1.Args[1] 7872 if x1_1.Op != OpPPC64SRDconst || auxIntToInt64(x1_1.AuxInt) != 40 || w != x1_1.Args[0] { 7873 break 7874 } 7875 x2 := x1.Args[2] 7876 if x2.Op != OpPPC64MOVBstore { 7877 break 7878 } 7879 i4 := auxIntToInt32(x2.AuxInt) 7880 if auxToSym(x2.Aux) != s { 7881 break 7882 } 7883 _ = x2.Args[2] 7884 if p != x2.Args[0] { 7885 break 7886 } 7887 x2_1 := x2.Args[1] 7888 if x2_1.Op != OpPPC64SRDconst || auxIntToInt64(x2_1.AuxInt) != 32 || w != x2_1.Args[0] { 7889 break 7890 } 7891 x3 := x2.Args[2] 7892 if x3.Op != OpPPC64MOVWstore { 7893 break 7894 } 7895 i0 := auxIntToInt32(x3.AuxInt) 7896 if auxToSym(x3.Aux) != s { 7897 break 7898 } 7899 mem := x3.Args[2] 7900 if p != x3.Args[0] || w != x3.Args[1] || !(!config.BigEndian && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && x3.Uses == 1 && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && clobber(x0, x1, x2, x3)) { 7901 break 7902 } 7903 v.reset(OpPPC64MOVDstore) 7904 v.AuxInt = int32ToAuxInt(i0) 7905 v.Aux = symToAux(s) 7906 v.AddArg3(p, w, mem) 7907 return true 7908 } 7909 // match: (MOVBstore [i7] {s} p w x0:(MOVBstore [i6] {s} p (SRDconst w [8]) x1:(MOVBstore [i5] {s} p (SRDconst w [16]) x2:(MOVBstore [i4] {s} p (SRDconst w [24]) x3:(MOVBstore [i3] {s} p (SRDconst w [32]) x4:(MOVBstore [i2] {s} p (SRDconst w [40]) x5:(MOVBstore [i1] {s} p (SRDconst w [48]) x6:(MOVBstore [i0] {s} p (SRDconst w [56]) mem)))))))) 7910 // cond: !config.BigEndian && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && x3.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses == 1 && i1 == i0+1 && i2 == i0+2 && i3 == i0+3 && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && clobber(x0, x1, x2, x3, x4, x5, x6) 7911 // result: (MOVDBRstore (MOVDaddr <typ.Uintptr> [i0] {s} p) w mem) 7912 for { 7913 i7 := auxIntToInt32(v.AuxInt) 7914 s := auxToSym(v.Aux) 7915 p := v_0 7916 w := v_1 7917 x0 := v_2 7918 if x0.Op != OpPPC64MOVBstore { 7919 break 7920 } 7921 i6 := auxIntToInt32(x0.AuxInt) 7922 if auxToSym(x0.Aux) != s { 7923 break 7924 } 7925 _ = x0.Args[2] 7926 if p != x0.Args[0] { 7927 break 7928 } 7929 x0_1 := x0.Args[1] 7930 if x0_1.Op != OpPPC64SRDconst || auxIntToInt64(x0_1.AuxInt) != 8 || w != x0_1.Args[0] { 7931 break 7932 } 7933 x1 := x0.Args[2] 7934 if x1.Op != OpPPC64MOVBstore { 7935 break 7936 } 7937 i5 := auxIntToInt32(x1.AuxInt) 7938 if auxToSym(x1.Aux) != s { 7939 break 7940 } 7941 _ = x1.Args[2] 7942 if p != x1.Args[0] { 7943 break 7944 } 7945 x1_1 := x1.Args[1] 7946 if x1_1.Op != OpPPC64SRDconst || auxIntToInt64(x1_1.AuxInt) != 16 || w != x1_1.Args[0] { 7947 break 7948 } 7949 x2 := x1.Args[2] 7950 if x2.Op != OpPPC64MOVBstore { 7951 break 7952 } 7953 i4 := auxIntToInt32(x2.AuxInt) 7954 if auxToSym(x2.Aux) != s { 7955 break 7956 } 7957 _ = x2.Args[2] 7958 if p != x2.Args[0] { 7959 break 7960 } 7961 x2_1 := x2.Args[1] 7962 if x2_1.Op != OpPPC64SRDconst || auxIntToInt64(x2_1.AuxInt) != 24 || w != x2_1.Args[0] { 7963 break 7964 } 7965 x3 := x2.Args[2] 7966 if x3.Op != OpPPC64MOVBstore { 7967 break 7968 } 7969 i3 := auxIntToInt32(x3.AuxInt) 7970 if auxToSym(x3.Aux) != s { 7971 break 7972 } 7973 _ = x3.Args[2] 7974 if p != x3.Args[0] { 7975 break 7976 } 7977 x3_1 := x3.Args[1] 7978 if x3_1.Op != OpPPC64SRDconst || auxIntToInt64(x3_1.AuxInt) != 32 || w != x3_1.Args[0] { 7979 break 7980 } 7981 x4 := x3.Args[2] 7982 if x4.Op != OpPPC64MOVBstore { 7983 break 7984 } 7985 i2 := auxIntToInt32(x4.AuxInt) 7986 if auxToSym(x4.Aux) != s { 7987 break 7988 } 7989 _ = x4.Args[2] 7990 if p != x4.Args[0] { 7991 break 7992 } 7993 x4_1 := x4.Args[1] 7994 if x4_1.Op != OpPPC64SRDconst || auxIntToInt64(x4_1.AuxInt) != 40 || w != x4_1.Args[0] { 7995 break 7996 } 7997 x5 := x4.Args[2] 7998 if x5.Op != OpPPC64MOVBstore { 7999 break 8000 } 8001 i1 := auxIntToInt32(x5.AuxInt) 8002 if auxToSym(x5.Aux) != s { 8003 break 8004 } 8005 _ = x5.Args[2] 8006 if p != x5.Args[0] { 8007 break 8008 } 8009 x5_1 := x5.Args[1] 8010 if x5_1.Op != OpPPC64SRDconst || auxIntToInt64(x5_1.AuxInt) != 48 || w != x5_1.Args[0] { 8011 break 8012 } 8013 x6 := x5.Args[2] 8014 if x6.Op != OpPPC64MOVBstore { 8015 break 8016 } 8017 i0 := auxIntToInt32(x6.AuxInt) 8018 if auxToSym(x6.Aux) != s { 8019 break 8020 } 8021 mem := x6.Args[2] 8022 if p != x6.Args[0] { 8023 break 8024 } 8025 x6_1 := x6.Args[1] 8026 if x6_1.Op != OpPPC64SRDconst || auxIntToInt64(x6_1.AuxInt) != 56 || w != x6_1.Args[0] || !(!config.BigEndian && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && x3.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses == 1 && i1 == i0+1 && i2 == i0+2 && i3 == i0+3 && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && clobber(x0, x1, x2, x3, x4, x5, x6)) { 8027 break 8028 } 8029 v.reset(OpPPC64MOVDBRstore) 8030 v0 := b.NewValue0(x6.Pos, OpPPC64MOVDaddr, typ.Uintptr) 8031 v0.AuxInt = int32ToAuxInt(i0) 8032 v0.Aux = symToAux(s) 8033 v0.AddArg(p) 8034 v.AddArg3(v0, w, mem) 8035 return true 8036 } 8037 return false 8038 } 8039 func rewriteValuePPC64_OpPPC64MOVBstoreidx(v *Value) bool { 8040 v_3 := v.Args[3] 8041 v_2 := v.Args[2] 8042 v_1 := v.Args[1] 8043 v_0 := v.Args[0] 8044 b := v.Block 8045 typ := &b.Func.Config.Types 8046 // match: (MOVBstoreidx ptr (MOVDconst [c]) val mem) 8047 // cond: is16Bit(c) 8048 // result: (MOVBstore [int32(c)] ptr val mem) 8049 for { 8050 ptr := v_0 8051 if v_1.Op != OpPPC64MOVDconst { 8052 break 8053 } 8054 c := auxIntToInt64(v_1.AuxInt) 8055 val := v_2 8056 mem := v_3 8057 if !(is16Bit(c)) { 8058 break 8059 } 8060 v.reset(OpPPC64MOVBstore) 8061 v.AuxInt = int32ToAuxInt(int32(c)) 8062 v.AddArg3(ptr, val, mem) 8063 return true 8064 } 8065 // match: (MOVBstoreidx (MOVDconst [c]) ptr val mem) 8066 // cond: is16Bit(c) 8067 // result: (MOVBstore [int32(c)] ptr val mem) 8068 for { 8069 if v_0.Op != OpPPC64MOVDconst { 8070 break 8071 } 8072 c := auxIntToInt64(v_0.AuxInt) 8073 ptr := v_1 8074 val := v_2 8075 mem := v_3 8076 if !(is16Bit(c)) { 8077 break 8078 } 8079 v.reset(OpPPC64MOVBstore) 8080 v.AuxInt = int32ToAuxInt(int32(c)) 8081 v.AddArg3(ptr, val, mem) 8082 return true 8083 } 8084 // match: (MOVBstoreidx ptr idx (MOVBreg x) mem) 8085 // result: (MOVBstoreidx ptr idx x mem) 8086 for { 8087 ptr := v_0 8088 idx := v_1 8089 if v_2.Op != OpPPC64MOVBreg { 8090 break 8091 } 8092 x := v_2.Args[0] 8093 mem := v_3 8094 v.reset(OpPPC64MOVBstoreidx) 8095 v.AddArg4(ptr, idx, x, mem) 8096 return true 8097 } 8098 // match: (MOVBstoreidx ptr idx (MOVBZreg x) mem) 8099 // result: (MOVBstoreidx ptr idx x mem) 8100 for { 8101 ptr := v_0 8102 idx := v_1 8103 if v_2.Op != OpPPC64MOVBZreg { 8104 break 8105 } 8106 x := v_2.Args[0] 8107 mem := v_3 8108 v.reset(OpPPC64MOVBstoreidx) 8109 v.AddArg4(ptr, idx, x, mem) 8110 return true 8111 } 8112 // match: (MOVBstoreidx ptr idx (MOVHreg x) mem) 8113 // result: (MOVBstoreidx ptr idx x mem) 8114 for { 8115 ptr := v_0 8116 idx := v_1 8117 if v_2.Op != OpPPC64MOVHreg { 8118 break 8119 } 8120 x := v_2.Args[0] 8121 mem := v_3 8122 v.reset(OpPPC64MOVBstoreidx) 8123 v.AddArg4(ptr, idx, x, mem) 8124 return true 8125 } 8126 // match: (MOVBstoreidx ptr idx (MOVHZreg x) mem) 8127 // result: (MOVBstoreidx ptr idx x mem) 8128 for { 8129 ptr := v_0 8130 idx := v_1 8131 if v_2.Op != OpPPC64MOVHZreg { 8132 break 8133 } 8134 x := v_2.Args[0] 8135 mem := v_3 8136 v.reset(OpPPC64MOVBstoreidx) 8137 v.AddArg4(ptr, idx, x, mem) 8138 return true 8139 } 8140 // match: (MOVBstoreidx ptr idx (MOVWreg x) mem) 8141 // result: (MOVBstoreidx ptr idx x mem) 8142 for { 8143 ptr := v_0 8144 idx := v_1 8145 if v_2.Op != OpPPC64MOVWreg { 8146 break 8147 } 8148 x := v_2.Args[0] 8149 mem := v_3 8150 v.reset(OpPPC64MOVBstoreidx) 8151 v.AddArg4(ptr, idx, x, mem) 8152 return true 8153 } 8154 // match: (MOVBstoreidx ptr idx (MOVWZreg x) mem) 8155 // result: (MOVBstoreidx ptr idx x mem) 8156 for { 8157 ptr := v_0 8158 idx := v_1 8159 if v_2.Op != OpPPC64MOVWZreg { 8160 break 8161 } 8162 x := v_2.Args[0] 8163 mem := v_3 8164 v.reset(OpPPC64MOVBstoreidx) 8165 v.AddArg4(ptr, idx, x, mem) 8166 return true 8167 } 8168 // match: (MOVBstoreidx ptr idx (SRWconst (MOVHreg x) [c]) mem) 8169 // cond: c <= 8 8170 // result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem) 8171 for { 8172 ptr := v_0 8173 idx := v_1 8174 if v_2.Op != OpPPC64SRWconst { 8175 break 8176 } 8177 c := auxIntToInt64(v_2.AuxInt) 8178 v_2_0 := v_2.Args[0] 8179 if v_2_0.Op != OpPPC64MOVHreg { 8180 break 8181 } 8182 x := v_2_0.Args[0] 8183 mem := v_3 8184 if !(c <= 8) { 8185 break 8186 } 8187 v.reset(OpPPC64MOVBstoreidx) 8188 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32) 8189 v0.AuxInt = int64ToAuxInt(c) 8190 v0.AddArg(x) 8191 v.AddArg4(ptr, idx, v0, mem) 8192 return true 8193 } 8194 // match: (MOVBstoreidx ptr idx (SRWconst (MOVHZreg x) [c]) mem) 8195 // cond: c <= 8 8196 // result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem) 8197 for { 8198 ptr := v_0 8199 idx := v_1 8200 if v_2.Op != OpPPC64SRWconst { 8201 break 8202 } 8203 c := auxIntToInt64(v_2.AuxInt) 8204 v_2_0 := v_2.Args[0] 8205 if v_2_0.Op != OpPPC64MOVHZreg { 8206 break 8207 } 8208 x := v_2_0.Args[0] 8209 mem := v_3 8210 if !(c <= 8) { 8211 break 8212 } 8213 v.reset(OpPPC64MOVBstoreidx) 8214 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32) 8215 v0.AuxInt = int64ToAuxInt(c) 8216 v0.AddArg(x) 8217 v.AddArg4(ptr, idx, v0, mem) 8218 return true 8219 } 8220 // match: (MOVBstoreidx ptr idx (SRWconst (MOVWreg x) [c]) mem) 8221 // cond: c <= 24 8222 // result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem) 8223 for { 8224 ptr := v_0 8225 idx := v_1 8226 if v_2.Op != OpPPC64SRWconst { 8227 break 8228 } 8229 c := auxIntToInt64(v_2.AuxInt) 8230 v_2_0 := v_2.Args[0] 8231 if v_2_0.Op != OpPPC64MOVWreg { 8232 break 8233 } 8234 x := v_2_0.Args[0] 8235 mem := v_3 8236 if !(c <= 24) { 8237 break 8238 } 8239 v.reset(OpPPC64MOVBstoreidx) 8240 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32) 8241 v0.AuxInt = int64ToAuxInt(c) 8242 v0.AddArg(x) 8243 v.AddArg4(ptr, idx, v0, mem) 8244 return true 8245 } 8246 // match: (MOVBstoreidx ptr idx (SRWconst (MOVWZreg x) [c]) mem) 8247 // cond: c <= 24 8248 // result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem) 8249 for { 8250 ptr := v_0 8251 idx := v_1 8252 if v_2.Op != OpPPC64SRWconst { 8253 break 8254 } 8255 c := auxIntToInt64(v_2.AuxInt) 8256 v_2_0 := v_2.Args[0] 8257 if v_2_0.Op != OpPPC64MOVWZreg { 8258 break 8259 } 8260 x := v_2_0.Args[0] 8261 mem := v_3 8262 if !(c <= 24) { 8263 break 8264 } 8265 v.reset(OpPPC64MOVBstoreidx) 8266 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32) 8267 v0.AuxInt = int64ToAuxInt(c) 8268 v0.AddArg(x) 8269 v.AddArg4(ptr, idx, v0, mem) 8270 return true 8271 } 8272 return false 8273 } 8274 func rewriteValuePPC64_OpPPC64MOVBstorezero(v *Value) bool { 8275 v_1 := v.Args[1] 8276 v_0 := v.Args[0] 8277 // match: (MOVBstorezero [off1] {sym} (ADDconst [off2] x) mem) 8278 // cond: is16Bit(int64(off1)+off2) 8279 // result: (MOVBstorezero [off1+int32(off2)] {sym} x mem) 8280 for { 8281 off1 := auxIntToInt32(v.AuxInt) 8282 sym := auxToSym(v.Aux) 8283 if v_0.Op != OpPPC64ADDconst { 8284 break 8285 } 8286 off2 := auxIntToInt64(v_0.AuxInt) 8287 x := v_0.Args[0] 8288 mem := v_1 8289 if !(is16Bit(int64(off1) + off2)) { 8290 break 8291 } 8292 v.reset(OpPPC64MOVBstorezero) 8293 v.AuxInt = int32ToAuxInt(off1 + int32(off2)) 8294 v.Aux = symToAux(sym) 8295 v.AddArg2(x, mem) 8296 return true 8297 } 8298 // match: (MOVBstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem) 8299 // cond: canMergeSym(sym1,sym2) && (x.Op != OpSB || p.Uses == 1) 8300 // result: (MOVBstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem) 8301 for { 8302 off1 := auxIntToInt32(v.AuxInt) 8303 sym1 := auxToSym(v.Aux) 8304 p := v_0 8305 if p.Op != OpPPC64MOVDaddr { 8306 break 8307 } 8308 off2 := auxIntToInt32(p.AuxInt) 8309 sym2 := auxToSym(p.Aux) 8310 x := p.Args[0] 8311 mem := v_1 8312 if !(canMergeSym(sym1, sym2) && (x.Op != OpSB || p.Uses == 1)) { 8313 break 8314 } 8315 v.reset(OpPPC64MOVBstorezero) 8316 v.AuxInt = int32ToAuxInt(off1 + off2) 8317 v.Aux = symToAux(mergeSym(sym1, sym2)) 8318 v.AddArg2(x, mem) 8319 return true 8320 } 8321 return false 8322 } 8323 func rewriteValuePPC64_OpPPC64MOVDload(v *Value) bool { 8324 v_1 := v.Args[1] 8325 v_0 := v.Args[0] 8326 // match: (MOVDload [off] {sym} ptr (FMOVDstore [off] {sym} ptr x _)) 8327 // result: (MFVSRD x) 8328 for { 8329 off := auxIntToInt32(v.AuxInt) 8330 sym := auxToSym(v.Aux) 8331 ptr := v_0 8332 if v_1.Op != OpPPC64FMOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym { 8333 break 8334 } 8335 x := v_1.Args[1] 8336 if ptr != v_1.Args[0] { 8337 break 8338 } 8339 v.reset(OpPPC64MFVSRD) 8340 v.AddArg(x) 8341 return true 8342 } 8343 // match: (MOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem) 8344 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1) 8345 // result: (MOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem) 8346 for { 8347 off1 := auxIntToInt32(v.AuxInt) 8348 sym1 := auxToSym(v.Aux) 8349 p := v_0 8350 if p.Op != OpPPC64MOVDaddr { 8351 break 8352 } 8353 off2 := auxIntToInt32(p.AuxInt) 8354 sym2 := auxToSym(p.Aux) 8355 ptr := p.Args[0] 8356 mem := v_1 8357 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) { 8358 break 8359 } 8360 v.reset(OpPPC64MOVDload) 8361 v.AuxInt = int32ToAuxInt(off1 + off2) 8362 v.Aux = symToAux(mergeSym(sym1, sym2)) 8363 v.AddArg2(ptr, mem) 8364 return true 8365 } 8366 // match: (MOVDload [off1] {sym} (ADDconst [off2] x) mem) 8367 // cond: is16Bit(int64(off1)+off2) 8368 // result: (MOVDload [off1+int32(off2)] {sym} x mem) 8369 for { 8370 off1 := auxIntToInt32(v.AuxInt) 8371 sym := auxToSym(v.Aux) 8372 if v_0.Op != OpPPC64ADDconst { 8373 break 8374 } 8375 off2 := auxIntToInt64(v_0.AuxInt) 8376 x := v_0.Args[0] 8377 mem := v_1 8378 if !(is16Bit(int64(off1) + off2)) { 8379 break 8380 } 8381 v.reset(OpPPC64MOVDload) 8382 v.AuxInt = int32ToAuxInt(off1 + int32(off2)) 8383 v.Aux = symToAux(sym) 8384 v.AddArg2(x, mem) 8385 return true 8386 } 8387 // match: (MOVDload [0] {sym} p:(ADD ptr idx) mem) 8388 // cond: sym == nil && p.Uses == 1 8389 // result: (MOVDloadidx ptr idx mem) 8390 for { 8391 if auxIntToInt32(v.AuxInt) != 0 { 8392 break 8393 } 8394 sym := auxToSym(v.Aux) 8395 p := v_0 8396 if p.Op != OpPPC64ADD { 8397 break 8398 } 8399 idx := p.Args[1] 8400 ptr := p.Args[0] 8401 mem := v_1 8402 if !(sym == nil && p.Uses == 1) { 8403 break 8404 } 8405 v.reset(OpPPC64MOVDloadidx) 8406 v.AddArg3(ptr, idx, mem) 8407 return true 8408 } 8409 return false 8410 } 8411 func rewriteValuePPC64_OpPPC64MOVDloadidx(v *Value) bool { 8412 v_2 := v.Args[2] 8413 v_1 := v.Args[1] 8414 v_0 := v.Args[0] 8415 // match: (MOVDloadidx ptr (MOVDconst [c]) mem) 8416 // cond: is16Bit(c) && c%4 == 0 8417 // result: (MOVDload [int32(c)] ptr mem) 8418 for { 8419 ptr := v_0 8420 if v_1.Op != OpPPC64MOVDconst { 8421 break 8422 } 8423 c := auxIntToInt64(v_1.AuxInt) 8424 mem := v_2 8425 if !(is16Bit(c) && c%4 == 0) { 8426 break 8427 } 8428 v.reset(OpPPC64MOVDload) 8429 v.AuxInt = int32ToAuxInt(int32(c)) 8430 v.AddArg2(ptr, mem) 8431 return true 8432 } 8433 // match: (MOVDloadidx (MOVDconst [c]) ptr mem) 8434 // cond: is16Bit(c) && c%4 == 0 8435 // result: (MOVDload [int32(c)] ptr mem) 8436 for { 8437 if v_0.Op != OpPPC64MOVDconst { 8438 break 8439 } 8440 c := auxIntToInt64(v_0.AuxInt) 8441 ptr := v_1 8442 mem := v_2 8443 if !(is16Bit(c) && c%4 == 0) { 8444 break 8445 } 8446 v.reset(OpPPC64MOVDload) 8447 v.AuxInt = int32ToAuxInt(int32(c)) 8448 v.AddArg2(ptr, mem) 8449 return true 8450 } 8451 return false 8452 } 8453 func rewriteValuePPC64_OpPPC64MOVDstore(v *Value) bool { 8454 v_2 := v.Args[2] 8455 v_1 := v.Args[1] 8456 v_0 := v.Args[0] 8457 // match: (MOVDstore [off] {sym} ptr (MFVSRD x) mem) 8458 // result: (FMOVDstore [off] {sym} ptr x mem) 8459 for { 8460 off := auxIntToInt32(v.AuxInt) 8461 sym := auxToSym(v.Aux) 8462 ptr := v_0 8463 if v_1.Op != OpPPC64MFVSRD { 8464 break 8465 } 8466 x := v_1.Args[0] 8467 mem := v_2 8468 v.reset(OpPPC64FMOVDstore) 8469 v.AuxInt = int32ToAuxInt(off) 8470 v.Aux = symToAux(sym) 8471 v.AddArg3(ptr, x, mem) 8472 return true 8473 } 8474 // match: (MOVDstore [off1] {sym} (ADDconst [off2] x) val mem) 8475 // cond: is16Bit(int64(off1)+off2) 8476 // result: (MOVDstore [off1+int32(off2)] {sym} x val mem) 8477 for { 8478 off1 := auxIntToInt32(v.AuxInt) 8479 sym := auxToSym(v.Aux) 8480 if v_0.Op != OpPPC64ADDconst { 8481 break 8482 } 8483 off2 := auxIntToInt64(v_0.AuxInt) 8484 x := v_0.Args[0] 8485 val := v_1 8486 mem := v_2 8487 if !(is16Bit(int64(off1) + off2)) { 8488 break 8489 } 8490 v.reset(OpPPC64MOVDstore) 8491 v.AuxInt = int32ToAuxInt(off1 + int32(off2)) 8492 v.Aux = symToAux(sym) 8493 v.AddArg3(x, val, mem) 8494 return true 8495 } 8496 // match: (MOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem) 8497 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1) 8498 // result: (MOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem) 8499 for { 8500 off1 := auxIntToInt32(v.AuxInt) 8501 sym1 := auxToSym(v.Aux) 8502 p := v_0 8503 if p.Op != OpPPC64MOVDaddr { 8504 break 8505 } 8506 off2 := auxIntToInt32(p.AuxInt) 8507 sym2 := auxToSym(p.Aux) 8508 ptr := p.Args[0] 8509 val := v_1 8510 mem := v_2 8511 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) { 8512 break 8513 } 8514 v.reset(OpPPC64MOVDstore) 8515 v.AuxInt = int32ToAuxInt(off1 + off2) 8516 v.Aux = symToAux(mergeSym(sym1, sym2)) 8517 v.AddArg3(ptr, val, mem) 8518 return true 8519 } 8520 // match: (MOVDstore [off] {sym} ptr (MOVDconst [0]) mem) 8521 // result: (MOVDstorezero [off] {sym} ptr mem) 8522 for { 8523 off := auxIntToInt32(v.AuxInt) 8524 sym := auxToSym(v.Aux) 8525 ptr := v_0 8526 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 { 8527 break 8528 } 8529 mem := v_2 8530 v.reset(OpPPC64MOVDstorezero) 8531 v.AuxInt = int32ToAuxInt(off) 8532 v.Aux = symToAux(sym) 8533 v.AddArg2(ptr, mem) 8534 return true 8535 } 8536 // match: (MOVDstore [0] {sym} p:(ADD ptr idx) val mem) 8537 // cond: sym == nil && p.Uses == 1 8538 // result: (MOVDstoreidx ptr idx val mem) 8539 for { 8540 if auxIntToInt32(v.AuxInt) != 0 { 8541 break 8542 } 8543 sym := auxToSym(v.Aux) 8544 p := v_0 8545 if p.Op != OpPPC64ADD { 8546 break 8547 } 8548 idx := p.Args[1] 8549 ptr := p.Args[0] 8550 val := v_1 8551 mem := v_2 8552 if !(sym == nil && p.Uses == 1) { 8553 break 8554 } 8555 v.reset(OpPPC64MOVDstoreidx) 8556 v.AddArg4(ptr, idx, val, mem) 8557 return true 8558 } 8559 return false 8560 } 8561 func rewriteValuePPC64_OpPPC64MOVDstoreidx(v *Value) bool { 8562 v_3 := v.Args[3] 8563 v_2 := v.Args[2] 8564 v_1 := v.Args[1] 8565 v_0 := v.Args[0] 8566 // match: (MOVDstoreidx ptr (MOVDconst [c]) val mem) 8567 // cond: is16Bit(c) && c%4 == 0 8568 // result: (MOVDstore [int32(c)] ptr val mem) 8569 for { 8570 ptr := v_0 8571 if v_1.Op != OpPPC64MOVDconst { 8572 break 8573 } 8574 c := auxIntToInt64(v_1.AuxInt) 8575 val := v_2 8576 mem := v_3 8577 if !(is16Bit(c) && c%4 == 0) { 8578 break 8579 } 8580 v.reset(OpPPC64MOVDstore) 8581 v.AuxInt = int32ToAuxInt(int32(c)) 8582 v.AddArg3(ptr, val, mem) 8583 return true 8584 } 8585 // match: (MOVDstoreidx (MOVDconst [c]) ptr val mem) 8586 // cond: is16Bit(c) && c%4 == 0 8587 // result: (MOVDstore [int32(c)] ptr val mem) 8588 for { 8589 if v_0.Op != OpPPC64MOVDconst { 8590 break 8591 } 8592 c := auxIntToInt64(v_0.AuxInt) 8593 ptr := v_1 8594 val := v_2 8595 mem := v_3 8596 if !(is16Bit(c) && c%4 == 0) { 8597 break 8598 } 8599 v.reset(OpPPC64MOVDstore) 8600 v.AuxInt = int32ToAuxInt(int32(c)) 8601 v.AddArg3(ptr, val, mem) 8602 return true 8603 } 8604 return false 8605 } 8606 func rewriteValuePPC64_OpPPC64MOVDstorezero(v *Value) bool { 8607 v_1 := v.Args[1] 8608 v_0 := v.Args[0] 8609 // match: (MOVDstorezero [off1] {sym} (ADDconst [off2] x) mem) 8610 // cond: is16Bit(int64(off1)+off2) 8611 // result: (MOVDstorezero [off1+int32(off2)] {sym} x mem) 8612 for { 8613 off1 := auxIntToInt32(v.AuxInt) 8614 sym := auxToSym(v.Aux) 8615 if v_0.Op != OpPPC64ADDconst { 8616 break 8617 } 8618 off2 := auxIntToInt64(v_0.AuxInt) 8619 x := v_0.Args[0] 8620 mem := v_1 8621 if !(is16Bit(int64(off1) + off2)) { 8622 break 8623 } 8624 v.reset(OpPPC64MOVDstorezero) 8625 v.AuxInt = int32ToAuxInt(off1 + int32(off2)) 8626 v.Aux = symToAux(sym) 8627 v.AddArg2(x, mem) 8628 return true 8629 } 8630 // match: (MOVDstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem) 8631 // cond: canMergeSym(sym1,sym2) && (x.Op != OpSB || p.Uses == 1) 8632 // result: (MOVDstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem) 8633 for { 8634 off1 := auxIntToInt32(v.AuxInt) 8635 sym1 := auxToSym(v.Aux) 8636 p := v_0 8637 if p.Op != OpPPC64MOVDaddr { 8638 break 8639 } 8640 off2 := auxIntToInt32(p.AuxInt) 8641 sym2 := auxToSym(p.Aux) 8642 x := p.Args[0] 8643 mem := v_1 8644 if !(canMergeSym(sym1, sym2) && (x.Op != OpSB || p.Uses == 1)) { 8645 break 8646 } 8647 v.reset(OpPPC64MOVDstorezero) 8648 v.AuxInt = int32ToAuxInt(off1 + off2) 8649 v.Aux = symToAux(mergeSym(sym1, sym2)) 8650 v.AddArg2(x, mem) 8651 return true 8652 } 8653 return false 8654 } 8655 func rewriteValuePPC64_OpPPC64MOVHBRstore(v *Value) bool { 8656 v_2 := v.Args[2] 8657 v_1 := v.Args[1] 8658 v_0 := v.Args[0] 8659 // match: (MOVHBRstore {sym} ptr (MOVHreg x) mem) 8660 // result: (MOVHBRstore {sym} ptr x mem) 8661 for { 8662 sym := auxToSym(v.Aux) 8663 ptr := v_0 8664 if v_1.Op != OpPPC64MOVHreg { 8665 break 8666 } 8667 x := v_1.Args[0] 8668 mem := v_2 8669 v.reset(OpPPC64MOVHBRstore) 8670 v.Aux = symToAux(sym) 8671 v.AddArg3(ptr, x, mem) 8672 return true 8673 } 8674 // match: (MOVHBRstore {sym} ptr (MOVHZreg x) mem) 8675 // result: (MOVHBRstore {sym} ptr x mem) 8676 for { 8677 sym := auxToSym(v.Aux) 8678 ptr := v_0 8679 if v_1.Op != OpPPC64MOVHZreg { 8680 break 8681 } 8682 x := v_1.Args[0] 8683 mem := v_2 8684 v.reset(OpPPC64MOVHBRstore) 8685 v.Aux = symToAux(sym) 8686 v.AddArg3(ptr, x, mem) 8687 return true 8688 } 8689 // match: (MOVHBRstore {sym} ptr (MOVWreg x) mem) 8690 // result: (MOVHBRstore {sym} ptr x mem) 8691 for { 8692 sym := auxToSym(v.Aux) 8693 ptr := v_0 8694 if v_1.Op != OpPPC64MOVWreg { 8695 break 8696 } 8697 x := v_1.Args[0] 8698 mem := v_2 8699 v.reset(OpPPC64MOVHBRstore) 8700 v.Aux = symToAux(sym) 8701 v.AddArg3(ptr, x, mem) 8702 return true 8703 } 8704 // match: (MOVHBRstore {sym} ptr (MOVWZreg x) mem) 8705 // result: (MOVHBRstore {sym} ptr x mem) 8706 for { 8707 sym := auxToSym(v.Aux) 8708 ptr := v_0 8709 if v_1.Op != OpPPC64MOVWZreg { 8710 break 8711 } 8712 x := v_1.Args[0] 8713 mem := v_2 8714 v.reset(OpPPC64MOVHBRstore) 8715 v.Aux = symToAux(sym) 8716 v.AddArg3(ptr, x, mem) 8717 return true 8718 } 8719 return false 8720 } 8721 func rewriteValuePPC64_OpPPC64MOVHZload(v *Value) bool { 8722 v_1 := v.Args[1] 8723 v_0 := v.Args[0] 8724 // match: (MOVHZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem) 8725 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1) 8726 // result: (MOVHZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem) 8727 for { 8728 off1 := auxIntToInt32(v.AuxInt) 8729 sym1 := auxToSym(v.Aux) 8730 p := v_0 8731 if p.Op != OpPPC64MOVDaddr { 8732 break 8733 } 8734 off2 := auxIntToInt32(p.AuxInt) 8735 sym2 := auxToSym(p.Aux) 8736 ptr := p.Args[0] 8737 mem := v_1 8738 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) { 8739 break 8740 } 8741 v.reset(OpPPC64MOVHZload) 8742 v.AuxInt = int32ToAuxInt(off1 + off2) 8743 v.Aux = symToAux(mergeSym(sym1, sym2)) 8744 v.AddArg2(ptr, mem) 8745 return true 8746 } 8747 // match: (MOVHZload [off1] {sym} (ADDconst [off2] x) mem) 8748 // cond: is16Bit(int64(off1)+off2) 8749 // result: (MOVHZload [off1+int32(off2)] {sym} x mem) 8750 for { 8751 off1 := auxIntToInt32(v.AuxInt) 8752 sym := auxToSym(v.Aux) 8753 if v_0.Op != OpPPC64ADDconst { 8754 break 8755 } 8756 off2 := auxIntToInt64(v_0.AuxInt) 8757 x := v_0.Args[0] 8758 mem := v_1 8759 if !(is16Bit(int64(off1) + off2)) { 8760 break 8761 } 8762 v.reset(OpPPC64MOVHZload) 8763 v.AuxInt = int32ToAuxInt(off1 + int32(off2)) 8764 v.Aux = symToAux(sym) 8765 v.AddArg2(x, mem) 8766 return true 8767 } 8768 // match: (MOVHZload [0] {sym} p:(ADD ptr idx) mem) 8769 // cond: sym == nil && p.Uses == 1 8770 // result: (MOVHZloadidx ptr idx mem) 8771 for { 8772 if auxIntToInt32(v.AuxInt) != 0 { 8773 break 8774 } 8775 sym := auxToSym(v.Aux) 8776 p := v_0 8777 if p.Op != OpPPC64ADD { 8778 break 8779 } 8780 idx := p.Args[1] 8781 ptr := p.Args[0] 8782 mem := v_1 8783 if !(sym == nil && p.Uses == 1) { 8784 break 8785 } 8786 v.reset(OpPPC64MOVHZloadidx) 8787 v.AddArg3(ptr, idx, mem) 8788 return true 8789 } 8790 return false 8791 } 8792 func rewriteValuePPC64_OpPPC64MOVHZloadidx(v *Value) bool { 8793 v_2 := v.Args[2] 8794 v_1 := v.Args[1] 8795 v_0 := v.Args[0] 8796 // match: (MOVHZloadidx ptr (MOVDconst [c]) mem) 8797 // cond: is16Bit(c) 8798 // result: (MOVHZload [int32(c)] ptr mem) 8799 for { 8800 ptr := v_0 8801 if v_1.Op != OpPPC64MOVDconst { 8802 break 8803 } 8804 c := auxIntToInt64(v_1.AuxInt) 8805 mem := v_2 8806 if !(is16Bit(c)) { 8807 break 8808 } 8809 v.reset(OpPPC64MOVHZload) 8810 v.AuxInt = int32ToAuxInt(int32(c)) 8811 v.AddArg2(ptr, mem) 8812 return true 8813 } 8814 // match: (MOVHZloadidx (MOVDconst [c]) ptr mem) 8815 // cond: is16Bit(c) 8816 // result: (MOVHZload [int32(c)] ptr mem) 8817 for { 8818 if v_0.Op != OpPPC64MOVDconst { 8819 break 8820 } 8821 c := auxIntToInt64(v_0.AuxInt) 8822 ptr := v_1 8823 mem := v_2 8824 if !(is16Bit(c)) { 8825 break 8826 } 8827 v.reset(OpPPC64MOVHZload) 8828 v.AuxInt = int32ToAuxInt(int32(c)) 8829 v.AddArg2(ptr, mem) 8830 return true 8831 } 8832 return false 8833 } 8834 func rewriteValuePPC64_OpPPC64MOVHZreg(v *Value) bool { 8835 v_0 := v.Args[0] 8836 b := v.Block 8837 typ := &b.Func.Config.Types 8838 // match: (MOVHZreg y:(Select0 (ANDCCconst [c] _))) 8839 // cond: uint64(c) <= 0xFFFF 8840 // result: y 8841 for { 8842 y := v_0 8843 if y.Op != OpSelect0 { 8844 break 8845 } 8846 y_0 := y.Args[0] 8847 if y_0.Op != OpPPC64ANDCCconst { 8848 break 8849 } 8850 c := auxIntToInt64(y_0.AuxInt) 8851 if !(uint64(c) <= 0xFFFF) { 8852 break 8853 } 8854 v.copyOf(y) 8855 return true 8856 } 8857 // match: (MOVHZreg (SRWconst [c] (MOVBZreg x))) 8858 // result: (SRWconst [c] (MOVBZreg x)) 8859 for { 8860 if v_0.Op != OpPPC64SRWconst { 8861 break 8862 } 8863 c := auxIntToInt64(v_0.AuxInt) 8864 v_0_0 := v_0.Args[0] 8865 if v_0_0.Op != OpPPC64MOVBZreg { 8866 break 8867 } 8868 x := v_0_0.Args[0] 8869 v.reset(OpPPC64SRWconst) 8870 v.AuxInt = int64ToAuxInt(c) 8871 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64) 8872 v0.AddArg(x) 8873 v.AddArg(v0) 8874 return true 8875 } 8876 // match: (MOVHZreg (SRWconst [c] (MOVHZreg x))) 8877 // result: (SRWconst [c] (MOVHZreg x)) 8878 for { 8879 if v_0.Op != OpPPC64SRWconst { 8880 break 8881 } 8882 c := auxIntToInt64(v_0.AuxInt) 8883 v_0_0 := v_0.Args[0] 8884 if v_0_0.Op != OpPPC64MOVHZreg { 8885 break 8886 } 8887 x := v_0_0.Args[0] 8888 v.reset(OpPPC64SRWconst) 8889 v.AuxInt = int64ToAuxInt(c) 8890 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64) 8891 v0.AddArg(x) 8892 v.AddArg(v0) 8893 return true 8894 } 8895 // match: (MOVHZreg (SRWconst [c] x)) 8896 // cond: sizeof(x.Type) <= 16 8897 // result: (SRWconst [c] x) 8898 for { 8899 if v_0.Op != OpPPC64SRWconst { 8900 break 8901 } 8902 c := auxIntToInt64(v_0.AuxInt) 8903 x := v_0.Args[0] 8904 if !(sizeof(x.Type) <= 16) { 8905 break 8906 } 8907 v.reset(OpPPC64SRWconst) 8908 v.AuxInt = int64ToAuxInt(c) 8909 v.AddArg(x) 8910 return true 8911 } 8912 // match: (MOVHZreg (SRDconst [c] x)) 8913 // cond: c>=48 8914 // result: (SRDconst [c] x) 8915 for { 8916 if v_0.Op != OpPPC64SRDconst { 8917 break 8918 } 8919 c := auxIntToInt64(v_0.AuxInt) 8920 x := v_0.Args[0] 8921 if !(c >= 48) { 8922 break 8923 } 8924 v.reset(OpPPC64SRDconst) 8925 v.AuxInt = int64ToAuxInt(c) 8926 v.AddArg(x) 8927 return true 8928 } 8929 // match: (MOVHZreg (SRWconst [c] x)) 8930 // cond: c>=16 8931 // result: (SRWconst [c] x) 8932 for { 8933 if v_0.Op != OpPPC64SRWconst { 8934 break 8935 } 8936 c := auxIntToInt64(v_0.AuxInt) 8937 x := v_0.Args[0] 8938 if !(c >= 16) { 8939 break 8940 } 8941 v.reset(OpPPC64SRWconst) 8942 v.AuxInt = int64ToAuxInt(c) 8943 v.AddArg(x) 8944 return true 8945 } 8946 // match: (MOVHZreg y:(MOVHZreg _)) 8947 // result: y 8948 for { 8949 y := v_0 8950 if y.Op != OpPPC64MOVHZreg { 8951 break 8952 } 8953 v.copyOf(y) 8954 return true 8955 } 8956 // match: (MOVHZreg y:(MOVBZreg _)) 8957 // result: y 8958 for { 8959 y := v_0 8960 if y.Op != OpPPC64MOVBZreg { 8961 break 8962 } 8963 v.copyOf(y) 8964 return true 8965 } 8966 // match: (MOVHZreg y:(MOVHBRload _ _)) 8967 // result: y 8968 for { 8969 y := v_0 8970 if y.Op != OpPPC64MOVHBRload { 8971 break 8972 } 8973 v.copyOf(y) 8974 return true 8975 } 8976 // match: (MOVHZreg y:(MOVHreg x)) 8977 // result: (MOVHZreg x) 8978 for { 8979 y := v_0 8980 if y.Op != OpPPC64MOVHreg { 8981 break 8982 } 8983 x := y.Args[0] 8984 v.reset(OpPPC64MOVHZreg) 8985 v.AddArg(x) 8986 return true 8987 } 8988 // match: (MOVHZreg (OR <t> x (MOVWZreg y))) 8989 // result: (MOVHZreg (OR <t> x y)) 8990 for { 8991 if v_0.Op != OpPPC64OR { 8992 break 8993 } 8994 t := v_0.Type 8995 _ = v_0.Args[1] 8996 v_0_0 := v_0.Args[0] 8997 v_0_1 := v_0.Args[1] 8998 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 8999 x := v_0_0 9000 if v_0_1.Op != OpPPC64MOVWZreg { 9001 continue 9002 } 9003 y := v_0_1.Args[0] 9004 v.reset(OpPPC64MOVHZreg) 9005 v0 := b.NewValue0(v.Pos, OpPPC64OR, t) 9006 v0.AddArg2(x, y) 9007 v.AddArg(v0) 9008 return true 9009 } 9010 break 9011 } 9012 // match: (MOVHZreg (XOR <t> x (MOVWZreg y))) 9013 // result: (MOVHZreg (XOR <t> x y)) 9014 for { 9015 if v_0.Op != OpPPC64XOR { 9016 break 9017 } 9018 t := v_0.Type 9019 _ = v_0.Args[1] 9020 v_0_0 := v_0.Args[0] 9021 v_0_1 := v_0.Args[1] 9022 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 9023 x := v_0_0 9024 if v_0_1.Op != OpPPC64MOVWZreg { 9025 continue 9026 } 9027 y := v_0_1.Args[0] 9028 v.reset(OpPPC64MOVHZreg) 9029 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t) 9030 v0.AddArg2(x, y) 9031 v.AddArg(v0) 9032 return true 9033 } 9034 break 9035 } 9036 // match: (MOVHZreg (AND <t> x (MOVWZreg y))) 9037 // result: (MOVHZreg (AND <t> x y)) 9038 for { 9039 if v_0.Op != OpPPC64AND { 9040 break 9041 } 9042 t := v_0.Type 9043 _ = v_0.Args[1] 9044 v_0_0 := v_0.Args[0] 9045 v_0_1 := v_0.Args[1] 9046 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 9047 x := v_0_0 9048 if v_0_1.Op != OpPPC64MOVWZreg { 9049 continue 9050 } 9051 y := v_0_1.Args[0] 9052 v.reset(OpPPC64MOVHZreg) 9053 v0 := b.NewValue0(v.Pos, OpPPC64AND, t) 9054 v0.AddArg2(x, y) 9055 v.AddArg(v0) 9056 return true 9057 } 9058 break 9059 } 9060 // match: (MOVHZreg (OR <t> x (MOVHZreg y))) 9061 // result: (MOVHZreg (OR <t> x y)) 9062 for { 9063 if v_0.Op != OpPPC64OR { 9064 break 9065 } 9066 t := v_0.Type 9067 _ = v_0.Args[1] 9068 v_0_0 := v_0.Args[0] 9069 v_0_1 := v_0.Args[1] 9070 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 9071 x := v_0_0 9072 if v_0_1.Op != OpPPC64MOVHZreg { 9073 continue 9074 } 9075 y := v_0_1.Args[0] 9076 v.reset(OpPPC64MOVHZreg) 9077 v0 := b.NewValue0(v.Pos, OpPPC64OR, t) 9078 v0.AddArg2(x, y) 9079 v.AddArg(v0) 9080 return true 9081 } 9082 break 9083 } 9084 // match: (MOVHZreg (XOR <t> x (MOVHZreg y))) 9085 // result: (MOVHZreg (XOR <t> x y)) 9086 for { 9087 if v_0.Op != OpPPC64XOR { 9088 break 9089 } 9090 t := v_0.Type 9091 _ = v_0.Args[1] 9092 v_0_0 := v_0.Args[0] 9093 v_0_1 := v_0.Args[1] 9094 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 9095 x := v_0_0 9096 if v_0_1.Op != OpPPC64MOVHZreg { 9097 continue 9098 } 9099 y := v_0_1.Args[0] 9100 v.reset(OpPPC64MOVHZreg) 9101 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t) 9102 v0.AddArg2(x, y) 9103 v.AddArg(v0) 9104 return true 9105 } 9106 break 9107 } 9108 // match: (MOVHZreg (AND <t> x (MOVHZreg y))) 9109 // result: (MOVHZreg (AND <t> x y)) 9110 for { 9111 if v_0.Op != OpPPC64AND { 9112 break 9113 } 9114 t := v_0.Type 9115 _ = v_0.Args[1] 9116 v_0_0 := v_0.Args[0] 9117 v_0_1 := v_0.Args[1] 9118 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 9119 x := v_0_0 9120 if v_0_1.Op != OpPPC64MOVHZreg { 9121 continue 9122 } 9123 y := v_0_1.Args[0] 9124 v.reset(OpPPC64MOVHZreg) 9125 v0 := b.NewValue0(v.Pos, OpPPC64AND, t) 9126 v0.AddArg2(x, y) 9127 v.AddArg(v0) 9128 return true 9129 } 9130 break 9131 } 9132 // match: (MOVHZreg z:(Select0 (ANDCCconst [c] (MOVBZload ptr x)))) 9133 // result: z 9134 for { 9135 z := v_0 9136 if z.Op != OpSelect0 { 9137 break 9138 } 9139 z_0 := z.Args[0] 9140 if z_0.Op != OpPPC64ANDCCconst { 9141 break 9142 } 9143 z_0_0 := z_0.Args[0] 9144 if z_0_0.Op != OpPPC64MOVBZload { 9145 break 9146 } 9147 v.copyOf(z) 9148 return true 9149 } 9150 // match: (MOVHZreg z:(AND y (MOVHZload ptr x))) 9151 // result: z 9152 for { 9153 z := v_0 9154 if z.Op != OpPPC64AND { 9155 break 9156 } 9157 _ = z.Args[1] 9158 z_0 := z.Args[0] 9159 z_1 := z.Args[1] 9160 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 9161 if z_1.Op != OpPPC64MOVHZload { 9162 continue 9163 } 9164 v.copyOf(z) 9165 return true 9166 } 9167 break 9168 } 9169 // match: (MOVHZreg z:(Select0 (ANDCCconst [c] (MOVHZload ptr x)))) 9170 // result: z 9171 for { 9172 z := v_0 9173 if z.Op != OpSelect0 { 9174 break 9175 } 9176 z_0 := z.Args[0] 9177 if z_0.Op != OpPPC64ANDCCconst { 9178 break 9179 } 9180 z_0_0 := z_0.Args[0] 9181 if z_0_0.Op != OpPPC64MOVHZload { 9182 break 9183 } 9184 v.copyOf(z) 9185 return true 9186 } 9187 // match: (MOVHZreg x:(MOVBZload _ _)) 9188 // result: x 9189 for { 9190 x := v_0 9191 if x.Op != OpPPC64MOVBZload { 9192 break 9193 } 9194 v.copyOf(x) 9195 return true 9196 } 9197 // match: (MOVHZreg x:(MOVBZloadidx _ _ _)) 9198 // result: x 9199 for { 9200 x := v_0 9201 if x.Op != OpPPC64MOVBZloadidx { 9202 break 9203 } 9204 v.copyOf(x) 9205 return true 9206 } 9207 // match: (MOVHZreg x:(MOVHZload _ _)) 9208 // result: x 9209 for { 9210 x := v_0 9211 if x.Op != OpPPC64MOVHZload { 9212 break 9213 } 9214 v.copyOf(x) 9215 return true 9216 } 9217 // match: (MOVHZreg x:(MOVHZloadidx _ _ _)) 9218 // result: x 9219 for { 9220 x := v_0 9221 if x.Op != OpPPC64MOVHZloadidx { 9222 break 9223 } 9224 v.copyOf(x) 9225 return true 9226 } 9227 // match: (MOVHZreg x:(Arg <t>)) 9228 // cond: (is8BitInt(t) || is16BitInt(t)) && !isSigned(t) 9229 // result: x 9230 for { 9231 x := v_0 9232 if x.Op != OpArg { 9233 break 9234 } 9235 t := x.Type 9236 if !((is8BitInt(t) || is16BitInt(t)) && !isSigned(t)) { 9237 break 9238 } 9239 v.copyOf(x) 9240 return true 9241 } 9242 // match: (MOVHZreg (MOVDconst [c])) 9243 // result: (MOVDconst [int64(uint16(c))]) 9244 for { 9245 if v_0.Op != OpPPC64MOVDconst { 9246 break 9247 } 9248 c := auxIntToInt64(v_0.AuxInt) 9249 v.reset(OpPPC64MOVDconst) 9250 v.AuxInt = int64ToAuxInt(int64(uint16(c))) 9251 return true 9252 } 9253 return false 9254 } 9255 func rewriteValuePPC64_OpPPC64MOVHload(v *Value) bool { 9256 v_1 := v.Args[1] 9257 v_0 := v.Args[0] 9258 // match: (MOVHload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem) 9259 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1) 9260 // result: (MOVHload [off1+off2] {mergeSym(sym1,sym2)} ptr mem) 9261 for { 9262 off1 := auxIntToInt32(v.AuxInt) 9263 sym1 := auxToSym(v.Aux) 9264 p := v_0 9265 if p.Op != OpPPC64MOVDaddr { 9266 break 9267 } 9268 off2 := auxIntToInt32(p.AuxInt) 9269 sym2 := auxToSym(p.Aux) 9270 ptr := p.Args[0] 9271 mem := v_1 9272 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) { 9273 break 9274 } 9275 v.reset(OpPPC64MOVHload) 9276 v.AuxInt = int32ToAuxInt(off1 + off2) 9277 v.Aux = symToAux(mergeSym(sym1, sym2)) 9278 v.AddArg2(ptr, mem) 9279 return true 9280 } 9281 // match: (MOVHload [off1] {sym} (ADDconst [off2] x) mem) 9282 // cond: is16Bit(int64(off1)+off2) 9283 // result: (MOVHload [off1+int32(off2)] {sym} x mem) 9284 for { 9285 off1 := auxIntToInt32(v.AuxInt) 9286 sym := auxToSym(v.Aux) 9287 if v_0.Op != OpPPC64ADDconst { 9288 break 9289 } 9290 off2 := auxIntToInt64(v_0.AuxInt) 9291 x := v_0.Args[0] 9292 mem := v_1 9293 if !(is16Bit(int64(off1) + off2)) { 9294 break 9295 } 9296 v.reset(OpPPC64MOVHload) 9297 v.AuxInt = int32ToAuxInt(off1 + int32(off2)) 9298 v.Aux = symToAux(sym) 9299 v.AddArg2(x, mem) 9300 return true 9301 } 9302 // match: (MOVHload [0] {sym} p:(ADD ptr idx) mem) 9303 // cond: sym == nil && p.Uses == 1 9304 // result: (MOVHloadidx ptr idx mem) 9305 for { 9306 if auxIntToInt32(v.AuxInt) != 0 { 9307 break 9308 } 9309 sym := auxToSym(v.Aux) 9310 p := v_0 9311 if p.Op != OpPPC64ADD { 9312 break 9313 } 9314 idx := p.Args[1] 9315 ptr := p.Args[0] 9316 mem := v_1 9317 if !(sym == nil && p.Uses == 1) { 9318 break 9319 } 9320 v.reset(OpPPC64MOVHloadidx) 9321 v.AddArg3(ptr, idx, mem) 9322 return true 9323 } 9324 return false 9325 } 9326 func rewriteValuePPC64_OpPPC64MOVHloadidx(v *Value) bool { 9327 v_2 := v.Args[2] 9328 v_1 := v.Args[1] 9329 v_0 := v.Args[0] 9330 // match: (MOVHloadidx ptr (MOVDconst [c]) mem) 9331 // cond: is16Bit(c) 9332 // result: (MOVHload [int32(c)] ptr mem) 9333 for { 9334 ptr := v_0 9335 if v_1.Op != OpPPC64MOVDconst { 9336 break 9337 } 9338 c := auxIntToInt64(v_1.AuxInt) 9339 mem := v_2 9340 if !(is16Bit(c)) { 9341 break 9342 } 9343 v.reset(OpPPC64MOVHload) 9344 v.AuxInt = int32ToAuxInt(int32(c)) 9345 v.AddArg2(ptr, mem) 9346 return true 9347 } 9348 // match: (MOVHloadidx (MOVDconst [c]) ptr mem) 9349 // cond: is16Bit(c) 9350 // result: (MOVHload [int32(c)] ptr mem) 9351 for { 9352 if v_0.Op != OpPPC64MOVDconst { 9353 break 9354 } 9355 c := auxIntToInt64(v_0.AuxInt) 9356 ptr := v_1 9357 mem := v_2 9358 if !(is16Bit(c)) { 9359 break 9360 } 9361 v.reset(OpPPC64MOVHload) 9362 v.AuxInt = int32ToAuxInt(int32(c)) 9363 v.AddArg2(ptr, mem) 9364 return true 9365 } 9366 return false 9367 } 9368 func rewriteValuePPC64_OpPPC64MOVHreg(v *Value) bool { 9369 v_0 := v.Args[0] 9370 b := v.Block 9371 typ := &b.Func.Config.Types 9372 // match: (MOVHreg y:(Select0 (ANDCCconst [c] _))) 9373 // cond: uint64(c) <= 0x7FFF 9374 // result: y 9375 for { 9376 y := v_0 9377 if y.Op != OpSelect0 { 9378 break 9379 } 9380 y_0 := y.Args[0] 9381 if y_0.Op != OpPPC64ANDCCconst { 9382 break 9383 } 9384 c := auxIntToInt64(y_0.AuxInt) 9385 if !(uint64(c) <= 0x7FFF) { 9386 break 9387 } 9388 v.copyOf(y) 9389 return true 9390 } 9391 // match: (MOVHreg (SRAWconst [c] (MOVBreg x))) 9392 // result: (SRAWconst [c] (MOVBreg x)) 9393 for { 9394 if v_0.Op != OpPPC64SRAWconst { 9395 break 9396 } 9397 c := auxIntToInt64(v_0.AuxInt) 9398 v_0_0 := v_0.Args[0] 9399 if v_0_0.Op != OpPPC64MOVBreg { 9400 break 9401 } 9402 x := v_0_0.Args[0] 9403 v.reset(OpPPC64SRAWconst) 9404 v.AuxInt = int64ToAuxInt(c) 9405 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64) 9406 v0.AddArg(x) 9407 v.AddArg(v0) 9408 return true 9409 } 9410 // match: (MOVHreg (SRAWconst [c] (MOVHreg x))) 9411 // result: (SRAWconst [c] (MOVHreg x)) 9412 for { 9413 if v_0.Op != OpPPC64SRAWconst { 9414 break 9415 } 9416 c := auxIntToInt64(v_0.AuxInt) 9417 v_0_0 := v_0.Args[0] 9418 if v_0_0.Op != OpPPC64MOVHreg { 9419 break 9420 } 9421 x := v_0_0.Args[0] 9422 v.reset(OpPPC64SRAWconst) 9423 v.AuxInt = int64ToAuxInt(c) 9424 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64) 9425 v0.AddArg(x) 9426 v.AddArg(v0) 9427 return true 9428 } 9429 // match: (MOVHreg (SRAWconst [c] x)) 9430 // cond: sizeof(x.Type) <= 16 9431 // result: (SRAWconst [c] x) 9432 for { 9433 if v_0.Op != OpPPC64SRAWconst { 9434 break 9435 } 9436 c := auxIntToInt64(v_0.AuxInt) 9437 x := v_0.Args[0] 9438 if !(sizeof(x.Type) <= 16) { 9439 break 9440 } 9441 v.reset(OpPPC64SRAWconst) 9442 v.AuxInt = int64ToAuxInt(c) 9443 v.AddArg(x) 9444 return true 9445 } 9446 // match: (MOVHreg (SRDconst [c] x)) 9447 // cond: c>48 9448 // result: (SRDconst [c] x) 9449 for { 9450 if v_0.Op != OpPPC64SRDconst { 9451 break 9452 } 9453 c := auxIntToInt64(v_0.AuxInt) 9454 x := v_0.Args[0] 9455 if !(c > 48) { 9456 break 9457 } 9458 v.reset(OpPPC64SRDconst) 9459 v.AuxInt = int64ToAuxInt(c) 9460 v.AddArg(x) 9461 return true 9462 } 9463 // match: (MOVHreg (SRDconst [c] x)) 9464 // cond: c==48 9465 // result: (SRADconst [c] x) 9466 for { 9467 if v_0.Op != OpPPC64SRDconst { 9468 break 9469 } 9470 c := auxIntToInt64(v_0.AuxInt) 9471 x := v_0.Args[0] 9472 if !(c == 48) { 9473 break 9474 } 9475 v.reset(OpPPC64SRADconst) 9476 v.AuxInt = int64ToAuxInt(c) 9477 v.AddArg(x) 9478 return true 9479 } 9480 // match: (MOVHreg (SRADconst [c] x)) 9481 // cond: c>=48 9482 // result: (SRADconst [c] x) 9483 for { 9484 if v_0.Op != OpPPC64SRADconst { 9485 break 9486 } 9487 c := auxIntToInt64(v_0.AuxInt) 9488 x := v_0.Args[0] 9489 if !(c >= 48) { 9490 break 9491 } 9492 v.reset(OpPPC64SRADconst) 9493 v.AuxInt = int64ToAuxInt(c) 9494 v.AddArg(x) 9495 return true 9496 } 9497 // match: (MOVHreg (SRWconst [c] x)) 9498 // cond: c>16 9499 // result: (SRWconst [c] x) 9500 for { 9501 if v_0.Op != OpPPC64SRWconst { 9502 break 9503 } 9504 c := auxIntToInt64(v_0.AuxInt) 9505 x := v_0.Args[0] 9506 if !(c > 16) { 9507 break 9508 } 9509 v.reset(OpPPC64SRWconst) 9510 v.AuxInt = int64ToAuxInt(c) 9511 v.AddArg(x) 9512 return true 9513 } 9514 // match: (MOVHreg (SRAWconst [c] x)) 9515 // cond: c>=16 9516 // result: (SRAWconst [c] x) 9517 for { 9518 if v_0.Op != OpPPC64SRAWconst { 9519 break 9520 } 9521 c := auxIntToInt64(v_0.AuxInt) 9522 x := v_0.Args[0] 9523 if !(c >= 16) { 9524 break 9525 } 9526 v.reset(OpPPC64SRAWconst) 9527 v.AuxInt = int64ToAuxInt(c) 9528 v.AddArg(x) 9529 return true 9530 } 9531 // match: (MOVHreg (SRWconst [c] x)) 9532 // cond: c==16 9533 // result: (SRAWconst [c] x) 9534 for { 9535 if v_0.Op != OpPPC64SRWconst { 9536 break 9537 } 9538 c := auxIntToInt64(v_0.AuxInt) 9539 x := v_0.Args[0] 9540 if !(c == 16) { 9541 break 9542 } 9543 v.reset(OpPPC64SRAWconst) 9544 v.AuxInt = int64ToAuxInt(c) 9545 v.AddArg(x) 9546 return true 9547 } 9548 // match: (MOVHreg y:(MOVHreg _)) 9549 // result: y 9550 for { 9551 y := v_0 9552 if y.Op != OpPPC64MOVHreg { 9553 break 9554 } 9555 v.copyOf(y) 9556 return true 9557 } 9558 // match: (MOVHreg y:(MOVBreg _)) 9559 // result: y 9560 for { 9561 y := v_0 9562 if y.Op != OpPPC64MOVBreg { 9563 break 9564 } 9565 v.copyOf(y) 9566 return true 9567 } 9568 // match: (MOVHreg y:(MOVHZreg x)) 9569 // result: (MOVHreg x) 9570 for { 9571 y := v_0 9572 if y.Op != OpPPC64MOVHZreg { 9573 break 9574 } 9575 x := y.Args[0] 9576 v.reset(OpPPC64MOVHreg) 9577 v.AddArg(x) 9578 return true 9579 } 9580 // match: (MOVHreg x:(MOVHload _ _)) 9581 // result: x 9582 for { 9583 x := v_0 9584 if x.Op != OpPPC64MOVHload { 9585 break 9586 } 9587 v.copyOf(x) 9588 return true 9589 } 9590 // match: (MOVHreg x:(MOVHloadidx _ _ _)) 9591 // result: x 9592 for { 9593 x := v_0 9594 if x.Op != OpPPC64MOVHloadidx { 9595 break 9596 } 9597 v.copyOf(x) 9598 return true 9599 } 9600 // match: (MOVHreg x:(Arg <t>)) 9601 // cond: (is8BitInt(t) || is16BitInt(t)) && isSigned(t) 9602 // result: x 9603 for { 9604 x := v_0 9605 if x.Op != OpArg { 9606 break 9607 } 9608 t := x.Type 9609 if !((is8BitInt(t) || is16BitInt(t)) && isSigned(t)) { 9610 break 9611 } 9612 v.copyOf(x) 9613 return true 9614 } 9615 // match: (MOVHreg (MOVDconst [c])) 9616 // result: (MOVDconst [int64(int16(c))]) 9617 for { 9618 if v_0.Op != OpPPC64MOVDconst { 9619 break 9620 } 9621 c := auxIntToInt64(v_0.AuxInt) 9622 v.reset(OpPPC64MOVDconst) 9623 v.AuxInt = int64ToAuxInt(int64(int16(c))) 9624 return true 9625 } 9626 return false 9627 } 9628 func rewriteValuePPC64_OpPPC64MOVHstore(v *Value) bool { 9629 v_2 := v.Args[2] 9630 v_1 := v.Args[1] 9631 v_0 := v.Args[0] 9632 b := v.Block 9633 config := b.Func.Config 9634 // match: (MOVHstore [off1] {sym} (ADDconst [off2] x) val mem) 9635 // cond: is16Bit(int64(off1)+off2) 9636 // result: (MOVHstore [off1+int32(off2)] {sym} x val mem) 9637 for { 9638 off1 := auxIntToInt32(v.AuxInt) 9639 sym := auxToSym(v.Aux) 9640 if v_0.Op != OpPPC64ADDconst { 9641 break 9642 } 9643 off2 := auxIntToInt64(v_0.AuxInt) 9644 x := v_0.Args[0] 9645 val := v_1 9646 mem := v_2 9647 if !(is16Bit(int64(off1) + off2)) { 9648 break 9649 } 9650 v.reset(OpPPC64MOVHstore) 9651 v.AuxInt = int32ToAuxInt(off1 + int32(off2)) 9652 v.Aux = symToAux(sym) 9653 v.AddArg3(x, val, mem) 9654 return true 9655 } 9656 // match: (MOVHstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem) 9657 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1) 9658 // result: (MOVHstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem) 9659 for { 9660 off1 := auxIntToInt32(v.AuxInt) 9661 sym1 := auxToSym(v.Aux) 9662 p := v_0 9663 if p.Op != OpPPC64MOVDaddr { 9664 break 9665 } 9666 off2 := auxIntToInt32(p.AuxInt) 9667 sym2 := auxToSym(p.Aux) 9668 ptr := p.Args[0] 9669 val := v_1 9670 mem := v_2 9671 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) { 9672 break 9673 } 9674 v.reset(OpPPC64MOVHstore) 9675 v.AuxInt = int32ToAuxInt(off1 + off2) 9676 v.Aux = symToAux(mergeSym(sym1, sym2)) 9677 v.AddArg3(ptr, val, mem) 9678 return true 9679 } 9680 // match: (MOVHstore [off] {sym} ptr (MOVDconst [0]) mem) 9681 // result: (MOVHstorezero [off] {sym} ptr mem) 9682 for { 9683 off := auxIntToInt32(v.AuxInt) 9684 sym := auxToSym(v.Aux) 9685 ptr := v_0 9686 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 { 9687 break 9688 } 9689 mem := v_2 9690 v.reset(OpPPC64MOVHstorezero) 9691 v.AuxInt = int32ToAuxInt(off) 9692 v.Aux = symToAux(sym) 9693 v.AddArg2(ptr, mem) 9694 return true 9695 } 9696 // match: (MOVHstore [0] {sym} p:(ADD ptr idx) val mem) 9697 // cond: sym == nil && p.Uses == 1 9698 // result: (MOVHstoreidx ptr idx val mem) 9699 for { 9700 if auxIntToInt32(v.AuxInt) != 0 { 9701 break 9702 } 9703 sym := auxToSym(v.Aux) 9704 p := v_0 9705 if p.Op != OpPPC64ADD { 9706 break 9707 } 9708 idx := p.Args[1] 9709 ptr := p.Args[0] 9710 val := v_1 9711 mem := v_2 9712 if !(sym == nil && p.Uses == 1) { 9713 break 9714 } 9715 v.reset(OpPPC64MOVHstoreidx) 9716 v.AddArg4(ptr, idx, val, mem) 9717 return true 9718 } 9719 // match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem) 9720 // result: (MOVHstore [off] {sym} ptr x mem) 9721 for { 9722 off := auxIntToInt32(v.AuxInt) 9723 sym := auxToSym(v.Aux) 9724 ptr := v_0 9725 if v_1.Op != OpPPC64MOVHreg { 9726 break 9727 } 9728 x := v_1.Args[0] 9729 mem := v_2 9730 v.reset(OpPPC64MOVHstore) 9731 v.AuxInt = int32ToAuxInt(off) 9732 v.Aux = symToAux(sym) 9733 v.AddArg3(ptr, x, mem) 9734 return true 9735 } 9736 // match: (MOVHstore [off] {sym} ptr (MOVHZreg x) mem) 9737 // result: (MOVHstore [off] {sym} ptr x mem) 9738 for { 9739 off := auxIntToInt32(v.AuxInt) 9740 sym := auxToSym(v.Aux) 9741 ptr := v_0 9742 if v_1.Op != OpPPC64MOVHZreg { 9743 break 9744 } 9745 x := v_1.Args[0] 9746 mem := v_2 9747 v.reset(OpPPC64MOVHstore) 9748 v.AuxInt = int32ToAuxInt(off) 9749 v.Aux = symToAux(sym) 9750 v.AddArg3(ptr, x, mem) 9751 return true 9752 } 9753 // match: (MOVHstore [off] {sym} ptr (MOVWreg x) mem) 9754 // result: (MOVHstore [off] {sym} ptr x mem) 9755 for { 9756 off := auxIntToInt32(v.AuxInt) 9757 sym := auxToSym(v.Aux) 9758 ptr := v_0 9759 if v_1.Op != OpPPC64MOVWreg { 9760 break 9761 } 9762 x := v_1.Args[0] 9763 mem := v_2 9764 v.reset(OpPPC64MOVHstore) 9765 v.AuxInt = int32ToAuxInt(off) 9766 v.Aux = symToAux(sym) 9767 v.AddArg3(ptr, x, mem) 9768 return true 9769 } 9770 // match: (MOVHstore [off] {sym} ptr (MOVWZreg x) mem) 9771 // result: (MOVHstore [off] {sym} ptr x mem) 9772 for { 9773 off := auxIntToInt32(v.AuxInt) 9774 sym := auxToSym(v.Aux) 9775 ptr := v_0 9776 if v_1.Op != OpPPC64MOVWZreg { 9777 break 9778 } 9779 x := v_1.Args[0] 9780 mem := v_2 9781 v.reset(OpPPC64MOVHstore) 9782 v.AuxInt = int32ToAuxInt(off) 9783 v.Aux = symToAux(sym) 9784 v.AddArg3(ptr, x, mem) 9785 return true 9786 } 9787 // match: (MOVHstore [i1] {s} p (SRWconst w [16]) x0:(MOVHstore [i0] {s} p w mem)) 9788 // cond: !config.BigEndian && x0.Uses == 1 && i1 == i0+2 && clobber(x0) 9789 // result: (MOVWstore [i0] {s} p w mem) 9790 for { 9791 i1 := auxIntToInt32(v.AuxInt) 9792 s := auxToSym(v.Aux) 9793 p := v_0 9794 if v_1.Op != OpPPC64SRWconst || auxIntToInt64(v_1.AuxInt) != 16 { 9795 break 9796 } 9797 w := v_1.Args[0] 9798 x0 := v_2 9799 if x0.Op != OpPPC64MOVHstore { 9800 break 9801 } 9802 i0 := auxIntToInt32(x0.AuxInt) 9803 if auxToSym(x0.Aux) != s { 9804 break 9805 } 9806 mem := x0.Args[2] 9807 if p != x0.Args[0] || w != x0.Args[1] || !(!config.BigEndian && x0.Uses == 1 && i1 == i0+2 && clobber(x0)) { 9808 break 9809 } 9810 v.reset(OpPPC64MOVWstore) 9811 v.AuxInt = int32ToAuxInt(i0) 9812 v.Aux = symToAux(s) 9813 v.AddArg3(p, w, mem) 9814 return true 9815 } 9816 // match: (MOVHstore [i1] {s} p (SRDconst w [16]) x0:(MOVHstore [i0] {s} p w mem)) 9817 // cond: !config.BigEndian && x0.Uses == 1 && i1 == i0+2 && clobber(x0) 9818 // result: (MOVWstore [i0] {s} p w mem) 9819 for { 9820 i1 := auxIntToInt32(v.AuxInt) 9821 s := auxToSym(v.Aux) 9822 p := v_0 9823 if v_1.Op != OpPPC64SRDconst || auxIntToInt64(v_1.AuxInt) != 16 { 9824 break 9825 } 9826 w := v_1.Args[0] 9827 x0 := v_2 9828 if x0.Op != OpPPC64MOVHstore { 9829 break 9830 } 9831 i0 := auxIntToInt32(x0.AuxInt) 9832 if auxToSym(x0.Aux) != s { 9833 break 9834 } 9835 mem := x0.Args[2] 9836 if p != x0.Args[0] || w != x0.Args[1] || !(!config.BigEndian && x0.Uses == 1 && i1 == i0+2 && clobber(x0)) { 9837 break 9838 } 9839 v.reset(OpPPC64MOVWstore) 9840 v.AuxInt = int32ToAuxInt(i0) 9841 v.Aux = symToAux(s) 9842 v.AddArg3(p, w, mem) 9843 return true 9844 } 9845 return false 9846 } 9847 func rewriteValuePPC64_OpPPC64MOVHstoreidx(v *Value) bool { 9848 v_3 := v.Args[3] 9849 v_2 := v.Args[2] 9850 v_1 := v.Args[1] 9851 v_0 := v.Args[0] 9852 // match: (MOVHstoreidx ptr (MOVDconst [c]) val mem) 9853 // cond: is16Bit(c) 9854 // result: (MOVHstore [int32(c)] ptr val mem) 9855 for { 9856 ptr := v_0 9857 if v_1.Op != OpPPC64MOVDconst { 9858 break 9859 } 9860 c := auxIntToInt64(v_1.AuxInt) 9861 val := v_2 9862 mem := v_3 9863 if !(is16Bit(c)) { 9864 break 9865 } 9866 v.reset(OpPPC64MOVHstore) 9867 v.AuxInt = int32ToAuxInt(int32(c)) 9868 v.AddArg3(ptr, val, mem) 9869 return true 9870 } 9871 // match: (MOVHstoreidx (MOVDconst [c]) ptr val mem) 9872 // cond: is16Bit(c) 9873 // result: (MOVHstore [int32(c)] ptr val mem) 9874 for { 9875 if v_0.Op != OpPPC64MOVDconst { 9876 break 9877 } 9878 c := auxIntToInt64(v_0.AuxInt) 9879 ptr := v_1 9880 val := v_2 9881 mem := v_3 9882 if !(is16Bit(c)) { 9883 break 9884 } 9885 v.reset(OpPPC64MOVHstore) 9886 v.AuxInt = int32ToAuxInt(int32(c)) 9887 v.AddArg3(ptr, val, mem) 9888 return true 9889 } 9890 // match: (MOVHstoreidx ptr idx (MOVHreg x) mem) 9891 // result: (MOVHstoreidx ptr idx x mem) 9892 for { 9893 ptr := v_0 9894 idx := v_1 9895 if v_2.Op != OpPPC64MOVHreg { 9896 break 9897 } 9898 x := v_2.Args[0] 9899 mem := v_3 9900 v.reset(OpPPC64MOVHstoreidx) 9901 v.AddArg4(ptr, idx, x, mem) 9902 return true 9903 } 9904 // match: (MOVHstoreidx ptr idx (MOVHZreg x) mem) 9905 // result: (MOVHstoreidx ptr idx x mem) 9906 for { 9907 ptr := v_0 9908 idx := v_1 9909 if v_2.Op != OpPPC64MOVHZreg { 9910 break 9911 } 9912 x := v_2.Args[0] 9913 mem := v_3 9914 v.reset(OpPPC64MOVHstoreidx) 9915 v.AddArg4(ptr, idx, x, mem) 9916 return true 9917 } 9918 // match: (MOVHstoreidx ptr idx (MOVWreg x) mem) 9919 // result: (MOVHstoreidx ptr idx x mem) 9920 for { 9921 ptr := v_0 9922 idx := v_1 9923 if v_2.Op != OpPPC64MOVWreg { 9924 break 9925 } 9926 x := v_2.Args[0] 9927 mem := v_3 9928 v.reset(OpPPC64MOVHstoreidx) 9929 v.AddArg4(ptr, idx, x, mem) 9930 return true 9931 } 9932 // match: (MOVHstoreidx ptr idx (MOVWZreg x) mem) 9933 // result: (MOVHstoreidx ptr idx x mem) 9934 for { 9935 ptr := v_0 9936 idx := v_1 9937 if v_2.Op != OpPPC64MOVWZreg { 9938 break 9939 } 9940 x := v_2.Args[0] 9941 mem := v_3 9942 v.reset(OpPPC64MOVHstoreidx) 9943 v.AddArg4(ptr, idx, x, mem) 9944 return true 9945 } 9946 return false 9947 } 9948 func rewriteValuePPC64_OpPPC64MOVHstorezero(v *Value) bool { 9949 v_1 := v.Args[1] 9950 v_0 := v.Args[0] 9951 // match: (MOVHstorezero [off1] {sym} (ADDconst [off2] x) mem) 9952 // cond: is16Bit(int64(off1)+off2) 9953 // result: (MOVHstorezero [off1+int32(off2)] {sym} x mem) 9954 for { 9955 off1 := auxIntToInt32(v.AuxInt) 9956 sym := auxToSym(v.Aux) 9957 if v_0.Op != OpPPC64ADDconst { 9958 break 9959 } 9960 off2 := auxIntToInt64(v_0.AuxInt) 9961 x := v_0.Args[0] 9962 mem := v_1 9963 if !(is16Bit(int64(off1) + off2)) { 9964 break 9965 } 9966 v.reset(OpPPC64MOVHstorezero) 9967 v.AuxInt = int32ToAuxInt(off1 + int32(off2)) 9968 v.Aux = symToAux(sym) 9969 v.AddArg2(x, mem) 9970 return true 9971 } 9972 // match: (MOVHstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem) 9973 // cond: canMergeSym(sym1,sym2) && (x.Op != OpSB || p.Uses == 1) 9974 // result: (MOVHstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem) 9975 for { 9976 off1 := auxIntToInt32(v.AuxInt) 9977 sym1 := auxToSym(v.Aux) 9978 p := v_0 9979 if p.Op != OpPPC64MOVDaddr { 9980 break 9981 } 9982 off2 := auxIntToInt32(p.AuxInt) 9983 sym2 := auxToSym(p.Aux) 9984 x := p.Args[0] 9985 mem := v_1 9986 if !(canMergeSym(sym1, sym2) && (x.Op != OpSB || p.Uses == 1)) { 9987 break 9988 } 9989 v.reset(OpPPC64MOVHstorezero) 9990 v.AuxInt = int32ToAuxInt(off1 + off2) 9991 v.Aux = symToAux(mergeSym(sym1, sym2)) 9992 v.AddArg2(x, mem) 9993 return true 9994 } 9995 return false 9996 } 9997 func rewriteValuePPC64_OpPPC64MOVWBRstore(v *Value) bool { 9998 v_2 := v.Args[2] 9999 v_1 := v.Args[1] 10000 v_0 := v.Args[0] 10001 // match: (MOVWBRstore {sym} ptr (MOVWreg x) mem) 10002 // result: (MOVWBRstore {sym} ptr x mem) 10003 for { 10004 sym := auxToSym(v.Aux) 10005 ptr := v_0 10006 if v_1.Op != OpPPC64MOVWreg { 10007 break 10008 } 10009 x := v_1.Args[0] 10010 mem := v_2 10011 v.reset(OpPPC64MOVWBRstore) 10012 v.Aux = symToAux(sym) 10013 v.AddArg3(ptr, x, mem) 10014 return true 10015 } 10016 // match: (MOVWBRstore {sym} ptr (MOVWZreg x) mem) 10017 // result: (MOVWBRstore {sym} ptr x mem) 10018 for { 10019 sym := auxToSym(v.Aux) 10020 ptr := v_0 10021 if v_1.Op != OpPPC64MOVWZreg { 10022 break 10023 } 10024 x := v_1.Args[0] 10025 mem := v_2 10026 v.reset(OpPPC64MOVWBRstore) 10027 v.Aux = symToAux(sym) 10028 v.AddArg3(ptr, x, mem) 10029 return true 10030 } 10031 return false 10032 } 10033 func rewriteValuePPC64_OpPPC64MOVWZload(v *Value) bool { 10034 v_1 := v.Args[1] 10035 v_0 := v.Args[0] 10036 // match: (MOVWZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem) 10037 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1) 10038 // result: (MOVWZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem) 10039 for { 10040 off1 := auxIntToInt32(v.AuxInt) 10041 sym1 := auxToSym(v.Aux) 10042 p := v_0 10043 if p.Op != OpPPC64MOVDaddr { 10044 break 10045 } 10046 off2 := auxIntToInt32(p.AuxInt) 10047 sym2 := auxToSym(p.Aux) 10048 ptr := p.Args[0] 10049 mem := v_1 10050 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) { 10051 break 10052 } 10053 v.reset(OpPPC64MOVWZload) 10054 v.AuxInt = int32ToAuxInt(off1 + off2) 10055 v.Aux = symToAux(mergeSym(sym1, sym2)) 10056 v.AddArg2(ptr, mem) 10057 return true 10058 } 10059 // match: (MOVWZload [off1] {sym} (ADDconst [off2] x) mem) 10060 // cond: is16Bit(int64(off1)+off2) 10061 // result: (MOVWZload [off1+int32(off2)] {sym} x mem) 10062 for { 10063 off1 := auxIntToInt32(v.AuxInt) 10064 sym := auxToSym(v.Aux) 10065 if v_0.Op != OpPPC64ADDconst { 10066 break 10067 } 10068 off2 := auxIntToInt64(v_0.AuxInt) 10069 x := v_0.Args[0] 10070 mem := v_1 10071 if !(is16Bit(int64(off1) + off2)) { 10072 break 10073 } 10074 v.reset(OpPPC64MOVWZload) 10075 v.AuxInt = int32ToAuxInt(off1 + int32(off2)) 10076 v.Aux = symToAux(sym) 10077 v.AddArg2(x, mem) 10078 return true 10079 } 10080 // match: (MOVWZload [0] {sym} p:(ADD ptr idx) mem) 10081 // cond: sym == nil && p.Uses == 1 10082 // result: (MOVWZloadidx ptr idx mem) 10083 for { 10084 if auxIntToInt32(v.AuxInt) != 0 { 10085 break 10086 } 10087 sym := auxToSym(v.Aux) 10088 p := v_0 10089 if p.Op != OpPPC64ADD { 10090 break 10091 } 10092 idx := p.Args[1] 10093 ptr := p.Args[0] 10094 mem := v_1 10095 if !(sym == nil && p.Uses == 1) { 10096 break 10097 } 10098 v.reset(OpPPC64MOVWZloadidx) 10099 v.AddArg3(ptr, idx, mem) 10100 return true 10101 } 10102 return false 10103 } 10104 func rewriteValuePPC64_OpPPC64MOVWZloadidx(v *Value) bool { 10105 v_2 := v.Args[2] 10106 v_1 := v.Args[1] 10107 v_0 := v.Args[0] 10108 // match: (MOVWZloadidx ptr (MOVDconst [c]) mem) 10109 // cond: is16Bit(c) 10110 // result: (MOVWZload [int32(c)] ptr mem) 10111 for { 10112 ptr := v_0 10113 if v_1.Op != OpPPC64MOVDconst { 10114 break 10115 } 10116 c := auxIntToInt64(v_1.AuxInt) 10117 mem := v_2 10118 if !(is16Bit(c)) { 10119 break 10120 } 10121 v.reset(OpPPC64MOVWZload) 10122 v.AuxInt = int32ToAuxInt(int32(c)) 10123 v.AddArg2(ptr, mem) 10124 return true 10125 } 10126 // match: (MOVWZloadidx (MOVDconst [c]) ptr mem) 10127 // cond: is16Bit(c) 10128 // result: (MOVWZload [int32(c)] ptr mem) 10129 for { 10130 if v_0.Op != OpPPC64MOVDconst { 10131 break 10132 } 10133 c := auxIntToInt64(v_0.AuxInt) 10134 ptr := v_1 10135 mem := v_2 10136 if !(is16Bit(c)) { 10137 break 10138 } 10139 v.reset(OpPPC64MOVWZload) 10140 v.AuxInt = int32ToAuxInt(int32(c)) 10141 v.AddArg2(ptr, mem) 10142 return true 10143 } 10144 return false 10145 } 10146 func rewriteValuePPC64_OpPPC64MOVWZreg(v *Value) bool { 10147 v_0 := v.Args[0] 10148 b := v.Block 10149 typ := &b.Func.Config.Types 10150 // match: (MOVWZreg y:(Select0 (ANDCCconst [c] _))) 10151 // cond: uint64(c) <= 0xFFFFFFFF 10152 // result: y 10153 for { 10154 y := v_0 10155 if y.Op != OpSelect0 { 10156 break 10157 } 10158 y_0 := y.Args[0] 10159 if y_0.Op != OpPPC64ANDCCconst { 10160 break 10161 } 10162 c := auxIntToInt64(y_0.AuxInt) 10163 if !(uint64(c) <= 0xFFFFFFFF) { 10164 break 10165 } 10166 v.copyOf(y) 10167 return true 10168 } 10169 // match: (MOVWZreg y:(AND (MOVDconst [c]) _)) 10170 // cond: uint64(c) <= 0xFFFFFFFF 10171 // result: y 10172 for { 10173 y := v_0 10174 if y.Op != OpPPC64AND { 10175 break 10176 } 10177 y_0 := y.Args[0] 10178 y_1 := y.Args[1] 10179 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 { 10180 if y_0.Op != OpPPC64MOVDconst { 10181 continue 10182 } 10183 c := auxIntToInt64(y_0.AuxInt) 10184 if !(uint64(c) <= 0xFFFFFFFF) { 10185 continue 10186 } 10187 v.copyOf(y) 10188 return true 10189 } 10190 break 10191 } 10192 // match: (MOVWZreg (SRWconst [c] (MOVBZreg x))) 10193 // result: (SRWconst [c] (MOVBZreg x)) 10194 for { 10195 if v_0.Op != OpPPC64SRWconst { 10196 break 10197 } 10198 c := auxIntToInt64(v_0.AuxInt) 10199 v_0_0 := v_0.Args[0] 10200 if v_0_0.Op != OpPPC64MOVBZreg { 10201 break 10202 } 10203 x := v_0_0.Args[0] 10204 v.reset(OpPPC64SRWconst) 10205 v.AuxInt = int64ToAuxInt(c) 10206 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64) 10207 v0.AddArg(x) 10208 v.AddArg(v0) 10209 return true 10210 } 10211 // match: (MOVWZreg (SRWconst [c] (MOVHZreg x))) 10212 // result: (SRWconst [c] (MOVHZreg x)) 10213 for { 10214 if v_0.Op != OpPPC64SRWconst { 10215 break 10216 } 10217 c := auxIntToInt64(v_0.AuxInt) 10218 v_0_0 := v_0.Args[0] 10219 if v_0_0.Op != OpPPC64MOVHZreg { 10220 break 10221 } 10222 x := v_0_0.Args[0] 10223 v.reset(OpPPC64SRWconst) 10224 v.AuxInt = int64ToAuxInt(c) 10225 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64) 10226 v0.AddArg(x) 10227 v.AddArg(v0) 10228 return true 10229 } 10230 // match: (MOVWZreg (SRWconst [c] (MOVWZreg x))) 10231 // result: (SRWconst [c] (MOVWZreg x)) 10232 for { 10233 if v_0.Op != OpPPC64SRWconst { 10234 break 10235 } 10236 c := auxIntToInt64(v_0.AuxInt) 10237 v_0_0 := v_0.Args[0] 10238 if v_0_0.Op != OpPPC64MOVWZreg { 10239 break 10240 } 10241 x := v_0_0.Args[0] 10242 v.reset(OpPPC64SRWconst) 10243 v.AuxInt = int64ToAuxInt(c) 10244 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64) 10245 v0.AddArg(x) 10246 v.AddArg(v0) 10247 return true 10248 } 10249 // match: (MOVWZreg (SRWconst [c] x)) 10250 // cond: sizeof(x.Type) <= 32 10251 // result: (SRWconst [c] x) 10252 for { 10253 if v_0.Op != OpPPC64SRWconst { 10254 break 10255 } 10256 c := auxIntToInt64(v_0.AuxInt) 10257 x := v_0.Args[0] 10258 if !(sizeof(x.Type) <= 32) { 10259 break 10260 } 10261 v.reset(OpPPC64SRWconst) 10262 v.AuxInt = int64ToAuxInt(c) 10263 v.AddArg(x) 10264 return true 10265 } 10266 // match: (MOVWZreg (SRDconst [c] x)) 10267 // cond: c>=32 10268 // result: (SRDconst [c] x) 10269 for { 10270 if v_0.Op != OpPPC64SRDconst { 10271 break 10272 } 10273 c := auxIntToInt64(v_0.AuxInt) 10274 x := v_0.Args[0] 10275 if !(c >= 32) { 10276 break 10277 } 10278 v.reset(OpPPC64SRDconst) 10279 v.AuxInt = int64ToAuxInt(c) 10280 v.AddArg(x) 10281 return true 10282 } 10283 // match: (MOVWZreg y:(MOVWZreg _)) 10284 // result: y 10285 for { 10286 y := v_0 10287 if y.Op != OpPPC64MOVWZreg { 10288 break 10289 } 10290 v.copyOf(y) 10291 return true 10292 } 10293 // match: (MOVWZreg y:(MOVHZreg _)) 10294 // result: y 10295 for { 10296 y := v_0 10297 if y.Op != OpPPC64MOVHZreg { 10298 break 10299 } 10300 v.copyOf(y) 10301 return true 10302 } 10303 // match: (MOVWZreg y:(MOVBZreg _)) 10304 // result: y 10305 for { 10306 y := v_0 10307 if y.Op != OpPPC64MOVBZreg { 10308 break 10309 } 10310 v.copyOf(y) 10311 return true 10312 } 10313 // match: (MOVWZreg y:(MOVHBRload _ _)) 10314 // result: y 10315 for { 10316 y := v_0 10317 if y.Op != OpPPC64MOVHBRload { 10318 break 10319 } 10320 v.copyOf(y) 10321 return true 10322 } 10323 // match: (MOVWZreg y:(MOVWBRload _ _)) 10324 // result: y 10325 for { 10326 y := v_0 10327 if y.Op != OpPPC64MOVWBRload { 10328 break 10329 } 10330 v.copyOf(y) 10331 return true 10332 } 10333 // match: (MOVWZreg y:(MOVWreg x)) 10334 // result: (MOVWZreg x) 10335 for { 10336 y := v_0 10337 if y.Op != OpPPC64MOVWreg { 10338 break 10339 } 10340 x := y.Args[0] 10341 v.reset(OpPPC64MOVWZreg) 10342 v.AddArg(x) 10343 return true 10344 } 10345 // match: (MOVWZreg (OR <t> x (MOVWZreg y))) 10346 // result: (MOVWZreg (OR <t> x y)) 10347 for { 10348 if v_0.Op != OpPPC64OR { 10349 break 10350 } 10351 t := v_0.Type 10352 _ = v_0.Args[1] 10353 v_0_0 := v_0.Args[0] 10354 v_0_1 := v_0.Args[1] 10355 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 10356 x := v_0_0 10357 if v_0_1.Op != OpPPC64MOVWZreg { 10358 continue 10359 } 10360 y := v_0_1.Args[0] 10361 v.reset(OpPPC64MOVWZreg) 10362 v0 := b.NewValue0(v.Pos, OpPPC64OR, t) 10363 v0.AddArg2(x, y) 10364 v.AddArg(v0) 10365 return true 10366 } 10367 break 10368 } 10369 // match: (MOVWZreg (XOR <t> x (MOVWZreg y))) 10370 // result: (MOVWZreg (XOR <t> x y)) 10371 for { 10372 if v_0.Op != OpPPC64XOR { 10373 break 10374 } 10375 t := v_0.Type 10376 _ = v_0.Args[1] 10377 v_0_0 := v_0.Args[0] 10378 v_0_1 := v_0.Args[1] 10379 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 10380 x := v_0_0 10381 if v_0_1.Op != OpPPC64MOVWZreg { 10382 continue 10383 } 10384 y := v_0_1.Args[0] 10385 v.reset(OpPPC64MOVWZreg) 10386 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t) 10387 v0.AddArg2(x, y) 10388 v.AddArg(v0) 10389 return true 10390 } 10391 break 10392 } 10393 // match: (MOVWZreg (AND <t> x (MOVWZreg y))) 10394 // result: (MOVWZreg (AND <t> x y)) 10395 for { 10396 if v_0.Op != OpPPC64AND { 10397 break 10398 } 10399 t := v_0.Type 10400 _ = v_0.Args[1] 10401 v_0_0 := v_0.Args[0] 10402 v_0_1 := v_0.Args[1] 10403 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 10404 x := v_0_0 10405 if v_0_1.Op != OpPPC64MOVWZreg { 10406 continue 10407 } 10408 y := v_0_1.Args[0] 10409 v.reset(OpPPC64MOVWZreg) 10410 v0 := b.NewValue0(v.Pos, OpPPC64AND, t) 10411 v0.AddArg2(x, y) 10412 v.AddArg(v0) 10413 return true 10414 } 10415 break 10416 } 10417 // match: (MOVWZreg z:(Select0 (ANDCCconst [c] (MOVBZload ptr x)))) 10418 // result: z 10419 for { 10420 z := v_0 10421 if z.Op != OpSelect0 { 10422 break 10423 } 10424 z_0 := z.Args[0] 10425 if z_0.Op != OpPPC64ANDCCconst { 10426 break 10427 } 10428 z_0_0 := z_0.Args[0] 10429 if z_0_0.Op != OpPPC64MOVBZload { 10430 break 10431 } 10432 v.copyOf(z) 10433 return true 10434 } 10435 // match: (MOVWZreg z:(AND y (MOVWZload ptr x))) 10436 // result: z 10437 for { 10438 z := v_0 10439 if z.Op != OpPPC64AND { 10440 break 10441 } 10442 _ = z.Args[1] 10443 z_0 := z.Args[0] 10444 z_1 := z.Args[1] 10445 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 10446 if z_1.Op != OpPPC64MOVWZload { 10447 continue 10448 } 10449 v.copyOf(z) 10450 return true 10451 } 10452 break 10453 } 10454 // match: (MOVWZreg z:(Select0 (ANDCCconst [c] (MOVHZload ptr x)))) 10455 // result: z 10456 for { 10457 z := v_0 10458 if z.Op != OpSelect0 { 10459 break 10460 } 10461 z_0 := z.Args[0] 10462 if z_0.Op != OpPPC64ANDCCconst { 10463 break 10464 } 10465 z_0_0 := z_0.Args[0] 10466 if z_0_0.Op != OpPPC64MOVHZload { 10467 break 10468 } 10469 v.copyOf(z) 10470 return true 10471 } 10472 // match: (MOVWZreg z:(Select0 (ANDCCconst [c] (MOVWZload ptr x)))) 10473 // result: z 10474 for { 10475 z := v_0 10476 if z.Op != OpSelect0 { 10477 break 10478 } 10479 z_0 := z.Args[0] 10480 if z_0.Op != OpPPC64ANDCCconst { 10481 break 10482 } 10483 z_0_0 := z_0.Args[0] 10484 if z_0_0.Op != OpPPC64MOVWZload { 10485 break 10486 } 10487 v.copyOf(z) 10488 return true 10489 } 10490 // match: (MOVWZreg x:(MOVBZload _ _)) 10491 // result: x 10492 for { 10493 x := v_0 10494 if x.Op != OpPPC64MOVBZload { 10495 break 10496 } 10497 v.copyOf(x) 10498 return true 10499 } 10500 // match: (MOVWZreg x:(MOVBZloadidx _ _ _)) 10501 // result: x 10502 for { 10503 x := v_0 10504 if x.Op != OpPPC64MOVBZloadidx { 10505 break 10506 } 10507 v.copyOf(x) 10508 return true 10509 } 10510 // match: (MOVWZreg x:(MOVHZload _ _)) 10511 // result: x 10512 for { 10513 x := v_0 10514 if x.Op != OpPPC64MOVHZload { 10515 break 10516 } 10517 v.copyOf(x) 10518 return true 10519 } 10520 // match: (MOVWZreg x:(MOVHZloadidx _ _ _)) 10521 // result: x 10522 for { 10523 x := v_0 10524 if x.Op != OpPPC64MOVHZloadidx { 10525 break 10526 } 10527 v.copyOf(x) 10528 return true 10529 } 10530 // match: (MOVWZreg x:(MOVWZload _ _)) 10531 // result: x 10532 for { 10533 x := v_0 10534 if x.Op != OpPPC64MOVWZload { 10535 break 10536 } 10537 v.copyOf(x) 10538 return true 10539 } 10540 // match: (MOVWZreg x:(MOVWZloadidx _ _ _)) 10541 // result: x 10542 for { 10543 x := v_0 10544 if x.Op != OpPPC64MOVWZloadidx { 10545 break 10546 } 10547 v.copyOf(x) 10548 return true 10549 } 10550 // match: (MOVWZreg x:(Select0 (LoweredAtomicLoad32 _ _))) 10551 // result: x 10552 for { 10553 x := v_0 10554 if x.Op != OpSelect0 { 10555 break 10556 } 10557 x_0 := x.Args[0] 10558 if x_0.Op != OpPPC64LoweredAtomicLoad32 { 10559 break 10560 } 10561 v.copyOf(x) 10562 return true 10563 } 10564 // match: (MOVWZreg x:(Arg <t>)) 10565 // cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !isSigned(t) 10566 // result: x 10567 for { 10568 x := v_0 10569 if x.Op != OpArg { 10570 break 10571 } 10572 t := x.Type 10573 if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !isSigned(t)) { 10574 break 10575 } 10576 v.copyOf(x) 10577 return true 10578 } 10579 // match: (MOVWZreg (MOVDconst [c])) 10580 // result: (MOVDconst [int64(uint32(c))]) 10581 for { 10582 if v_0.Op != OpPPC64MOVDconst { 10583 break 10584 } 10585 c := auxIntToInt64(v_0.AuxInt) 10586 v.reset(OpPPC64MOVDconst) 10587 v.AuxInt = int64ToAuxInt(int64(uint32(c))) 10588 return true 10589 } 10590 return false 10591 } 10592 func rewriteValuePPC64_OpPPC64MOVWload(v *Value) bool { 10593 v_1 := v.Args[1] 10594 v_0 := v.Args[0] 10595 // match: (MOVWload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem) 10596 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1) 10597 // result: (MOVWload [off1+off2] {mergeSym(sym1,sym2)} ptr mem) 10598 for { 10599 off1 := auxIntToInt32(v.AuxInt) 10600 sym1 := auxToSym(v.Aux) 10601 p := v_0 10602 if p.Op != OpPPC64MOVDaddr { 10603 break 10604 } 10605 off2 := auxIntToInt32(p.AuxInt) 10606 sym2 := auxToSym(p.Aux) 10607 ptr := p.Args[0] 10608 mem := v_1 10609 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) { 10610 break 10611 } 10612 v.reset(OpPPC64MOVWload) 10613 v.AuxInt = int32ToAuxInt(off1 + off2) 10614 v.Aux = symToAux(mergeSym(sym1, sym2)) 10615 v.AddArg2(ptr, mem) 10616 return true 10617 } 10618 // match: (MOVWload [off1] {sym} (ADDconst [off2] x) mem) 10619 // cond: is16Bit(int64(off1)+off2) 10620 // result: (MOVWload [off1+int32(off2)] {sym} x mem) 10621 for { 10622 off1 := auxIntToInt32(v.AuxInt) 10623 sym := auxToSym(v.Aux) 10624 if v_0.Op != OpPPC64ADDconst { 10625 break 10626 } 10627 off2 := auxIntToInt64(v_0.AuxInt) 10628 x := v_0.Args[0] 10629 mem := v_1 10630 if !(is16Bit(int64(off1) + off2)) { 10631 break 10632 } 10633 v.reset(OpPPC64MOVWload) 10634 v.AuxInt = int32ToAuxInt(off1 + int32(off2)) 10635 v.Aux = symToAux(sym) 10636 v.AddArg2(x, mem) 10637 return true 10638 } 10639 // match: (MOVWload [0] {sym} p:(ADD ptr idx) mem) 10640 // cond: sym == nil && p.Uses == 1 10641 // result: (MOVWloadidx ptr idx mem) 10642 for { 10643 if auxIntToInt32(v.AuxInt) != 0 { 10644 break 10645 } 10646 sym := auxToSym(v.Aux) 10647 p := v_0 10648 if p.Op != OpPPC64ADD { 10649 break 10650 } 10651 idx := p.Args[1] 10652 ptr := p.Args[0] 10653 mem := v_1 10654 if !(sym == nil && p.Uses == 1) { 10655 break 10656 } 10657 v.reset(OpPPC64MOVWloadidx) 10658 v.AddArg3(ptr, idx, mem) 10659 return true 10660 } 10661 return false 10662 } 10663 func rewriteValuePPC64_OpPPC64MOVWloadidx(v *Value) bool { 10664 v_2 := v.Args[2] 10665 v_1 := v.Args[1] 10666 v_0 := v.Args[0] 10667 // match: (MOVWloadidx ptr (MOVDconst [c]) mem) 10668 // cond: is16Bit(c) && c%4 == 0 10669 // result: (MOVWload [int32(c)] ptr mem) 10670 for { 10671 ptr := v_0 10672 if v_1.Op != OpPPC64MOVDconst { 10673 break 10674 } 10675 c := auxIntToInt64(v_1.AuxInt) 10676 mem := v_2 10677 if !(is16Bit(c) && c%4 == 0) { 10678 break 10679 } 10680 v.reset(OpPPC64MOVWload) 10681 v.AuxInt = int32ToAuxInt(int32(c)) 10682 v.AddArg2(ptr, mem) 10683 return true 10684 } 10685 // match: (MOVWloadidx (MOVDconst [c]) ptr mem) 10686 // cond: is16Bit(c) && c%4 == 0 10687 // result: (MOVWload [int32(c)] ptr mem) 10688 for { 10689 if v_0.Op != OpPPC64MOVDconst { 10690 break 10691 } 10692 c := auxIntToInt64(v_0.AuxInt) 10693 ptr := v_1 10694 mem := v_2 10695 if !(is16Bit(c) && c%4 == 0) { 10696 break 10697 } 10698 v.reset(OpPPC64MOVWload) 10699 v.AuxInt = int32ToAuxInt(int32(c)) 10700 v.AddArg2(ptr, mem) 10701 return true 10702 } 10703 return false 10704 } 10705 func rewriteValuePPC64_OpPPC64MOVWreg(v *Value) bool { 10706 v_0 := v.Args[0] 10707 b := v.Block 10708 typ := &b.Func.Config.Types 10709 // match: (MOVWreg y:(Select0 (ANDCCconst [c] _))) 10710 // cond: uint64(c) <= 0xFFFF 10711 // result: y 10712 for { 10713 y := v_0 10714 if y.Op != OpSelect0 { 10715 break 10716 } 10717 y_0 := y.Args[0] 10718 if y_0.Op != OpPPC64ANDCCconst { 10719 break 10720 } 10721 c := auxIntToInt64(y_0.AuxInt) 10722 if !(uint64(c) <= 0xFFFF) { 10723 break 10724 } 10725 v.copyOf(y) 10726 return true 10727 } 10728 // match: (MOVWreg y:(AND (MOVDconst [c]) _)) 10729 // cond: uint64(c) <= 0x7FFFFFFF 10730 // result: y 10731 for { 10732 y := v_0 10733 if y.Op != OpPPC64AND { 10734 break 10735 } 10736 y_0 := y.Args[0] 10737 y_1 := y.Args[1] 10738 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 { 10739 if y_0.Op != OpPPC64MOVDconst { 10740 continue 10741 } 10742 c := auxIntToInt64(y_0.AuxInt) 10743 if !(uint64(c) <= 0x7FFFFFFF) { 10744 continue 10745 } 10746 v.copyOf(y) 10747 return true 10748 } 10749 break 10750 } 10751 // match: (MOVWreg (SRAWconst [c] (MOVBreg x))) 10752 // result: (SRAWconst [c] (MOVBreg x)) 10753 for { 10754 if v_0.Op != OpPPC64SRAWconst { 10755 break 10756 } 10757 c := auxIntToInt64(v_0.AuxInt) 10758 v_0_0 := v_0.Args[0] 10759 if v_0_0.Op != OpPPC64MOVBreg { 10760 break 10761 } 10762 x := v_0_0.Args[0] 10763 v.reset(OpPPC64SRAWconst) 10764 v.AuxInt = int64ToAuxInt(c) 10765 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64) 10766 v0.AddArg(x) 10767 v.AddArg(v0) 10768 return true 10769 } 10770 // match: (MOVWreg (SRAWconst [c] (MOVHreg x))) 10771 // result: (SRAWconst [c] (MOVHreg x)) 10772 for { 10773 if v_0.Op != OpPPC64SRAWconst { 10774 break 10775 } 10776 c := auxIntToInt64(v_0.AuxInt) 10777 v_0_0 := v_0.Args[0] 10778 if v_0_0.Op != OpPPC64MOVHreg { 10779 break 10780 } 10781 x := v_0_0.Args[0] 10782 v.reset(OpPPC64SRAWconst) 10783 v.AuxInt = int64ToAuxInt(c) 10784 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64) 10785 v0.AddArg(x) 10786 v.AddArg(v0) 10787 return true 10788 } 10789 // match: (MOVWreg (SRAWconst [c] (MOVWreg x))) 10790 // result: (SRAWconst [c] (MOVWreg x)) 10791 for { 10792 if v_0.Op != OpPPC64SRAWconst { 10793 break 10794 } 10795 c := auxIntToInt64(v_0.AuxInt) 10796 v_0_0 := v_0.Args[0] 10797 if v_0_0.Op != OpPPC64MOVWreg { 10798 break 10799 } 10800 x := v_0_0.Args[0] 10801 v.reset(OpPPC64SRAWconst) 10802 v.AuxInt = int64ToAuxInt(c) 10803 v0 := b.NewValue0(v.Pos, OpPPC64MOVWreg, typ.Int64) 10804 v0.AddArg(x) 10805 v.AddArg(v0) 10806 return true 10807 } 10808 // match: (MOVWreg (SRAWconst [c] x)) 10809 // cond: sizeof(x.Type) <= 32 10810 // result: (SRAWconst [c] x) 10811 for { 10812 if v_0.Op != OpPPC64SRAWconst { 10813 break 10814 } 10815 c := auxIntToInt64(v_0.AuxInt) 10816 x := v_0.Args[0] 10817 if !(sizeof(x.Type) <= 32) { 10818 break 10819 } 10820 v.reset(OpPPC64SRAWconst) 10821 v.AuxInt = int64ToAuxInt(c) 10822 v.AddArg(x) 10823 return true 10824 } 10825 // match: (MOVWreg (SRDconst [c] x)) 10826 // cond: c>32 10827 // result: (SRDconst [c] x) 10828 for { 10829 if v_0.Op != OpPPC64SRDconst { 10830 break 10831 } 10832 c := auxIntToInt64(v_0.AuxInt) 10833 x := v_0.Args[0] 10834 if !(c > 32) { 10835 break 10836 } 10837 v.reset(OpPPC64SRDconst) 10838 v.AuxInt = int64ToAuxInt(c) 10839 v.AddArg(x) 10840 return true 10841 } 10842 // match: (MOVWreg (SRADconst [c] x)) 10843 // cond: c>=32 10844 // result: (SRADconst [c] x) 10845 for { 10846 if v_0.Op != OpPPC64SRADconst { 10847 break 10848 } 10849 c := auxIntToInt64(v_0.AuxInt) 10850 x := v_0.Args[0] 10851 if !(c >= 32) { 10852 break 10853 } 10854 v.reset(OpPPC64SRADconst) 10855 v.AuxInt = int64ToAuxInt(c) 10856 v.AddArg(x) 10857 return true 10858 } 10859 // match: (MOVWreg (SRDconst [c] x)) 10860 // cond: c==32 10861 // result: (SRADconst [c] x) 10862 for { 10863 if v_0.Op != OpPPC64SRDconst { 10864 break 10865 } 10866 c := auxIntToInt64(v_0.AuxInt) 10867 x := v_0.Args[0] 10868 if !(c == 32) { 10869 break 10870 } 10871 v.reset(OpPPC64SRADconst) 10872 v.AuxInt = int64ToAuxInt(c) 10873 v.AddArg(x) 10874 return true 10875 } 10876 // match: (MOVWreg y:(MOVWreg _)) 10877 // result: y 10878 for { 10879 y := v_0 10880 if y.Op != OpPPC64MOVWreg { 10881 break 10882 } 10883 v.copyOf(y) 10884 return true 10885 } 10886 // match: (MOVWreg y:(MOVHreg _)) 10887 // result: y 10888 for { 10889 y := v_0 10890 if y.Op != OpPPC64MOVHreg { 10891 break 10892 } 10893 v.copyOf(y) 10894 return true 10895 } 10896 // match: (MOVWreg y:(MOVBreg _)) 10897 // result: y 10898 for { 10899 y := v_0 10900 if y.Op != OpPPC64MOVBreg { 10901 break 10902 } 10903 v.copyOf(y) 10904 return true 10905 } 10906 // match: (MOVWreg y:(MOVWZreg x)) 10907 // result: (MOVWreg x) 10908 for { 10909 y := v_0 10910 if y.Op != OpPPC64MOVWZreg { 10911 break 10912 } 10913 x := y.Args[0] 10914 v.reset(OpPPC64MOVWreg) 10915 v.AddArg(x) 10916 return true 10917 } 10918 // match: (MOVWreg x:(MOVHload _ _)) 10919 // result: x 10920 for { 10921 x := v_0 10922 if x.Op != OpPPC64MOVHload { 10923 break 10924 } 10925 v.copyOf(x) 10926 return true 10927 } 10928 // match: (MOVWreg x:(MOVHloadidx _ _ _)) 10929 // result: x 10930 for { 10931 x := v_0 10932 if x.Op != OpPPC64MOVHloadidx { 10933 break 10934 } 10935 v.copyOf(x) 10936 return true 10937 } 10938 // match: (MOVWreg x:(MOVWload _ _)) 10939 // result: x 10940 for { 10941 x := v_0 10942 if x.Op != OpPPC64MOVWload { 10943 break 10944 } 10945 v.copyOf(x) 10946 return true 10947 } 10948 // match: (MOVWreg x:(MOVWloadidx _ _ _)) 10949 // result: x 10950 for { 10951 x := v_0 10952 if x.Op != OpPPC64MOVWloadidx { 10953 break 10954 } 10955 v.copyOf(x) 10956 return true 10957 } 10958 // match: (MOVWreg x:(Arg <t>)) 10959 // cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && isSigned(t) 10960 // result: x 10961 for { 10962 x := v_0 10963 if x.Op != OpArg { 10964 break 10965 } 10966 t := x.Type 10967 if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && isSigned(t)) { 10968 break 10969 } 10970 v.copyOf(x) 10971 return true 10972 } 10973 // match: (MOVWreg (MOVDconst [c])) 10974 // result: (MOVDconst [int64(int32(c))]) 10975 for { 10976 if v_0.Op != OpPPC64MOVDconst { 10977 break 10978 } 10979 c := auxIntToInt64(v_0.AuxInt) 10980 v.reset(OpPPC64MOVDconst) 10981 v.AuxInt = int64ToAuxInt(int64(int32(c))) 10982 return true 10983 } 10984 return false 10985 } 10986 func rewriteValuePPC64_OpPPC64MOVWstore(v *Value) bool { 10987 v_2 := v.Args[2] 10988 v_1 := v.Args[1] 10989 v_0 := v.Args[0] 10990 // match: (MOVWstore [off1] {sym} (ADDconst [off2] x) val mem) 10991 // cond: is16Bit(int64(off1)+off2) 10992 // result: (MOVWstore [off1+int32(off2)] {sym} x val mem) 10993 for { 10994 off1 := auxIntToInt32(v.AuxInt) 10995 sym := auxToSym(v.Aux) 10996 if v_0.Op != OpPPC64ADDconst { 10997 break 10998 } 10999 off2 := auxIntToInt64(v_0.AuxInt) 11000 x := v_0.Args[0] 11001 val := v_1 11002 mem := v_2 11003 if !(is16Bit(int64(off1) + off2)) { 11004 break 11005 } 11006 v.reset(OpPPC64MOVWstore) 11007 v.AuxInt = int32ToAuxInt(off1 + int32(off2)) 11008 v.Aux = symToAux(sym) 11009 v.AddArg3(x, val, mem) 11010 return true 11011 } 11012 // match: (MOVWstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem) 11013 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1) 11014 // result: (MOVWstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem) 11015 for { 11016 off1 := auxIntToInt32(v.AuxInt) 11017 sym1 := auxToSym(v.Aux) 11018 p := v_0 11019 if p.Op != OpPPC64MOVDaddr { 11020 break 11021 } 11022 off2 := auxIntToInt32(p.AuxInt) 11023 sym2 := auxToSym(p.Aux) 11024 ptr := p.Args[0] 11025 val := v_1 11026 mem := v_2 11027 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) { 11028 break 11029 } 11030 v.reset(OpPPC64MOVWstore) 11031 v.AuxInt = int32ToAuxInt(off1 + off2) 11032 v.Aux = symToAux(mergeSym(sym1, sym2)) 11033 v.AddArg3(ptr, val, mem) 11034 return true 11035 } 11036 // match: (MOVWstore [off] {sym} ptr (MOVDconst [0]) mem) 11037 // result: (MOVWstorezero [off] {sym} ptr mem) 11038 for { 11039 off := auxIntToInt32(v.AuxInt) 11040 sym := auxToSym(v.Aux) 11041 ptr := v_0 11042 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 { 11043 break 11044 } 11045 mem := v_2 11046 v.reset(OpPPC64MOVWstorezero) 11047 v.AuxInt = int32ToAuxInt(off) 11048 v.Aux = symToAux(sym) 11049 v.AddArg2(ptr, mem) 11050 return true 11051 } 11052 // match: (MOVWstore [0] {sym} p:(ADD ptr idx) val mem) 11053 // cond: sym == nil && p.Uses == 1 11054 // result: (MOVWstoreidx ptr idx val mem) 11055 for { 11056 if auxIntToInt32(v.AuxInt) != 0 { 11057 break 11058 } 11059 sym := auxToSym(v.Aux) 11060 p := v_0 11061 if p.Op != OpPPC64ADD { 11062 break 11063 } 11064 idx := p.Args[1] 11065 ptr := p.Args[0] 11066 val := v_1 11067 mem := v_2 11068 if !(sym == nil && p.Uses == 1) { 11069 break 11070 } 11071 v.reset(OpPPC64MOVWstoreidx) 11072 v.AddArg4(ptr, idx, val, mem) 11073 return true 11074 } 11075 // match: (MOVWstore [off] {sym} ptr (MOVWreg x) mem) 11076 // result: (MOVWstore [off] {sym} ptr x mem) 11077 for { 11078 off := auxIntToInt32(v.AuxInt) 11079 sym := auxToSym(v.Aux) 11080 ptr := v_0 11081 if v_1.Op != OpPPC64MOVWreg { 11082 break 11083 } 11084 x := v_1.Args[0] 11085 mem := v_2 11086 v.reset(OpPPC64MOVWstore) 11087 v.AuxInt = int32ToAuxInt(off) 11088 v.Aux = symToAux(sym) 11089 v.AddArg3(ptr, x, mem) 11090 return true 11091 } 11092 // match: (MOVWstore [off] {sym} ptr (MOVWZreg x) mem) 11093 // result: (MOVWstore [off] {sym} ptr x mem) 11094 for { 11095 off := auxIntToInt32(v.AuxInt) 11096 sym := auxToSym(v.Aux) 11097 ptr := v_0 11098 if v_1.Op != OpPPC64MOVWZreg { 11099 break 11100 } 11101 x := v_1.Args[0] 11102 mem := v_2 11103 v.reset(OpPPC64MOVWstore) 11104 v.AuxInt = int32ToAuxInt(off) 11105 v.Aux = symToAux(sym) 11106 v.AddArg3(ptr, x, mem) 11107 return true 11108 } 11109 return false 11110 } 11111 func rewriteValuePPC64_OpPPC64MOVWstoreidx(v *Value) bool { 11112 v_3 := v.Args[3] 11113 v_2 := v.Args[2] 11114 v_1 := v.Args[1] 11115 v_0 := v.Args[0] 11116 // match: (MOVWstoreidx ptr (MOVDconst [c]) val mem) 11117 // cond: is16Bit(c) 11118 // result: (MOVWstore [int32(c)] ptr val mem) 11119 for { 11120 ptr := v_0 11121 if v_1.Op != OpPPC64MOVDconst { 11122 break 11123 } 11124 c := auxIntToInt64(v_1.AuxInt) 11125 val := v_2 11126 mem := v_3 11127 if !(is16Bit(c)) { 11128 break 11129 } 11130 v.reset(OpPPC64MOVWstore) 11131 v.AuxInt = int32ToAuxInt(int32(c)) 11132 v.AddArg3(ptr, val, mem) 11133 return true 11134 } 11135 // match: (MOVWstoreidx (MOVDconst [c]) ptr val mem) 11136 // cond: is16Bit(c) 11137 // result: (MOVWstore [int32(c)] ptr val mem) 11138 for { 11139 if v_0.Op != OpPPC64MOVDconst { 11140 break 11141 } 11142 c := auxIntToInt64(v_0.AuxInt) 11143 ptr := v_1 11144 val := v_2 11145 mem := v_3 11146 if !(is16Bit(c)) { 11147 break 11148 } 11149 v.reset(OpPPC64MOVWstore) 11150 v.AuxInt = int32ToAuxInt(int32(c)) 11151 v.AddArg3(ptr, val, mem) 11152 return true 11153 } 11154 // match: (MOVWstoreidx ptr idx (MOVWreg x) mem) 11155 // result: (MOVWstoreidx ptr idx x mem) 11156 for { 11157 ptr := v_0 11158 idx := v_1 11159 if v_2.Op != OpPPC64MOVWreg { 11160 break 11161 } 11162 x := v_2.Args[0] 11163 mem := v_3 11164 v.reset(OpPPC64MOVWstoreidx) 11165 v.AddArg4(ptr, idx, x, mem) 11166 return true 11167 } 11168 // match: (MOVWstoreidx ptr idx (MOVWZreg x) mem) 11169 // result: (MOVWstoreidx ptr idx x mem) 11170 for { 11171 ptr := v_0 11172 idx := v_1 11173 if v_2.Op != OpPPC64MOVWZreg { 11174 break 11175 } 11176 x := v_2.Args[0] 11177 mem := v_3 11178 v.reset(OpPPC64MOVWstoreidx) 11179 v.AddArg4(ptr, idx, x, mem) 11180 return true 11181 } 11182 return false 11183 } 11184 func rewriteValuePPC64_OpPPC64MOVWstorezero(v *Value) bool { 11185 v_1 := v.Args[1] 11186 v_0 := v.Args[0] 11187 // match: (MOVWstorezero [off1] {sym} (ADDconst [off2] x) mem) 11188 // cond: is16Bit(int64(off1)+off2) 11189 // result: (MOVWstorezero [off1+int32(off2)] {sym} x mem) 11190 for { 11191 off1 := auxIntToInt32(v.AuxInt) 11192 sym := auxToSym(v.Aux) 11193 if v_0.Op != OpPPC64ADDconst { 11194 break 11195 } 11196 off2 := auxIntToInt64(v_0.AuxInt) 11197 x := v_0.Args[0] 11198 mem := v_1 11199 if !(is16Bit(int64(off1) + off2)) { 11200 break 11201 } 11202 v.reset(OpPPC64MOVWstorezero) 11203 v.AuxInt = int32ToAuxInt(off1 + int32(off2)) 11204 v.Aux = symToAux(sym) 11205 v.AddArg2(x, mem) 11206 return true 11207 } 11208 // match: (MOVWstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem) 11209 // cond: canMergeSym(sym1,sym2) && (x.Op != OpSB || p.Uses == 1) 11210 // result: (MOVWstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem) 11211 for { 11212 off1 := auxIntToInt32(v.AuxInt) 11213 sym1 := auxToSym(v.Aux) 11214 p := v_0 11215 if p.Op != OpPPC64MOVDaddr { 11216 break 11217 } 11218 off2 := auxIntToInt32(p.AuxInt) 11219 sym2 := auxToSym(p.Aux) 11220 x := p.Args[0] 11221 mem := v_1 11222 if !(canMergeSym(sym1, sym2) && (x.Op != OpSB || p.Uses == 1)) { 11223 break 11224 } 11225 v.reset(OpPPC64MOVWstorezero) 11226 v.AuxInt = int32ToAuxInt(off1 + off2) 11227 v.Aux = symToAux(mergeSym(sym1, sym2)) 11228 v.AddArg2(x, mem) 11229 return true 11230 } 11231 return false 11232 } 11233 func rewriteValuePPC64_OpPPC64MTVSRD(v *Value) bool { 11234 v_0 := v.Args[0] 11235 b := v.Block 11236 typ := &b.Func.Config.Types 11237 // match: (MTVSRD (MOVDconst [c])) 11238 // cond: !math.IsNaN(math.Float64frombits(uint64(c))) 11239 // result: (FMOVDconst [math.Float64frombits(uint64(c))]) 11240 for { 11241 if v_0.Op != OpPPC64MOVDconst { 11242 break 11243 } 11244 c := auxIntToInt64(v_0.AuxInt) 11245 if !(!math.IsNaN(math.Float64frombits(uint64(c)))) { 11246 break 11247 } 11248 v.reset(OpPPC64FMOVDconst) 11249 v.AuxInt = float64ToAuxInt(math.Float64frombits(uint64(c))) 11250 return true 11251 } 11252 // match: (MTVSRD x:(MOVDload [off] {sym} ptr mem)) 11253 // cond: x.Uses == 1 && clobber(x) 11254 // result: @x.Block (FMOVDload [off] {sym} ptr mem) 11255 for { 11256 x := v_0 11257 if x.Op != OpPPC64MOVDload { 11258 break 11259 } 11260 off := auxIntToInt32(x.AuxInt) 11261 sym := auxToSym(x.Aux) 11262 mem := x.Args[1] 11263 ptr := x.Args[0] 11264 if !(x.Uses == 1 && clobber(x)) { 11265 break 11266 } 11267 b = x.Block 11268 v0 := b.NewValue0(x.Pos, OpPPC64FMOVDload, typ.Float64) 11269 v.copyOf(v0) 11270 v0.AuxInt = int32ToAuxInt(off) 11271 v0.Aux = symToAux(sym) 11272 v0.AddArg2(ptr, mem) 11273 return true 11274 } 11275 return false 11276 } 11277 func rewriteValuePPC64_OpPPC64MULLD(v *Value) bool { 11278 v_1 := v.Args[1] 11279 v_0 := v.Args[0] 11280 // match: (MULLD x (MOVDconst [c])) 11281 // cond: is16Bit(c) 11282 // result: (MULLDconst [int32(c)] x) 11283 for { 11284 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 11285 x := v_0 11286 if v_1.Op != OpPPC64MOVDconst { 11287 continue 11288 } 11289 c := auxIntToInt64(v_1.AuxInt) 11290 if !(is16Bit(c)) { 11291 continue 11292 } 11293 v.reset(OpPPC64MULLDconst) 11294 v.AuxInt = int32ToAuxInt(int32(c)) 11295 v.AddArg(x) 11296 return true 11297 } 11298 break 11299 } 11300 return false 11301 } 11302 func rewriteValuePPC64_OpPPC64MULLW(v *Value) bool { 11303 v_1 := v.Args[1] 11304 v_0 := v.Args[0] 11305 // match: (MULLW x (MOVDconst [c])) 11306 // cond: is16Bit(c) 11307 // result: (MULLWconst [int32(c)] x) 11308 for { 11309 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 11310 x := v_0 11311 if v_1.Op != OpPPC64MOVDconst { 11312 continue 11313 } 11314 c := auxIntToInt64(v_1.AuxInt) 11315 if !(is16Bit(c)) { 11316 continue 11317 } 11318 v.reset(OpPPC64MULLWconst) 11319 v.AuxInt = int32ToAuxInt(int32(c)) 11320 v.AddArg(x) 11321 return true 11322 } 11323 break 11324 } 11325 return false 11326 } 11327 func rewriteValuePPC64_OpPPC64NEG(v *Value) bool { 11328 v_0 := v.Args[0] 11329 // match: (NEG (ADDconst [c] x)) 11330 // cond: is32Bit(-c) 11331 // result: (SUBFCconst [-c] x) 11332 for { 11333 if v_0.Op != OpPPC64ADDconst { 11334 break 11335 } 11336 c := auxIntToInt64(v_0.AuxInt) 11337 x := v_0.Args[0] 11338 if !(is32Bit(-c)) { 11339 break 11340 } 11341 v.reset(OpPPC64SUBFCconst) 11342 v.AuxInt = int64ToAuxInt(-c) 11343 v.AddArg(x) 11344 return true 11345 } 11346 // match: (NEG (SUBFCconst [c] x)) 11347 // cond: is32Bit(-c) 11348 // result: (ADDconst [-c] x) 11349 for { 11350 if v_0.Op != OpPPC64SUBFCconst { 11351 break 11352 } 11353 c := auxIntToInt64(v_0.AuxInt) 11354 x := v_0.Args[0] 11355 if !(is32Bit(-c)) { 11356 break 11357 } 11358 v.reset(OpPPC64ADDconst) 11359 v.AuxInt = int64ToAuxInt(-c) 11360 v.AddArg(x) 11361 return true 11362 } 11363 // match: (NEG (SUB x y)) 11364 // result: (SUB y x) 11365 for { 11366 if v_0.Op != OpPPC64SUB { 11367 break 11368 } 11369 y := v_0.Args[1] 11370 x := v_0.Args[0] 11371 v.reset(OpPPC64SUB) 11372 v.AddArg2(y, x) 11373 return true 11374 } 11375 // match: (NEG (NEG x)) 11376 // result: x 11377 for { 11378 if v_0.Op != OpPPC64NEG { 11379 break 11380 } 11381 x := v_0.Args[0] 11382 v.copyOf(x) 11383 return true 11384 } 11385 return false 11386 } 11387 func rewriteValuePPC64_OpPPC64NOR(v *Value) bool { 11388 v_1 := v.Args[1] 11389 v_0 := v.Args[0] 11390 // match: (NOR (MOVDconst [c]) (MOVDconst [d])) 11391 // result: (MOVDconst [^(c|d)]) 11392 for { 11393 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 11394 if v_0.Op != OpPPC64MOVDconst { 11395 continue 11396 } 11397 c := auxIntToInt64(v_0.AuxInt) 11398 if v_1.Op != OpPPC64MOVDconst { 11399 continue 11400 } 11401 d := auxIntToInt64(v_1.AuxInt) 11402 v.reset(OpPPC64MOVDconst) 11403 v.AuxInt = int64ToAuxInt(^(c | d)) 11404 return true 11405 } 11406 break 11407 } 11408 return false 11409 } 11410 func rewriteValuePPC64_OpPPC64NotEqual(v *Value) bool { 11411 v_0 := v.Args[0] 11412 b := v.Block 11413 typ := &b.Func.Config.Types 11414 // match: (NotEqual (FlagEQ)) 11415 // result: (MOVDconst [0]) 11416 for { 11417 if v_0.Op != OpPPC64FlagEQ { 11418 break 11419 } 11420 v.reset(OpPPC64MOVDconst) 11421 v.AuxInt = int64ToAuxInt(0) 11422 return true 11423 } 11424 // match: (NotEqual (FlagLT)) 11425 // result: (MOVDconst [1]) 11426 for { 11427 if v_0.Op != OpPPC64FlagLT { 11428 break 11429 } 11430 v.reset(OpPPC64MOVDconst) 11431 v.AuxInt = int64ToAuxInt(1) 11432 return true 11433 } 11434 // match: (NotEqual (FlagGT)) 11435 // result: (MOVDconst [1]) 11436 for { 11437 if v_0.Op != OpPPC64FlagGT { 11438 break 11439 } 11440 v.reset(OpPPC64MOVDconst) 11441 v.AuxInt = int64ToAuxInt(1) 11442 return true 11443 } 11444 // match: (NotEqual (InvertFlags x)) 11445 // result: (NotEqual x) 11446 for { 11447 if v_0.Op != OpPPC64InvertFlags { 11448 break 11449 } 11450 x := v_0.Args[0] 11451 v.reset(OpPPC64NotEqual) 11452 v.AddArg(x) 11453 return true 11454 } 11455 // match: (NotEqual cmp) 11456 // result: (ISELB [6] (MOVDconst [1]) cmp) 11457 for { 11458 cmp := v_0 11459 v.reset(OpPPC64ISELB) 11460 v.AuxInt = int32ToAuxInt(6) 11461 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 11462 v0.AuxInt = int64ToAuxInt(1) 11463 v.AddArg2(v0, cmp) 11464 return true 11465 } 11466 } 11467 func rewriteValuePPC64_OpPPC64OR(v *Value) bool { 11468 v_1 := v.Args[1] 11469 v_0 := v.Args[0] 11470 b := v.Block 11471 config := b.Func.Config 11472 typ := &b.Func.Config.Types 11473 // match: (OR x (NOR y y)) 11474 // result: (ORN x y) 11475 for { 11476 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 11477 x := v_0 11478 if v_1.Op != OpPPC64NOR { 11479 continue 11480 } 11481 y := v_1.Args[1] 11482 if y != v_1.Args[0] { 11483 continue 11484 } 11485 v.reset(OpPPC64ORN) 11486 v.AddArg2(x, y) 11487 return true 11488 } 11489 break 11490 } 11491 // match: (OR (MOVDconst [c]) (MOVDconst [d])) 11492 // result: (MOVDconst [c|d]) 11493 for { 11494 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 11495 if v_0.Op != OpPPC64MOVDconst { 11496 continue 11497 } 11498 c := auxIntToInt64(v_0.AuxInt) 11499 if v_1.Op != OpPPC64MOVDconst { 11500 continue 11501 } 11502 d := auxIntToInt64(v_1.AuxInt) 11503 v.reset(OpPPC64MOVDconst) 11504 v.AuxInt = int64ToAuxInt(c | d) 11505 return true 11506 } 11507 break 11508 } 11509 // match: (OR x (MOVDconst [c])) 11510 // cond: isU32Bit(c) 11511 // result: (ORconst [c] x) 11512 for { 11513 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 11514 x := v_0 11515 if v_1.Op != OpPPC64MOVDconst { 11516 continue 11517 } 11518 c := auxIntToInt64(v_1.AuxInt) 11519 if !(isU32Bit(c)) { 11520 continue 11521 } 11522 v.reset(OpPPC64ORconst) 11523 v.AuxInt = int64ToAuxInt(c) 11524 v.AddArg(x) 11525 return true 11526 } 11527 break 11528 } 11529 // match: (OR <t> x0:(MOVBZload [i0] {s} p mem) o1:(SLWconst x1:(MOVBZload [i1] {s} p mem) [8])) 11530 // cond: !config.BigEndian && i1 == i0+1 && x0.Uses ==1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1) 11531 // result: @mergePoint(b,x0,x1) (MOVHZload <t> {s} [i0] p mem) 11532 for { 11533 t := v.Type 11534 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 11535 x0 := v_0 11536 if x0.Op != OpPPC64MOVBZload { 11537 continue 11538 } 11539 i0 := auxIntToInt32(x0.AuxInt) 11540 s := auxToSym(x0.Aux) 11541 mem := x0.Args[1] 11542 p := x0.Args[0] 11543 o1 := v_1 11544 if o1.Op != OpPPC64SLWconst || auxIntToInt64(o1.AuxInt) != 8 { 11545 continue 11546 } 11547 x1 := o1.Args[0] 11548 if x1.Op != OpPPC64MOVBZload { 11549 continue 11550 } 11551 i1 := auxIntToInt32(x1.AuxInt) 11552 if auxToSym(x1.Aux) != s { 11553 continue 11554 } 11555 _ = x1.Args[1] 11556 if p != x1.Args[0] || mem != x1.Args[1] || !(!config.BigEndian && i1 == i0+1 && x0.Uses == 1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1)) { 11557 continue 11558 } 11559 b = mergePoint(b, x0, x1) 11560 v0 := b.NewValue0(x1.Pos, OpPPC64MOVHZload, t) 11561 v.copyOf(v0) 11562 v0.AuxInt = int32ToAuxInt(i0) 11563 v0.Aux = symToAux(s) 11564 v0.AddArg2(p, mem) 11565 return true 11566 } 11567 break 11568 } 11569 // match: (OR <t> x0:(MOVBZload [i0] {s} p mem) o1:(SLDconst x1:(MOVBZload [i1] {s} p mem) [8])) 11570 // cond: !config.BigEndian && i1 == i0+1 && x0.Uses ==1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1) 11571 // result: @mergePoint(b,x0,x1) (MOVHZload <t> {s} [i0] p mem) 11572 for { 11573 t := v.Type 11574 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 11575 x0 := v_0 11576 if x0.Op != OpPPC64MOVBZload { 11577 continue 11578 } 11579 i0 := auxIntToInt32(x0.AuxInt) 11580 s := auxToSym(x0.Aux) 11581 mem := x0.Args[1] 11582 p := x0.Args[0] 11583 o1 := v_1 11584 if o1.Op != OpPPC64SLDconst || auxIntToInt64(o1.AuxInt) != 8 { 11585 continue 11586 } 11587 x1 := o1.Args[0] 11588 if x1.Op != OpPPC64MOVBZload { 11589 continue 11590 } 11591 i1 := auxIntToInt32(x1.AuxInt) 11592 if auxToSym(x1.Aux) != s { 11593 continue 11594 } 11595 _ = x1.Args[1] 11596 if p != x1.Args[0] || mem != x1.Args[1] || !(!config.BigEndian && i1 == i0+1 && x0.Uses == 1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1)) { 11597 continue 11598 } 11599 b = mergePoint(b, x0, x1) 11600 v0 := b.NewValue0(x1.Pos, OpPPC64MOVHZload, t) 11601 v.copyOf(v0) 11602 v0.AuxInt = int32ToAuxInt(i0) 11603 v0.Aux = symToAux(s) 11604 v0.AddArg2(p, mem) 11605 return true 11606 } 11607 break 11608 } 11609 // match: (OR <t> x0:(MOVBZload [i1] {s} p mem) o1:(SLWconst x1:(MOVBZload [i0] {s} p mem) [8])) 11610 // cond: !config.BigEndian && i1 == i0+1 && x0.Uses ==1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1) 11611 // result: @mergePoint(b,x0,x1) (MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) 11612 for { 11613 t := v.Type 11614 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 11615 x0 := v_0 11616 if x0.Op != OpPPC64MOVBZload { 11617 continue 11618 } 11619 i1 := auxIntToInt32(x0.AuxInt) 11620 s := auxToSym(x0.Aux) 11621 mem := x0.Args[1] 11622 p := x0.Args[0] 11623 o1 := v_1 11624 if o1.Op != OpPPC64SLWconst || auxIntToInt64(o1.AuxInt) != 8 { 11625 continue 11626 } 11627 x1 := o1.Args[0] 11628 if x1.Op != OpPPC64MOVBZload { 11629 continue 11630 } 11631 i0 := auxIntToInt32(x1.AuxInt) 11632 if auxToSym(x1.Aux) != s { 11633 continue 11634 } 11635 _ = x1.Args[1] 11636 if p != x1.Args[0] || mem != x1.Args[1] || !(!config.BigEndian && i1 == i0+1 && x0.Uses == 1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1)) { 11637 continue 11638 } 11639 b = mergePoint(b, x0, x1) 11640 v0 := b.NewValue0(x1.Pos, OpPPC64MOVHBRload, t) 11641 v.copyOf(v0) 11642 v1 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr) 11643 v1.AuxInt = int32ToAuxInt(i0) 11644 v1.Aux = symToAux(s) 11645 v1.AddArg(p) 11646 v0.AddArg2(v1, mem) 11647 return true 11648 } 11649 break 11650 } 11651 // match: (OR <t> x0:(MOVBZload [i1] {s} p mem) o1:(SLDconst x1:(MOVBZload [i0] {s} p mem) [8])) 11652 // cond: !config.BigEndian && i1 == i0+1 && x0.Uses ==1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1) 11653 // result: @mergePoint(b,x0,x1) (MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) 11654 for { 11655 t := v.Type 11656 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 11657 x0 := v_0 11658 if x0.Op != OpPPC64MOVBZload { 11659 continue 11660 } 11661 i1 := auxIntToInt32(x0.AuxInt) 11662 s := auxToSym(x0.Aux) 11663 mem := x0.Args[1] 11664 p := x0.Args[0] 11665 o1 := v_1 11666 if o1.Op != OpPPC64SLDconst || auxIntToInt64(o1.AuxInt) != 8 { 11667 continue 11668 } 11669 x1 := o1.Args[0] 11670 if x1.Op != OpPPC64MOVBZload { 11671 continue 11672 } 11673 i0 := auxIntToInt32(x1.AuxInt) 11674 if auxToSym(x1.Aux) != s { 11675 continue 11676 } 11677 _ = x1.Args[1] 11678 if p != x1.Args[0] || mem != x1.Args[1] || !(!config.BigEndian && i1 == i0+1 && x0.Uses == 1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1)) { 11679 continue 11680 } 11681 b = mergePoint(b, x0, x1) 11682 v0 := b.NewValue0(x1.Pos, OpPPC64MOVHBRload, t) 11683 v.copyOf(v0) 11684 v1 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr) 11685 v1.AuxInt = int32ToAuxInt(i0) 11686 v1.Aux = symToAux(s) 11687 v1.AddArg(p) 11688 v0.AddArg2(v1, mem) 11689 return true 11690 } 11691 break 11692 } 11693 // match: (OR <t> s0:(SLWconst x0:(MOVBZload [i1] {s} p mem) [n1]) s1:(SLWconst x1:(MOVBZload [i0] {s} p mem) [n2])) 11694 // cond: !config.BigEndian && i1 == i0+1 && n1%8 == 0 && n2 == n1+8 && x0.Uses == 1 && x1.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, s0, s1) 11695 // result: @mergePoint(b,x0,x1) (SLDconst <t> (MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [n1]) 11696 for { 11697 t := v.Type 11698 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 11699 s0 := v_0 11700 if s0.Op != OpPPC64SLWconst { 11701 continue 11702 } 11703 n1 := auxIntToInt64(s0.AuxInt) 11704 x0 := s0.Args[0] 11705 if x0.Op != OpPPC64MOVBZload { 11706 continue 11707 } 11708 i1 := auxIntToInt32(x0.AuxInt) 11709 s := auxToSym(x0.Aux) 11710 mem := x0.Args[1] 11711 p := x0.Args[0] 11712 s1 := v_1 11713 if s1.Op != OpPPC64SLWconst { 11714 continue 11715 } 11716 n2 := auxIntToInt64(s1.AuxInt) 11717 x1 := s1.Args[0] 11718 if x1.Op != OpPPC64MOVBZload { 11719 continue 11720 } 11721 i0 := auxIntToInt32(x1.AuxInt) 11722 if auxToSym(x1.Aux) != s { 11723 continue 11724 } 11725 _ = x1.Args[1] 11726 if p != x1.Args[0] || mem != x1.Args[1] || !(!config.BigEndian && i1 == i0+1 && n1%8 == 0 && n2 == n1+8 && x0.Uses == 1 && x1.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, s0, s1)) { 11727 continue 11728 } 11729 b = mergePoint(b, x0, x1) 11730 v0 := b.NewValue0(x1.Pos, OpPPC64SLDconst, t) 11731 v.copyOf(v0) 11732 v0.AuxInt = int64ToAuxInt(n1) 11733 v1 := b.NewValue0(x1.Pos, OpPPC64MOVHBRload, t) 11734 v2 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr) 11735 v2.AuxInt = int32ToAuxInt(i0) 11736 v2.Aux = symToAux(s) 11737 v2.AddArg(p) 11738 v1.AddArg2(v2, mem) 11739 v0.AddArg(v1) 11740 return true 11741 } 11742 break 11743 } 11744 // match: (OR <t> s0:(SLDconst x0:(MOVBZload [i1] {s} p mem) [n1]) s1:(SLDconst x1:(MOVBZload [i0] {s} p mem) [n2])) 11745 // cond: !config.BigEndian && i1 == i0+1 && n1%8 == 0 && n2 == n1+8 && x0.Uses == 1 && x1.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, s0, s1) 11746 // result: @mergePoint(b,x0,x1) (SLDconst <t> (MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [n1]) 11747 for { 11748 t := v.Type 11749 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 11750 s0 := v_0 11751 if s0.Op != OpPPC64SLDconst { 11752 continue 11753 } 11754 n1 := auxIntToInt64(s0.AuxInt) 11755 x0 := s0.Args[0] 11756 if x0.Op != OpPPC64MOVBZload { 11757 continue 11758 } 11759 i1 := auxIntToInt32(x0.AuxInt) 11760 s := auxToSym(x0.Aux) 11761 mem := x0.Args[1] 11762 p := x0.Args[0] 11763 s1 := v_1 11764 if s1.Op != OpPPC64SLDconst { 11765 continue 11766 } 11767 n2 := auxIntToInt64(s1.AuxInt) 11768 x1 := s1.Args[0] 11769 if x1.Op != OpPPC64MOVBZload { 11770 continue 11771 } 11772 i0 := auxIntToInt32(x1.AuxInt) 11773 if auxToSym(x1.Aux) != s { 11774 continue 11775 } 11776 _ = x1.Args[1] 11777 if p != x1.Args[0] || mem != x1.Args[1] || !(!config.BigEndian && i1 == i0+1 && n1%8 == 0 && n2 == n1+8 && x0.Uses == 1 && x1.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, s0, s1)) { 11778 continue 11779 } 11780 b = mergePoint(b, x0, x1) 11781 v0 := b.NewValue0(x1.Pos, OpPPC64SLDconst, t) 11782 v.copyOf(v0) 11783 v0.AuxInt = int64ToAuxInt(n1) 11784 v1 := b.NewValue0(x1.Pos, OpPPC64MOVHBRload, t) 11785 v2 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr) 11786 v2.AuxInt = int32ToAuxInt(i0) 11787 v2.Aux = symToAux(s) 11788 v2.AddArg(p) 11789 v1.AddArg2(v2, mem) 11790 v0.AddArg(v1) 11791 return true 11792 } 11793 break 11794 } 11795 // match: (OR <t> s1:(SLWconst x2:(MOVBZload [i3] {s} p mem) [24]) o0:(OR <t> s0:(SLWconst x1:(MOVBZload [i2] {s} p mem) [16]) x0:(MOVHZload [i0] {s} p mem))) 11796 // cond: !config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses ==1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0) 11797 // result: @mergePoint(b,x0,x1,x2) (MOVWZload <t> {s} [i0] p mem) 11798 for { 11799 t := v.Type 11800 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 11801 s1 := v_0 11802 if s1.Op != OpPPC64SLWconst || auxIntToInt64(s1.AuxInt) != 24 { 11803 continue 11804 } 11805 x2 := s1.Args[0] 11806 if x2.Op != OpPPC64MOVBZload { 11807 continue 11808 } 11809 i3 := auxIntToInt32(x2.AuxInt) 11810 s := auxToSym(x2.Aux) 11811 mem := x2.Args[1] 11812 p := x2.Args[0] 11813 o0 := v_1 11814 if o0.Op != OpPPC64OR || o0.Type != t { 11815 continue 11816 } 11817 _ = o0.Args[1] 11818 o0_0 := o0.Args[0] 11819 o0_1 := o0.Args[1] 11820 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 { 11821 s0 := o0_0 11822 if s0.Op != OpPPC64SLWconst || auxIntToInt64(s0.AuxInt) != 16 { 11823 continue 11824 } 11825 x1 := s0.Args[0] 11826 if x1.Op != OpPPC64MOVBZload { 11827 continue 11828 } 11829 i2 := auxIntToInt32(x1.AuxInt) 11830 if auxToSym(x1.Aux) != s { 11831 continue 11832 } 11833 _ = x1.Args[1] 11834 if p != x1.Args[0] || mem != x1.Args[1] { 11835 continue 11836 } 11837 x0 := o0_1 11838 if x0.Op != OpPPC64MOVHZload { 11839 continue 11840 } 11841 i0 := auxIntToInt32(x0.AuxInt) 11842 if auxToSym(x0.Aux) != s { 11843 continue 11844 } 11845 _ = x0.Args[1] 11846 if p != x0.Args[0] || mem != x0.Args[1] || !(!config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)) { 11847 continue 11848 } 11849 b = mergePoint(b, x0, x1, x2) 11850 v0 := b.NewValue0(x0.Pos, OpPPC64MOVWZload, t) 11851 v.copyOf(v0) 11852 v0.AuxInt = int32ToAuxInt(i0) 11853 v0.Aux = symToAux(s) 11854 v0.AddArg2(p, mem) 11855 return true 11856 } 11857 } 11858 break 11859 } 11860 // match: (OR <t> s1:(SLDconst x2:(MOVBZload [i3] {s} p mem) [24]) o0:(OR <t> s0:(SLDconst x1:(MOVBZload [i2] {s} p mem) [16]) x0:(MOVHZload [i0] {s} p mem))) 11861 // cond: !config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses ==1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0) 11862 // result: @mergePoint(b,x0,x1,x2) (MOVWZload <t> {s} [i0] p mem) 11863 for { 11864 t := v.Type 11865 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 11866 s1 := v_0 11867 if s1.Op != OpPPC64SLDconst || auxIntToInt64(s1.AuxInt) != 24 { 11868 continue 11869 } 11870 x2 := s1.Args[0] 11871 if x2.Op != OpPPC64MOVBZload { 11872 continue 11873 } 11874 i3 := auxIntToInt32(x2.AuxInt) 11875 s := auxToSym(x2.Aux) 11876 mem := x2.Args[1] 11877 p := x2.Args[0] 11878 o0 := v_1 11879 if o0.Op != OpPPC64OR || o0.Type != t { 11880 continue 11881 } 11882 _ = o0.Args[1] 11883 o0_0 := o0.Args[0] 11884 o0_1 := o0.Args[1] 11885 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 { 11886 s0 := o0_0 11887 if s0.Op != OpPPC64SLDconst || auxIntToInt64(s0.AuxInt) != 16 { 11888 continue 11889 } 11890 x1 := s0.Args[0] 11891 if x1.Op != OpPPC64MOVBZload { 11892 continue 11893 } 11894 i2 := auxIntToInt32(x1.AuxInt) 11895 if auxToSym(x1.Aux) != s { 11896 continue 11897 } 11898 _ = x1.Args[1] 11899 if p != x1.Args[0] || mem != x1.Args[1] { 11900 continue 11901 } 11902 x0 := o0_1 11903 if x0.Op != OpPPC64MOVHZload { 11904 continue 11905 } 11906 i0 := auxIntToInt32(x0.AuxInt) 11907 if auxToSym(x0.Aux) != s { 11908 continue 11909 } 11910 _ = x0.Args[1] 11911 if p != x0.Args[0] || mem != x0.Args[1] || !(!config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)) { 11912 continue 11913 } 11914 b = mergePoint(b, x0, x1, x2) 11915 v0 := b.NewValue0(x0.Pos, OpPPC64MOVWZload, t) 11916 v.copyOf(v0) 11917 v0.AuxInt = int32ToAuxInt(i0) 11918 v0.Aux = symToAux(s) 11919 v0.AddArg2(p, mem) 11920 return true 11921 } 11922 } 11923 break 11924 } 11925 // match: (OR <t> s1:(SLWconst x2:(MOVBZload [i0] {s} p mem) [24]) o0:(OR <t> s0:(SLWconst x1:(MOVBZload [i1] {s} p mem) [16]) x0:(MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i2] {s} p) mem))) 11926 // cond: !config.BigEndian && i1 == i0+1 && i2 == i0+2 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0) 11927 // result: @mergePoint(b,x0,x1,x2) (MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) 11928 for { 11929 t := v.Type 11930 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 11931 s1 := v_0 11932 if s1.Op != OpPPC64SLWconst || auxIntToInt64(s1.AuxInt) != 24 { 11933 continue 11934 } 11935 x2 := s1.Args[0] 11936 if x2.Op != OpPPC64MOVBZload { 11937 continue 11938 } 11939 i0 := auxIntToInt32(x2.AuxInt) 11940 s := auxToSym(x2.Aux) 11941 mem := x2.Args[1] 11942 p := x2.Args[0] 11943 o0 := v_1 11944 if o0.Op != OpPPC64OR || o0.Type != t { 11945 continue 11946 } 11947 _ = o0.Args[1] 11948 o0_0 := o0.Args[0] 11949 o0_1 := o0.Args[1] 11950 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 { 11951 s0 := o0_0 11952 if s0.Op != OpPPC64SLWconst || auxIntToInt64(s0.AuxInt) != 16 { 11953 continue 11954 } 11955 x1 := s0.Args[0] 11956 if x1.Op != OpPPC64MOVBZload { 11957 continue 11958 } 11959 i1 := auxIntToInt32(x1.AuxInt) 11960 if auxToSym(x1.Aux) != s { 11961 continue 11962 } 11963 _ = x1.Args[1] 11964 if p != x1.Args[0] || mem != x1.Args[1] { 11965 continue 11966 } 11967 x0 := o0_1 11968 if x0.Op != OpPPC64MOVHBRload || x0.Type != t { 11969 continue 11970 } 11971 _ = x0.Args[1] 11972 x0_0 := x0.Args[0] 11973 if x0_0.Op != OpPPC64MOVDaddr || x0_0.Type != typ.Uintptr { 11974 continue 11975 } 11976 i2 := auxIntToInt32(x0_0.AuxInt) 11977 if auxToSym(x0_0.Aux) != s || p != x0_0.Args[0] || mem != x0.Args[1] || !(!config.BigEndian && i1 == i0+1 && i2 == i0+2 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)) { 11978 continue 11979 } 11980 b = mergePoint(b, x0, x1, x2) 11981 v0 := b.NewValue0(x0.Pos, OpPPC64MOVWBRload, t) 11982 v.copyOf(v0) 11983 v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) 11984 v1.AuxInt = int32ToAuxInt(i0) 11985 v1.Aux = symToAux(s) 11986 v1.AddArg(p) 11987 v0.AddArg2(v1, mem) 11988 return true 11989 } 11990 } 11991 break 11992 } 11993 // match: (OR <t> s1:(SLDconst x2:(MOVBZload [i0] {s} p mem) [24]) o0:(OR <t> s0:(SLDconst x1:(MOVBZload [i1] {s} p mem) [16]) x0:(MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i2] {s} p) mem))) 11994 // cond: !config.BigEndian && i1 == i0+1 && i2 == i0+2 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0) 11995 // result: @mergePoint(b,x0,x1,x2) (MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) 11996 for { 11997 t := v.Type 11998 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 11999 s1 := v_0 12000 if s1.Op != OpPPC64SLDconst || auxIntToInt64(s1.AuxInt) != 24 { 12001 continue 12002 } 12003 x2 := s1.Args[0] 12004 if x2.Op != OpPPC64MOVBZload { 12005 continue 12006 } 12007 i0 := auxIntToInt32(x2.AuxInt) 12008 s := auxToSym(x2.Aux) 12009 mem := x2.Args[1] 12010 p := x2.Args[0] 12011 o0 := v_1 12012 if o0.Op != OpPPC64OR || o0.Type != t { 12013 continue 12014 } 12015 _ = o0.Args[1] 12016 o0_0 := o0.Args[0] 12017 o0_1 := o0.Args[1] 12018 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 { 12019 s0 := o0_0 12020 if s0.Op != OpPPC64SLDconst || auxIntToInt64(s0.AuxInt) != 16 { 12021 continue 12022 } 12023 x1 := s0.Args[0] 12024 if x1.Op != OpPPC64MOVBZload { 12025 continue 12026 } 12027 i1 := auxIntToInt32(x1.AuxInt) 12028 if auxToSym(x1.Aux) != s { 12029 continue 12030 } 12031 _ = x1.Args[1] 12032 if p != x1.Args[0] || mem != x1.Args[1] { 12033 continue 12034 } 12035 x0 := o0_1 12036 if x0.Op != OpPPC64MOVHBRload || x0.Type != t { 12037 continue 12038 } 12039 _ = x0.Args[1] 12040 x0_0 := x0.Args[0] 12041 if x0_0.Op != OpPPC64MOVDaddr || x0_0.Type != typ.Uintptr { 12042 continue 12043 } 12044 i2 := auxIntToInt32(x0_0.AuxInt) 12045 if auxToSym(x0_0.Aux) != s || p != x0_0.Args[0] || mem != x0.Args[1] || !(!config.BigEndian && i1 == i0+1 && i2 == i0+2 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)) { 12046 continue 12047 } 12048 b = mergePoint(b, x0, x1, x2) 12049 v0 := b.NewValue0(x0.Pos, OpPPC64MOVWBRload, t) 12050 v.copyOf(v0) 12051 v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) 12052 v1.AuxInt = int32ToAuxInt(i0) 12053 v1.Aux = symToAux(s) 12054 v1.AddArg(p) 12055 v0.AddArg2(v1, mem) 12056 return true 12057 } 12058 } 12059 break 12060 } 12061 // match: (OR <t> x0:(MOVBZload [i3] {s} p mem) o0:(OR <t> s0:(SLWconst x1:(MOVBZload [i2] {s} p mem) [8]) s1:(SLWconst x2:(MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [16]))) 12062 // cond: !config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0) 12063 // result: @mergePoint(b,x0,x1,x2) (MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) 12064 for { 12065 t := v.Type 12066 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 12067 x0 := v_0 12068 if x0.Op != OpPPC64MOVBZload { 12069 continue 12070 } 12071 i3 := auxIntToInt32(x0.AuxInt) 12072 s := auxToSym(x0.Aux) 12073 mem := x0.Args[1] 12074 p := x0.Args[0] 12075 o0 := v_1 12076 if o0.Op != OpPPC64OR || o0.Type != t { 12077 continue 12078 } 12079 _ = o0.Args[1] 12080 o0_0 := o0.Args[0] 12081 o0_1 := o0.Args[1] 12082 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 { 12083 s0 := o0_0 12084 if s0.Op != OpPPC64SLWconst || auxIntToInt64(s0.AuxInt) != 8 { 12085 continue 12086 } 12087 x1 := s0.Args[0] 12088 if x1.Op != OpPPC64MOVBZload { 12089 continue 12090 } 12091 i2 := auxIntToInt32(x1.AuxInt) 12092 if auxToSym(x1.Aux) != s { 12093 continue 12094 } 12095 _ = x1.Args[1] 12096 if p != x1.Args[0] || mem != x1.Args[1] { 12097 continue 12098 } 12099 s1 := o0_1 12100 if s1.Op != OpPPC64SLWconst || auxIntToInt64(s1.AuxInt) != 16 { 12101 continue 12102 } 12103 x2 := s1.Args[0] 12104 if x2.Op != OpPPC64MOVHBRload || x2.Type != t { 12105 continue 12106 } 12107 _ = x2.Args[1] 12108 x2_0 := x2.Args[0] 12109 if x2_0.Op != OpPPC64MOVDaddr || x2_0.Type != typ.Uintptr { 12110 continue 12111 } 12112 i0 := auxIntToInt32(x2_0.AuxInt) 12113 if auxToSym(x2_0.Aux) != s || p != x2_0.Args[0] || mem != x2.Args[1] || !(!config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)) { 12114 continue 12115 } 12116 b = mergePoint(b, x0, x1, x2) 12117 v0 := b.NewValue0(x2.Pos, OpPPC64MOVWBRload, t) 12118 v.copyOf(v0) 12119 v1 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr) 12120 v1.AuxInt = int32ToAuxInt(i0) 12121 v1.Aux = symToAux(s) 12122 v1.AddArg(p) 12123 v0.AddArg2(v1, mem) 12124 return true 12125 } 12126 } 12127 break 12128 } 12129 // match: (OR <t> x0:(MOVBZload [i3] {s} p mem) o0:(OR <t> s0:(SLDconst x1:(MOVBZload [i2] {s} p mem) [8]) s1:(SLDconst x2:(MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [16]))) 12130 // cond: !config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0) 12131 // result: @mergePoint(b,x0,x1,x2) (MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) 12132 for { 12133 t := v.Type 12134 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 12135 x0 := v_0 12136 if x0.Op != OpPPC64MOVBZload { 12137 continue 12138 } 12139 i3 := auxIntToInt32(x0.AuxInt) 12140 s := auxToSym(x0.Aux) 12141 mem := x0.Args[1] 12142 p := x0.Args[0] 12143 o0 := v_1 12144 if o0.Op != OpPPC64OR || o0.Type != t { 12145 continue 12146 } 12147 _ = o0.Args[1] 12148 o0_0 := o0.Args[0] 12149 o0_1 := o0.Args[1] 12150 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 { 12151 s0 := o0_0 12152 if s0.Op != OpPPC64SLDconst || auxIntToInt64(s0.AuxInt) != 8 { 12153 continue 12154 } 12155 x1 := s0.Args[0] 12156 if x1.Op != OpPPC64MOVBZload { 12157 continue 12158 } 12159 i2 := auxIntToInt32(x1.AuxInt) 12160 if auxToSym(x1.Aux) != s { 12161 continue 12162 } 12163 _ = x1.Args[1] 12164 if p != x1.Args[0] || mem != x1.Args[1] { 12165 continue 12166 } 12167 s1 := o0_1 12168 if s1.Op != OpPPC64SLDconst || auxIntToInt64(s1.AuxInt) != 16 { 12169 continue 12170 } 12171 x2 := s1.Args[0] 12172 if x2.Op != OpPPC64MOVHBRload || x2.Type != t { 12173 continue 12174 } 12175 _ = x2.Args[1] 12176 x2_0 := x2.Args[0] 12177 if x2_0.Op != OpPPC64MOVDaddr || x2_0.Type != typ.Uintptr { 12178 continue 12179 } 12180 i0 := auxIntToInt32(x2_0.AuxInt) 12181 if auxToSym(x2_0.Aux) != s || p != x2_0.Args[0] || mem != x2.Args[1] || !(!config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)) { 12182 continue 12183 } 12184 b = mergePoint(b, x0, x1, x2) 12185 v0 := b.NewValue0(x2.Pos, OpPPC64MOVWBRload, t) 12186 v.copyOf(v0) 12187 v1 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr) 12188 v1.AuxInt = int32ToAuxInt(i0) 12189 v1.Aux = symToAux(s) 12190 v1.AddArg(p) 12191 v0.AddArg2(v1, mem) 12192 return true 12193 } 12194 } 12195 break 12196 } 12197 // match: (OR <t> s2:(SLDconst x2:(MOVBZload [i3] {s} p mem) [32]) o0:(OR <t> s1:(SLDconst x1:(MOVBZload [i2] {s} p mem) [40]) s0:(SLDconst x0:(MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [48]))) 12198 // cond: !config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && s2.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, s2, o0) 12199 // result: @mergePoint(b,x0,x1,x2) (SLDconst <t> (MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [32]) 12200 for { 12201 t := v.Type 12202 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 12203 s2 := v_0 12204 if s2.Op != OpPPC64SLDconst || auxIntToInt64(s2.AuxInt) != 32 { 12205 continue 12206 } 12207 x2 := s2.Args[0] 12208 if x2.Op != OpPPC64MOVBZload { 12209 continue 12210 } 12211 i3 := auxIntToInt32(x2.AuxInt) 12212 s := auxToSym(x2.Aux) 12213 mem := x2.Args[1] 12214 p := x2.Args[0] 12215 o0 := v_1 12216 if o0.Op != OpPPC64OR || o0.Type != t { 12217 continue 12218 } 12219 _ = o0.Args[1] 12220 o0_0 := o0.Args[0] 12221 o0_1 := o0.Args[1] 12222 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 { 12223 s1 := o0_0 12224 if s1.Op != OpPPC64SLDconst || auxIntToInt64(s1.AuxInt) != 40 { 12225 continue 12226 } 12227 x1 := s1.Args[0] 12228 if x1.Op != OpPPC64MOVBZload { 12229 continue 12230 } 12231 i2 := auxIntToInt32(x1.AuxInt) 12232 if auxToSym(x1.Aux) != s { 12233 continue 12234 } 12235 _ = x1.Args[1] 12236 if p != x1.Args[0] || mem != x1.Args[1] { 12237 continue 12238 } 12239 s0 := o0_1 12240 if s0.Op != OpPPC64SLDconst || auxIntToInt64(s0.AuxInt) != 48 { 12241 continue 12242 } 12243 x0 := s0.Args[0] 12244 if x0.Op != OpPPC64MOVHBRload || x0.Type != t { 12245 continue 12246 } 12247 _ = x0.Args[1] 12248 x0_0 := x0.Args[0] 12249 if x0_0.Op != OpPPC64MOVDaddr || x0_0.Type != typ.Uintptr { 12250 continue 12251 } 12252 i0 := auxIntToInt32(x0_0.AuxInt) 12253 if auxToSym(x0_0.Aux) != s || p != x0_0.Args[0] || mem != x0.Args[1] || !(!config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && s2.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, s2, o0)) { 12254 continue 12255 } 12256 b = mergePoint(b, x0, x1, x2) 12257 v0 := b.NewValue0(x0.Pos, OpPPC64SLDconst, t) 12258 v.copyOf(v0) 12259 v0.AuxInt = int64ToAuxInt(32) 12260 v1 := b.NewValue0(x0.Pos, OpPPC64MOVWBRload, t) 12261 v2 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) 12262 v2.AuxInt = int32ToAuxInt(i0) 12263 v2.Aux = symToAux(s) 12264 v2.AddArg(p) 12265 v1.AddArg2(v2, mem) 12266 v0.AddArg(v1) 12267 return true 12268 } 12269 } 12270 break 12271 } 12272 // match: (OR <t> s2:(SLDconst x2:(MOVBZload [i0] {s} p mem) [56]) o0:(OR <t> s1:(SLDconst x1:(MOVBZload [i1] {s} p mem) [48]) s0:(SLDconst x0:(MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i2] {s} p) mem) [32]))) 12273 // cond: !config.BigEndian && i1 == i0+1 && i2 == i0+2 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && s2.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, s2, o0) 12274 // result: @mergePoint(b,x0,x1,x2) (SLDconst <t> (MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [32]) 12275 for { 12276 t := v.Type 12277 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 12278 s2 := v_0 12279 if s2.Op != OpPPC64SLDconst || auxIntToInt64(s2.AuxInt) != 56 { 12280 continue 12281 } 12282 x2 := s2.Args[0] 12283 if x2.Op != OpPPC64MOVBZload { 12284 continue 12285 } 12286 i0 := auxIntToInt32(x2.AuxInt) 12287 s := auxToSym(x2.Aux) 12288 mem := x2.Args[1] 12289 p := x2.Args[0] 12290 o0 := v_1 12291 if o0.Op != OpPPC64OR || o0.Type != t { 12292 continue 12293 } 12294 _ = o0.Args[1] 12295 o0_0 := o0.Args[0] 12296 o0_1 := o0.Args[1] 12297 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 { 12298 s1 := o0_0 12299 if s1.Op != OpPPC64SLDconst || auxIntToInt64(s1.AuxInt) != 48 { 12300 continue 12301 } 12302 x1 := s1.Args[0] 12303 if x1.Op != OpPPC64MOVBZload { 12304 continue 12305 } 12306 i1 := auxIntToInt32(x1.AuxInt) 12307 if auxToSym(x1.Aux) != s { 12308 continue 12309 } 12310 _ = x1.Args[1] 12311 if p != x1.Args[0] || mem != x1.Args[1] { 12312 continue 12313 } 12314 s0 := o0_1 12315 if s0.Op != OpPPC64SLDconst || auxIntToInt64(s0.AuxInt) != 32 { 12316 continue 12317 } 12318 x0 := s0.Args[0] 12319 if x0.Op != OpPPC64MOVHBRload || x0.Type != t { 12320 continue 12321 } 12322 _ = x0.Args[1] 12323 x0_0 := x0.Args[0] 12324 if x0_0.Op != OpPPC64MOVDaddr || x0_0.Type != typ.Uintptr { 12325 continue 12326 } 12327 i2 := auxIntToInt32(x0_0.AuxInt) 12328 if auxToSym(x0_0.Aux) != s || p != x0_0.Args[0] || mem != x0.Args[1] || !(!config.BigEndian && i1 == i0+1 && i2 == i0+2 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && s2.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, s2, o0)) { 12329 continue 12330 } 12331 b = mergePoint(b, x0, x1, x2) 12332 v0 := b.NewValue0(x0.Pos, OpPPC64SLDconst, t) 12333 v.copyOf(v0) 12334 v0.AuxInt = int64ToAuxInt(32) 12335 v1 := b.NewValue0(x0.Pos, OpPPC64MOVWBRload, t) 12336 v2 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) 12337 v2.AuxInt = int32ToAuxInt(i0) 12338 v2.Aux = symToAux(s) 12339 v2.AddArg(p) 12340 v1.AddArg2(v2, mem) 12341 v0.AddArg(v1) 12342 return true 12343 } 12344 } 12345 break 12346 } 12347 // match: (OR <t> s6:(SLDconst x7:(MOVBZload [i7] {s} p mem) [56]) o5:(OR <t> s5:(SLDconst x6:(MOVBZload [i6] {s} p mem) [48]) o4:(OR <t> s4:(SLDconst x5:(MOVBZload [i5] {s} p mem) [40]) o3:(OR <t> s3:(SLDconst x4:(MOVBZload [i4] {s} p mem) [32]) x0:(MOVWZload {s} [i0] p mem))))) 12348 // cond: !config.BigEndian && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && x0.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses ==1 && x7.Uses == 1 && o3.Uses == 1 && o4.Uses == 1 && o5.Uses == 1 && s3.Uses == 1 && s4.Uses == 1 && s5.Uses == 1 && s6.Uses == 1 && mergePoint(b, x0, x4, x5, x6, x7) != nil && clobber(x0, x4, x5, x6, x7, s3, s4, s5, s6, o3, o4, o5) 12349 // result: @mergePoint(b,x0,x4,x5,x6,x7) (MOVDload <t> {s} [i0] p mem) 12350 for { 12351 t := v.Type 12352 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 12353 s6 := v_0 12354 if s6.Op != OpPPC64SLDconst || auxIntToInt64(s6.AuxInt) != 56 { 12355 continue 12356 } 12357 x7 := s6.Args[0] 12358 if x7.Op != OpPPC64MOVBZload { 12359 continue 12360 } 12361 i7 := auxIntToInt32(x7.AuxInt) 12362 s := auxToSym(x7.Aux) 12363 mem := x7.Args[1] 12364 p := x7.Args[0] 12365 o5 := v_1 12366 if o5.Op != OpPPC64OR || o5.Type != t { 12367 continue 12368 } 12369 _ = o5.Args[1] 12370 o5_0 := o5.Args[0] 12371 o5_1 := o5.Args[1] 12372 for _i1 := 0; _i1 <= 1; _i1, o5_0, o5_1 = _i1+1, o5_1, o5_0 { 12373 s5 := o5_0 12374 if s5.Op != OpPPC64SLDconst || auxIntToInt64(s5.AuxInt) != 48 { 12375 continue 12376 } 12377 x6 := s5.Args[0] 12378 if x6.Op != OpPPC64MOVBZload { 12379 continue 12380 } 12381 i6 := auxIntToInt32(x6.AuxInt) 12382 if auxToSym(x6.Aux) != s { 12383 continue 12384 } 12385 _ = x6.Args[1] 12386 if p != x6.Args[0] || mem != x6.Args[1] { 12387 continue 12388 } 12389 o4 := o5_1 12390 if o4.Op != OpPPC64OR || o4.Type != t { 12391 continue 12392 } 12393 _ = o4.Args[1] 12394 o4_0 := o4.Args[0] 12395 o4_1 := o4.Args[1] 12396 for _i2 := 0; _i2 <= 1; _i2, o4_0, o4_1 = _i2+1, o4_1, o4_0 { 12397 s4 := o4_0 12398 if s4.Op != OpPPC64SLDconst || auxIntToInt64(s4.AuxInt) != 40 { 12399 continue 12400 } 12401 x5 := s4.Args[0] 12402 if x5.Op != OpPPC64MOVBZload { 12403 continue 12404 } 12405 i5 := auxIntToInt32(x5.AuxInt) 12406 if auxToSym(x5.Aux) != s { 12407 continue 12408 } 12409 _ = x5.Args[1] 12410 if p != x5.Args[0] || mem != x5.Args[1] { 12411 continue 12412 } 12413 o3 := o4_1 12414 if o3.Op != OpPPC64OR || o3.Type != t { 12415 continue 12416 } 12417 _ = o3.Args[1] 12418 o3_0 := o3.Args[0] 12419 o3_1 := o3.Args[1] 12420 for _i3 := 0; _i3 <= 1; _i3, o3_0, o3_1 = _i3+1, o3_1, o3_0 { 12421 s3 := o3_0 12422 if s3.Op != OpPPC64SLDconst || auxIntToInt64(s3.AuxInt) != 32 { 12423 continue 12424 } 12425 x4 := s3.Args[0] 12426 if x4.Op != OpPPC64MOVBZload { 12427 continue 12428 } 12429 i4 := auxIntToInt32(x4.AuxInt) 12430 if auxToSym(x4.Aux) != s { 12431 continue 12432 } 12433 _ = x4.Args[1] 12434 if p != x4.Args[0] || mem != x4.Args[1] { 12435 continue 12436 } 12437 x0 := o3_1 12438 if x0.Op != OpPPC64MOVWZload { 12439 continue 12440 } 12441 i0 := auxIntToInt32(x0.AuxInt) 12442 if auxToSym(x0.Aux) != s { 12443 continue 12444 } 12445 _ = x0.Args[1] 12446 if p != x0.Args[0] || mem != x0.Args[1] || !(!config.BigEndian && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && x0.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses == 1 && x7.Uses == 1 && o3.Uses == 1 && o4.Uses == 1 && o5.Uses == 1 && s3.Uses == 1 && s4.Uses == 1 && s5.Uses == 1 && s6.Uses == 1 && mergePoint(b, x0, x4, x5, x6, x7) != nil && clobber(x0, x4, x5, x6, x7, s3, s4, s5, s6, o3, o4, o5)) { 12447 continue 12448 } 12449 b = mergePoint(b, x0, x4, x5, x6, x7) 12450 v0 := b.NewValue0(x0.Pos, OpPPC64MOVDload, t) 12451 v.copyOf(v0) 12452 v0.AuxInt = int32ToAuxInt(i0) 12453 v0.Aux = symToAux(s) 12454 v0.AddArg2(p, mem) 12455 return true 12456 } 12457 } 12458 } 12459 } 12460 break 12461 } 12462 // match: (OR <t> s0:(SLDconst x0:(MOVBZload [i0] {s} p mem) [56]) o0:(OR <t> s1:(SLDconst x1:(MOVBZload [i1] {s} p mem) [48]) o1:(OR <t> s2:(SLDconst x2:(MOVBZload [i2] {s} p mem) [40]) o2:(OR <t> s3:(SLDconst x3:(MOVBZload [i3] {s} p mem) [32]) x4:(MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i4] p) mem))))) 12463 // cond: !config.BigEndian && i1 == i0+1 && i2 == i0+2 && i3 == i0+3 && i4 == i0+4 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && x3.Uses == 1 && x4.Uses == 1 && o0.Uses == 1 && o1.Uses == 1 && o2.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && mergePoint(b, x0, x1, x2, x3, x4) != nil && clobber(x0, x1, x2, x3, x4, o0, o1, o2, s0, s1, s2, s3) 12464 // result: @mergePoint(b,x0,x1,x2,x3,x4) (MOVDBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) 12465 for { 12466 t := v.Type 12467 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 12468 s0 := v_0 12469 if s0.Op != OpPPC64SLDconst || auxIntToInt64(s0.AuxInt) != 56 { 12470 continue 12471 } 12472 x0 := s0.Args[0] 12473 if x0.Op != OpPPC64MOVBZload { 12474 continue 12475 } 12476 i0 := auxIntToInt32(x0.AuxInt) 12477 s := auxToSym(x0.Aux) 12478 mem := x0.Args[1] 12479 p := x0.Args[0] 12480 o0 := v_1 12481 if o0.Op != OpPPC64OR || o0.Type != t { 12482 continue 12483 } 12484 _ = o0.Args[1] 12485 o0_0 := o0.Args[0] 12486 o0_1 := o0.Args[1] 12487 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 { 12488 s1 := o0_0 12489 if s1.Op != OpPPC64SLDconst || auxIntToInt64(s1.AuxInt) != 48 { 12490 continue 12491 } 12492 x1 := s1.Args[0] 12493 if x1.Op != OpPPC64MOVBZload { 12494 continue 12495 } 12496 i1 := auxIntToInt32(x1.AuxInt) 12497 if auxToSym(x1.Aux) != s { 12498 continue 12499 } 12500 _ = x1.Args[1] 12501 if p != x1.Args[0] || mem != x1.Args[1] { 12502 continue 12503 } 12504 o1 := o0_1 12505 if o1.Op != OpPPC64OR || o1.Type != t { 12506 continue 12507 } 12508 _ = o1.Args[1] 12509 o1_0 := o1.Args[0] 12510 o1_1 := o1.Args[1] 12511 for _i2 := 0; _i2 <= 1; _i2, o1_0, o1_1 = _i2+1, o1_1, o1_0 { 12512 s2 := o1_0 12513 if s2.Op != OpPPC64SLDconst || auxIntToInt64(s2.AuxInt) != 40 { 12514 continue 12515 } 12516 x2 := s2.Args[0] 12517 if x2.Op != OpPPC64MOVBZload { 12518 continue 12519 } 12520 i2 := auxIntToInt32(x2.AuxInt) 12521 if auxToSym(x2.Aux) != s { 12522 continue 12523 } 12524 _ = x2.Args[1] 12525 if p != x2.Args[0] || mem != x2.Args[1] { 12526 continue 12527 } 12528 o2 := o1_1 12529 if o2.Op != OpPPC64OR || o2.Type != t { 12530 continue 12531 } 12532 _ = o2.Args[1] 12533 o2_0 := o2.Args[0] 12534 o2_1 := o2.Args[1] 12535 for _i3 := 0; _i3 <= 1; _i3, o2_0, o2_1 = _i3+1, o2_1, o2_0 { 12536 s3 := o2_0 12537 if s3.Op != OpPPC64SLDconst || auxIntToInt64(s3.AuxInt) != 32 { 12538 continue 12539 } 12540 x3 := s3.Args[0] 12541 if x3.Op != OpPPC64MOVBZload { 12542 continue 12543 } 12544 i3 := auxIntToInt32(x3.AuxInt) 12545 if auxToSym(x3.Aux) != s { 12546 continue 12547 } 12548 _ = x3.Args[1] 12549 if p != x3.Args[0] || mem != x3.Args[1] { 12550 continue 12551 } 12552 x4 := o2_1 12553 if x4.Op != OpPPC64MOVWBRload || x4.Type != t { 12554 continue 12555 } 12556 _ = x4.Args[1] 12557 x4_0 := x4.Args[0] 12558 if x4_0.Op != OpPPC64MOVDaddr || x4_0.Type != typ.Uintptr { 12559 continue 12560 } 12561 i4 := auxIntToInt32(x4_0.AuxInt) 12562 if p != x4_0.Args[0] || mem != x4.Args[1] || !(!config.BigEndian && i1 == i0+1 && i2 == i0+2 && i3 == i0+3 && i4 == i0+4 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && x3.Uses == 1 && x4.Uses == 1 && o0.Uses == 1 && o1.Uses == 1 && o2.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && mergePoint(b, x0, x1, x2, x3, x4) != nil && clobber(x0, x1, x2, x3, x4, o0, o1, o2, s0, s1, s2, s3)) { 12563 continue 12564 } 12565 b = mergePoint(b, x0, x1, x2, x3, x4) 12566 v0 := b.NewValue0(x4.Pos, OpPPC64MOVDBRload, t) 12567 v.copyOf(v0) 12568 v1 := b.NewValue0(x4.Pos, OpPPC64MOVDaddr, typ.Uintptr) 12569 v1.AuxInt = int32ToAuxInt(i0) 12570 v1.Aux = symToAux(s) 12571 v1.AddArg(p) 12572 v0.AddArg2(v1, mem) 12573 return true 12574 } 12575 } 12576 } 12577 } 12578 break 12579 } 12580 // match: (OR <t> x7:(MOVBZload [i7] {s} p mem) o5:(OR <t> s6:(SLDconst x6:(MOVBZload [i6] {s} p mem) [8]) o4:(OR <t> s5:(SLDconst x5:(MOVBZload [i5] {s} p mem) [16]) o3:(OR <t> s4:(SLDconst x4:(MOVBZload [i4] {s} p mem) [24]) s0:(SLWconst x3:(MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [32]))))) 12581 // cond: !config.BigEndian && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && x3.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses == 1 && x7.Uses == 1 && o3.Uses == 1 && o4.Uses == 1 && o5.Uses == 1 && s0.Uses == 1 && s4.Uses == 1 && s5.Uses == 1 && s6.Uses == 1 && mergePoint(b, x3, x4, x5, x6, x7) != nil && clobber(x3, x4, x5, x6, x7, o3, o4, o5, s0, s4, s5, s6) 12582 // result: @mergePoint(b,x3,x4,x5,x6,x7) (MOVDBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) 12583 for { 12584 t := v.Type 12585 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 12586 x7 := v_0 12587 if x7.Op != OpPPC64MOVBZload { 12588 continue 12589 } 12590 i7 := auxIntToInt32(x7.AuxInt) 12591 s := auxToSym(x7.Aux) 12592 mem := x7.Args[1] 12593 p := x7.Args[0] 12594 o5 := v_1 12595 if o5.Op != OpPPC64OR || o5.Type != t { 12596 continue 12597 } 12598 _ = o5.Args[1] 12599 o5_0 := o5.Args[0] 12600 o5_1 := o5.Args[1] 12601 for _i1 := 0; _i1 <= 1; _i1, o5_0, o5_1 = _i1+1, o5_1, o5_0 { 12602 s6 := o5_0 12603 if s6.Op != OpPPC64SLDconst || auxIntToInt64(s6.AuxInt) != 8 { 12604 continue 12605 } 12606 x6 := s6.Args[0] 12607 if x6.Op != OpPPC64MOVBZload { 12608 continue 12609 } 12610 i6 := auxIntToInt32(x6.AuxInt) 12611 if auxToSym(x6.Aux) != s { 12612 continue 12613 } 12614 _ = x6.Args[1] 12615 if p != x6.Args[0] || mem != x6.Args[1] { 12616 continue 12617 } 12618 o4 := o5_1 12619 if o4.Op != OpPPC64OR || o4.Type != t { 12620 continue 12621 } 12622 _ = o4.Args[1] 12623 o4_0 := o4.Args[0] 12624 o4_1 := o4.Args[1] 12625 for _i2 := 0; _i2 <= 1; _i2, o4_0, o4_1 = _i2+1, o4_1, o4_0 { 12626 s5 := o4_0 12627 if s5.Op != OpPPC64SLDconst || auxIntToInt64(s5.AuxInt) != 16 { 12628 continue 12629 } 12630 x5 := s5.Args[0] 12631 if x5.Op != OpPPC64MOVBZload { 12632 continue 12633 } 12634 i5 := auxIntToInt32(x5.AuxInt) 12635 if auxToSym(x5.Aux) != s { 12636 continue 12637 } 12638 _ = x5.Args[1] 12639 if p != x5.Args[0] || mem != x5.Args[1] { 12640 continue 12641 } 12642 o3 := o4_1 12643 if o3.Op != OpPPC64OR || o3.Type != t { 12644 continue 12645 } 12646 _ = o3.Args[1] 12647 o3_0 := o3.Args[0] 12648 o3_1 := o3.Args[1] 12649 for _i3 := 0; _i3 <= 1; _i3, o3_0, o3_1 = _i3+1, o3_1, o3_0 { 12650 s4 := o3_0 12651 if s4.Op != OpPPC64SLDconst || auxIntToInt64(s4.AuxInt) != 24 { 12652 continue 12653 } 12654 x4 := s4.Args[0] 12655 if x4.Op != OpPPC64MOVBZload { 12656 continue 12657 } 12658 i4 := auxIntToInt32(x4.AuxInt) 12659 if auxToSym(x4.Aux) != s { 12660 continue 12661 } 12662 _ = x4.Args[1] 12663 if p != x4.Args[0] || mem != x4.Args[1] { 12664 continue 12665 } 12666 s0 := o3_1 12667 if s0.Op != OpPPC64SLWconst || auxIntToInt64(s0.AuxInt) != 32 { 12668 continue 12669 } 12670 x3 := s0.Args[0] 12671 if x3.Op != OpPPC64MOVWBRload || x3.Type != t { 12672 continue 12673 } 12674 _ = x3.Args[1] 12675 x3_0 := x3.Args[0] 12676 if x3_0.Op != OpPPC64MOVDaddr || x3_0.Type != typ.Uintptr { 12677 continue 12678 } 12679 i0 := auxIntToInt32(x3_0.AuxInt) 12680 if auxToSym(x3_0.Aux) != s || p != x3_0.Args[0] || mem != x3.Args[1] || !(!config.BigEndian && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && x3.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses == 1 && x7.Uses == 1 && o3.Uses == 1 && o4.Uses == 1 && o5.Uses == 1 && s0.Uses == 1 && s4.Uses == 1 && s5.Uses == 1 && s6.Uses == 1 && mergePoint(b, x3, x4, x5, x6, x7) != nil && clobber(x3, x4, x5, x6, x7, o3, o4, o5, s0, s4, s5, s6)) { 12681 continue 12682 } 12683 b = mergePoint(b, x3, x4, x5, x6, x7) 12684 v0 := b.NewValue0(x3.Pos, OpPPC64MOVDBRload, t) 12685 v.copyOf(v0) 12686 v1 := b.NewValue0(x3.Pos, OpPPC64MOVDaddr, typ.Uintptr) 12687 v1.AuxInt = int32ToAuxInt(i0) 12688 v1.Aux = symToAux(s) 12689 v1.AddArg(p) 12690 v0.AddArg2(v1, mem) 12691 return true 12692 } 12693 } 12694 } 12695 } 12696 break 12697 } 12698 // match: (OR <t> x7:(MOVBZload [i7] {s} p mem) o5:(OR <t> s6:(SLDconst x6:(MOVBZload [i6] {s} p mem) [8]) o4:(OR <t> s5:(SLDconst x5:(MOVBZload [i5] {s} p mem) [16]) o3:(OR <t> s4:(SLDconst x4:(MOVBZload [i4] {s} p mem) [24]) s0:(SLDconst x3:(MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [32]))))) 12699 // cond: !config.BigEndian && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && x3.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses == 1 && x7.Uses == 1 && o3.Uses == 1 && o4.Uses == 1 && o5.Uses == 1 && s0.Uses == 1 && s4.Uses == 1 && s5.Uses == 1 && s6.Uses == 1 && mergePoint(b, x3, x4, x5, x6, x7) != nil && clobber(x3, x4, x5, x6, x7, o3, o4, o5, s0, s4, s5, s6) 12700 // result: @mergePoint(b,x3,x4,x5,x6,x7) (MOVDBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) 12701 for { 12702 t := v.Type 12703 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 12704 x7 := v_0 12705 if x7.Op != OpPPC64MOVBZload { 12706 continue 12707 } 12708 i7 := auxIntToInt32(x7.AuxInt) 12709 s := auxToSym(x7.Aux) 12710 mem := x7.Args[1] 12711 p := x7.Args[0] 12712 o5 := v_1 12713 if o5.Op != OpPPC64OR || o5.Type != t { 12714 continue 12715 } 12716 _ = o5.Args[1] 12717 o5_0 := o5.Args[0] 12718 o5_1 := o5.Args[1] 12719 for _i1 := 0; _i1 <= 1; _i1, o5_0, o5_1 = _i1+1, o5_1, o5_0 { 12720 s6 := o5_0 12721 if s6.Op != OpPPC64SLDconst || auxIntToInt64(s6.AuxInt) != 8 { 12722 continue 12723 } 12724 x6 := s6.Args[0] 12725 if x6.Op != OpPPC64MOVBZload { 12726 continue 12727 } 12728 i6 := auxIntToInt32(x6.AuxInt) 12729 if auxToSym(x6.Aux) != s { 12730 continue 12731 } 12732 _ = x6.Args[1] 12733 if p != x6.Args[0] || mem != x6.Args[1] { 12734 continue 12735 } 12736 o4 := o5_1 12737 if o4.Op != OpPPC64OR || o4.Type != t { 12738 continue 12739 } 12740 _ = o4.Args[1] 12741 o4_0 := o4.Args[0] 12742 o4_1 := o4.Args[1] 12743 for _i2 := 0; _i2 <= 1; _i2, o4_0, o4_1 = _i2+1, o4_1, o4_0 { 12744 s5 := o4_0 12745 if s5.Op != OpPPC64SLDconst || auxIntToInt64(s5.AuxInt) != 16 { 12746 continue 12747 } 12748 x5 := s5.Args[0] 12749 if x5.Op != OpPPC64MOVBZload { 12750 continue 12751 } 12752 i5 := auxIntToInt32(x5.AuxInt) 12753 if auxToSym(x5.Aux) != s { 12754 continue 12755 } 12756 _ = x5.Args[1] 12757 if p != x5.Args[0] || mem != x5.Args[1] { 12758 continue 12759 } 12760 o3 := o4_1 12761 if o3.Op != OpPPC64OR || o3.Type != t { 12762 continue 12763 } 12764 _ = o3.Args[1] 12765 o3_0 := o3.Args[0] 12766 o3_1 := o3.Args[1] 12767 for _i3 := 0; _i3 <= 1; _i3, o3_0, o3_1 = _i3+1, o3_1, o3_0 { 12768 s4 := o3_0 12769 if s4.Op != OpPPC64SLDconst || auxIntToInt64(s4.AuxInt) != 24 { 12770 continue 12771 } 12772 x4 := s4.Args[0] 12773 if x4.Op != OpPPC64MOVBZload { 12774 continue 12775 } 12776 i4 := auxIntToInt32(x4.AuxInt) 12777 if auxToSym(x4.Aux) != s { 12778 continue 12779 } 12780 _ = x4.Args[1] 12781 if p != x4.Args[0] || mem != x4.Args[1] { 12782 continue 12783 } 12784 s0 := o3_1 12785 if s0.Op != OpPPC64SLDconst || auxIntToInt64(s0.AuxInt) != 32 { 12786 continue 12787 } 12788 x3 := s0.Args[0] 12789 if x3.Op != OpPPC64MOVWBRload || x3.Type != t { 12790 continue 12791 } 12792 _ = x3.Args[1] 12793 x3_0 := x3.Args[0] 12794 if x3_0.Op != OpPPC64MOVDaddr || x3_0.Type != typ.Uintptr { 12795 continue 12796 } 12797 i0 := auxIntToInt32(x3_0.AuxInt) 12798 if auxToSym(x3_0.Aux) != s || p != x3_0.Args[0] || mem != x3.Args[1] || !(!config.BigEndian && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && x3.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses == 1 && x7.Uses == 1 && o3.Uses == 1 && o4.Uses == 1 && o5.Uses == 1 && s0.Uses == 1 && s4.Uses == 1 && s5.Uses == 1 && s6.Uses == 1 && mergePoint(b, x3, x4, x5, x6, x7) != nil && clobber(x3, x4, x5, x6, x7, o3, o4, o5, s0, s4, s5, s6)) { 12799 continue 12800 } 12801 b = mergePoint(b, x3, x4, x5, x6, x7) 12802 v0 := b.NewValue0(x3.Pos, OpPPC64MOVDBRload, t) 12803 v.copyOf(v0) 12804 v1 := b.NewValue0(x3.Pos, OpPPC64MOVDaddr, typ.Uintptr) 12805 v1.AuxInt = int32ToAuxInt(i0) 12806 v1.Aux = symToAux(s) 12807 v1.AddArg(p) 12808 v0.AddArg2(v1, mem) 12809 return true 12810 } 12811 } 12812 } 12813 } 12814 break 12815 } 12816 return false 12817 } 12818 func rewriteValuePPC64_OpPPC64ORN(v *Value) bool { 12819 v_1 := v.Args[1] 12820 v_0 := v.Args[0] 12821 // match: (ORN x (MOVDconst [-1])) 12822 // result: x 12823 for { 12824 x := v_0 12825 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 { 12826 break 12827 } 12828 v.copyOf(x) 12829 return true 12830 } 12831 // match: (ORN (MOVDconst [c]) (MOVDconst [d])) 12832 // result: (MOVDconst [c|^d]) 12833 for { 12834 if v_0.Op != OpPPC64MOVDconst { 12835 break 12836 } 12837 c := auxIntToInt64(v_0.AuxInt) 12838 if v_1.Op != OpPPC64MOVDconst { 12839 break 12840 } 12841 d := auxIntToInt64(v_1.AuxInt) 12842 v.reset(OpPPC64MOVDconst) 12843 v.AuxInt = int64ToAuxInt(c | ^d) 12844 return true 12845 } 12846 return false 12847 } 12848 func rewriteValuePPC64_OpPPC64ORconst(v *Value) bool { 12849 v_0 := v.Args[0] 12850 // match: (ORconst [c] (ORconst [d] x)) 12851 // result: (ORconst [c|d] x) 12852 for { 12853 c := auxIntToInt64(v.AuxInt) 12854 if v_0.Op != OpPPC64ORconst { 12855 break 12856 } 12857 d := auxIntToInt64(v_0.AuxInt) 12858 x := v_0.Args[0] 12859 v.reset(OpPPC64ORconst) 12860 v.AuxInt = int64ToAuxInt(c | d) 12861 v.AddArg(x) 12862 return true 12863 } 12864 // match: (ORconst [-1] _) 12865 // result: (MOVDconst [-1]) 12866 for { 12867 if auxIntToInt64(v.AuxInt) != -1 { 12868 break 12869 } 12870 v.reset(OpPPC64MOVDconst) 12871 v.AuxInt = int64ToAuxInt(-1) 12872 return true 12873 } 12874 // match: (ORconst [0] x) 12875 // result: x 12876 for { 12877 if auxIntToInt64(v.AuxInt) != 0 { 12878 break 12879 } 12880 x := v_0 12881 v.copyOf(x) 12882 return true 12883 } 12884 return false 12885 } 12886 func rewriteValuePPC64_OpPPC64ROTL(v *Value) bool { 12887 v_1 := v.Args[1] 12888 v_0 := v.Args[0] 12889 // match: (ROTL x (MOVDconst [c])) 12890 // result: (ROTLconst x [c&63]) 12891 for { 12892 x := v_0 12893 if v_1.Op != OpPPC64MOVDconst { 12894 break 12895 } 12896 c := auxIntToInt64(v_1.AuxInt) 12897 v.reset(OpPPC64ROTLconst) 12898 v.AuxInt = int64ToAuxInt(c & 63) 12899 v.AddArg(x) 12900 return true 12901 } 12902 return false 12903 } 12904 func rewriteValuePPC64_OpPPC64ROTLW(v *Value) bool { 12905 v_1 := v.Args[1] 12906 v_0 := v.Args[0] 12907 // match: (ROTLW x (MOVDconst [c])) 12908 // result: (ROTLWconst x [c&31]) 12909 for { 12910 x := v_0 12911 if v_1.Op != OpPPC64MOVDconst { 12912 break 12913 } 12914 c := auxIntToInt64(v_1.AuxInt) 12915 v.reset(OpPPC64ROTLWconst) 12916 v.AuxInt = int64ToAuxInt(c & 31) 12917 v.AddArg(x) 12918 return true 12919 } 12920 return false 12921 } 12922 func rewriteValuePPC64_OpPPC64ROTLWconst(v *Value) bool { 12923 v_0 := v.Args[0] 12924 // match: (ROTLWconst [r] (AND (MOVDconst [m]) x)) 12925 // cond: isPPC64WordRotateMask(m) 12926 // result: (RLWINM [encodePPC64RotateMask(r,rotateLeft32(m,r),32)] x) 12927 for { 12928 r := auxIntToInt64(v.AuxInt) 12929 if v_0.Op != OpPPC64AND { 12930 break 12931 } 12932 _ = v_0.Args[1] 12933 v_0_0 := v_0.Args[0] 12934 v_0_1 := v_0.Args[1] 12935 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 12936 if v_0_0.Op != OpPPC64MOVDconst { 12937 continue 12938 } 12939 m := auxIntToInt64(v_0_0.AuxInt) 12940 x := v_0_1 12941 if !(isPPC64WordRotateMask(m)) { 12942 continue 12943 } 12944 v.reset(OpPPC64RLWINM) 12945 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32)) 12946 v.AddArg(x) 12947 return true 12948 } 12949 break 12950 } 12951 // match: (ROTLWconst [r] (Select0 (ANDCCconst [m] x))) 12952 // cond: isPPC64WordRotateMask(m) 12953 // result: (RLWINM [encodePPC64RotateMask(r,rotateLeft32(m,r),32)] x) 12954 for { 12955 r := auxIntToInt64(v.AuxInt) 12956 if v_0.Op != OpSelect0 { 12957 break 12958 } 12959 v_0_0 := v_0.Args[0] 12960 if v_0_0.Op != OpPPC64ANDCCconst { 12961 break 12962 } 12963 m := auxIntToInt64(v_0_0.AuxInt) 12964 x := v_0_0.Args[0] 12965 if !(isPPC64WordRotateMask(m)) { 12966 break 12967 } 12968 v.reset(OpPPC64RLWINM) 12969 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32)) 12970 v.AddArg(x) 12971 return true 12972 } 12973 return false 12974 } 12975 func rewriteValuePPC64_OpPPC64SLD(v *Value) bool { 12976 v_1 := v.Args[1] 12977 v_0 := v.Args[0] 12978 // match: (SLD x (MOVDconst [c])) 12979 // result: (SLDconst [c&63 | (c>>6&1*63)] x) 12980 for { 12981 x := v_0 12982 if v_1.Op != OpPPC64MOVDconst { 12983 break 12984 } 12985 c := auxIntToInt64(v_1.AuxInt) 12986 v.reset(OpPPC64SLDconst) 12987 v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63)) 12988 v.AddArg(x) 12989 return true 12990 } 12991 return false 12992 } 12993 func rewriteValuePPC64_OpPPC64SLDconst(v *Value) bool { 12994 v_0 := v.Args[0] 12995 // match: (SLDconst [l] (SRWconst [r] x)) 12996 // cond: mergePPC64SldiSrw(l,r) != 0 12997 // result: (RLWINM [mergePPC64SldiSrw(l,r)] x) 12998 for { 12999 l := auxIntToInt64(v.AuxInt) 13000 if v_0.Op != OpPPC64SRWconst { 13001 break 13002 } 13003 r := auxIntToInt64(v_0.AuxInt) 13004 x := v_0.Args[0] 13005 if !(mergePPC64SldiSrw(l, r) != 0) { 13006 break 13007 } 13008 v.reset(OpPPC64RLWINM) 13009 v.AuxInt = int64ToAuxInt(mergePPC64SldiSrw(l, r)) 13010 v.AddArg(x) 13011 return true 13012 } 13013 // match: (SLDconst [c] z:(MOVBZreg x)) 13014 // cond: c < 8 && z.Uses == 1 13015 // result: (CLRLSLDI [newPPC64ShiftAuxInt(c,56,63,64)] x) 13016 for { 13017 c := auxIntToInt64(v.AuxInt) 13018 z := v_0 13019 if z.Op != OpPPC64MOVBZreg { 13020 break 13021 } 13022 x := z.Args[0] 13023 if !(c < 8 && z.Uses == 1) { 13024 break 13025 } 13026 v.reset(OpPPC64CLRLSLDI) 13027 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 56, 63, 64)) 13028 v.AddArg(x) 13029 return true 13030 } 13031 // match: (SLDconst [c] z:(MOVHZreg x)) 13032 // cond: c < 16 && z.Uses == 1 13033 // result: (CLRLSLDI [newPPC64ShiftAuxInt(c,48,63,64)] x) 13034 for { 13035 c := auxIntToInt64(v.AuxInt) 13036 z := v_0 13037 if z.Op != OpPPC64MOVHZreg { 13038 break 13039 } 13040 x := z.Args[0] 13041 if !(c < 16 && z.Uses == 1) { 13042 break 13043 } 13044 v.reset(OpPPC64CLRLSLDI) 13045 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 48, 63, 64)) 13046 v.AddArg(x) 13047 return true 13048 } 13049 // match: (SLDconst [c] z:(MOVWZreg x)) 13050 // cond: c < 32 && z.Uses == 1 13051 // result: (CLRLSLDI [newPPC64ShiftAuxInt(c,32,63,64)] x) 13052 for { 13053 c := auxIntToInt64(v.AuxInt) 13054 z := v_0 13055 if z.Op != OpPPC64MOVWZreg { 13056 break 13057 } 13058 x := z.Args[0] 13059 if !(c < 32 && z.Uses == 1) { 13060 break 13061 } 13062 v.reset(OpPPC64CLRLSLDI) 13063 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32, 63, 64)) 13064 v.AddArg(x) 13065 return true 13066 } 13067 // match: (SLDconst [c] z:(Select0 (ANDCCconst [d] x))) 13068 // cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d)) 13069 // result: (CLRLSLDI [newPPC64ShiftAuxInt(c,64-getPPC64ShiftMaskLength(d),63,64)] x) 13070 for { 13071 c := auxIntToInt64(v.AuxInt) 13072 z := v_0 13073 if z.Op != OpSelect0 { 13074 break 13075 } 13076 z_0 := z.Args[0] 13077 if z_0.Op != OpPPC64ANDCCconst { 13078 break 13079 } 13080 d := auxIntToInt64(z_0.AuxInt) 13081 x := z_0.Args[0] 13082 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) { 13083 break 13084 } 13085 v.reset(OpPPC64CLRLSLDI) 13086 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64)) 13087 v.AddArg(x) 13088 return true 13089 } 13090 // match: (SLDconst [c] z:(AND (MOVDconst [d]) x)) 13091 // cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(64-getPPC64ShiftMaskLength(d)) 13092 // result: (CLRLSLDI [newPPC64ShiftAuxInt(c,64-getPPC64ShiftMaskLength(d),63,64)] x) 13093 for { 13094 c := auxIntToInt64(v.AuxInt) 13095 z := v_0 13096 if z.Op != OpPPC64AND { 13097 break 13098 } 13099 _ = z.Args[1] 13100 z_0 := z.Args[0] 13101 z_1 := z.Args[1] 13102 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 13103 if z_0.Op != OpPPC64MOVDconst { 13104 continue 13105 } 13106 d := auxIntToInt64(z_0.AuxInt) 13107 x := z_1 13108 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) { 13109 continue 13110 } 13111 v.reset(OpPPC64CLRLSLDI) 13112 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64)) 13113 v.AddArg(x) 13114 return true 13115 } 13116 break 13117 } 13118 // match: (SLDconst [c] z:(MOVWreg x)) 13119 // cond: c < 32 && buildcfg.GOPPC64 >= 9 13120 // result: (EXTSWSLconst [c] x) 13121 for { 13122 c := auxIntToInt64(v.AuxInt) 13123 z := v_0 13124 if z.Op != OpPPC64MOVWreg { 13125 break 13126 } 13127 x := z.Args[0] 13128 if !(c < 32 && buildcfg.GOPPC64 >= 9) { 13129 break 13130 } 13131 v.reset(OpPPC64EXTSWSLconst) 13132 v.AuxInt = int64ToAuxInt(c) 13133 v.AddArg(x) 13134 return true 13135 } 13136 return false 13137 } 13138 func rewriteValuePPC64_OpPPC64SLW(v *Value) bool { 13139 v_1 := v.Args[1] 13140 v_0 := v.Args[0] 13141 // match: (SLW x (MOVDconst [c])) 13142 // result: (SLWconst [c&31 | (c>>5&1*31)] x) 13143 for { 13144 x := v_0 13145 if v_1.Op != OpPPC64MOVDconst { 13146 break 13147 } 13148 c := auxIntToInt64(v_1.AuxInt) 13149 v.reset(OpPPC64SLWconst) 13150 v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31)) 13151 v.AddArg(x) 13152 return true 13153 } 13154 return false 13155 } 13156 func rewriteValuePPC64_OpPPC64SLWconst(v *Value) bool { 13157 v_0 := v.Args[0] 13158 // match: (SLWconst [c] z:(MOVBZreg x)) 13159 // cond: z.Uses == 1 && c < 8 13160 // result: (CLRLSLWI [newPPC64ShiftAuxInt(c,24,31,32)] x) 13161 for { 13162 c := auxIntToInt64(v.AuxInt) 13163 z := v_0 13164 if z.Op != OpPPC64MOVBZreg { 13165 break 13166 } 13167 x := z.Args[0] 13168 if !(z.Uses == 1 && c < 8) { 13169 break 13170 } 13171 v.reset(OpPPC64CLRLSLWI) 13172 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 24, 31, 32)) 13173 v.AddArg(x) 13174 return true 13175 } 13176 // match: (SLWconst [c] z:(MOVHZreg x)) 13177 // cond: z.Uses == 1 && c < 16 13178 // result: (CLRLSLWI [newPPC64ShiftAuxInt(c,16,31,32)] x) 13179 for { 13180 c := auxIntToInt64(v.AuxInt) 13181 z := v_0 13182 if z.Op != OpPPC64MOVHZreg { 13183 break 13184 } 13185 x := z.Args[0] 13186 if !(z.Uses == 1 && c < 16) { 13187 break 13188 } 13189 v.reset(OpPPC64CLRLSLWI) 13190 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 16, 31, 32)) 13191 v.AddArg(x) 13192 return true 13193 } 13194 // match: (SLWconst [c] z:(Select0 (ANDCCconst [d] x))) 13195 // cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(32-getPPC64ShiftMaskLength(d)) 13196 // result: (CLRLSLWI [newPPC64ShiftAuxInt(c,32-getPPC64ShiftMaskLength(d),31,32)] x) 13197 for { 13198 c := auxIntToInt64(v.AuxInt) 13199 z := v_0 13200 if z.Op != OpSelect0 { 13201 break 13202 } 13203 z_0 := z.Args[0] 13204 if z_0.Op != OpPPC64ANDCCconst { 13205 break 13206 } 13207 d := auxIntToInt64(z_0.AuxInt) 13208 x := z_0.Args[0] 13209 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) { 13210 break 13211 } 13212 v.reset(OpPPC64CLRLSLWI) 13213 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32)) 13214 v.AddArg(x) 13215 return true 13216 } 13217 // match: (SLWconst [c] z:(AND (MOVDconst [d]) x)) 13218 // cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(32-getPPC64ShiftMaskLength(d)) 13219 // result: (CLRLSLWI [newPPC64ShiftAuxInt(c,32-getPPC64ShiftMaskLength(d),31,32)] x) 13220 for { 13221 c := auxIntToInt64(v.AuxInt) 13222 z := v_0 13223 if z.Op != OpPPC64AND { 13224 break 13225 } 13226 _ = z.Args[1] 13227 z_0 := z.Args[0] 13228 z_1 := z.Args[1] 13229 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 13230 if z_0.Op != OpPPC64MOVDconst { 13231 continue 13232 } 13233 d := auxIntToInt64(z_0.AuxInt) 13234 x := z_1 13235 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) { 13236 continue 13237 } 13238 v.reset(OpPPC64CLRLSLWI) 13239 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32)) 13240 v.AddArg(x) 13241 return true 13242 } 13243 break 13244 } 13245 // match: (SLWconst [c] z:(MOVWreg x)) 13246 // cond: c < 32 && buildcfg.GOPPC64 >= 9 13247 // result: (EXTSWSLconst [c] x) 13248 for { 13249 c := auxIntToInt64(v.AuxInt) 13250 z := v_0 13251 if z.Op != OpPPC64MOVWreg { 13252 break 13253 } 13254 x := z.Args[0] 13255 if !(c < 32 && buildcfg.GOPPC64 >= 9) { 13256 break 13257 } 13258 v.reset(OpPPC64EXTSWSLconst) 13259 v.AuxInt = int64ToAuxInt(c) 13260 v.AddArg(x) 13261 return true 13262 } 13263 return false 13264 } 13265 func rewriteValuePPC64_OpPPC64SRAD(v *Value) bool { 13266 v_1 := v.Args[1] 13267 v_0 := v.Args[0] 13268 // match: (SRAD x (MOVDconst [c])) 13269 // result: (SRADconst [c&63 | (c>>6&1*63)] x) 13270 for { 13271 x := v_0 13272 if v_1.Op != OpPPC64MOVDconst { 13273 break 13274 } 13275 c := auxIntToInt64(v_1.AuxInt) 13276 v.reset(OpPPC64SRADconst) 13277 v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63)) 13278 v.AddArg(x) 13279 return true 13280 } 13281 return false 13282 } 13283 func rewriteValuePPC64_OpPPC64SRAW(v *Value) bool { 13284 v_1 := v.Args[1] 13285 v_0 := v.Args[0] 13286 // match: (SRAW x (MOVDconst [c])) 13287 // result: (SRAWconst [c&31 | (c>>5&1*31)] x) 13288 for { 13289 x := v_0 13290 if v_1.Op != OpPPC64MOVDconst { 13291 break 13292 } 13293 c := auxIntToInt64(v_1.AuxInt) 13294 v.reset(OpPPC64SRAWconst) 13295 v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31)) 13296 v.AddArg(x) 13297 return true 13298 } 13299 return false 13300 } 13301 func rewriteValuePPC64_OpPPC64SRD(v *Value) bool { 13302 v_1 := v.Args[1] 13303 v_0 := v.Args[0] 13304 // match: (SRD x (MOVDconst [c])) 13305 // result: (SRDconst [c&63 | (c>>6&1*63)] x) 13306 for { 13307 x := v_0 13308 if v_1.Op != OpPPC64MOVDconst { 13309 break 13310 } 13311 c := auxIntToInt64(v_1.AuxInt) 13312 v.reset(OpPPC64SRDconst) 13313 v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63)) 13314 v.AddArg(x) 13315 return true 13316 } 13317 return false 13318 } 13319 func rewriteValuePPC64_OpPPC64SRW(v *Value) bool { 13320 v_1 := v.Args[1] 13321 v_0 := v.Args[0] 13322 // match: (SRW x (MOVDconst [c])) 13323 // result: (SRWconst [c&31 | (c>>5&1*31)] x) 13324 for { 13325 x := v_0 13326 if v_1.Op != OpPPC64MOVDconst { 13327 break 13328 } 13329 c := auxIntToInt64(v_1.AuxInt) 13330 v.reset(OpPPC64SRWconst) 13331 v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31)) 13332 v.AddArg(x) 13333 return true 13334 } 13335 return false 13336 } 13337 func rewriteValuePPC64_OpPPC64SRWconst(v *Value) bool { 13338 v_0 := v.Args[0] 13339 // match: (SRWconst (Select0 (ANDCCconst [m] x)) [s]) 13340 // cond: mergePPC64RShiftMask(m>>uint(s),s,32) == 0 13341 // result: (MOVDconst [0]) 13342 for { 13343 s := auxIntToInt64(v.AuxInt) 13344 if v_0.Op != OpSelect0 { 13345 break 13346 } 13347 v_0_0 := v_0.Args[0] 13348 if v_0_0.Op != OpPPC64ANDCCconst { 13349 break 13350 } 13351 m := auxIntToInt64(v_0_0.AuxInt) 13352 if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) { 13353 break 13354 } 13355 v.reset(OpPPC64MOVDconst) 13356 v.AuxInt = int64ToAuxInt(0) 13357 return true 13358 } 13359 // match: (SRWconst (Select0 (ANDCCconst [m] x)) [s]) 13360 // cond: mergePPC64AndSrwi(m>>uint(s),s) != 0 13361 // result: (RLWINM [mergePPC64AndSrwi(m>>uint(s),s)] x) 13362 for { 13363 s := auxIntToInt64(v.AuxInt) 13364 if v_0.Op != OpSelect0 { 13365 break 13366 } 13367 v_0_0 := v_0.Args[0] 13368 if v_0_0.Op != OpPPC64ANDCCconst { 13369 break 13370 } 13371 m := auxIntToInt64(v_0_0.AuxInt) 13372 x := v_0_0.Args[0] 13373 if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) { 13374 break 13375 } 13376 v.reset(OpPPC64RLWINM) 13377 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s)) 13378 v.AddArg(x) 13379 return true 13380 } 13381 // match: (SRWconst (AND (MOVDconst [m]) x) [s]) 13382 // cond: mergePPC64RShiftMask(m>>uint(s),s,32) == 0 13383 // result: (MOVDconst [0]) 13384 for { 13385 s := auxIntToInt64(v.AuxInt) 13386 if v_0.Op != OpPPC64AND { 13387 break 13388 } 13389 _ = v_0.Args[1] 13390 v_0_0 := v_0.Args[0] 13391 v_0_1 := v_0.Args[1] 13392 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 13393 if v_0_0.Op != OpPPC64MOVDconst { 13394 continue 13395 } 13396 m := auxIntToInt64(v_0_0.AuxInt) 13397 if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) { 13398 continue 13399 } 13400 v.reset(OpPPC64MOVDconst) 13401 v.AuxInt = int64ToAuxInt(0) 13402 return true 13403 } 13404 break 13405 } 13406 // match: (SRWconst (AND (MOVDconst [m]) x) [s]) 13407 // cond: mergePPC64AndSrwi(m>>uint(s),s) != 0 13408 // result: (RLWINM [mergePPC64AndSrwi(m>>uint(s),s)] x) 13409 for { 13410 s := auxIntToInt64(v.AuxInt) 13411 if v_0.Op != OpPPC64AND { 13412 break 13413 } 13414 _ = v_0.Args[1] 13415 v_0_0 := v_0.Args[0] 13416 v_0_1 := v_0.Args[1] 13417 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 { 13418 if v_0_0.Op != OpPPC64MOVDconst { 13419 continue 13420 } 13421 m := auxIntToInt64(v_0_0.AuxInt) 13422 x := v_0_1 13423 if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) { 13424 continue 13425 } 13426 v.reset(OpPPC64RLWINM) 13427 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s)) 13428 v.AddArg(x) 13429 return true 13430 } 13431 break 13432 } 13433 return false 13434 } 13435 func rewriteValuePPC64_OpPPC64SUB(v *Value) bool { 13436 v_1 := v.Args[1] 13437 v_0 := v.Args[0] 13438 // match: (SUB x (MOVDconst [c])) 13439 // cond: is32Bit(-c) 13440 // result: (ADDconst [-c] x) 13441 for { 13442 x := v_0 13443 if v_1.Op != OpPPC64MOVDconst { 13444 break 13445 } 13446 c := auxIntToInt64(v_1.AuxInt) 13447 if !(is32Bit(-c)) { 13448 break 13449 } 13450 v.reset(OpPPC64ADDconst) 13451 v.AuxInt = int64ToAuxInt(-c) 13452 v.AddArg(x) 13453 return true 13454 } 13455 // match: (SUB (MOVDconst [c]) x) 13456 // cond: is32Bit(c) 13457 // result: (SUBFCconst [c] x) 13458 for { 13459 if v_0.Op != OpPPC64MOVDconst { 13460 break 13461 } 13462 c := auxIntToInt64(v_0.AuxInt) 13463 x := v_1 13464 if !(is32Bit(c)) { 13465 break 13466 } 13467 v.reset(OpPPC64SUBFCconst) 13468 v.AuxInt = int64ToAuxInt(c) 13469 v.AddArg(x) 13470 return true 13471 } 13472 return false 13473 } 13474 func rewriteValuePPC64_OpPPC64SUBE(v *Value) bool { 13475 v_2 := v.Args[2] 13476 v_1 := v.Args[1] 13477 v_0 := v.Args[0] 13478 b := v.Block 13479 typ := &b.Func.Config.Types 13480 // match: (SUBE x y (Select1 <typ.UInt64> (SUBCconst (MOVDconst [0]) [0]))) 13481 // result: (SUBC x y) 13482 for { 13483 x := v_0 13484 y := v_1 13485 if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 { 13486 break 13487 } 13488 v_2_0 := v_2.Args[0] 13489 if v_2_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_2_0.AuxInt) != 0 { 13490 break 13491 } 13492 v_2_0_0 := v_2_0.Args[0] 13493 if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 { 13494 break 13495 } 13496 v.reset(OpPPC64SUBC) 13497 v.AddArg2(x, y) 13498 return true 13499 } 13500 return false 13501 } 13502 func rewriteValuePPC64_OpPPC64SUBFCconst(v *Value) bool { 13503 v_0 := v.Args[0] 13504 // match: (SUBFCconst [c] (NEG x)) 13505 // result: (ADDconst [c] x) 13506 for { 13507 c := auxIntToInt64(v.AuxInt) 13508 if v_0.Op != OpPPC64NEG { 13509 break 13510 } 13511 x := v_0.Args[0] 13512 v.reset(OpPPC64ADDconst) 13513 v.AuxInt = int64ToAuxInt(c) 13514 v.AddArg(x) 13515 return true 13516 } 13517 // match: (SUBFCconst [c] (SUBFCconst [d] x)) 13518 // cond: is32Bit(c-d) 13519 // result: (ADDconst [c-d] x) 13520 for { 13521 c := auxIntToInt64(v.AuxInt) 13522 if v_0.Op != OpPPC64SUBFCconst { 13523 break 13524 } 13525 d := auxIntToInt64(v_0.AuxInt) 13526 x := v_0.Args[0] 13527 if !(is32Bit(c - d)) { 13528 break 13529 } 13530 v.reset(OpPPC64ADDconst) 13531 v.AuxInt = int64ToAuxInt(c - d) 13532 v.AddArg(x) 13533 return true 13534 } 13535 // match: (SUBFCconst [0] x) 13536 // result: (NEG x) 13537 for { 13538 if auxIntToInt64(v.AuxInt) != 0 { 13539 break 13540 } 13541 x := v_0 13542 v.reset(OpPPC64NEG) 13543 v.AddArg(x) 13544 return true 13545 } 13546 return false 13547 } 13548 func rewriteValuePPC64_OpPPC64XOR(v *Value) bool { 13549 v_1 := v.Args[1] 13550 v_0 := v.Args[0] 13551 // match: (XOR (MOVDconst [c]) (MOVDconst [d])) 13552 // result: (MOVDconst [c^d]) 13553 for { 13554 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 13555 if v_0.Op != OpPPC64MOVDconst { 13556 continue 13557 } 13558 c := auxIntToInt64(v_0.AuxInt) 13559 if v_1.Op != OpPPC64MOVDconst { 13560 continue 13561 } 13562 d := auxIntToInt64(v_1.AuxInt) 13563 v.reset(OpPPC64MOVDconst) 13564 v.AuxInt = int64ToAuxInt(c ^ d) 13565 return true 13566 } 13567 break 13568 } 13569 // match: (XOR x (MOVDconst [c])) 13570 // cond: isU32Bit(c) 13571 // result: (XORconst [c] x) 13572 for { 13573 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 { 13574 x := v_0 13575 if v_1.Op != OpPPC64MOVDconst { 13576 continue 13577 } 13578 c := auxIntToInt64(v_1.AuxInt) 13579 if !(isU32Bit(c)) { 13580 continue 13581 } 13582 v.reset(OpPPC64XORconst) 13583 v.AuxInt = int64ToAuxInt(c) 13584 v.AddArg(x) 13585 return true 13586 } 13587 break 13588 } 13589 return false 13590 } 13591 func rewriteValuePPC64_OpPPC64XORconst(v *Value) bool { 13592 v_0 := v.Args[0] 13593 b := v.Block 13594 typ := &b.Func.Config.Types 13595 // match: (XORconst [c] (XORconst [d] x)) 13596 // result: (XORconst [c^d] x) 13597 for { 13598 c := auxIntToInt64(v.AuxInt) 13599 if v_0.Op != OpPPC64XORconst { 13600 break 13601 } 13602 d := auxIntToInt64(v_0.AuxInt) 13603 x := v_0.Args[0] 13604 v.reset(OpPPC64XORconst) 13605 v.AuxInt = int64ToAuxInt(c ^ d) 13606 v.AddArg(x) 13607 return true 13608 } 13609 // match: (XORconst [0] x) 13610 // result: x 13611 for { 13612 if auxIntToInt64(v.AuxInt) != 0 { 13613 break 13614 } 13615 x := v_0 13616 v.copyOf(x) 13617 return true 13618 } 13619 // match: (XORconst [1] (ISELB [6] (MOVDconst [1]) cmp)) 13620 // result: (ISELB [2] (MOVDconst [1]) cmp) 13621 for { 13622 if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64ISELB || auxIntToInt32(v_0.AuxInt) != 6 { 13623 break 13624 } 13625 cmp := v_0.Args[1] 13626 v_0_0 := v_0.Args[0] 13627 if v_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0_0.AuxInt) != 1 { 13628 break 13629 } 13630 v.reset(OpPPC64ISELB) 13631 v.AuxInt = int32ToAuxInt(2) 13632 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 13633 v0.AuxInt = int64ToAuxInt(1) 13634 v.AddArg2(v0, cmp) 13635 return true 13636 } 13637 // match: (XORconst [1] (ISELB [5] (MOVDconst [1]) cmp)) 13638 // result: (ISELB [1] (MOVDconst [1]) cmp) 13639 for { 13640 if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64ISELB || auxIntToInt32(v_0.AuxInt) != 5 { 13641 break 13642 } 13643 cmp := v_0.Args[1] 13644 v_0_0 := v_0.Args[0] 13645 if v_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0_0.AuxInt) != 1 { 13646 break 13647 } 13648 v.reset(OpPPC64ISELB) 13649 v.AuxInt = int32ToAuxInt(1) 13650 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 13651 v0.AuxInt = int64ToAuxInt(1) 13652 v.AddArg2(v0, cmp) 13653 return true 13654 } 13655 // match: (XORconst [1] (ISELB [4] (MOVDconst [1]) cmp)) 13656 // result: (ISELB [0] (MOVDconst [1]) cmp) 13657 for { 13658 if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64ISELB || auxIntToInt32(v_0.AuxInt) != 4 { 13659 break 13660 } 13661 cmp := v_0.Args[1] 13662 v_0_0 := v_0.Args[0] 13663 if v_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0_0.AuxInt) != 1 { 13664 break 13665 } 13666 v.reset(OpPPC64ISELB) 13667 v.AuxInt = int32ToAuxInt(0) 13668 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 13669 v0.AuxInt = int64ToAuxInt(1) 13670 v.AddArg2(v0, cmp) 13671 return true 13672 } 13673 return false 13674 } 13675 func rewriteValuePPC64_OpPanicBounds(v *Value) bool { 13676 v_2 := v.Args[2] 13677 v_1 := v.Args[1] 13678 v_0 := v.Args[0] 13679 // match: (PanicBounds [kind] x y mem) 13680 // cond: boundsABI(kind) == 0 13681 // result: (LoweredPanicBoundsA [kind] x y mem) 13682 for { 13683 kind := auxIntToInt64(v.AuxInt) 13684 x := v_0 13685 y := v_1 13686 mem := v_2 13687 if !(boundsABI(kind) == 0) { 13688 break 13689 } 13690 v.reset(OpPPC64LoweredPanicBoundsA) 13691 v.AuxInt = int64ToAuxInt(kind) 13692 v.AddArg3(x, y, mem) 13693 return true 13694 } 13695 // match: (PanicBounds [kind] x y mem) 13696 // cond: boundsABI(kind) == 1 13697 // result: (LoweredPanicBoundsB [kind] x y mem) 13698 for { 13699 kind := auxIntToInt64(v.AuxInt) 13700 x := v_0 13701 y := v_1 13702 mem := v_2 13703 if !(boundsABI(kind) == 1) { 13704 break 13705 } 13706 v.reset(OpPPC64LoweredPanicBoundsB) 13707 v.AuxInt = int64ToAuxInt(kind) 13708 v.AddArg3(x, y, mem) 13709 return true 13710 } 13711 // match: (PanicBounds [kind] x y mem) 13712 // cond: boundsABI(kind) == 2 13713 // result: (LoweredPanicBoundsC [kind] x y mem) 13714 for { 13715 kind := auxIntToInt64(v.AuxInt) 13716 x := v_0 13717 y := v_1 13718 mem := v_2 13719 if !(boundsABI(kind) == 2) { 13720 break 13721 } 13722 v.reset(OpPPC64LoweredPanicBoundsC) 13723 v.AuxInt = int64ToAuxInt(kind) 13724 v.AddArg3(x, y, mem) 13725 return true 13726 } 13727 return false 13728 } 13729 func rewriteValuePPC64_OpPopCount16(v *Value) bool { 13730 v_0 := v.Args[0] 13731 b := v.Block 13732 typ := &b.Func.Config.Types 13733 // match: (PopCount16 x) 13734 // result: (POPCNTW (MOVHZreg x)) 13735 for { 13736 x := v_0 13737 v.reset(OpPPC64POPCNTW) 13738 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64) 13739 v0.AddArg(x) 13740 v.AddArg(v0) 13741 return true 13742 } 13743 } 13744 func rewriteValuePPC64_OpPopCount32(v *Value) bool { 13745 v_0 := v.Args[0] 13746 b := v.Block 13747 typ := &b.Func.Config.Types 13748 // match: (PopCount32 x) 13749 // result: (POPCNTW (MOVWZreg x)) 13750 for { 13751 x := v_0 13752 v.reset(OpPPC64POPCNTW) 13753 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64) 13754 v0.AddArg(x) 13755 v.AddArg(v0) 13756 return true 13757 } 13758 } 13759 func rewriteValuePPC64_OpPopCount8(v *Value) bool { 13760 v_0 := v.Args[0] 13761 b := v.Block 13762 typ := &b.Func.Config.Types 13763 // match: (PopCount8 x) 13764 // result: (POPCNTB (MOVBZreg x)) 13765 for { 13766 x := v_0 13767 v.reset(OpPPC64POPCNTB) 13768 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64) 13769 v0.AddArg(x) 13770 v.AddArg(v0) 13771 return true 13772 } 13773 } 13774 func rewriteValuePPC64_OpPrefetchCache(v *Value) bool { 13775 v_1 := v.Args[1] 13776 v_0 := v.Args[0] 13777 // match: (PrefetchCache ptr mem) 13778 // result: (DCBT ptr mem [0]) 13779 for { 13780 ptr := v_0 13781 mem := v_1 13782 v.reset(OpPPC64DCBT) 13783 v.AuxInt = int64ToAuxInt(0) 13784 v.AddArg2(ptr, mem) 13785 return true 13786 } 13787 } 13788 func rewriteValuePPC64_OpPrefetchCacheStreamed(v *Value) bool { 13789 v_1 := v.Args[1] 13790 v_0 := v.Args[0] 13791 // match: (PrefetchCacheStreamed ptr mem) 13792 // result: (DCBT ptr mem [16]) 13793 for { 13794 ptr := v_0 13795 mem := v_1 13796 v.reset(OpPPC64DCBT) 13797 v.AuxInt = int64ToAuxInt(16) 13798 v.AddArg2(ptr, mem) 13799 return true 13800 } 13801 } 13802 func rewriteValuePPC64_OpRotateLeft16(v *Value) bool { 13803 v_1 := v.Args[1] 13804 v_0 := v.Args[0] 13805 b := v.Block 13806 typ := &b.Func.Config.Types 13807 // match: (RotateLeft16 <t> x (MOVDconst [c])) 13808 // result: (Or16 (Lsh16x64 <t> x (MOVDconst [c&15])) (Rsh16Ux64 <t> x (MOVDconst [-c&15]))) 13809 for { 13810 t := v.Type 13811 x := v_0 13812 if v_1.Op != OpPPC64MOVDconst { 13813 break 13814 } 13815 c := auxIntToInt64(v_1.AuxInt) 13816 v.reset(OpOr16) 13817 v0 := b.NewValue0(v.Pos, OpLsh16x64, t) 13818 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 13819 v1.AuxInt = int64ToAuxInt(c & 15) 13820 v0.AddArg2(x, v1) 13821 v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t) 13822 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 13823 v3.AuxInt = int64ToAuxInt(-c & 15) 13824 v2.AddArg2(x, v3) 13825 v.AddArg2(v0, v2) 13826 return true 13827 } 13828 return false 13829 } 13830 func rewriteValuePPC64_OpRotateLeft8(v *Value) bool { 13831 v_1 := v.Args[1] 13832 v_0 := v.Args[0] 13833 b := v.Block 13834 typ := &b.Func.Config.Types 13835 // match: (RotateLeft8 <t> x (MOVDconst [c])) 13836 // result: (Or8 (Lsh8x64 <t> x (MOVDconst [c&7])) (Rsh8Ux64 <t> x (MOVDconst [-c&7]))) 13837 for { 13838 t := v.Type 13839 x := v_0 13840 if v_1.Op != OpPPC64MOVDconst { 13841 break 13842 } 13843 c := auxIntToInt64(v_1.AuxInt) 13844 v.reset(OpOr8) 13845 v0 := b.NewValue0(v.Pos, OpLsh8x64, t) 13846 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 13847 v1.AuxInt = int64ToAuxInt(c & 7) 13848 v0.AddArg2(x, v1) 13849 v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t) 13850 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 13851 v3.AuxInt = int64ToAuxInt(-c & 7) 13852 v2.AddArg2(x, v3) 13853 v.AddArg2(v0, v2) 13854 return true 13855 } 13856 return false 13857 } 13858 func rewriteValuePPC64_OpRsh16Ux16(v *Value) bool { 13859 v_1 := v.Args[1] 13860 v_0 := v.Args[0] 13861 b := v.Block 13862 typ := &b.Func.Config.Types 13863 // match: (Rsh16Ux16 x y) 13864 // cond: shiftIsBounded(v) 13865 // result: (SRW (MOVHZreg x) y) 13866 for { 13867 x := v_0 13868 y := v_1 13869 if !(shiftIsBounded(v)) { 13870 break 13871 } 13872 v.reset(OpPPC64SRW) 13873 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64) 13874 v0.AddArg(x) 13875 v.AddArg2(v0, y) 13876 return true 13877 } 13878 // match: (Rsh16Ux16 x y) 13879 // result: (SRW (ZeroExt16to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [16])))) 13880 for { 13881 x := v_0 13882 y := v_1 13883 v.reset(OpPPC64SRW) 13884 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 13885 v0.AddArg(x) 13886 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 13887 v1.AuxInt = int32ToAuxInt(0) 13888 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 13889 v2.AuxInt = int64ToAuxInt(-1) 13890 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 13891 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 13892 v4.AddArg(y) 13893 v5 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 13894 v5.AuxInt = int64ToAuxInt(16) 13895 v3.AddArg2(v4, v5) 13896 v1.AddArg3(y, v2, v3) 13897 v.AddArg2(v0, v1) 13898 return true 13899 } 13900 } 13901 func rewriteValuePPC64_OpRsh16Ux32(v *Value) bool { 13902 v_1 := v.Args[1] 13903 v_0 := v.Args[0] 13904 b := v.Block 13905 typ := &b.Func.Config.Types 13906 // match: (Rsh16Ux32 x y) 13907 // cond: shiftIsBounded(v) 13908 // result: (SRW (MOVHZreg x) y) 13909 for { 13910 x := v_0 13911 y := v_1 13912 if !(shiftIsBounded(v)) { 13913 break 13914 } 13915 v.reset(OpPPC64SRW) 13916 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64) 13917 v0.AddArg(x) 13918 v.AddArg2(v0, y) 13919 return true 13920 } 13921 // match: (Rsh16Ux32 x y) 13922 // result: (SRW (ZeroExt16to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [16])))) 13923 for { 13924 x := v_0 13925 y := v_1 13926 v.reset(OpPPC64SRW) 13927 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 13928 v0.AddArg(x) 13929 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 13930 v1.AuxInt = int32ToAuxInt(0) 13931 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 13932 v2.AuxInt = int64ToAuxInt(-1) 13933 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 13934 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 13935 v4.AuxInt = int64ToAuxInt(16) 13936 v3.AddArg2(y, v4) 13937 v1.AddArg3(y, v2, v3) 13938 v.AddArg2(v0, v1) 13939 return true 13940 } 13941 } 13942 func rewriteValuePPC64_OpRsh16Ux64(v *Value) bool { 13943 v_1 := v.Args[1] 13944 v_0 := v.Args[0] 13945 b := v.Block 13946 typ := &b.Func.Config.Types 13947 // match: (Rsh16Ux64 x (MOVDconst [c])) 13948 // cond: uint64(c) < 16 13949 // result: (SRWconst (ZeroExt16to32 x) [c]) 13950 for { 13951 x := v_0 13952 if v_1.Op != OpPPC64MOVDconst { 13953 break 13954 } 13955 c := auxIntToInt64(v_1.AuxInt) 13956 if !(uint64(c) < 16) { 13957 break 13958 } 13959 v.reset(OpPPC64SRWconst) 13960 v.AuxInt = int64ToAuxInt(c) 13961 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 13962 v0.AddArg(x) 13963 v.AddArg(v0) 13964 return true 13965 } 13966 // match: (Rsh16Ux64 x y) 13967 // cond: shiftIsBounded(v) 13968 // result: (SRW (MOVHZreg x) y) 13969 for { 13970 x := v_0 13971 y := v_1 13972 if !(shiftIsBounded(v)) { 13973 break 13974 } 13975 v.reset(OpPPC64SRW) 13976 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64) 13977 v0.AddArg(x) 13978 v.AddArg2(v0, y) 13979 return true 13980 } 13981 // match: (Rsh16Ux64 x y) 13982 // result: (SRW (ZeroExt16to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [16])))) 13983 for { 13984 x := v_0 13985 y := v_1 13986 v.reset(OpPPC64SRW) 13987 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 13988 v0.AddArg(x) 13989 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 13990 v1.AuxInt = int32ToAuxInt(0) 13991 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 13992 v2.AuxInt = int64ToAuxInt(-1) 13993 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 13994 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 13995 v4.AuxInt = int64ToAuxInt(16) 13996 v3.AddArg2(y, v4) 13997 v1.AddArg3(y, v2, v3) 13998 v.AddArg2(v0, v1) 13999 return true 14000 } 14001 } 14002 func rewriteValuePPC64_OpRsh16Ux8(v *Value) bool { 14003 v_1 := v.Args[1] 14004 v_0 := v.Args[0] 14005 b := v.Block 14006 typ := &b.Func.Config.Types 14007 // match: (Rsh16Ux8 x y) 14008 // cond: shiftIsBounded(v) 14009 // result: (SRW (MOVHZreg x) y) 14010 for { 14011 x := v_0 14012 y := v_1 14013 if !(shiftIsBounded(v)) { 14014 break 14015 } 14016 v.reset(OpPPC64SRW) 14017 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64) 14018 v0.AddArg(x) 14019 v.AddArg2(v0, y) 14020 return true 14021 } 14022 // match: (Rsh16Ux8 x y) 14023 // result: (SRW (ZeroExt16to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [16])))) 14024 for { 14025 x := v_0 14026 y := v_1 14027 v.reset(OpPPC64SRW) 14028 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 14029 v0.AddArg(x) 14030 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14031 v1.AuxInt = int32ToAuxInt(0) 14032 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14033 v2.AuxInt = int64ToAuxInt(-1) 14034 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14035 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 14036 v4.AddArg(y) 14037 v5 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14038 v5.AuxInt = int64ToAuxInt(16) 14039 v3.AddArg2(v4, v5) 14040 v1.AddArg3(y, v2, v3) 14041 v.AddArg2(v0, v1) 14042 return true 14043 } 14044 } 14045 func rewriteValuePPC64_OpRsh16x16(v *Value) bool { 14046 v_1 := v.Args[1] 14047 v_0 := v.Args[0] 14048 b := v.Block 14049 typ := &b.Func.Config.Types 14050 // match: (Rsh16x16 x y) 14051 // cond: shiftIsBounded(v) 14052 // result: (SRAW (MOVHreg x) y) 14053 for { 14054 x := v_0 14055 y := v_1 14056 if !(shiftIsBounded(v)) { 14057 break 14058 } 14059 v.reset(OpPPC64SRAW) 14060 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64) 14061 v0.AddArg(x) 14062 v.AddArg2(v0, y) 14063 return true 14064 } 14065 // match: (Rsh16x16 x y) 14066 // result: (SRAW (SignExt16to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [16])))) 14067 for { 14068 x := v_0 14069 y := v_1 14070 v.reset(OpPPC64SRAW) 14071 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 14072 v0.AddArg(x) 14073 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14074 v1.AuxInt = int32ToAuxInt(0) 14075 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14076 v2.AuxInt = int64ToAuxInt(-1) 14077 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14078 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 14079 v4.AddArg(y) 14080 v5 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14081 v5.AuxInt = int64ToAuxInt(16) 14082 v3.AddArg2(v4, v5) 14083 v1.AddArg3(y, v2, v3) 14084 v.AddArg2(v0, v1) 14085 return true 14086 } 14087 } 14088 func rewriteValuePPC64_OpRsh16x32(v *Value) bool { 14089 v_1 := v.Args[1] 14090 v_0 := v.Args[0] 14091 b := v.Block 14092 typ := &b.Func.Config.Types 14093 // match: (Rsh16x32 x y) 14094 // cond: shiftIsBounded(v) 14095 // result: (SRAW (MOVHreg x) y) 14096 for { 14097 x := v_0 14098 y := v_1 14099 if !(shiftIsBounded(v)) { 14100 break 14101 } 14102 v.reset(OpPPC64SRAW) 14103 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64) 14104 v0.AddArg(x) 14105 v.AddArg2(v0, y) 14106 return true 14107 } 14108 // match: (Rsh16x32 x y) 14109 // result: (SRAW (SignExt16to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [16])))) 14110 for { 14111 x := v_0 14112 y := v_1 14113 v.reset(OpPPC64SRAW) 14114 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 14115 v0.AddArg(x) 14116 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14117 v1.AuxInt = int32ToAuxInt(0) 14118 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14119 v2.AuxInt = int64ToAuxInt(-1) 14120 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14121 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14122 v4.AuxInt = int64ToAuxInt(16) 14123 v3.AddArg2(y, v4) 14124 v1.AddArg3(y, v2, v3) 14125 v.AddArg2(v0, v1) 14126 return true 14127 } 14128 } 14129 func rewriteValuePPC64_OpRsh16x64(v *Value) bool { 14130 v_1 := v.Args[1] 14131 v_0 := v.Args[0] 14132 b := v.Block 14133 typ := &b.Func.Config.Types 14134 // match: (Rsh16x64 x (MOVDconst [c])) 14135 // cond: uint64(c) >= 16 14136 // result: (SRAWconst (SignExt16to32 x) [63]) 14137 for { 14138 x := v_0 14139 if v_1.Op != OpPPC64MOVDconst { 14140 break 14141 } 14142 c := auxIntToInt64(v_1.AuxInt) 14143 if !(uint64(c) >= 16) { 14144 break 14145 } 14146 v.reset(OpPPC64SRAWconst) 14147 v.AuxInt = int64ToAuxInt(63) 14148 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 14149 v0.AddArg(x) 14150 v.AddArg(v0) 14151 return true 14152 } 14153 // match: (Rsh16x64 x (MOVDconst [c])) 14154 // cond: uint64(c) < 16 14155 // result: (SRAWconst (SignExt16to32 x) [c]) 14156 for { 14157 x := v_0 14158 if v_1.Op != OpPPC64MOVDconst { 14159 break 14160 } 14161 c := auxIntToInt64(v_1.AuxInt) 14162 if !(uint64(c) < 16) { 14163 break 14164 } 14165 v.reset(OpPPC64SRAWconst) 14166 v.AuxInt = int64ToAuxInt(c) 14167 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 14168 v0.AddArg(x) 14169 v.AddArg(v0) 14170 return true 14171 } 14172 // match: (Rsh16x64 x y) 14173 // cond: shiftIsBounded(v) 14174 // result: (SRAW (MOVHreg x) y) 14175 for { 14176 x := v_0 14177 y := v_1 14178 if !(shiftIsBounded(v)) { 14179 break 14180 } 14181 v.reset(OpPPC64SRAW) 14182 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64) 14183 v0.AddArg(x) 14184 v.AddArg2(v0, y) 14185 return true 14186 } 14187 // match: (Rsh16x64 x y) 14188 // result: (SRAW (SignExt16to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [16])))) 14189 for { 14190 x := v_0 14191 y := v_1 14192 v.reset(OpPPC64SRAW) 14193 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 14194 v0.AddArg(x) 14195 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14196 v1.AuxInt = int32ToAuxInt(0) 14197 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14198 v2.AuxInt = int64ToAuxInt(-1) 14199 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14200 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14201 v4.AuxInt = int64ToAuxInt(16) 14202 v3.AddArg2(y, v4) 14203 v1.AddArg3(y, v2, v3) 14204 v.AddArg2(v0, v1) 14205 return true 14206 } 14207 } 14208 func rewriteValuePPC64_OpRsh16x8(v *Value) bool { 14209 v_1 := v.Args[1] 14210 v_0 := v.Args[0] 14211 b := v.Block 14212 typ := &b.Func.Config.Types 14213 // match: (Rsh16x8 x y) 14214 // cond: shiftIsBounded(v) 14215 // result: (SRAW (MOVHreg x) y) 14216 for { 14217 x := v_0 14218 y := v_1 14219 if !(shiftIsBounded(v)) { 14220 break 14221 } 14222 v.reset(OpPPC64SRAW) 14223 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64) 14224 v0.AddArg(x) 14225 v.AddArg2(v0, y) 14226 return true 14227 } 14228 // match: (Rsh16x8 x y) 14229 // result: (SRAW (SignExt16to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [16])))) 14230 for { 14231 x := v_0 14232 y := v_1 14233 v.reset(OpPPC64SRAW) 14234 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 14235 v0.AddArg(x) 14236 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14237 v1.AuxInt = int32ToAuxInt(0) 14238 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14239 v2.AuxInt = int64ToAuxInt(-1) 14240 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14241 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 14242 v4.AddArg(y) 14243 v5 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14244 v5.AuxInt = int64ToAuxInt(16) 14245 v3.AddArg2(v4, v5) 14246 v1.AddArg3(y, v2, v3) 14247 v.AddArg2(v0, v1) 14248 return true 14249 } 14250 } 14251 func rewriteValuePPC64_OpRsh32Ux16(v *Value) bool { 14252 v_1 := v.Args[1] 14253 v_0 := v.Args[0] 14254 b := v.Block 14255 typ := &b.Func.Config.Types 14256 // match: (Rsh32Ux16 x y) 14257 // cond: shiftIsBounded(v) 14258 // result: (SRW x y) 14259 for { 14260 x := v_0 14261 y := v_1 14262 if !(shiftIsBounded(v)) { 14263 break 14264 } 14265 v.reset(OpPPC64SRW) 14266 v.AddArg2(x, y) 14267 return true 14268 } 14269 // match: (Rsh32Ux16 x y) 14270 // result: (SRW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [32])))) 14271 for { 14272 x := v_0 14273 y := v_1 14274 v.reset(OpPPC64SRW) 14275 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14276 v0.AuxInt = int32ToAuxInt(0) 14277 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14278 v1.AuxInt = int64ToAuxInt(-1) 14279 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14280 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 14281 v3.AddArg(y) 14282 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14283 v4.AuxInt = int64ToAuxInt(32) 14284 v2.AddArg2(v3, v4) 14285 v0.AddArg3(y, v1, v2) 14286 v.AddArg2(x, v0) 14287 return true 14288 } 14289 } 14290 func rewriteValuePPC64_OpRsh32Ux32(v *Value) bool { 14291 v_1 := v.Args[1] 14292 v_0 := v.Args[0] 14293 b := v.Block 14294 typ := &b.Func.Config.Types 14295 // match: (Rsh32Ux32 x y) 14296 // cond: shiftIsBounded(v) 14297 // result: (SRW x y) 14298 for { 14299 x := v_0 14300 y := v_1 14301 if !(shiftIsBounded(v)) { 14302 break 14303 } 14304 v.reset(OpPPC64SRW) 14305 v.AddArg2(x, y) 14306 return true 14307 } 14308 // match: (Rsh32Ux32 x y) 14309 // result: (SRW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [32])))) 14310 for { 14311 x := v_0 14312 y := v_1 14313 v.reset(OpPPC64SRW) 14314 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14315 v0.AuxInt = int32ToAuxInt(0) 14316 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14317 v1.AuxInt = int64ToAuxInt(-1) 14318 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14319 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14320 v3.AuxInt = int64ToAuxInt(32) 14321 v2.AddArg2(y, v3) 14322 v0.AddArg3(y, v1, v2) 14323 v.AddArg2(x, v0) 14324 return true 14325 } 14326 } 14327 func rewriteValuePPC64_OpRsh32Ux64(v *Value) bool { 14328 v_1 := v.Args[1] 14329 v_0 := v.Args[0] 14330 b := v.Block 14331 typ := &b.Func.Config.Types 14332 // match: (Rsh32Ux64 x (MOVDconst [c])) 14333 // cond: uint64(c) < 32 14334 // result: (SRWconst x [c]) 14335 for { 14336 x := v_0 14337 if v_1.Op != OpPPC64MOVDconst { 14338 break 14339 } 14340 c := auxIntToInt64(v_1.AuxInt) 14341 if !(uint64(c) < 32) { 14342 break 14343 } 14344 v.reset(OpPPC64SRWconst) 14345 v.AuxInt = int64ToAuxInt(c) 14346 v.AddArg(x) 14347 return true 14348 } 14349 // match: (Rsh32Ux64 x y) 14350 // cond: shiftIsBounded(v) 14351 // result: (SRW x y) 14352 for { 14353 x := v_0 14354 y := v_1 14355 if !(shiftIsBounded(v)) { 14356 break 14357 } 14358 v.reset(OpPPC64SRW) 14359 v.AddArg2(x, y) 14360 return true 14361 } 14362 // match: (Rsh32Ux64 x y) 14363 // result: (SRW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [32])))) 14364 for { 14365 x := v_0 14366 y := v_1 14367 v.reset(OpPPC64SRW) 14368 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14369 v0.AuxInt = int32ToAuxInt(0) 14370 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14371 v1.AuxInt = int64ToAuxInt(-1) 14372 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14373 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14374 v3.AuxInt = int64ToAuxInt(32) 14375 v2.AddArg2(y, v3) 14376 v0.AddArg3(y, v1, v2) 14377 v.AddArg2(x, v0) 14378 return true 14379 } 14380 } 14381 func rewriteValuePPC64_OpRsh32Ux8(v *Value) bool { 14382 v_1 := v.Args[1] 14383 v_0 := v.Args[0] 14384 b := v.Block 14385 typ := &b.Func.Config.Types 14386 // match: (Rsh32Ux8 x y) 14387 // cond: shiftIsBounded(v) 14388 // result: (SRW x y) 14389 for { 14390 x := v_0 14391 y := v_1 14392 if !(shiftIsBounded(v)) { 14393 break 14394 } 14395 v.reset(OpPPC64SRW) 14396 v.AddArg2(x, y) 14397 return true 14398 } 14399 // match: (Rsh32Ux8 x y) 14400 // result: (SRW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [32])))) 14401 for { 14402 x := v_0 14403 y := v_1 14404 v.reset(OpPPC64SRW) 14405 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14406 v0.AuxInt = int32ToAuxInt(0) 14407 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14408 v1.AuxInt = int64ToAuxInt(-1) 14409 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14410 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 14411 v3.AddArg(y) 14412 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14413 v4.AuxInt = int64ToAuxInt(32) 14414 v2.AddArg2(v3, v4) 14415 v0.AddArg3(y, v1, v2) 14416 v.AddArg2(x, v0) 14417 return true 14418 } 14419 } 14420 func rewriteValuePPC64_OpRsh32x16(v *Value) bool { 14421 v_1 := v.Args[1] 14422 v_0 := v.Args[0] 14423 b := v.Block 14424 typ := &b.Func.Config.Types 14425 // match: (Rsh32x16 x y) 14426 // cond: shiftIsBounded(v) 14427 // result: (SRAW x y) 14428 for { 14429 x := v_0 14430 y := v_1 14431 if !(shiftIsBounded(v)) { 14432 break 14433 } 14434 v.reset(OpPPC64SRAW) 14435 v.AddArg2(x, y) 14436 return true 14437 } 14438 // match: (Rsh32x16 x y) 14439 // result: (SRAW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [32])))) 14440 for { 14441 x := v_0 14442 y := v_1 14443 v.reset(OpPPC64SRAW) 14444 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14445 v0.AuxInt = int32ToAuxInt(0) 14446 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14447 v1.AuxInt = int64ToAuxInt(-1) 14448 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14449 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 14450 v3.AddArg(y) 14451 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14452 v4.AuxInt = int64ToAuxInt(32) 14453 v2.AddArg2(v3, v4) 14454 v0.AddArg3(y, v1, v2) 14455 v.AddArg2(x, v0) 14456 return true 14457 } 14458 } 14459 func rewriteValuePPC64_OpRsh32x32(v *Value) bool { 14460 v_1 := v.Args[1] 14461 v_0 := v.Args[0] 14462 b := v.Block 14463 typ := &b.Func.Config.Types 14464 // match: (Rsh32x32 x y) 14465 // cond: shiftIsBounded(v) 14466 // result: (SRAW x y) 14467 for { 14468 x := v_0 14469 y := v_1 14470 if !(shiftIsBounded(v)) { 14471 break 14472 } 14473 v.reset(OpPPC64SRAW) 14474 v.AddArg2(x, y) 14475 return true 14476 } 14477 // match: (Rsh32x32 x y) 14478 // result: (SRAW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [32])))) 14479 for { 14480 x := v_0 14481 y := v_1 14482 v.reset(OpPPC64SRAW) 14483 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14484 v0.AuxInt = int32ToAuxInt(0) 14485 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14486 v1.AuxInt = int64ToAuxInt(-1) 14487 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14488 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14489 v3.AuxInt = int64ToAuxInt(32) 14490 v2.AddArg2(y, v3) 14491 v0.AddArg3(y, v1, v2) 14492 v.AddArg2(x, v0) 14493 return true 14494 } 14495 } 14496 func rewriteValuePPC64_OpRsh32x64(v *Value) bool { 14497 v_1 := v.Args[1] 14498 v_0 := v.Args[0] 14499 b := v.Block 14500 typ := &b.Func.Config.Types 14501 // match: (Rsh32x64 x (MOVDconst [c])) 14502 // cond: uint64(c) >= 32 14503 // result: (SRAWconst x [63]) 14504 for { 14505 x := v_0 14506 if v_1.Op != OpPPC64MOVDconst { 14507 break 14508 } 14509 c := auxIntToInt64(v_1.AuxInt) 14510 if !(uint64(c) >= 32) { 14511 break 14512 } 14513 v.reset(OpPPC64SRAWconst) 14514 v.AuxInt = int64ToAuxInt(63) 14515 v.AddArg(x) 14516 return true 14517 } 14518 // match: (Rsh32x64 x (MOVDconst [c])) 14519 // cond: uint64(c) < 32 14520 // result: (SRAWconst x [c]) 14521 for { 14522 x := v_0 14523 if v_1.Op != OpPPC64MOVDconst { 14524 break 14525 } 14526 c := auxIntToInt64(v_1.AuxInt) 14527 if !(uint64(c) < 32) { 14528 break 14529 } 14530 v.reset(OpPPC64SRAWconst) 14531 v.AuxInt = int64ToAuxInt(c) 14532 v.AddArg(x) 14533 return true 14534 } 14535 // match: (Rsh32x64 x y) 14536 // cond: shiftIsBounded(v) 14537 // result: (SRAW x y) 14538 for { 14539 x := v_0 14540 y := v_1 14541 if !(shiftIsBounded(v)) { 14542 break 14543 } 14544 v.reset(OpPPC64SRAW) 14545 v.AddArg2(x, y) 14546 return true 14547 } 14548 // match: (Rsh32x64 x y) 14549 // result: (SRAW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [32])))) 14550 for { 14551 x := v_0 14552 y := v_1 14553 v.reset(OpPPC64SRAW) 14554 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14555 v0.AuxInt = int32ToAuxInt(0) 14556 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14557 v1.AuxInt = int64ToAuxInt(-1) 14558 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14559 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14560 v3.AuxInt = int64ToAuxInt(32) 14561 v2.AddArg2(y, v3) 14562 v0.AddArg3(y, v1, v2) 14563 v.AddArg2(x, v0) 14564 return true 14565 } 14566 } 14567 func rewriteValuePPC64_OpRsh32x8(v *Value) bool { 14568 v_1 := v.Args[1] 14569 v_0 := v.Args[0] 14570 b := v.Block 14571 typ := &b.Func.Config.Types 14572 // match: (Rsh32x8 x y) 14573 // cond: shiftIsBounded(v) 14574 // result: (SRAW x y) 14575 for { 14576 x := v_0 14577 y := v_1 14578 if !(shiftIsBounded(v)) { 14579 break 14580 } 14581 v.reset(OpPPC64SRAW) 14582 v.AddArg2(x, y) 14583 return true 14584 } 14585 // match: (Rsh32x8 x y) 14586 // result: (SRAW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [32])))) 14587 for { 14588 x := v_0 14589 y := v_1 14590 v.reset(OpPPC64SRAW) 14591 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14592 v0.AuxInt = int32ToAuxInt(0) 14593 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14594 v1.AuxInt = int64ToAuxInt(-1) 14595 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14596 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 14597 v3.AddArg(y) 14598 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14599 v4.AuxInt = int64ToAuxInt(32) 14600 v2.AddArg2(v3, v4) 14601 v0.AddArg3(y, v1, v2) 14602 v.AddArg2(x, v0) 14603 return true 14604 } 14605 } 14606 func rewriteValuePPC64_OpRsh64Ux16(v *Value) bool { 14607 v_1 := v.Args[1] 14608 v_0 := v.Args[0] 14609 b := v.Block 14610 typ := &b.Func.Config.Types 14611 // match: (Rsh64Ux16 x y) 14612 // cond: shiftIsBounded(v) 14613 // result: (SRD x y) 14614 for { 14615 x := v_0 14616 y := v_1 14617 if !(shiftIsBounded(v)) { 14618 break 14619 } 14620 v.reset(OpPPC64SRD) 14621 v.AddArg2(x, y) 14622 return true 14623 } 14624 // match: (Rsh64Ux16 x y) 14625 // result: (SRD x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [64])))) 14626 for { 14627 x := v_0 14628 y := v_1 14629 v.reset(OpPPC64SRD) 14630 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14631 v0.AuxInt = int32ToAuxInt(0) 14632 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14633 v1.AuxInt = int64ToAuxInt(-1) 14634 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14635 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 14636 v3.AddArg(y) 14637 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14638 v4.AuxInt = int64ToAuxInt(64) 14639 v2.AddArg2(v3, v4) 14640 v0.AddArg3(y, v1, v2) 14641 v.AddArg2(x, v0) 14642 return true 14643 } 14644 } 14645 func rewriteValuePPC64_OpRsh64Ux32(v *Value) bool { 14646 v_1 := v.Args[1] 14647 v_0 := v.Args[0] 14648 b := v.Block 14649 typ := &b.Func.Config.Types 14650 // match: (Rsh64Ux32 x y) 14651 // cond: shiftIsBounded(v) 14652 // result: (SRD x y) 14653 for { 14654 x := v_0 14655 y := v_1 14656 if !(shiftIsBounded(v)) { 14657 break 14658 } 14659 v.reset(OpPPC64SRD) 14660 v.AddArg2(x, y) 14661 return true 14662 } 14663 // match: (Rsh64Ux32 x y) 14664 // result: (SRD x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [64])))) 14665 for { 14666 x := v_0 14667 y := v_1 14668 v.reset(OpPPC64SRD) 14669 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14670 v0.AuxInt = int32ToAuxInt(0) 14671 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14672 v1.AuxInt = int64ToAuxInt(-1) 14673 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14674 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14675 v3.AuxInt = int64ToAuxInt(64) 14676 v2.AddArg2(y, v3) 14677 v0.AddArg3(y, v1, v2) 14678 v.AddArg2(x, v0) 14679 return true 14680 } 14681 } 14682 func rewriteValuePPC64_OpRsh64Ux64(v *Value) bool { 14683 v_1 := v.Args[1] 14684 v_0 := v.Args[0] 14685 b := v.Block 14686 typ := &b.Func.Config.Types 14687 // match: (Rsh64Ux64 x (MOVDconst [c])) 14688 // cond: uint64(c) < 64 14689 // result: (SRDconst x [c]) 14690 for { 14691 x := v_0 14692 if v_1.Op != OpPPC64MOVDconst { 14693 break 14694 } 14695 c := auxIntToInt64(v_1.AuxInt) 14696 if !(uint64(c) < 64) { 14697 break 14698 } 14699 v.reset(OpPPC64SRDconst) 14700 v.AuxInt = int64ToAuxInt(c) 14701 v.AddArg(x) 14702 return true 14703 } 14704 // match: (Rsh64Ux64 x y) 14705 // cond: shiftIsBounded(v) 14706 // result: (SRD x y) 14707 for { 14708 x := v_0 14709 y := v_1 14710 if !(shiftIsBounded(v)) { 14711 break 14712 } 14713 v.reset(OpPPC64SRD) 14714 v.AddArg2(x, y) 14715 return true 14716 } 14717 // match: (Rsh64Ux64 x y) 14718 // result: (SRD x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [64])))) 14719 for { 14720 x := v_0 14721 y := v_1 14722 v.reset(OpPPC64SRD) 14723 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14724 v0.AuxInt = int32ToAuxInt(0) 14725 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14726 v1.AuxInt = int64ToAuxInt(-1) 14727 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14728 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14729 v3.AuxInt = int64ToAuxInt(64) 14730 v2.AddArg2(y, v3) 14731 v0.AddArg3(y, v1, v2) 14732 v.AddArg2(x, v0) 14733 return true 14734 } 14735 } 14736 func rewriteValuePPC64_OpRsh64Ux8(v *Value) bool { 14737 v_1 := v.Args[1] 14738 v_0 := v.Args[0] 14739 b := v.Block 14740 typ := &b.Func.Config.Types 14741 // match: (Rsh64Ux8 x y) 14742 // cond: shiftIsBounded(v) 14743 // result: (SRD x y) 14744 for { 14745 x := v_0 14746 y := v_1 14747 if !(shiftIsBounded(v)) { 14748 break 14749 } 14750 v.reset(OpPPC64SRD) 14751 v.AddArg2(x, y) 14752 return true 14753 } 14754 // match: (Rsh64Ux8 x y) 14755 // result: (SRD x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [64])))) 14756 for { 14757 x := v_0 14758 y := v_1 14759 v.reset(OpPPC64SRD) 14760 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14761 v0.AuxInt = int32ToAuxInt(0) 14762 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14763 v1.AuxInt = int64ToAuxInt(-1) 14764 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14765 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 14766 v3.AddArg(y) 14767 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14768 v4.AuxInt = int64ToAuxInt(64) 14769 v2.AddArg2(v3, v4) 14770 v0.AddArg3(y, v1, v2) 14771 v.AddArg2(x, v0) 14772 return true 14773 } 14774 } 14775 func rewriteValuePPC64_OpRsh64x16(v *Value) bool { 14776 v_1 := v.Args[1] 14777 v_0 := v.Args[0] 14778 b := v.Block 14779 typ := &b.Func.Config.Types 14780 // match: (Rsh64x16 x y) 14781 // cond: shiftIsBounded(v) 14782 // result: (SRAD x y) 14783 for { 14784 x := v_0 14785 y := v_1 14786 if !(shiftIsBounded(v)) { 14787 break 14788 } 14789 v.reset(OpPPC64SRAD) 14790 v.AddArg2(x, y) 14791 return true 14792 } 14793 // match: (Rsh64x16 x y) 14794 // result: (SRAD x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [64])))) 14795 for { 14796 x := v_0 14797 y := v_1 14798 v.reset(OpPPC64SRAD) 14799 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14800 v0.AuxInt = int32ToAuxInt(0) 14801 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14802 v1.AuxInt = int64ToAuxInt(-1) 14803 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14804 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 14805 v3.AddArg(y) 14806 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14807 v4.AuxInt = int64ToAuxInt(64) 14808 v2.AddArg2(v3, v4) 14809 v0.AddArg3(y, v1, v2) 14810 v.AddArg2(x, v0) 14811 return true 14812 } 14813 } 14814 func rewriteValuePPC64_OpRsh64x32(v *Value) bool { 14815 v_1 := v.Args[1] 14816 v_0 := v.Args[0] 14817 b := v.Block 14818 typ := &b.Func.Config.Types 14819 // match: (Rsh64x32 x y) 14820 // cond: shiftIsBounded(v) 14821 // result: (SRAD x y) 14822 for { 14823 x := v_0 14824 y := v_1 14825 if !(shiftIsBounded(v)) { 14826 break 14827 } 14828 v.reset(OpPPC64SRAD) 14829 v.AddArg2(x, y) 14830 return true 14831 } 14832 // match: (Rsh64x32 x y) 14833 // result: (SRAD x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [64])))) 14834 for { 14835 x := v_0 14836 y := v_1 14837 v.reset(OpPPC64SRAD) 14838 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14839 v0.AuxInt = int32ToAuxInt(0) 14840 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14841 v1.AuxInt = int64ToAuxInt(-1) 14842 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14843 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14844 v3.AuxInt = int64ToAuxInt(64) 14845 v2.AddArg2(y, v3) 14846 v0.AddArg3(y, v1, v2) 14847 v.AddArg2(x, v0) 14848 return true 14849 } 14850 } 14851 func rewriteValuePPC64_OpRsh64x64(v *Value) bool { 14852 v_1 := v.Args[1] 14853 v_0 := v.Args[0] 14854 b := v.Block 14855 typ := &b.Func.Config.Types 14856 // match: (Rsh64x64 x (MOVDconst [c])) 14857 // cond: uint64(c) >= 64 14858 // result: (SRADconst x [63]) 14859 for { 14860 x := v_0 14861 if v_1.Op != OpPPC64MOVDconst { 14862 break 14863 } 14864 c := auxIntToInt64(v_1.AuxInt) 14865 if !(uint64(c) >= 64) { 14866 break 14867 } 14868 v.reset(OpPPC64SRADconst) 14869 v.AuxInt = int64ToAuxInt(63) 14870 v.AddArg(x) 14871 return true 14872 } 14873 // match: (Rsh64x64 x (MOVDconst [c])) 14874 // cond: uint64(c) < 64 14875 // result: (SRADconst x [c]) 14876 for { 14877 x := v_0 14878 if v_1.Op != OpPPC64MOVDconst { 14879 break 14880 } 14881 c := auxIntToInt64(v_1.AuxInt) 14882 if !(uint64(c) < 64) { 14883 break 14884 } 14885 v.reset(OpPPC64SRADconst) 14886 v.AuxInt = int64ToAuxInt(c) 14887 v.AddArg(x) 14888 return true 14889 } 14890 // match: (Rsh64x64 x y) 14891 // cond: shiftIsBounded(v) 14892 // result: (SRAD x y) 14893 for { 14894 x := v_0 14895 y := v_1 14896 if !(shiftIsBounded(v)) { 14897 break 14898 } 14899 v.reset(OpPPC64SRAD) 14900 v.AddArg2(x, y) 14901 return true 14902 } 14903 // match: (Rsh64x64 x y) 14904 // result: (SRAD x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [64])))) 14905 for { 14906 x := v_0 14907 y := v_1 14908 v.reset(OpPPC64SRAD) 14909 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14910 v0.AuxInt = int32ToAuxInt(0) 14911 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14912 v1.AuxInt = int64ToAuxInt(-1) 14913 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14914 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14915 v3.AuxInt = int64ToAuxInt(64) 14916 v2.AddArg2(y, v3) 14917 v0.AddArg3(y, v1, v2) 14918 v.AddArg2(x, v0) 14919 return true 14920 } 14921 } 14922 func rewriteValuePPC64_OpRsh64x8(v *Value) bool { 14923 v_1 := v.Args[1] 14924 v_0 := v.Args[0] 14925 b := v.Block 14926 typ := &b.Func.Config.Types 14927 // match: (Rsh64x8 x y) 14928 // cond: shiftIsBounded(v) 14929 // result: (SRAD x y) 14930 for { 14931 x := v_0 14932 y := v_1 14933 if !(shiftIsBounded(v)) { 14934 break 14935 } 14936 v.reset(OpPPC64SRAD) 14937 v.AddArg2(x, y) 14938 return true 14939 } 14940 // match: (Rsh64x8 x y) 14941 // result: (SRAD x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [64])))) 14942 for { 14943 x := v_0 14944 y := v_1 14945 v.reset(OpPPC64SRAD) 14946 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14947 v0.AuxInt = int32ToAuxInt(0) 14948 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14949 v1.AuxInt = int64ToAuxInt(-1) 14950 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14951 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 14952 v3.AddArg(y) 14953 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14954 v4.AuxInt = int64ToAuxInt(64) 14955 v2.AddArg2(v3, v4) 14956 v0.AddArg3(y, v1, v2) 14957 v.AddArg2(x, v0) 14958 return true 14959 } 14960 } 14961 func rewriteValuePPC64_OpRsh8Ux16(v *Value) bool { 14962 v_1 := v.Args[1] 14963 v_0 := v.Args[0] 14964 b := v.Block 14965 typ := &b.Func.Config.Types 14966 // match: (Rsh8Ux16 x y) 14967 // cond: shiftIsBounded(v) 14968 // result: (SRW (MOVBZreg x) y) 14969 for { 14970 x := v_0 14971 y := v_1 14972 if !(shiftIsBounded(v)) { 14973 break 14974 } 14975 v.reset(OpPPC64SRW) 14976 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64) 14977 v0.AddArg(x) 14978 v.AddArg2(v0, y) 14979 return true 14980 } 14981 // match: (Rsh8Ux16 x y) 14982 // result: (SRW (ZeroExt8to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [8])))) 14983 for { 14984 x := v_0 14985 y := v_1 14986 v.reset(OpPPC64SRW) 14987 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 14988 v0.AddArg(x) 14989 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 14990 v1.AuxInt = int32ToAuxInt(0) 14991 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14992 v2.AuxInt = int64ToAuxInt(-1) 14993 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 14994 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 14995 v4.AddArg(y) 14996 v5 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 14997 v5.AuxInt = int64ToAuxInt(8) 14998 v3.AddArg2(v4, v5) 14999 v1.AddArg3(y, v2, v3) 15000 v.AddArg2(v0, v1) 15001 return true 15002 } 15003 } 15004 func rewriteValuePPC64_OpRsh8Ux32(v *Value) bool { 15005 v_1 := v.Args[1] 15006 v_0 := v.Args[0] 15007 b := v.Block 15008 typ := &b.Func.Config.Types 15009 // match: (Rsh8Ux32 x y) 15010 // cond: shiftIsBounded(v) 15011 // result: (SRW (MOVBZreg x) y) 15012 for { 15013 x := v_0 15014 y := v_1 15015 if !(shiftIsBounded(v)) { 15016 break 15017 } 15018 v.reset(OpPPC64SRW) 15019 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64) 15020 v0.AddArg(x) 15021 v.AddArg2(v0, y) 15022 return true 15023 } 15024 // match: (Rsh8Ux32 x y) 15025 // result: (SRW (ZeroExt8to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [8])))) 15026 for { 15027 x := v_0 15028 y := v_1 15029 v.reset(OpPPC64SRW) 15030 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 15031 v0.AddArg(x) 15032 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 15033 v1.AuxInt = int32ToAuxInt(0) 15034 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 15035 v2.AuxInt = int64ToAuxInt(-1) 15036 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 15037 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 15038 v4.AuxInt = int64ToAuxInt(8) 15039 v3.AddArg2(y, v4) 15040 v1.AddArg3(y, v2, v3) 15041 v.AddArg2(v0, v1) 15042 return true 15043 } 15044 } 15045 func rewriteValuePPC64_OpRsh8Ux64(v *Value) bool { 15046 v_1 := v.Args[1] 15047 v_0 := v.Args[0] 15048 b := v.Block 15049 typ := &b.Func.Config.Types 15050 // match: (Rsh8Ux64 x (MOVDconst [c])) 15051 // cond: uint64(c) < 8 15052 // result: (SRWconst (ZeroExt8to32 x) [c]) 15053 for { 15054 x := v_0 15055 if v_1.Op != OpPPC64MOVDconst { 15056 break 15057 } 15058 c := auxIntToInt64(v_1.AuxInt) 15059 if !(uint64(c) < 8) { 15060 break 15061 } 15062 v.reset(OpPPC64SRWconst) 15063 v.AuxInt = int64ToAuxInt(c) 15064 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 15065 v0.AddArg(x) 15066 v.AddArg(v0) 15067 return true 15068 } 15069 // match: (Rsh8Ux64 x y) 15070 // cond: shiftIsBounded(v) 15071 // result: (SRW (MOVBZreg x) y) 15072 for { 15073 x := v_0 15074 y := v_1 15075 if !(shiftIsBounded(v)) { 15076 break 15077 } 15078 v.reset(OpPPC64SRW) 15079 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64) 15080 v0.AddArg(x) 15081 v.AddArg2(v0, y) 15082 return true 15083 } 15084 // match: (Rsh8Ux64 x y) 15085 // result: (SRW (ZeroExt8to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [8])))) 15086 for { 15087 x := v_0 15088 y := v_1 15089 v.reset(OpPPC64SRW) 15090 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 15091 v0.AddArg(x) 15092 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 15093 v1.AuxInt = int32ToAuxInt(0) 15094 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 15095 v2.AuxInt = int64ToAuxInt(-1) 15096 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 15097 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 15098 v4.AuxInt = int64ToAuxInt(8) 15099 v3.AddArg2(y, v4) 15100 v1.AddArg3(y, v2, v3) 15101 v.AddArg2(v0, v1) 15102 return true 15103 } 15104 } 15105 func rewriteValuePPC64_OpRsh8Ux8(v *Value) bool { 15106 v_1 := v.Args[1] 15107 v_0 := v.Args[0] 15108 b := v.Block 15109 typ := &b.Func.Config.Types 15110 // match: (Rsh8Ux8 x y) 15111 // cond: shiftIsBounded(v) 15112 // result: (SRW (MOVBZreg x) y) 15113 for { 15114 x := v_0 15115 y := v_1 15116 if !(shiftIsBounded(v)) { 15117 break 15118 } 15119 v.reset(OpPPC64SRW) 15120 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64) 15121 v0.AddArg(x) 15122 v.AddArg2(v0, y) 15123 return true 15124 } 15125 // match: (Rsh8Ux8 x y) 15126 // result: (SRW (ZeroExt8to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [8])))) 15127 for { 15128 x := v_0 15129 y := v_1 15130 v.reset(OpPPC64SRW) 15131 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 15132 v0.AddArg(x) 15133 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 15134 v1.AuxInt = int32ToAuxInt(0) 15135 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 15136 v2.AuxInt = int64ToAuxInt(-1) 15137 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 15138 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 15139 v4.AddArg(y) 15140 v5 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 15141 v5.AuxInt = int64ToAuxInt(8) 15142 v3.AddArg2(v4, v5) 15143 v1.AddArg3(y, v2, v3) 15144 v.AddArg2(v0, v1) 15145 return true 15146 } 15147 } 15148 func rewriteValuePPC64_OpRsh8x16(v *Value) bool { 15149 v_1 := v.Args[1] 15150 v_0 := v.Args[0] 15151 b := v.Block 15152 typ := &b.Func.Config.Types 15153 // match: (Rsh8x16 x y) 15154 // cond: shiftIsBounded(v) 15155 // result: (SRAW (MOVBreg x) y) 15156 for { 15157 x := v_0 15158 y := v_1 15159 if !(shiftIsBounded(v)) { 15160 break 15161 } 15162 v.reset(OpPPC64SRAW) 15163 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64) 15164 v0.AddArg(x) 15165 v.AddArg2(v0, y) 15166 return true 15167 } 15168 // match: (Rsh8x16 x y) 15169 // result: (SRAW (SignExt8to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [8])))) 15170 for { 15171 x := v_0 15172 y := v_1 15173 v.reset(OpPPC64SRAW) 15174 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 15175 v0.AddArg(x) 15176 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 15177 v1.AuxInt = int32ToAuxInt(0) 15178 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 15179 v2.AuxInt = int64ToAuxInt(-1) 15180 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 15181 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 15182 v4.AddArg(y) 15183 v5 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 15184 v5.AuxInt = int64ToAuxInt(8) 15185 v3.AddArg2(v4, v5) 15186 v1.AddArg3(y, v2, v3) 15187 v.AddArg2(v0, v1) 15188 return true 15189 } 15190 } 15191 func rewriteValuePPC64_OpRsh8x32(v *Value) bool { 15192 v_1 := v.Args[1] 15193 v_0 := v.Args[0] 15194 b := v.Block 15195 typ := &b.Func.Config.Types 15196 // match: (Rsh8x32 x y) 15197 // cond: shiftIsBounded(v) 15198 // result: (SRAW (MOVBreg x) y) 15199 for { 15200 x := v_0 15201 y := v_1 15202 if !(shiftIsBounded(v)) { 15203 break 15204 } 15205 v.reset(OpPPC64SRAW) 15206 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64) 15207 v0.AddArg(x) 15208 v.AddArg2(v0, y) 15209 return true 15210 } 15211 // match: (Rsh8x32 x y) 15212 // result: (SRAW (SignExt8to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [8])))) 15213 for { 15214 x := v_0 15215 y := v_1 15216 v.reset(OpPPC64SRAW) 15217 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 15218 v0.AddArg(x) 15219 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 15220 v1.AuxInt = int32ToAuxInt(0) 15221 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 15222 v2.AuxInt = int64ToAuxInt(-1) 15223 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 15224 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 15225 v4.AuxInt = int64ToAuxInt(8) 15226 v3.AddArg2(y, v4) 15227 v1.AddArg3(y, v2, v3) 15228 v.AddArg2(v0, v1) 15229 return true 15230 } 15231 } 15232 func rewriteValuePPC64_OpRsh8x64(v *Value) bool { 15233 v_1 := v.Args[1] 15234 v_0 := v.Args[0] 15235 b := v.Block 15236 typ := &b.Func.Config.Types 15237 // match: (Rsh8x64 x (MOVDconst [c])) 15238 // cond: uint64(c) >= 8 15239 // result: (SRAWconst (SignExt8to32 x) [63]) 15240 for { 15241 x := v_0 15242 if v_1.Op != OpPPC64MOVDconst { 15243 break 15244 } 15245 c := auxIntToInt64(v_1.AuxInt) 15246 if !(uint64(c) >= 8) { 15247 break 15248 } 15249 v.reset(OpPPC64SRAWconst) 15250 v.AuxInt = int64ToAuxInt(63) 15251 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 15252 v0.AddArg(x) 15253 v.AddArg(v0) 15254 return true 15255 } 15256 // match: (Rsh8x64 x (MOVDconst [c])) 15257 // cond: uint64(c) < 8 15258 // result: (SRAWconst (SignExt8to32 x) [c]) 15259 for { 15260 x := v_0 15261 if v_1.Op != OpPPC64MOVDconst { 15262 break 15263 } 15264 c := auxIntToInt64(v_1.AuxInt) 15265 if !(uint64(c) < 8) { 15266 break 15267 } 15268 v.reset(OpPPC64SRAWconst) 15269 v.AuxInt = int64ToAuxInt(c) 15270 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 15271 v0.AddArg(x) 15272 v.AddArg(v0) 15273 return true 15274 } 15275 // match: (Rsh8x64 x y) 15276 // cond: shiftIsBounded(v) 15277 // result: (SRAW (MOVBreg x) y) 15278 for { 15279 x := v_0 15280 y := v_1 15281 if !(shiftIsBounded(v)) { 15282 break 15283 } 15284 v.reset(OpPPC64SRAW) 15285 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64) 15286 v0.AddArg(x) 15287 v.AddArg2(v0, y) 15288 return true 15289 } 15290 // match: (Rsh8x64 x y) 15291 // result: (SRAW (SignExt8to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [8])))) 15292 for { 15293 x := v_0 15294 y := v_1 15295 v.reset(OpPPC64SRAW) 15296 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 15297 v0.AddArg(x) 15298 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 15299 v1.AuxInt = int32ToAuxInt(0) 15300 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 15301 v2.AuxInt = int64ToAuxInt(-1) 15302 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 15303 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 15304 v4.AuxInt = int64ToAuxInt(8) 15305 v3.AddArg2(y, v4) 15306 v1.AddArg3(y, v2, v3) 15307 v.AddArg2(v0, v1) 15308 return true 15309 } 15310 } 15311 func rewriteValuePPC64_OpRsh8x8(v *Value) bool { 15312 v_1 := v.Args[1] 15313 v_0 := v.Args[0] 15314 b := v.Block 15315 typ := &b.Func.Config.Types 15316 // match: (Rsh8x8 x y) 15317 // cond: shiftIsBounded(v) 15318 // result: (SRAW (MOVBreg x) y) 15319 for { 15320 x := v_0 15321 y := v_1 15322 if !(shiftIsBounded(v)) { 15323 break 15324 } 15325 v.reset(OpPPC64SRAW) 15326 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64) 15327 v0.AddArg(x) 15328 v.AddArg2(v0, y) 15329 return true 15330 } 15331 // match: (Rsh8x8 x y) 15332 // result: (SRAW (SignExt8to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [8])))) 15333 for { 15334 x := v_0 15335 y := v_1 15336 v.reset(OpPPC64SRAW) 15337 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 15338 v0.AddArg(x) 15339 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32) 15340 v1.AuxInt = int32ToAuxInt(0) 15341 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 15342 v2.AuxInt = int64ToAuxInt(-1) 15343 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags) 15344 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 15345 v4.AddArg(y) 15346 v5 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64) 15347 v5.AuxInt = int64ToAuxInt(8) 15348 v3.AddArg2(v4, v5) 15349 v1.AddArg3(y, v2, v3) 15350 v.AddArg2(v0, v1) 15351 return true 15352 } 15353 } 15354 func rewriteValuePPC64_OpSelect0(v *Value) bool { 15355 v_0 := v.Args[0] 15356 b := v.Block 15357 typ := &b.Func.Config.Types 15358 // match: (Select0 (Mul64uhilo x y)) 15359 // result: (MULHDU x y) 15360 for { 15361 if v_0.Op != OpMul64uhilo { 15362 break 15363 } 15364 y := v_0.Args[1] 15365 x := v_0.Args[0] 15366 v.reset(OpPPC64MULHDU) 15367 v.AddArg2(x, y) 15368 return true 15369 } 15370 // match: (Select0 (Add64carry x y c)) 15371 // result: (Select0 <typ.UInt64> (ADDE x y (Select1 <typ.UInt64> (ADDCconst c [-1])))) 15372 for { 15373 if v_0.Op != OpAdd64carry { 15374 break 15375 } 15376 c := v_0.Args[2] 15377 x := v_0.Args[0] 15378 y := v_0.Args[1] 15379 v.reset(OpSelect0) 15380 v.Type = typ.UInt64 15381 v0 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64)) 15382 v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64) 15383 v2 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64)) 15384 v2.AuxInt = int64ToAuxInt(-1) 15385 v2.AddArg(c) 15386 v1.AddArg(v2) 15387 v0.AddArg3(x, y, v1) 15388 v.AddArg(v0) 15389 return true 15390 } 15391 // match: (Select0 (Sub64borrow x y c)) 15392 // result: (Select0 <typ.UInt64> (SUBE x y (Select1 <typ.UInt64> (SUBCconst c [0])))) 15393 for { 15394 if v_0.Op != OpSub64borrow { 15395 break 15396 } 15397 c := v_0.Args[2] 15398 x := v_0.Args[0] 15399 y := v_0.Args[1] 15400 v.reset(OpSelect0) 15401 v.Type = typ.UInt64 15402 v0 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64)) 15403 v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64) 15404 v2 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64)) 15405 v2.AuxInt = int64ToAuxInt(0) 15406 v2.AddArg(c) 15407 v1.AddArg(v2) 15408 v0.AddArg3(x, y, v1) 15409 v.AddArg(v0) 15410 return true 15411 } 15412 // match: (Select0 (ANDCCconst [m] (ROTLWconst [r] x))) 15413 // cond: isPPC64WordRotateMask(m) 15414 // result: (RLWINM [encodePPC64RotateMask(r,m,32)] x) 15415 for { 15416 if v_0.Op != OpPPC64ANDCCconst { 15417 break 15418 } 15419 m := auxIntToInt64(v_0.AuxInt) 15420 v_0_0 := v_0.Args[0] 15421 if v_0_0.Op != OpPPC64ROTLWconst { 15422 break 15423 } 15424 r := auxIntToInt64(v_0_0.AuxInt) 15425 x := v_0_0.Args[0] 15426 if !(isPPC64WordRotateMask(m)) { 15427 break 15428 } 15429 v.reset(OpPPC64RLWINM) 15430 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32)) 15431 v.AddArg(x) 15432 return true 15433 } 15434 // match: (Select0 (ANDCCconst [m] (ROTLW x r))) 15435 // cond: isPPC64WordRotateMask(m) 15436 // result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r) 15437 for { 15438 if v_0.Op != OpPPC64ANDCCconst { 15439 break 15440 } 15441 m := auxIntToInt64(v_0.AuxInt) 15442 v_0_0 := v_0.Args[0] 15443 if v_0_0.Op != OpPPC64ROTLW { 15444 break 15445 } 15446 r := v_0_0.Args[1] 15447 x := v_0_0.Args[0] 15448 if !(isPPC64WordRotateMask(m)) { 15449 break 15450 } 15451 v.reset(OpPPC64RLWNM) 15452 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32)) 15453 v.AddArg2(x, r) 15454 return true 15455 } 15456 // match: (Select0 (ANDCCconst [m] (SRWconst x [s]))) 15457 // cond: mergePPC64RShiftMask(m,s,32) == 0 15458 // result: (MOVDconst [0]) 15459 for { 15460 if v_0.Op != OpPPC64ANDCCconst { 15461 break 15462 } 15463 m := auxIntToInt64(v_0.AuxInt) 15464 v_0_0 := v_0.Args[0] 15465 if v_0_0.Op != OpPPC64SRWconst { 15466 break 15467 } 15468 s := auxIntToInt64(v_0_0.AuxInt) 15469 if !(mergePPC64RShiftMask(m, s, 32) == 0) { 15470 break 15471 } 15472 v.reset(OpPPC64MOVDconst) 15473 v.AuxInt = int64ToAuxInt(0) 15474 return true 15475 } 15476 // match: (Select0 (ANDCCconst [m] (SRWconst x [s]))) 15477 // cond: mergePPC64AndSrwi(m,s) != 0 15478 // result: (RLWINM [mergePPC64AndSrwi(m,s)] x) 15479 for { 15480 if v_0.Op != OpPPC64ANDCCconst { 15481 break 15482 } 15483 m := auxIntToInt64(v_0.AuxInt) 15484 v_0_0 := v_0.Args[0] 15485 if v_0_0.Op != OpPPC64SRWconst { 15486 break 15487 } 15488 s := auxIntToInt64(v_0_0.AuxInt) 15489 x := v_0_0.Args[0] 15490 if !(mergePPC64AndSrwi(m, s) != 0) { 15491 break 15492 } 15493 v.reset(OpPPC64RLWINM) 15494 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s)) 15495 v.AddArg(x) 15496 return true 15497 } 15498 // match: (Select0 (ANDCCconst [c] (Select0 (ANDCCconst [d] x)))) 15499 // result: (Select0 (ANDCCconst [c&d] x)) 15500 for { 15501 if v_0.Op != OpPPC64ANDCCconst { 15502 break 15503 } 15504 c := auxIntToInt64(v_0.AuxInt) 15505 v_0_0 := v_0.Args[0] 15506 if v_0_0.Op != OpSelect0 { 15507 break 15508 } 15509 v_0_0_0 := v_0_0.Args[0] 15510 if v_0_0_0.Op != OpPPC64ANDCCconst { 15511 break 15512 } 15513 d := auxIntToInt64(v_0_0_0.AuxInt) 15514 x := v_0_0_0.Args[0] 15515 v.reset(OpSelect0) 15516 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 15517 v0.AuxInt = int64ToAuxInt(c & d) 15518 v0.AddArg(x) 15519 v.AddArg(v0) 15520 return true 15521 } 15522 // match: (Select0 (ANDCCconst [-1] x)) 15523 // result: x 15524 for { 15525 if v_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0.AuxInt) != -1 { 15526 break 15527 } 15528 x := v_0.Args[0] 15529 v.copyOf(x) 15530 return true 15531 } 15532 // match: (Select0 (ANDCCconst [0] _)) 15533 // result: (MOVDconst [0]) 15534 for { 15535 if v_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0.AuxInt) != 0 { 15536 break 15537 } 15538 v.reset(OpPPC64MOVDconst) 15539 v.AuxInt = int64ToAuxInt(0) 15540 return true 15541 } 15542 // match: (Select0 (ANDCCconst [c] y:(MOVBZreg _))) 15543 // cond: c&0xFF == 0xFF 15544 // result: y 15545 for { 15546 if v_0.Op != OpPPC64ANDCCconst { 15547 break 15548 } 15549 c := auxIntToInt64(v_0.AuxInt) 15550 y := v_0.Args[0] 15551 if y.Op != OpPPC64MOVBZreg || !(c&0xFF == 0xFF) { 15552 break 15553 } 15554 v.copyOf(y) 15555 return true 15556 } 15557 // match: (Select0 (ANDCCconst [0xFF] y:(MOVBreg _))) 15558 // result: y 15559 for { 15560 if v_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0.AuxInt) != 0xFF { 15561 break 15562 } 15563 y := v_0.Args[0] 15564 if y.Op != OpPPC64MOVBreg { 15565 break 15566 } 15567 v.copyOf(y) 15568 return true 15569 } 15570 // match: (Select0 (ANDCCconst [c] y:(MOVHZreg _))) 15571 // cond: c&0xFFFF == 0xFFFF 15572 // result: y 15573 for { 15574 if v_0.Op != OpPPC64ANDCCconst { 15575 break 15576 } 15577 c := auxIntToInt64(v_0.AuxInt) 15578 y := v_0.Args[0] 15579 if y.Op != OpPPC64MOVHZreg || !(c&0xFFFF == 0xFFFF) { 15580 break 15581 } 15582 v.copyOf(y) 15583 return true 15584 } 15585 // match: (Select0 (ANDCCconst [0xFFFF] y:(MOVHreg _))) 15586 // result: y 15587 for { 15588 if v_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0.AuxInt) != 0xFFFF { 15589 break 15590 } 15591 y := v_0.Args[0] 15592 if y.Op != OpPPC64MOVHreg { 15593 break 15594 } 15595 v.copyOf(y) 15596 return true 15597 } 15598 // match: (Select0 (ANDCCconst [c] (MOVBreg x))) 15599 // result: (Select0 (ANDCCconst [c&0xFF] x)) 15600 for { 15601 if v_0.Op != OpPPC64ANDCCconst { 15602 break 15603 } 15604 c := auxIntToInt64(v_0.AuxInt) 15605 v_0_0 := v_0.Args[0] 15606 if v_0_0.Op != OpPPC64MOVBreg { 15607 break 15608 } 15609 x := v_0_0.Args[0] 15610 v.reset(OpSelect0) 15611 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 15612 v0.AuxInt = int64ToAuxInt(c & 0xFF) 15613 v0.AddArg(x) 15614 v.AddArg(v0) 15615 return true 15616 } 15617 // match: (Select0 (ANDCCconst [c] (MOVBZreg x))) 15618 // result: (Select0 (ANDCCconst [c&0xFF] x)) 15619 for { 15620 if v_0.Op != OpPPC64ANDCCconst { 15621 break 15622 } 15623 c := auxIntToInt64(v_0.AuxInt) 15624 v_0_0 := v_0.Args[0] 15625 if v_0_0.Op != OpPPC64MOVBZreg { 15626 break 15627 } 15628 x := v_0_0.Args[0] 15629 v.reset(OpSelect0) 15630 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 15631 v0.AuxInt = int64ToAuxInt(c & 0xFF) 15632 v0.AddArg(x) 15633 v.AddArg(v0) 15634 return true 15635 } 15636 // match: (Select0 (ANDCCconst [c] (MOVHreg x))) 15637 // result: (Select0 (ANDCCconst [c&0xFFFF] x)) 15638 for { 15639 if v_0.Op != OpPPC64ANDCCconst { 15640 break 15641 } 15642 c := auxIntToInt64(v_0.AuxInt) 15643 v_0_0 := v_0.Args[0] 15644 if v_0_0.Op != OpPPC64MOVHreg { 15645 break 15646 } 15647 x := v_0_0.Args[0] 15648 v.reset(OpSelect0) 15649 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 15650 v0.AuxInt = int64ToAuxInt(c & 0xFFFF) 15651 v0.AddArg(x) 15652 v.AddArg(v0) 15653 return true 15654 } 15655 // match: (Select0 (ANDCCconst [c] (MOVHZreg x))) 15656 // result: (Select0 (ANDCCconst [c&0xFFFF] x)) 15657 for { 15658 if v_0.Op != OpPPC64ANDCCconst { 15659 break 15660 } 15661 c := auxIntToInt64(v_0.AuxInt) 15662 v_0_0 := v_0.Args[0] 15663 if v_0_0.Op != OpPPC64MOVHZreg { 15664 break 15665 } 15666 x := v_0_0.Args[0] 15667 v.reset(OpSelect0) 15668 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 15669 v0.AuxInt = int64ToAuxInt(c & 0xFFFF) 15670 v0.AddArg(x) 15671 v.AddArg(v0) 15672 return true 15673 } 15674 // match: (Select0 (ANDCCconst [c] (MOVWreg x))) 15675 // result: (Select0 (ANDCCconst [c&0xFFFFFFFF] x)) 15676 for { 15677 if v_0.Op != OpPPC64ANDCCconst { 15678 break 15679 } 15680 c := auxIntToInt64(v_0.AuxInt) 15681 v_0_0 := v_0.Args[0] 15682 if v_0_0.Op != OpPPC64MOVWreg { 15683 break 15684 } 15685 x := v_0_0.Args[0] 15686 v.reset(OpSelect0) 15687 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 15688 v0.AuxInt = int64ToAuxInt(c & 0xFFFFFFFF) 15689 v0.AddArg(x) 15690 v.AddArg(v0) 15691 return true 15692 } 15693 // match: (Select0 (ANDCCconst [c] (MOVWZreg x))) 15694 // result: (Select0 (ANDCCconst [c&0xFFFFFFFF] x)) 15695 for { 15696 if v_0.Op != OpPPC64ANDCCconst { 15697 break 15698 } 15699 c := auxIntToInt64(v_0.AuxInt) 15700 v_0_0 := v_0.Args[0] 15701 if v_0_0.Op != OpPPC64MOVWZreg { 15702 break 15703 } 15704 x := v_0_0.Args[0] 15705 v.reset(OpSelect0) 15706 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 15707 v0.AuxInt = int64ToAuxInt(c & 0xFFFFFFFF) 15708 v0.AddArg(x) 15709 v.AddArg(v0) 15710 return true 15711 } 15712 return false 15713 } 15714 func rewriteValuePPC64_OpSelect1(v *Value) bool { 15715 v_0 := v.Args[0] 15716 b := v.Block 15717 typ := &b.Func.Config.Types 15718 // match: (Select1 (Mul64uhilo x y)) 15719 // result: (MULLD x y) 15720 for { 15721 if v_0.Op != OpMul64uhilo { 15722 break 15723 } 15724 y := v_0.Args[1] 15725 x := v_0.Args[0] 15726 v.reset(OpPPC64MULLD) 15727 v.AddArg2(x, y) 15728 return true 15729 } 15730 // match: (Select1 (Add64carry x y c)) 15731 // result: (ADDZEzero (Select1 <typ.UInt64> (ADDE x y (Select1 <typ.UInt64> (ADDCconst c [-1]))))) 15732 for { 15733 if v_0.Op != OpAdd64carry { 15734 break 15735 } 15736 c := v_0.Args[2] 15737 x := v_0.Args[0] 15738 y := v_0.Args[1] 15739 v.reset(OpPPC64ADDZEzero) 15740 v0 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64) 15741 v1 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64)) 15742 v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64) 15743 v3 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64)) 15744 v3.AuxInt = int64ToAuxInt(-1) 15745 v3.AddArg(c) 15746 v2.AddArg(v3) 15747 v1.AddArg3(x, y, v2) 15748 v0.AddArg(v1) 15749 v.AddArg(v0) 15750 return true 15751 } 15752 // match: (Select1 (ADDCconst n:(ADDZEzero x) [-1])) 15753 // cond: n.Uses <= 2 15754 // result: x 15755 for { 15756 if v_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_0.AuxInt) != -1 { 15757 break 15758 } 15759 n := v_0.Args[0] 15760 if n.Op != OpPPC64ADDZEzero { 15761 break 15762 } 15763 x := n.Args[0] 15764 if !(n.Uses <= 2) { 15765 break 15766 } 15767 v.copyOf(x) 15768 return true 15769 } 15770 // match: (Select1 (Sub64borrow x y c)) 15771 // result: (NEG (SUBZEzero (Select1 <typ.UInt64> (SUBE x y (Select1 <typ.UInt64> (SUBCconst c [0])))))) 15772 for { 15773 if v_0.Op != OpSub64borrow { 15774 break 15775 } 15776 c := v_0.Args[2] 15777 x := v_0.Args[0] 15778 y := v_0.Args[1] 15779 v.reset(OpPPC64NEG) 15780 v0 := b.NewValue0(v.Pos, OpPPC64SUBZEzero, typ.UInt64) 15781 v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64) 15782 v2 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64)) 15783 v3 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64) 15784 v4 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64)) 15785 v4.AuxInt = int64ToAuxInt(0) 15786 v4.AddArg(c) 15787 v3.AddArg(v4) 15788 v2.AddArg3(x, y, v3) 15789 v1.AddArg(v2) 15790 v0.AddArg(v1) 15791 v.AddArg(v0) 15792 return true 15793 } 15794 // match: (Select1 (SUBCconst n:(NEG (SUBZEzero x)) [0])) 15795 // cond: n.Uses <= 2 15796 // result: x 15797 for { 15798 if v_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_0.AuxInt) != 0 { 15799 break 15800 } 15801 n := v_0.Args[0] 15802 if n.Op != OpPPC64NEG { 15803 break 15804 } 15805 n_0 := n.Args[0] 15806 if n_0.Op != OpPPC64SUBZEzero { 15807 break 15808 } 15809 x := n_0.Args[0] 15810 if !(n.Uses <= 2) { 15811 break 15812 } 15813 v.copyOf(x) 15814 return true 15815 } 15816 return false 15817 } 15818 func rewriteValuePPC64_OpSelectN(v *Value) bool { 15819 v_0 := v.Args[0] 15820 b := v.Block 15821 config := b.Func.Config 15822 // match: (SelectN [0] call:(CALLstatic {sym} s1:(MOVDstore _ (MOVDconst [sz]) s2:(MOVDstore _ src s3:(MOVDstore {t} _ dst mem))))) 15823 // cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(s1, s2, s3, call) 15824 // result: (Move [sz] dst src mem) 15825 for { 15826 if auxIntToInt64(v.AuxInt) != 0 { 15827 break 15828 } 15829 call := v_0 15830 if call.Op != OpPPC64CALLstatic || len(call.Args) != 1 { 15831 break 15832 } 15833 sym := auxToCall(call.Aux) 15834 s1 := call.Args[0] 15835 if s1.Op != OpPPC64MOVDstore { 15836 break 15837 } 15838 _ = s1.Args[2] 15839 s1_1 := s1.Args[1] 15840 if s1_1.Op != OpPPC64MOVDconst { 15841 break 15842 } 15843 sz := auxIntToInt64(s1_1.AuxInt) 15844 s2 := s1.Args[2] 15845 if s2.Op != OpPPC64MOVDstore { 15846 break 15847 } 15848 _ = s2.Args[2] 15849 src := s2.Args[1] 15850 s3 := s2.Args[2] 15851 if s3.Op != OpPPC64MOVDstore { 15852 break 15853 } 15854 mem := s3.Args[2] 15855 dst := s3.Args[1] 15856 if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(s1, s2, s3, call)) { 15857 break 15858 } 15859 v.reset(OpMove) 15860 v.AuxInt = int64ToAuxInt(sz) 15861 v.AddArg3(dst, src, mem) 15862 return true 15863 } 15864 // match: (SelectN [0] call:(CALLstatic {sym} dst src (MOVDconst [sz]) mem)) 15865 // cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call) 15866 // result: (Move [sz] dst src mem) 15867 for { 15868 if auxIntToInt64(v.AuxInt) != 0 { 15869 break 15870 } 15871 call := v_0 15872 if call.Op != OpPPC64CALLstatic || len(call.Args) != 4 { 15873 break 15874 } 15875 sym := auxToCall(call.Aux) 15876 mem := call.Args[3] 15877 dst := call.Args[0] 15878 src := call.Args[1] 15879 call_2 := call.Args[2] 15880 if call_2.Op != OpPPC64MOVDconst { 15881 break 15882 } 15883 sz := auxIntToInt64(call_2.AuxInt) 15884 if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)) { 15885 break 15886 } 15887 v.reset(OpMove) 15888 v.AuxInt = int64ToAuxInt(sz) 15889 v.AddArg3(dst, src, mem) 15890 return true 15891 } 15892 return false 15893 } 15894 func rewriteValuePPC64_OpSlicemask(v *Value) bool { 15895 v_0 := v.Args[0] 15896 b := v.Block 15897 // match: (Slicemask <t> x) 15898 // result: (SRADconst (NEG <t> x) [63]) 15899 for { 15900 t := v.Type 15901 x := v_0 15902 v.reset(OpPPC64SRADconst) 15903 v.AuxInt = int64ToAuxInt(63) 15904 v0 := b.NewValue0(v.Pos, OpPPC64NEG, t) 15905 v0.AddArg(x) 15906 v.AddArg(v0) 15907 return true 15908 } 15909 } 15910 func rewriteValuePPC64_OpStore(v *Value) bool { 15911 v_2 := v.Args[2] 15912 v_1 := v.Args[1] 15913 v_0 := v.Args[0] 15914 // match: (Store {t} ptr val mem) 15915 // cond: t.Size() == 8 && is64BitFloat(val.Type) 15916 // result: (FMOVDstore ptr val mem) 15917 for { 15918 t := auxToType(v.Aux) 15919 ptr := v_0 15920 val := v_1 15921 mem := v_2 15922 if !(t.Size() == 8 && is64BitFloat(val.Type)) { 15923 break 15924 } 15925 v.reset(OpPPC64FMOVDstore) 15926 v.AddArg3(ptr, val, mem) 15927 return true 15928 } 15929 // match: (Store {t} ptr val mem) 15930 // cond: t.Size() == 8 && is32BitFloat(val.Type) 15931 // result: (FMOVDstore ptr val mem) 15932 for { 15933 t := auxToType(v.Aux) 15934 ptr := v_0 15935 val := v_1 15936 mem := v_2 15937 if !(t.Size() == 8 && is32BitFloat(val.Type)) { 15938 break 15939 } 15940 v.reset(OpPPC64FMOVDstore) 15941 v.AddArg3(ptr, val, mem) 15942 return true 15943 } 15944 // match: (Store {t} ptr val mem) 15945 // cond: t.Size() == 4 && is32BitFloat(val.Type) 15946 // result: (FMOVSstore ptr val mem) 15947 for { 15948 t := auxToType(v.Aux) 15949 ptr := v_0 15950 val := v_1 15951 mem := v_2 15952 if !(t.Size() == 4 && is32BitFloat(val.Type)) { 15953 break 15954 } 15955 v.reset(OpPPC64FMOVSstore) 15956 v.AddArg3(ptr, val, mem) 15957 return true 15958 } 15959 // match: (Store {t} ptr val mem) 15960 // cond: t.Size() == 8 && !is64BitFloat(val.Type) 15961 // result: (MOVDstore ptr val mem) 15962 for { 15963 t := auxToType(v.Aux) 15964 ptr := v_0 15965 val := v_1 15966 mem := v_2 15967 if !(t.Size() == 8 && !is64BitFloat(val.Type)) { 15968 break 15969 } 15970 v.reset(OpPPC64MOVDstore) 15971 v.AddArg3(ptr, val, mem) 15972 return true 15973 } 15974 // match: (Store {t} ptr val mem) 15975 // cond: t.Size() == 4 && is32BitInt(val.Type) 15976 // result: (MOVWstore ptr val mem) 15977 for { 15978 t := auxToType(v.Aux) 15979 ptr := v_0 15980 val := v_1 15981 mem := v_2 15982 if !(t.Size() == 4 && is32BitInt(val.Type)) { 15983 break 15984 } 15985 v.reset(OpPPC64MOVWstore) 15986 v.AddArg3(ptr, val, mem) 15987 return true 15988 } 15989 // match: (Store {t} ptr val mem) 15990 // cond: t.Size() == 2 15991 // result: (MOVHstore ptr val mem) 15992 for { 15993 t := auxToType(v.Aux) 15994 ptr := v_0 15995 val := v_1 15996 mem := v_2 15997 if !(t.Size() == 2) { 15998 break 15999 } 16000 v.reset(OpPPC64MOVHstore) 16001 v.AddArg3(ptr, val, mem) 16002 return true 16003 } 16004 // match: (Store {t} ptr val mem) 16005 // cond: t.Size() == 1 16006 // result: (MOVBstore ptr val mem) 16007 for { 16008 t := auxToType(v.Aux) 16009 ptr := v_0 16010 val := v_1 16011 mem := v_2 16012 if !(t.Size() == 1) { 16013 break 16014 } 16015 v.reset(OpPPC64MOVBstore) 16016 v.AddArg3(ptr, val, mem) 16017 return true 16018 } 16019 return false 16020 } 16021 func rewriteValuePPC64_OpTrunc16to8(v *Value) bool { 16022 v_0 := v.Args[0] 16023 // match: (Trunc16to8 <t> x) 16024 // cond: isSigned(t) 16025 // result: (MOVBreg x) 16026 for { 16027 t := v.Type 16028 x := v_0 16029 if !(isSigned(t)) { 16030 break 16031 } 16032 v.reset(OpPPC64MOVBreg) 16033 v.AddArg(x) 16034 return true 16035 } 16036 // match: (Trunc16to8 x) 16037 // result: (MOVBZreg x) 16038 for { 16039 x := v_0 16040 v.reset(OpPPC64MOVBZreg) 16041 v.AddArg(x) 16042 return true 16043 } 16044 } 16045 func rewriteValuePPC64_OpTrunc32to16(v *Value) bool { 16046 v_0 := v.Args[0] 16047 // match: (Trunc32to16 <t> x) 16048 // cond: isSigned(t) 16049 // result: (MOVHreg x) 16050 for { 16051 t := v.Type 16052 x := v_0 16053 if !(isSigned(t)) { 16054 break 16055 } 16056 v.reset(OpPPC64MOVHreg) 16057 v.AddArg(x) 16058 return true 16059 } 16060 // match: (Trunc32to16 x) 16061 // result: (MOVHZreg x) 16062 for { 16063 x := v_0 16064 v.reset(OpPPC64MOVHZreg) 16065 v.AddArg(x) 16066 return true 16067 } 16068 } 16069 func rewriteValuePPC64_OpTrunc32to8(v *Value) bool { 16070 v_0 := v.Args[0] 16071 // match: (Trunc32to8 <t> x) 16072 // cond: isSigned(t) 16073 // result: (MOVBreg x) 16074 for { 16075 t := v.Type 16076 x := v_0 16077 if !(isSigned(t)) { 16078 break 16079 } 16080 v.reset(OpPPC64MOVBreg) 16081 v.AddArg(x) 16082 return true 16083 } 16084 // match: (Trunc32to8 x) 16085 // result: (MOVBZreg x) 16086 for { 16087 x := v_0 16088 v.reset(OpPPC64MOVBZreg) 16089 v.AddArg(x) 16090 return true 16091 } 16092 } 16093 func rewriteValuePPC64_OpTrunc64to16(v *Value) bool { 16094 v_0 := v.Args[0] 16095 // match: (Trunc64to16 <t> x) 16096 // cond: isSigned(t) 16097 // result: (MOVHreg x) 16098 for { 16099 t := v.Type 16100 x := v_0 16101 if !(isSigned(t)) { 16102 break 16103 } 16104 v.reset(OpPPC64MOVHreg) 16105 v.AddArg(x) 16106 return true 16107 } 16108 // match: (Trunc64to16 x) 16109 // result: (MOVHZreg x) 16110 for { 16111 x := v_0 16112 v.reset(OpPPC64MOVHZreg) 16113 v.AddArg(x) 16114 return true 16115 } 16116 } 16117 func rewriteValuePPC64_OpTrunc64to32(v *Value) bool { 16118 v_0 := v.Args[0] 16119 // match: (Trunc64to32 <t> x) 16120 // cond: isSigned(t) 16121 // result: (MOVWreg x) 16122 for { 16123 t := v.Type 16124 x := v_0 16125 if !(isSigned(t)) { 16126 break 16127 } 16128 v.reset(OpPPC64MOVWreg) 16129 v.AddArg(x) 16130 return true 16131 } 16132 // match: (Trunc64to32 x) 16133 // result: (MOVWZreg x) 16134 for { 16135 x := v_0 16136 v.reset(OpPPC64MOVWZreg) 16137 v.AddArg(x) 16138 return true 16139 } 16140 } 16141 func rewriteValuePPC64_OpTrunc64to8(v *Value) bool { 16142 v_0 := v.Args[0] 16143 // match: (Trunc64to8 <t> x) 16144 // cond: isSigned(t) 16145 // result: (MOVBreg x) 16146 for { 16147 t := v.Type 16148 x := v_0 16149 if !(isSigned(t)) { 16150 break 16151 } 16152 v.reset(OpPPC64MOVBreg) 16153 v.AddArg(x) 16154 return true 16155 } 16156 // match: (Trunc64to8 x) 16157 // result: (MOVBZreg x) 16158 for { 16159 x := v_0 16160 v.reset(OpPPC64MOVBZreg) 16161 v.AddArg(x) 16162 return true 16163 } 16164 } 16165 func rewriteValuePPC64_OpZero(v *Value) bool { 16166 v_1 := v.Args[1] 16167 v_0 := v.Args[0] 16168 b := v.Block 16169 // match: (Zero [0] _ mem) 16170 // result: mem 16171 for { 16172 if auxIntToInt64(v.AuxInt) != 0 { 16173 break 16174 } 16175 mem := v_1 16176 v.copyOf(mem) 16177 return true 16178 } 16179 // match: (Zero [1] destptr mem) 16180 // result: (MOVBstorezero destptr mem) 16181 for { 16182 if auxIntToInt64(v.AuxInt) != 1 { 16183 break 16184 } 16185 destptr := v_0 16186 mem := v_1 16187 v.reset(OpPPC64MOVBstorezero) 16188 v.AddArg2(destptr, mem) 16189 return true 16190 } 16191 // match: (Zero [2] destptr mem) 16192 // result: (MOVHstorezero destptr mem) 16193 for { 16194 if auxIntToInt64(v.AuxInt) != 2 { 16195 break 16196 } 16197 destptr := v_0 16198 mem := v_1 16199 v.reset(OpPPC64MOVHstorezero) 16200 v.AddArg2(destptr, mem) 16201 return true 16202 } 16203 // match: (Zero [3] destptr mem) 16204 // result: (MOVBstorezero [2] destptr (MOVHstorezero destptr mem)) 16205 for { 16206 if auxIntToInt64(v.AuxInt) != 3 { 16207 break 16208 } 16209 destptr := v_0 16210 mem := v_1 16211 v.reset(OpPPC64MOVBstorezero) 16212 v.AuxInt = int32ToAuxInt(2) 16213 v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem) 16214 v0.AddArg2(destptr, mem) 16215 v.AddArg2(destptr, v0) 16216 return true 16217 } 16218 // match: (Zero [4] destptr mem) 16219 // result: (MOVWstorezero destptr mem) 16220 for { 16221 if auxIntToInt64(v.AuxInt) != 4 { 16222 break 16223 } 16224 destptr := v_0 16225 mem := v_1 16226 v.reset(OpPPC64MOVWstorezero) 16227 v.AddArg2(destptr, mem) 16228 return true 16229 } 16230 // match: (Zero [5] destptr mem) 16231 // result: (MOVBstorezero [4] destptr (MOVWstorezero destptr mem)) 16232 for { 16233 if auxIntToInt64(v.AuxInt) != 5 { 16234 break 16235 } 16236 destptr := v_0 16237 mem := v_1 16238 v.reset(OpPPC64MOVBstorezero) 16239 v.AuxInt = int32ToAuxInt(4) 16240 v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem) 16241 v0.AddArg2(destptr, mem) 16242 v.AddArg2(destptr, v0) 16243 return true 16244 } 16245 // match: (Zero [6] destptr mem) 16246 // result: (MOVHstorezero [4] destptr (MOVWstorezero destptr mem)) 16247 for { 16248 if auxIntToInt64(v.AuxInt) != 6 { 16249 break 16250 } 16251 destptr := v_0 16252 mem := v_1 16253 v.reset(OpPPC64MOVHstorezero) 16254 v.AuxInt = int32ToAuxInt(4) 16255 v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem) 16256 v0.AddArg2(destptr, mem) 16257 v.AddArg2(destptr, v0) 16258 return true 16259 } 16260 // match: (Zero [7] destptr mem) 16261 // result: (MOVBstorezero [6] destptr (MOVHstorezero [4] destptr (MOVWstorezero destptr mem))) 16262 for { 16263 if auxIntToInt64(v.AuxInt) != 7 { 16264 break 16265 } 16266 destptr := v_0 16267 mem := v_1 16268 v.reset(OpPPC64MOVBstorezero) 16269 v.AuxInt = int32ToAuxInt(6) 16270 v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem) 16271 v0.AuxInt = int32ToAuxInt(4) 16272 v1 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem) 16273 v1.AddArg2(destptr, mem) 16274 v0.AddArg2(destptr, v1) 16275 v.AddArg2(destptr, v0) 16276 return true 16277 } 16278 // match: (Zero [8] {t} destptr mem) 16279 // result: (MOVDstorezero destptr mem) 16280 for { 16281 if auxIntToInt64(v.AuxInt) != 8 { 16282 break 16283 } 16284 destptr := v_0 16285 mem := v_1 16286 v.reset(OpPPC64MOVDstorezero) 16287 v.AddArg2(destptr, mem) 16288 return true 16289 } 16290 // match: (Zero [12] {t} destptr mem) 16291 // result: (MOVWstorezero [8] destptr (MOVDstorezero [0] destptr mem)) 16292 for { 16293 if auxIntToInt64(v.AuxInt) != 12 { 16294 break 16295 } 16296 destptr := v_0 16297 mem := v_1 16298 v.reset(OpPPC64MOVWstorezero) 16299 v.AuxInt = int32ToAuxInt(8) 16300 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem) 16301 v0.AuxInt = int32ToAuxInt(0) 16302 v0.AddArg2(destptr, mem) 16303 v.AddArg2(destptr, v0) 16304 return true 16305 } 16306 // match: (Zero [16] {t} destptr mem) 16307 // result: (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem)) 16308 for { 16309 if auxIntToInt64(v.AuxInt) != 16 { 16310 break 16311 } 16312 destptr := v_0 16313 mem := v_1 16314 v.reset(OpPPC64MOVDstorezero) 16315 v.AuxInt = int32ToAuxInt(8) 16316 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem) 16317 v0.AuxInt = int32ToAuxInt(0) 16318 v0.AddArg2(destptr, mem) 16319 v.AddArg2(destptr, v0) 16320 return true 16321 } 16322 // match: (Zero [24] {t} destptr mem) 16323 // result: (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem))) 16324 for { 16325 if auxIntToInt64(v.AuxInt) != 24 { 16326 break 16327 } 16328 destptr := v_0 16329 mem := v_1 16330 v.reset(OpPPC64MOVDstorezero) 16331 v.AuxInt = int32ToAuxInt(16) 16332 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem) 16333 v0.AuxInt = int32ToAuxInt(8) 16334 v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem) 16335 v1.AuxInt = int32ToAuxInt(0) 16336 v1.AddArg2(destptr, mem) 16337 v0.AddArg2(destptr, v1) 16338 v.AddArg2(destptr, v0) 16339 return true 16340 } 16341 // match: (Zero [32] {t} destptr mem) 16342 // result: (MOVDstorezero [24] destptr (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem)))) 16343 for { 16344 if auxIntToInt64(v.AuxInt) != 32 { 16345 break 16346 } 16347 destptr := v_0 16348 mem := v_1 16349 v.reset(OpPPC64MOVDstorezero) 16350 v.AuxInt = int32ToAuxInt(24) 16351 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem) 16352 v0.AuxInt = int32ToAuxInt(16) 16353 v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem) 16354 v1.AuxInt = int32ToAuxInt(8) 16355 v2 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem) 16356 v2.AuxInt = int32ToAuxInt(0) 16357 v2.AddArg2(destptr, mem) 16358 v1.AddArg2(destptr, v2) 16359 v0.AddArg2(destptr, v1) 16360 v.AddArg2(destptr, v0) 16361 return true 16362 } 16363 // match: (Zero [s] ptr mem) 16364 // cond: buildcfg.GOPPC64 <= 8 && s < 64 16365 // result: (LoweredZeroShort [s] ptr mem) 16366 for { 16367 s := auxIntToInt64(v.AuxInt) 16368 ptr := v_0 16369 mem := v_1 16370 if !(buildcfg.GOPPC64 <= 8 && s < 64) { 16371 break 16372 } 16373 v.reset(OpPPC64LoweredZeroShort) 16374 v.AuxInt = int64ToAuxInt(s) 16375 v.AddArg2(ptr, mem) 16376 return true 16377 } 16378 // match: (Zero [s] ptr mem) 16379 // cond: buildcfg.GOPPC64 <= 8 16380 // result: (LoweredZero [s] ptr mem) 16381 for { 16382 s := auxIntToInt64(v.AuxInt) 16383 ptr := v_0 16384 mem := v_1 16385 if !(buildcfg.GOPPC64 <= 8) { 16386 break 16387 } 16388 v.reset(OpPPC64LoweredZero) 16389 v.AuxInt = int64ToAuxInt(s) 16390 v.AddArg2(ptr, mem) 16391 return true 16392 } 16393 // match: (Zero [s] ptr mem) 16394 // cond: s < 128 && buildcfg.GOPPC64 >= 9 16395 // result: (LoweredQuadZeroShort [s] ptr mem) 16396 for { 16397 s := auxIntToInt64(v.AuxInt) 16398 ptr := v_0 16399 mem := v_1 16400 if !(s < 128 && buildcfg.GOPPC64 >= 9) { 16401 break 16402 } 16403 v.reset(OpPPC64LoweredQuadZeroShort) 16404 v.AuxInt = int64ToAuxInt(s) 16405 v.AddArg2(ptr, mem) 16406 return true 16407 } 16408 // match: (Zero [s] ptr mem) 16409 // cond: buildcfg.GOPPC64 >= 9 16410 // result: (LoweredQuadZero [s] ptr mem) 16411 for { 16412 s := auxIntToInt64(v.AuxInt) 16413 ptr := v_0 16414 mem := v_1 16415 if !(buildcfg.GOPPC64 >= 9) { 16416 break 16417 } 16418 v.reset(OpPPC64LoweredQuadZero) 16419 v.AuxInt = int64ToAuxInt(s) 16420 v.AddArg2(ptr, mem) 16421 return true 16422 } 16423 return false 16424 } 16425 func rewriteBlockPPC64(b *Block) bool { 16426 typ := &b.Func.Config.Types 16427 switch b.Kind { 16428 case BlockPPC64EQ: 16429 // match: (EQ (CMPconst [0] (Select0 (ANDCCconst [c] x))) yes no) 16430 // result: (EQ (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no) 16431 for b.Controls[0].Op == OpPPC64CMPconst { 16432 v_0 := b.Controls[0] 16433 if auxIntToInt64(v_0.AuxInt) != 0 { 16434 break 16435 } 16436 v_0_0 := v_0.Args[0] 16437 if v_0_0.Op != OpSelect0 { 16438 break 16439 } 16440 v_0_0_0 := v_0_0.Args[0] 16441 if v_0_0_0.Op != OpPPC64ANDCCconst { 16442 break 16443 } 16444 c := auxIntToInt64(v_0_0_0.AuxInt) 16445 x := v_0_0_0.Args[0] 16446 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 16447 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 16448 v1.AuxInt = int64ToAuxInt(c) 16449 v1.AddArg(x) 16450 v0.AddArg(v1) 16451 b.resetWithControl(BlockPPC64EQ, v0) 16452 return true 16453 } 16454 // match: (EQ (CMPWconst [0] (Select0 (ANDCCconst [c] x))) yes no) 16455 // result: (EQ (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no) 16456 for b.Controls[0].Op == OpPPC64CMPWconst { 16457 v_0 := b.Controls[0] 16458 if auxIntToInt32(v_0.AuxInt) != 0 { 16459 break 16460 } 16461 v_0_0 := v_0.Args[0] 16462 if v_0_0.Op != OpSelect0 { 16463 break 16464 } 16465 v_0_0_0 := v_0_0.Args[0] 16466 if v_0_0_0.Op != OpPPC64ANDCCconst { 16467 break 16468 } 16469 c := auxIntToInt64(v_0_0_0.AuxInt) 16470 x := v_0_0_0.Args[0] 16471 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 16472 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 16473 v1.AuxInt = int64ToAuxInt(c) 16474 v1.AddArg(x) 16475 v0.AddArg(v1) 16476 b.resetWithControl(BlockPPC64EQ, v0) 16477 return true 16478 } 16479 // match: (EQ (FlagEQ) yes no) 16480 // result: (First yes no) 16481 for b.Controls[0].Op == OpPPC64FlagEQ { 16482 b.Reset(BlockFirst) 16483 return true 16484 } 16485 // match: (EQ (FlagLT) yes no) 16486 // result: (First no yes) 16487 for b.Controls[0].Op == OpPPC64FlagLT { 16488 b.Reset(BlockFirst) 16489 b.swapSuccessors() 16490 return true 16491 } 16492 // match: (EQ (FlagGT) yes no) 16493 // result: (First no yes) 16494 for b.Controls[0].Op == OpPPC64FlagGT { 16495 b.Reset(BlockFirst) 16496 b.swapSuccessors() 16497 return true 16498 } 16499 // match: (EQ (InvertFlags cmp) yes no) 16500 // result: (EQ cmp yes no) 16501 for b.Controls[0].Op == OpPPC64InvertFlags { 16502 v_0 := b.Controls[0] 16503 cmp := v_0.Args[0] 16504 b.resetWithControl(BlockPPC64EQ, cmp) 16505 return true 16506 } 16507 // match: (EQ (CMPconst [0] (Select0 (ANDCCconst [c] x))) yes no) 16508 // result: (EQ (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no) 16509 for b.Controls[0].Op == OpPPC64CMPconst { 16510 v_0 := b.Controls[0] 16511 if auxIntToInt64(v_0.AuxInt) != 0 { 16512 break 16513 } 16514 v_0_0 := v_0.Args[0] 16515 if v_0_0.Op != OpSelect0 { 16516 break 16517 } 16518 v_0_0_0 := v_0_0.Args[0] 16519 if v_0_0_0.Op != OpPPC64ANDCCconst { 16520 break 16521 } 16522 c := auxIntToInt64(v_0_0_0.AuxInt) 16523 x := v_0_0_0.Args[0] 16524 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 16525 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 16526 v1.AuxInt = int64ToAuxInt(c) 16527 v1.AddArg(x) 16528 v0.AddArg(v1) 16529 b.resetWithControl(BlockPPC64EQ, v0) 16530 return true 16531 } 16532 // match: (EQ (CMPWconst [0] (Select0 (ANDCCconst [c] x))) yes no) 16533 // result: (EQ (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no) 16534 for b.Controls[0].Op == OpPPC64CMPWconst { 16535 v_0 := b.Controls[0] 16536 if auxIntToInt32(v_0.AuxInt) != 0 { 16537 break 16538 } 16539 v_0_0 := v_0.Args[0] 16540 if v_0_0.Op != OpSelect0 { 16541 break 16542 } 16543 v_0_0_0 := v_0_0.Args[0] 16544 if v_0_0_0.Op != OpPPC64ANDCCconst { 16545 break 16546 } 16547 c := auxIntToInt64(v_0_0_0.AuxInt) 16548 x := v_0_0_0.Args[0] 16549 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 16550 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 16551 v1.AuxInt = int64ToAuxInt(c) 16552 v1.AddArg(x) 16553 v0.AddArg(v1) 16554 b.resetWithControl(BlockPPC64EQ, v0) 16555 return true 16556 } 16557 // match: (EQ (CMPconst [0] z:(AND x y)) yes no) 16558 // cond: z.Uses == 1 16559 // result: (EQ (Select1 <types.TypeFlags> (ANDCC x y)) yes no) 16560 for b.Controls[0].Op == OpPPC64CMPconst { 16561 v_0 := b.Controls[0] 16562 if auxIntToInt64(v_0.AuxInt) != 0 { 16563 break 16564 } 16565 z := v_0.Args[0] 16566 if z.Op != OpPPC64AND { 16567 break 16568 } 16569 _ = z.Args[1] 16570 z_0 := z.Args[0] 16571 z_1 := z.Args[1] 16572 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 16573 x := z_0 16574 y := z_1 16575 if !(z.Uses == 1) { 16576 continue 16577 } 16578 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 16579 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags)) 16580 v1.AddArg2(x, y) 16581 v0.AddArg(v1) 16582 b.resetWithControl(BlockPPC64EQ, v0) 16583 return true 16584 } 16585 break 16586 } 16587 // match: (EQ (CMPconst [0] z:(OR x y)) yes no) 16588 // cond: z.Uses == 1 16589 // result: (EQ (Select1 <types.TypeFlags> (ORCC x y)) yes no) 16590 for b.Controls[0].Op == OpPPC64CMPconst { 16591 v_0 := b.Controls[0] 16592 if auxIntToInt64(v_0.AuxInt) != 0 { 16593 break 16594 } 16595 z := v_0.Args[0] 16596 if z.Op != OpPPC64OR { 16597 break 16598 } 16599 _ = z.Args[1] 16600 z_0 := z.Args[0] 16601 z_1 := z.Args[1] 16602 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 16603 x := z_0 16604 y := z_1 16605 if !(z.Uses == 1) { 16606 continue 16607 } 16608 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 16609 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags)) 16610 v1.AddArg2(x, y) 16611 v0.AddArg(v1) 16612 b.resetWithControl(BlockPPC64EQ, v0) 16613 return true 16614 } 16615 break 16616 } 16617 // match: (EQ (CMPconst [0] z:(XOR x y)) yes no) 16618 // cond: z.Uses == 1 16619 // result: (EQ (Select1 <types.TypeFlags> (XORCC x y)) yes no) 16620 for b.Controls[0].Op == OpPPC64CMPconst { 16621 v_0 := b.Controls[0] 16622 if auxIntToInt64(v_0.AuxInt) != 0 { 16623 break 16624 } 16625 z := v_0.Args[0] 16626 if z.Op != OpPPC64XOR { 16627 break 16628 } 16629 _ = z.Args[1] 16630 z_0 := z.Args[0] 16631 z_1 := z.Args[1] 16632 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 16633 x := z_0 16634 y := z_1 16635 if !(z.Uses == 1) { 16636 continue 16637 } 16638 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 16639 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags)) 16640 v1.AddArg2(x, y) 16641 v0.AddArg(v1) 16642 b.resetWithControl(BlockPPC64EQ, v0) 16643 return true 16644 } 16645 break 16646 } 16647 case BlockPPC64GE: 16648 // match: (GE (FlagEQ) yes no) 16649 // result: (First yes no) 16650 for b.Controls[0].Op == OpPPC64FlagEQ { 16651 b.Reset(BlockFirst) 16652 return true 16653 } 16654 // match: (GE (FlagLT) yes no) 16655 // result: (First no yes) 16656 for b.Controls[0].Op == OpPPC64FlagLT { 16657 b.Reset(BlockFirst) 16658 b.swapSuccessors() 16659 return true 16660 } 16661 // match: (GE (FlagGT) yes no) 16662 // result: (First yes no) 16663 for b.Controls[0].Op == OpPPC64FlagGT { 16664 b.Reset(BlockFirst) 16665 return true 16666 } 16667 // match: (GE (InvertFlags cmp) yes no) 16668 // result: (LE cmp yes no) 16669 for b.Controls[0].Op == OpPPC64InvertFlags { 16670 v_0 := b.Controls[0] 16671 cmp := v_0.Args[0] 16672 b.resetWithControl(BlockPPC64LE, cmp) 16673 return true 16674 } 16675 // match: (GE (CMPconst [0] (Select0 (ANDCCconst [c] x))) yes no) 16676 // result: (GE (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no) 16677 for b.Controls[0].Op == OpPPC64CMPconst { 16678 v_0 := b.Controls[0] 16679 if auxIntToInt64(v_0.AuxInt) != 0 { 16680 break 16681 } 16682 v_0_0 := v_0.Args[0] 16683 if v_0_0.Op != OpSelect0 { 16684 break 16685 } 16686 v_0_0_0 := v_0_0.Args[0] 16687 if v_0_0_0.Op != OpPPC64ANDCCconst { 16688 break 16689 } 16690 c := auxIntToInt64(v_0_0_0.AuxInt) 16691 x := v_0_0_0.Args[0] 16692 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 16693 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 16694 v1.AuxInt = int64ToAuxInt(c) 16695 v1.AddArg(x) 16696 v0.AddArg(v1) 16697 b.resetWithControl(BlockPPC64GE, v0) 16698 return true 16699 } 16700 // match: (GE (CMPWconst [0] (Select0 (ANDCCconst [c] x))) yes no) 16701 // result: (GE (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no) 16702 for b.Controls[0].Op == OpPPC64CMPWconst { 16703 v_0 := b.Controls[0] 16704 if auxIntToInt32(v_0.AuxInt) != 0 { 16705 break 16706 } 16707 v_0_0 := v_0.Args[0] 16708 if v_0_0.Op != OpSelect0 { 16709 break 16710 } 16711 v_0_0_0 := v_0_0.Args[0] 16712 if v_0_0_0.Op != OpPPC64ANDCCconst { 16713 break 16714 } 16715 c := auxIntToInt64(v_0_0_0.AuxInt) 16716 x := v_0_0_0.Args[0] 16717 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 16718 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 16719 v1.AuxInt = int64ToAuxInt(c) 16720 v1.AddArg(x) 16721 v0.AddArg(v1) 16722 b.resetWithControl(BlockPPC64GE, v0) 16723 return true 16724 } 16725 // match: (GE (CMPconst [0] z:(AND x y)) yes no) 16726 // cond: z.Uses == 1 16727 // result: (GE (Select1 <types.TypeFlags> (ANDCC x y)) yes no) 16728 for b.Controls[0].Op == OpPPC64CMPconst { 16729 v_0 := b.Controls[0] 16730 if auxIntToInt64(v_0.AuxInt) != 0 { 16731 break 16732 } 16733 z := v_0.Args[0] 16734 if z.Op != OpPPC64AND { 16735 break 16736 } 16737 _ = z.Args[1] 16738 z_0 := z.Args[0] 16739 z_1 := z.Args[1] 16740 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 16741 x := z_0 16742 y := z_1 16743 if !(z.Uses == 1) { 16744 continue 16745 } 16746 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 16747 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags)) 16748 v1.AddArg2(x, y) 16749 v0.AddArg(v1) 16750 b.resetWithControl(BlockPPC64GE, v0) 16751 return true 16752 } 16753 break 16754 } 16755 // match: (GE (CMPconst [0] z:(OR x y)) yes no) 16756 // cond: z.Uses == 1 16757 // result: (GE (Select1 <types.TypeFlags> (ORCC x y)) yes no) 16758 for b.Controls[0].Op == OpPPC64CMPconst { 16759 v_0 := b.Controls[0] 16760 if auxIntToInt64(v_0.AuxInt) != 0 { 16761 break 16762 } 16763 z := v_0.Args[0] 16764 if z.Op != OpPPC64OR { 16765 break 16766 } 16767 _ = z.Args[1] 16768 z_0 := z.Args[0] 16769 z_1 := z.Args[1] 16770 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 16771 x := z_0 16772 y := z_1 16773 if !(z.Uses == 1) { 16774 continue 16775 } 16776 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 16777 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags)) 16778 v1.AddArg2(x, y) 16779 v0.AddArg(v1) 16780 b.resetWithControl(BlockPPC64GE, v0) 16781 return true 16782 } 16783 break 16784 } 16785 // match: (GE (CMPconst [0] z:(XOR x y)) yes no) 16786 // cond: z.Uses == 1 16787 // result: (GE (Select1 <types.TypeFlags> (XORCC x y)) yes no) 16788 for b.Controls[0].Op == OpPPC64CMPconst { 16789 v_0 := b.Controls[0] 16790 if auxIntToInt64(v_0.AuxInt) != 0 { 16791 break 16792 } 16793 z := v_0.Args[0] 16794 if z.Op != OpPPC64XOR { 16795 break 16796 } 16797 _ = z.Args[1] 16798 z_0 := z.Args[0] 16799 z_1 := z.Args[1] 16800 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 16801 x := z_0 16802 y := z_1 16803 if !(z.Uses == 1) { 16804 continue 16805 } 16806 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 16807 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags)) 16808 v1.AddArg2(x, y) 16809 v0.AddArg(v1) 16810 b.resetWithControl(BlockPPC64GE, v0) 16811 return true 16812 } 16813 break 16814 } 16815 case BlockPPC64GT: 16816 // match: (GT (FlagEQ) yes no) 16817 // result: (First no yes) 16818 for b.Controls[0].Op == OpPPC64FlagEQ { 16819 b.Reset(BlockFirst) 16820 b.swapSuccessors() 16821 return true 16822 } 16823 // match: (GT (FlagLT) yes no) 16824 // result: (First no yes) 16825 for b.Controls[0].Op == OpPPC64FlagLT { 16826 b.Reset(BlockFirst) 16827 b.swapSuccessors() 16828 return true 16829 } 16830 // match: (GT (FlagGT) yes no) 16831 // result: (First yes no) 16832 for b.Controls[0].Op == OpPPC64FlagGT { 16833 b.Reset(BlockFirst) 16834 return true 16835 } 16836 // match: (GT (InvertFlags cmp) yes no) 16837 // result: (LT cmp yes no) 16838 for b.Controls[0].Op == OpPPC64InvertFlags { 16839 v_0 := b.Controls[0] 16840 cmp := v_0.Args[0] 16841 b.resetWithControl(BlockPPC64LT, cmp) 16842 return true 16843 } 16844 // match: (GT (CMPconst [0] (Select0 (ANDCCconst [c] x))) yes no) 16845 // result: (GT (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no) 16846 for b.Controls[0].Op == OpPPC64CMPconst { 16847 v_0 := b.Controls[0] 16848 if auxIntToInt64(v_0.AuxInt) != 0 { 16849 break 16850 } 16851 v_0_0 := v_0.Args[0] 16852 if v_0_0.Op != OpSelect0 { 16853 break 16854 } 16855 v_0_0_0 := v_0_0.Args[0] 16856 if v_0_0_0.Op != OpPPC64ANDCCconst { 16857 break 16858 } 16859 c := auxIntToInt64(v_0_0_0.AuxInt) 16860 x := v_0_0_0.Args[0] 16861 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 16862 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 16863 v1.AuxInt = int64ToAuxInt(c) 16864 v1.AddArg(x) 16865 v0.AddArg(v1) 16866 b.resetWithControl(BlockPPC64GT, v0) 16867 return true 16868 } 16869 // match: (GT (CMPWconst [0] (Select0 (ANDCCconst [c] x))) yes no) 16870 // result: (GT (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no) 16871 for b.Controls[0].Op == OpPPC64CMPWconst { 16872 v_0 := b.Controls[0] 16873 if auxIntToInt32(v_0.AuxInt) != 0 { 16874 break 16875 } 16876 v_0_0 := v_0.Args[0] 16877 if v_0_0.Op != OpSelect0 { 16878 break 16879 } 16880 v_0_0_0 := v_0_0.Args[0] 16881 if v_0_0_0.Op != OpPPC64ANDCCconst { 16882 break 16883 } 16884 c := auxIntToInt64(v_0_0_0.AuxInt) 16885 x := v_0_0_0.Args[0] 16886 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 16887 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 16888 v1.AuxInt = int64ToAuxInt(c) 16889 v1.AddArg(x) 16890 v0.AddArg(v1) 16891 b.resetWithControl(BlockPPC64GT, v0) 16892 return true 16893 } 16894 // match: (GT (CMPconst [0] z:(AND x y)) yes no) 16895 // cond: z.Uses == 1 16896 // result: (GT (Select1 <types.TypeFlags> (ANDCC x y)) yes no) 16897 for b.Controls[0].Op == OpPPC64CMPconst { 16898 v_0 := b.Controls[0] 16899 if auxIntToInt64(v_0.AuxInt) != 0 { 16900 break 16901 } 16902 z := v_0.Args[0] 16903 if z.Op != OpPPC64AND { 16904 break 16905 } 16906 _ = z.Args[1] 16907 z_0 := z.Args[0] 16908 z_1 := z.Args[1] 16909 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 16910 x := z_0 16911 y := z_1 16912 if !(z.Uses == 1) { 16913 continue 16914 } 16915 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 16916 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags)) 16917 v1.AddArg2(x, y) 16918 v0.AddArg(v1) 16919 b.resetWithControl(BlockPPC64GT, v0) 16920 return true 16921 } 16922 break 16923 } 16924 // match: (GT (CMPconst [0] z:(OR x y)) yes no) 16925 // cond: z.Uses == 1 16926 // result: (GT (Select1 <types.TypeFlags> (ORCC x y)) yes no) 16927 for b.Controls[0].Op == OpPPC64CMPconst { 16928 v_0 := b.Controls[0] 16929 if auxIntToInt64(v_0.AuxInt) != 0 { 16930 break 16931 } 16932 z := v_0.Args[0] 16933 if z.Op != OpPPC64OR { 16934 break 16935 } 16936 _ = z.Args[1] 16937 z_0 := z.Args[0] 16938 z_1 := z.Args[1] 16939 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 16940 x := z_0 16941 y := z_1 16942 if !(z.Uses == 1) { 16943 continue 16944 } 16945 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 16946 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags)) 16947 v1.AddArg2(x, y) 16948 v0.AddArg(v1) 16949 b.resetWithControl(BlockPPC64GT, v0) 16950 return true 16951 } 16952 break 16953 } 16954 // match: (GT (CMPconst [0] z:(XOR x y)) yes no) 16955 // cond: z.Uses == 1 16956 // result: (GT (Select1 <types.TypeFlags> (XORCC x y)) yes no) 16957 for b.Controls[0].Op == OpPPC64CMPconst { 16958 v_0 := b.Controls[0] 16959 if auxIntToInt64(v_0.AuxInt) != 0 { 16960 break 16961 } 16962 z := v_0.Args[0] 16963 if z.Op != OpPPC64XOR { 16964 break 16965 } 16966 _ = z.Args[1] 16967 z_0 := z.Args[0] 16968 z_1 := z.Args[1] 16969 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 16970 x := z_0 16971 y := z_1 16972 if !(z.Uses == 1) { 16973 continue 16974 } 16975 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 16976 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags)) 16977 v1.AddArg2(x, y) 16978 v0.AddArg(v1) 16979 b.resetWithControl(BlockPPC64GT, v0) 16980 return true 16981 } 16982 break 16983 } 16984 case BlockIf: 16985 // match: (If (Equal cc) yes no) 16986 // result: (EQ cc yes no) 16987 for b.Controls[0].Op == OpPPC64Equal { 16988 v_0 := b.Controls[0] 16989 cc := v_0.Args[0] 16990 b.resetWithControl(BlockPPC64EQ, cc) 16991 return true 16992 } 16993 // match: (If (NotEqual cc) yes no) 16994 // result: (NE cc yes no) 16995 for b.Controls[0].Op == OpPPC64NotEqual { 16996 v_0 := b.Controls[0] 16997 cc := v_0.Args[0] 16998 b.resetWithControl(BlockPPC64NE, cc) 16999 return true 17000 } 17001 // match: (If (LessThan cc) yes no) 17002 // result: (LT cc yes no) 17003 for b.Controls[0].Op == OpPPC64LessThan { 17004 v_0 := b.Controls[0] 17005 cc := v_0.Args[0] 17006 b.resetWithControl(BlockPPC64LT, cc) 17007 return true 17008 } 17009 // match: (If (LessEqual cc) yes no) 17010 // result: (LE cc yes no) 17011 for b.Controls[0].Op == OpPPC64LessEqual { 17012 v_0 := b.Controls[0] 17013 cc := v_0.Args[0] 17014 b.resetWithControl(BlockPPC64LE, cc) 17015 return true 17016 } 17017 // match: (If (GreaterThan cc) yes no) 17018 // result: (GT cc yes no) 17019 for b.Controls[0].Op == OpPPC64GreaterThan { 17020 v_0 := b.Controls[0] 17021 cc := v_0.Args[0] 17022 b.resetWithControl(BlockPPC64GT, cc) 17023 return true 17024 } 17025 // match: (If (GreaterEqual cc) yes no) 17026 // result: (GE cc yes no) 17027 for b.Controls[0].Op == OpPPC64GreaterEqual { 17028 v_0 := b.Controls[0] 17029 cc := v_0.Args[0] 17030 b.resetWithControl(BlockPPC64GE, cc) 17031 return true 17032 } 17033 // match: (If (FLessThan cc) yes no) 17034 // result: (FLT cc yes no) 17035 for b.Controls[0].Op == OpPPC64FLessThan { 17036 v_0 := b.Controls[0] 17037 cc := v_0.Args[0] 17038 b.resetWithControl(BlockPPC64FLT, cc) 17039 return true 17040 } 17041 // match: (If (FLessEqual cc) yes no) 17042 // result: (FLE cc yes no) 17043 for b.Controls[0].Op == OpPPC64FLessEqual { 17044 v_0 := b.Controls[0] 17045 cc := v_0.Args[0] 17046 b.resetWithControl(BlockPPC64FLE, cc) 17047 return true 17048 } 17049 // match: (If (FGreaterThan cc) yes no) 17050 // result: (FGT cc yes no) 17051 for b.Controls[0].Op == OpPPC64FGreaterThan { 17052 v_0 := b.Controls[0] 17053 cc := v_0.Args[0] 17054 b.resetWithControl(BlockPPC64FGT, cc) 17055 return true 17056 } 17057 // match: (If (FGreaterEqual cc) yes no) 17058 // result: (FGE cc yes no) 17059 for b.Controls[0].Op == OpPPC64FGreaterEqual { 17060 v_0 := b.Controls[0] 17061 cc := v_0.Args[0] 17062 b.resetWithControl(BlockPPC64FGE, cc) 17063 return true 17064 } 17065 // match: (If cond yes no) 17066 // result: (NE (CMPWconst [0] (Select0 <typ.UInt32> (ANDCCconst [1] cond))) yes no) 17067 for { 17068 cond := b.Controls[0] 17069 v0 := b.NewValue0(cond.Pos, OpPPC64CMPWconst, types.TypeFlags) 17070 v0.AuxInt = int32ToAuxInt(0) 17071 v1 := b.NewValue0(cond.Pos, OpSelect0, typ.UInt32) 17072 v2 := b.NewValue0(cond.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 17073 v2.AuxInt = int64ToAuxInt(1) 17074 v2.AddArg(cond) 17075 v1.AddArg(v2) 17076 v0.AddArg(v1) 17077 b.resetWithControl(BlockPPC64NE, v0) 17078 return true 17079 } 17080 case BlockPPC64LE: 17081 // match: (LE (FlagEQ) yes no) 17082 // result: (First yes no) 17083 for b.Controls[0].Op == OpPPC64FlagEQ { 17084 b.Reset(BlockFirst) 17085 return true 17086 } 17087 // match: (LE (FlagLT) yes no) 17088 // result: (First yes no) 17089 for b.Controls[0].Op == OpPPC64FlagLT { 17090 b.Reset(BlockFirst) 17091 return true 17092 } 17093 // match: (LE (FlagGT) yes no) 17094 // result: (First no yes) 17095 for b.Controls[0].Op == OpPPC64FlagGT { 17096 b.Reset(BlockFirst) 17097 b.swapSuccessors() 17098 return true 17099 } 17100 // match: (LE (InvertFlags cmp) yes no) 17101 // result: (GE cmp yes no) 17102 for b.Controls[0].Op == OpPPC64InvertFlags { 17103 v_0 := b.Controls[0] 17104 cmp := v_0.Args[0] 17105 b.resetWithControl(BlockPPC64GE, cmp) 17106 return true 17107 } 17108 // match: (LE (CMPconst [0] (Select0 (ANDCCconst [c] x))) yes no) 17109 // result: (LE (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no) 17110 for b.Controls[0].Op == OpPPC64CMPconst { 17111 v_0 := b.Controls[0] 17112 if auxIntToInt64(v_0.AuxInt) != 0 { 17113 break 17114 } 17115 v_0_0 := v_0.Args[0] 17116 if v_0_0.Op != OpSelect0 { 17117 break 17118 } 17119 v_0_0_0 := v_0_0.Args[0] 17120 if v_0_0_0.Op != OpPPC64ANDCCconst { 17121 break 17122 } 17123 c := auxIntToInt64(v_0_0_0.AuxInt) 17124 x := v_0_0_0.Args[0] 17125 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 17126 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 17127 v1.AuxInt = int64ToAuxInt(c) 17128 v1.AddArg(x) 17129 v0.AddArg(v1) 17130 b.resetWithControl(BlockPPC64LE, v0) 17131 return true 17132 } 17133 // match: (LE (CMPWconst [0] (Select0 (ANDCCconst [c] x))) yes no) 17134 // result: (LE (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no) 17135 for b.Controls[0].Op == OpPPC64CMPWconst { 17136 v_0 := b.Controls[0] 17137 if auxIntToInt32(v_0.AuxInt) != 0 { 17138 break 17139 } 17140 v_0_0 := v_0.Args[0] 17141 if v_0_0.Op != OpSelect0 { 17142 break 17143 } 17144 v_0_0_0 := v_0_0.Args[0] 17145 if v_0_0_0.Op != OpPPC64ANDCCconst { 17146 break 17147 } 17148 c := auxIntToInt64(v_0_0_0.AuxInt) 17149 x := v_0_0_0.Args[0] 17150 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 17151 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 17152 v1.AuxInt = int64ToAuxInt(c) 17153 v1.AddArg(x) 17154 v0.AddArg(v1) 17155 b.resetWithControl(BlockPPC64LE, v0) 17156 return true 17157 } 17158 // match: (LE (CMPconst [0] z:(AND x y)) yes no) 17159 // cond: z.Uses == 1 17160 // result: (LE (Select1 <types.TypeFlags> (ANDCC x y)) yes no) 17161 for b.Controls[0].Op == OpPPC64CMPconst { 17162 v_0 := b.Controls[0] 17163 if auxIntToInt64(v_0.AuxInt) != 0 { 17164 break 17165 } 17166 z := v_0.Args[0] 17167 if z.Op != OpPPC64AND { 17168 break 17169 } 17170 _ = z.Args[1] 17171 z_0 := z.Args[0] 17172 z_1 := z.Args[1] 17173 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 17174 x := z_0 17175 y := z_1 17176 if !(z.Uses == 1) { 17177 continue 17178 } 17179 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 17180 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags)) 17181 v1.AddArg2(x, y) 17182 v0.AddArg(v1) 17183 b.resetWithControl(BlockPPC64LE, v0) 17184 return true 17185 } 17186 break 17187 } 17188 // match: (LE (CMPconst [0] z:(OR x y)) yes no) 17189 // cond: z.Uses == 1 17190 // result: (LE (Select1 <types.TypeFlags> (ORCC x y)) yes no) 17191 for b.Controls[0].Op == OpPPC64CMPconst { 17192 v_0 := b.Controls[0] 17193 if auxIntToInt64(v_0.AuxInt) != 0 { 17194 break 17195 } 17196 z := v_0.Args[0] 17197 if z.Op != OpPPC64OR { 17198 break 17199 } 17200 _ = z.Args[1] 17201 z_0 := z.Args[0] 17202 z_1 := z.Args[1] 17203 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 17204 x := z_0 17205 y := z_1 17206 if !(z.Uses == 1) { 17207 continue 17208 } 17209 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 17210 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags)) 17211 v1.AddArg2(x, y) 17212 v0.AddArg(v1) 17213 b.resetWithControl(BlockPPC64LE, v0) 17214 return true 17215 } 17216 break 17217 } 17218 // match: (LE (CMPconst [0] z:(XOR x y)) yes no) 17219 // cond: z.Uses == 1 17220 // result: (LE (Select1 <types.TypeFlags> (XORCC x y)) yes no) 17221 for b.Controls[0].Op == OpPPC64CMPconst { 17222 v_0 := b.Controls[0] 17223 if auxIntToInt64(v_0.AuxInt) != 0 { 17224 break 17225 } 17226 z := v_0.Args[0] 17227 if z.Op != OpPPC64XOR { 17228 break 17229 } 17230 _ = z.Args[1] 17231 z_0 := z.Args[0] 17232 z_1 := z.Args[1] 17233 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 17234 x := z_0 17235 y := z_1 17236 if !(z.Uses == 1) { 17237 continue 17238 } 17239 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 17240 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags)) 17241 v1.AddArg2(x, y) 17242 v0.AddArg(v1) 17243 b.resetWithControl(BlockPPC64LE, v0) 17244 return true 17245 } 17246 break 17247 } 17248 case BlockPPC64LT: 17249 // match: (LT (FlagEQ) yes no) 17250 // result: (First no yes) 17251 for b.Controls[0].Op == OpPPC64FlagEQ { 17252 b.Reset(BlockFirst) 17253 b.swapSuccessors() 17254 return true 17255 } 17256 // match: (LT (FlagLT) yes no) 17257 // result: (First yes no) 17258 for b.Controls[0].Op == OpPPC64FlagLT { 17259 b.Reset(BlockFirst) 17260 return true 17261 } 17262 // match: (LT (FlagGT) yes no) 17263 // result: (First no yes) 17264 for b.Controls[0].Op == OpPPC64FlagGT { 17265 b.Reset(BlockFirst) 17266 b.swapSuccessors() 17267 return true 17268 } 17269 // match: (LT (InvertFlags cmp) yes no) 17270 // result: (GT cmp yes no) 17271 for b.Controls[0].Op == OpPPC64InvertFlags { 17272 v_0 := b.Controls[0] 17273 cmp := v_0.Args[0] 17274 b.resetWithControl(BlockPPC64GT, cmp) 17275 return true 17276 } 17277 // match: (LT (CMPconst [0] (Select0 (ANDCCconst [c] x))) yes no) 17278 // result: (LT (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no) 17279 for b.Controls[0].Op == OpPPC64CMPconst { 17280 v_0 := b.Controls[0] 17281 if auxIntToInt64(v_0.AuxInt) != 0 { 17282 break 17283 } 17284 v_0_0 := v_0.Args[0] 17285 if v_0_0.Op != OpSelect0 { 17286 break 17287 } 17288 v_0_0_0 := v_0_0.Args[0] 17289 if v_0_0_0.Op != OpPPC64ANDCCconst { 17290 break 17291 } 17292 c := auxIntToInt64(v_0_0_0.AuxInt) 17293 x := v_0_0_0.Args[0] 17294 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 17295 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 17296 v1.AuxInt = int64ToAuxInt(c) 17297 v1.AddArg(x) 17298 v0.AddArg(v1) 17299 b.resetWithControl(BlockPPC64LT, v0) 17300 return true 17301 } 17302 // match: (LT (CMPWconst [0] (Select0 (ANDCCconst [c] x))) yes no) 17303 // result: (LT (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no) 17304 for b.Controls[0].Op == OpPPC64CMPWconst { 17305 v_0 := b.Controls[0] 17306 if auxIntToInt32(v_0.AuxInt) != 0 { 17307 break 17308 } 17309 v_0_0 := v_0.Args[0] 17310 if v_0_0.Op != OpSelect0 { 17311 break 17312 } 17313 v_0_0_0 := v_0_0.Args[0] 17314 if v_0_0_0.Op != OpPPC64ANDCCconst { 17315 break 17316 } 17317 c := auxIntToInt64(v_0_0_0.AuxInt) 17318 x := v_0_0_0.Args[0] 17319 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 17320 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 17321 v1.AuxInt = int64ToAuxInt(c) 17322 v1.AddArg(x) 17323 v0.AddArg(v1) 17324 b.resetWithControl(BlockPPC64LT, v0) 17325 return true 17326 } 17327 // match: (LT (CMPconst [0] z:(AND x y)) yes no) 17328 // cond: z.Uses == 1 17329 // result: (LT (Select1 <types.TypeFlags> (ANDCC x y)) yes no) 17330 for b.Controls[0].Op == OpPPC64CMPconst { 17331 v_0 := b.Controls[0] 17332 if auxIntToInt64(v_0.AuxInt) != 0 { 17333 break 17334 } 17335 z := v_0.Args[0] 17336 if z.Op != OpPPC64AND { 17337 break 17338 } 17339 _ = z.Args[1] 17340 z_0 := z.Args[0] 17341 z_1 := z.Args[1] 17342 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 17343 x := z_0 17344 y := z_1 17345 if !(z.Uses == 1) { 17346 continue 17347 } 17348 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 17349 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags)) 17350 v1.AddArg2(x, y) 17351 v0.AddArg(v1) 17352 b.resetWithControl(BlockPPC64LT, v0) 17353 return true 17354 } 17355 break 17356 } 17357 // match: (LT (CMPconst [0] z:(OR x y)) yes no) 17358 // cond: z.Uses == 1 17359 // result: (LT (Select1 <types.TypeFlags> (ORCC x y)) yes no) 17360 for b.Controls[0].Op == OpPPC64CMPconst { 17361 v_0 := b.Controls[0] 17362 if auxIntToInt64(v_0.AuxInt) != 0 { 17363 break 17364 } 17365 z := v_0.Args[0] 17366 if z.Op != OpPPC64OR { 17367 break 17368 } 17369 _ = z.Args[1] 17370 z_0 := z.Args[0] 17371 z_1 := z.Args[1] 17372 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 17373 x := z_0 17374 y := z_1 17375 if !(z.Uses == 1) { 17376 continue 17377 } 17378 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 17379 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags)) 17380 v1.AddArg2(x, y) 17381 v0.AddArg(v1) 17382 b.resetWithControl(BlockPPC64LT, v0) 17383 return true 17384 } 17385 break 17386 } 17387 // match: (LT (CMPconst [0] z:(XOR x y)) yes no) 17388 // cond: z.Uses == 1 17389 // result: (LT (Select1 <types.TypeFlags> (XORCC x y)) yes no) 17390 for b.Controls[0].Op == OpPPC64CMPconst { 17391 v_0 := b.Controls[0] 17392 if auxIntToInt64(v_0.AuxInt) != 0 { 17393 break 17394 } 17395 z := v_0.Args[0] 17396 if z.Op != OpPPC64XOR { 17397 break 17398 } 17399 _ = z.Args[1] 17400 z_0 := z.Args[0] 17401 z_1 := z.Args[1] 17402 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 17403 x := z_0 17404 y := z_1 17405 if !(z.Uses == 1) { 17406 continue 17407 } 17408 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 17409 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags)) 17410 v1.AddArg2(x, y) 17411 v0.AddArg(v1) 17412 b.resetWithControl(BlockPPC64LT, v0) 17413 return true 17414 } 17415 break 17416 } 17417 case BlockPPC64NE: 17418 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (Equal cc)))) yes no) 17419 // result: (EQ cc yes no) 17420 for b.Controls[0].Op == OpPPC64CMPWconst { 17421 v_0 := b.Controls[0] 17422 if auxIntToInt32(v_0.AuxInt) != 0 { 17423 break 17424 } 17425 v_0_0 := v_0.Args[0] 17426 if v_0_0.Op != OpSelect0 { 17427 break 17428 } 17429 v_0_0_0 := v_0_0.Args[0] 17430 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 { 17431 break 17432 } 17433 v_0_0_0_0 := v_0_0_0.Args[0] 17434 if v_0_0_0_0.Op != OpPPC64Equal { 17435 break 17436 } 17437 cc := v_0_0_0_0.Args[0] 17438 b.resetWithControl(BlockPPC64EQ, cc) 17439 return true 17440 } 17441 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (NotEqual cc)))) yes no) 17442 // result: (NE cc yes no) 17443 for b.Controls[0].Op == OpPPC64CMPWconst { 17444 v_0 := b.Controls[0] 17445 if auxIntToInt32(v_0.AuxInt) != 0 { 17446 break 17447 } 17448 v_0_0 := v_0.Args[0] 17449 if v_0_0.Op != OpSelect0 { 17450 break 17451 } 17452 v_0_0_0 := v_0_0.Args[0] 17453 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 { 17454 break 17455 } 17456 v_0_0_0_0 := v_0_0_0.Args[0] 17457 if v_0_0_0_0.Op != OpPPC64NotEqual { 17458 break 17459 } 17460 cc := v_0_0_0_0.Args[0] 17461 b.resetWithControl(BlockPPC64NE, cc) 17462 return true 17463 } 17464 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (LessThan cc)))) yes no) 17465 // result: (LT cc yes no) 17466 for b.Controls[0].Op == OpPPC64CMPWconst { 17467 v_0 := b.Controls[0] 17468 if auxIntToInt32(v_0.AuxInt) != 0 { 17469 break 17470 } 17471 v_0_0 := v_0.Args[0] 17472 if v_0_0.Op != OpSelect0 { 17473 break 17474 } 17475 v_0_0_0 := v_0_0.Args[0] 17476 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 { 17477 break 17478 } 17479 v_0_0_0_0 := v_0_0_0.Args[0] 17480 if v_0_0_0_0.Op != OpPPC64LessThan { 17481 break 17482 } 17483 cc := v_0_0_0_0.Args[0] 17484 b.resetWithControl(BlockPPC64LT, cc) 17485 return true 17486 } 17487 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (LessEqual cc)))) yes no) 17488 // result: (LE cc yes no) 17489 for b.Controls[0].Op == OpPPC64CMPWconst { 17490 v_0 := b.Controls[0] 17491 if auxIntToInt32(v_0.AuxInt) != 0 { 17492 break 17493 } 17494 v_0_0 := v_0.Args[0] 17495 if v_0_0.Op != OpSelect0 { 17496 break 17497 } 17498 v_0_0_0 := v_0_0.Args[0] 17499 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 { 17500 break 17501 } 17502 v_0_0_0_0 := v_0_0_0.Args[0] 17503 if v_0_0_0_0.Op != OpPPC64LessEqual { 17504 break 17505 } 17506 cc := v_0_0_0_0.Args[0] 17507 b.resetWithControl(BlockPPC64LE, cc) 17508 return true 17509 } 17510 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (GreaterThan cc)))) yes no) 17511 // result: (GT cc yes no) 17512 for b.Controls[0].Op == OpPPC64CMPWconst { 17513 v_0 := b.Controls[0] 17514 if auxIntToInt32(v_0.AuxInt) != 0 { 17515 break 17516 } 17517 v_0_0 := v_0.Args[0] 17518 if v_0_0.Op != OpSelect0 { 17519 break 17520 } 17521 v_0_0_0 := v_0_0.Args[0] 17522 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 { 17523 break 17524 } 17525 v_0_0_0_0 := v_0_0_0.Args[0] 17526 if v_0_0_0_0.Op != OpPPC64GreaterThan { 17527 break 17528 } 17529 cc := v_0_0_0_0.Args[0] 17530 b.resetWithControl(BlockPPC64GT, cc) 17531 return true 17532 } 17533 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (GreaterEqual cc)))) yes no) 17534 // result: (GE cc yes no) 17535 for b.Controls[0].Op == OpPPC64CMPWconst { 17536 v_0 := b.Controls[0] 17537 if auxIntToInt32(v_0.AuxInt) != 0 { 17538 break 17539 } 17540 v_0_0 := v_0.Args[0] 17541 if v_0_0.Op != OpSelect0 { 17542 break 17543 } 17544 v_0_0_0 := v_0_0.Args[0] 17545 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 { 17546 break 17547 } 17548 v_0_0_0_0 := v_0_0_0.Args[0] 17549 if v_0_0_0_0.Op != OpPPC64GreaterEqual { 17550 break 17551 } 17552 cc := v_0_0_0_0.Args[0] 17553 b.resetWithControl(BlockPPC64GE, cc) 17554 return true 17555 } 17556 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (FLessThan cc)))) yes no) 17557 // result: (FLT cc yes no) 17558 for b.Controls[0].Op == OpPPC64CMPWconst { 17559 v_0 := b.Controls[0] 17560 if auxIntToInt32(v_0.AuxInt) != 0 { 17561 break 17562 } 17563 v_0_0 := v_0.Args[0] 17564 if v_0_0.Op != OpSelect0 { 17565 break 17566 } 17567 v_0_0_0 := v_0_0.Args[0] 17568 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 { 17569 break 17570 } 17571 v_0_0_0_0 := v_0_0_0.Args[0] 17572 if v_0_0_0_0.Op != OpPPC64FLessThan { 17573 break 17574 } 17575 cc := v_0_0_0_0.Args[0] 17576 b.resetWithControl(BlockPPC64FLT, cc) 17577 return true 17578 } 17579 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (FLessEqual cc)))) yes no) 17580 // result: (FLE cc yes no) 17581 for b.Controls[0].Op == OpPPC64CMPWconst { 17582 v_0 := b.Controls[0] 17583 if auxIntToInt32(v_0.AuxInt) != 0 { 17584 break 17585 } 17586 v_0_0 := v_0.Args[0] 17587 if v_0_0.Op != OpSelect0 { 17588 break 17589 } 17590 v_0_0_0 := v_0_0.Args[0] 17591 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 { 17592 break 17593 } 17594 v_0_0_0_0 := v_0_0_0.Args[0] 17595 if v_0_0_0_0.Op != OpPPC64FLessEqual { 17596 break 17597 } 17598 cc := v_0_0_0_0.Args[0] 17599 b.resetWithControl(BlockPPC64FLE, cc) 17600 return true 17601 } 17602 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (FGreaterThan cc)))) yes no) 17603 // result: (FGT cc yes no) 17604 for b.Controls[0].Op == OpPPC64CMPWconst { 17605 v_0 := b.Controls[0] 17606 if auxIntToInt32(v_0.AuxInt) != 0 { 17607 break 17608 } 17609 v_0_0 := v_0.Args[0] 17610 if v_0_0.Op != OpSelect0 { 17611 break 17612 } 17613 v_0_0_0 := v_0_0.Args[0] 17614 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 { 17615 break 17616 } 17617 v_0_0_0_0 := v_0_0_0.Args[0] 17618 if v_0_0_0_0.Op != OpPPC64FGreaterThan { 17619 break 17620 } 17621 cc := v_0_0_0_0.Args[0] 17622 b.resetWithControl(BlockPPC64FGT, cc) 17623 return true 17624 } 17625 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (FGreaterEqual cc)))) yes no) 17626 // result: (FGE cc yes no) 17627 for b.Controls[0].Op == OpPPC64CMPWconst { 17628 v_0 := b.Controls[0] 17629 if auxIntToInt32(v_0.AuxInt) != 0 { 17630 break 17631 } 17632 v_0_0 := v_0.Args[0] 17633 if v_0_0.Op != OpSelect0 { 17634 break 17635 } 17636 v_0_0_0 := v_0_0.Args[0] 17637 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 { 17638 break 17639 } 17640 v_0_0_0_0 := v_0_0_0.Args[0] 17641 if v_0_0_0_0.Op != OpPPC64FGreaterEqual { 17642 break 17643 } 17644 cc := v_0_0_0_0.Args[0] 17645 b.resetWithControl(BlockPPC64FGE, cc) 17646 return true 17647 } 17648 // match: (NE (CMPconst [0] (Select0 (ANDCCconst [c] x))) yes no) 17649 // result: (NE (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no) 17650 for b.Controls[0].Op == OpPPC64CMPconst { 17651 v_0 := b.Controls[0] 17652 if auxIntToInt64(v_0.AuxInt) != 0 { 17653 break 17654 } 17655 v_0_0 := v_0.Args[0] 17656 if v_0_0.Op != OpSelect0 { 17657 break 17658 } 17659 v_0_0_0 := v_0_0.Args[0] 17660 if v_0_0_0.Op != OpPPC64ANDCCconst { 17661 break 17662 } 17663 c := auxIntToInt64(v_0_0_0.AuxInt) 17664 x := v_0_0_0.Args[0] 17665 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 17666 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 17667 v1.AuxInt = int64ToAuxInt(c) 17668 v1.AddArg(x) 17669 v0.AddArg(v1) 17670 b.resetWithControl(BlockPPC64NE, v0) 17671 return true 17672 } 17673 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [c] x))) yes no) 17674 // result: (NE (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no) 17675 for b.Controls[0].Op == OpPPC64CMPWconst { 17676 v_0 := b.Controls[0] 17677 if auxIntToInt32(v_0.AuxInt) != 0 { 17678 break 17679 } 17680 v_0_0 := v_0.Args[0] 17681 if v_0_0.Op != OpSelect0 { 17682 break 17683 } 17684 v_0_0_0 := v_0_0.Args[0] 17685 if v_0_0_0.Op != OpPPC64ANDCCconst { 17686 break 17687 } 17688 c := auxIntToInt64(v_0_0_0.AuxInt) 17689 x := v_0_0_0.Args[0] 17690 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 17691 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 17692 v1.AuxInt = int64ToAuxInt(c) 17693 v1.AddArg(x) 17694 v0.AddArg(v1) 17695 b.resetWithControl(BlockPPC64NE, v0) 17696 return true 17697 } 17698 // match: (NE (FlagEQ) yes no) 17699 // result: (First no yes) 17700 for b.Controls[0].Op == OpPPC64FlagEQ { 17701 b.Reset(BlockFirst) 17702 b.swapSuccessors() 17703 return true 17704 } 17705 // match: (NE (FlagLT) yes no) 17706 // result: (First yes no) 17707 for b.Controls[0].Op == OpPPC64FlagLT { 17708 b.Reset(BlockFirst) 17709 return true 17710 } 17711 // match: (NE (FlagGT) yes no) 17712 // result: (First yes no) 17713 for b.Controls[0].Op == OpPPC64FlagGT { 17714 b.Reset(BlockFirst) 17715 return true 17716 } 17717 // match: (NE (InvertFlags cmp) yes no) 17718 // result: (NE cmp yes no) 17719 for b.Controls[0].Op == OpPPC64InvertFlags { 17720 v_0 := b.Controls[0] 17721 cmp := v_0.Args[0] 17722 b.resetWithControl(BlockPPC64NE, cmp) 17723 return true 17724 } 17725 // match: (NE (CMPconst [0] (Select0 (ANDCCconst [c] x))) yes no) 17726 // result: (NE (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no) 17727 for b.Controls[0].Op == OpPPC64CMPconst { 17728 v_0 := b.Controls[0] 17729 if auxIntToInt64(v_0.AuxInt) != 0 { 17730 break 17731 } 17732 v_0_0 := v_0.Args[0] 17733 if v_0_0.Op != OpSelect0 { 17734 break 17735 } 17736 v_0_0_0 := v_0_0.Args[0] 17737 if v_0_0_0.Op != OpPPC64ANDCCconst { 17738 break 17739 } 17740 c := auxIntToInt64(v_0_0_0.AuxInt) 17741 x := v_0_0_0.Args[0] 17742 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 17743 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 17744 v1.AuxInt = int64ToAuxInt(c) 17745 v1.AddArg(x) 17746 v0.AddArg(v1) 17747 b.resetWithControl(BlockPPC64NE, v0) 17748 return true 17749 } 17750 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [c] x))) yes no) 17751 // result: (NE (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no) 17752 for b.Controls[0].Op == OpPPC64CMPWconst { 17753 v_0 := b.Controls[0] 17754 if auxIntToInt32(v_0.AuxInt) != 0 { 17755 break 17756 } 17757 v_0_0 := v_0.Args[0] 17758 if v_0_0.Op != OpSelect0 { 17759 break 17760 } 17761 v_0_0_0 := v_0_0.Args[0] 17762 if v_0_0_0.Op != OpPPC64ANDCCconst { 17763 break 17764 } 17765 c := auxIntToInt64(v_0_0_0.AuxInt) 17766 x := v_0_0_0.Args[0] 17767 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 17768 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags)) 17769 v1.AuxInt = int64ToAuxInt(c) 17770 v1.AddArg(x) 17771 v0.AddArg(v1) 17772 b.resetWithControl(BlockPPC64NE, v0) 17773 return true 17774 } 17775 // match: (NE (CMPconst [0] z:(AND x y)) yes no) 17776 // cond: z.Uses == 1 17777 // result: (NE (Select1 <types.TypeFlags> (ANDCC x y)) yes no) 17778 for b.Controls[0].Op == OpPPC64CMPconst { 17779 v_0 := b.Controls[0] 17780 if auxIntToInt64(v_0.AuxInt) != 0 { 17781 break 17782 } 17783 z := v_0.Args[0] 17784 if z.Op != OpPPC64AND { 17785 break 17786 } 17787 _ = z.Args[1] 17788 z_0 := z.Args[0] 17789 z_1 := z.Args[1] 17790 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 17791 x := z_0 17792 y := z_1 17793 if !(z.Uses == 1) { 17794 continue 17795 } 17796 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 17797 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags)) 17798 v1.AddArg2(x, y) 17799 v0.AddArg(v1) 17800 b.resetWithControl(BlockPPC64NE, v0) 17801 return true 17802 } 17803 break 17804 } 17805 // match: (NE (CMPconst [0] z:(OR x y)) yes no) 17806 // cond: z.Uses == 1 17807 // result: (NE (Select1 <types.TypeFlags> (ORCC x y)) yes no) 17808 for b.Controls[0].Op == OpPPC64CMPconst { 17809 v_0 := b.Controls[0] 17810 if auxIntToInt64(v_0.AuxInt) != 0 { 17811 break 17812 } 17813 z := v_0.Args[0] 17814 if z.Op != OpPPC64OR { 17815 break 17816 } 17817 _ = z.Args[1] 17818 z_0 := z.Args[0] 17819 z_1 := z.Args[1] 17820 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 17821 x := z_0 17822 y := z_1 17823 if !(z.Uses == 1) { 17824 continue 17825 } 17826 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 17827 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags)) 17828 v1.AddArg2(x, y) 17829 v0.AddArg(v1) 17830 b.resetWithControl(BlockPPC64NE, v0) 17831 return true 17832 } 17833 break 17834 } 17835 // match: (NE (CMPconst [0] z:(XOR x y)) yes no) 17836 // cond: z.Uses == 1 17837 // result: (NE (Select1 <types.TypeFlags> (XORCC x y)) yes no) 17838 for b.Controls[0].Op == OpPPC64CMPconst { 17839 v_0 := b.Controls[0] 17840 if auxIntToInt64(v_0.AuxInt) != 0 { 17841 break 17842 } 17843 z := v_0.Args[0] 17844 if z.Op != OpPPC64XOR { 17845 break 17846 } 17847 _ = z.Args[1] 17848 z_0 := z.Args[0] 17849 z_1 := z.Args[1] 17850 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 { 17851 x := z_0 17852 y := z_1 17853 if !(z.Uses == 1) { 17854 continue 17855 } 17856 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags) 17857 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags)) 17858 v1.AddArg2(x, y) 17859 v0.AddArg(v1) 17860 b.resetWithControl(BlockPPC64NE, v0) 17861 return true 17862 } 17863 break 17864 } 17865 } 17866 return false 17867 }