]> Cypherpunks repositories - gostls13.git/commitdiff
all: rename WebAssembly instructions according to spec changes
authorRichard Musiol <mail@richard-musiol.de>
Wed, 12 Dec 2018 12:04:44 +0000 (13:04 +0100)
committerRichard Musiol <neelance@gmail.com>
Sun, 3 Mar 2019 21:10:01 +0000 (21:10 +0000)
The names of some instructions have been updated in the WebAssembly
specification to be more consistent, see
https://github.com/WebAssembly/spec/commit/994591e51c9df9e7ef980b04d660709b79982f75.
This change to the spec is possible because it is still in a draft
state.

Go's support for WebAssembly is still experimental and thus excempt from
the compatibility promise. Being consistent with the spec should
warrant this breaking change to the assembly instruction names.

Change-Id: Iafb8b18ee7f55dd0e23c6c7824aa1fad43117ef1
Reviewed-on: https://go-review.googlesource.com/c/153797
Run-TryBot: Richard Musiol <neelance@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
14 files changed:
src/cmd/compile/internal/ssa/gen/Wasm.rules
src/cmd/compile/internal/ssa/gen/WasmOps.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewriteWasm.go
src/cmd/compile/internal/wasm/ssa.go
src/cmd/internal/obj/wasm/a.out.go
src/cmd/internal/obj/wasm/anames.go
src/cmd/internal/obj/wasm/wasmobj.go
src/internal/bytealg/compare_wasm.s
src/internal/bytealg/indexbyte_wasm.s
src/reflect/asm_wasm.s
src/runtime/asm_wasm.s
src/runtime/rt0_js_wasm.s
src/runtime/sys_wasm.s

index 41d8d1122d1f3e321701e4b580ce5ff58081ed82..b7ecae7d8c3535ae9f26c25cce2ea68b77ec2cb1 100644 (file)
 (Trunc16to8         x) -> x
 
 // Lowering float <-> int
-(Cvt32to32F x) -> (LoweredRound32F (F64ConvertSI64 (SignExt32to64 x)))
-(Cvt32to64F x) -> (F64ConvertSI64 (SignExt32to64 x))
-(Cvt64to32F x) -> (LoweredRound32F (F64ConvertSI64 x))
-(Cvt64to64F x) -> (F64ConvertSI64 x)
-(Cvt32Uto32F x) -> (LoweredRound32F (F64ConvertUI64 (ZeroExt32to64 x)))
-(Cvt32Uto64F x) -> (F64ConvertUI64 (ZeroExt32to64 x))
-(Cvt64Uto32F x) -> (LoweredRound32F (F64ConvertUI64 x))
-(Cvt64Uto64F x) -> (F64ConvertUI64 x)
-
-(Cvt32Fto32 x) -> (I64TruncSF64 x)
-(Cvt32Fto64 x) -> (I64TruncSF64 x)
-(Cvt64Fto32 x) -> (I64TruncSF64 x)
-(Cvt64Fto64 x) -> (I64TruncSF64 x)
-(Cvt32Fto32U x) -> (I64TruncUF64 x)
-(Cvt32Fto64U x) -> (I64TruncUF64 x)
-(Cvt64Fto32U x) -> (I64TruncUF64 x)
-(Cvt64Fto64U x) -> (I64TruncUF64 x)
+(Cvt32to32F x) -> (LoweredRound32F (F64ConvertI64S (SignExt32to64 x)))
+(Cvt32to64F x) -> (F64ConvertI64S (SignExt32to64 x))
+(Cvt64to32F x) -> (LoweredRound32F (F64ConvertI64S x))
+(Cvt64to64F x) -> (F64ConvertI64S x)
+(Cvt32Uto32F x) -> (LoweredRound32F (F64ConvertI64U (ZeroExt32to64 x)))
+(Cvt32Uto64F x) -> (F64ConvertI64U (ZeroExt32to64 x))
+(Cvt64Uto32F x) -> (LoweredRound32F (F64ConvertI64U x))
+(Cvt64Uto64F x) -> (F64ConvertI64U x)
+
+(Cvt32Fto32 x) -> (I64TruncF64S x)
+(Cvt32Fto64 x) -> (I64TruncF64S x)
+(Cvt64Fto32 x) -> (I64TruncF64S x)
+(Cvt64Fto64 x) -> (I64TruncF64S x)
+(Cvt32Fto32U x) -> (I64TruncF64U x)
+(Cvt32Fto64U x) -> (I64TruncF64U x)
+(Cvt64Fto32U x) -> (I64TruncF64U x)
+(Cvt64Fto64U x) -> (I64TruncF64U x)
 
 (Cvt32Fto64F x) -> x
 (Cvt64Fto32F x) -> (LoweredRound32F x)
