1
0
mirror of https://github.com/golang/go synced 2024-11-17 06:04:47 -07:00

cmd/asm: add the fifth argument of the instruction to Optab on arm64

Currently the Optab structure contains four arguments of an instruction,
excludes the fifth argument p.RegTo2. It does not participate in
instruction matching and is usually handled separately.

Instructions with five operands are common in the newer arm instruction
set, so this CL adds the fifth argument to Optab, so that instruction
matching is easier. This caused the oplook function also needs to be
updated synchronously, this CL also made some cleaning and modifications
to this function.

Change-Id: I1d95ad99e72a44dfad1e00db182cfc369a0e55c6
Reviewed-on: https://go-review.googlesource.com/c/go/+/505975
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Eric Fang <eric.fang@arm.com>
This commit is contained in:
erifan01 2023-06-06 17:55:58 +08:00 committed by Eric Fang
parent 598958f0f2
commit 8a1ff51827
4 changed files with 647 additions and 646 deletions

View File

@ -166,94 +166,94 @@ TEXT errors(SB),$0
FSTPD (R1, R2), (R0) // ERROR "invalid register pair"
FMOVS (F2), F0 // ERROR "illegal combination"
FMOVD F0, (F1) // ERROR "illegal combination"
LDADDAD R5, (R6), RSP // ERROR "illegal destination register"
LDADDAW R5, (R6), RSP // ERROR "illegal destination register"
LDADDAH R5, (R6), RSP // ERROR "illegal destination register"
LDADDAB R5, (R6), RSP // ERROR "illegal destination register"
LDADDALD R5, (R6), RSP // ERROR "illegal destination register"
LDADDALW R5, (R6), RSP // ERROR "illegal destination register"
LDADDALH R5, (R6), RSP // ERROR "illegal destination register"
LDADDALB R5, (R6), RSP // ERROR "illegal destination register"
LDADDD R5, (R6), RSP // ERROR "illegal destination register"
LDADDW R5, (R6), RSP // ERROR "illegal destination register"
LDADDH R5, (R6), RSP // ERROR "illegal destination register"
LDADDB R5, (R6), RSP // ERROR "illegal destination register"
LDADDLD R5, (R6), RSP // ERROR "illegal destination register"
LDADDLW R5, (R6), RSP // ERROR "illegal destination register"
LDADDLH R5, (R6), RSP // ERROR "illegal destination register"
LDADDLB R5, (R6), RSP // ERROR "illegal destination register"
LDCLRAD R5, (R6), RSP // ERROR "illegal destination register"
LDCLRAW R5, (R6), RSP // ERROR "illegal destination register"
LDCLRAH R5, (R6), RSP // ERROR "illegal destination register"
LDCLRAB R5, (R6), RSP // ERROR "illegal destination register"
LDCLRALD R5, (R6), RSP // ERROR "illegal destination register"
LDCLRALW R5, (R6), RSP // ERROR "illegal destination register"
LDCLRALH R5, (R6), RSP // ERROR "illegal destination register"
LDCLRALB R5, (R6), RSP // ERROR "illegal destination register"
LDCLRD R5, (R6), RSP // ERROR "illegal destination register"
LDCLRW R5, (R6), RSP // ERROR "illegal destination register"
LDCLRH R5, (R6), RSP // ERROR "illegal destination register"
LDCLRB R5, (R6), RSP // ERROR "illegal destination register"
LDCLRLD R5, (R6), RSP // ERROR "illegal destination register"
LDCLRLW R5, (R6), RSP // ERROR "illegal destination register"
LDCLRLH R5, (R6), RSP // ERROR "illegal destination register"
LDCLRLB R5, (R6), RSP // ERROR "illegal destination register"
LDEORAD R5, (R6), RSP // ERROR "illegal destination register"
LDEORAW R5, (R6), RSP // ERROR "illegal destination register"
LDEORAH R5, (R6), RSP // ERROR "illegal destination register"
LDEORAB R5, (R6), RSP // ERROR "illegal destination register"
LDEORALD R5, (R6), RSP // ERROR "illegal destination register"
LDEORALW R5, (R6), RSP // ERROR "illegal destination register"
LDEORALH R5, (R6), RSP // ERROR "illegal destination register"
LDEORALB R5, (R6), RSP // ERROR "illegal destination register"
LDEORD R5, (R6), RSP // ERROR "illegal destination register"
LDEORW R5, (R6), RSP // ERROR "illegal destination register"
LDEORH R5, (R6), RSP // ERROR "illegal destination register"
LDEORB R5, (R6), RSP // ERROR "illegal destination register"
LDEORLD R5, (R6), RSP // ERROR "illegal destination register"
LDEORLW R5, (R6), RSP // ERROR "illegal destination register"
LDEORLH R5, (R6), RSP // ERROR "illegal destination register"
LDEORLB R5, (R6), RSP // ERROR "illegal destination register"
LDORAD R5, (R6), RSP // ERROR "illegal destination register"
LDORAW R5, (R6), RSP // ERROR "illegal destination register"
LDORAH R5, (R6), RSP // ERROR "illegal destination register"
LDORAB R5, (R6), RSP // ERROR "illegal destination register"
LDORALD R5, (R6), RSP // ERROR "illegal destination register"
LDORALW R5, (R6), RSP // ERROR "illegal destination register"
LDORALH R5, (R6), RSP // ERROR "illegal destination register"
LDORALB R5, (R6), RSP // ERROR "illegal destination register"
LDORD R5, (R6), RSP // ERROR "illegal destination register"
LDORW R5, (R6), RSP // ERROR "illegal destination register"
LDORH R5, (R6), RSP // ERROR "illegal destination register"
LDORB R5, (R6), RSP // ERROR "illegal destination register"
LDORLD R5, (R6), RSP // ERROR "illegal destination register"
LDORLW R5, (R6), RSP // ERROR "illegal destination register"
LDORLH R5, (R6), RSP // ERROR "illegal destination register"
LDORLB R5, (R6), RSP // ERROR "illegal destination register"
SWPAD R5, (R6), RSP // ERROR "illegal destination register"
SWPAW R5, (R6), RSP // ERROR "illegal destination register"
SWPAH R5, (R6), RSP // ERROR "illegal destination register"
SWPAB R5, (R6), RSP // ERROR "illegal destination register"
SWPALD R5, (R6), RSP // ERROR "illegal destination register"
SWPALW R5, (R6), RSP // ERROR "illegal destination register"
SWPALH R5, (R6), RSP // ERROR "illegal destination register"
SWPALB R5, (R6), RSP // ERROR "illegal destination register"
SWPD R5, (R6), RSP // ERROR "illegal destination register"
SWPW R5, (R6), RSP // ERROR "illegal destination register"
SWPH R5, (R6), RSP // ERROR "illegal destination register"
SWPB R5, (R6), RSP // ERROR "illegal destination register"
SWPLD R5, (R6), RSP // ERROR "illegal destination register"
SWPLW R5, (R6), RSP // ERROR "illegal destination register"
SWPLH R5, (R6), RSP // ERROR "illegal destination register"
SWPLB R5, (R6), RSP // ERROR "illegal destination register"
STXR R5, (R6), RSP // ERROR "illegal destination register"
STXRW R5, (R6), RSP // ERROR "illegal destination register"
STLXR R5, (R6), RSP // ERROR "illegal destination register"
STLXRW R5, (R6), RSP // ERROR "illegal destination register"
STXP (R5, R7), (R6), RSP // ERROR "illegal destination register"
STXPW (R5, R7), (R6), RSP // ERROR "illegal destination register"
STLXP (R5, R7), (R6), RSP // ERROR "illegal destination register"
STLXP (R5, R7), (R6), RSP // ERROR "illegal destination register"
LDADDAD R5, (R6), RSP // ERROR "illegal combination"
LDADDAW R5, (R6), RSP // ERROR "illegal combination"
LDADDAH R5, (R6), RSP // ERROR "illegal combination"
LDADDAB R5, (R6), RSP // ERROR "illegal combination"
LDADDALD R5, (R6), RSP // ERROR "illegal combination"
LDADDALW R5, (R6), RSP // ERROR "illegal combination"
LDADDALH R5, (R6), RSP // ERROR "illegal combination"
LDADDALB R5, (R6), RSP // ERROR "illegal combination"
LDADDD R5, (R6), RSP // ERROR "illegal combination"
LDADDW R5, (R6), RSP // ERROR "illegal combination"
LDADDH R5, (R6), RSP // ERROR "illegal combination"
LDADDB R5, (R6), RSP // ERROR "illegal combination"
LDADDLD R5, (R6), RSP // ERROR "illegal combination"
LDADDLW R5, (R6), RSP // ERROR "illegal combination"
LDADDLH R5, (R6), RSP // ERROR "illegal combination"
LDADDLB R5, (R6), RSP // ERROR "illegal combination"
LDCLRAD R5, (R6), RSP // ERROR "illegal combination"
LDCLRAW R5, (R6), RSP // ERROR "illegal combination"
LDCLRAH R5, (R6), RSP // ERROR "illegal combination"
LDCLRAB R5, (R6), RSP // ERROR "illegal combination"
LDCLRALD R5, (R6), RSP // ERROR "illegal combination"
LDCLRALW R5, (R6), RSP // ERROR "illegal combination"
LDCLRALH R5, (R6), RSP // ERROR "illegal combination"
LDCLRALB R5, (R6), RSP // ERROR "illegal combination"
LDCLRD R5, (R6), RSP // ERROR "illegal combination"
LDCLRW R5, (R6), RSP // ERROR "illegal combination"
LDCLRH R5, (R6), RSP // ERROR "illegal combination"
LDCLRB R5, (R6), RSP // ERROR "illegal combination"
LDCLRLD R5, (R6), RSP // ERROR "illegal combination"
LDCLRLW R5, (R6), RSP // ERROR "illegal combination"
LDCLRLH R5, (R6), RSP // ERROR "illegal combination"
LDCLRLB R5, (R6), RSP // ERROR "illegal combination"
LDEORAD R5, (R6), RSP // ERROR "illegal combination"
LDEORAW R5, (R6), RSP // ERROR "illegal combination"
LDEORAH R5, (R6), RSP // ERROR "illegal combination"
LDEORAB R5, (R6), RSP // ERROR "illegal combination"
LDEORALD R5, (R6), RSP // ERROR "illegal combination"
LDEORALW R5, (R6), RSP // ERROR "illegal combination"
LDEORALH R5, (R6), RSP // ERROR "illegal combination"
LDEORALB R5, (R6), RSP // ERROR "illegal combination"
LDEORD R5, (R6), RSP // ERROR "illegal combination"
LDEORW R5, (R6), RSP // ERROR "illegal combination"
LDEORH R5, (R6), RSP // ERROR "illegal combination"
LDEORB R5, (R6), RSP // ERROR "illegal combination"
LDEORLD R5, (R6), RSP // ERROR "illegal combination"
LDEORLW R5, (R6), RSP // ERROR "illegal combination"
LDEORLH R5, (R6), RSP // ERROR "illegal combination"
LDEORLB R5, (R6), RSP // ERROR "illegal combination"
LDORAD R5, (R6), RSP // ERROR "illegal combination"
LDORAW R5, (R6), RSP // ERROR "illegal combination"
LDORAH R5, (R6), RSP // ERROR "illegal combination"
LDORAB R5, (R6), RSP // ERROR "illegal combination"
LDORALD R5, (R6), RSP // ERROR "illegal combination"
LDORALW R5, (R6), RSP // ERROR "illegal combination"
LDORALH R5, (R6), RSP // ERROR "illegal combination"
LDORALB R5, (R6), RSP // ERROR "illegal combination"
LDORD R5, (R6), RSP // ERROR "illegal combination"
LDORW R5, (R6), RSP // ERROR "illegal combination"
LDORH R5, (R6), RSP // ERROR "illegal combination"
LDORB R5, (R6), RSP // ERROR "illegal combination"
LDORLD R5, (R6), RSP // ERROR "illegal combination"
LDORLW R5, (R6), RSP // ERROR "illegal combination"
LDORLH R5, (R6), RSP // ERROR "illegal combination"
LDORLB R5, (R6), RSP // ERROR "illegal combination"
SWPAD R5, (R6), RSP // ERROR "illegal combination"
SWPAW R5, (R6), RSP // ERROR "illegal combination"
SWPAH R5, (R6), RSP // ERROR "illegal combination"
SWPAB R5, (R6), RSP // ERROR "illegal combination"
SWPALD R5, (R6), RSP // ERROR "illegal combination"
SWPALW R5, (R6), RSP // ERROR "illegal combination"
SWPALH R5, (R6), RSP // ERROR "illegal combination"
SWPALB R5, (R6), RSP // ERROR "illegal combination"
SWPD R5, (R6), RSP // ERROR "illegal combination"
SWPW R5, (R6), RSP // ERROR "illegal combination"
SWPH R5, (R6), RSP // ERROR "illegal combination"
SWPB R5, (R6), RSP // ERROR "illegal combination"
SWPLD R5, (R6), RSP // ERROR "illegal combination"
SWPLW R5, (R6), RSP // ERROR "illegal combination"
SWPLH R5, (R6), RSP // ERROR "illegal combination"
SWPLB R5, (R6), RSP // ERROR "illegal combination"
STXR R5, (R6), RSP // ERROR "illegal combination"
STXRW R5, (R6), RSP // ERROR "illegal combination"
STLXR R5, (R6), RSP // ERROR "illegal combination"
STLXRW R5, (R6), RSP // ERROR "illegal combination"
STXP (R5, R7), (R6), RSP // ERROR "illegal combination"
STXPW (R5, R7), (R6), RSP // ERROR "illegal combination"
STLXP (R5, R7), (R6), RSP // ERROR "illegal combination"
STLXP (R5, R7), (R6), RSP // ERROR "illegal combination"
MSR OSLAR_EL1, R5 // ERROR "illegal combination"
MRS R11, AIDR_EL1 // ERROR "illegal combination"
MSR R6, AIDR_EL1 // ERROR "system register is not writable"

