From ccb95b6492ad6e7a7d1a7fda896baee4caffb3b4 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Thu, 23 Jan 2020 17:45:54 -0800 Subject: [PATCH] cmd/compile: preserve shift boundness during wasm rewrite rules MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Mostly for clarity. There are nominal improvements to the generated code: file before after Δ % addr2line 4742769 4742639 -130 -0.003% api 6973284 6973209 -75 -0.001% asm 5922230 5922127 -103 -0.002% buildid 3117327 3117252 -75 -0.002% cgo 5539274 5539199 -75 -0.001% compile 27423605 27424940 +1335 +0.005% cover 6096973 6096898 -75 -0.001% dist 4121655 4121580 -75 -0.002% doc 5386254 5386179 -75 -0.001% fix 3755243 3755168 -75 -0.002% link 7602682 7602607 -75 -0.001% nm 4687186 4687056 -130 -0.003% objdump 5184883 5184753 -130 -0.003% pack 2511360 2511285 -75 -0.003% pprof 16872050 16871832 -218 -0.001% test2json 3060633 3060558 -75 -0.002% trace 13170181 13170018 -163 -0.001% vet 9865995 9865920 -75 -0.001% total 151188868 151188504 -364 -0.000% Change-Id: If765e3661549d183a2dbb44e83521c4a3f61d175 Reviewed-on: https://go-review.googlesource.com/c/go/+/216998 Run-TryBot: Josh Bleecher Snyder Reviewed-by: Cherry Zhang --- src/cmd/compile/internal/ssa/gen/Wasm.rules | 42 +-- src/cmd/compile/internal/ssa/rewriteWasm.go | 270 +++++++++++++------- 2 files changed, 201 insertions(+), 111 deletions(-) diff --git a/src/cmd/compile/internal/ssa/gen/Wasm.rules b/src/cmd/compile/internal/ssa/gen/Wasm.rules index e66a46d1b5..a65bf19d9c 100644 --- a/src/cmd/compile/internal/ssa/gen/Wasm.rules +++ b/src/cmd/compile/internal/ssa/gen/Wasm.rules @@ -101,31 +101,31 @@ (Lsh64x64 x (I64Const [c])) && uint64(c) < 64 -> (I64Shl x (I64Const [c])) (Lsh64x64 x (I64Const [c])) && uint64(c) >= 64 -> (I64Const [0]) (Lsh64x64 x y) -> (Select (I64Shl x y) (I64Const [0]) (I64LtU y (I64Const [64]))) -(Lsh64x(32|16|8) x y) -> (Lsh64x64 x (ZeroExt(32|16|8)to64 y)) +(Lsh64x(32|16|8) [c] x y) -> (Lsh64x64 [c] x (ZeroExt(32|16|8)to64 y)) -(Lsh32x64 x y) -> (Lsh64x64 x y) -(Lsh32x(32|16|8) x y) -> (Lsh64x64 x (ZeroExt(32|16|8)to64 y)) +(Lsh32x64 [c] x y) -> (Lsh64x64 [c] x y) +(Lsh32x(32|16|8) [c] x y) -> (Lsh64x64 [c] x (ZeroExt(32|16|8)to64 y)) -(Lsh16x64 x y) -> (Lsh64x64 x y) -(Lsh16x(32|16|8) x y) -> (Lsh64x64 x (ZeroExt(32|16|8)to64 y)) +(Lsh16x64 [c] x y) -> (Lsh64x64 [c] x y) +(Lsh16x(32|16|8) [c] x y) -> (Lsh64x64 [c] x (ZeroExt(32|16|8)to64 y)) -(Lsh8x64 x y) -> (Lsh64x64 x y) -(Lsh8x(32|16|8) x y) -> (Lsh64x64 x (ZeroExt(32|16|8)to64 y)) +(Lsh8x64 [c] x y) -> (Lsh64x64 [c] x y) +(Lsh8x(32|16|8) [c] x y) -> (Lsh64x64 [c] x (ZeroExt(32|16|8)to64 y)) (Rsh64Ux64 x y) && shiftIsBounded(v) -> (I64ShrU x y) (Rsh64Ux64 x (I64Const [c])) && uint64(c) < 64 -> (I64ShrU x (I64Const [c])) (Rsh64Ux64 x (I64Const [c])) && uint64(c) >= 64 -> (I64Const [0]) (Rsh64Ux64 x y) -> (Select (I64ShrU x y) (I64Const [0]) (I64LtU y (I64Const [64]))) -(Rsh64Ux(32|16|8) x y) -> (Rsh64Ux64 x (ZeroExt(32|16|8)to64 y)) +(Rsh64Ux(32|16|8) [c] x y) -> (Rsh64Ux64 [c] x (ZeroExt(32|16|8)to64 y)) -(Rsh32Ux64 x y) -> (Rsh64Ux64 (ZeroExt32to64 x) y) -(Rsh32Ux(32|16|8) x y) -> (Rsh64Ux64 (ZeroExt32to64 x) (ZeroExt(32|16|8)to64 y)) +(Rsh32Ux64 [c] x y) -> (Rsh64Ux64 [c] (ZeroExt32to64 x) y) +(Rsh32Ux(32|16|8) [c] x y) -> (Rsh64Ux64 [c] (ZeroExt32to64 x) (ZeroExt(32|16|8)to64 y)) -(Rsh16Ux64 x y) -> (Rsh64Ux64 (ZeroExt16to64 x) y) -(Rsh16Ux(32|16|8) x y) -> (Rsh64Ux64 (ZeroExt16to64 x) (ZeroExt(32|16|8)to64 y)) +(Rsh16Ux64 [c] x y) -> (Rsh64Ux64 [c] (ZeroExt16to64 x) y) +(Rsh16Ux(32|16|8) [c] x y) -> (Rsh64Ux64 [c] (ZeroExt16to64 x) (ZeroExt(32|16|8)to64 y)) -(Rsh8Ux64 x y) -> (Rsh64Ux64 (ZeroExt8to64 x) y) -(Rsh8Ux(32|16|8) x y) -> (Rsh64Ux64 (ZeroExt8to64 x) (ZeroExt(32|16|8)to64 y)) +(Rsh8Ux64 [c] x y) -> (Rsh64Ux64 [c] (ZeroExt8to64 x) y) +(Rsh8Ux(32|16|8) [c] x y) -> (Rsh64Ux64 [c] (ZeroExt8to64 x) (ZeroExt(32|16|8)to64 y)) // Signed right shift needs to return 0/-1 if shift amount is >= width of shifted value. // We implement this by setting the shift value to (width - 1) if the shift value is >= width. @@ -134,16 +134,16 @@ (Rsh64x64 x (I64Const [c])) && uint64(c) < 64 -> (I64ShrS x (I64Const [c])) (Rsh64x64 x (I64Const [c])) && uint64(c) >= 64 -> (I64ShrS x (I64Const [63])) (Rsh64x64 x y) -> (I64ShrS x (Select y (I64Const [63]) (I64LtU y (I64Const [64])))) -(Rsh64x(32|16|8) x y) -> (Rsh64x64 x (ZeroExt(32|16|8)to64 y)) +(Rsh64x(32|16|8) [c] x y) -> (Rsh64x64 [c] x (ZeroExt(32|16|8)to64 y)) -(Rsh32x64 x y) -> (Rsh64x64 (SignExt32to64 x) y) -(Rsh32x(32|16|8) x y) -> (Rsh64x64 (SignExt32to64 x) (ZeroExt(32|16|8)to64 y)) +(Rsh32x64 [c] x y) -> (Rsh64x64 [c] (SignExt32to64 x) y) +(Rsh32x(32|16|8) [c] x y) -> (Rsh64x64 [c] (SignExt32to64 x) (ZeroExt(32|16|8)to64 y)) -(Rsh16x64 x y) -> (Rsh64x64 (SignExt16to64 x) y) -(Rsh16x(32|16|8) x y) -> (Rsh64x64 (SignExt16to64 x) (ZeroExt(32|16|8)to64 y)) +(Rsh16x64 [c] x y) -> (Rsh64x64 [c] (SignExt16to64 x) y) +(Rsh16x(32|16|8) [c] x y) -> (Rsh64x64 [c] (SignExt16to64 x) (ZeroExt(32|16|8)to64 y)) -(Rsh8x64 x y) -> (Rsh64x64 (SignExt8to64 x) y) -(Rsh8x(32|16|8) x y) -> (Rsh64x64 (SignExt8to64 x) (ZeroExt(32|16|8)to64 y)) +(Rsh8x64 [c] x y) -> (Rsh64x64 [c] (SignExt8to64 x) y) +(Rsh8x(32|16|8) [c] x y) -> (Rsh64x64 [c] (SignExt8to64 x) (ZeroExt(32|16|8)to64 y)) // Lowering rotates (RotateLeft8 x (I64Const [c])) -> (Or8 (Lsh8x64 x (I64Const [c&7])) (Rsh8Ux64 x (I64Const [-c&7]))) diff --git a/src/cmd/compile/internal/ssa/rewriteWasm.go b/src/cmd/compile/internal/ssa/rewriteWasm.go index 53d03ad0ca..049b98c8ff 100644 --- a/src/cmd/compile/internal/ssa/rewriteWasm.go +++ b/src/cmd/compile/internal/ssa/rewriteWasm.go @@ -2594,12 +2594,14 @@ func rewriteValueWasm_OpLsh16x16(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Lsh16x16 x y) - // result: (Lsh64x64 x (ZeroExt16to64 y)) + // match: (Lsh16x16 [c] x y) + // result: (Lsh64x64 [c] x (ZeroExt16to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpLsh64x64) + v.AuxInt = c v.AddArg(x) v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) v0.AddArg(y) @@ -2612,12 +2614,14 @@ func rewriteValueWasm_OpLsh16x32(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Lsh16x32 x y) - // result: (Lsh64x64 x (ZeroExt32to64 y)) + // match: (Lsh16x32 [c] x y) + // result: (Lsh64x64 [c] x (ZeroExt32to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpLsh64x64) + v.AuxInt = c v.AddArg(x) v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) v0.AddArg(y) @@ -2628,12 +2632,14 @@ func rewriteValueWasm_OpLsh16x32(v *Value) bool { func rewriteValueWasm_OpLsh16x64(v *Value) bool { v_1 := v.Args[1] v_0 := v.Args[0] - // match: (Lsh16x64 x y) - // result: (Lsh64x64 x y) + // match: (Lsh16x64 [c] x y) + // result: (Lsh64x64 [c] x y) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpLsh64x64) + v.AuxInt = c v.AddArg(x) v.AddArg(y) return true @@ -2644,12 +2650,14 @@ func rewriteValueWasm_OpLsh16x8(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Lsh16x8 x y) - // result: (Lsh64x64 x (ZeroExt8to64 y)) + // match: (Lsh16x8 [c] x y) + // result: (Lsh64x64 [c] x (ZeroExt8to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpLsh64x64) + v.AuxInt = c v.AddArg(x) v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) v0.AddArg(y) @@ -2662,12 +2670,14 @@ func rewriteValueWasm_OpLsh32x16(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Lsh32x16 x y) - // result: (Lsh64x64 x (ZeroExt16to64 y)) + // match: (Lsh32x16 [c] x y) + // result: (Lsh64x64 [c] x (ZeroExt16to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpLsh64x64) + v.AuxInt = c v.AddArg(x) v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) v0.AddArg(y) @@ -2680,12 +2690,14 @@ func rewriteValueWasm_OpLsh32x32(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Lsh32x32 x y) - // result: (Lsh64x64 x (ZeroExt32to64 y)) + // match: (Lsh32x32 [c] x y) + // result: (Lsh64x64 [c] x (ZeroExt32to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpLsh64x64) + v.AuxInt = c v.AddArg(x) v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) v0.AddArg(y) @@ -2696,12 +2708,14 @@ func rewriteValueWasm_OpLsh32x32(v *Value) bool { func rewriteValueWasm_OpLsh32x64(v *Value) bool { v_1 := v.Args[1] v_0 := v.Args[0] - // match: (Lsh32x64 x y) - // result: (Lsh64x64 x y) + // match: (Lsh32x64 [c] x y) + // result: (Lsh64x64 [c] x y) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpLsh64x64) + v.AuxInt = c v.AddArg(x) v.AddArg(y) return true @@ -2712,12 +2726,14 @@ func rewriteValueWasm_OpLsh32x8(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Lsh32x8 x y) - // result: (Lsh64x64 x (ZeroExt8to64 y)) + // match: (Lsh32x8 [c] x y) + // result: (Lsh64x64 [c] x (ZeroExt8to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpLsh64x64) + v.AuxInt = c v.AddArg(x) v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) v0.AddArg(y) @@ -2730,12 +2746,14 @@ func rewriteValueWasm_OpLsh64x16(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Lsh64x16 x y) - // result: (Lsh64x64 x (ZeroExt16to64 y)) + // match: (Lsh64x16 [c] x y) + // result: (Lsh64x64 [c] x (ZeroExt16to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpLsh64x64) + v.AuxInt = c v.AddArg(x) v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) v0.AddArg(y) @@ -2748,12 +2766,14 @@ func rewriteValueWasm_OpLsh64x32(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Lsh64x32 x y) - // result: (Lsh64x64 x (ZeroExt32to64 y)) + // match: (Lsh64x32 [c] x y) + // result: (Lsh64x64 [c] x (ZeroExt32to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpLsh64x64) + v.AuxInt = c v.AddArg(x) v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) v0.AddArg(y) @@ -2841,12 +2861,14 @@ func rewriteValueWasm_OpLsh64x8(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Lsh64x8 x y) - // result: (Lsh64x64 x (ZeroExt8to64 y)) + // match: (Lsh64x8 [c] x y) + // result: (Lsh64x64 [c] x (ZeroExt8to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpLsh64x64) + v.AuxInt = c v.AddArg(x) v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) v0.AddArg(y) @@ -2859,12 +2881,14 @@ func rewriteValueWasm_OpLsh8x16(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Lsh8x16 x y) - // result: (Lsh64x64 x (ZeroExt16to64 y)) + // match: (Lsh8x16 [c] x y) + // result: (Lsh64x64 [c] x (ZeroExt16to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpLsh64x64) + v.AuxInt = c v.AddArg(x) v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) v0.AddArg(y) @@ -2877,12 +2901,14 @@ func rewriteValueWasm_OpLsh8x32(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Lsh8x32 x y) - // result: (Lsh64x64 x (ZeroExt32to64 y)) + // match: (Lsh8x32 [c] x y) + // result: (Lsh64x64 [c] x (ZeroExt32to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpLsh64x64) + v.AuxInt = c v.AddArg(x) v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) v0.AddArg(y) @@ -2893,12 +2919,14 @@ func rewriteValueWasm_OpLsh8x32(v *Value) bool { func rewriteValueWasm_OpLsh8x64(v *Value) bool { v_1 := v.Args[1] v_0 := v.Args[0] - // match: (Lsh8x64 x y) - // result: (Lsh64x64 x y) + // match: (Lsh8x64 [c] x y) + // result: (Lsh64x64 [c] x y) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpLsh64x64) + v.AuxInt = c v.AddArg(x) v.AddArg(y) return true @@ -2909,12 +2937,14 @@ func rewriteValueWasm_OpLsh8x8(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Lsh8x8 x y) - // result: (Lsh64x64 x (ZeroExt8to64 y)) + // match: (Lsh8x8 [c] x y) + // result: (Lsh64x64 [c] x (ZeroExt8to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpLsh64x64) + v.AuxInt = c v.AddArg(x) v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) v0.AddArg(y) @@ -4009,12 +4039,14 @@ func rewriteValueWasm_OpRsh16Ux16(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh16Ux16 x y) - // result: (Rsh64Ux64 (ZeroExt16to64 x) (ZeroExt16to64 y)) + // match: (Rsh16Ux16 [c] x y) + // result: (Rsh64Ux64 [c] (ZeroExt16to64 x) (ZeroExt16to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64Ux64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) v0.AddArg(x) v.AddArg(v0) @@ -4029,12 +4061,14 @@ func rewriteValueWasm_OpRsh16Ux32(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh16Ux32 x y) - // result: (Rsh64Ux64 (ZeroExt16to64 x) (ZeroExt32to64 y)) + // match: (Rsh16Ux32 [c] x y) + // result: (Rsh64Ux64 [c] (ZeroExt16to64 x) (ZeroExt32to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64Ux64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) v0.AddArg(x) v.AddArg(v0) @@ -4049,12 +4083,14 @@ func rewriteValueWasm_OpRsh16Ux64(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh16Ux64 x y) - // result: (Rsh64Ux64 (ZeroExt16to64 x) y) + // match: (Rsh16Ux64 [c] x y) + // result: (Rsh64Ux64 [c] (ZeroExt16to64 x) y) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64Ux64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) v0.AddArg(x) v.AddArg(v0) @@ -4067,12 +4103,14 @@ func rewriteValueWasm_OpRsh16Ux8(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh16Ux8 x y) - // result: (Rsh64Ux64 (ZeroExt16to64 x) (ZeroExt8to64 y)) + // match: (Rsh16Ux8 [c] x y) + // result: (Rsh64Ux64 [c] (ZeroExt16to64 x) (ZeroExt8to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64Ux64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) v0.AddArg(x) v.AddArg(v0) @@ -4087,12 +4125,14 @@ func rewriteValueWasm_OpRsh16x16(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh16x16 x y) - // result: (Rsh64x64 (SignExt16to64 x) (ZeroExt16to64 y)) + // match: (Rsh16x16 [c] x y) + // result: (Rsh64x64 [c] (SignExt16to64 x) (ZeroExt16to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64x64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64) v0.AddArg(x) v.AddArg(v0) @@ -4107,12 +4147,14 @@ func rewriteValueWasm_OpRsh16x32(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh16x32 x y) - // result: (Rsh64x64 (SignExt16to64 x) (ZeroExt32to64 y)) + // match: (Rsh16x32 [c] x y) + // result: (Rsh64x64 [c] (SignExt16to64 x) (ZeroExt32to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64x64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64) v0.AddArg(x) v.AddArg(v0) @@ -4127,12 +4169,14 @@ func rewriteValueWasm_OpRsh16x64(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh16x64 x y) - // result: (Rsh64x64 (SignExt16to64 x) y) + // match: (Rsh16x64 [c] x y) + // result: (Rsh64x64 [c] (SignExt16to64 x) y) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64x64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64) v0.AddArg(x) v.AddArg(v0) @@ -4145,12 +4189,14 @@ func rewriteValueWasm_OpRsh16x8(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh16x8 x y) - // result: (Rsh64x64 (SignExt16to64 x) (ZeroExt8to64 y)) + // match: (Rsh16x8 [c] x y) + // result: (Rsh64x64 [c] (SignExt16to64 x) (ZeroExt8to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64x64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64) v0.AddArg(x) v.AddArg(v0) @@ -4165,12 +4211,14 @@ func rewriteValueWasm_OpRsh32Ux16(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh32Ux16 x y) - // result: (Rsh64Ux64 (ZeroExt32to64 x) (ZeroExt16to64 y)) + // match: (Rsh32Ux16 [c] x y) + // result: (Rsh64Ux64 [c] (ZeroExt32to64 x) (ZeroExt16to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64Ux64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) v0.AddArg(x) v.AddArg(v0) @@ -4185,12 +4233,14 @@ func rewriteValueWasm_OpRsh32Ux32(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh32Ux32 x y) - // result: (Rsh64Ux64 (ZeroExt32to64 x) (ZeroExt32to64 y)) + // match: (Rsh32Ux32 [c] x y) + // result: (Rsh64Ux64 [c] (ZeroExt32to64 x) (ZeroExt32to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64Ux64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) v0.AddArg(x) v.AddArg(v0) @@ -4205,12 +4255,14 @@ func rewriteValueWasm_OpRsh32Ux64(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh32Ux64 x y) - // result: (Rsh64Ux64 (ZeroExt32to64 x) y) + // match: (Rsh32Ux64 [c] x y) + // result: (Rsh64Ux64 [c] (ZeroExt32to64 x) y) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64Ux64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) v0.AddArg(x) v.AddArg(v0) @@ -4223,12 +4275,14 @@ func rewriteValueWasm_OpRsh32Ux8(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh32Ux8 x y) - // result: (Rsh64Ux64 (ZeroExt32to64 x) (ZeroExt8to64 y)) + // match: (Rsh32Ux8 [c] x y) + // result: (Rsh64Ux64 [c] (ZeroExt32to64 x) (ZeroExt8to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64Ux64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) v0.AddArg(x) v.AddArg(v0) @@ -4243,12 +4297,14 @@ func rewriteValueWasm_OpRsh32x16(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh32x16 x y) - // result: (Rsh64x64 (SignExt32to64 x) (ZeroExt16to64 y)) + // match: (Rsh32x16 [c] x y) + // result: (Rsh64x64 [c] (SignExt32to64 x) (ZeroExt16to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64x64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) v0.AddArg(x) v.AddArg(v0) @@ -4263,12 +4319,14 @@ func rewriteValueWasm_OpRsh32x32(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh32x32 x y) - // result: (Rsh64x64 (SignExt32to64 x) (ZeroExt32to64 y)) + // match: (Rsh32x32 [c] x y) + // result: (Rsh64x64 [c] (SignExt32to64 x) (ZeroExt32to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64x64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) v0.AddArg(x) v.AddArg(v0) @@ -4283,12 +4341,14 @@ func rewriteValueWasm_OpRsh32x64(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh32x64 x y) - // result: (Rsh64x64 (SignExt32to64 x) y) + // match: (Rsh32x64 [c] x y) + // result: (Rsh64x64 [c] (SignExt32to64 x) y) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64x64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) v0.AddArg(x) v.AddArg(v0) @@ -4301,12 +4361,14 @@ func rewriteValueWasm_OpRsh32x8(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh32x8 x y) - // result: (Rsh64x64 (SignExt32to64 x) (ZeroExt8to64 y)) + // match: (Rsh32x8 [c] x y) + // result: (Rsh64x64 [c] (SignExt32to64 x) (ZeroExt8to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64x64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64) v0.AddArg(x) v.AddArg(v0) @@ -4321,12 +4383,14 @@ func rewriteValueWasm_OpRsh64Ux16(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh64Ux16 x y) - // result: (Rsh64Ux64 x (ZeroExt16to64 y)) + // match: (Rsh64Ux16 [c] x y) + // result: (Rsh64Ux64 [c] x (ZeroExt16to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64Ux64) + v.AuxInt = c v.AddArg(x) v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) v0.AddArg(y) @@ -4339,12 +4403,14 @@ func rewriteValueWasm_OpRsh64Ux32(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh64Ux32 x y) - // result: (Rsh64Ux64 x (ZeroExt32to64 y)) + // match: (Rsh64Ux32 [c] x y) + // result: (Rsh64Ux64 [c] x (ZeroExt32to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64Ux64) + v.AuxInt = c v.AddArg(x) v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) v0.AddArg(y) @@ -4432,12 +4498,14 @@ func rewriteValueWasm_OpRsh64Ux8(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh64Ux8 x y) - // result: (Rsh64Ux64 x (ZeroExt8to64 y)) + // match: (Rsh64Ux8 [c] x y) + // result: (Rsh64Ux64 [c] x (ZeroExt8to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64Ux64) + v.AuxInt = c v.AddArg(x) v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) v0.AddArg(y) @@ -4450,12 +4518,14 @@ func rewriteValueWasm_OpRsh64x16(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh64x16 x y) - // result: (Rsh64x64 x (ZeroExt16to64 y)) + // match: (Rsh64x16 [c] x y) + // result: (Rsh64x64 [c] x (ZeroExt16to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64x64) + v.AuxInt = c v.AddArg(x) v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64) v0.AddArg(y) @@ -4468,12 +4538,14 @@ func rewriteValueWasm_OpRsh64x32(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh64x32 x y) - // result: (Rsh64x64 x (ZeroExt32to64 y)) + // match: (Rsh64x32 [c] x y) + // result: (Rsh64x64 [c] x (ZeroExt32to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64x64) + v.AuxInt = c v.AddArg(x) v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64) v0.AddArg(y) @@ -4565,12 +4637,14 @@ func rewriteValueWasm_OpRsh64x8(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh64x8 x y) - // result: (Rsh64x64 x (ZeroExt8to64 y)) + // match: (Rsh64x8 [c] x y) + // result: (Rsh64x64 [c] x (ZeroExt8to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64x64) + v.AuxInt = c v.AddArg(x) v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) v0.AddArg(y) @@ -4583,12 +4657,14 @@ func rewriteValueWasm_OpRsh8Ux16(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh8Ux16 x y) - // result: (Rsh64Ux64 (ZeroExt8to64 x) (ZeroExt16to64 y)) + // match: (Rsh8Ux16 [c] x y) + // result: (Rsh64Ux64 [c] (ZeroExt8to64 x) (ZeroExt16to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64Ux64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) v0.AddArg(x) v.AddArg(v0) @@ -4603,12 +4679,14 @@ func rewriteValueWasm_OpRsh8Ux32(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh8Ux32 x y) - // result: (Rsh64Ux64 (ZeroExt8to64 x) (ZeroExt32to64 y)) + // match: (Rsh8Ux32 [c] x y) + // result: (Rsh64Ux64 [c] (ZeroExt8to64 x) (ZeroExt32to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64Ux64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) v0.AddArg(x) v.AddArg(v0) @@ -4623,12 +4701,14 @@ func rewriteValueWasm_OpRsh8Ux64(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh8Ux64 x y) - // result: (Rsh64Ux64 (ZeroExt8to64 x) y) + // match: (Rsh8Ux64 [c] x y) + // result: (Rsh64Ux64 [c] (ZeroExt8to64 x) y) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64Ux64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) v0.AddArg(x) v.AddArg(v0) @@ -4641,12 +4721,14 @@ func rewriteValueWasm_OpRsh8Ux8(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh8Ux8 x y) - // result: (Rsh64Ux64 (ZeroExt8to64 x) (ZeroExt8to64 y)) + // match: (Rsh8Ux8 [c] x y) + // result: (Rsh64Ux64 [c] (ZeroExt8to64 x) (ZeroExt8to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64Ux64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64) v0.AddArg(x) v.AddArg(v0) @@ -4661,12 +4743,14 @@ func rewriteValueWasm_OpRsh8x16(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh8x16 x y) - // result: (Rsh64x64 (SignExt8to64 x) (ZeroExt16to64 y)) + // match: (Rsh8x16 [c] x y) + // result: (Rsh64x64 [c] (SignExt8to64 x) (ZeroExt16to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64x64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64) v0.AddArg(x) v.AddArg(v0) @@ -4681,12 +4765,14 @@ func rewriteValueWasm_OpRsh8x32(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh8x32 x y) - // result: (Rsh64x64 (SignExt8to64 x) (ZeroExt32to64 y)) + // match: (Rsh8x32 [c] x y) + // result: (Rsh64x64 [c] (SignExt8to64 x) (ZeroExt32to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64x64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64) v0.AddArg(x) v.AddArg(v0) @@ -4701,12 +4787,14 @@ func rewriteValueWasm_OpRsh8x64(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh8x64 x y) - // result: (Rsh64x64 (SignExt8to64 x) y) + // match: (Rsh8x64 [c] x y) + // result: (Rsh64x64 [c] (SignExt8to64 x) y) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64x64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64) v0.AddArg(x) v.AddArg(v0) @@ -4719,12 +4807,14 @@ func rewriteValueWasm_OpRsh8x8(v *Value) bool { v_0 := v.Args[0] b := v.Block typ := &b.Func.Config.Types - // match: (Rsh8x8 x y) - // result: (Rsh64x64 (SignExt8to64 x) (ZeroExt8to64 y)) + // match: (Rsh8x8 [c] x y) + // result: (Rsh64x64 [c] (SignExt8to64 x) (ZeroExt8to64 y)) for { + c := v.AuxInt x := v_0 y := v_1 v.reset(OpRsh64x64) + v.AuxInt = c v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64) v0.AddArg(x) v.AddArg(v0) -- 2.50.0