-
Notifications
You must be signed in to change notification settings - Fork 21
Implement the 16-bit STS instruction #138
Comments
cc @agnat |
If I'm not mistaken both versions take a single register. Anyway... I think it is pretty low priority. It seems like a nice task for a boring winter evening, though. Let's keep the ticket and ignore it for now. Maybe change the title to something more... actionable. |
Hm, I see... It only takes one cycle. Anyway, I still think it's low priority. |
The reason I originally said this would be difficult to implement was because I assumed we'd have to be smart about selecting the correct instruction based on the registers. It should be fairly straightforward to implement without this behaviour, which is what GCC does too I think. |
Removing low priority tag because this blocks AVRTiny, which doesn't have the 32-bit variant. |
There are two instructions which perform direct stores to data space.
STS k, Rr
STS k, Rr
They have the same mnemonic, but one is a 32-bit wide instruction taking a GPR pair as an operand, and one is a 16-bit wide instruction taking a single GPR(although it only uses the upper 16 registers (
r16
-r31
).It seems as if the 16-bit version is unsupported - it isn't enabled when compiling on the higher end XMEGAs, or the low end
avr2
s. I discovered it by accident when usingavr-as -mall-opcodes
on our test suite. It seems as if the only way it is enabled is using this command, and it is probably a bug in that regard because it "overrides" the 32-bit version so it cannot be used with the flag.The instruction set manual section on the 16-bit variant.
Of course, the instruction is still a part of the ISA, so the question then follows - do we support it (very difficult and time consuming, probably a terrible idea), or pretend it doesn't exist, and only support the 32-bit variant?
The text was updated successfully, but these errors were encountered: