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