View File

@ -341,21 +341,21 @@ const (
// optab is sorted based on the order of these constants
// and the first match is chosen.
// The more specific class needs to come earlier.
C_NONE = iota
C_REG // R0..R30
C_ZREG // R0..R30, ZR
C_RSP // R0..R30, RSP
C_FREG // F0..F31
C_VREG // V0..V31
C_PAIR // (Rn, Rm)
C_SHIFT // Rn<<2
C_EXTREG // Rn.UXTB[<<3]
C_SPR // REG_NZCV
C_COND // condition code, EQ, NE, etc.
C_SPOP // special operand, PLDL1KEEP, VMALLE1IS, etc.
C_ARNG // Vn.<T>
C_ELEM // Vn.<T>[index]
C_LIST // [V1, V2, V3]
C_NONE = iota + 1 // starting from 1, leave unclassified Addr's class as 0
C_REG // R0..R30
C_ZREG // R0..R30, ZR
C_RSP // R0..R30, RSP
C_FREG // F0..F31
C_VREG // V0..V31
C_PAIR // (Rn, Rm)
C_SHIFT // Rn<<2
C_EXTREG // Rn.UXTB[<<3]
C_SPR // REG_NZCV
C_COND // condition code, EQ, NE, etc.
C_SPOP // special operand, PLDL1KEEP, VMALLE1IS, etc.
C_ARNG // Vn.<T>
C_ELEM // Vn.<T>[index]
C_LIST // [V1, V2, V3]
C_ZCON // $0
C_ABCON0 // could be C_ADDCON0 or C_BITCON

View File

@ -6,6 +6,7 @@ package arm64
// This order should be strictly consistent to that in a.out.go
var cnames7 = []string{
"", // C_NONE starts from 1
"NONE",
"REG",
"ZREG",

File diff suppressed because it is too large Load Diff