i think we need more special cases. for example, this plan 9 assembly: MOVM.IA.W [R0-R7], ...
9 years, 11 months ago
(2014-06-01 08:15:48 UTC)
#3
Message was sent while issue was closed.
i think we need more special cases. for example,
this plan 9 assembly:
MOVM.IA.W [R0-R7], R8
is disassembled as:
STM [R0-R7], R8!
of course, this depends on how close to the plan 9 syntax
you want to make cmd/objdump.
other issues that I found while playing with cmd/objdump:
1. translate MVN $x, Ra to MOVW $~x, Ra; similar for CMN.
2. translate PUSH and POP to appropriate MOVMs.
3. (probably a problem of the objdump, not the arm disassembler)
all private symbols are not decoded (e.g. udiv<>(SB) in
src/pkg/runtime/vlop_arm.s)
I understand that it's pretty close to 1.3 release and you're
busy fixing the other more important bugs, so please feel
free to defer any of the above issues and comment marked
non-essential below, but please do address the Mem issue.
https://codereview.appspot.com/106720044/diff/1/armasm/plan9x.go
File armasm/plan9x.go (right):
https://codereview.appspot.com/106720044/diff/1/armasm/plan9x.go#newcode44
armasm/plan9x.go:44: if inst.Op&^15 == LDR_EQ && reg == R15 && mem.Base == SP &&
mem.Sign == 0 && mem.Mode == AddrPostIndex {
also need to check for POP [R15] (not essential).
https://codereview.appspot.com/106720044/diff/1/armasm/plan9x.go#newcode124
armasm/plan9x.go:124: op = "MOVB" + op[4:] + suffix
LDRB means load byte with zero extend in ARM docs., whereas MOVB is
load byte with sign extension.
LDRB should translate to MOVBU, and LDRSB should translate to MOVB.
similar for LDR{,S}H.
https://codereview.appspot.com/106720044/diff/1/armasm/plan9x.go#newcode157
armasm/plan9x.go:157: return fmt.Sprintf("$%d", int(a))
why use decimal instead of hexadecimal here?
https://codereview.appspot.com/106720044/diff/1/armasm/plan9x.go#newcode159
armasm/plan9x.go:159: case Mem:
perhaps I'm missing something, but i didn't find where
you handled proper plan 9 translation of Mem operands
for LDRD, SWP, LDM/STM, LDREX/STREX instructions.
why not move the special handling code here?
Issue 106720044: code review 106720044: armasm: add plan 9 output
(Closed)
Created 9 years, 11 months ago by rsc
Modified 9 years, 11 months ago
Reviewers: minux
Base URL:
Comments: 4