You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The assembler front end expects SWPW/SWPBU in
SWPBU R4, (R2), R8
Otherwise it will complaint
SWPBU: expected register; found (R2)
But it I add a new line in cmd/asm/internal/asm/testdata/arm.s
endtoend_test.go:155: mismatched output:
have 00725 (testdata/arm.s:1001) SWPBU (R2), R4, R8
want 00725 (testdata/arm.s:1001) SWPBU R4, (R2), R8
SWI
According to the newest ARM maunal,
SWI only has one form
SWI $imm
But
SWI (R0) is also accepted, which should be rejected.
The text was updated successfully, but these errors were encountered:
SWPW/SWPBU can be fixed by changing either the front end, line 555 - 566 of cmd/asm/internal/asm/asm.go
case sys.ARM:
// Special cases.
if arch.IsARMSTREX(op) {
/*
STREX x, (y), z
from=(y) reg=x to=z
*/
prog.From = a[1]
prog.Reg = p.getRegister(prog, op, &a[0])
prog.To = a[2]
break
}
or the backend line 219 of cmd/internal/obj/arm/asm5.go
{ASWPW, C_SOREG, C_REG, C_REG, 40, 4, 0, 0, 0},
which one is better?
no "SWI (Reg)" is used in the entire go source tree, so we can safely remove line 130 of cmd/internal/obj/arm/asm5.go
There is a "STREX R3, (R1), R0" in runtime/internal/atomic/asm_arm.s, and
"{ASTREXD, C_SOREG, C_REG, C_REG, 92, 4, 0, 0, 0}," in cmd/internal/obj/arm/asm5.go,
so the least change way might be changing cmd/asm/internal/asm/testdata/arm.s,
SWPW R3, (R7), R9 // SWPW (R7), R3, R9 // 939007e1
SWPBU R4, (R2), R8 // SWPBU (R2), R4, R8 // 948042e1
benshi001
changed the title
Wrong SWI/SWPW/SWPBU in ARM assembler
cmd/internal/obj/arm: Wrong SWI/SWPW/SWPBU in ARM assembler
May 16, 2017
The assembler front end expects SWPW/SWPBU in
SWPBU R4, (R2), R8
Otherwise it will complaint
SWPBU: expected register; found (R2)
But it I add a new line in cmd/asm/internal/asm/testdata/arm.s
endtoend_test.go:155: mismatched output:
have 00725 (testdata/arm.s:1001) SWPBU (R2), R4, R8
want 00725 (testdata/arm.s:1001) SWPBU R4, (R2), R8
According to the newest ARM maunal,
SWI only has one form
SWI $imm
But
SWI (R0) is also accepted, which should be rejected.
The text was updated successfully, but these errors were encountered: