aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/wasm
diff options
context:
space:
mode:
authorRichard Musiol <mail@richard-musiol.de>2018-12-12 13:04:44 +0100
committerRichard Musiol <neelance@gmail.com>2019-03-03 21:10:01 +0000
commitc0d82bb0eca81aa13c2e605b4a25655f61a159aa (patch)
tree1bfc2d2d4433a185997329c625b9164d82415032 /src/cmd/compile/internal/wasm
parent159b2de4428d47e422ffd696e0f0c62353c4bb79 (diff)
downloadgo-c0d82bb0eca81aa13c2e605b4a25655f61a159aa.tar.gz
go-c0d82bb0eca81aa13c2e605b4a25655f61a159aa.zip
all: rename WebAssembly instructions according to spec changes
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>
Diffstat (limited to 'src/cmd/compile/internal/wasm')
-rw-r--r--src/cmd/compile/internal/wasm/ssa.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cmd/compile/internal/wasm/ssa.go b/src/cmd/compile/internal/wasm/ssa.go
index 897d6146c5..604c88247f 100644
--- a/src/cmd/compile/internal/wasm/ssa.go
+++ b/src/cmd/compile/internal/wasm/ssa.go
@@ -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)
}
}