mirror of
https://github.com/golang/go
synced 2024-11-14 22:30:26 -07:00
code review changes for registers
Change-Id: I39443f35c07db45a60ce90bf202306042a0c8e1b
This commit is contained in:
parent
d99a3f0a6c
commit
d6a797836a
2
src/cmd/asm/internal/asm/testdata/armerror.s
vendored
2
src/cmd/asm/internal/asm/testdata/armerror.s
vendored
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user