index e0f2f92a3f70bcd342e3a92cd61b4e160083a7b7..c0ad9498ff0b591dd3c7dee94e792302e070fc1b 100644 (file)
@@ -187,10 +187,10 @@ func init() {
                {name: "F64Mul", asm: "F64Mul", argLength: 2, reg: fp21, typ: "Float64"}, // arg0 * arg1
                {name: "F64Div", asm: "F64Div", argLength: 2, reg: fp21, typ: "Float64"}, // arg0 / arg1
 
-               {name: "I64TruncSF64", asm: "I64TruncSF64", argLength: 1, reg: regInfo{inputs: []regMask{fp}, outputs: []regMask{gp}}, typ: "Int64"},       // truncates the float arg0 to a signed integer
-               {name: "I64TruncUF64", asm: "I64TruncUF64", argLength: 1, reg: regInfo{inputs: []regMask{fp}, outputs: []regMask{gp}}, typ: "Int64"},       // truncates the float arg0 to an unsigned integer
-               {name: "F64ConvertSI64", asm: "F64ConvertSI64", argLength: 1, reg: regInfo{inputs: []regMask{gp}, outputs: []regMask{fp}}, typ: "Float64"}, // converts the signed integer arg0 to a float
-               {name: "F64ConvertUI64", asm: "F64ConvertUI64", argLength: 1, reg: regInfo{inputs: []regMask{gp}, outputs: []regMask{fp}}, typ: "Float64"}, // converts the unsigned integer arg0 to a float
+               {name: "I64TruncF64S", asm: "I64TruncF64S", argLength: 1, reg: regInfo{inputs: []regMask{fp}, outputs: []regMask{gp}}, typ: "Int64"},       // truncates the float arg0 to a signed integer
+               {name: "I64TruncF64U", asm: "I64TruncF64U", argLength: 1, reg: regInfo{inputs: []regMask{fp}, outputs: []regMask{gp}}, typ: "Int64"},       // truncates the float arg0 to an unsigned integer
+               {name: "F64ConvertI64S", asm: "F64ConvertI64S", argLength: 1, reg: regInfo{inputs: []regMask{gp}, outputs: []regMask{fp}}, typ: "Float64"}, // converts the signed integer arg0 to a float
+               {name: "F64ConvertI64U", asm: "F64ConvertI64U", argLength: 1, reg: regInfo{inputs: []regMask{gp}, outputs: []regMask{fp}}, typ: "Float64"}, // converts the unsigned integer arg0 to a float
        }
 
        archs = append(archs, arch{
index 2278407a260e7bb5a9008acdf5add81e4e401aac..948bbdc32a5f6f061df44f0ba4f28df41e6752d1 100644 (file)
@@ -2075,10 +2075,10 @@ const (
        OpWasmF64Sub
        OpWasmF64Mul
        OpWasmF64Div
-       OpWasmI64TruncSF64
-       OpWasmI64TruncUF64
-       OpWasmF64ConvertSI64
-       OpWasmF64ConvertUI64
+       OpWasmI64TruncF64S
+       OpWasmI64TruncF64U
+       OpWasmF64ConvertI64S
+       OpWasmF64ConvertI64U
 
        OpAdd8
        OpAdd16
@@ -28000,9 +28000,9 @@ var opcodeTable = [...]opInfo{
                },
        },
        {
-               name:   "I64TruncSF64",
+               name:   "I64TruncF64S",
                argLen: 1,
-               asm:    wasm.AI64TruncSF64,
+               asm:    wasm.AI64TruncF64S,
                reg: regInfo{
                        inputs: []inputInfo{
                                {0, 4294901760}, // F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15
@@ -28013,9 +28013,9 @@ var opcodeTable = [...]opInfo{
                },
        },
        {
-               name:   "I64TruncUF64",
+               name:   "I64TruncF64U",
                argLen: 1,
-               asm:    wasm.AI64TruncUF64,
+               asm:    wasm.AI64TruncF64U,
                reg: regInfo{
                        inputs: []inputInfo{
                                {0, 4294901760}, // F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15
@@ -28026,9 +28026,9 @@ var opcodeTable = [...]opInfo{
                },
        },
        {
-               name:   "F64ConvertSI64",
+               name:   "F64ConvertI64S",
                argLen: 1,
-               asm:    wasm.AF64ConvertSI64,
+               asm:    wasm.AF64ConvertI64S,
                reg: regInfo{
                        inputs: []inputInfo{
                                {0, 65535}, // R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 R14 R15
@@ -28039,9 +28039,9 @@ var opcodeTable = [...]opInfo{
                },
        },
        {
-               name:   "F64ConvertUI64",
+               name:   "F64ConvertI64U",
                argLen: 1,
-               asm:    wasm.AF64ConvertUI64,
+               asm:    wasm.AF64ConvertI64U,
                reg: regInfo{
                        inputs: []inputInfo{
                                {0, 65535}, // R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 R14 R15
index e14d6251be9a1a7c95f0bebbf1f9bca816b112b1..1b7b5022dae0f166c3e14d5121d5731d7f16cd32 100644 (file)
@@ -913,10 +913,10 @@ func rewriteValueWasm_OpConvert_0(v *Value) bool {
 func rewriteValueWasm_OpCvt32Fto32_0(v *Value) bool {
        // match: (Cvt32Fto32 x)
        // cond:
-       // result: (I64TruncSF64 x)
+       // result: (I64TruncF64S x)
        for {
                x := v.Args[0]
-               v.reset(OpWasmI64TruncSF64)
+               v.reset(OpWasmI64TruncF64S)
                v.AddArg(x)
                return true
        }
@@ -924,10 +924,10 @@ func rewriteValueWasm_OpCvt32Fto32_0(v *Value) bool {
 func rewriteValueWasm_OpCvt32Fto32U_0(v *Value) bool {
        // match: (Cvt32Fto32U x)
        // cond:
-       // result: (I64TruncUF64 x)
+       // result: (I64TruncF64U x)
        for {
                x := v.Args[0]
-               v.reset(OpWasmI64TruncUF64)
+               v.reset(OpWasmI64TruncF64U)
                v.AddArg(x)
                return true
        }
@@ -935,10 +935,10 @@ func rewriteValueWasm_OpCvt32Fto32U_0(v *Value) bool {
 func rewriteValueWasm_OpCvt32Fto64_0(v *Value) bool {
        // match: (Cvt32Fto64 x)
        // cond:
-       // result: (I64TruncSF64 x)
+       // result: (I64TruncF64S x)
        for {
                x := v.Args[0]
-               v.reset(OpWasmI64TruncSF64)
+               v.reset(OpWasmI64TruncF64S)
                v.AddArg(x)
                return true
        }
@@ -958,10 +958,10 @@ func rewriteValueWasm_OpCvt32Fto64F_0(v *Value) bool {
 func rewriteValueWasm_OpCvt32Fto64U_0(v *Value) bool {
        // match: (Cvt32Fto64U x)
        // cond:
-       // result: (I64TruncUF64 x)
+       // result: (I64TruncF64U x)
        for {
                x := v.Args[0]
-               v.reset(OpWasmI64TruncUF64)
+               v.reset(OpWasmI64TruncF64U)
                v.AddArg(x)
                return true
        }
@@ -973,11 +973,11 @@ func rewriteValueWasm_OpCvt32Uto32F_0(v *Value) bool {
        _ = typ
        // match: (Cvt32Uto32F x)
        // cond:
-       // result: (LoweredRound32F (F64ConvertUI64 (ZeroExt32to64 x)))
+       // result: (LoweredRound32F (F64ConvertI64U (ZeroExt32to64 x)))
        for {
                x := v.Args[0]
                v.reset(OpWasmLoweredRound32F)
-               v0 := b.NewValue0(v.Pos, OpWasmF64ConvertUI64, typ.Float64)
+               v0 := b.NewValue0(v.Pos, OpWasmF64ConvertI64U, typ.Float64)
                v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
                v1.AddArg(x)
                v0.AddArg(v1)
@@ -992,10 +992,10 @@ func rewriteValueWasm_OpCvt32Uto64F_0(v *Value) bool {
        _ = typ
        // match: (Cvt32Uto64F x)
        // cond:
-       // result: (F64ConvertUI64 (ZeroExt32to64 x))
+       // result: (F64ConvertI64U (ZeroExt32to64 x))
        for {
                x := v.Args[0]
-               v.reset(OpWasmF64ConvertUI64)
+               v.reset(OpWasmF64ConvertI64U)
                v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
                v0.AddArg(x)
                v.AddArg(v0)
@@ -1009,11 +1009,11 @@ func rewriteValueWasm_OpCvt32to32F_0(v *Value) bool {
        _ = typ
        // match: (Cvt32to32F x)
        // cond:
-       // result: (LoweredRound32F (F64ConvertSI64 (SignExt32to64 x)))
+       // result: (LoweredRound32F (F64ConvertI64S (SignExt32to64 x)))
        for {
                x := v.Args[0]
                v.reset(OpWasmLoweredRound32F)
-               v0 := b.NewValue0(v.Pos, OpWasmF64ConvertSI64, typ.Float64)
+               v0 := b.NewValue0(v.Pos, OpWasmF64ConvertI64S, typ.Float64)
                v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
                v1.AddArg(x)
                v0.AddArg(v1)
@@ -1028,10 +1028,10 @@ func rewriteValueWasm_OpCvt32to64F_0(v *Value) bool {
        _ = typ
        // match: (Cvt32to64F x)
        // cond:
-       // result: (F64ConvertSI64 (SignExt32to64 x))
+       // result: (F64ConvertI64S (SignExt32to64 x))
        for {
                x := v.Args[0]
-               v.reset(OpWasmF64ConvertSI64)
+               v.reset(OpWasmF64ConvertI64S)
                v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
                v0.AddArg(x)
                v.AddArg(v0)
@@ -1041,10 +1041,10 @@ func rewriteValueWasm_OpCvt32to64F_0(v *Value) bool {
 func rewriteValueWasm_OpCvt64Fto32_0(v *Value) bool {
        // match: (Cvt64Fto32 x)
        // cond:
-       // result: (I64TruncSF64 x)
+       // result: (I64TruncF64S x)
        for {
                x := v.Args[0]
-               v.reset(OpWasmI64TruncSF64)
+               v.reset(OpWasmI64TruncF64S)
                v.AddArg(x)
                return true
        }
@@ -1063,10 +1063,10 @@ func rewriteValueWasm_OpCvt64Fto32F_0(v *Value) bool {
 func rewriteValueWasm_OpCvt64Fto32U_0(v *Value) bool {
        // match: (Cvt64Fto32U x)
        // cond:
-       // result: (I64TruncUF64 x)
+       // result: (I64TruncF64U x)
        for {
                x := v.Args[0]
-               v.reset(OpWasmI64TruncUF64)
+               v.reset(OpWasmI64TruncF64U)
                v.AddArg(x)
                return true
        }
@@ -1074,10 +1074,10 @@ func rewriteValueWasm_OpCvt64Fto32U_0(v *Value) bool {
 func rewriteValueWasm_OpCvt64Fto64_0(v *Value) bool {
        // match: (Cvt64Fto64 x)
        // cond:
-       // result: (I64TruncSF64 x)
+       // result: (I64TruncF64S x)
        for {
                x := v.Args[0]
-               v.reset(OpWasmI64TruncSF64)
+               v.reset(OpWasmI64TruncF64S)
                v.AddArg(x)
                return true
        }
@@ -1085,10 +1085,10 @@ func rewriteValueWasm_OpCvt64Fto64_0(v *Value) bool {
 func rewriteValueWasm_OpCvt64Fto64U_0(v *Value) bool {
        // match: (Cvt64Fto64U x)
        // cond:
-       // result: (I64TruncUF64 x)
+       // result: (I64TruncF64U x)
        for {
                x := v.Args[0]
-               v.reset(OpWasmI64TruncUF64)
+               v.reset(OpWasmI64TruncF64U)
                v.AddArg(x)
                return true
        }
@@ -1100,11 +1100,11 @@ func rewriteValueWasm_OpCvt64Uto32F_0(v *Value) bool {
        _ = typ
        // match: (Cvt64Uto32F x)
        // cond:
-       // result: (LoweredRound32F (F64ConvertUI64 x))
+       // result: (LoweredRound32F (F64ConvertI64U x))
        for {
                x := v.Args[0]
                v.reset(OpWasmLoweredRound32F)
-               v0 := b.NewValue0(v.Pos, OpWasmF64ConvertUI64, typ.Float64)
+               v0 := b.NewValue0(v.Pos, OpWasmF64ConvertI64U, typ.Float64)
                v0.AddArg(x)
                v.AddArg(v0)
                return true
@@ -1113,10 +1113,10 @@ func rewriteValueWasm_OpCvt64Uto32F_0(v *Value) bool {
 func rewriteValueWasm_OpCvt64Uto64F_0(v *Value) bool {
        // match: (Cvt64Uto64F x)
        // cond:
-       // result: (F64ConvertUI64 x)
+       // result: (F64ConvertI64U x)
        for {
                x := v.Args[0]
-               v.reset(OpWasmF64ConvertUI64)
+               v.reset(OpWasmF64ConvertI64U)
                v.AddArg(x)
                return true
        }
@@ -1128,11 +1128,11 @@ func rewriteValueWasm_OpCvt64to32F_0(v *Value) bool {
        _ = typ
        // match: (Cvt64to32F x)
        // cond:
-       // result: (LoweredRound32F (F64ConvertSI64 x))
+       // result: (LoweredRound32F (F64ConvertI64S x))
        for {
                x := v.Args[0]
                v.reset(OpWasmLoweredRound32F)
-               v0 := b.NewValue0(v.Pos, OpWasmF64ConvertSI64, typ.Float64)
+               v0 := b.NewValue0(v.Pos, OpWasmF64ConvertI64S, typ.Float64)
                v0.AddArg(x)
                v.AddArg(v0)
                return true
@@ -1141,10 +1141,10 @@ func rewriteValueWasm_OpCvt64to32F_0(v *Value) bool {
 func rewriteValueWasm_OpCvt64to64F_0(v *Value) bool {
        // match: (Cvt64to64F x)
        // cond:
-       // result: (F64ConvertSI64 x)
+       // result: (F64ConvertI64S x)
        for {
                x := v.Args[0]
-               v.reset(OpWasmF64ConvertSI64)
+               v.reset(OpWasmF64ConvertI64S)
                v.AddArg(x)
                return true
        }
index 897d6146c5b16b782273c43c1ee13f6a938bfe46..604c88247fbf2f52362a53251b5ce9df80780ef1 100644 (file)
@@ -283,13 +283,13 @@ func ssaGenValueOnStack(s *gc.SSAGenState, v *ssa.Value) {
        case ssa.OpWasmI64Eqz:
                getValue64(s, v.Args[0])
                s.Prog(v.Op.Asm())
-               s.Prog(wasm.AI64ExtendUI32)
+               s.Prog(wasm.AI64ExtendI32U)
 
        case ssa.OpWasmI64Eq, ssa.OpWasmI64Ne, ssa.OpWasmI64LtS, ssa.OpWasmI64LtU, ssa.OpWasmI64GtS, ssa.OpWasmI64GtU, ssa.OpWasmI64LeS, ssa.OpWasmI64LeU, ssa.OpWasmI64GeS, ssa.OpWasmI64GeU, ssa.OpWasmF64Eq, ssa.OpWasmF64Ne, ssa.OpWasmF64Lt, ssa.OpWasmF64Gt, ssa.OpWasmF64Le, ssa.OpWasmF64Ge:
                getValue64(s, v.Args[0])
                getValue64(s, v.Args[1])
                s.Prog(v.Op.Asm())
-               s.Prog(wasm.AI64ExtendUI32)
+               s.Prog(wasm.AI64ExtendI32U)
 
        case ssa.OpWasmI64Add, ssa.OpWasmI64Sub, ssa.OpWasmI64Mul, ssa.OpWasmI64DivU, ssa.OpWasmI64RemS, ssa.OpWasmI64RemU, ssa.OpWasmI64And, ssa.OpWasmI64Or, ssa.OpWasmI64Xor, ssa.OpWasmI64Shl, ssa.OpWasmI64ShrS, ssa.OpWasmI64ShrU, ssa.OpWasmF64Add, ssa.OpWasmF64Sub, ssa.OpWasmF64Mul, ssa.OpWasmF64Div:
                getValue64(s, v.Args[0])
@@ -307,17 +307,17 @@ func ssaGenValueOnStack(s *gc.SSAGenState, v *ssa.Value) {
                }
                s.Prog(wasm.AI64DivS)
 
-       case ssa.OpWasmI64TruncSF64:
+       case ssa.OpWasmI64TruncF64S:
                getValue64(s, v.Args[0])
                p := s.Prog(wasm.ACall)
                p.To = obj.Addr{Type: obj.TYPE_MEM, Name: obj.NAME_EXTERN, Sym: gc.WasmTruncS}
 
-       case ssa.OpWasmI64TruncUF64:
+       case ssa.OpWasmI64TruncF64U:
                getValue64(s, v.Args[0])
                p := s.Prog(wasm.ACall)
                p.To = obj.Addr{Type: obj.TYPE_MEM, Name: obj.NAME_EXTERN, Sym: gc.WasmTruncU}
 
-       case ssa.OpWasmF64Neg, ssa.OpWasmF64ConvertSI64, ssa.OpWasmF64ConvertUI64:
+       case ssa.OpWasmF64Neg, ssa.OpWasmF64ConvertI64S, ssa.OpWasmF64ConvertI64U:
                getValue64(s, v.Args[0])
                s.Prog(v.Op.Asm())
 
@@ -362,7 +362,7 @@ func getValue64(s *gc.SSAGenState, v *ssa.Value) {
        reg := v.Reg()
        getReg(s, reg)
        if reg == wasm.REG_SP {
-               s.Prog(wasm.AI64ExtendUI32)
+               s.Prog(wasm.AI64ExtendI32U)
        }
 }
 
index 0e8196be60f91926d87f0c60b377782c00f6f4b2..f1830ba0361143623e3dfb7a690d6d8ee266b080 100644 (file)
@@ -186,25 +186,25 @@ const (
        AF64Copysign
 
        AI32WrapI64
-       AI32TruncSF32
-       AI32TruncUF32
-       AI32TruncSF64
-       AI32TruncUF64
-       AI64ExtendSI32
-       AI64ExtendUI32
-       AI64TruncSF32
-       AI64TruncUF32
-       AI64TruncSF64
-       AI64TruncUF64
-       AF32ConvertSI32
-       AF32ConvertUI32
-       AF32ConvertSI64
-       AF32ConvertUI64
+       AI32TruncF32S
+       AI32TruncF32U
+       AI32TruncF64S
+       AI32TruncF64U
+       AI64ExtendI32S
+       AI64ExtendI32U
+       AI64TruncF32S
+       AI64TruncF32U
+       AI64TruncF64S
+       AI64TruncF64U
+       AF32ConvertI32S
+       AF32ConvertI32U
+       AF32ConvertI64S
+       AF32ConvertI64U
        AF32DemoteF64
-       AF64ConvertSI32
-       AF64ConvertUI32
-       AF64ConvertSI64
-       AF64ConvertUI64
+       AF64ConvertI32S
+       AF64ConvertI32U
+       AF64ConvertI64S
+       AF64ConvertI64U
        AF64PromoteF32
        AI32ReinterpretF32
        AI64ReinterpretF64
index 369de3092d6ff88fbe6e0cd4a821d28b95702951..7ef09d665edcabf1cb1af0d9fe1cb879defeddac 100644 (file)
@@ -153,25 +153,25 @@ var Anames = []string{
        "F64Max",
        "F64Copysign",
        "I32WrapI64",
-       "I32TruncSF32",
-       "I32TruncUF32",
-       "I32TruncSF64",
-       "I32TruncUF64",
-       "I64ExtendSI32",
-       "I64ExtendUI32",
-       "I64TruncSF32",
-       "I64TruncUF32",
-       "I64TruncSF64",
-       "I64TruncUF64",
-       "F32ConvertSI32",
-       "F32ConvertUI32",
-       "F32ConvertSI64",
-       "F32ConvertUI64",
+       "I32TruncF32S",
+       "I32TruncF32U",
+       "I32TruncF64S",
+       "I32TruncF64U",
+       "I64ExtendI32S",
+       "I64ExtendI32U",
+       "I64TruncF32S",
+       "I64TruncF32U",
+       "I64TruncF64S",
+       "I64TruncF64U",
+       "F32ConvertI32S",
+       "F32ConvertI32U",
+       "F32ConvertI64S",
+       "F32ConvertI64U",
        "F32DemoteF64",
-       "F64ConvertSI32",
-       "F64ConvertUI32",
-       "F64ConvertSI64",
-       "F64ConvertUI64",
+       "F64ConvertI32S",
+       "F64ConvertI32U",
+       "F64ConvertI64S",
+       "F64ConvertI64U",
        "F64PromoteF32",
        "I32ReinterpretF32",
        "I64ReinterpretF64",
index fbea103dcb08030f19bb1eb74292761c66544e34..4a499b4f917b1edd321bbef0039bf7629db5fef9 100644 (file)
@@ -181,7 +181,7 @@ func preprocess(ctxt *obj.Link, s *obj.LSym, newprog obj.ProgAlloc) {
                // Not
                // If
                //   Get SP
-               //   I64ExtendUI32
+               //   I64ExtendI32U
                //   I64Const $framesize+8
                //   I64Add
                //   I64Load panic_argp(R0)
@@ -212,7 +212,7 @@ func preprocess(ctxt *obj.Link, s *obj.LSym, newprog obj.ProgAlloc) {
                p = appendp(p, AIf)
 
                p = appendp(p, AGet, regAddr(REG_SP))
-               p = appendp(p, AI64ExtendUI32)
+               p = appendp(p, AI64ExtendI32U)
                p = appendp(p, AI64Const, constAddr(framesize+8))
                p = appendp(p, AI64Add)
                p = appendp(p, AI64Load, panicargp)
@@ -584,7 +584,7 @@ func preprocess(ctxt *obj.Link, s *obj.LSym, newprog obj.ProgAlloc) {
                                case obj.NAME_AUTO, obj.NAME_PARAM:
                                        p = appendp(p, AGet, regAddr(get.From.Reg))
                                        if get.From.Reg == REG_SP {
-                                               p = appendp(p, AI64ExtendUI32)
+                                               p = appendp(p, AI64ExtendI32U)
                                        }
                                        if get.From.Offset != 0 {
                                                p = appendp(p, AI64Const, constAddr(get.From.Offset))
@@ -641,7 +641,7 @@ func preprocess(ctxt *obj.Link, s *obj.LSym, newprog obj.ProgAlloc) {
                                        case obj.NAME_NONE, obj.NAME_PARAM, obj.NAME_AUTO:
                                                p = appendp(p, AGet, regAddr(mov.From.Reg))
                                                if mov.From.Reg == REG_SP {
-                                                       p = appendp(p, AI64ExtendUI32)
+                                                       p = appendp(p, AI64ExtendI32U)
                                                }
                                                p = appendp(p, AI64Const, constAddr(mov.From.Offset))
                                                p = appendp(p, AI64Add)
@@ -654,7 +654,7 @@ func preprocess(ctxt *obj.Link, s *obj.LSym, newprog obj.ProgAlloc) {
                                case obj.TYPE_REG:
                                        p = appendp(p, AGet, mov.From)
                                        if mov.From.Reg == REG_SP {
-                                               p = appendp(p, AI64ExtendUI32)
+                                               p = appendp(p, AI64ExtendI32U)
                                        }
 
                                case obj.TYPE_MEM:
@@ -788,13 +788,13 @@ func assemble(ctxt *obj.Link, s *obj.LSym, newprog obj.ProgAlloc) {
                        reg := p.From.Reg
                        switch {
                        case reg >= REG_PC_F && reg <= REG_PAUSE:
-                               w.WriteByte(0x23) // get_global
+                               w.WriteByte(0x23) // global.get
                                writeUleb128(w, uint64(reg-REG_PC_F))
                        case reg >= REG_R0 && reg <= REG_R15:
-                               w.WriteByte(0x20) // get_local (i64)
+                               w.WriteByte(0x20) // local.get (i64)
                                writeUleb128(w, uint64(reg-REG_R0))
                        case reg >= REG_F0 && reg <= REG_F15:
-                               w.WriteByte(0x20) // get_local (f64)
+                               w.WriteByte(0x20) // local.get (f64)
                                writeUleb128(w, uint64(numI+(reg-REG_F0)))
                        default:
                                panic("bad Get: invalid register")
@@ -808,14 +808,14 @@ func assemble(ctxt *obj.Link, s *obj.LSym, newprog obj.ProgAlloc) {
                        reg := p.To.Reg
                        switch {
                        case reg >= REG_PC_F && reg <= REG_PAUSE:
-                               w.WriteByte(0x24) // set_global
+                               w.WriteByte(0x24) // global.set
                                writeUleb128(w, uint64(reg-REG_PC_F))
                        case reg >= REG_R0 && reg <= REG_F15:
                                if p.Link.As == AGet && p.Link.From.Reg == reg {
-                                       w.WriteByte(0x22) // tee_local
+                                       w.WriteByte(0x22) // local.tee
                                        p = p.Link
                                } else {
-                                       w.WriteByte(0x21) // set_local
+                                       w.WriteByte(0x21) // local.set
                                }
                                if reg <= REG_R15 {
                                        writeUleb128(w, uint64(reg-REG_R0))
@@ -834,10 +834,10 @@ func assemble(ctxt *obj.Link, s *obj.LSym, newprog obj.ProgAlloc) {
                        reg := p.To.Reg
                        switch {
                        case reg >= REG_R0 && reg <= REG_R15:
-                               w.WriteByte(0x22) // tee_local (i64)
+                               w.WriteByte(0x22) // local.tee (i64)
                                writeUleb128(w, uint64(reg-REG_R0))
                        case reg >= REG_F0 && reg <= REG_F15:
-                               w.WriteByte(0x22) // tee_local (f64)
+                               w.WriteByte(0x22) // local.tee (f64)
                                writeUleb128(w, uint64(numI+(reg-REG_F0)))
                        default:
                                panic("bad Tee: invalid register")
index b2a20a08f6e5287bbb621e9a0ddd08bc4ece93d4..2d28215b1a4df3fd76ff4140581bfdc9e77963f5 100644 (file)
@@ -44,7 +44,7 @@ TEXT cmpbody<>(SB), NOSPLIT, $0-0
        Get R4
        I32WrapI64
        Call memcmp<>(SB)
-       I64ExtendSI32
+       I64ExtendI32S
        Set R5
 
        Get R5
index aae11b30a6eaaedaedca0442ac73ff74b7037031..4d940a3bb01e2ac946580d22d94ce3dc1a27ac82 100644 (file)
@@ -12,7 +12,7 @@ TEXT ·IndexByte(SB), NOSPLIT, $0-40
        I64Load b_len+8(FP)
        I32WrapI64
        Call memchr<>(SB)
-       I64ExtendSI32
+       I64ExtendI32S
        Set R0
 
        Get SP
@@ -35,7 +35,7 @@ TEXT ·IndexByteString(SB), NOSPLIT, $0-32
        I64Load s_len+8(FP)
        I32WrapI64
        Call memchr<>(SB)
-       I64ExtendSI32
+       I64ExtendI32S
        Set R0
 
        I64Const $-1
index 627e295769cb3cec1bbd1097c2e825c969914446..63b4d94fca98d63d2b180e459680adc1389c47db 100644 (file)
@@ -16,7 +16,7 @@ TEXT ·makeFuncStub(SB),(NOSPLIT|WRAPPER),$32
 
        Get SP
        Get SP
-       I64ExtendUI32
+       I64ExtendI32U
        I64Const $argframe+0(FP)
        I64Add
        I64Store $8
@@ -38,7 +38,7 @@ TEXT ·methodValueCall(SB),(NOSPLIT|WRAPPER),$32
 
        Get SP
        Get SP
-       I64ExtendUI32
+       I64ExtendI32U
        I64Const $argframe+0(FP)
        I64Add
        I64Store $8
index 374b9f73dbf3ec0463bcb20c7e16fb31d46ff4f1..1d25ee899dfc5df92624d183538527390de1d29e 100644 (file)
@@ -366,7 +366,7 @@ TEXT NAME(SB), WRAPPER, $MAXSIZE-32; \
        Set RET1; \
        \
        Get SP; \
-       I64ExtendUI32; \
+       I64ExtendI32U; \
        Get R0; \
        I64Add; \
        Set RET2; \
index 50adbe22256da7ba81b48ea160fa353bc51902f6..c4efd9637c41cd45fa3474e616c82567951d1323 100644 (file)
@@ -23,12 +23,12 @@ TEXT wasm_export_run(SB),NOSPLIT,$0
 
        Get SP
        Get R0 // argc
-       I64ExtendUI32
+       I64ExtendI32U
        I64Store $0
 
        Get SP
        Get R1 // argv
-       I64ExtendUI32
+       I64ExtendI32U
        I64Store $8
 
        I32Const $runtime·rt0_go(SB)
index 6e28656340d79464b9d1fd8f4922b558f47a7906..d7bab926dc505a9e3631a799333f1071f62f66bb 100644 (file)
@@ -117,7 +117,7 @@ TEXT runtime·wasmTruncS(SB), NOSPLIT, $0-0
        End
 
        Get R0
-       I64TruncSF64
+       I64TruncF64S
        Return
 
 TEXT runtime·wasmTruncU(SB), NOSPLIT, $0-0
@@ -146,7 +146,7 @@ TEXT runtime·wasmTruncU(SB), NOSPLIT, $0-0
        End
 
        Get R0
-       I64TruncUF64
+       I64TruncF64U
        Return
 
 TEXT runtime·exitThread(SB), NOSPLIT, $0-0