github.com/megatontech/mynoteforgo@v0.0.0-20200507084910-5d0c6ea6e890/源码/cmd/compile/internal/ssa/rewriteWasm.go (about) 1 // Code generated from gen/Wasm.rules; DO NOT EDIT. 2 // generated with: cd gen; go run *.go 3 4 package ssa 5 6 import "fmt" 7 import "math" 8 import "cmd/internal/obj" 9 import "cmd/internal/objabi" 10 import "cmd/compile/internal/types" 11 12 var _ = fmt.Println // in case not otherwise used 13 var _ = math.MinInt8 // in case not otherwise used 14 var _ = obj.ANOP // in case not otherwise used 15 var _ = objabi.GOROOT // in case not otherwise used 16 var _ = types.TypeMem // in case not otherwise used 17 18 func rewriteValueWasm(v *Value) bool { 19 switch v.Op { 20 case OpAdd16: 21 return rewriteValueWasm_OpAdd16_0(v) 22 case OpAdd32: 23 return rewriteValueWasm_OpAdd32_0(v) 24 case OpAdd32F: 25 return rewriteValueWasm_OpAdd32F_0(v) 26 case OpAdd64: 27 return rewriteValueWasm_OpAdd64_0(v) 28 case OpAdd64F: 29 return rewriteValueWasm_OpAdd64F_0(v) 30 case OpAdd8: 31 return rewriteValueWasm_OpAdd8_0(v) 32 case OpAddPtr: 33 return rewriteValueWasm_OpAddPtr_0(v) 34 case OpAddr: 35 return rewriteValueWasm_OpAddr_0(v) 36 case OpAnd16: 37 return rewriteValueWasm_OpAnd16_0(v) 38 case OpAnd32: 39 return rewriteValueWasm_OpAnd32_0(v) 40 case OpAnd64: 41 return rewriteValueWasm_OpAnd64_0(v) 42 case OpAnd8: 43 return rewriteValueWasm_OpAnd8_0(v) 44 case OpAndB: 45 return rewriteValueWasm_OpAndB_0(v) 46 case OpClosureCall: 47 return rewriteValueWasm_OpClosureCall_0(v) 48 case OpCom16: 49 return rewriteValueWasm_OpCom16_0(v) 50 case OpCom32: 51 return rewriteValueWasm_OpCom32_0(v) 52 case OpCom64: 53 return rewriteValueWasm_OpCom64_0(v) 54 case OpCom8: 55 return rewriteValueWasm_OpCom8_0(v) 56 case OpConst16: 57 return rewriteValueWasm_OpConst16_0(v) 58 case OpConst32: 59 return rewriteValueWasm_OpConst32_0(v) 60 case OpConst32F: 61 return rewriteValueWasm_OpConst32F_0(v) 62 case OpConst64: 63 return rewriteValueWasm_OpConst64_0(v) 64 case OpConst64F: 65 return rewriteValueWasm_OpConst64F_0(v) 66 case OpConst8: 67 return rewriteValueWasm_OpConst8_0(v) 68 case OpConstBool: 69 return rewriteValueWasm_OpConstBool_0(v) 70 case OpConstNil: 71 return rewriteValueWasm_OpConstNil_0(v) 72 case OpConvert: 73 return rewriteValueWasm_OpConvert_0(v) 74 case OpCvt32Fto32: 75 return rewriteValueWasm_OpCvt32Fto32_0(v) 76 case OpCvt32Fto32U: 77 return rewriteValueWasm_OpCvt32Fto32U_0(v) 78 case OpCvt32Fto64: 79 return rewriteValueWasm_OpCvt32Fto64_0(v) 80 case OpCvt32Fto64F: 81 return rewriteValueWasm_OpCvt32Fto64F_0(v) 82 case OpCvt32Fto64U: 83 return rewriteValueWasm_OpCvt32Fto64U_0(v) 84 case OpCvt32Uto32F: 85 return rewriteValueWasm_OpCvt32Uto32F_0(v) 86 case OpCvt32Uto64F: 87 return rewriteValueWasm_OpCvt32Uto64F_0(v) 88 case OpCvt32to32F: 89 return rewriteValueWasm_OpCvt32to32F_0(v) 90 case OpCvt32to64F: 91 return rewriteValueWasm_OpCvt32to64F_0(v) 92 case OpCvt64Fto32: 93 return rewriteValueWasm_OpCvt64Fto32_0(v) 94 case OpCvt64Fto32F: 95 return rewriteValueWasm_OpCvt64Fto32F_0(v) 96 case OpCvt64Fto32U: 97 return rewriteValueWasm_OpCvt64Fto32U_0(v) 98 case OpCvt64Fto64: 99 return rewriteValueWasm_OpCvt64Fto64_0(v) 100 case OpCvt64Fto64U: 101 return rewriteValueWasm_OpCvt64Fto64U_0(v) 102 case OpCvt64Uto32F: 103 return rewriteValueWasm_OpCvt64Uto32F_0(v) 104 case OpCvt64Uto64F: 105 return rewriteValueWasm_OpCvt64Uto64F_0(v) 106 case OpCvt64to32F: 107 return rewriteValueWasm_OpCvt64to32F_0(v) 108 case OpCvt64to64F: 109 return rewriteValueWasm_OpCvt64to64F_0(v) 110 case OpDiv16: 111 return rewriteValueWasm_OpDiv16_0(v) 112 case OpDiv16u: 113 return rewriteValueWasm_OpDiv16u_0(v) 114 case OpDiv32: 115 return rewriteValueWasm_OpDiv32_0(v) 116 case OpDiv32F: 117 return rewriteValueWasm_OpDiv32F_0(v) 118 case OpDiv32u: 119 return rewriteValueWasm_OpDiv32u_0(v) 120 case OpDiv64: 121 return rewriteValueWasm_OpDiv64_0(v) 122 case OpDiv64F: 123 return rewriteValueWasm_OpDiv64F_0(v) 124 case OpDiv64u: 125 return rewriteValueWasm_OpDiv64u_0(v) 126 case OpDiv8: 127 return rewriteValueWasm_OpDiv8_0(v) 128 case OpDiv8u: 129 return rewriteValueWasm_OpDiv8u_0(v) 130 case OpEq16: 131 return rewriteValueWasm_OpEq16_0(v) 132 case OpEq32: 133 return rewriteValueWasm_OpEq32_0(v) 134 case OpEq32F: 135 return rewriteValueWasm_OpEq32F_0(v) 136 case OpEq64: 137 return rewriteValueWasm_OpEq64_0(v) 138 case OpEq64F: 139 return rewriteValueWasm_OpEq64F_0(v) 140 case OpEq8: 141 return rewriteValueWasm_OpEq8_0(v) 142 case OpEqB: 143 return rewriteValueWasm_OpEqB_0(v) 144 case OpEqPtr: 145 return rewriteValueWasm_OpEqPtr_0(v) 146 case OpGeq16: 147 return rewriteValueWasm_OpGeq16_0(v) 148 case OpGeq16U: 149 return rewriteValueWasm_OpGeq16U_0(v) 150 case OpGeq32: 151 return rewriteValueWasm_OpGeq32_0(v) 152 case OpGeq32F: 153 return rewriteValueWasm_OpGeq32F_0(v) 154 case OpGeq32U: 155 return rewriteValueWasm_OpGeq32U_0(v) 156 case OpGeq64: 157 return rewriteValueWasm_OpGeq64_0(v) 158 case OpGeq64F: 159 return rewriteValueWasm_OpGeq64F_0(v) 160 case OpGeq64U: 161 return rewriteValueWasm_OpGeq64U_0(v) 162 case OpGeq8: 163 return rewriteValueWasm_OpGeq8_0(v) 164 case OpGeq8U: 165 return rewriteValueWasm_OpGeq8U_0(v) 166 case OpGetCallerPC: 167 return rewriteValueWasm_OpGetCallerPC_0(v) 168 case OpGetCallerSP: 169 return rewriteValueWasm_OpGetCallerSP_0(v) 170 case OpGetClosurePtr: 171 return rewriteValueWasm_OpGetClosurePtr_0(v) 172 case OpGreater16: 173 return rewriteValueWasm_OpGreater16_0(v) 174 case OpGreater16U: 175 return rewriteValueWasm_OpGreater16U_0(v) 176 case OpGreater32: 177 return rewriteValueWasm_OpGreater32_0(v) 178 case OpGreater32F: 179 return rewriteValueWasm_OpGreater32F_0(v) 180 case OpGreater32U: 181 return rewriteValueWasm_OpGreater32U_0(v) 182 case OpGreater64: 183 return rewriteValueWasm_OpGreater64_0(v) 184 case OpGreater64F: 185 return rewriteValueWasm_OpGreater64F_0(v) 186 case OpGreater64U: 187 return rewriteValueWasm_OpGreater64U_0(v) 188 case OpGreater8: 189 return rewriteValueWasm_OpGreater8_0(v) 190 case OpGreater8U: 191 return rewriteValueWasm_OpGreater8U_0(v) 192 case OpInterCall: 193 return rewriteValueWasm_OpInterCall_0(v) 194 case OpIsInBounds: 195 return rewriteValueWasm_OpIsInBounds_0(v) 196 case OpIsNonNil: 197 return rewriteValueWasm_OpIsNonNil_0(v) 198 case OpIsSliceInBounds: 199 return rewriteValueWasm_OpIsSliceInBounds_0(v) 200 case OpLeq16: 201 return rewriteValueWasm_OpLeq16_0(v) 202 case OpLeq16U: 203 return rewriteValueWasm_OpLeq16U_0(v) 204 case OpLeq32: 205 return rewriteValueWasm_OpLeq32_0(v) 206 case OpLeq32F: 207 return rewriteValueWasm_OpLeq32F_0(v) 208 case OpLeq32U: 209 return rewriteValueWasm_OpLeq32U_0(v) 210 case OpLeq64: 211 return rewriteValueWasm_OpLeq64_0(v) 212 case OpLeq64F: 213 return rewriteValueWasm_OpLeq64F_0(v) 214 case OpLeq64U: 215 return rewriteValueWasm_OpLeq64U_0(v) 216 case OpLeq8: 217 return rewriteValueWasm_OpLeq8_0(v) 218 case OpLeq8U: 219 return rewriteValueWasm_OpLeq8U_0(v) 220 case OpLess16: 221 return rewriteValueWasm_OpLess16_0(v) 222 case OpLess16U: 223 return rewriteValueWasm_OpLess16U_0(v) 224 case OpLess32: 225 return rewriteValueWasm_OpLess32_0(v) 226 case OpLess32F: 227 return rewriteValueWasm_OpLess32F_0(v) 228 case OpLess32U: 229 return rewriteValueWasm_OpLess32U_0(v) 230 case OpLess64: 231 return rewriteValueWasm_OpLess64_0(v) 232 case OpLess64F: 233 return rewriteValueWasm_OpLess64F_0(v) 234 case OpLess64U: 235 return rewriteValueWasm_OpLess64U_0(v) 236 case OpLess8: 237 return rewriteValueWasm_OpLess8_0(v) 238 case OpLess8U: 239 return rewriteValueWasm_OpLess8U_0(v) 240 case OpLoad: 241 return rewriteValueWasm_OpLoad_0(v) 242 case OpLocalAddr: 243 return rewriteValueWasm_OpLocalAddr_0(v) 244 case OpLsh16x16: 245 return rewriteValueWasm_OpLsh16x16_0(v) 246 case OpLsh16x32: 247 return rewriteValueWasm_OpLsh16x32_0(v) 248 case OpLsh16x64: 249 return rewriteValueWasm_OpLsh16x64_0(v) 250 case OpLsh16x8: 251 return rewriteValueWasm_OpLsh16x8_0(v) 252 case OpLsh32x16: 253 return rewriteValueWasm_OpLsh32x16_0(v) 254 case OpLsh32x32: 255 return rewriteValueWasm_OpLsh32x32_0(v) 256 case OpLsh32x64: 257 return rewriteValueWasm_OpLsh32x64_0(v) 258 case OpLsh32x8: 259 return rewriteValueWasm_OpLsh32x8_0(v) 260 case OpLsh64x16: 261 return rewriteValueWasm_OpLsh64x16_0(v) 262 case OpLsh64x32: 263 return rewriteValueWasm_OpLsh64x32_0(v) 264 case OpLsh64x64: 265 return rewriteValueWasm_OpLsh64x64_0(v) 266 case OpLsh64x8: 267 return rewriteValueWasm_OpLsh64x8_0(v) 268 case OpLsh8x16: 269 return rewriteValueWasm_OpLsh8x16_0(v) 270 case OpLsh8x32: 271 return rewriteValueWasm_OpLsh8x32_0(v) 272 case OpLsh8x64: 273 return rewriteValueWasm_OpLsh8x64_0(v) 274 case OpLsh8x8: 275 return rewriteValueWasm_OpLsh8x8_0(v) 276 case OpMod16: 277 return rewriteValueWasm_OpMod16_0(v) 278 case OpMod16u: 279 return rewriteValueWasm_OpMod16u_0(v) 280 case OpMod32: 281 return rewriteValueWasm_OpMod32_0(v) 282 case OpMod32u: 283 return rewriteValueWasm_OpMod32u_0(v) 284 case OpMod64: 285 return rewriteValueWasm_OpMod64_0(v) 286 case OpMod64u: 287 return rewriteValueWasm_OpMod64u_0(v) 288 case OpMod8: 289 return rewriteValueWasm_OpMod8_0(v) 290 case OpMod8u: 291 return rewriteValueWasm_OpMod8u_0(v) 292 case OpMove: 293 return rewriteValueWasm_OpMove_0(v) || rewriteValueWasm_OpMove_10(v) 294 case OpMul16: 295 return rewriteValueWasm_OpMul16_0(v) 296 case OpMul32: 297 return rewriteValueWasm_OpMul32_0(v) 298 case OpMul32F: 299 return rewriteValueWasm_OpMul32F_0(v) 300 case OpMul64: 301 return rewriteValueWasm_OpMul64_0(v) 302 case OpMul64F: 303 return rewriteValueWasm_OpMul64F_0(v) 304 case OpMul8: 305 return rewriteValueWasm_OpMul8_0(v) 306 case OpNeg16: 307 return rewriteValueWasm_OpNeg16_0(v) 308 case OpNeg32: 309 return rewriteValueWasm_OpNeg32_0(v) 310 case OpNeg32F: 311 return rewriteValueWasm_OpNeg32F_0(v) 312 case OpNeg64: 313 return rewriteValueWasm_OpNeg64_0(v) 314 case OpNeg64F: 315 return rewriteValueWasm_OpNeg64F_0(v) 316 case OpNeg8: 317 return rewriteValueWasm_OpNeg8_0(v) 318 case OpNeq16: 319 return rewriteValueWasm_OpNeq16_0(v) 320 case OpNeq32: 321 return rewriteValueWasm_OpNeq32_0(v) 322 case OpNeq32F: 323 return rewriteValueWasm_OpNeq32F_0(v) 324 case OpNeq64: 325 return rewriteValueWasm_OpNeq64_0(v) 326 case OpNeq64F: 327 return rewriteValueWasm_OpNeq64F_0(v) 328 case OpNeq8: 329 return rewriteValueWasm_OpNeq8_0(v) 330 case OpNeqB: 331 return rewriteValueWasm_OpNeqB_0(v) 332 case OpNeqPtr: 333 return rewriteValueWasm_OpNeqPtr_0(v) 334 case OpNilCheck: 335 return rewriteValueWasm_OpNilCheck_0(v) 336 case OpNot: 337 return rewriteValueWasm_OpNot_0(v) 338 case OpOffPtr: 339 return rewriteValueWasm_OpOffPtr_0(v) 340 case OpOr16: 341 return rewriteValueWasm_OpOr16_0(v) 342 case OpOr32: 343 return rewriteValueWasm_OpOr32_0(v) 344 case OpOr64: 345 return rewriteValueWasm_OpOr64_0(v) 346 case OpOr8: 347 return rewriteValueWasm_OpOr8_0(v) 348 case OpOrB: 349 return rewriteValueWasm_OpOrB_0(v) 350 case OpRound32F: 351 return rewriteValueWasm_OpRound32F_0(v) 352 case OpRound64F: 353 return rewriteValueWasm_OpRound64F_0(v) 354 case OpRsh16Ux16: 355 return rewriteValueWasm_OpRsh16Ux16_0(v) 356 case OpRsh16Ux32: 357 return rewriteValueWasm_OpRsh16Ux32_0(v) 358 case OpRsh16Ux64: 359 return rewriteValueWasm_OpRsh16Ux64_0(v) 360 case OpRsh16Ux8: 361 return rewriteValueWasm_OpRsh16Ux8_0(v) 362 case OpRsh16x16: 363 return rewriteValueWasm_OpRsh16x16_0(v) 364 case OpRsh16x32: 365 return rewriteValueWasm_OpRsh16x32_0(v) 366 case OpRsh16x64: 367 return rewriteValueWasm_OpRsh16x64_0(v) 368 case OpRsh16x8: 369 return rewriteValueWasm_OpRsh16x8_0(v) 370 case OpRsh32Ux16: 371 return rewriteValueWasm_OpRsh32Ux16_0(v) 372 case OpRsh32Ux32: 373 return rewriteValueWasm_OpRsh32Ux32_0(v) 374 case OpRsh32Ux64: 375 return rewriteValueWasm_OpRsh32Ux64_0(v) 376 case OpRsh32Ux8: 377 return rewriteValueWasm_OpRsh32Ux8_0(v) 378 case OpRsh32x16: 379 return rewriteValueWasm_OpRsh32x16_0(v) 380 case OpRsh32x32: 381 return rewriteValueWasm_OpRsh32x32_0(v) 382 case OpRsh32x64: 383 return rewriteValueWasm_OpRsh32x64_0(v) 384 case OpRsh32x8: 385 return rewriteValueWasm_OpRsh32x8_0(v) 386 case OpRsh64Ux16: 387 return rewriteValueWasm_OpRsh64Ux16_0(v) 388 case OpRsh64Ux32: 389 return rewriteValueWasm_OpRsh64Ux32_0(v) 390 case OpRsh64Ux64: 391 return rewriteValueWasm_OpRsh64Ux64_0(v) 392 case OpRsh64Ux8: 393 return rewriteValueWasm_OpRsh64Ux8_0(v) 394 case OpRsh64x16: 395 return rewriteValueWasm_OpRsh64x16_0(v) 396 case OpRsh64x32: 397 return rewriteValueWasm_OpRsh64x32_0(v) 398 case OpRsh64x64: 399 return rewriteValueWasm_OpRsh64x64_0(v) 400 case OpRsh64x8: 401 return rewriteValueWasm_OpRsh64x8_0(v) 402 case OpRsh8Ux16: 403 return rewriteValueWasm_OpRsh8Ux16_0(v) 404 case OpRsh8Ux32: 405 return rewriteValueWasm_OpRsh8Ux32_0(v) 406 case OpRsh8Ux64: 407 return rewriteValueWasm_OpRsh8Ux64_0(v) 408 case OpRsh8Ux8: 409 return rewriteValueWasm_OpRsh8Ux8_0(v) 410 case OpRsh8x16: 411 return rewriteValueWasm_OpRsh8x16_0(v) 412 case OpRsh8x32: 413 return rewriteValueWasm_OpRsh8x32_0(v) 414 case OpRsh8x64: 415 return rewriteValueWasm_OpRsh8x64_0(v) 416 case OpRsh8x8: 417 return rewriteValueWasm_OpRsh8x8_0(v) 418 case OpSignExt16to32: 419 return rewriteValueWasm_OpSignExt16to32_0(v) 420 case OpSignExt16to64: 421 return rewriteValueWasm_OpSignExt16to64_0(v) 422 case OpSignExt32to64: 423 return rewriteValueWasm_OpSignExt32to64_0(v) 424 case OpSignExt8to16: 425 return rewriteValueWasm_OpSignExt8to16_0(v) 426 case OpSignExt8to32: 427 return rewriteValueWasm_OpSignExt8to32_0(v) 428 case OpSignExt8to64: 429 return rewriteValueWasm_OpSignExt8to64_0(v) 430 case OpSlicemask: 431 return rewriteValueWasm_OpSlicemask_0(v) 432 case OpStaticCall: 433 return rewriteValueWasm_OpStaticCall_0(v) 434 case OpStore: 435 return rewriteValueWasm_OpStore_0(v) 436 case OpSub16: 437 return rewriteValueWasm_OpSub16_0(v) 438 case OpSub32: 439 return rewriteValueWasm_OpSub32_0(v) 440 case OpSub32F: 441 return rewriteValueWasm_OpSub32F_0(v) 442 case OpSub64: 443 return rewriteValueWasm_OpSub64_0(v) 444 case OpSub64F: 445 return rewriteValueWasm_OpSub64F_0(v) 446 case OpSub8: 447 return rewriteValueWasm_OpSub8_0(v) 448 case OpSubPtr: 449 return rewriteValueWasm_OpSubPtr_0(v) 450 case OpTrunc16to8: 451 return rewriteValueWasm_OpTrunc16to8_0(v) 452 case OpTrunc32to16: 453 return rewriteValueWasm_OpTrunc32to16_0(v) 454 case OpTrunc32to8: 455 return rewriteValueWasm_OpTrunc32to8_0(v) 456 case OpTrunc64to16: 457 return rewriteValueWasm_OpTrunc64to16_0(v) 458 case OpTrunc64to32: 459 return rewriteValueWasm_OpTrunc64to32_0(v) 460 case OpTrunc64to8: 461 return rewriteValueWasm_OpTrunc64to8_0(v) 462 case OpWB: 463 return rewriteValueWasm_OpWB_0(v) 464 case OpWasmF64Add: 465 return rewriteValueWasm_OpWasmF64Add_0(v) 466 case OpWasmF64Mul: 467 return rewriteValueWasm_OpWasmF64Mul_0(v) 468 case OpWasmI64Add: 469 return rewriteValueWasm_OpWasmI64Add_0(v) 470 case OpWasmI64AddConst: 471 return rewriteValueWasm_OpWasmI64AddConst_0(v) 472 case OpWasmI64And: 473 return rewriteValueWasm_OpWasmI64And_0(v) 474 case OpWasmI64Eq: 475 return rewriteValueWasm_OpWasmI64Eq_0(v) 476 case OpWasmI64Eqz: 477 return rewriteValueWasm_OpWasmI64Eqz_0(v) 478 case OpWasmI64Load: 479 return rewriteValueWasm_OpWasmI64Load_0(v) 480 case OpWasmI64Load16S: 481 return rewriteValueWasm_OpWasmI64Load16S_0(v) 482 case OpWasmI64Load16U: 483 return rewriteValueWasm_OpWasmI64Load16U_0(v) 484 case OpWasmI64Load32S: 485 return rewriteValueWasm_OpWasmI64Load32S_0(v) 486 case OpWasmI64Load32U: 487 return rewriteValueWasm_OpWasmI64Load32U_0(v) 488 case OpWasmI64Load8S: 489 return rewriteValueWasm_OpWasmI64Load8S_0(v) 490 case OpWasmI64Load8U: 491 return rewriteValueWasm_OpWasmI64Load8U_0(v) 492 case OpWasmI64Mul: 493 return rewriteValueWasm_OpWasmI64Mul_0(v) 494 case OpWasmI64Ne: 495 return rewriteValueWasm_OpWasmI64Ne_0(v) 496 case OpWasmI64Or: 497 return rewriteValueWasm_OpWasmI64Or_0(v) 498 case OpWasmI64Shl: 499 return rewriteValueWasm_OpWasmI64Shl_0(v) 500 case OpWasmI64ShrS: 501 return rewriteValueWasm_OpWasmI64ShrS_0(v) 502 case OpWasmI64ShrU: 503 return rewriteValueWasm_OpWasmI64ShrU_0(v) 504 case OpWasmI64Store: 505 return rewriteValueWasm_OpWasmI64Store_0(v) 506 case OpWasmI64Store16: 507 return rewriteValueWasm_OpWasmI64Store16_0(v) 508 case OpWasmI64Store32: 509 return rewriteValueWasm_OpWasmI64Store32_0(v) 510 case OpWasmI64Store8: 511 return rewriteValueWasm_OpWasmI64Store8_0(v) 512 case OpWasmI64Xor: 513 return rewriteValueWasm_OpWasmI64Xor_0(v) 514 case OpXor16: 515 return rewriteValueWasm_OpXor16_0(v) 516 case OpXor32: 517 return rewriteValueWasm_OpXor32_0(v) 518 case OpXor64: 519 return rewriteValueWasm_OpXor64_0(v) 520 case OpXor8: 521 return rewriteValueWasm_OpXor8_0(v) 522 case OpZero: 523 return rewriteValueWasm_OpZero_0(v) || rewriteValueWasm_OpZero_10(v) 524 case OpZeroExt16to32: 525 return rewriteValueWasm_OpZeroExt16to32_0(v) 526 case OpZeroExt16to64: 527 return rewriteValueWasm_OpZeroExt16to64_0(v) 528 case OpZeroExt32to64: 529 return rewriteValueWasm_OpZeroExt32to64_0(v) 530 case OpZeroExt8to16: 531 return rewriteValueWasm_OpZeroExt8to16_0(v) 532 case OpZeroExt8to32: 533 return rewriteValueWasm_OpZeroExt8to32_0(v) 534 case OpZeroExt8to64: 535 return rewriteValueWasm_OpZeroExt8to64_0(v) 536 } 537 return false 538 } 539 func rewriteValueWasm_OpAdd16_0(v *Value) bool { 540 // match: (Add16 x y) 541 // cond: 542 // result: (I64Add x y) 543 for { 544 _ = v.Args[1] 545 x := v.Args[0] 546 y := v.Args[1] 547 v.reset(OpWasmI64Add) 548 v.AddArg(x) 549 v.AddArg(y) 550 return true 551 } 552 } 553 func rewriteValueWasm_OpAdd32_0(v *Value) bool { 554 // match: (Add32 x y) 555 // cond: 556 // result: (I64Add x y) 557 for { 558 _ = v.Args[1] 559 x := v.Args[0] 560 y := v.Args[1] 561 v.reset(OpWasmI64Add) 562 v.AddArg(x) 563 v.AddArg(y) 564 return true 565 } 566 } 567 func rewriteValueWasm_OpAdd32F_0(v *Value) bool { 568 // match: (Add32F x y) 569 // cond: 570 // result: (F64Add x y) 571 for { 572 _ = v.Args[1] 573 x := v.Args[0] 574 y := v.Args[1] 575 v.reset(OpWasmF64Add) 576 v.AddArg(x) 577 v.AddArg(y) 578 return true 579 } 580 } 581 func rewriteValueWasm_OpAdd64_0(v *Value) bool { 582 // match: (Add64 x y) 583 // cond: 584 // result: (I64Add x y) 585 for { 586 _ = v.Args[1] 587 x := v.Args[0] 588 y := v.Args[1] 589 v.reset(OpWasmI64Add) 590 v.AddArg(x) 591 v.AddArg(y) 592 return true 593 } 594 } 595 func rewriteValueWasm_OpAdd64F_0(v *Value) bool { 596 // match: (Add64F x y) 597 // cond: 598 // result: (F64Add x y) 599 for { 600 _ = v.Args[1] 601 x := v.Args[0] 602 y := v.Args[1] 603 v.reset(OpWasmF64Add) 604 v.AddArg(x) 605 v.AddArg(y) 606 return true 607 } 608 } 609 func rewriteValueWasm_OpAdd8_0(v *Value) bool { 610 // match: (Add8 x y) 611 // cond: 612 // result: (I64Add x y) 613 for { 614 _ = v.Args[1] 615 x := v.Args[0] 616 y := v.Args[1] 617 v.reset(OpWasmI64Add) 618 v.AddArg(x) 619 v.AddArg(y) 620 return true 621 } 622 } 623 func rewriteValueWasm_OpAddPtr_0(v *Value) bool { 624 // match: (AddPtr x y) 625 // cond: 626 // result: (I64Add x y) 627 for { 628 _ = v.Args[1] 629 x := v.Args[0] 630 y := v.Args[1] 631 v.reset(OpWasmI64Add) 632 v.AddArg(x) 633 v.AddArg(y) 634 return true 635 } 636 } 637 func rewriteValueWasm_OpAddr_0(v *Value) bool { 638 // match: (Addr {sym} base) 639 // cond: 640 // result: (LoweredAddr {sym} base) 641 for { 642 sym := v.Aux 643 base := v.Args[0] 644 v.reset(OpWasmLoweredAddr) 645 v.Aux = sym 646 v.AddArg(base) 647 return true 648 } 649 } 650 func rewriteValueWasm_OpAnd16_0(v *Value) bool { 651 // match: (And16 x y) 652 // cond: 653 // result: (I64And x y) 654 for { 655 _ = v.Args[1] 656 x := v.Args[0] 657 y := v.Args[1] 658 v.reset(OpWasmI64And) 659 v.AddArg(x) 660 v.AddArg(y) 661 return true 662 } 663 } 664 func rewriteValueWasm_OpAnd32_0(v *Value) bool { 665 // match: (And32 x y) 666 // cond: 667 // result: (I64And x y) 668 for { 669 _ = v.Args[1] 670 x := v.Args[0] 671 y := v.Args[1] 672 v.reset(OpWasmI64And) 673 v.AddArg(x) 674 v.AddArg(y) 675 return true 676 } 677 } 678 func rewriteValueWasm_OpAnd64_0(v *Value) bool { 679 // match: (And64 x y) 680 // cond: 681 // result: (I64And x y) 682 for { 683 _ = v.Args[1] 684 x := v.Args[0] 685 y := v.Args[1] 686 v.reset(OpWasmI64And) 687 v.AddArg(x) 688 v.AddArg(y) 689 return true 690 } 691 } 692 func rewriteValueWasm_OpAnd8_0(v *Value) bool { 693 // match: (And8 x y) 694 // cond: 695 // result: (I64And x y) 696 for { 697 _ = v.Args[1] 698 x := v.Args[0] 699 y := v.Args[1] 700 v.reset(OpWasmI64And) 701 v.AddArg(x) 702 v.AddArg(y) 703 return true 704 } 705 } 706 func rewriteValueWasm_OpAndB_0(v *Value) bool { 707 // match: (AndB x y) 708 // cond: 709 // result: (I64And x y) 710 for { 711 _ = v.Args[1] 712 x := v.Args[0] 713 y := v.Args[1] 714 v.reset(OpWasmI64And) 715 v.AddArg(x) 716 v.AddArg(y) 717 return true 718 } 719 } 720 func rewriteValueWasm_OpClosureCall_0(v *Value) bool { 721 // match: (ClosureCall [argwid] entry closure mem) 722 // cond: 723 // result: (LoweredClosureCall [argwid] entry closure mem) 724 for { 725 argwid := v.AuxInt 726 _ = v.Args[2] 727 entry := v.Args[0] 728 closure := v.Args[1] 729 mem := v.Args[2] 730 v.reset(OpWasmLoweredClosureCall) 731 v.AuxInt = argwid 732 v.AddArg(entry) 733 v.AddArg(closure) 734 v.AddArg(mem) 735 return true 736 } 737 } 738 func rewriteValueWasm_OpCom16_0(v *Value) bool { 739 b := v.Block 740 _ = b 741 typ := &b.Func.Config.Types 742 _ = typ 743 // match: (Com16 x) 744 // cond: 745 // result: (I64Xor x (I64Const [-1])) 746 for { 747 x := v.Args[0] 748 v.reset(OpWasmI64Xor) 749 v.AddArg(x) 750 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 751 v0.AuxInt = -1 752 v.AddArg(v0) 753 return true 754 } 755 } 756 func rewriteValueWasm_OpCom32_0(v *Value) bool { 757 b := v.Block 758 _ = b 759 typ := &b.Func.Config.Types 760 _ = typ 761 // match: (Com32 x) 762 // cond: 763 // result: (I64Xor x (I64Const [-1])) 764 for { 765 x := v.Args[0] 766 v.reset(OpWasmI64Xor) 767 v.AddArg(x) 768 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 769 v0.AuxInt = -1 770 v.AddArg(v0) 771 return true 772 } 773 } 774 func rewriteValueWasm_OpCom64_0(v *Value) bool { 775 b := v.Block 776 _ = b 777 typ := &b.Func.Config.Types 778 _ = typ 779 // match: (Com64 x) 780 // cond: 781 // result: (I64Xor x (I64Const [-1])) 782 for { 783 x := v.Args[0] 784 v.reset(OpWasmI64Xor) 785 v.AddArg(x) 786 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 787 v0.AuxInt = -1 788 v.AddArg(v0) 789 return true 790 } 791 } 792 func rewriteValueWasm_OpCom8_0(v *Value) bool { 793 b := v.Block 794 _ = b 795 typ := &b.Func.Config.Types 796 _ = typ 797 // match: (Com8 x) 798 // cond: 799 // result: (I64Xor x (I64Const [-1])) 800 for { 801 x := v.Args[0] 802 v.reset(OpWasmI64Xor) 803 v.AddArg(x) 804 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 805 v0.AuxInt = -1 806 v.AddArg(v0) 807 return true 808 } 809 } 810 func rewriteValueWasm_OpConst16_0(v *Value) bool { 811 // match: (Const16 [val]) 812 // cond: 813 // result: (I64Const [val]) 814 for { 815 val := v.AuxInt 816 v.reset(OpWasmI64Const) 817 v.AuxInt = val 818 return true 819 } 820 } 821 func rewriteValueWasm_OpConst32_0(v *Value) bool { 822 // match: (Const32 [val]) 823 // cond: 824 // result: (I64Const [val]) 825 for { 826 val := v.AuxInt 827 v.reset(OpWasmI64Const) 828 v.AuxInt = val 829 return true 830 } 831 } 832 func rewriteValueWasm_OpConst32F_0(v *Value) bool { 833 // match: (Const32F [val]) 834 // cond: 835 // result: (F64Const [val]) 836 for { 837 val := v.AuxInt 838 v.reset(OpWasmF64Const) 839 v.AuxInt = val 840 return true 841 } 842 } 843 func rewriteValueWasm_OpConst64_0(v *Value) bool { 844 // match: (Const64 [val]) 845 // cond: 846 // result: (I64Const [val]) 847 for { 848 val := v.AuxInt 849 v.reset(OpWasmI64Const) 850 v.AuxInt = val 851 return true 852 } 853 } 854 func rewriteValueWasm_OpConst64F_0(v *Value) bool { 855 // match: (Const64F [val]) 856 // cond: 857 // result: (F64Const [val]) 858 for { 859 val := v.AuxInt 860 v.reset(OpWasmF64Const) 861 v.AuxInt = val 862 return true 863 } 864 } 865 func rewriteValueWasm_OpConst8_0(v *Value) bool { 866 // match: (Const8 [val]) 867 // cond: 868 // result: (I64Const [val]) 869 for { 870 val := v.AuxInt 871 v.reset(OpWasmI64Const) 872 v.AuxInt = val 873 return true 874 } 875 } 876 func rewriteValueWasm_OpConstBool_0(v *Value) bool { 877 // match: (ConstBool [b]) 878 // cond: 879 // result: (I64Const [b]) 880 for { 881 b := v.AuxInt 882 v.reset(OpWasmI64Const) 883 v.AuxInt = b 884 return true 885 } 886 } 887 func rewriteValueWasm_OpConstNil_0(v *Value) bool { 888 // match: (ConstNil) 889 // cond: 890 // result: (I64Const [0]) 891 for { 892 v.reset(OpWasmI64Const) 893 v.AuxInt = 0 894 return true 895 } 896 } 897 func rewriteValueWasm_OpConvert_0(v *Value) bool { 898 // match: (Convert <t> x mem) 899 // cond: 900 // result: (LoweredConvert <t> x mem) 901 for { 902 t := v.Type 903 _ = v.Args[1] 904 x := v.Args[0] 905 mem := v.Args[1] 906 v.reset(OpWasmLoweredConvert) 907 v.Type = t 908 v.AddArg(x) 909 v.AddArg(mem) 910 return true 911 } 912 } 913 func rewriteValueWasm_OpCvt32Fto32_0(v *Value) bool { 914 // match: (Cvt32Fto32 x) 915 // cond: 916 // result: (I64TruncSF64 x) 917 for { 918 x := v.Args[0] 919 v.reset(OpWasmI64TruncSF64) 920 v.AddArg(x) 921 return true 922 } 923 } 924 func rewriteValueWasm_OpCvt32Fto32U_0(v *Value) bool { 925 // match: (Cvt32Fto32U x) 926 // cond: 927 // result: (I64TruncUF64 x) 928 for { 929 x := v.Args[0] 930 v.reset(OpWasmI64TruncUF64) 931 v.AddArg(x) 932 return true 933 } 934 } 935 func rewriteValueWasm_OpCvt32Fto64_0(v *Value) bool { 936 // match: (Cvt32Fto64 x) 937 // cond: 938 // result: (I64TruncSF64 x) 939 for { 940 x := v.Args[0] 941 v.reset(OpWasmI64TruncSF64) 942 v.AddArg(x) 943 return true 944 } 945 } 946 func rewriteValueWasm_OpCvt32Fto64F_0(v *Value) bool { 947 // match: (Cvt32Fto64F x) 948 // cond: 949 // result: x 950 for { 951 x := v.Args[0] 952 v.reset(OpCopy) 953 v.Type = x.Type 954 v.AddArg(x) 955 return true 956 } 957 } 958 func rewriteValueWasm_OpCvt32Fto64U_0(v *Value) bool { 959 // match: (Cvt32Fto64U x) 960 // cond: 961 // result: (I64TruncUF64 x) 962 for { 963 x := v.Args[0] 964 v.reset(OpWasmI64TruncUF64) 965 v.AddArg(x) 966 return true 967 } 968 } 969 func rewriteValueWasm_OpCvt32Uto32F_0(v *Value) bool { 970 b := v.Block 971 _ = b 972 typ := &b.Func.Config.Types 973 _ = typ 974 // match: (Cvt32Uto32F x) 975 // cond: 976 // result: (LoweredRound32F (F64ConvertUI64 (ZeroExt32to64 x))) 977 for { 978 x := v.Args[0] 979 v.reset(OpWasmLoweredRound32F) 980 v0 := b.NewValue0(v.Pos, OpWasmF64ConvertUI64, typ.Float64) 981 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 982 v1.AddArg(x) 983 v0.AddArg(v1) 984 v.AddArg(v0) 985 return true 986 } 987 } 988 func rewriteValueWasm_OpCvt32Uto64F_0(v *Value) bool { 989 b := v.Block 990 _ = b 991 typ := &b.Func.Config.Types 992 _ = typ 993 // match: (Cvt32Uto64F x) 994 // cond: 995 // result: (F64ConvertUI64 (ZeroExt32to64 x)) 996 for { 997 x := v.Args[0] 998 v.reset(OpWasmF64ConvertUI64) 999 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 1000 v0.AddArg(x) 1001 v.AddArg(v0) 1002 return true 1003 } 1004 } 1005 func rewriteValueWasm_OpCvt32to32F_0(v *Value) bool { 1006 b := v.Block 1007 _ = b 1008 typ := &b.Func.Config.Types 1009 _ = typ 1010 // match: (Cvt32to32F x) 1011 // cond: 1012 // result: (LoweredRound32F (F64ConvertSI64 (SignExt32to64 x))) 1013 for { 1014 x := v.Args[0] 1015 v.reset(OpWasmLoweredRound32F) 1016 v0 := b.NewValue0(v.Pos, OpWasmF64ConvertSI64, typ.Float64) 1017 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 1018 v1.AddArg(x) 1019 v0.AddArg(v1) 1020 v.AddArg(v0) 1021 return true 1022 } 1023 } 1024 func rewriteValueWasm_OpCvt32to64F_0(v *Value) bool { 1025 b := v.Block 1026 _ = b 1027 typ := &b.Func.Config.Types 1028 _ = typ 1029 // match: (Cvt32to64F x) 1030 // cond: 1031 // result: (F64ConvertSI64 (SignExt32to64 x)) 1032 for { 1033 x := v.Args[0] 1034 v.reset(OpWasmF64ConvertSI64) 1035 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 1036 v0.AddArg(x) 1037 v.AddArg(v0) 1038 return true 1039 } 1040 } 1041 func rewriteValueWasm_OpCvt64Fto32_0(v *Value) bool { 1042 // match: (Cvt64Fto32 x) 1043 // cond: 1044 // result: (I64TruncSF64 x) 1045 for { 1046 x := v.Args[0] 1047 v.reset(OpWasmI64TruncSF64) 1048 v.AddArg(x) 1049 return true 1050 } 1051 } 1052 func rewriteValueWasm_OpCvt64Fto32F_0(v *Value) bool { 1053 // match: (Cvt64Fto32F x) 1054 // cond: 1055 // result: (LoweredRound32F x) 1056 for { 1057 x := v.Args[0] 1058 v.reset(OpWasmLoweredRound32F) 1059 v.AddArg(x) 1060 return true 1061 } 1062 } 1063 func rewriteValueWasm_OpCvt64Fto32U_0(v *Value) bool { 1064 // match: (Cvt64Fto32U x) 1065 // cond: 1066 // result: (I64TruncUF64 x) 1067 for { 1068 x := v.Args[0] 1069 v.reset(OpWasmI64TruncUF64) 1070 v.AddArg(x) 1071 return true 1072 } 1073 } 1074 func rewriteValueWasm_OpCvt64Fto64_0(v *Value) bool { 1075 // match: (Cvt64Fto64 x) 1076 // cond: 1077 // result: (I64TruncSF64 x) 1078 for { 1079 x := v.Args[0] 1080 v.reset(OpWasmI64TruncSF64) 1081 v.AddArg(x) 1082 return true 1083 } 1084 } 1085 func rewriteValueWasm_OpCvt64Fto64U_0(v *Value) bool { 1086 // match: (Cvt64Fto64U x) 1087 // cond: 1088 // result: (I64TruncUF64 x) 1089 for { 1090 x := v.Args[0] 1091 v.reset(OpWasmI64TruncUF64) 1092 v.AddArg(x) 1093 return true 1094 } 1095 } 1096 func rewriteValueWasm_OpCvt64Uto32F_0(v *Value) bool { 1097 b := v.Block 1098 _ = b 1099 typ := &b.Func.Config.Types 1100 _ = typ 1101 // match: (Cvt64Uto32F x) 1102 // cond: 1103 // result: (LoweredRound32F (F64ConvertUI64 x)) 1104 for { 1105 x := v.Args[0] 1106 v.reset(OpWasmLoweredRound32F) 1107 v0 := b.NewValue0(v.Pos, OpWasmF64ConvertUI64, typ.Float64) 1108 v0.AddArg(x) 1109 v.AddArg(v0) 1110 return true 1111 } 1112 } 1113 func rewriteValueWasm_OpCvt64Uto64F_0(v *Value) bool { 1114 // match: (Cvt64Uto64F x) 1115 // cond: 1116 // result: (F64ConvertUI64 x) 1117 for { 1118 x := v.Args[0] 1119 v.reset(OpWasmF64ConvertUI64) 1120 v.AddArg(x) 1121 return true 1122 } 1123 } 1124 func rewriteValueWasm_OpCvt64to32F_0(v *Value) bool { 1125 b := v.Block 1126 _ = b 1127 typ := &b.Func.Config.Types 1128 _ = typ 1129 // match: (Cvt64to32F x) 1130 // cond: 1131 // result: (LoweredRound32F (F64ConvertSI64 x)) 1132 for { 1133 x := v.Args[0] 1134 v.reset(OpWasmLoweredRound32F) 1135 v0 := b.NewValue0(v.Pos, OpWasmF64ConvertSI64, typ.Float64) 1136 v0.AddArg(x) 1137 v.AddArg(v0) 1138 return true 1139 } 1140 } 1141 func rewriteValueWasm_OpCvt64to64F_0(v *Value) bool { 1142 // match: (Cvt64to64F x) 1143 // cond: 1144 // result: (F64ConvertSI64 x) 1145 for { 1146 x := v.Args[0] 1147 v.reset(OpWasmF64ConvertSI64) 1148 v.AddArg(x) 1149 return true 1150 } 1151 } 1152 func rewriteValueWasm_OpDiv16_0(v *Value) bool { 1153 b := v.Block 1154 _ = b 1155 typ := &b.Func.Config.Types 1156 _ = typ 1157 // match: (Div16 x y) 1158 // cond: 1159 // result: (I64DivS (SignExt16to64 x) (SignExt16to64 y)) 1160 for { 1161 _ = v.Args[1] 1162 x := v.Args[0] 1163 y := v.Args[1] 1164 v.reset(OpWasmI64DivS) 1165 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64) 1166 v0.AddArg(x) 1167 v.AddArg(v0) 1168 v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64) 1169 v1.AddArg(y) 1170 v.AddArg(v1) 1171 return true 1172 } 1173 } 1174 func rewriteValueWasm_OpDiv16u_0(v *Value) bool { 1175 b := v.Block 1176 _ = b 1177 typ := &b.Func.Config.Types 1178 _ = typ 1179 // match: (Div16u x y) 1180 // cond: 1181 // result: (I64DivU (ZeroExt16to64 x) (ZeroExt16to64 y)) 1182 for { 1183 _ = v.Args[1] 1184 x := v.Args[0] 1185 y := v.Args[1] 1186 v.reset(OpWasmI64DivU) 1187 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 1188 v0.AddArg(x) 1189 v.AddArg(v0) 1190 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 1191 v1.AddArg(y) 1192 v.AddArg(v1) 1193 return true 1194 } 1195 } 1196 func rewriteValueWasm_OpDiv32_0(v *Value) bool { 1197 b := v.Block 1198 _ = b 1199 typ := &b.Func.Config.Types 1200 _ = typ 1201 // match: (Div32 x y) 1202 // cond: 1203 // result: (I64DivS (SignExt32to64 x) (SignExt32to64 y)) 1204 for { 1205 _ = v.Args[1] 1206 x := v.Args[0] 1207 y := v.Args[1] 1208 v.reset(OpWasmI64DivS) 1209 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 1210 v0.AddArg(x) 1211 v.AddArg(v0) 1212 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 1213 v1.AddArg(y) 1214 v.AddArg(v1) 1215 return true 1216 } 1217 } 1218 func rewriteValueWasm_OpDiv32F_0(v *Value) bool { 1219 // match: (Div32F x y) 1220 // cond: 1221 // result: (F64Div x y) 1222 for { 1223 _ = v.Args[1] 1224 x := v.Args[0] 1225 y := v.Args[1] 1226 v.reset(OpWasmF64Div) 1227 v.AddArg(x) 1228 v.AddArg(y) 1229 return true 1230 } 1231 } 1232 func rewriteValueWasm_OpDiv32u_0(v *Value) bool { 1233 b := v.Block 1234 _ = b 1235 typ := &b.Func.Config.Types 1236 _ = typ 1237 // match: (Div32u x y) 1238 // cond: 1239 // result: (I64DivU (ZeroExt32to64 x) (ZeroExt32to64 y)) 1240 for { 1241 _ = v.Args[1] 1242 x := v.Args[0] 1243 y := v.Args[1] 1244 v.reset(OpWasmI64DivU) 1245 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 1246 v0.AddArg(x) 1247 v.AddArg(v0) 1248 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 1249 v1.AddArg(y) 1250 v.AddArg(v1) 1251 return true 1252 } 1253 } 1254 func rewriteValueWasm_OpDiv64_0(v *Value) bool { 1255 // match: (Div64 x y) 1256 // cond: 1257 // result: (I64DivS x y) 1258 for { 1259 _ = v.Args[1] 1260 x := v.Args[0] 1261 y := v.Args[1] 1262 v.reset(OpWasmI64DivS) 1263 v.AddArg(x) 1264 v.AddArg(y) 1265 return true 1266 } 1267 } 1268 func rewriteValueWasm_OpDiv64F_0(v *Value) bool { 1269 // match: (Div64F x y) 1270 // cond: 1271 // result: (F64Div x y) 1272 for { 1273 _ = v.Args[1] 1274 x := v.Args[0] 1275 y := v.Args[1] 1276 v.reset(OpWasmF64Div) 1277 v.AddArg(x) 1278 v.AddArg(y) 1279 return true 1280 } 1281 } 1282 func rewriteValueWasm_OpDiv64u_0(v *Value) bool { 1283 // match: (Div64u x y) 1284 // cond: 1285 // result: (I64DivU x y) 1286 for { 1287 _ = v.Args[1] 1288 x := v.Args[0] 1289 y := v.Args[1] 1290 v.reset(OpWasmI64DivU) 1291 v.AddArg(x) 1292 v.AddArg(y) 1293 return true 1294 } 1295 } 1296 func rewriteValueWasm_OpDiv8_0(v *Value) bool { 1297 b := v.Block 1298 _ = b 1299 typ := &b.Func.Config.Types 1300 _ = typ 1301 // match: (Div8 x y) 1302 // cond: 1303 // result: (I64DivS (SignExt8to64 x) (SignExt8to64 y)) 1304 for { 1305 _ = v.Args[1] 1306 x := v.Args[0] 1307 y := v.Args[1] 1308 v.reset(OpWasmI64DivS) 1309 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64) 1310 v0.AddArg(x) 1311 v.AddArg(v0) 1312 v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64) 1313 v1.AddArg(y) 1314 v.AddArg(v1) 1315 return true 1316 } 1317 } 1318 func rewriteValueWasm_OpDiv8u_0(v *Value) bool { 1319 b := v.Block 1320 _ = b 1321 typ := &b.Func.Config.Types 1322 _ = typ 1323 // match: (Div8u x y) 1324 // cond: 1325 // result: (I64DivU (ZeroExt8to64 x) (ZeroExt8to64 y)) 1326 for { 1327 _ = v.Args[1] 1328 x := v.Args[0] 1329 y := v.Args[1] 1330 v.reset(OpWasmI64DivU) 1331 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 1332 v0.AddArg(x) 1333 v.AddArg(v0) 1334 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 1335 v1.AddArg(y) 1336 v.AddArg(v1) 1337 return true 1338 } 1339 } 1340 func rewriteValueWasm_OpEq16_0(v *Value) bool { 1341 b := v.Block 1342 _ = b 1343 typ := &b.Func.Config.Types 1344 _ = typ 1345 // match: (Eq16 x y) 1346 // cond: 1347 // result: (I64Eq (ZeroExt16to64 x) (ZeroExt16to64 y)) 1348 for { 1349 _ = v.Args[1] 1350 x := v.Args[0] 1351 y := v.Args[1] 1352 v.reset(OpWasmI64Eq) 1353 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 1354 v0.AddArg(x) 1355 v.AddArg(v0) 1356 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 1357 v1.AddArg(y) 1358 v.AddArg(v1) 1359 return true 1360 } 1361 } 1362 func rewriteValueWasm_OpEq32_0(v *Value) bool { 1363 b := v.Block 1364 _ = b 1365 typ := &b.Func.Config.Types 1366 _ = typ 1367 // match: (Eq32 x y) 1368 // cond: 1369 // result: (I64Eq (ZeroExt32to64 x) (ZeroExt32to64 y)) 1370 for { 1371 _ = v.Args[1] 1372 x := v.Args[0] 1373 y := v.Args[1] 1374 v.reset(OpWasmI64Eq) 1375 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 1376 v0.AddArg(x) 1377 v.AddArg(v0) 1378 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 1379 v1.AddArg(y) 1380 v.AddArg(v1) 1381 return true 1382 } 1383 } 1384 func rewriteValueWasm_OpEq32F_0(v *Value) bool { 1385 b := v.Block 1386 _ = b 1387 typ := &b.Func.Config.Types 1388 _ = typ 1389 // match: (Eq32F x y) 1390 // cond: 1391 // result: (F64Eq (LoweredRound32F x) (LoweredRound32F y)) 1392 for { 1393 _ = v.Args[1] 1394 x := v.Args[0] 1395 y := v.Args[1] 1396 v.reset(OpWasmF64Eq) 1397 v0 := b.NewValue0(v.Pos, OpWasmLoweredRound32F, typ.Float32) 1398 v0.AddArg(x) 1399 v.AddArg(v0) 1400 v1 := b.NewValue0(v.Pos, OpWasmLoweredRound32F, typ.Float32) 1401 v1.AddArg(y) 1402 v.AddArg(v1) 1403 return true 1404 } 1405 } 1406 func rewriteValueWasm_OpEq64_0(v *Value) bool { 1407 // match: (Eq64 x y) 1408 // cond: 1409 // result: (I64Eq x y) 1410 for { 1411 _ = v.Args[1] 1412 x := v.Args[0] 1413 y := v.Args[1] 1414 v.reset(OpWasmI64Eq) 1415 v.AddArg(x) 1416 v.AddArg(y) 1417 return true 1418 } 1419 } 1420 func rewriteValueWasm_OpEq64F_0(v *Value) bool { 1421 // match: (Eq64F x y) 1422 // cond: 1423 // result: (F64Eq x y) 1424 for { 1425 _ = v.Args[1] 1426 x := v.Args[0] 1427 y := v.Args[1] 1428 v.reset(OpWasmF64Eq) 1429 v.AddArg(x) 1430 v.AddArg(y) 1431 return true 1432 } 1433 } 1434 func rewriteValueWasm_OpEq8_0(v *Value) bool { 1435 b := v.Block 1436 _ = b 1437 typ := &b.Func.Config.Types 1438 _ = typ 1439 // match: (Eq8 x y) 1440 // cond: 1441 // result: (I64Eq (ZeroExt8to64 x) (ZeroExt8to64 y)) 1442 for { 1443 _ = v.Args[1] 1444 x := v.Args[0] 1445 y := v.Args[1] 1446 v.reset(OpWasmI64Eq) 1447 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 1448 v0.AddArg(x) 1449 v.AddArg(v0) 1450 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 1451 v1.AddArg(y) 1452 v.AddArg(v1) 1453 return true 1454 } 1455 } 1456 func rewriteValueWasm_OpEqB_0(v *Value) bool { 1457 // match: (EqB x y) 1458 // cond: 1459 // result: (I64Eq x y) 1460 for { 1461 _ = v.Args[1] 1462 x := v.Args[0] 1463 y := v.Args[1] 1464 v.reset(OpWasmI64Eq) 1465 v.AddArg(x) 1466 v.AddArg(y) 1467 return true 1468 } 1469 } 1470 func rewriteValueWasm_OpEqPtr_0(v *Value) bool { 1471 // match: (EqPtr x y) 1472 // cond: 1473 // result: (I64Eq x y) 1474 for { 1475 _ = v.Args[1] 1476 x := v.Args[0] 1477 y := v.Args[1] 1478 v.reset(OpWasmI64Eq) 1479 v.AddArg(x) 1480 v.AddArg(y) 1481 return true 1482 } 1483 } 1484 func rewriteValueWasm_OpGeq16_0(v *Value) bool { 1485 b := v.Block 1486 _ = b 1487 typ := &b.Func.Config.Types 1488 _ = typ 1489 // match: (Geq16 x y) 1490 // cond: 1491 // result: (I64GeS (SignExt16to64 x) (SignExt16to64 y)) 1492 for { 1493 _ = v.Args[1] 1494 x := v.Args[0] 1495 y := v.Args[1] 1496 v.reset(OpWasmI64GeS) 1497 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64) 1498 v0.AddArg(x) 1499 v.AddArg(v0) 1500 v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64) 1501 v1.AddArg(y) 1502 v.AddArg(v1) 1503 return true 1504 } 1505 } 1506 func rewriteValueWasm_OpGeq16U_0(v *Value) bool { 1507 b := v.Block 1508 _ = b 1509 typ := &b.Func.Config.Types 1510 _ = typ 1511 // match: (Geq16U x y) 1512 // cond: 1513 // result: (I64GeU (ZeroExt16to64 x) (ZeroExt16to64 y)) 1514 for { 1515 _ = v.Args[1] 1516 x := v.Args[0] 1517 y := v.Args[1] 1518 v.reset(OpWasmI64GeU) 1519 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 1520 v0.AddArg(x) 1521 v.AddArg(v0) 1522 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 1523 v1.AddArg(y) 1524 v.AddArg(v1) 1525 return true 1526 } 1527 } 1528 func rewriteValueWasm_OpGeq32_0(v *Value) bool { 1529 b := v.Block 1530 _ = b 1531 typ := &b.Func.Config.Types 1532 _ = typ 1533 // match: (Geq32 x y) 1534 // cond: 1535 // result: (I64GeS (SignExt32to64 x) (SignExt32to64 y)) 1536 for { 1537 _ = v.Args[1] 1538 x := v.Args[0] 1539 y := v.Args[1] 1540 v.reset(OpWasmI64GeS) 1541 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 1542 v0.AddArg(x) 1543 v.AddArg(v0) 1544 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 1545 v1.AddArg(y) 1546 v.AddArg(v1) 1547 return true 1548 } 1549 } 1550 func rewriteValueWasm_OpGeq32F_0(v *Value) bool { 1551 b := v.Block 1552 _ = b 1553 typ := &b.Func.Config.Types 1554 _ = typ 1555 // match: (Geq32F x y) 1556 // cond: 1557 // result: (F64Ge (LoweredRound32F x) (LoweredRound32F y)) 1558 for { 1559 _ = v.Args[1] 1560 x := v.Args[0] 1561 y := v.Args[1] 1562 v.reset(OpWasmF64Ge) 1563 v0 := b.NewValue0(v.Pos, OpWasmLoweredRound32F, typ.Float32) 1564 v0.AddArg(x) 1565 v.AddArg(v0) 1566 v1 := b.NewValue0(v.Pos, OpWasmLoweredRound32F, typ.Float32) 1567 v1.AddArg(y) 1568 v.AddArg(v1) 1569 return true 1570 } 1571 } 1572 func rewriteValueWasm_OpGeq32U_0(v *Value) bool { 1573 b := v.Block 1574 _ = b 1575 typ := &b.Func.Config.Types 1576 _ = typ 1577 // match: (Geq32U x y) 1578 // cond: 1579 // result: (I64GeU (ZeroExt32to64 x) (ZeroExt32to64 y)) 1580 for { 1581 _ = v.Args[1] 1582 x := v.Args[0] 1583 y := v.Args[1] 1584 v.reset(OpWasmI64GeU) 1585 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 1586 v0.AddArg(x) 1587 v.AddArg(v0) 1588 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 1589 v1.AddArg(y) 1590 v.AddArg(v1) 1591 return true 1592 } 1593 } 1594 func rewriteValueWasm_OpGeq64_0(v *Value) bool { 1595 // match: (Geq64 x y) 1596 // cond: 1597 // result: (I64GeS x y) 1598 for { 1599 _ = v.Args[1] 1600 x := v.Args[0] 1601 y := v.Args[1] 1602 v.reset(OpWasmI64GeS) 1603 v.AddArg(x) 1604 v.AddArg(y) 1605 return true 1606 } 1607 } 1608 func rewriteValueWasm_OpGeq64F_0(v *Value) bool { 1609 // match: (Geq64F x y) 1610 // cond: 1611 // result: (F64Ge x y) 1612 for { 1613 _ = v.Args[1] 1614 x := v.Args[0] 1615 y := v.Args[1] 1616 v.reset(OpWasmF64Ge) 1617 v.AddArg(x) 1618 v.AddArg(y) 1619 return true 1620 } 1621 } 1622 func rewriteValueWasm_OpGeq64U_0(v *Value) bool { 1623 // match: (Geq64U x y) 1624 // cond: 1625 // result: (I64GeU x y) 1626 for { 1627 _ = v.Args[1] 1628 x := v.Args[0] 1629 y := v.Args[1] 1630 v.reset(OpWasmI64GeU) 1631 v.AddArg(x) 1632 v.AddArg(y) 1633 return true 1634 } 1635 } 1636 func rewriteValueWasm_OpGeq8_0(v *Value) bool { 1637 b := v.Block 1638 _ = b 1639 typ := &b.Func.Config.Types 1640 _ = typ 1641 // match: (Geq8 x y) 1642 // cond: 1643 // result: (I64GeS (SignExt8to64 x) (SignExt8to64 y)) 1644 for { 1645 _ = v.Args[1] 1646 x := v.Args[0] 1647 y := v.Args[1] 1648 v.reset(OpWasmI64GeS) 1649 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64) 1650 v0.AddArg(x) 1651 v.AddArg(v0) 1652 v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64) 1653 v1.AddArg(y) 1654 v.AddArg(v1) 1655 return true 1656 } 1657 } 1658 func rewriteValueWasm_OpGeq8U_0(v *Value) bool { 1659 b := v.Block 1660 _ = b 1661 typ := &b.Func.Config.Types 1662 _ = typ 1663 // match: (Geq8U x y) 1664 // cond: 1665 // result: (I64GeU (ZeroExt8to64 x) (ZeroExt8to64 y)) 1666 for { 1667 _ = v.Args[1] 1668 x := v.Args[0] 1669 y := v.Args[1] 1670 v.reset(OpWasmI64GeU) 1671 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 1672 v0.AddArg(x) 1673 v.AddArg(v0) 1674 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 1675 v1.AddArg(y) 1676 v.AddArg(v1) 1677 return true 1678 } 1679 } 1680 func rewriteValueWasm_OpGetCallerPC_0(v *Value) bool { 1681 // match: (GetCallerPC) 1682 // cond: 1683 // result: (LoweredGetCallerPC) 1684 for { 1685 v.reset(OpWasmLoweredGetCallerPC) 1686 return true 1687 } 1688 } 1689 func rewriteValueWasm_OpGetCallerSP_0(v *Value) bool { 1690 // match: (GetCallerSP) 1691 // cond: 1692 // result: (LoweredGetCallerSP) 1693 for { 1694 v.reset(OpWasmLoweredGetCallerSP) 1695 return true 1696 } 1697 } 1698 func rewriteValueWasm_OpGetClosurePtr_0(v *Value) bool { 1699 // match: (GetClosurePtr) 1700 // cond: 1701 // result: (LoweredGetClosurePtr) 1702 for { 1703 v.reset(OpWasmLoweredGetClosurePtr) 1704 return true 1705 } 1706 } 1707 func rewriteValueWasm_OpGreater16_0(v *Value) bool { 1708 b := v.Block 1709 _ = b 1710 typ := &b.Func.Config.Types 1711 _ = typ 1712 // match: (Greater16 x y) 1713 // cond: 1714 // result: (I64GtS (SignExt16to64 x) (SignExt16to64 y)) 1715 for { 1716 _ = v.Args[1] 1717 x := v.Args[0] 1718 y := v.Args[1] 1719 v.reset(OpWasmI64GtS) 1720 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64) 1721 v0.AddArg(x) 1722 v.AddArg(v0) 1723 v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64) 1724 v1.AddArg(y) 1725 v.AddArg(v1) 1726 return true 1727 } 1728 } 1729 func rewriteValueWasm_OpGreater16U_0(v *Value) bool { 1730 b := v.Block 1731 _ = b 1732 typ := &b.Func.Config.Types 1733 _ = typ 1734 // match: (Greater16U x y) 1735 // cond: 1736 // result: (I64GtU (ZeroExt16to64 x) (ZeroExt16to64 y)) 1737 for { 1738 _ = v.Args[1] 1739 x := v.Args[0] 1740 y := v.Args[1] 1741 v.reset(OpWasmI64GtU) 1742 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 1743 v0.AddArg(x) 1744 v.AddArg(v0) 1745 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 1746 v1.AddArg(y) 1747 v.AddArg(v1) 1748 return true 1749 } 1750 } 1751 func rewriteValueWasm_OpGreater32_0(v *Value) bool { 1752 b := v.Block 1753 _ = b 1754 typ := &b.Func.Config.Types 1755 _ = typ 1756 // match: (Greater32 x y) 1757 // cond: 1758 // result: (I64GtS (SignExt32to64 x) (SignExt32to64 y)) 1759 for { 1760 _ = v.Args[1] 1761 x := v.Args[0] 1762 y := v.Args[1] 1763 v.reset(OpWasmI64GtS) 1764 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 1765 v0.AddArg(x) 1766 v.AddArg(v0) 1767 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 1768 v1.AddArg(y) 1769 v.AddArg(v1) 1770 return true 1771 } 1772 } 1773 func rewriteValueWasm_OpGreater32F_0(v *Value) bool { 1774 b := v.Block 1775 _ = b 1776 typ := &b.Func.Config.Types 1777 _ = typ 1778 // match: (Greater32F x y) 1779 // cond: 1780 // result: (F64Gt (LoweredRound32F x) (LoweredRound32F y)) 1781 for { 1782 _ = v.Args[1] 1783 x := v.Args[0] 1784 y := v.Args[1] 1785 v.reset(OpWasmF64Gt) 1786 v0 := b.NewValue0(v.Pos, OpWasmLoweredRound32F, typ.Float32) 1787 v0.AddArg(x) 1788 v.AddArg(v0) 1789 v1 := b.NewValue0(v.Pos, OpWasmLoweredRound32F, typ.Float32) 1790 v1.AddArg(y) 1791 v.AddArg(v1) 1792 return true 1793 } 1794 } 1795 func rewriteValueWasm_OpGreater32U_0(v *Value) bool { 1796 b := v.Block 1797 _ = b 1798 typ := &b.Func.Config.Types 1799 _ = typ 1800 // match: (Greater32U x y) 1801 // cond: 1802 // result: (I64GtU (ZeroExt32to64 x) (ZeroExt32to64 y)) 1803 for { 1804 _ = v.Args[1] 1805 x := v.Args[0] 1806 y := v.Args[1] 1807 v.reset(OpWasmI64GtU) 1808 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 1809 v0.AddArg(x) 1810 v.AddArg(v0) 1811 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 1812 v1.AddArg(y) 1813 v.AddArg(v1) 1814 return true 1815 } 1816 } 1817 func rewriteValueWasm_OpGreater64_0(v *Value) bool { 1818 // match: (Greater64 x y) 1819 // cond: 1820 // result: (I64GtS x y) 1821 for { 1822 _ = v.Args[1] 1823 x := v.Args[0] 1824 y := v.Args[1] 1825 v.reset(OpWasmI64GtS) 1826 v.AddArg(x) 1827 v.AddArg(y) 1828 return true 1829 } 1830 } 1831 func rewriteValueWasm_OpGreater64F_0(v *Value) bool { 1832 // match: (Greater64F x y) 1833 // cond: 1834 // result: (F64Gt x y) 1835 for { 1836 _ = v.Args[1] 1837 x := v.Args[0] 1838 y := v.Args[1] 1839 v.reset(OpWasmF64Gt) 1840 v.AddArg(x) 1841 v.AddArg(y) 1842 return true 1843 } 1844 } 1845 func rewriteValueWasm_OpGreater64U_0(v *Value) bool { 1846 // match: (Greater64U x y) 1847 // cond: 1848 // result: (I64GtU x y) 1849 for { 1850 _ = v.Args[1] 1851 x := v.Args[0] 1852 y := v.Args[1] 1853 v.reset(OpWasmI64GtU) 1854 v.AddArg(x) 1855 v.AddArg(y) 1856 return true 1857 } 1858 } 1859 func rewriteValueWasm_OpGreater8_0(v *Value) bool { 1860 b := v.Block 1861 _ = b 1862 typ := &b.Func.Config.Types 1863 _ = typ 1864 // match: (Greater8 x y) 1865 // cond: 1866 // result: (I64GtS (SignExt8to64 x) (SignExt8to64 y)) 1867 for { 1868 _ = v.Args[1] 1869 x := v.Args[0] 1870 y := v.Args[1] 1871 v.reset(OpWasmI64GtS) 1872 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64) 1873 v0.AddArg(x) 1874 v.AddArg(v0) 1875 v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64) 1876 v1.AddArg(y) 1877 v.AddArg(v1) 1878 return true 1879 } 1880 } 1881 func rewriteValueWasm_OpGreater8U_0(v *Value) bool { 1882 b := v.Block 1883 _ = b 1884 typ := &b.Func.Config.Types 1885 _ = typ 1886 // match: (Greater8U x y) 1887 // cond: 1888 // result: (I64GtU (ZeroExt8to64 x) (ZeroExt8to64 y)) 1889 for { 1890 _ = v.Args[1] 1891 x := v.Args[0] 1892 y := v.Args[1] 1893 v.reset(OpWasmI64GtU) 1894 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 1895 v0.AddArg(x) 1896 v.AddArg(v0) 1897 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 1898 v1.AddArg(y) 1899 v.AddArg(v1) 1900 return true 1901 } 1902 } 1903 func rewriteValueWasm_OpInterCall_0(v *Value) bool { 1904 // match: (InterCall [argwid] entry mem) 1905 // cond: 1906 // result: (LoweredInterCall [argwid] entry mem) 1907 for { 1908 argwid := v.AuxInt 1909 _ = v.Args[1] 1910 entry := v.Args[0] 1911 mem := v.Args[1] 1912 v.reset(OpWasmLoweredInterCall) 1913 v.AuxInt = argwid 1914 v.AddArg(entry) 1915 v.AddArg(mem) 1916 return true 1917 } 1918 } 1919 func rewriteValueWasm_OpIsInBounds_0(v *Value) bool { 1920 // match: (IsInBounds idx len) 1921 // cond: 1922 // result: (I64LtU idx len) 1923 for { 1924 _ = v.Args[1] 1925 idx := v.Args[0] 1926 len := v.Args[1] 1927 v.reset(OpWasmI64LtU) 1928 v.AddArg(idx) 1929 v.AddArg(len) 1930 return true 1931 } 1932 } 1933 func rewriteValueWasm_OpIsNonNil_0(v *Value) bool { 1934 b := v.Block 1935 _ = b 1936 typ := &b.Func.Config.Types 1937 _ = typ 1938 // match: (IsNonNil p) 1939 // cond: 1940 // result: (I64Eqz (I64Eqz p)) 1941 for { 1942 p := v.Args[0] 1943 v.reset(OpWasmI64Eqz) 1944 v0 := b.NewValue0(v.Pos, OpWasmI64Eqz, typ.Bool) 1945 v0.AddArg(p) 1946 v.AddArg(v0) 1947 return true 1948 } 1949 } 1950 func rewriteValueWasm_OpIsSliceInBounds_0(v *Value) bool { 1951 // match: (IsSliceInBounds idx len) 1952 // cond: 1953 // result: (I64LeU idx len) 1954 for { 1955 _ = v.Args[1] 1956 idx := v.Args[0] 1957 len := v.Args[1] 1958 v.reset(OpWasmI64LeU) 1959 v.AddArg(idx) 1960 v.AddArg(len) 1961 return true 1962 } 1963 } 1964 func rewriteValueWasm_OpLeq16_0(v *Value) bool { 1965 b := v.Block 1966 _ = b 1967 typ := &b.Func.Config.Types 1968 _ = typ 1969 // match: (Leq16 x y) 1970 // cond: 1971 // result: (I64LeS (SignExt16to64 x) (SignExt16to64 y)) 1972 for { 1973 _ = v.Args[1] 1974 x := v.Args[0] 1975 y := v.Args[1] 1976 v.reset(OpWasmI64LeS) 1977 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64) 1978 v0.AddArg(x) 1979 v.AddArg(v0) 1980 v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64) 1981 v1.AddArg(y) 1982 v.AddArg(v1) 1983 return true 1984 } 1985 } 1986 func rewriteValueWasm_OpLeq16U_0(v *Value) bool { 1987 b := v.Block 1988 _ = b 1989 typ := &b.Func.Config.Types 1990 _ = typ 1991 // match: (Leq16U x y) 1992 // cond: 1993 // result: (I64LeU (ZeroExt16to64 x) (ZeroExt16to64 y)) 1994 for { 1995 _ = v.Args[1] 1996 x := v.Args[0] 1997 y := v.Args[1] 1998 v.reset(OpWasmI64LeU) 1999 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 2000 v0.AddArg(x) 2001 v.AddArg(v0) 2002 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 2003 v1.AddArg(y) 2004 v.AddArg(v1) 2005 return true 2006 } 2007 } 2008 func rewriteValueWasm_OpLeq32_0(v *Value) bool { 2009 b := v.Block 2010 _ = b 2011 typ := &b.Func.Config.Types 2012 _ = typ 2013 // match: (Leq32 x y) 2014 // cond: 2015 // result: (I64LeS (SignExt32to64 x) (SignExt32to64 y)) 2016 for { 2017 _ = v.Args[1] 2018 x := v.Args[0] 2019 y := v.Args[1] 2020 v.reset(OpWasmI64LeS) 2021 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 2022 v0.AddArg(x) 2023 v.AddArg(v0) 2024 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 2025 v1.AddArg(y) 2026 v.AddArg(v1) 2027 return true 2028 } 2029 } 2030 func rewriteValueWasm_OpLeq32F_0(v *Value) bool { 2031 b := v.Block 2032 _ = b 2033 typ := &b.Func.Config.Types 2034 _ = typ 2035 // match: (Leq32F x y) 2036 // cond: 2037 // result: (F64Le (LoweredRound32F x) (LoweredRound32F y)) 2038 for { 2039 _ = v.Args[1] 2040 x := v.Args[0] 2041 y := v.Args[1] 2042 v.reset(OpWasmF64Le) 2043 v0 := b.NewValue0(v.Pos, OpWasmLoweredRound32F, typ.Float32) 2044 v0.AddArg(x) 2045 v.AddArg(v0) 2046 v1 := b.NewValue0(v.Pos, OpWasmLoweredRound32F, typ.Float32) 2047 v1.AddArg(y) 2048 v.AddArg(v1) 2049 return true 2050 } 2051 } 2052 func rewriteValueWasm_OpLeq32U_0(v *Value) bool { 2053 b := v.Block 2054 _ = b 2055 typ := &b.Func.Config.Types 2056 _ = typ 2057 // match: (Leq32U x y) 2058 // cond: 2059 // result: (I64LeU (ZeroExt32to64 x) (ZeroExt32to64 y)) 2060 for { 2061 _ = v.Args[1] 2062 x := v.Args[0] 2063 y := v.Args[1] 2064 v.reset(OpWasmI64LeU) 2065 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 2066 v0.AddArg(x) 2067 v.AddArg(v0) 2068 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 2069 v1.AddArg(y) 2070 v.AddArg(v1) 2071 return true 2072 } 2073 } 2074 func rewriteValueWasm_OpLeq64_0(v *Value) bool { 2075 // match: (Leq64 x y) 2076 // cond: 2077 // result: (I64LeS x y) 2078 for { 2079 _ = v.Args[1] 2080 x := v.Args[0] 2081 y := v.Args[1] 2082 v.reset(OpWasmI64LeS) 2083 v.AddArg(x) 2084 v.AddArg(y) 2085 return true 2086 } 2087 } 2088 func rewriteValueWasm_OpLeq64F_0(v *Value) bool { 2089 // match: (Leq64F x y) 2090 // cond: 2091 // result: (F64Le x y) 2092 for { 2093 _ = v.Args[1] 2094 x := v.Args[0] 2095 y := v.Args[1] 2096 v.reset(OpWasmF64Le) 2097 v.AddArg(x) 2098 v.AddArg(y) 2099 return true 2100 } 2101 } 2102 func rewriteValueWasm_OpLeq64U_0(v *Value) bool { 2103 // match: (Leq64U x y) 2104 // cond: 2105 // result: (I64LeU x y) 2106 for { 2107 _ = v.Args[1] 2108 x := v.Args[0] 2109 y := v.Args[1] 2110 v.reset(OpWasmI64LeU) 2111 v.AddArg(x) 2112 v.AddArg(y) 2113 return true 2114 } 2115 } 2116 func rewriteValueWasm_OpLeq8_0(v *Value) bool { 2117 b := v.Block 2118 _ = b 2119 typ := &b.Func.Config.Types 2120 _ = typ 2121 // match: (Leq8 x y) 2122 // cond: 2123 // result: (I64LeS (SignExt8to64 x) (SignExt8to64 y)) 2124 for { 2125 _ = v.Args[1] 2126 x := v.Args[0] 2127 y := v.Args[1] 2128 v.reset(OpWasmI64LeS) 2129 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64) 2130 v0.AddArg(x) 2131 v.AddArg(v0) 2132 v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64) 2133 v1.AddArg(y) 2134 v.AddArg(v1) 2135 return true 2136 } 2137 } 2138 func rewriteValueWasm_OpLeq8U_0(v *Value) bool { 2139 b := v.Block 2140 _ = b 2141 typ := &b.Func.Config.Types 2142 _ = typ 2143 // match: (Leq8U x y) 2144 // cond: 2145 // result: (I64LeU (ZeroExt8to64 x) (ZeroExt8to64 y)) 2146 for { 2147 _ = v.Args[1] 2148 x := v.Args[0] 2149 y := v.Args[1] 2150 v.reset(OpWasmI64LeU) 2151 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 2152 v0.AddArg(x) 2153 v.AddArg(v0) 2154 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 2155 v1.AddArg(y) 2156 v.AddArg(v1) 2157 return true 2158 } 2159 } 2160 func rewriteValueWasm_OpLess16_0(v *Value) bool { 2161 b := v.Block 2162 _ = b 2163 typ := &b.Func.Config.Types 2164 _ = typ 2165 // match: (Less16 x y) 2166 // cond: 2167 // result: (I64LtS (SignExt16to64 x) (SignExt16to64 y)) 2168 for { 2169 _ = v.Args[1] 2170 x := v.Args[0] 2171 y := v.Args[1] 2172 v.reset(OpWasmI64LtS) 2173 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64) 2174 v0.AddArg(x) 2175 v.AddArg(v0) 2176 v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64) 2177 v1.AddArg(y) 2178 v.AddArg(v1) 2179 return true 2180 } 2181 } 2182 func rewriteValueWasm_OpLess16U_0(v *Value) bool { 2183 b := v.Block 2184 _ = b 2185 typ := &b.Func.Config.Types 2186 _ = typ 2187 // match: (Less16U x y) 2188 // cond: 2189 // result: (I64LtU (ZeroExt16to64 x) (ZeroExt16to64 y)) 2190 for { 2191 _ = v.Args[1] 2192 x := v.Args[0] 2193 y := v.Args[1] 2194 v.reset(OpWasmI64LtU) 2195 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 2196 v0.AddArg(x) 2197 v.AddArg(v0) 2198 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 2199 v1.AddArg(y) 2200 v.AddArg(v1) 2201 return true 2202 } 2203 } 2204 func rewriteValueWasm_OpLess32_0(v *Value) bool { 2205 b := v.Block 2206 _ = b 2207 typ := &b.Func.Config.Types 2208 _ = typ 2209 // match: (Less32 x y) 2210 // cond: 2211 // result: (I64LtS (SignExt32to64 x) (SignExt32to64 y)) 2212 for { 2213 _ = v.Args[1] 2214 x := v.Args[0] 2215 y := v.Args[1] 2216 v.reset(OpWasmI64LtS) 2217 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 2218 v0.AddArg(x) 2219 v.AddArg(v0) 2220 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 2221 v1.AddArg(y) 2222 v.AddArg(v1) 2223 return true 2224 } 2225 } 2226 func rewriteValueWasm_OpLess32F_0(v *Value) bool { 2227 b := v.Block 2228 _ = b 2229 typ := &b.Func.Config.Types 2230 _ = typ 2231 // match: (Less32F x y) 2232 // cond: 2233 // result: (F64Lt (LoweredRound32F x) (LoweredRound32F y)) 2234 for { 2235 _ = v.Args[1] 2236 x := v.Args[0] 2237 y := v.Args[1] 2238 v.reset(OpWasmF64Lt) 2239 v0 := b.NewValue0(v.Pos, OpWasmLoweredRound32F, typ.Float32) 2240 v0.AddArg(x) 2241 v.AddArg(v0) 2242 v1 := b.NewValue0(v.Pos, OpWasmLoweredRound32F, typ.Float32) 2243 v1.AddArg(y) 2244 v.AddArg(v1) 2245 return true 2246 } 2247 } 2248 func rewriteValueWasm_OpLess32U_0(v *Value) bool { 2249 b := v.Block 2250 _ = b 2251 typ := &b.Func.Config.Types 2252 _ = typ 2253 // match: (Less32U x y) 2254 // cond: 2255 // result: (I64LtU (ZeroExt32to64 x) (ZeroExt32to64 y)) 2256 for { 2257 _ = v.Args[1] 2258 x := v.Args[0] 2259 y := v.Args[1] 2260 v.reset(OpWasmI64LtU) 2261 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 2262 v0.AddArg(x) 2263 v.AddArg(v0) 2264 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 2265 v1.AddArg(y) 2266 v.AddArg(v1) 2267 return true 2268 } 2269 } 2270 func rewriteValueWasm_OpLess64_0(v *Value) bool { 2271 // match: (Less64 x y) 2272 // cond: 2273 // result: (I64LtS x y) 2274 for { 2275 _ = v.Args[1] 2276 x := v.Args[0] 2277 y := v.Args[1] 2278 v.reset(OpWasmI64LtS) 2279 v.AddArg(x) 2280 v.AddArg(y) 2281 return true 2282 } 2283 } 2284 func rewriteValueWasm_OpLess64F_0(v *Value) bool { 2285 // match: (Less64F x y) 2286 // cond: 2287 // result: (F64Lt x y) 2288 for { 2289 _ = v.Args[1] 2290 x := v.Args[0] 2291 y := v.Args[1] 2292 v.reset(OpWasmF64Lt) 2293 v.AddArg(x) 2294 v.AddArg(y) 2295 return true 2296 } 2297 } 2298 func rewriteValueWasm_OpLess64U_0(v *Value) bool { 2299 // match: (Less64U x y) 2300 // cond: 2301 // result: (I64LtU x y) 2302 for { 2303 _ = v.Args[1] 2304 x := v.Args[0] 2305 y := v.Args[1] 2306 v.reset(OpWasmI64LtU) 2307 v.AddArg(x) 2308 v.AddArg(y) 2309 return true 2310 } 2311 } 2312 func rewriteValueWasm_OpLess8_0(v *Value) bool { 2313 b := v.Block 2314 _ = b 2315 typ := &b.Func.Config.Types 2316 _ = typ 2317 // match: (Less8 x y) 2318 // cond: 2319 // result: (I64LtS (SignExt8to64 x) (SignExt8to64 y)) 2320 for { 2321 _ = v.Args[1] 2322 x := v.Args[0] 2323 y := v.Args[1] 2324 v.reset(OpWasmI64LtS) 2325 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64) 2326 v0.AddArg(x) 2327 v.AddArg(v0) 2328 v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64) 2329 v1.AddArg(y) 2330 v.AddArg(v1) 2331 return true 2332 } 2333 } 2334 func rewriteValueWasm_OpLess8U_0(v *Value) bool { 2335 b := v.Block 2336 _ = b 2337 typ := &b.Func.Config.Types 2338 _ = typ 2339 // match: (Less8U x y) 2340 // cond: 2341 // result: (I64LtU (ZeroExt8to64 x) (ZeroExt8to64 y)) 2342 for { 2343 _ = v.Args[1] 2344 x := v.Args[0] 2345 y := v.Args[1] 2346 v.reset(OpWasmI64LtU) 2347 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 2348 v0.AddArg(x) 2349 v.AddArg(v0) 2350 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 2351 v1.AddArg(y) 2352 v.AddArg(v1) 2353 return true 2354 } 2355 } 2356 func rewriteValueWasm_OpLoad_0(v *Value) bool { 2357 // match: (Load <t> ptr mem) 2358 // cond: is32BitFloat(t) 2359 // result: (F32Load ptr mem) 2360 for { 2361 t := v.Type 2362 _ = v.Args[1] 2363 ptr := v.Args[0] 2364 mem := v.Args[1] 2365 if !(is32BitFloat(t)) { 2366 break 2367 } 2368 v.reset(OpWasmF32Load) 2369 v.AddArg(ptr) 2370 v.AddArg(mem) 2371 return true 2372 } 2373 // match: (Load <t> ptr mem) 2374 // cond: is64BitFloat(t) 2375 // result: (F64Load ptr mem) 2376 for { 2377 t := v.Type 2378 _ = v.Args[1] 2379 ptr := v.Args[0] 2380 mem := v.Args[1] 2381 if !(is64BitFloat(t)) { 2382 break 2383 } 2384 v.reset(OpWasmF64Load) 2385 v.AddArg(ptr) 2386 v.AddArg(mem) 2387 return true 2388 } 2389 // match: (Load <t> ptr mem) 2390 // cond: t.Size() == 8 2391 // result: (I64Load ptr mem) 2392 for { 2393 t := v.Type 2394 _ = v.Args[1] 2395 ptr := v.Args[0] 2396 mem := v.Args[1] 2397 if !(t.Size() == 8) { 2398 break 2399 } 2400 v.reset(OpWasmI64Load) 2401 v.AddArg(ptr) 2402 v.AddArg(mem) 2403 return true 2404 } 2405 // match: (Load <t> ptr mem) 2406 // cond: t.Size() == 4 && !t.IsSigned() 2407 // result: (I64Load32U ptr mem) 2408 for { 2409 t := v.Type 2410 _ = v.Args[1] 2411 ptr := v.Args[0] 2412 mem := v.Args[1] 2413 if !(t.Size() == 4 && !t.IsSigned()) { 2414 break 2415 } 2416 v.reset(OpWasmI64Load32U) 2417 v.AddArg(ptr) 2418 v.AddArg(mem) 2419 return true 2420 } 2421 // match: (Load <t> ptr mem) 2422 // cond: t.Size() == 4 && t.IsSigned() 2423 // result: (I64Load32S ptr mem) 2424 for { 2425 t := v.Type 2426 _ = v.Args[1] 2427 ptr := v.Args[0] 2428 mem := v.Args[1] 2429 if !(t.Size() == 4 && t.IsSigned()) { 2430 break 2431 } 2432 v.reset(OpWasmI64Load32S) 2433 v.AddArg(ptr) 2434 v.AddArg(mem) 2435 return true 2436 } 2437 // match: (Load <t> ptr mem) 2438 // cond: t.Size() == 2 && !t.IsSigned() 2439 // result: (I64Load16U ptr mem) 2440 for { 2441 t := v.Type 2442 _ = v.Args[1] 2443 ptr := v.Args[0] 2444 mem := v.Args[1] 2445 if !(t.Size() == 2 && !t.IsSigned()) { 2446 break 2447 } 2448 v.reset(OpWasmI64Load16U) 2449 v.AddArg(ptr) 2450 v.AddArg(mem) 2451 return true 2452 } 2453 // match: (Load <t> ptr mem) 2454 // cond: t.Size() == 2 && t.IsSigned() 2455 // result: (I64Load16S ptr mem) 2456 for { 2457 t := v.Type 2458 _ = v.Args[1] 2459 ptr := v.Args[0] 2460 mem := v.Args[1] 2461 if !(t.Size() == 2 && t.IsSigned()) { 2462 break 2463 } 2464 v.reset(OpWasmI64Load16S) 2465 v.AddArg(ptr) 2466 v.AddArg(mem) 2467 return true 2468 } 2469 // match: (Load <t> ptr mem) 2470 // cond: t.Size() == 1 && !t.IsSigned() 2471 // result: (I64Load8U ptr mem) 2472 for { 2473 t := v.Type 2474 _ = v.Args[1] 2475 ptr := v.Args[0] 2476 mem := v.Args[1] 2477 if !(t.Size() == 1 && !t.IsSigned()) { 2478 break 2479 } 2480 v.reset(OpWasmI64Load8U) 2481 v.AddArg(ptr) 2482 v.AddArg(mem) 2483 return true 2484 } 2485 // match: (Load <t> ptr mem) 2486 // cond: t.Size() == 1 && t.IsSigned() 2487 // result: (I64Load8S ptr mem) 2488 for { 2489 t := v.Type 2490 _ = v.Args[1] 2491 ptr := v.Args[0] 2492 mem := v.Args[1] 2493 if !(t.Size() == 1 && t.IsSigned()) { 2494 break 2495 } 2496 v.reset(OpWasmI64Load8S) 2497 v.AddArg(ptr) 2498 v.AddArg(mem) 2499 return true 2500 } 2501 return false 2502 } 2503 func rewriteValueWasm_OpLocalAddr_0(v *Value) bool { 2504 // match: (LocalAddr {sym} base _) 2505 // cond: 2506 // result: (LoweredAddr {sym} base) 2507 for { 2508 sym := v.Aux 2509 _ = v.Args[1] 2510 base := v.Args[0] 2511 v.reset(OpWasmLoweredAddr) 2512 v.Aux = sym 2513 v.AddArg(base) 2514 return true 2515 } 2516 } 2517 func rewriteValueWasm_OpLsh16x16_0(v *Value) bool { 2518 b := v.Block 2519 _ = b 2520 typ := &b.Func.Config.Types 2521 _ = typ 2522 // match: (Lsh16x16 x y) 2523 // cond: 2524 // result: (Lsh64x64 x (ZeroExt16to64 y)) 2525 for { 2526 _ = v.Args[1] 2527 x := v.Args[0] 2528 y := v.Args[1] 2529 v.reset(OpLsh64x64) 2530 v.AddArg(x) 2531 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 2532 v0.AddArg(y) 2533 v.AddArg(v0) 2534 return true 2535 } 2536 } 2537 func rewriteValueWasm_OpLsh16x32_0(v *Value) bool { 2538 b := v.Block 2539 _ = b 2540 typ := &b.Func.Config.Types 2541 _ = typ 2542 // match: (Lsh16x32 x y) 2543 // cond: 2544 // result: (Lsh64x64 x (ZeroExt32to64 y)) 2545 for { 2546 _ = v.Args[1] 2547 x := v.Args[0] 2548 y := v.Args[1] 2549 v.reset(OpLsh64x64) 2550 v.AddArg(x) 2551 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 2552 v0.AddArg(y) 2553 v.AddArg(v0) 2554 return true 2555 } 2556 } 2557 func rewriteValueWasm_OpLsh16x64_0(v *Value) bool { 2558 // match: (Lsh16x64 x y) 2559 // cond: 2560 // result: (Lsh64x64 x y) 2561 for { 2562 _ = v.Args[1] 2563 x := v.Args[0] 2564 y := v.Args[1] 2565 v.reset(OpLsh64x64) 2566 v.AddArg(x) 2567 v.AddArg(y) 2568 return true 2569 } 2570 } 2571 func rewriteValueWasm_OpLsh16x8_0(v *Value) bool { 2572 b := v.Block 2573 _ = b 2574 typ := &b.Func.Config.Types 2575 _ = typ 2576 // match: (Lsh16x8 x y) 2577 // cond: 2578 // result: (Lsh64x64 x (ZeroExt8to64 y)) 2579 for { 2580 _ = v.Args[1] 2581 x := v.Args[0] 2582 y := v.Args[1] 2583 v.reset(OpLsh64x64) 2584 v.AddArg(x) 2585 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 2586 v0.AddArg(y) 2587 v.AddArg(v0) 2588 return true 2589 } 2590 } 2591 func rewriteValueWasm_OpLsh32x16_0(v *Value) bool { 2592 b := v.Block 2593 _ = b 2594 typ := &b.Func.Config.Types 2595 _ = typ 2596 // match: (Lsh32x16 x y) 2597 // cond: 2598 // result: (Lsh64x64 x (ZeroExt16to64 y)) 2599 for { 2600 _ = v.Args[1] 2601 x := v.Args[0] 2602 y := v.Args[1] 2603 v.reset(OpLsh64x64) 2604 v.AddArg(x) 2605 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 2606 v0.AddArg(y) 2607 v.AddArg(v0) 2608 return true 2609 } 2610 } 2611 func rewriteValueWasm_OpLsh32x32_0(v *Value) bool { 2612 b := v.Block 2613 _ = b 2614 typ := &b.Func.Config.Types 2615 _ = typ 2616 // match: (Lsh32x32 x y) 2617 // cond: 2618 // result: (Lsh64x64 x (ZeroExt32to64 y)) 2619 for { 2620 _ = v.Args[1] 2621 x := v.Args[0] 2622 y := v.Args[1] 2623 v.reset(OpLsh64x64) 2624 v.AddArg(x) 2625 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 2626 v0.AddArg(y) 2627 v.AddArg(v0) 2628 return true 2629 } 2630 } 2631 func rewriteValueWasm_OpLsh32x64_0(v *Value) bool { 2632 // match: (Lsh32x64 x y) 2633 // cond: 2634 // result: (Lsh64x64 x y) 2635 for { 2636 _ = v.Args[1] 2637 x := v.Args[0] 2638 y := v.Args[1] 2639 v.reset(OpLsh64x64) 2640 v.AddArg(x) 2641 v.AddArg(y) 2642 return true 2643 } 2644 } 2645 func rewriteValueWasm_OpLsh32x8_0(v *Value) bool { 2646 b := v.Block 2647 _ = b 2648 typ := &b.Func.Config.Types 2649 _ = typ 2650 // match: (Lsh32x8 x y) 2651 // cond: 2652 // result: (Lsh64x64 x (ZeroExt8to64 y)) 2653 for { 2654 _ = v.Args[1] 2655 x := v.Args[0] 2656 y := v.Args[1] 2657 v.reset(OpLsh64x64) 2658 v.AddArg(x) 2659 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 2660 v0.AddArg(y) 2661 v.AddArg(v0) 2662 return true 2663 } 2664 } 2665 func rewriteValueWasm_OpLsh64x16_0(v *Value) bool { 2666 b := v.Block 2667 _ = b 2668 typ := &b.Func.Config.Types 2669 _ = typ 2670 // match: (Lsh64x16 x y) 2671 // cond: 2672 // result: (Lsh64x64 x (ZeroExt16to64 y)) 2673 for { 2674 _ = v.Args[1] 2675 x := v.Args[0] 2676 y := v.Args[1] 2677 v.reset(OpLsh64x64) 2678 v.AddArg(x) 2679 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 2680 v0.AddArg(y) 2681 v.AddArg(v0) 2682 return true 2683 } 2684 } 2685 func rewriteValueWasm_OpLsh64x32_0(v *Value) bool { 2686 b := v.Block 2687 _ = b 2688 typ := &b.Func.Config.Types 2689 _ = typ 2690 // match: (Lsh64x32 x y) 2691 // cond: 2692 // result: (Lsh64x64 x (ZeroExt32to64 y)) 2693 for { 2694 _ = v.Args[1] 2695 x := v.Args[0] 2696 y := v.Args[1] 2697 v.reset(OpLsh64x64) 2698 v.AddArg(x) 2699 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 2700 v0.AddArg(y) 2701 v.AddArg(v0) 2702 return true 2703 } 2704 } 2705 func rewriteValueWasm_OpLsh64x64_0(v *Value) bool { 2706 b := v.Block 2707 _ = b 2708 typ := &b.Func.Config.Types 2709 _ = typ 2710 // match: (Lsh64x64 x y) 2711 // cond: 2712 // result: (Select (I64Shl x y) (I64Const [0]) (I64LtU y (I64Const [64]))) 2713 for { 2714 _ = v.Args[1] 2715 x := v.Args[0] 2716 y := v.Args[1] 2717 v.reset(OpWasmSelect) 2718 v0 := b.NewValue0(v.Pos, OpWasmI64Shl, typ.Int64) 2719 v0.AddArg(x) 2720 v0.AddArg(y) 2721 v.AddArg(v0) 2722 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 2723 v1.AuxInt = 0 2724 v.AddArg(v1) 2725 v2 := b.NewValue0(v.Pos, OpWasmI64LtU, typ.Bool) 2726 v2.AddArg(y) 2727 v3 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 2728 v3.AuxInt = 64 2729 v2.AddArg(v3) 2730 v.AddArg(v2) 2731 return true 2732 } 2733 } 2734 func rewriteValueWasm_OpLsh64x8_0(v *Value) bool { 2735 b := v.Block 2736 _ = b 2737 typ := &b.Func.Config.Types 2738 _ = typ 2739 // match: (Lsh64x8 x y) 2740 // cond: 2741 // result: (Lsh64x64 x (ZeroExt8to64 y)) 2742 for { 2743 _ = v.Args[1] 2744 x := v.Args[0] 2745 y := v.Args[1] 2746 v.reset(OpLsh64x64) 2747 v.AddArg(x) 2748 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 2749 v0.AddArg(y) 2750 v.AddArg(v0) 2751 return true 2752 } 2753 } 2754 func rewriteValueWasm_OpLsh8x16_0(v *Value) bool { 2755 b := v.Block 2756 _ = b 2757 typ := &b.Func.Config.Types 2758 _ = typ 2759 // match: (Lsh8x16 x y) 2760 // cond: 2761 // result: (Lsh64x64 x (ZeroExt16to64 y)) 2762 for { 2763 _ = v.Args[1] 2764 x := v.Args[0] 2765 y := v.Args[1] 2766 v.reset(OpLsh64x64) 2767 v.AddArg(x) 2768 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 2769 v0.AddArg(y) 2770 v.AddArg(v0) 2771 return true 2772 } 2773 } 2774 func rewriteValueWasm_OpLsh8x32_0(v *Value) bool { 2775 b := v.Block 2776 _ = b 2777 typ := &b.Func.Config.Types 2778 _ = typ 2779 // match: (Lsh8x32 x y) 2780 // cond: 2781 // result: (Lsh64x64 x (ZeroExt32to64 y)) 2782 for { 2783 _ = v.Args[1] 2784 x := v.Args[0] 2785 y := v.Args[1] 2786 v.reset(OpLsh64x64) 2787 v.AddArg(x) 2788 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 2789 v0.AddArg(y) 2790 v.AddArg(v0) 2791 return true 2792 } 2793 } 2794 func rewriteValueWasm_OpLsh8x64_0(v *Value) bool { 2795 // match: (Lsh8x64 x y) 2796 // cond: 2797 // result: (Lsh64x64 x y) 2798 for { 2799 _ = v.Args[1] 2800 x := v.Args[0] 2801 y := v.Args[1] 2802 v.reset(OpLsh64x64) 2803 v.AddArg(x) 2804 v.AddArg(y) 2805 return true 2806 } 2807 } 2808 func rewriteValueWasm_OpLsh8x8_0(v *Value) bool { 2809 b := v.Block 2810 _ = b 2811 typ := &b.Func.Config.Types 2812 _ = typ 2813 // match: (Lsh8x8 x y) 2814 // cond: 2815 // result: (Lsh64x64 x (ZeroExt8to64 y)) 2816 for { 2817 _ = v.Args[1] 2818 x := v.Args[0] 2819 y := v.Args[1] 2820 v.reset(OpLsh64x64) 2821 v.AddArg(x) 2822 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 2823 v0.AddArg(y) 2824 v.AddArg(v0) 2825 return true 2826 } 2827 } 2828 func rewriteValueWasm_OpMod16_0(v *Value) bool { 2829 b := v.Block 2830 _ = b 2831 typ := &b.Func.Config.Types 2832 _ = typ 2833 // match: (Mod16 x y) 2834 // cond: 2835 // result: (I64RemS (SignExt16to64 x) (SignExt16to64 y)) 2836 for { 2837 _ = v.Args[1] 2838 x := v.Args[0] 2839 y := v.Args[1] 2840 v.reset(OpWasmI64RemS) 2841 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64) 2842 v0.AddArg(x) 2843 v.AddArg(v0) 2844 v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64) 2845 v1.AddArg(y) 2846 v.AddArg(v1) 2847 return true 2848 } 2849 } 2850 func rewriteValueWasm_OpMod16u_0(v *Value) bool { 2851 b := v.Block 2852 _ = b 2853 typ := &b.Func.Config.Types 2854 _ = typ 2855 // match: (Mod16u x y) 2856 // cond: 2857 // result: (I64RemU (ZeroExt16to64 x) (ZeroExt16to64 y)) 2858 for { 2859 _ = v.Args[1] 2860 x := v.Args[0] 2861 y := v.Args[1] 2862 v.reset(OpWasmI64RemU) 2863 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 2864 v0.AddArg(x) 2865 v.AddArg(v0) 2866 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 2867 v1.AddArg(y) 2868 v.AddArg(v1) 2869 return true 2870 } 2871 } 2872 func rewriteValueWasm_OpMod32_0(v *Value) bool { 2873 b := v.Block 2874 _ = b 2875 typ := &b.Func.Config.Types 2876 _ = typ 2877 // match: (Mod32 x y) 2878 // cond: 2879 // result: (I64RemS (SignExt32to64 x) (SignExt32to64 y)) 2880 for { 2881 _ = v.Args[1] 2882 x := v.Args[0] 2883 y := v.Args[1] 2884 v.reset(OpWasmI64RemS) 2885 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 2886 v0.AddArg(x) 2887 v.AddArg(v0) 2888 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 2889 v1.AddArg(y) 2890 v.AddArg(v1) 2891 return true 2892 } 2893 } 2894 func rewriteValueWasm_OpMod32u_0(v *Value) bool { 2895 b := v.Block 2896 _ = b 2897 typ := &b.Func.Config.Types 2898 _ = typ 2899 // match: (Mod32u x y) 2900 // cond: 2901 // result: (I64RemU (ZeroExt32to64 x) (ZeroExt32to64 y)) 2902 for { 2903 _ = v.Args[1] 2904 x := v.Args[0] 2905 y := v.Args[1] 2906 v.reset(OpWasmI64RemU) 2907 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 2908 v0.AddArg(x) 2909 v.AddArg(v0) 2910 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 2911 v1.AddArg(y) 2912 v.AddArg(v1) 2913 return true 2914 } 2915 } 2916 func rewriteValueWasm_OpMod64_0(v *Value) bool { 2917 // match: (Mod64 x y) 2918 // cond: 2919 // result: (I64RemS x y) 2920 for { 2921 _ = v.Args[1] 2922 x := v.Args[0] 2923 y := v.Args[1] 2924 v.reset(OpWasmI64RemS) 2925 v.AddArg(x) 2926 v.AddArg(y) 2927 return true 2928 } 2929 } 2930 func rewriteValueWasm_OpMod64u_0(v *Value) bool { 2931 // match: (Mod64u x y) 2932 // cond: 2933 // result: (I64RemU x y) 2934 for { 2935 _ = v.Args[1] 2936 x := v.Args[0] 2937 y := v.Args[1] 2938 v.reset(OpWasmI64RemU) 2939 v.AddArg(x) 2940 v.AddArg(y) 2941 return true 2942 } 2943 } 2944 func rewriteValueWasm_OpMod8_0(v *Value) bool { 2945 b := v.Block 2946 _ = b 2947 typ := &b.Func.Config.Types 2948 _ = typ 2949 // match: (Mod8 x y) 2950 // cond: 2951 // result: (I64RemS (SignExt8to64 x) (SignExt8to64 y)) 2952 for { 2953 _ = v.Args[1] 2954 x := v.Args[0] 2955 y := v.Args[1] 2956 v.reset(OpWasmI64RemS) 2957 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64) 2958 v0.AddArg(x) 2959 v.AddArg(v0) 2960 v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64) 2961 v1.AddArg(y) 2962 v.AddArg(v1) 2963 return true 2964 } 2965 } 2966 func rewriteValueWasm_OpMod8u_0(v *Value) bool { 2967 b := v.Block 2968 _ = b 2969 typ := &b.Func.Config.Types 2970 _ = typ 2971 // match: (Mod8u x y) 2972 // cond: 2973 // result: (I64RemU (ZeroExt8to64 x) (ZeroExt8to64 y)) 2974 for { 2975 _ = v.Args[1] 2976 x := v.Args[0] 2977 y := v.Args[1] 2978 v.reset(OpWasmI64RemU) 2979 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 2980 v0.AddArg(x) 2981 v.AddArg(v0) 2982 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 2983 v1.AddArg(y) 2984 v.AddArg(v1) 2985 return true 2986 } 2987 } 2988 func rewriteValueWasm_OpMove_0(v *Value) bool { 2989 b := v.Block 2990 _ = b 2991 typ := &b.Func.Config.Types 2992 _ = typ 2993 // match: (Move [0] _ _ mem) 2994 // cond: 2995 // result: mem 2996 for { 2997 if v.AuxInt != 0 { 2998 break 2999 } 3000 _ = v.Args[2] 3001 mem := v.Args[2] 3002 v.reset(OpCopy) 3003 v.Type = mem.Type 3004 v.AddArg(mem) 3005 return true 3006 } 3007 // match: (Move [1] dst src mem) 3008 // cond: 3009 // result: (I64Store8 dst (I64Load8U src mem) mem) 3010 for { 3011 if v.AuxInt != 1 { 3012 break 3013 } 3014 _ = v.Args[2] 3015 dst := v.Args[0] 3016 src := v.Args[1] 3017 mem := v.Args[2] 3018 v.reset(OpWasmI64Store8) 3019 v.AddArg(dst) 3020 v0 := b.NewValue0(v.Pos, OpWasmI64Load8U, typ.UInt8) 3021 v0.AddArg(src) 3022 v0.AddArg(mem) 3023 v.AddArg(v0) 3024 v.AddArg(mem) 3025 return true 3026 } 3027 // match: (Move [2] dst src mem) 3028 // cond: 3029 // result: (I64Store16 dst (I64Load16U src mem) mem) 3030 for { 3031 if v.AuxInt != 2 { 3032 break 3033 } 3034 _ = v.Args[2] 3035 dst := v.Args[0] 3036 src := v.Args[1] 3037 mem := v.Args[2] 3038 v.reset(OpWasmI64Store16) 3039 v.AddArg(dst) 3040 v0 := b.NewValue0(v.Pos, OpWasmI64Load16U, typ.UInt16) 3041 v0.AddArg(src) 3042 v0.AddArg(mem) 3043 v.AddArg(v0) 3044 v.AddArg(mem) 3045 return true 3046 } 3047 // match: (Move [4] dst src mem) 3048 // cond: 3049 // result: (I64Store32 dst (I64Load32U src mem) mem) 3050 for { 3051 if v.AuxInt != 4 { 3052 break 3053 } 3054 _ = v.Args[2] 3055 dst := v.Args[0] 3056 src := v.Args[1] 3057 mem := v.Args[2] 3058 v.reset(OpWasmI64Store32) 3059 v.AddArg(dst) 3060 v0 := b.NewValue0(v.Pos, OpWasmI64Load32U, typ.UInt32) 3061 v0.AddArg(src) 3062 v0.AddArg(mem) 3063 v.AddArg(v0) 3064 v.AddArg(mem) 3065 return true 3066 } 3067 // match: (Move [8] dst src mem) 3068 // cond: 3069 // result: (I64Store dst (I64Load src mem) mem) 3070 for { 3071 if v.AuxInt != 8 { 3072 break 3073 } 3074 _ = v.Args[2] 3075 dst := v.Args[0] 3076 src := v.Args[1] 3077 mem := v.Args[2] 3078 v.reset(OpWasmI64Store) 3079 v.AddArg(dst) 3080 v0 := b.NewValue0(v.Pos, OpWasmI64Load, typ.UInt64) 3081 v0.AddArg(src) 3082 v0.AddArg(mem) 3083 v.AddArg(v0) 3084 v.AddArg(mem) 3085 return true 3086 } 3087 // match: (Move [16] dst src mem) 3088 // cond: 3089 // result: (I64Store [8] dst (I64Load [8] src mem) (I64Store dst (I64Load src mem) mem)) 3090 for { 3091 if v.AuxInt != 16 { 3092 break 3093 } 3094 _ = v.Args[2] 3095 dst := v.Args[0] 3096 src := v.Args[1] 3097 mem := v.Args[2] 3098 v.reset(OpWasmI64Store) 3099 v.AuxInt = 8 3100 v.AddArg(dst) 3101 v0 := b.NewValue0(v.Pos, OpWasmI64Load, typ.UInt64) 3102 v0.AuxInt = 8 3103 v0.AddArg(src) 3104 v0.AddArg(mem) 3105 v.AddArg(v0) 3106 v1 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem) 3107 v1.AddArg(dst) 3108 v2 := b.NewValue0(v.Pos, OpWasmI64Load, typ.UInt64) 3109 v2.AddArg(src) 3110 v2.AddArg(mem) 3111 v1.AddArg(v2) 3112 v1.AddArg(mem) 3113 v.AddArg(v1) 3114 return true 3115 } 3116 // match: (Move [3] dst src mem) 3117 // cond: 3118 // result: (I64Store8 [2] dst (I64Load8U [2] src mem) (I64Store16 dst (I64Load16U src mem) mem)) 3119 for { 3120 if v.AuxInt != 3 { 3121 break 3122 } 3123 _ = v.Args[2] 3124 dst := v.Args[0] 3125 src := v.Args[1] 3126 mem := v.Args[2] 3127 v.reset(OpWasmI64Store8) 3128 v.AuxInt = 2 3129 v.AddArg(dst) 3130 v0 := b.NewValue0(v.Pos, OpWasmI64Load8U, typ.UInt8) 3131 v0.AuxInt = 2 3132 v0.AddArg(src) 3133 v0.AddArg(mem) 3134 v.AddArg(v0) 3135 v1 := b.NewValue0(v.Pos, OpWasmI64Store16, types.TypeMem) 3136 v1.AddArg(dst) 3137 v2 := b.NewValue0(v.Pos, OpWasmI64Load16U, typ.UInt16) 3138 v2.AddArg(src) 3139 v2.AddArg(mem) 3140 v1.AddArg(v2) 3141 v1.AddArg(mem) 3142 v.AddArg(v1) 3143 return true 3144 } 3145 // match: (Move [5] dst src mem) 3146 // cond: 3147 // result: (I64Store8 [4] dst (I64Load8U [4] src mem) (I64Store32 dst (I64Load32U src mem) mem)) 3148 for { 3149 if v.AuxInt != 5 { 3150 break 3151 } 3152 _ = v.Args[2] 3153 dst := v.Args[0] 3154 src := v.Args[1] 3155 mem := v.Args[2] 3156 v.reset(OpWasmI64Store8) 3157 v.AuxInt = 4 3158 v.AddArg(dst) 3159 v0 := b.NewValue0(v.Pos, OpWasmI64Load8U, typ.UInt8) 3160 v0.AuxInt = 4 3161 v0.AddArg(src) 3162 v0.AddArg(mem) 3163 v.AddArg(v0) 3164 v1 := b.NewValue0(v.Pos, OpWasmI64Store32, types.TypeMem) 3165 v1.AddArg(dst) 3166 v2 := b.NewValue0(v.Pos, OpWasmI64Load32U, typ.UInt32) 3167 v2.AddArg(src) 3168 v2.AddArg(mem) 3169 v1.AddArg(v2) 3170 v1.AddArg(mem) 3171 v.AddArg(v1) 3172 return true 3173 } 3174 // match: (Move [6] dst src mem) 3175 // cond: 3176 // result: (I64Store16 [4] dst (I64Load16U [4] src mem) (I64Store32 dst (I64Load32U src mem) mem)) 3177 for { 3178 if v.AuxInt != 6 { 3179 break 3180 } 3181 _ = v.Args[2] 3182 dst := v.Args[0] 3183 src := v.Args[1] 3184 mem := v.Args[2] 3185 v.reset(OpWasmI64Store16) 3186 v.AuxInt = 4 3187 v.AddArg(dst) 3188 v0 := b.NewValue0(v.Pos, OpWasmI64Load16U, typ.UInt16) 3189 v0.AuxInt = 4 3190 v0.AddArg(src) 3191 v0.AddArg(mem) 3192 v.AddArg(v0) 3193 v1 := b.NewValue0(v.Pos, OpWasmI64Store32, types.TypeMem) 3194 v1.AddArg(dst) 3195 v2 := b.NewValue0(v.Pos, OpWasmI64Load32U, typ.UInt32) 3196 v2.AddArg(src) 3197 v2.AddArg(mem) 3198 v1.AddArg(v2) 3199 v1.AddArg(mem) 3200 v.AddArg(v1) 3201 return true 3202 } 3203 // match: (Move [7] dst src mem) 3204 // cond: 3205 // result: (I64Store32 [3] dst (I64Load32U [3] src mem) (I64Store32 dst (I64Load32U src mem) mem)) 3206 for { 3207 if v.AuxInt != 7 { 3208 break 3209 } 3210 _ = v.Args[2] 3211 dst := v.Args[0] 3212 src := v.Args[1] 3213 mem := v.Args[2] 3214 v.reset(OpWasmI64Store32) 3215 v.AuxInt = 3 3216 v.AddArg(dst) 3217 v0 := b.NewValue0(v.Pos, OpWasmI64Load32U, typ.UInt32) 3218 v0.AuxInt = 3 3219 v0.AddArg(src) 3220 v0.AddArg(mem) 3221 v.AddArg(v0) 3222 v1 := b.NewValue0(v.Pos, OpWasmI64Store32, types.TypeMem) 3223 v1.AddArg(dst) 3224 v2 := b.NewValue0(v.Pos, OpWasmI64Load32U, typ.UInt32) 3225 v2.AddArg(src) 3226 v2.AddArg(mem) 3227 v1.AddArg(v2) 3228 v1.AddArg(mem) 3229 v.AddArg(v1) 3230 return true 3231 } 3232 return false 3233 } 3234 func rewriteValueWasm_OpMove_10(v *Value) bool { 3235 b := v.Block 3236 _ = b 3237 typ := &b.Func.Config.Types 3238 _ = typ 3239 // match: (Move [s] dst src mem) 3240 // cond: s > 8 && s < 16 3241 // result: (I64Store [s-8] dst (I64Load [s-8] src mem) (I64Store dst (I64Load src mem) mem)) 3242 for { 3243 s := v.AuxInt 3244 _ = v.Args[2] 3245 dst := v.Args[0] 3246 src := v.Args[1] 3247 mem := v.Args[2] 3248 if !(s > 8 && s < 16) { 3249 break 3250 } 3251 v.reset(OpWasmI64Store) 3252 v.AuxInt = s - 8 3253 v.AddArg(dst) 3254 v0 := b.NewValue0(v.Pos, OpWasmI64Load, typ.UInt64) 3255 v0.AuxInt = s - 8 3256 v0.AddArg(src) 3257 v0.AddArg(mem) 3258 v.AddArg(v0) 3259 v1 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem) 3260 v1.AddArg(dst) 3261 v2 := b.NewValue0(v.Pos, OpWasmI64Load, typ.UInt64) 3262 v2.AddArg(src) 3263 v2.AddArg(mem) 3264 v1.AddArg(v2) 3265 v1.AddArg(mem) 3266 v.AddArg(v1) 3267 return true 3268 } 3269 // match: (Move [s] dst src mem) 3270 // cond: s > 16 && s%16 != 0 && s%16 <= 8 3271 // result: (Move [s-s%16] (OffPtr <dst.Type> dst [s%16]) (OffPtr <src.Type> src [s%16]) (I64Store dst (I64Load src mem) mem)) 3272 for { 3273 s := v.AuxInt 3274 _ = v.Args[2] 3275 dst := v.Args[0] 3276 src := v.Args[1] 3277 mem := v.Args[2] 3278 if !(s > 16 && s%16 != 0 && s%16 <= 8) { 3279 break 3280 } 3281 v.reset(OpMove) 3282 v.AuxInt = s - s%16 3283 v0 := b.NewValue0(v.Pos, OpOffPtr, dst.Type) 3284 v0.AuxInt = s % 16 3285 v0.AddArg(dst) 3286 v.AddArg(v0) 3287 v1 := b.NewValue0(v.Pos, OpOffPtr, src.Type) 3288 v1.AuxInt = s % 16 3289 v1.AddArg(src) 3290 v.AddArg(v1) 3291 v2 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem) 3292 v2.AddArg(dst) 3293 v3 := b.NewValue0(v.Pos, OpWasmI64Load, typ.UInt64) 3294 v3.AddArg(src) 3295 v3.AddArg(mem) 3296 v2.AddArg(v3) 3297 v2.AddArg(mem) 3298 v.AddArg(v2) 3299 return true 3300 } 3301 // match: (Move [s] dst src mem) 3302 // cond: s > 16 && s%16 != 0 && s%16 > 8 3303 // result: (Move [s-s%16] (OffPtr <dst.Type> dst [s%16]) (OffPtr <src.Type> src [s%16]) (I64Store [8] dst (I64Load [8] src mem) (I64Store dst (I64Load src mem) mem))) 3304 for { 3305 s := v.AuxInt 3306 _ = v.Args[2] 3307 dst := v.Args[0] 3308 src := v.Args[1] 3309 mem := v.Args[2] 3310 if !(s > 16 && s%16 != 0 && s%16 > 8) { 3311 break 3312 } 3313 v.reset(OpMove) 3314 v.AuxInt = s - s%16 3315 v0 := b.NewValue0(v.Pos, OpOffPtr, dst.Type) 3316 v0.AuxInt = s % 16 3317 v0.AddArg(dst) 3318 v.AddArg(v0) 3319 v1 := b.NewValue0(v.Pos, OpOffPtr, src.Type) 3320 v1.AuxInt = s % 16 3321 v1.AddArg(src) 3322 v.AddArg(v1) 3323 v2 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem) 3324 v2.AuxInt = 8 3325 v2.AddArg(dst) 3326 v3 := b.NewValue0(v.Pos, OpWasmI64Load, typ.UInt64) 3327 v3.AuxInt = 8 3328 v3.AddArg(src) 3329 v3.AddArg(mem) 3330 v2.AddArg(v3) 3331 v4 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem) 3332 v4.AddArg(dst) 3333 v5 := b.NewValue0(v.Pos, OpWasmI64Load, typ.UInt64) 3334 v5.AddArg(src) 3335 v5.AddArg(mem) 3336 v4.AddArg(v5) 3337 v4.AddArg(mem) 3338 v2.AddArg(v4) 3339 v.AddArg(v2) 3340 return true 3341 } 3342 // match: (Move [s] dst src mem) 3343 // cond: s%8 == 0 3344 // result: (LoweredMove [s/8] dst src mem) 3345 for { 3346 s := v.AuxInt 3347 _ = v.Args[2] 3348 dst := v.Args[0] 3349 src := v.Args[1] 3350 mem := v.Args[2] 3351 if !(s%8 == 0) { 3352 break 3353 } 3354 v.reset(OpWasmLoweredMove) 3355 v.AuxInt = s / 8 3356 v.AddArg(dst) 3357 v.AddArg(src) 3358 v.AddArg(mem) 3359 return true 3360 } 3361 return false 3362 } 3363 func rewriteValueWasm_OpMul16_0(v *Value) bool { 3364 // match: (Mul16 x y) 3365 // cond: 3366 // result: (I64Mul x y) 3367 for { 3368 _ = v.Args[1] 3369 x := v.Args[0] 3370 y := v.Args[1] 3371 v.reset(OpWasmI64Mul) 3372 v.AddArg(x) 3373 v.AddArg(y) 3374 return true 3375 } 3376 } 3377 func rewriteValueWasm_OpMul32_0(v *Value) bool { 3378 // match: (Mul32 x y) 3379 // cond: 3380 // result: (I64Mul x y) 3381 for { 3382 _ = v.Args[1] 3383 x := v.Args[0] 3384 y := v.Args[1] 3385 v.reset(OpWasmI64Mul) 3386 v.AddArg(x) 3387 v.AddArg(y) 3388 return true 3389 } 3390 } 3391 func rewriteValueWasm_OpMul32F_0(v *Value) bool { 3392 // match: (Mul32F x y) 3393 // cond: 3394 // result: (F64Mul x y) 3395 for { 3396 _ = v.Args[1] 3397 x := v.Args[0] 3398 y := v.Args[1] 3399 v.reset(OpWasmF64Mul) 3400 v.AddArg(x) 3401 v.AddArg(y) 3402 return true 3403 } 3404 } 3405 func rewriteValueWasm_OpMul64_0(v *Value) bool { 3406 // match: (Mul64 x y) 3407 // cond: 3408 // result: (I64Mul x y) 3409 for { 3410 _ = v.Args[1] 3411 x := v.Args[0] 3412 y := v.Args[1] 3413 v.reset(OpWasmI64Mul) 3414 v.AddArg(x) 3415 v.AddArg(y) 3416 return true 3417 } 3418 } 3419 func rewriteValueWasm_OpMul64F_0(v *Value) bool { 3420 // match: (Mul64F x y) 3421 // cond: 3422 // result: (F64Mul x y) 3423 for { 3424 _ = v.Args[1] 3425 x := v.Args[0] 3426 y := v.Args[1] 3427 v.reset(OpWasmF64Mul) 3428 v.AddArg(x) 3429 v.AddArg(y) 3430 return true 3431 } 3432 } 3433 func rewriteValueWasm_OpMul8_0(v *Value) bool { 3434 // match: (Mul8 x y) 3435 // cond: 3436 // result: (I64Mul x y) 3437 for { 3438 _ = v.Args[1] 3439 x := v.Args[0] 3440 y := v.Args[1] 3441 v.reset(OpWasmI64Mul) 3442 v.AddArg(x) 3443 v.AddArg(y) 3444 return true 3445 } 3446 } 3447 func rewriteValueWasm_OpNeg16_0(v *Value) bool { 3448 b := v.Block 3449 _ = b 3450 typ := &b.Func.Config.Types 3451 _ = typ 3452 // match: (Neg16 x) 3453 // cond: 3454 // result: (I64Sub (I64Const [0]) x) 3455 for { 3456 x := v.Args[0] 3457 v.reset(OpWasmI64Sub) 3458 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 3459 v0.AuxInt = 0 3460 v.AddArg(v0) 3461 v.AddArg(x) 3462 return true 3463 } 3464 } 3465 func rewriteValueWasm_OpNeg32_0(v *Value) bool { 3466 b := v.Block 3467 _ = b 3468 typ := &b.Func.Config.Types 3469 _ = typ 3470 // match: (Neg32 x) 3471 // cond: 3472 // result: (I64Sub (I64Const [0]) x) 3473 for { 3474 x := v.Args[0] 3475 v.reset(OpWasmI64Sub) 3476 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 3477 v0.AuxInt = 0 3478 v.AddArg(v0) 3479 v.AddArg(x) 3480 return true 3481 } 3482 } 3483 func rewriteValueWasm_OpNeg32F_0(v *Value) bool { 3484 // match: (Neg32F x) 3485 // cond: 3486 // result: (F64Neg x) 3487 for { 3488 x := v.Args[0] 3489 v.reset(OpWasmF64Neg) 3490 v.AddArg(x) 3491 return true 3492 } 3493 } 3494 func rewriteValueWasm_OpNeg64_0(v *Value) bool { 3495 b := v.Block 3496 _ = b 3497 typ := &b.Func.Config.Types 3498 _ = typ 3499 // match: (Neg64 x) 3500 // cond: 3501 // result: (I64Sub (I64Const [0]) x) 3502 for { 3503 x := v.Args[0] 3504 v.reset(OpWasmI64Sub) 3505 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 3506 v0.AuxInt = 0 3507 v.AddArg(v0) 3508 v.AddArg(x) 3509 return true 3510 } 3511 } 3512 func rewriteValueWasm_OpNeg64F_0(v *Value) bool { 3513 // match: (Neg64F x) 3514 // cond: 3515 // result: (F64Neg x) 3516 for { 3517 x := v.Args[0] 3518 v.reset(OpWasmF64Neg) 3519 v.AddArg(x) 3520 return true 3521 } 3522 } 3523 func rewriteValueWasm_OpNeg8_0(v *Value) bool { 3524 b := v.Block 3525 _ = b 3526 typ := &b.Func.Config.Types 3527 _ = typ 3528 // match: (Neg8 x) 3529 // cond: 3530 // result: (I64Sub (I64Const [0]) x) 3531 for { 3532 x := v.Args[0] 3533 v.reset(OpWasmI64Sub) 3534 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 3535 v0.AuxInt = 0 3536 v.AddArg(v0) 3537 v.AddArg(x) 3538 return true 3539 } 3540 } 3541 func rewriteValueWasm_OpNeq16_0(v *Value) bool { 3542 b := v.Block 3543 _ = b 3544 typ := &b.Func.Config.Types 3545 _ = typ 3546 // match: (Neq16 x y) 3547 // cond: 3548 // result: (I64Ne (ZeroExt16to64 x) (ZeroExt16to64 y)) 3549 for { 3550 _ = v.Args[1] 3551 x := v.Args[0] 3552 y := v.Args[1] 3553 v.reset(OpWasmI64Ne) 3554 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 3555 v0.AddArg(x) 3556 v.AddArg(v0) 3557 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 3558 v1.AddArg(y) 3559 v.AddArg(v1) 3560 return true 3561 } 3562 } 3563 func rewriteValueWasm_OpNeq32_0(v *Value) bool { 3564 b := v.Block 3565 _ = b 3566 typ := &b.Func.Config.Types 3567 _ = typ 3568 // match: (Neq32 x y) 3569 // cond: 3570 // result: (I64Ne (ZeroExt32to64 x) (ZeroExt32to64 y)) 3571 for { 3572 _ = v.Args[1] 3573 x := v.Args[0] 3574 y := v.Args[1] 3575 v.reset(OpWasmI64Ne) 3576 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 3577 v0.AddArg(x) 3578 v.AddArg(v0) 3579 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 3580 v1.AddArg(y) 3581 v.AddArg(v1) 3582 return true 3583 } 3584 } 3585 func rewriteValueWasm_OpNeq32F_0(v *Value) bool { 3586 b := v.Block 3587 _ = b 3588 typ := &b.Func.Config.Types 3589 _ = typ 3590 // match: (Neq32F x y) 3591 // cond: 3592 // result: (F64Ne (LoweredRound32F x) (LoweredRound32F y)) 3593 for { 3594 _ = v.Args[1] 3595 x := v.Args[0] 3596 y := v.Args[1] 3597 v.reset(OpWasmF64Ne) 3598 v0 := b.NewValue0(v.Pos, OpWasmLoweredRound32F, typ.Float32) 3599 v0.AddArg(x) 3600 v.AddArg(v0) 3601 v1 := b.NewValue0(v.Pos, OpWasmLoweredRound32F, typ.Float32) 3602 v1.AddArg(y) 3603 v.AddArg(v1) 3604 return true 3605 } 3606 } 3607 func rewriteValueWasm_OpNeq64_0(v *Value) bool { 3608 // match: (Neq64 x y) 3609 // cond: 3610 // result: (I64Ne x y) 3611 for { 3612 _ = v.Args[1] 3613 x := v.Args[0] 3614 y := v.Args[1] 3615 v.reset(OpWasmI64Ne) 3616 v.AddArg(x) 3617 v.AddArg(y) 3618 return true 3619 } 3620 } 3621 func rewriteValueWasm_OpNeq64F_0(v *Value) bool { 3622 // match: (Neq64F x y) 3623 // cond: 3624 // result: (F64Ne x y) 3625 for { 3626 _ = v.Args[1] 3627 x := v.Args[0] 3628 y := v.Args[1] 3629 v.reset(OpWasmF64Ne) 3630 v.AddArg(x) 3631 v.AddArg(y) 3632 return true 3633 } 3634 } 3635 func rewriteValueWasm_OpNeq8_0(v *Value) bool { 3636 b := v.Block 3637 _ = b 3638 typ := &b.Func.Config.Types 3639 _ = typ 3640 // match: (Neq8 x y) 3641 // cond: 3642 // result: (I64Ne (ZeroExt8to64 x) (ZeroExt8to64 y)) 3643 for { 3644 _ = v.Args[1] 3645 x := v.Args[0] 3646 y := v.Args[1] 3647 v.reset(OpWasmI64Ne) 3648 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 3649 v0.AddArg(x) 3650 v.AddArg(v0) 3651 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 3652 v1.AddArg(y) 3653 v.AddArg(v1) 3654 return true 3655 } 3656 } 3657 func rewriteValueWasm_OpNeqB_0(v *Value) bool { 3658 // match: (NeqB x y) 3659 // cond: 3660 // result: (I64Ne x y) 3661 for { 3662 _ = v.Args[1] 3663 x := v.Args[0] 3664 y := v.Args[1] 3665 v.reset(OpWasmI64Ne) 3666 v.AddArg(x) 3667 v.AddArg(y) 3668 return true 3669 } 3670 } 3671 func rewriteValueWasm_OpNeqPtr_0(v *Value) bool { 3672 // match: (NeqPtr x y) 3673 // cond: 3674 // result: (I64Ne x y) 3675 for { 3676 _ = v.Args[1] 3677 x := v.Args[0] 3678 y := v.Args[1] 3679 v.reset(OpWasmI64Ne) 3680 v.AddArg(x) 3681 v.AddArg(y) 3682 return true 3683 } 3684 } 3685 func rewriteValueWasm_OpNilCheck_0(v *Value) bool { 3686 // match: (NilCheck ptr mem) 3687 // cond: 3688 // result: (LoweredNilCheck ptr mem) 3689 for { 3690 _ = v.Args[1] 3691 ptr := v.Args[0] 3692 mem := v.Args[1] 3693 v.reset(OpWasmLoweredNilCheck) 3694 v.AddArg(ptr) 3695 v.AddArg(mem) 3696 return true 3697 } 3698 } 3699 func rewriteValueWasm_OpNot_0(v *Value) bool { 3700 // match: (Not x) 3701 // cond: 3702 // result: (I64Eqz x) 3703 for { 3704 x := v.Args[0] 3705 v.reset(OpWasmI64Eqz) 3706 v.AddArg(x) 3707 return true 3708 } 3709 } 3710 func rewriteValueWasm_OpOffPtr_0(v *Value) bool { 3711 // match: (OffPtr [off] ptr) 3712 // cond: 3713 // result: (I64AddConst [off] ptr) 3714 for { 3715 off := v.AuxInt 3716 ptr := v.Args[0] 3717 v.reset(OpWasmI64AddConst) 3718 v.AuxInt = off 3719 v.AddArg(ptr) 3720 return true 3721 } 3722 } 3723 func rewriteValueWasm_OpOr16_0(v *Value) bool { 3724 // match: (Or16 x y) 3725 // cond: 3726 // result: (I64Or x y) 3727 for { 3728 _ = v.Args[1] 3729 x := v.Args[0] 3730 y := v.Args[1] 3731 v.reset(OpWasmI64Or) 3732 v.AddArg(x) 3733 v.AddArg(y) 3734 return true 3735 } 3736 } 3737 func rewriteValueWasm_OpOr32_0(v *Value) bool { 3738 // match: (Or32 x y) 3739 // cond: 3740 // result: (I64Or x y) 3741 for { 3742 _ = v.Args[1] 3743 x := v.Args[0] 3744 y := v.Args[1] 3745 v.reset(OpWasmI64Or) 3746 v.AddArg(x) 3747 v.AddArg(y) 3748 return true 3749 } 3750 } 3751 func rewriteValueWasm_OpOr64_0(v *Value) bool { 3752 // match: (Or64 x y) 3753 // cond: 3754 // result: (I64Or x y) 3755 for { 3756 _ = v.Args[1] 3757 x := v.Args[0] 3758 y := v.Args[1] 3759 v.reset(OpWasmI64Or) 3760 v.AddArg(x) 3761 v.AddArg(y) 3762 return true 3763 } 3764 } 3765 func rewriteValueWasm_OpOr8_0(v *Value) bool { 3766 // match: (Or8 x y) 3767 // cond: 3768 // result: (I64Or x y) 3769 for { 3770 _ = v.Args[1] 3771 x := v.Args[0] 3772 y := v.Args[1] 3773 v.reset(OpWasmI64Or) 3774 v.AddArg(x) 3775 v.AddArg(y) 3776 return true 3777 } 3778 } 3779 func rewriteValueWasm_OpOrB_0(v *Value) bool { 3780 // match: (OrB x y) 3781 // cond: 3782 // result: (I64Or x y) 3783 for { 3784 _ = v.Args[1] 3785 x := v.Args[0] 3786 y := v.Args[1] 3787 v.reset(OpWasmI64Or) 3788 v.AddArg(x) 3789 v.AddArg(y) 3790 return true 3791 } 3792 } 3793 func rewriteValueWasm_OpRound32F_0(v *Value) bool { 3794 // match: (Round32F x) 3795 // cond: 3796 // result: (LoweredRound32F x) 3797 for { 3798 x := v.Args[0] 3799 v.reset(OpWasmLoweredRound32F) 3800 v.AddArg(x) 3801 return true 3802 } 3803 } 3804 func rewriteValueWasm_OpRound64F_0(v *Value) bool { 3805 // match: (Round64F x) 3806 // cond: 3807 // result: x 3808 for { 3809 x := v.Args[0] 3810 v.reset(OpCopy) 3811 v.Type = x.Type 3812 v.AddArg(x) 3813 return true 3814 } 3815 } 3816 func rewriteValueWasm_OpRsh16Ux16_0(v *Value) bool { 3817 b := v.Block 3818 _ = b 3819 typ := &b.Func.Config.Types 3820 _ = typ 3821 // match: (Rsh16Ux16 x y) 3822 // cond: 3823 // result: (Rsh64Ux64 (ZeroExt16to64 x) (ZeroExt16to64 y)) 3824 for { 3825 _ = v.Args[1] 3826 x := v.Args[0] 3827 y := v.Args[1] 3828 v.reset(OpRsh64Ux64) 3829 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 3830 v0.AddArg(x) 3831 v.AddArg(v0) 3832 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 3833 v1.AddArg(y) 3834 v.AddArg(v1) 3835 return true 3836 } 3837 } 3838 func rewriteValueWasm_OpRsh16Ux32_0(v *Value) bool { 3839 b := v.Block 3840 _ = b 3841 typ := &b.Func.Config.Types 3842 _ = typ 3843 // match: (Rsh16Ux32 x y) 3844 // cond: 3845 // result: (Rsh64Ux64 (ZeroExt16to64 x) (ZeroExt32to64 y)) 3846 for { 3847 _ = v.Args[1] 3848 x := v.Args[0] 3849 y := v.Args[1] 3850 v.reset(OpRsh64Ux64) 3851 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 3852 v0.AddArg(x) 3853 v.AddArg(v0) 3854 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 3855 v1.AddArg(y) 3856 v.AddArg(v1) 3857 return true 3858 } 3859 } 3860 func rewriteValueWasm_OpRsh16Ux64_0(v *Value) bool { 3861 b := v.Block 3862 _ = b 3863 typ := &b.Func.Config.Types 3864 _ = typ 3865 // match: (Rsh16Ux64 x y) 3866 // cond: 3867 // result: (Rsh64Ux64 (ZeroExt16to64 x) y) 3868 for { 3869 _ = v.Args[1] 3870 x := v.Args[0] 3871 y := v.Args[1] 3872 v.reset(OpRsh64Ux64) 3873 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 3874 v0.AddArg(x) 3875 v.AddArg(v0) 3876 v.AddArg(y) 3877 return true 3878 } 3879 } 3880 func rewriteValueWasm_OpRsh16Ux8_0(v *Value) bool { 3881 b := v.Block 3882 _ = b 3883 typ := &b.Func.Config.Types 3884 _ = typ 3885 // match: (Rsh16Ux8 x y) 3886 // cond: 3887 // result: (Rsh64Ux64 (ZeroExt16to64 x) (ZeroExt8to64 y)) 3888 for { 3889 _ = v.Args[1] 3890 x := v.Args[0] 3891 y := v.Args[1] 3892 v.reset(OpRsh64Ux64) 3893 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 3894 v0.AddArg(x) 3895 v.AddArg(v0) 3896 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 3897 v1.AddArg(y) 3898 v.AddArg(v1) 3899 return true 3900 } 3901 } 3902 func rewriteValueWasm_OpRsh16x16_0(v *Value) bool { 3903 b := v.Block 3904 _ = b 3905 typ := &b.Func.Config.Types 3906 _ = typ 3907 // match: (Rsh16x16 x y) 3908 // cond: 3909 // result: (Rsh64x64 (SignExt16to64 x) (ZeroExt16to64 y)) 3910 for { 3911 _ = v.Args[1] 3912 x := v.Args[0] 3913 y := v.Args[1] 3914 v.reset(OpRsh64x64) 3915 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64) 3916 v0.AddArg(x) 3917 v.AddArg(v0) 3918 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 3919 v1.AddArg(y) 3920 v.AddArg(v1) 3921 return true 3922 } 3923 } 3924 func rewriteValueWasm_OpRsh16x32_0(v *Value) bool { 3925 b := v.Block 3926 _ = b 3927 typ := &b.Func.Config.Types 3928 _ = typ 3929 // match: (Rsh16x32 x y) 3930 // cond: 3931 // result: (Rsh64x64 (SignExt16to64 x) (ZeroExt32to64 y)) 3932 for { 3933 _ = v.Args[1] 3934 x := v.Args[0] 3935 y := v.Args[1] 3936 v.reset(OpRsh64x64) 3937 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64) 3938 v0.AddArg(x) 3939 v.AddArg(v0) 3940 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 3941 v1.AddArg(y) 3942 v.AddArg(v1) 3943 return true 3944 } 3945 } 3946 func rewriteValueWasm_OpRsh16x64_0(v *Value) bool { 3947 b := v.Block 3948 _ = b 3949 typ := &b.Func.Config.Types 3950 _ = typ 3951 // match: (Rsh16x64 x y) 3952 // cond: 3953 // result: (Rsh64x64 (SignExt16to64 x) y) 3954 for { 3955 _ = v.Args[1] 3956 x := v.Args[0] 3957 y := v.Args[1] 3958 v.reset(OpRsh64x64) 3959 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64) 3960 v0.AddArg(x) 3961 v.AddArg(v0) 3962 v.AddArg(y) 3963 return true 3964 } 3965 } 3966 func rewriteValueWasm_OpRsh16x8_0(v *Value) bool { 3967 b := v.Block 3968 _ = b 3969 typ := &b.Func.Config.Types 3970 _ = typ 3971 // match: (Rsh16x8 x y) 3972 // cond: 3973 // result: (Rsh64x64 (SignExt16to64 x) (ZeroExt8to64 y)) 3974 for { 3975 _ = v.Args[1] 3976 x := v.Args[0] 3977 y := v.Args[1] 3978 v.reset(OpRsh64x64) 3979 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64) 3980 v0.AddArg(x) 3981 v.AddArg(v0) 3982 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 3983 v1.AddArg(y) 3984 v.AddArg(v1) 3985 return true 3986 } 3987 } 3988 func rewriteValueWasm_OpRsh32Ux16_0(v *Value) bool { 3989 b := v.Block 3990 _ = b 3991 typ := &b.Func.Config.Types 3992 _ = typ 3993 // match: (Rsh32Ux16 x y) 3994 // cond: 3995 // result: (Rsh64Ux64 (ZeroExt32to64 x) (ZeroExt16to64 y)) 3996 for { 3997 _ = v.Args[1] 3998 x := v.Args[0] 3999 y := v.Args[1] 4000 v.reset(OpRsh64Ux64) 4001 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 4002 v0.AddArg(x) 4003 v.AddArg(v0) 4004 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 4005 v1.AddArg(y) 4006 v.AddArg(v1) 4007 return true 4008 } 4009 } 4010 func rewriteValueWasm_OpRsh32Ux32_0(v *Value) bool { 4011 b := v.Block 4012 _ = b 4013 typ := &b.Func.Config.Types 4014 _ = typ 4015 // match: (Rsh32Ux32 x y) 4016 // cond: 4017 // result: (Rsh64Ux64 (ZeroExt32to64 x) (ZeroExt32to64 y)) 4018 for { 4019 _ = v.Args[1] 4020 x := v.Args[0] 4021 y := v.Args[1] 4022 v.reset(OpRsh64Ux64) 4023 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 4024 v0.AddArg(x) 4025 v.AddArg(v0) 4026 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 4027 v1.AddArg(y) 4028 v.AddArg(v1) 4029 return true 4030 } 4031 } 4032 func rewriteValueWasm_OpRsh32Ux64_0(v *Value) bool { 4033 b := v.Block 4034 _ = b 4035 typ := &b.Func.Config.Types 4036 _ = typ 4037 // match: (Rsh32Ux64 x y) 4038 // cond: 4039 // result: (Rsh64Ux64 (ZeroExt32to64 x) y) 4040 for { 4041 _ = v.Args[1] 4042 x := v.Args[0] 4043 y := v.Args[1] 4044 v.reset(OpRsh64Ux64) 4045 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 4046 v0.AddArg(x) 4047 v.AddArg(v0) 4048 v.AddArg(y) 4049 return true 4050 } 4051 } 4052 func rewriteValueWasm_OpRsh32Ux8_0(v *Value) bool { 4053 b := v.Block 4054 _ = b 4055 typ := &b.Func.Config.Types 4056 _ = typ 4057 // match: (Rsh32Ux8 x y) 4058 // cond: 4059 // result: (Rsh64Ux64 (ZeroExt32to64 x) (ZeroExt8to64 y)) 4060 for { 4061 _ = v.Args[1] 4062 x := v.Args[0] 4063 y := v.Args[1] 4064 v.reset(OpRsh64Ux64) 4065 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 4066 v0.AddArg(x) 4067 v.AddArg(v0) 4068 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 4069 v1.AddArg(y) 4070 v.AddArg(v1) 4071 return true 4072 } 4073 } 4074 func rewriteValueWasm_OpRsh32x16_0(v *Value) bool { 4075 b := v.Block 4076 _ = b 4077 typ := &b.Func.Config.Types 4078 _ = typ 4079 // match: (Rsh32x16 x y) 4080 // cond: 4081 // result: (Rsh64x64 (SignExt32to64 x) (ZeroExt16to64 y)) 4082 for { 4083 _ = v.Args[1] 4084 x := v.Args[0] 4085 y := v.Args[1] 4086 v.reset(OpRsh64x64) 4087 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 4088 v0.AddArg(x) 4089 v.AddArg(v0) 4090 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 4091 v1.AddArg(y) 4092 v.AddArg(v1) 4093 return true 4094 } 4095 } 4096 func rewriteValueWasm_OpRsh32x32_0(v *Value) bool { 4097 b := v.Block 4098 _ = b 4099 typ := &b.Func.Config.Types 4100 _ = typ 4101 // match: (Rsh32x32 x y) 4102 // cond: 4103 // result: (Rsh64x64 (SignExt32to64 x) (ZeroExt32to64 y)) 4104 for { 4105 _ = v.Args[1] 4106 x := v.Args[0] 4107 y := v.Args[1] 4108 v.reset(OpRsh64x64) 4109 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 4110 v0.AddArg(x) 4111 v.AddArg(v0) 4112 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 4113 v1.AddArg(y) 4114 v.AddArg(v1) 4115 return true 4116 } 4117 } 4118 func rewriteValueWasm_OpRsh32x64_0(v *Value) bool { 4119 b := v.Block 4120 _ = b 4121 typ := &b.Func.Config.Types 4122 _ = typ 4123 // match: (Rsh32x64 x y) 4124 // cond: 4125 // result: (Rsh64x64 (SignExt32to64 x) y) 4126 for { 4127 _ = v.Args[1] 4128 x := v.Args[0] 4129 y := v.Args[1] 4130 v.reset(OpRsh64x64) 4131 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 4132 v0.AddArg(x) 4133 v.AddArg(v0) 4134 v.AddArg(y) 4135 return true 4136 } 4137 } 4138 func rewriteValueWasm_OpRsh32x8_0(v *Value) bool { 4139 b := v.Block 4140 _ = b 4141 typ := &b.Func.Config.Types 4142 _ = typ 4143 // match: (Rsh32x8 x y) 4144 // cond: 4145 // result: (Rsh64x64 (SignExt32to64 x) (ZeroExt8to64 y)) 4146 for { 4147 _ = v.Args[1] 4148 x := v.Args[0] 4149 y := v.Args[1] 4150 v.reset(OpRsh64x64) 4151 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) 4152 v0.AddArg(x) 4153 v.AddArg(v0) 4154 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 4155 v1.AddArg(y) 4156 v.AddArg(v1) 4157 return true 4158 } 4159 } 4160 func rewriteValueWasm_OpRsh64Ux16_0(v *Value) bool { 4161 b := v.Block 4162 _ = b 4163 typ := &b.Func.Config.Types 4164 _ = typ 4165 // match: (Rsh64Ux16 x y) 4166 // cond: 4167 // result: (Rsh64Ux64 x (ZeroExt16to64 y)) 4168 for { 4169 _ = v.Args[1] 4170 x := v.Args[0] 4171 y := v.Args[1] 4172 v.reset(OpRsh64Ux64) 4173 v.AddArg(x) 4174 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 4175 v0.AddArg(y) 4176 v.AddArg(v0) 4177 return true 4178 } 4179 } 4180 func rewriteValueWasm_OpRsh64Ux32_0(v *Value) bool { 4181 b := v.Block 4182 _ = b 4183 typ := &b.Func.Config.Types 4184 _ = typ 4185 // match: (Rsh64Ux32 x y) 4186 // cond: 4187 // result: (Rsh64Ux64 x (ZeroExt32to64 y)) 4188 for { 4189 _ = v.Args[1] 4190 x := v.Args[0] 4191 y := v.Args[1] 4192 v.reset(OpRsh64Ux64) 4193 v.AddArg(x) 4194 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 4195 v0.AddArg(y) 4196 v.AddArg(v0) 4197 return true 4198 } 4199 } 4200 func rewriteValueWasm_OpRsh64Ux64_0(v *Value) bool { 4201 b := v.Block 4202 _ = b 4203 typ := &b.Func.Config.Types 4204 _ = typ 4205 // match: (Rsh64Ux64 x y) 4206 // cond: 4207 // result: (Select (I64ShrU x y) (I64Const [0]) (I64LtU y (I64Const [64]))) 4208 for { 4209 _ = v.Args[1] 4210 x := v.Args[0] 4211 y := v.Args[1] 4212 v.reset(OpWasmSelect) 4213 v0 := b.NewValue0(v.Pos, OpWasmI64ShrU, typ.Int64) 4214 v0.AddArg(x) 4215 v0.AddArg(y) 4216 v.AddArg(v0) 4217 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 4218 v1.AuxInt = 0 4219 v.AddArg(v1) 4220 v2 := b.NewValue0(v.Pos, OpWasmI64LtU, typ.Bool) 4221 v2.AddArg(y) 4222 v3 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 4223 v3.AuxInt = 64 4224 v2.AddArg(v3) 4225 v.AddArg(v2) 4226 return true 4227 } 4228 } 4229 func rewriteValueWasm_OpRsh64Ux8_0(v *Value) bool { 4230 b := v.Block 4231 _ = b 4232 typ := &b.Func.Config.Types 4233 _ = typ 4234 // match: (Rsh64Ux8 x y) 4235 // cond: 4236 // result: (Rsh64Ux64 x (ZeroExt8to64 y)) 4237 for { 4238 _ = v.Args[1] 4239 x := v.Args[0] 4240 y := v.Args[1] 4241 v.reset(OpRsh64Ux64) 4242 v.AddArg(x) 4243 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 4244 v0.AddArg(y) 4245 v.AddArg(v0) 4246 return true 4247 } 4248 } 4249 func rewriteValueWasm_OpRsh64x16_0(v *Value) bool { 4250 b := v.Block 4251 _ = b 4252 typ := &b.Func.Config.Types 4253 _ = typ 4254 // match: (Rsh64x16 x y) 4255 // cond: 4256 // result: (Rsh64x64 x (ZeroExt16to64 y)) 4257 for { 4258 _ = v.Args[1] 4259 x := v.Args[0] 4260 y := v.Args[1] 4261 v.reset(OpRsh64x64) 4262 v.AddArg(x) 4263 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 4264 v0.AddArg(y) 4265 v.AddArg(v0) 4266 return true 4267 } 4268 } 4269 func rewriteValueWasm_OpRsh64x32_0(v *Value) bool { 4270 b := v.Block 4271 _ = b 4272 typ := &b.Func.Config.Types 4273 _ = typ 4274 // match: (Rsh64x32 x y) 4275 // cond: 4276 // result: (Rsh64x64 x (ZeroExt32to64 y)) 4277 for { 4278 _ = v.Args[1] 4279 x := v.Args[0] 4280 y := v.Args[1] 4281 v.reset(OpRsh64x64) 4282 v.AddArg(x) 4283 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 4284 v0.AddArg(y) 4285 v.AddArg(v0) 4286 return true 4287 } 4288 } 4289 func rewriteValueWasm_OpRsh64x64_0(v *Value) bool { 4290 b := v.Block 4291 _ = b 4292 typ := &b.Func.Config.Types 4293 _ = typ 4294 // match: (Rsh64x64 x y) 4295 // cond: 4296 // result: (I64ShrS x (Select <typ.Int64> y (I64Const [63]) (I64LtU y (I64Const [64])))) 4297 for { 4298 _ = v.Args[1] 4299 x := v.Args[0] 4300 y := v.Args[1] 4301 v.reset(OpWasmI64ShrS) 4302 v.AddArg(x) 4303 v0 := b.NewValue0(v.Pos, OpWasmSelect, typ.Int64) 4304 v0.AddArg(y) 4305 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 4306 v1.AuxInt = 63 4307 v0.AddArg(v1) 4308 v2 := b.NewValue0(v.Pos, OpWasmI64LtU, typ.Bool) 4309 v2.AddArg(y) 4310 v3 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 4311 v3.AuxInt = 64 4312 v2.AddArg(v3) 4313 v0.AddArg(v2) 4314 v.AddArg(v0) 4315 return true 4316 } 4317 } 4318 func rewriteValueWasm_OpRsh64x8_0(v *Value) bool { 4319 b := v.Block 4320 _ = b 4321 typ := &b.Func.Config.Types 4322 _ = typ 4323 // match: (Rsh64x8 x y) 4324 // cond: 4325 // result: (Rsh64x64 x (ZeroExt8to64 y)) 4326 for { 4327 _ = v.Args[1] 4328 x := v.Args[0] 4329 y := v.Args[1] 4330 v.reset(OpRsh64x64) 4331 v.AddArg(x) 4332 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 4333 v0.AddArg(y) 4334 v.AddArg(v0) 4335 return true 4336 } 4337 } 4338 func rewriteValueWasm_OpRsh8Ux16_0(v *Value) bool { 4339 b := v.Block 4340 _ = b 4341 typ := &b.Func.Config.Types 4342 _ = typ 4343 // match: (Rsh8Ux16 x y) 4344 // cond: 4345 // result: (Rsh64Ux64 (ZeroExt8to64 x) (ZeroExt16to64 y)) 4346 for { 4347 _ = v.Args[1] 4348 x := v.Args[0] 4349 y := v.Args[1] 4350 v.reset(OpRsh64Ux64) 4351 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 4352 v0.AddArg(x) 4353 v.AddArg(v0) 4354 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 4355 v1.AddArg(y) 4356 v.AddArg(v1) 4357 return true 4358 } 4359 } 4360 func rewriteValueWasm_OpRsh8Ux32_0(v *Value) bool { 4361 b := v.Block 4362 _ = b 4363 typ := &b.Func.Config.Types 4364 _ = typ 4365 // match: (Rsh8Ux32 x y) 4366 // cond: 4367 // result: (Rsh64Ux64 (ZeroExt8to64 x) (ZeroExt32to64 y)) 4368 for { 4369 _ = v.Args[1] 4370 x := v.Args[0] 4371 y := v.Args[1] 4372 v.reset(OpRsh64Ux64) 4373 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 4374 v0.AddArg(x) 4375 v.AddArg(v0) 4376 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 4377 v1.AddArg(y) 4378 v.AddArg(v1) 4379 return true 4380 } 4381 } 4382 func rewriteValueWasm_OpRsh8Ux64_0(v *Value) bool { 4383 b := v.Block 4384 _ = b 4385 typ := &b.Func.Config.Types 4386 _ = typ 4387 // match: (Rsh8Ux64 x y) 4388 // cond: 4389 // result: (Rsh64Ux64 (ZeroExt8to64 x) y) 4390 for { 4391 _ = v.Args[1] 4392 x := v.Args[0] 4393 y := v.Args[1] 4394 v.reset(OpRsh64Ux64) 4395 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 4396 v0.AddArg(x) 4397 v.AddArg(v0) 4398 v.AddArg(y) 4399 return true 4400 } 4401 } 4402 func rewriteValueWasm_OpRsh8Ux8_0(v *Value) bool { 4403 b := v.Block 4404 _ = b 4405 typ := &b.Func.Config.Types 4406 _ = typ 4407 // match: (Rsh8Ux8 x y) 4408 // cond: 4409 // result: (Rsh64Ux64 (ZeroExt8to64 x) (ZeroExt8to64 y)) 4410 for { 4411 _ = v.Args[1] 4412 x := v.Args[0] 4413 y := v.Args[1] 4414 v.reset(OpRsh64Ux64) 4415 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 4416 v0.AddArg(x) 4417 v.AddArg(v0) 4418 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 4419 v1.AddArg(y) 4420 v.AddArg(v1) 4421 return true 4422 } 4423 } 4424 func rewriteValueWasm_OpRsh8x16_0(v *Value) bool { 4425 b := v.Block 4426 _ = b 4427 typ := &b.Func.Config.Types 4428 _ = typ 4429 // match: (Rsh8x16 x y) 4430 // cond: 4431 // result: (Rsh64x64 (SignExt8to64 x) (ZeroExt16to64 y)) 4432 for { 4433 _ = v.Args[1] 4434 x := v.Args[0] 4435 y := v.Args[1] 4436 v.reset(OpRsh64x64) 4437 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64) 4438 v0.AddArg(x) 4439 v.AddArg(v0) 4440 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) 4441 v1.AddArg(y) 4442 v.AddArg(v1) 4443 return true 4444 } 4445 } 4446 func rewriteValueWasm_OpRsh8x32_0(v *Value) bool { 4447 b := v.Block 4448 _ = b 4449 typ := &b.Func.Config.Types 4450 _ = typ 4451 // match: (Rsh8x32 x y) 4452 // cond: 4453 // result: (Rsh64x64 (SignExt8to64 x) (ZeroExt32to64 y)) 4454 for { 4455 _ = v.Args[1] 4456 x := v.Args[0] 4457 y := v.Args[1] 4458 v.reset(OpRsh64x64) 4459 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64) 4460 v0.AddArg(x) 4461 v.AddArg(v0) 4462 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) 4463 v1.AddArg(y) 4464 v.AddArg(v1) 4465 return true 4466 } 4467 } 4468 func rewriteValueWasm_OpRsh8x64_0(v *Value) bool { 4469 b := v.Block 4470 _ = b 4471 typ := &b.Func.Config.Types 4472 _ = typ 4473 // match: (Rsh8x64 x y) 4474 // cond: 4475 // result: (Rsh64x64 (SignExt8to64 x) y) 4476 for { 4477 _ = v.Args[1] 4478 x := v.Args[0] 4479 y := v.Args[1] 4480 v.reset(OpRsh64x64) 4481 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64) 4482 v0.AddArg(x) 4483 v.AddArg(v0) 4484 v.AddArg(y) 4485 return true 4486 } 4487 } 4488 func rewriteValueWasm_OpRsh8x8_0(v *Value) bool { 4489 b := v.Block 4490 _ = b 4491 typ := &b.Func.Config.Types 4492 _ = typ 4493 // match: (Rsh8x8 x y) 4494 // cond: 4495 // result: (Rsh64x64 (SignExt8to64 x) (ZeroExt8to64 y)) 4496 for { 4497 _ = v.Args[1] 4498 x := v.Args[0] 4499 y := v.Args[1] 4500 v.reset(OpRsh64x64) 4501 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64) 4502 v0.AddArg(x) 4503 v.AddArg(v0) 4504 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) 4505 v1.AddArg(y) 4506 v.AddArg(v1) 4507 return true 4508 } 4509 } 4510 func rewriteValueWasm_OpSignExt16to32_0(v *Value) bool { 4511 b := v.Block 4512 _ = b 4513 typ := &b.Func.Config.Types 4514 _ = typ 4515 // match: (SignExt16to32 x:(I64Load16S _ _)) 4516 // cond: 4517 // result: x 4518 for { 4519 x := v.Args[0] 4520 if x.Op != OpWasmI64Load16S { 4521 break 4522 } 4523 _ = x.Args[1] 4524 v.reset(OpCopy) 4525 v.Type = x.Type 4526 v.AddArg(x) 4527 return true 4528 } 4529 // match: (SignExt16to32 x) 4530 // cond: 4531 // result: (I64ShrS (I64Shl x (I64Const [48])) (I64Const [48])) 4532 for { 4533 x := v.Args[0] 4534 v.reset(OpWasmI64ShrS) 4535 v0 := b.NewValue0(v.Pos, OpWasmI64Shl, typ.Int64) 4536 v0.AddArg(x) 4537 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 4538 v1.AuxInt = 48 4539 v0.AddArg(v1) 4540 v.AddArg(v0) 4541 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 4542 v2.AuxInt = 48 4543 v.AddArg(v2) 4544 return true 4545 } 4546 } 4547 func rewriteValueWasm_OpSignExt16to64_0(v *Value) bool { 4548 b := v.Block 4549 _ = b 4550 typ := &b.Func.Config.Types 4551 _ = typ 4552 // match: (SignExt16to64 x:(I64Load16S _ _)) 4553 // cond: 4554 // result: x 4555 for { 4556 x := v.Args[0] 4557 if x.Op != OpWasmI64Load16S { 4558 break 4559 } 4560 _ = x.Args[1] 4561 v.reset(OpCopy) 4562 v.Type = x.Type 4563 v.AddArg(x) 4564 return true 4565 } 4566 // match: (SignExt16to64 x) 4567 // cond: 4568 // result: (I64ShrS (I64Shl x (I64Const [48])) (I64Const [48])) 4569 for { 4570 x := v.Args[0] 4571 v.reset(OpWasmI64ShrS) 4572 v0 := b.NewValue0(v.Pos, OpWasmI64Shl, typ.Int64) 4573 v0.AddArg(x) 4574 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 4575 v1.AuxInt = 48 4576 v0.AddArg(v1) 4577 v.AddArg(v0) 4578 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 4579 v2.AuxInt = 48 4580 v.AddArg(v2) 4581 return true 4582 } 4583 } 4584 func rewriteValueWasm_OpSignExt32to64_0(v *Value) bool { 4585 b := v.Block 4586 _ = b 4587 typ := &b.Func.Config.Types 4588 _ = typ 4589 // match: (SignExt32to64 x:(I64Load32S _ _)) 4590 // cond: 4591 // result: x 4592 for { 4593 x := v.Args[0] 4594 if x.Op != OpWasmI64Load32S { 4595 break 4596 } 4597 _ = x.Args[1] 4598 v.reset(OpCopy) 4599 v.Type = x.Type 4600 v.AddArg(x) 4601 return true 4602 } 4603 // match: (SignExt32to64 x) 4604 // cond: 4605 // result: (I64ShrS (I64Shl x (I64Const [32])) (I64Const [32])) 4606 for { 4607 x := v.Args[0] 4608 v.reset(OpWasmI64ShrS) 4609 v0 := b.NewValue0(v.Pos, OpWasmI64Shl, typ.Int64) 4610 v0.AddArg(x) 4611 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 4612 v1.AuxInt = 32 4613 v0.AddArg(v1) 4614 v.AddArg(v0) 4615 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 4616 v2.AuxInt = 32 4617 v.AddArg(v2) 4618 return true 4619 } 4620 } 4621 func rewriteValueWasm_OpSignExt8to16_0(v *Value) bool { 4622 b := v.Block 4623 _ = b 4624 typ := &b.Func.Config.Types 4625 _ = typ 4626 // match: (SignExt8to16 x:(I64Load8S _ _)) 4627 // cond: 4628 // result: x 4629 for { 4630 x := v.Args[0] 4631 if x.Op != OpWasmI64Load8S { 4632 break 4633 } 4634 _ = x.Args[1] 4635 v.reset(OpCopy) 4636 v.Type = x.Type 4637 v.AddArg(x) 4638 return true 4639 } 4640 // match: (SignExt8to16 x) 4641 // cond: 4642 // result: (I64ShrS (I64Shl x (I64Const [56])) (I64Const [56])) 4643 for { 4644 x := v.Args[0] 4645 v.reset(OpWasmI64ShrS) 4646 v0 := b.NewValue0(v.Pos, OpWasmI64Shl, typ.Int64) 4647 v0.AddArg(x) 4648 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 4649 v1.AuxInt = 56 4650 v0.AddArg(v1) 4651 v.AddArg(v0) 4652 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 4653 v2.AuxInt = 56 4654 v.AddArg(v2) 4655 return true 4656 } 4657 } 4658 func rewriteValueWasm_OpSignExt8to32_0(v *Value) bool { 4659 b := v.Block 4660 _ = b 4661 typ := &b.Func.Config.Types 4662 _ = typ 4663 // match: (SignExt8to32 x:(I64Load8S _ _)) 4664 // cond: 4665 // result: x 4666 for { 4667 x := v.Args[0] 4668 if x.Op != OpWasmI64Load8S { 4669 break 4670 } 4671 _ = x.Args[1] 4672 v.reset(OpCopy) 4673 v.Type = x.Type 4674 v.AddArg(x) 4675 return true 4676 } 4677 // match: (SignExt8to32 x) 4678 // cond: 4679 // result: (I64ShrS (I64Shl x (I64Const [56])) (I64Const [56])) 4680 for { 4681 x := v.Args[0] 4682 v.reset(OpWasmI64ShrS) 4683 v0 := b.NewValue0(v.Pos, OpWasmI64Shl, typ.Int64) 4684 v0.AddArg(x) 4685 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 4686 v1.AuxInt = 56 4687 v0.AddArg(v1) 4688 v.AddArg(v0) 4689 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 4690 v2.AuxInt = 56 4691 v.AddArg(v2) 4692 return true 4693 } 4694 } 4695 func rewriteValueWasm_OpSignExt8to64_0(v *Value) bool { 4696 b := v.Block 4697 _ = b 4698 typ := &b.Func.Config.Types 4699 _ = typ 4700 // match: (SignExt8to64 x:(I64Load8S _ _)) 4701 // cond: 4702 // result: x 4703 for { 4704 x := v.Args[0] 4705 if x.Op != OpWasmI64Load8S { 4706 break 4707 } 4708 _ = x.Args[1] 4709 v.reset(OpCopy) 4710 v.Type = x.Type 4711 v.AddArg(x) 4712 return true 4713 } 4714 // match: (SignExt8to64 x) 4715 // cond: 4716 // result: (I64ShrS (I64Shl x (I64Const [56])) (I64Const [56])) 4717 for { 4718 x := v.Args[0] 4719 v.reset(OpWasmI64ShrS) 4720 v0 := b.NewValue0(v.Pos, OpWasmI64Shl, typ.Int64) 4721 v0.AddArg(x) 4722 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 4723 v1.AuxInt = 56 4724 v0.AddArg(v1) 4725 v.AddArg(v0) 4726 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 4727 v2.AuxInt = 56 4728 v.AddArg(v2) 4729 return true 4730 } 4731 } 4732 func rewriteValueWasm_OpSlicemask_0(v *Value) bool { 4733 b := v.Block 4734 _ = b 4735 typ := &b.Func.Config.Types 4736 _ = typ 4737 // match: (Slicemask x) 4738 // cond: 4739 // result: (I64ShrS (I64Sub (I64Const [0]) x) (I64Const [63])) 4740 for { 4741 x := v.Args[0] 4742 v.reset(OpWasmI64ShrS) 4743 v0 := b.NewValue0(v.Pos, OpWasmI64Sub, typ.Int64) 4744 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 4745 v1.AuxInt = 0 4746 v0.AddArg(v1) 4747 v0.AddArg(x) 4748 v.AddArg(v0) 4749 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 4750 v2.AuxInt = 63 4751 v.AddArg(v2) 4752 return true 4753 } 4754 } 4755 func rewriteValueWasm_OpStaticCall_0(v *Value) bool { 4756 // match: (StaticCall [argwid] {target} mem) 4757 // cond: 4758 // result: (LoweredStaticCall [argwid] {target} mem) 4759 for { 4760 argwid := v.AuxInt 4761 target := v.Aux 4762 mem := v.Args[0] 4763 v.reset(OpWasmLoweredStaticCall) 4764 v.AuxInt = argwid 4765 v.Aux = target 4766 v.AddArg(mem) 4767 return true 4768 } 4769 } 4770 func rewriteValueWasm_OpStore_0(v *Value) bool { 4771 // match: (Store {t} ptr val mem) 4772 // cond: is64BitFloat(t.(*types.Type)) 4773 // result: (F64Store ptr val mem) 4774 for { 4775 t := v.Aux 4776 _ = v.Args[2] 4777 ptr := v.Args[0] 4778 val := v.Args[1] 4779 mem := v.Args[2] 4780 if !(is64BitFloat(t.(*types.Type))) { 4781 break 4782 } 4783 v.reset(OpWasmF64Store) 4784 v.AddArg(ptr) 4785 v.AddArg(val) 4786 v.AddArg(mem) 4787 return true 4788 } 4789 // match: (Store {t} ptr val mem) 4790 // cond: is32BitFloat(t.(*types.Type)) 4791 // result: (F32Store ptr val mem) 4792 for { 4793 t := v.Aux 4794 _ = v.Args[2] 4795 ptr := v.Args[0] 4796 val := v.Args[1] 4797 mem := v.Args[2] 4798 if !(is32BitFloat(t.(*types.Type))) { 4799 break 4800 } 4801 v.reset(OpWasmF32Store) 4802 v.AddArg(ptr) 4803 v.AddArg(val) 4804 v.AddArg(mem) 4805 return true 4806 } 4807 // match: (Store {t} ptr val mem) 4808 // cond: t.(*types.Type).Size() == 8 4809 // result: (I64Store ptr val mem) 4810 for { 4811 t := v.Aux 4812 _ = v.Args[2] 4813 ptr := v.Args[0] 4814 val := v.Args[1] 4815 mem := v.Args[2] 4816 if !(t.(*types.Type).Size() == 8) { 4817 break 4818 } 4819 v.reset(OpWasmI64Store) 4820 v.AddArg(ptr) 4821 v.AddArg(val) 4822 v.AddArg(mem) 4823 return true 4824 } 4825 // match: (Store {t} ptr val mem) 4826 // cond: t.(*types.Type).Size() == 4 4827 // result: (I64Store32 ptr val mem) 4828 for { 4829 t := v.Aux 4830 _ = v.Args[2] 4831 ptr := v.Args[0] 4832 val := v.Args[1] 4833 mem := v.Args[2] 4834 if !(t.(*types.Type).Size() == 4) { 4835 break 4836 } 4837 v.reset(OpWasmI64Store32) 4838 v.AddArg(ptr) 4839 v.AddArg(val) 4840 v.AddArg(mem) 4841 return true 4842 } 4843 // match: (Store {t} ptr val mem) 4844 // cond: t.(*types.Type).Size() == 2 4845 // result: (I64Store16 ptr val mem) 4846 for { 4847 t := v.Aux 4848 _ = v.Args[2] 4849 ptr := v.Args[0] 4850 val := v.Args[1] 4851 mem := v.Args[2] 4852 if !(t.(*types.Type).Size() == 2) { 4853 break 4854 } 4855 v.reset(OpWasmI64Store16) 4856 v.AddArg(ptr) 4857 v.AddArg(val) 4858 v.AddArg(mem) 4859 return true 4860 } 4861 // match: (Store {t} ptr val mem) 4862 // cond: t.(*types.Type).Size() == 1 4863 // result: (I64Store8 ptr val mem) 4864 for { 4865 t := v.Aux 4866 _ = v.Args[2] 4867 ptr := v.Args[0] 4868 val := v.Args[1] 4869 mem := v.Args[2] 4870 if !(t.(*types.Type).Size() == 1) { 4871 break 4872 } 4873 v.reset(OpWasmI64Store8) 4874 v.AddArg(ptr) 4875 v.AddArg(val) 4876 v.AddArg(mem) 4877 return true 4878 } 4879 return false 4880 } 4881 func rewriteValueWasm_OpSub16_0(v *Value) bool { 4882 // match: (Sub16 x y) 4883 // cond: 4884 // result: (I64Sub x y) 4885 for { 4886 _ = v.Args[1] 4887 x := v.Args[0] 4888 y := v.Args[1] 4889 v.reset(OpWasmI64Sub) 4890 v.AddArg(x) 4891 v.AddArg(y) 4892 return true 4893 } 4894 } 4895 func rewriteValueWasm_OpSub32_0(v *Value) bool { 4896 // match: (Sub32 x y) 4897 // cond: 4898 // result: (I64Sub x y) 4899 for { 4900 _ = v.Args[1] 4901 x := v.Args[0] 4902 y := v.Args[1] 4903 v.reset(OpWasmI64Sub) 4904 v.AddArg(x) 4905 v.AddArg(y) 4906 return true 4907 } 4908 } 4909 func rewriteValueWasm_OpSub32F_0(v *Value) bool { 4910 // match: (Sub32F x y) 4911 // cond: 4912 // result: (F64Sub x y) 4913 for { 4914 _ = v.Args[1] 4915 x := v.Args[0] 4916 y := v.Args[1] 4917 v.reset(OpWasmF64Sub) 4918 v.AddArg(x) 4919 v.AddArg(y) 4920 return true 4921 } 4922 } 4923 func rewriteValueWasm_OpSub64_0(v *Value) bool { 4924 // match: (Sub64 x y) 4925 // cond: 4926 // result: (I64Sub x y) 4927 for { 4928 _ = v.Args[1] 4929 x := v.Args[0] 4930 y := v.Args[1] 4931 v.reset(OpWasmI64Sub) 4932 v.AddArg(x) 4933 v.AddArg(y) 4934 return true 4935 } 4936 } 4937 func rewriteValueWasm_OpSub64F_0(v *Value) bool { 4938 // match: (Sub64F x y) 4939 // cond: 4940 // result: (F64Sub x y) 4941 for { 4942 _ = v.Args[1] 4943 x := v.Args[0] 4944 y := v.Args[1] 4945 v.reset(OpWasmF64Sub) 4946 v.AddArg(x) 4947 v.AddArg(y) 4948 return true 4949 } 4950 } 4951 func rewriteValueWasm_OpSub8_0(v *Value) bool { 4952 // match: (Sub8 x y) 4953 // cond: 4954 // result: (I64Sub x y) 4955 for { 4956 _ = v.Args[1] 4957 x := v.Args[0] 4958 y := v.Args[1] 4959 v.reset(OpWasmI64Sub) 4960 v.AddArg(x) 4961 v.AddArg(y) 4962 return true 4963 } 4964 } 4965 func rewriteValueWasm_OpSubPtr_0(v *Value) bool { 4966 // match: (SubPtr x y) 4967 // cond: 4968 // result: (I64Sub x y) 4969 for { 4970 _ = v.Args[1] 4971 x := v.Args[0] 4972 y := v.Args[1] 4973 v.reset(OpWasmI64Sub) 4974 v.AddArg(x) 4975 v.AddArg(y) 4976 return true 4977 } 4978 } 4979 func rewriteValueWasm_OpTrunc16to8_0(v *Value) bool { 4980 // match: (Trunc16to8 x) 4981 // cond: 4982 // result: x 4983 for { 4984 x := v.Args[0] 4985 v.reset(OpCopy) 4986 v.Type = x.Type 4987 v.AddArg(x) 4988 return true 4989 } 4990 } 4991 func rewriteValueWasm_OpTrunc32to16_0(v *Value) bool { 4992 // match: (Trunc32to16 x) 4993 // cond: 4994 // result: x 4995 for { 4996 x := v.Args[0] 4997 v.reset(OpCopy) 4998 v.Type = x.Type 4999 v.AddArg(x) 5000 return true 5001 } 5002 } 5003 func rewriteValueWasm_OpTrunc32to8_0(v *Value) bool { 5004 // match: (Trunc32to8 x) 5005 // cond: 5006 // result: x 5007 for { 5008 x := v.Args[0] 5009 v.reset(OpCopy) 5010 v.Type = x.Type 5011 v.AddArg(x) 5012 return true 5013 } 5014 } 5015 func rewriteValueWasm_OpTrunc64to16_0(v *Value) bool { 5016 // match: (Trunc64to16 x) 5017 // cond: 5018 // result: x 5019 for { 5020 x := v.Args[0] 5021 v.reset(OpCopy) 5022 v.Type = x.Type 5023 v.AddArg(x) 5024 return true 5025 } 5026 } 5027 func rewriteValueWasm_OpTrunc64to32_0(v *Value) bool { 5028 // match: (Trunc64to32 x) 5029 // cond: 5030 // result: x 5031 for { 5032 x := v.Args[0] 5033 v.reset(OpCopy) 5034 v.Type = x.Type 5035 v.AddArg(x) 5036 return true 5037 } 5038 } 5039 func rewriteValueWasm_OpTrunc64to8_0(v *Value) bool { 5040 // match: (Trunc64to8 x) 5041 // cond: 5042 // result: x 5043 for { 5044 x := v.Args[0] 5045 v.reset(OpCopy) 5046 v.Type = x.Type 5047 v.AddArg(x) 5048 return true 5049 } 5050 } 5051 func rewriteValueWasm_OpWB_0(v *Value) bool { 5052 // match: (WB {fn} destptr srcptr mem) 5053 // cond: 5054 // result: (LoweredWB {fn} destptr srcptr mem) 5055 for { 5056 fn := v.Aux 5057 _ = v.Args[2] 5058 destptr := v.Args[0] 5059 srcptr := v.Args[1] 5060 mem := v.Args[2] 5061 v.reset(OpWasmLoweredWB) 5062 v.Aux = fn 5063 v.AddArg(destptr) 5064 v.AddArg(srcptr) 5065 v.AddArg(mem) 5066 return true 5067 } 5068 } 5069 func rewriteValueWasm_OpWasmF64Add_0(v *Value) bool { 5070 b := v.Block 5071 _ = b 5072 typ := &b.Func.Config.Types 5073 _ = typ 5074 // match: (F64Add (F64Const [x]) (F64Const [y])) 5075 // cond: 5076 // result: (F64Const [auxFrom64F(auxTo64F(x) + auxTo64F(y))]) 5077 for { 5078 _ = v.Args[1] 5079 v_0 := v.Args[0] 5080 if v_0.Op != OpWasmF64Const { 5081 break 5082 } 5083 x := v_0.AuxInt 5084 v_1 := v.Args[1] 5085 if v_1.Op != OpWasmF64Const { 5086 break 5087 } 5088 y := v_1.AuxInt 5089 v.reset(OpWasmF64Const) 5090 v.AuxInt = auxFrom64F(auxTo64F(x) + auxTo64F(y)) 5091 return true 5092 } 5093 // match: (F64Add (F64Const [x]) y) 5094 // cond: 5095 // result: (F64Add y (F64Const [x])) 5096 for { 5097 _ = v.Args[1] 5098 v_0 := v.Args[0] 5099 if v_0.Op != OpWasmF64Const { 5100 break 5101 } 5102 x := v_0.AuxInt 5103 y := v.Args[1] 5104 v.reset(OpWasmF64Add) 5105 v.AddArg(y) 5106 v0 := b.NewValue0(v.Pos, OpWasmF64Const, typ.Float64) 5107 v0.AuxInt = x 5108 v.AddArg(v0) 5109 return true 5110 } 5111 return false 5112 } 5113 func rewriteValueWasm_OpWasmF64Mul_0(v *Value) bool { 5114 b := v.Block 5115 _ = b 5116 typ := &b.Func.Config.Types 5117 _ = typ 5118 // match: (F64Mul (F64Const [x]) (F64Const [y])) 5119 // cond: 5120 // result: (F64Const [auxFrom64F(auxTo64F(x) * auxTo64F(y))]) 5121 for { 5122 _ = v.Args[1] 5123 v_0 := v.Args[0] 5124 if v_0.Op != OpWasmF64Const { 5125 break 5126 } 5127 x := v_0.AuxInt 5128 v_1 := v.Args[1] 5129 if v_1.Op != OpWasmF64Const { 5130 break 5131 } 5132 y := v_1.AuxInt 5133 v.reset(OpWasmF64Const) 5134 v.AuxInt = auxFrom64F(auxTo64F(x) * auxTo64F(y)) 5135 return true 5136 } 5137 // match: (F64Mul (F64Const [x]) y) 5138 // cond: 5139 // result: (F64Mul y (F64Const [x])) 5140 for { 5141 _ = v.Args[1] 5142 v_0 := v.Args[0] 5143 if v_0.Op != OpWasmF64Const { 5144 break 5145 } 5146 x := v_0.AuxInt 5147 y := v.Args[1] 5148 v.reset(OpWasmF64Mul) 5149 v.AddArg(y) 5150 v0 := b.NewValue0(v.Pos, OpWasmF64Const, typ.Float64) 5151 v0.AuxInt = x 5152 v.AddArg(v0) 5153 return true 5154 } 5155 return false 5156 } 5157 func rewriteValueWasm_OpWasmI64Add_0(v *Value) bool { 5158 b := v.Block 5159 _ = b 5160 typ := &b.Func.Config.Types 5161 _ = typ 5162 // match: (I64Add (I64Const [x]) (I64Const [y])) 5163 // cond: 5164 // result: (I64Const [x + y]) 5165 for { 5166 _ = v.Args[1] 5167 v_0 := v.Args[0] 5168 if v_0.Op != OpWasmI64Const { 5169 break 5170 } 5171 x := v_0.AuxInt 5172 v_1 := v.Args[1] 5173 if v_1.Op != OpWasmI64Const { 5174 break 5175 } 5176 y := v_1.AuxInt 5177 v.reset(OpWasmI64Const) 5178 v.AuxInt = x + y 5179 return true 5180 } 5181 // match: (I64Add (I64Const [x]) y) 5182 // cond: 5183 // result: (I64Add y (I64Const [x])) 5184 for { 5185 _ = v.Args[1] 5186 v_0 := v.Args[0] 5187 if v_0.Op != OpWasmI64Const { 5188 break 5189 } 5190 x := v_0.AuxInt 5191 y := v.Args[1] 5192 v.reset(OpWasmI64Add) 5193 v.AddArg(y) 5194 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 5195 v0.AuxInt = x 5196 v.AddArg(v0) 5197 return true 5198 } 5199 // match: (I64Add x (I64Const [y])) 5200 // cond: 5201 // result: (I64AddConst [y] x) 5202 for { 5203 _ = v.Args[1] 5204 x := v.Args[0] 5205 v_1 := v.Args[1] 5206 if v_1.Op != OpWasmI64Const { 5207 break 5208 } 5209 y := v_1.AuxInt 5210 v.reset(OpWasmI64AddConst) 5211 v.AuxInt = y 5212 v.AddArg(x) 5213 return true 5214 } 5215 return false 5216 } 5217 func rewriteValueWasm_OpWasmI64AddConst_0(v *Value) bool { 5218 // match: (I64AddConst [0] x) 5219 // cond: 5220 // result: x 5221 for { 5222 if v.AuxInt != 0 { 5223 break 5224 } 5225 x := v.Args[0] 5226 v.reset(OpCopy) 5227 v.Type = x.Type 5228 v.AddArg(x) 5229 return true 5230 } 5231 // match: (I64AddConst [off] (LoweredAddr {sym} [off2] base)) 5232 // cond: isU32Bit(off+off2) 5233 // result: (LoweredAddr {sym} [off+off2] base) 5234 for { 5235 off := v.AuxInt 5236 v_0 := v.Args[0] 5237 if v_0.Op != OpWasmLoweredAddr { 5238 break 5239 } 5240 off2 := v_0.AuxInt 5241 sym := v_0.Aux 5242 base := v_0.Args[0] 5243 if !(isU32Bit(off + off2)) { 5244 break 5245 } 5246 v.reset(OpWasmLoweredAddr) 5247 v.AuxInt = off + off2 5248 v.Aux = sym 5249 v.AddArg(base) 5250 return true 5251 } 5252 return false 5253 } 5254 func rewriteValueWasm_OpWasmI64And_0(v *Value) bool { 5255 b := v.Block 5256 _ = b 5257 typ := &b.Func.Config.Types 5258 _ = typ 5259 // match: (I64And (I64Const [x]) (I64Const [y])) 5260 // cond: 5261 // result: (I64Const [x & y]) 5262 for { 5263 _ = v.Args[1] 5264 v_0 := v.Args[0] 5265 if v_0.Op != OpWasmI64Const { 5266 break 5267 } 5268 x := v_0.AuxInt 5269 v_1 := v.Args[1] 5270 if v_1.Op != OpWasmI64Const { 5271 break 5272 } 5273 y := v_1.AuxInt 5274 v.reset(OpWasmI64Const) 5275 v.AuxInt = x & y 5276 return true 5277 } 5278 // match: (I64And (I64Const [x]) y) 5279 // cond: 5280 // result: (I64And y (I64Const [x])) 5281 for { 5282 _ = v.Args[1] 5283 v_0 := v.Args[0] 5284 if v_0.Op != OpWasmI64Const { 5285 break 5286 } 5287 x := v_0.AuxInt 5288 y := v.Args[1] 5289 v.reset(OpWasmI64And) 5290 v.AddArg(y) 5291 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 5292 v0.AuxInt = x 5293 v.AddArg(v0) 5294 return true 5295 } 5296 return false 5297 } 5298 func rewriteValueWasm_OpWasmI64Eq_0(v *Value) bool { 5299 b := v.Block 5300 _ = b 5301 typ := &b.Func.Config.Types 5302 _ = typ 5303 // match: (I64Eq (I64Const [x]) (I64Const [y])) 5304 // cond: x == y 5305 // result: (I64Const [1]) 5306 for { 5307 _ = v.Args[1] 5308 v_0 := v.Args[0] 5309 if v_0.Op != OpWasmI64Const { 5310 break 5311 } 5312 x := v_0.AuxInt 5313 v_1 := v.Args[1] 5314 if v_1.Op != OpWasmI64Const { 5315 break 5316 } 5317 y := v_1.AuxInt 5318 if !(x == y) { 5319 break 5320 } 5321 v.reset(OpWasmI64Const) 5322 v.AuxInt = 1 5323 return true 5324 } 5325 // match: (I64Eq (I64Const [x]) (I64Const [y])) 5326 // cond: x != y 5327 // result: (I64Const [0]) 5328 for { 5329 _ = v.Args[1] 5330 v_0 := v.Args[0] 5331 if v_0.Op != OpWasmI64Const { 5332 break 5333 } 5334 x := v_0.AuxInt 5335 v_1 := v.Args[1] 5336 if v_1.Op != OpWasmI64Const { 5337 break 5338 } 5339 y := v_1.AuxInt 5340 if !(x != y) { 5341 break 5342 } 5343 v.reset(OpWasmI64Const) 5344 v.AuxInt = 0 5345 return true 5346 } 5347 // match: (I64Eq (I64Const [x]) y) 5348 // cond: 5349 // result: (I64Eq y (I64Const [x])) 5350 for { 5351 _ = v.Args[1] 5352 v_0 := v.Args[0] 5353 if v_0.Op != OpWasmI64Const { 5354 break 5355 } 5356 x := v_0.AuxInt 5357 y := v.Args[1] 5358 v.reset(OpWasmI64Eq) 5359 v.AddArg(y) 5360 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 5361 v0.AuxInt = x 5362 v.AddArg(v0) 5363 return true 5364 } 5365 // match: (I64Eq x (I64Const [0])) 5366 // cond: 5367 // result: (I64Eqz x) 5368 for { 5369 _ = v.Args[1] 5370 x := v.Args[0] 5371 v_1 := v.Args[1] 5372 if v_1.Op != OpWasmI64Const { 5373 break 5374 } 5375 if v_1.AuxInt != 0 { 5376 break 5377 } 5378 v.reset(OpWasmI64Eqz) 5379 v.AddArg(x) 5380 return true 5381 } 5382 return false 5383 } 5384 func rewriteValueWasm_OpWasmI64Eqz_0(v *Value) bool { 5385 // match: (I64Eqz (I64Eqz (I64Eqz x))) 5386 // cond: 5387 // result: (I64Eqz x) 5388 for { 5389 v_0 := v.Args[0] 5390 if v_0.Op != OpWasmI64Eqz { 5391 break 5392 } 5393 v_0_0 := v_0.Args[0] 5394 if v_0_0.Op != OpWasmI64Eqz { 5395 break 5396 } 5397 x := v_0_0.Args[0] 5398 v.reset(OpWasmI64Eqz) 5399 v.AddArg(x) 5400 return true 5401 } 5402 return false 5403 } 5404 func rewriteValueWasm_OpWasmI64Load_0(v *Value) bool { 5405 // match: (I64Load [off] (I64AddConst [off2] ptr) mem) 5406 // cond: isU32Bit(off+off2) 5407 // result: (I64Load [off+off2] ptr mem) 5408 for { 5409 off := v.AuxInt 5410 _ = v.Args[1] 5411 v_0 := v.Args[0] 5412 if v_0.Op != OpWasmI64AddConst { 5413 break 5414 } 5415 off2 := v_0.AuxInt 5416 ptr := v_0.Args[0] 5417 mem := v.Args[1] 5418 if !(isU32Bit(off + off2)) { 5419 break 5420 } 5421 v.reset(OpWasmI64Load) 5422 v.AuxInt = off + off2 5423 v.AddArg(ptr) 5424 v.AddArg(mem) 5425 return true 5426 } 5427 return false 5428 } 5429 func rewriteValueWasm_OpWasmI64Load16S_0(v *Value) bool { 5430 // match: (I64Load16S [off] (I64AddConst [off2] ptr) mem) 5431 // cond: isU32Bit(off+off2) 5432 // result: (I64Load16S [off+off2] ptr mem) 5433 for { 5434 off := v.AuxInt 5435 _ = v.Args[1] 5436 v_0 := v.Args[0] 5437 if v_0.Op != OpWasmI64AddConst { 5438 break 5439 } 5440 off2 := v_0.AuxInt 5441 ptr := v_0.Args[0] 5442 mem := v.Args[1] 5443 if !(isU32Bit(off + off2)) { 5444 break 5445 } 5446 v.reset(OpWasmI64Load16S) 5447 v.AuxInt = off + off2 5448 v.AddArg(ptr) 5449 v.AddArg(mem) 5450 return true 5451 } 5452 return false 5453 } 5454 func rewriteValueWasm_OpWasmI64Load16U_0(v *Value) bool { 5455 // match: (I64Load16U [off] (I64AddConst [off2] ptr) mem) 5456 // cond: isU32Bit(off+off2) 5457 // result: (I64Load16U [off+off2] ptr mem) 5458 for { 5459 off := v.AuxInt 5460 _ = v.Args[1] 5461 v_0 := v.Args[0] 5462 if v_0.Op != OpWasmI64AddConst { 5463 break 5464 } 5465 off2 := v_0.AuxInt 5466 ptr := v_0.Args[0] 5467 mem := v.Args[1] 5468 if !(isU32Bit(off + off2)) { 5469 break 5470 } 5471 v.reset(OpWasmI64Load16U) 5472 v.AuxInt = off + off2 5473 v.AddArg(ptr) 5474 v.AddArg(mem) 5475 return true 5476 } 5477 return false 5478 } 5479 func rewriteValueWasm_OpWasmI64Load32S_0(v *Value) bool { 5480 // match: (I64Load32S [off] (I64AddConst [off2] ptr) mem) 5481 // cond: isU32Bit(off+off2) 5482 // result: (I64Load32S [off+off2] ptr mem) 5483 for { 5484 off := v.AuxInt 5485 _ = v.Args[1] 5486 v_0 := v.Args[0] 5487 if v_0.Op != OpWasmI64AddConst { 5488 break 5489 } 5490 off2 := v_0.AuxInt 5491 ptr := v_0.Args[0] 5492 mem := v.Args[1] 5493 if !(isU32Bit(off + off2)) { 5494 break 5495 } 5496 v.reset(OpWasmI64Load32S) 5497 v.AuxInt = off + off2 5498 v.AddArg(ptr) 5499 v.AddArg(mem) 5500 return true 5501 } 5502 return false 5503 } 5504 func rewriteValueWasm_OpWasmI64Load32U_0(v *Value) bool { 5505 // match: (I64Load32U [off] (I64AddConst [off2] ptr) mem) 5506 // cond: isU32Bit(off+off2) 5507 // result: (I64Load32U [off+off2] ptr mem) 5508 for { 5509 off := v.AuxInt 5510 _ = v.Args[1] 5511 v_0 := v.Args[0] 5512 if v_0.Op != OpWasmI64AddConst { 5513 break 5514 } 5515 off2 := v_0.AuxInt 5516 ptr := v_0.Args[0] 5517 mem := v.Args[1] 5518 if !(isU32Bit(off + off2)) { 5519 break 5520 } 5521 v.reset(OpWasmI64Load32U) 5522 v.AuxInt = off + off2 5523 v.AddArg(ptr) 5524 v.AddArg(mem) 5525 return true 5526 } 5527 return false 5528 } 5529 func rewriteValueWasm_OpWasmI64Load8S_0(v *Value) bool { 5530 // match: (I64Load8S [off] (I64AddConst [off2] ptr) mem) 5531 // cond: isU32Bit(off+off2) 5532 // result: (I64Load8S [off+off2] ptr mem) 5533 for { 5534 off := v.AuxInt 5535 _ = v.Args[1] 5536 v_0 := v.Args[0] 5537 if v_0.Op != OpWasmI64AddConst { 5538 break 5539 } 5540 off2 := v_0.AuxInt 5541 ptr := v_0.Args[0] 5542 mem := v.Args[1] 5543 if !(isU32Bit(off + off2)) { 5544 break 5545 } 5546 v.reset(OpWasmI64Load8S) 5547 v.AuxInt = off + off2 5548 v.AddArg(ptr) 5549 v.AddArg(mem) 5550 return true 5551 } 5552 return false 5553 } 5554 func rewriteValueWasm_OpWasmI64Load8U_0(v *Value) bool { 5555 // match: (I64Load8U [off] (I64AddConst [off2] ptr) mem) 5556 // cond: isU32Bit(off+off2) 5557 // result: (I64Load8U [off+off2] ptr mem) 5558 for { 5559 off := v.AuxInt 5560 _ = v.Args[1] 5561 v_0 := v.Args[0] 5562 if v_0.Op != OpWasmI64AddConst { 5563 break 5564 } 5565 off2 := v_0.AuxInt 5566 ptr := v_0.Args[0] 5567 mem := v.Args[1] 5568 if !(isU32Bit(off + off2)) { 5569 break 5570 } 5571 v.reset(OpWasmI64Load8U) 5572 v.AuxInt = off + off2 5573 v.AddArg(ptr) 5574 v.AddArg(mem) 5575 return true 5576 } 5577 return false 5578 } 5579 func rewriteValueWasm_OpWasmI64Mul_0(v *Value) bool { 5580 b := v.Block 5581 _ = b 5582 typ := &b.Func.Config.Types 5583 _ = typ 5584 // match: (I64Mul (I64Const [x]) (I64Const [y])) 5585 // cond: 5586 // result: (I64Const [x * y]) 5587 for { 5588 _ = v.Args[1] 5589 v_0 := v.Args[0] 5590 if v_0.Op != OpWasmI64Const { 5591 break 5592 } 5593 x := v_0.AuxInt 5594 v_1 := v.Args[1] 5595 if v_1.Op != OpWasmI64Const { 5596 break 5597 } 5598 y := v_1.AuxInt 5599 v.reset(OpWasmI64Const) 5600 v.AuxInt = x * y 5601 return true 5602 } 5603 // match: (I64Mul (I64Const [x]) y) 5604 // cond: 5605 // result: (I64Mul y (I64Const [x])) 5606 for { 5607 _ = v.Args[1] 5608 v_0 := v.Args[0] 5609 if v_0.Op != OpWasmI64Const { 5610 break 5611 } 5612 x := v_0.AuxInt 5613 y := v.Args[1] 5614 v.reset(OpWasmI64Mul) 5615 v.AddArg(y) 5616 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 5617 v0.AuxInt = x 5618 v.AddArg(v0) 5619 return true 5620 } 5621 return false 5622 } 5623 func rewriteValueWasm_OpWasmI64Ne_0(v *Value) bool { 5624 b := v.Block 5625 _ = b 5626 typ := &b.Func.Config.Types 5627 _ = typ 5628 // match: (I64Ne (I64Const [x]) (I64Const [y])) 5629 // cond: x == y 5630 // result: (I64Const [0]) 5631 for { 5632 _ = v.Args[1] 5633 v_0 := v.Args[0] 5634 if v_0.Op != OpWasmI64Const { 5635 break 5636 } 5637 x := v_0.AuxInt 5638 v_1 := v.Args[1] 5639 if v_1.Op != OpWasmI64Const { 5640 break 5641 } 5642 y := v_1.AuxInt 5643 if !(x == y) { 5644 break 5645 } 5646 v.reset(OpWasmI64Const) 5647 v.AuxInt = 0 5648 return true 5649 } 5650 // match: (I64Ne (I64Const [x]) (I64Const [y])) 5651 // cond: x != y 5652 // result: (I64Const [1]) 5653 for { 5654 _ = v.Args[1] 5655 v_0 := v.Args[0] 5656 if v_0.Op != OpWasmI64Const { 5657 break 5658 } 5659 x := v_0.AuxInt 5660 v_1 := v.Args[1] 5661 if v_1.Op != OpWasmI64Const { 5662 break 5663 } 5664 y := v_1.AuxInt 5665 if !(x != y) { 5666 break 5667 } 5668 v.reset(OpWasmI64Const) 5669 v.AuxInt = 1 5670 return true 5671 } 5672 // match: (I64Ne (I64Const [x]) y) 5673 // cond: 5674 // result: (I64Ne y (I64Const [x])) 5675 for { 5676 _ = v.Args[1] 5677 v_0 := v.Args[0] 5678 if v_0.Op != OpWasmI64Const { 5679 break 5680 } 5681 x := v_0.AuxInt 5682 y := v.Args[1] 5683 v.reset(OpWasmI64Ne) 5684 v.AddArg(y) 5685 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 5686 v0.AuxInt = x 5687 v.AddArg(v0) 5688 return true 5689 } 5690 // match: (I64Ne x (I64Const [0])) 5691 // cond: 5692 // result: (I64Eqz (I64Eqz x)) 5693 for { 5694 _ = v.Args[1] 5695 x := v.Args[0] 5696 v_1 := v.Args[1] 5697 if v_1.Op != OpWasmI64Const { 5698 break 5699 } 5700 if v_1.AuxInt != 0 { 5701 break 5702 } 5703 v.reset(OpWasmI64Eqz) 5704 v0 := b.NewValue0(v.Pos, OpWasmI64Eqz, typ.Bool) 5705 v0.AddArg(x) 5706 v.AddArg(v0) 5707 return true 5708 } 5709 return false 5710 } 5711 func rewriteValueWasm_OpWasmI64Or_0(v *Value) bool { 5712 b := v.Block 5713 _ = b 5714 typ := &b.Func.Config.Types 5715 _ = typ 5716 // match: (I64Or (I64Const [x]) (I64Const [y])) 5717 // cond: 5718 // result: (I64Const [x | y]) 5719 for { 5720 _ = v.Args[1] 5721 v_0 := v.Args[0] 5722 if v_0.Op != OpWasmI64Const { 5723 break 5724 } 5725 x := v_0.AuxInt 5726 v_1 := v.Args[1] 5727 if v_1.Op != OpWasmI64Const { 5728 break 5729 } 5730 y := v_1.AuxInt 5731 v.reset(OpWasmI64Const) 5732 v.AuxInt = x | y 5733 return true 5734 } 5735 // match: (I64Or (I64Const [x]) y) 5736 // cond: 5737 // result: (I64Or y (I64Const [x])) 5738 for { 5739 _ = v.Args[1] 5740 v_0 := v.Args[0] 5741 if v_0.Op != OpWasmI64Const { 5742 break 5743 } 5744 x := v_0.AuxInt 5745 y := v.Args[1] 5746 v.reset(OpWasmI64Or) 5747 v.AddArg(y) 5748 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 5749 v0.AuxInt = x 5750 v.AddArg(v0) 5751 return true 5752 } 5753 return false 5754 } 5755 func rewriteValueWasm_OpWasmI64Shl_0(v *Value) bool { 5756 // match: (I64Shl (I64Const [x]) (I64Const [y])) 5757 // cond: 5758 // result: (I64Const [x << uint64(y)]) 5759 for { 5760 _ = v.Args[1] 5761 v_0 := v.Args[0] 5762 if v_0.Op != OpWasmI64Const { 5763 break 5764 } 5765 x := v_0.AuxInt 5766 v_1 := v.Args[1] 5767 if v_1.Op != OpWasmI64Const { 5768 break 5769 } 5770 y := v_1.AuxInt 5771 v.reset(OpWasmI64Const) 5772 v.AuxInt = x << uint64(y) 5773 return true 5774 } 5775 return false 5776 } 5777 func rewriteValueWasm_OpWasmI64ShrS_0(v *Value) bool { 5778 // match: (I64ShrS (I64Const [x]) (I64Const [y])) 5779 // cond: 5780 // result: (I64Const [x >> uint64(y)]) 5781 for { 5782 _ = v.Args[1] 5783 v_0 := v.Args[0] 5784 if v_0.Op != OpWasmI64Const { 5785 break 5786 } 5787 x := v_0.AuxInt 5788 v_1 := v.Args[1] 5789 if v_1.Op != OpWasmI64Const { 5790 break 5791 } 5792 y := v_1.AuxInt 5793 v.reset(OpWasmI64Const) 5794 v.AuxInt = x >> uint64(y) 5795 return true 5796 } 5797 return false 5798 } 5799 func rewriteValueWasm_OpWasmI64ShrU_0(v *Value) bool { 5800 // match: (I64ShrU (I64Const [x]) (I64Const [y])) 5801 // cond: 5802 // result: (I64Const [int64(uint64(x) >> uint64(y))]) 5803 for { 5804 _ = v.Args[1] 5805 v_0 := v.Args[0] 5806 if v_0.Op != OpWasmI64Const { 5807 break 5808 } 5809 x := v_0.AuxInt 5810 v_1 := v.Args[1] 5811 if v_1.Op != OpWasmI64Const { 5812 break 5813 } 5814 y := v_1.AuxInt 5815 v.reset(OpWasmI64Const) 5816 v.AuxInt = int64(uint64(x) >> uint64(y)) 5817 return true 5818 } 5819 return false 5820 } 5821 func rewriteValueWasm_OpWasmI64Store_0(v *Value) bool { 5822 // match: (I64Store [off] (I64AddConst [off2] ptr) val mem) 5823 // cond: isU32Bit(off+off2) 5824 // result: (I64Store [off+off2] ptr val mem) 5825 for { 5826 off := v.AuxInt 5827 _ = v.Args[2] 5828 v_0 := v.Args[0] 5829 if v_0.Op != OpWasmI64AddConst { 5830 break 5831 } 5832 off2 := v_0.AuxInt 5833 ptr := v_0.Args[0] 5834 val := v.Args[1] 5835 mem := v.Args[2] 5836 if !(isU32Bit(off + off2)) { 5837 break 5838 } 5839 v.reset(OpWasmI64Store) 5840 v.AuxInt = off + off2 5841 v.AddArg(ptr) 5842 v.AddArg(val) 5843 v.AddArg(mem) 5844 return true 5845 } 5846 return false 5847 } 5848 func rewriteValueWasm_OpWasmI64Store16_0(v *Value) bool { 5849 // match: (I64Store16 [off] (I64AddConst [off2] ptr) val mem) 5850 // cond: isU32Bit(off+off2) 5851 // result: (I64Store16 [off+off2] ptr val mem) 5852 for { 5853 off := v.AuxInt 5854 _ = v.Args[2] 5855 v_0 := v.Args[0] 5856 if v_0.Op != OpWasmI64AddConst { 5857 break 5858 } 5859 off2 := v_0.AuxInt 5860 ptr := v_0.Args[0] 5861 val := v.Args[1] 5862 mem := v.Args[2] 5863 if !(isU32Bit(off + off2)) { 5864 break 5865 } 5866 v.reset(OpWasmI64Store16) 5867 v.AuxInt = off + off2 5868 v.AddArg(ptr) 5869 v.AddArg(val) 5870 v.AddArg(mem) 5871 return true 5872 } 5873 return false 5874 } 5875 func rewriteValueWasm_OpWasmI64Store32_0(v *Value) bool { 5876 // match: (I64Store32 [off] (I64AddConst [off2] ptr) val mem) 5877 // cond: isU32Bit(off+off2) 5878 // result: (I64Store32 [off+off2] ptr val mem) 5879 for { 5880 off := v.AuxInt 5881 _ = v.Args[2] 5882 v_0 := v.Args[0] 5883 if v_0.Op != OpWasmI64AddConst { 5884 break 5885 } 5886 off2 := v_0.AuxInt 5887 ptr := v_0.Args[0] 5888 val := v.Args[1] 5889 mem := v.Args[2] 5890 if !(isU32Bit(off + off2)) { 5891 break 5892 } 5893 v.reset(OpWasmI64Store32) 5894 v.AuxInt = off + off2 5895 v.AddArg(ptr) 5896 v.AddArg(val) 5897 v.AddArg(mem) 5898 return true 5899 } 5900 return false 5901 } 5902 func rewriteValueWasm_OpWasmI64Store8_0(v *Value) bool { 5903 // match: (I64Store8 [off] (I64AddConst [off2] ptr) val mem) 5904 // cond: isU32Bit(off+off2) 5905 // result: (I64Store8 [off+off2] ptr val mem) 5906 for { 5907 off := v.AuxInt 5908 _ = v.Args[2] 5909 v_0 := v.Args[0] 5910 if v_0.Op != OpWasmI64AddConst { 5911 break 5912 } 5913 off2 := v_0.AuxInt 5914 ptr := v_0.Args[0] 5915 val := v.Args[1] 5916 mem := v.Args[2] 5917 if !(isU32Bit(off + off2)) { 5918 break 5919 } 5920 v.reset(OpWasmI64Store8) 5921 v.AuxInt = off + off2 5922 v.AddArg(ptr) 5923 v.AddArg(val) 5924 v.AddArg(mem) 5925 return true 5926 } 5927 return false 5928 } 5929 func rewriteValueWasm_OpWasmI64Xor_0(v *Value) bool { 5930 b := v.Block 5931 _ = b 5932 typ := &b.Func.Config.Types 5933 _ = typ 5934 // match: (I64Xor (I64Const [x]) (I64Const [y])) 5935 // cond: 5936 // result: (I64Const [x ^ y]) 5937 for { 5938 _ = v.Args[1] 5939 v_0 := v.Args[0] 5940 if v_0.Op != OpWasmI64Const { 5941 break 5942 } 5943 x := v_0.AuxInt 5944 v_1 := v.Args[1] 5945 if v_1.Op != OpWasmI64Const { 5946 break 5947 } 5948 y := v_1.AuxInt 5949 v.reset(OpWasmI64Const) 5950 v.AuxInt = x ^ y 5951 return true 5952 } 5953 // match: (I64Xor (I64Const [x]) y) 5954 // cond: 5955 // result: (I64Xor y (I64Const [x])) 5956 for { 5957 _ = v.Args[1] 5958 v_0 := v.Args[0] 5959 if v_0.Op != OpWasmI64Const { 5960 break 5961 } 5962 x := v_0.AuxInt 5963 y := v.Args[1] 5964 v.reset(OpWasmI64Xor) 5965 v.AddArg(y) 5966 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 5967 v0.AuxInt = x 5968 v.AddArg(v0) 5969 return true 5970 } 5971 return false 5972 } 5973 func rewriteValueWasm_OpXor16_0(v *Value) bool { 5974 // match: (Xor16 x y) 5975 // cond: 5976 // result: (I64Xor x y) 5977 for { 5978 _ = v.Args[1] 5979 x := v.Args[0] 5980 y := v.Args[1] 5981 v.reset(OpWasmI64Xor) 5982 v.AddArg(x) 5983 v.AddArg(y) 5984 return true 5985 } 5986 } 5987 func rewriteValueWasm_OpXor32_0(v *Value) bool { 5988 // match: (Xor32 x y) 5989 // cond: 5990 // result: (I64Xor x y) 5991 for { 5992 _ = v.Args[1] 5993 x := v.Args[0] 5994 y := v.Args[1] 5995 v.reset(OpWasmI64Xor) 5996 v.AddArg(x) 5997 v.AddArg(y) 5998 return true 5999 } 6000 } 6001 func rewriteValueWasm_OpXor64_0(v *Value) bool { 6002 // match: (Xor64 x y) 6003 // cond: 6004 // result: (I64Xor x y) 6005 for { 6006 _ = v.Args[1] 6007 x := v.Args[0] 6008 y := v.Args[1] 6009 v.reset(OpWasmI64Xor) 6010 v.AddArg(x) 6011 v.AddArg(y) 6012 return true 6013 } 6014 } 6015 func rewriteValueWasm_OpXor8_0(v *Value) bool { 6016 // match: (Xor8 x y) 6017 // cond: 6018 // result: (I64Xor x y) 6019 for { 6020 _ = v.Args[1] 6021 x := v.Args[0] 6022 y := v.Args[1] 6023 v.reset(OpWasmI64Xor) 6024 v.AddArg(x) 6025 v.AddArg(y) 6026 return true 6027 } 6028 } 6029 func rewriteValueWasm_OpZero_0(v *Value) bool { 6030 b := v.Block 6031 _ = b 6032 typ := &b.Func.Config.Types 6033 _ = typ 6034 // match: (Zero [0] _ mem) 6035 // cond: 6036 // result: mem 6037 for { 6038 if v.AuxInt != 0 { 6039 break 6040 } 6041 _ = v.Args[1] 6042 mem := v.Args[1] 6043 v.reset(OpCopy) 6044 v.Type = mem.Type 6045 v.AddArg(mem) 6046 return true 6047 } 6048 // match: (Zero [1] destptr mem) 6049 // cond: 6050 // result: (I64Store8 destptr (I64Const [0]) mem) 6051 for { 6052 if v.AuxInt != 1 { 6053 break 6054 } 6055 _ = v.Args[1] 6056 destptr := v.Args[0] 6057 mem := v.Args[1] 6058 v.reset(OpWasmI64Store8) 6059 v.AddArg(destptr) 6060 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6061 v0.AuxInt = 0 6062 v.AddArg(v0) 6063 v.AddArg(mem) 6064 return true 6065 } 6066 // match: (Zero [2] destptr mem) 6067 // cond: 6068 // result: (I64Store16 destptr (I64Const [0]) mem) 6069 for { 6070 if v.AuxInt != 2 { 6071 break 6072 } 6073 _ = v.Args[1] 6074 destptr := v.Args[0] 6075 mem := v.Args[1] 6076 v.reset(OpWasmI64Store16) 6077 v.AddArg(destptr) 6078 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6079 v0.AuxInt = 0 6080 v.AddArg(v0) 6081 v.AddArg(mem) 6082 return true 6083 } 6084 // match: (Zero [4] destptr mem) 6085 // cond: 6086 // result: (I64Store32 destptr (I64Const [0]) mem) 6087 for { 6088 if v.AuxInt != 4 { 6089 break 6090 } 6091 _ = v.Args[1] 6092 destptr := v.Args[0] 6093 mem := v.Args[1] 6094 v.reset(OpWasmI64Store32) 6095 v.AddArg(destptr) 6096 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6097 v0.AuxInt = 0 6098 v.AddArg(v0) 6099 v.AddArg(mem) 6100 return true 6101 } 6102 // match: (Zero [8] destptr mem) 6103 // cond: 6104 // result: (I64Store destptr (I64Const [0]) mem) 6105 for { 6106 if v.AuxInt != 8 { 6107 break 6108 } 6109 _ = v.Args[1] 6110 destptr := v.Args[0] 6111 mem := v.Args[1] 6112 v.reset(OpWasmI64Store) 6113 v.AddArg(destptr) 6114 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6115 v0.AuxInt = 0 6116 v.AddArg(v0) 6117 v.AddArg(mem) 6118 return true 6119 } 6120 // match: (Zero [3] destptr mem) 6121 // cond: 6122 // result: (I64Store8 [2] destptr (I64Const [0]) (I64Store16 destptr (I64Const [0]) mem)) 6123 for { 6124 if v.AuxInt != 3 { 6125 break 6126 } 6127 _ = v.Args[1] 6128 destptr := v.Args[0] 6129 mem := v.Args[1] 6130 v.reset(OpWasmI64Store8) 6131 v.AuxInt = 2 6132 v.AddArg(destptr) 6133 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6134 v0.AuxInt = 0 6135 v.AddArg(v0) 6136 v1 := b.NewValue0(v.Pos, OpWasmI64Store16, types.TypeMem) 6137 v1.AddArg(destptr) 6138 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6139 v2.AuxInt = 0 6140 v1.AddArg(v2) 6141 v1.AddArg(mem) 6142 v.AddArg(v1) 6143 return true 6144 } 6145 // match: (Zero [5] destptr mem) 6146 // cond: 6147 // result: (I64Store8 [4] destptr (I64Const [0]) (I64Store32 destptr (I64Const [0]) mem)) 6148 for { 6149 if v.AuxInt != 5 { 6150 break 6151 } 6152 _ = v.Args[1] 6153 destptr := v.Args[0] 6154 mem := v.Args[1] 6155 v.reset(OpWasmI64Store8) 6156 v.AuxInt = 4 6157 v.AddArg(destptr) 6158 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6159 v0.AuxInt = 0 6160 v.AddArg(v0) 6161 v1 := b.NewValue0(v.Pos, OpWasmI64Store32, types.TypeMem) 6162 v1.AddArg(destptr) 6163 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6164 v2.AuxInt = 0 6165 v1.AddArg(v2) 6166 v1.AddArg(mem) 6167 v.AddArg(v1) 6168 return true 6169 } 6170 // match: (Zero [6] destptr mem) 6171 // cond: 6172 // result: (I64Store16 [4] destptr (I64Const [0]) (I64Store32 destptr (I64Const [0]) mem)) 6173 for { 6174 if v.AuxInt != 6 { 6175 break 6176 } 6177 _ = v.Args[1] 6178 destptr := v.Args[0] 6179 mem := v.Args[1] 6180 v.reset(OpWasmI64Store16) 6181 v.AuxInt = 4 6182 v.AddArg(destptr) 6183 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6184 v0.AuxInt = 0 6185 v.AddArg(v0) 6186 v1 := b.NewValue0(v.Pos, OpWasmI64Store32, types.TypeMem) 6187 v1.AddArg(destptr) 6188 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6189 v2.AuxInt = 0 6190 v1.AddArg(v2) 6191 v1.AddArg(mem) 6192 v.AddArg(v1) 6193 return true 6194 } 6195 // match: (Zero [7] destptr mem) 6196 // cond: 6197 // result: (I64Store32 [3] destptr (I64Const [0]) (I64Store32 destptr (I64Const [0]) mem)) 6198 for { 6199 if v.AuxInt != 7 { 6200 break 6201 } 6202 _ = v.Args[1] 6203 destptr := v.Args[0] 6204 mem := v.Args[1] 6205 v.reset(OpWasmI64Store32) 6206 v.AuxInt = 3 6207 v.AddArg(destptr) 6208 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6209 v0.AuxInt = 0 6210 v.AddArg(v0) 6211 v1 := b.NewValue0(v.Pos, OpWasmI64Store32, types.TypeMem) 6212 v1.AddArg(destptr) 6213 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6214 v2.AuxInt = 0 6215 v1.AddArg(v2) 6216 v1.AddArg(mem) 6217 v.AddArg(v1) 6218 return true 6219 } 6220 // match: (Zero [s] destptr mem) 6221 // cond: s%8 != 0 && s > 8 6222 // result: (Zero [s-s%8] (OffPtr <destptr.Type> destptr [s%8]) (I64Store destptr (I64Const [0]) mem)) 6223 for { 6224 s := v.AuxInt 6225 _ = v.Args[1] 6226 destptr := v.Args[0] 6227 mem := v.Args[1] 6228 if !(s%8 != 0 && s > 8) { 6229 break 6230 } 6231 v.reset(OpZero) 6232 v.AuxInt = s - s%8 6233 v0 := b.NewValue0(v.Pos, OpOffPtr, destptr.Type) 6234 v0.AuxInt = s % 8 6235 v0.AddArg(destptr) 6236 v.AddArg(v0) 6237 v1 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem) 6238 v1.AddArg(destptr) 6239 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6240 v2.AuxInt = 0 6241 v1.AddArg(v2) 6242 v1.AddArg(mem) 6243 v.AddArg(v1) 6244 return true 6245 } 6246 return false 6247 } 6248 func rewriteValueWasm_OpZero_10(v *Value) bool { 6249 b := v.Block 6250 _ = b 6251 typ := &b.Func.Config.Types 6252 _ = typ 6253 // match: (Zero [16] destptr mem) 6254 // cond: 6255 // result: (I64Store [8] destptr (I64Const [0]) (I64Store destptr (I64Const [0]) mem)) 6256 for { 6257 if v.AuxInt != 16 { 6258 break 6259 } 6260 _ = v.Args[1] 6261 destptr := v.Args[0] 6262 mem := v.Args[1] 6263 v.reset(OpWasmI64Store) 6264 v.AuxInt = 8 6265 v.AddArg(destptr) 6266 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6267 v0.AuxInt = 0 6268 v.AddArg(v0) 6269 v1 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem) 6270 v1.AddArg(destptr) 6271 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6272 v2.AuxInt = 0 6273 v1.AddArg(v2) 6274 v1.AddArg(mem) 6275 v.AddArg(v1) 6276 return true 6277 } 6278 // match: (Zero [24] destptr mem) 6279 // cond: 6280 // result: (I64Store [16] destptr (I64Const [0]) (I64Store [8] destptr (I64Const [0]) (I64Store destptr (I64Const [0]) mem))) 6281 for { 6282 if v.AuxInt != 24 { 6283 break 6284 } 6285 _ = v.Args[1] 6286 destptr := v.Args[0] 6287 mem := v.Args[1] 6288 v.reset(OpWasmI64Store) 6289 v.AuxInt = 16 6290 v.AddArg(destptr) 6291 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6292 v0.AuxInt = 0 6293 v.AddArg(v0) 6294 v1 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem) 6295 v1.AuxInt = 8 6296 v1.AddArg(destptr) 6297 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6298 v2.AuxInt = 0 6299 v1.AddArg(v2) 6300 v3 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem) 6301 v3.AddArg(destptr) 6302 v4 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6303 v4.AuxInt = 0 6304 v3.AddArg(v4) 6305 v3.AddArg(mem) 6306 v1.AddArg(v3) 6307 v.AddArg(v1) 6308 return true 6309 } 6310 // match: (Zero [32] destptr mem) 6311 // cond: 6312 // result: (I64Store [24] destptr (I64Const [0]) (I64Store [16] destptr (I64Const [0]) (I64Store [8] destptr (I64Const [0]) (I64Store destptr (I64Const [0]) mem)))) 6313 for { 6314 if v.AuxInt != 32 { 6315 break 6316 } 6317 _ = v.Args[1] 6318 destptr := v.Args[0] 6319 mem := v.Args[1] 6320 v.reset(OpWasmI64Store) 6321 v.AuxInt = 24 6322 v.AddArg(destptr) 6323 v0 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6324 v0.AuxInt = 0 6325 v.AddArg(v0) 6326 v1 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem) 6327 v1.AuxInt = 16 6328 v1.AddArg(destptr) 6329 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6330 v2.AuxInt = 0 6331 v1.AddArg(v2) 6332 v3 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem) 6333 v3.AuxInt = 8 6334 v3.AddArg(destptr) 6335 v4 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6336 v4.AuxInt = 0 6337 v3.AddArg(v4) 6338 v5 := b.NewValue0(v.Pos, OpWasmI64Store, types.TypeMem) 6339 v5.AddArg(destptr) 6340 v6 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6341 v6.AuxInt = 0 6342 v5.AddArg(v6) 6343 v5.AddArg(mem) 6344 v3.AddArg(v5) 6345 v1.AddArg(v3) 6346 v.AddArg(v1) 6347 return true 6348 } 6349 // match: (Zero [s] destptr mem) 6350 // cond: s%8 == 0 && s > 32 6351 // result: (LoweredZero [s/8] destptr mem) 6352 for { 6353 s := v.AuxInt 6354 _ = v.Args[1] 6355 destptr := v.Args[0] 6356 mem := v.Args[1] 6357 if !(s%8 == 0 && s > 32) { 6358 break 6359 } 6360 v.reset(OpWasmLoweredZero) 6361 v.AuxInt = s / 8 6362 v.AddArg(destptr) 6363 v.AddArg(mem) 6364 return true 6365 } 6366 return false 6367 } 6368 func rewriteValueWasm_OpZeroExt16to32_0(v *Value) bool { 6369 b := v.Block 6370 _ = b 6371 typ := &b.Func.Config.Types 6372 _ = typ 6373 // match: (ZeroExt16to32 x:(I64Load16U _ _)) 6374 // cond: 6375 // result: x 6376 for { 6377 x := v.Args[0] 6378 if x.Op != OpWasmI64Load16U { 6379 break 6380 } 6381 _ = x.Args[1] 6382 v.reset(OpCopy) 6383 v.Type = x.Type 6384 v.AddArg(x) 6385 return true 6386 } 6387 // match: (ZeroExt16to32 x) 6388 // cond: 6389 // result: (I64ShrU (I64Shl x (I64Const [48])) (I64Const [48])) 6390 for { 6391 x := v.Args[0] 6392 v.reset(OpWasmI64ShrU) 6393 v0 := b.NewValue0(v.Pos, OpWasmI64Shl, typ.Int64) 6394 v0.AddArg(x) 6395 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6396 v1.AuxInt = 48 6397 v0.AddArg(v1) 6398 v.AddArg(v0) 6399 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6400 v2.AuxInt = 48 6401 v.AddArg(v2) 6402 return true 6403 } 6404 } 6405 func rewriteValueWasm_OpZeroExt16to64_0(v *Value) bool { 6406 b := v.Block 6407 _ = b 6408 typ := &b.Func.Config.Types 6409 _ = typ 6410 // match: (ZeroExt16to64 x:(I64Load16U _ _)) 6411 // cond: 6412 // result: x 6413 for { 6414 x := v.Args[0] 6415 if x.Op != OpWasmI64Load16U { 6416 break 6417 } 6418 _ = x.Args[1] 6419 v.reset(OpCopy) 6420 v.Type = x.Type 6421 v.AddArg(x) 6422 return true 6423 } 6424 // match: (ZeroExt16to64 x) 6425 // cond: 6426 // result: (I64ShrU (I64Shl x (I64Const [48])) (I64Const [48])) 6427 for { 6428 x := v.Args[0] 6429 v.reset(OpWasmI64ShrU) 6430 v0 := b.NewValue0(v.Pos, OpWasmI64Shl, typ.Int64) 6431 v0.AddArg(x) 6432 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6433 v1.AuxInt = 48 6434 v0.AddArg(v1) 6435 v.AddArg(v0) 6436 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6437 v2.AuxInt = 48 6438 v.AddArg(v2) 6439 return true 6440 } 6441 } 6442 func rewriteValueWasm_OpZeroExt32to64_0(v *Value) bool { 6443 b := v.Block 6444 _ = b 6445 typ := &b.Func.Config.Types 6446 _ = typ 6447 // match: (ZeroExt32to64 x:(I64Load32U _ _)) 6448 // cond: 6449 // result: x 6450 for { 6451 x := v.Args[0] 6452 if x.Op != OpWasmI64Load32U { 6453 break 6454 } 6455 _ = x.Args[1] 6456 v.reset(OpCopy) 6457 v.Type = x.Type 6458 v.AddArg(x) 6459 return true 6460 } 6461 // match: (ZeroExt32to64 x) 6462 // cond: 6463 // result: (I64ShrU (I64Shl x (I64Const [32])) (I64Const [32])) 6464 for { 6465 x := v.Args[0] 6466 v.reset(OpWasmI64ShrU) 6467 v0 := b.NewValue0(v.Pos, OpWasmI64Shl, typ.Int64) 6468 v0.AddArg(x) 6469 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6470 v1.AuxInt = 32 6471 v0.AddArg(v1) 6472 v.AddArg(v0) 6473 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6474 v2.AuxInt = 32 6475 v.AddArg(v2) 6476 return true 6477 } 6478 } 6479 func rewriteValueWasm_OpZeroExt8to16_0(v *Value) bool { 6480 b := v.Block 6481 _ = b 6482 typ := &b.Func.Config.Types 6483 _ = typ 6484 // match: (ZeroExt8to16 x:(I64Load8U _ _)) 6485 // cond: 6486 // result: x 6487 for { 6488 x := v.Args[0] 6489 if x.Op != OpWasmI64Load8U { 6490 break 6491 } 6492 _ = x.Args[1] 6493 v.reset(OpCopy) 6494 v.Type = x.Type 6495 v.AddArg(x) 6496 return true 6497 } 6498 // match: (ZeroExt8to16 x) 6499 // cond: 6500 // result: (I64ShrU (I64Shl x (I64Const [56])) (I64Const [56])) 6501 for { 6502 x := v.Args[0] 6503 v.reset(OpWasmI64ShrU) 6504 v0 := b.NewValue0(v.Pos, OpWasmI64Shl, typ.Int64) 6505 v0.AddArg(x) 6506 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6507 v1.AuxInt = 56 6508 v0.AddArg(v1) 6509 v.AddArg(v0) 6510 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6511 v2.AuxInt = 56 6512 v.AddArg(v2) 6513 return true 6514 } 6515 } 6516 func rewriteValueWasm_OpZeroExt8to32_0(v *Value) bool { 6517 b := v.Block 6518 _ = b 6519 typ := &b.Func.Config.Types 6520 _ = typ 6521 // match: (ZeroExt8to32 x:(I64Load8U _ _)) 6522 // cond: 6523 // result: x 6524 for { 6525 x := v.Args[0] 6526 if x.Op != OpWasmI64Load8U { 6527 break 6528 } 6529 _ = x.Args[1] 6530 v.reset(OpCopy) 6531 v.Type = x.Type 6532 v.AddArg(x) 6533 return true 6534 } 6535 // match: (ZeroExt8to32 x) 6536 // cond: 6537 // result: (I64ShrU (I64Shl x (I64Const [56])) (I64Const [56])) 6538 for { 6539 x := v.Args[0] 6540 v.reset(OpWasmI64ShrU) 6541 v0 := b.NewValue0(v.Pos, OpWasmI64Shl, typ.Int64) 6542 v0.AddArg(x) 6543 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6544 v1.AuxInt = 56 6545 v0.AddArg(v1) 6546 v.AddArg(v0) 6547 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6548 v2.AuxInt = 56 6549 v.AddArg(v2) 6550 return true 6551 } 6552 } 6553 func rewriteValueWasm_OpZeroExt8to64_0(v *Value) bool { 6554 b := v.Block 6555 _ = b 6556 typ := &b.Func.Config.Types 6557 _ = typ 6558 // match: (ZeroExt8to64 x:(I64Load8U _ _)) 6559 // cond: 6560 // result: x 6561 for { 6562 x := v.Args[0] 6563 if x.Op != OpWasmI64Load8U { 6564 break 6565 } 6566 _ = x.Args[1] 6567 v.reset(OpCopy) 6568 v.Type = x.Type 6569 v.AddArg(x) 6570 return true 6571 } 6572 // match: (ZeroExt8to64 x) 6573 // cond: 6574 // result: (I64ShrU (I64Shl x (I64Const [56])) (I64Const [56])) 6575 for { 6576 x := v.Args[0] 6577 v.reset(OpWasmI64ShrU) 6578 v0 := b.NewValue0(v.Pos, OpWasmI64Shl, typ.Int64) 6579 v0.AddArg(x) 6580 v1 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6581 v1.AuxInt = 56 6582 v0.AddArg(v1) 6583 v.AddArg(v0) 6584 v2 := b.NewValue0(v.Pos, OpWasmI64Const, typ.Int64) 6585 v2.AuxInt = 56 6586 v.AddArg(v2) 6587 return true 6588 } 6589 } 6590 func rewriteBlockWasm(b *Block) bool { 6591 config := b.Func.Config 6592 _ = config 6593 fe := b.Func.fe 6594 _ = fe 6595 typ := &config.Types 6596 _ = typ 6597 switch b.Kind { 6598 } 6599 return false 6600 }