Skip to content
This repository was archived by the owner on Sep 2, 2018. It is now read-only.

Support parsing LDD/STD instructions #71

Closed
dylanmckay opened this issue Apr 6, 2015 · 3 comments
Closed

Support parsing LDD/STD instructions #71

dylanmckay opened this issue Apr 6, 2015 · 3 comments

Comments

@dylanmckay
Copy link
Member

The parser does not handle the Y+2, Z+3 operand types.

Once this instruction is fixed, take the XFAIL attribute from test/MC/AVR/inst-ldd.s and test/MC/AVR/inst-std.s.

@dylanmckay
Copy link
Member Author

One possible solution would be to create a custom operand type with a custom parser match class. It is unclear how clean this solution will be. I tried this in a private branch. I could successfully parse the <PTR>+<IMM> operands into a custom operand named memri (memory register+immediate). The problem was that how would the instruction bit fields map to the operand.

We would normally have a bitfield for each of the register and the immediate. If these two are concatenated into one operand, we probably have to write a custom encoder method to concatenate the bits and extract them in AVRInstrInfo.td. This may not be such a bad idea, however. We currently have a hack that defines an extra bit for the pointer register variable for LD/ST (because the bit depends on the instruction itself, this provided a hook so we can check the instruction in C++ and set the bit appropriately). We could hoist this up to memri and then turn LD r5, Y into an alias of LDD r5, Y+0.

That depends on whether we will be able to express an operand of type memri in an InstAlias, and it is also complicated because LD and ST are defined for the X, Y, and Z pointer registers, but LDD and STD are only defined for Y and Z. It is also less useful because the postincrement/predecrement variants of LD and ST are not aliases of LDD and STD in terms of machine code representation.

dylanmckay pushed a commit that referenced this issue May 4, 2015
These are tests which are broken because they depend on issues which
haven't been fixed yet.

- `LDD`/`STD` (#71)
- `MOVW` (#84)
@dylanmckay dylanmckay changed the title Support LDD/STD instructions Support parsing LDD/STD instructions Jun 4, 2015
@agnat
Copy link

agnat commented Jun 5, 2015

The parsing bit is fixed in 204b291. The encoding part was done in 9de9e69.

Looks done to me.

@dylanmckay
Copy link
Member Author

I concur.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants