1
0
mirror of https://github.com/golang/go synced 2024-11-11 22:40:22 -07:00

cmd/internal/obj/arm64: fix encoding error for SYS instruction

Currently using the SYS instruction will report the "illegal combination"
error. This is because the assembler parser treats the register operand
as p.To, while optab defines it as p.Reg. This CL fixes this bug.

Change-Id: I57799a7c19934b0c62278948f4efaa41001593a4
Reviewed-on: https://go-review.googlesource.com/c/go/+/396796
Run-TryBot: Eric Fang <eric.fang@arm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Trust: Eric Fang <eric.fang@arm.com>
This commit is contained in:
eric fang 2022-03-31 07:34:01 +00:00 committed by Eric Fang
parent be8ee5a58f
commit ecee4a3291
2 changed files with 3 additions and 1 deletions

View File

@ -1627,4 +1627,6 @@ again:
MSR R13, ZCR_EL1 // 0d1218d5
MRS ZCR_EL1, R23 // 171238d5
MSR R17, ZCR_EL1 // 111218d5
SYS $32768, R1 // 018008d5
SYS $32768 // 1f8008d5
END

View File

@ -843,7 +843,7 @@ var optab = []Optab{
{ADMB, C_VCON, C_NONE, C_NONE, C_NONE, 51, 4, 0, 0, 0},
{AHINT, C_VCON, C_NONE, C_NONE, C_NONE, 52, 4, 0, 0, 0},
{ASYS, C_VCON, C_NONE, C_NONE, C_NONE, 50, 4, 0, 0, 0},
{ASYS, C_VCON, C_REG, C_NONE, C_NONE, 50, 4, 0, 0, 0},
{ASYS, C_VCON, C_NONE, C_NONE, C_REG, 50, 4, 0, 0, 0},
{ASYSL, C_VCON, C_NONE, C_NONE, C_REG, 50, 4, 0, 0, 0},
/* encryption instructions */