mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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
994591e51c.
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>
This commit is contained in:
parent
159b2de442
commit
c0d82bb0ec
14 changed files with 129 additions and 129 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue