]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/obj/arm64: fix encoding error for SYS instruction
authoreric fang <eric.fang@arm.com>
Thu, 31 Mar 2022 07:34:01 +0000 (07:34 +0000)
committerEric Fang <eric.fang@arm.com>
Fri, 1 Apr 2022 01:23:42 +0000 (01:23 +0000)
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>

src/cmd/asm/internal/asm/testdata/arm64.s
src/cmd/internal/obj/arm64/asm7.go

index 8a7dd299aababc2127f83d4ca7dd1c2d18fbbc6f..03f0c46cacd5c44bdf2af14c646f55f3f67463e3 100644 (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
index 244430eb8fc6820499b71e20c714ccd4cd8e2557..bf33da50c1043ceda3e5c08397b552cce44d3bcd 100644 (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 */