1
0
mirror of https://github.com/golang/go synced 2024-11-14 20:10:30 -07:00

code review changes for registers

Change-Id: I39443f35c07db45a60ce90bf202306042a0c8e1b
This commit is contained in:
Mauri de Souza Meneguzzo 2024-10-21 18:39:57 -03:00
parent d99a3f0a6c
commit d6a797836a
No known key found for this signature in database
GPG Key ID: 20F8BD208210BEF4
2 changed files with 4 additions and 6 deletions

View File

@ -261,8 +261,6 @@ TEXT errors(SB),$0
STREXD R0, (R2), R2 // ERROR "cannot use same register as both source and destination"
STREXD R1, (R4), R7 // ERROR "must be even"
STREXB R0, (R2), R0 // ERROR "cannot use same register as both source and destination"
STREXB R0, (R2), R1 // ERROR "cannot use same register as both source and destination"
STREXB R0, (R2), R2 // ERROR "cannot use same register as both source and destination"
STREXB R1, (R4), R7 // ERROR "must be even"
END

View File

@ -2425,15 +2425,15 @@ func (c *ctxt5) asmout(p *obj.Prog, o *Optab, out []uint32) {
if c.instoffset != 0 {
c.ctxt.Diag("offset must be zero in STREX")
}
if p.Reg&1 != 0 {
c.ctxt.Diag("source register must be even in STREXD: %v", p)
}
if p.To.Reg == p.From.Reg || p.To.Reg == p.Reg || p.To.Reg == p.Reg+1 {
if p.To.Reg == p.From.Reg || p.To.Reg == p.Reg || (p.As == ASTREXD && p.To.Reg == p.Reg+1) {
c.ctxt.Diag("cannot use same register as both source and destination: %v", p)
}
switch p.As {
case ASTREXD:
if p.Reg&1 != 0 {
c.ctxt.Diag("source register must be even in STREXD: %v", p)
}
o1 = 0x1a << 20
case ASTREXB:
o1 = 0x1c << 20