Closed cpldcpu closed 8 years ago
I wouldn't be surprised to be honest, I haven't worked on AVR Tiny support very much.
Good thing is though that this is an easy fix :)
@cpldcpu: Is MOVW
unsupported by all Tiny cores or just the 10?
Looking at the datasheet to the ATtiny25, it looks like it's not all of the Tiny cores.
Pulling up the datasheet for the ATtiny10 family, it looks like these are the devices that don't support the instruction.
It looks like in AVRInstrInfo::copyPhysReg
, we were unconditionally creating MOVW
instructions, ignoring the subtarget settings.
Am fixing it up now to use two 8-bit MOV
instructions if MOVW
is unsupported.
Would you be able to test that the fix works @cpldcpu once I merge it?
Should be fixed as of f6524cd0. @cpldcpu can you confirm this?
All devices with the "avrtiny" architecture do not support MOVW: ATtiny 4/5/9/10/20/40/102/104
This is just a small subset of the "ATtiny" series. The ATtiny 25 is based on the AVR25 architecture.
Slightly confusing...
I will test later.
Btw - I came across a huge load of issues in connection with assembler code. Is this currently a focus?
So, to be clear, we should disable MOVW
for all tiny cores except the 25
, 45
, and 85
?
Btw - I came across a huge load of issues in connection with assembler code. Is this currently a focus?
What kind of issues?
Nono, only for the "tinyavr" / "reduced core" architecture. See Avr-gcc mapping:
http://www.nongnu.org/avr-libc/user-manual/using_tools.html
Regarding assembler: Can provide more bug reports later. I have been trying to compile V-USB.
The table of subtarget features we have is pretty much taken from that data, so after f6524cd this should now work correctly for all Tiny devices.
@cpldcpu if you want to open an issue, go ahead :)
Might as well add the latest two:
def : Device<"attiny102", FamilyAVRTiny, ELFArchAVRTiny>; def : Device<"attiny104", FamilyAVRTiny, ELFArchAVRTiny>;
Will open an issue later.
Have added those devices as of 0c265ab.
Ok, recompiled and tested my code. Looks looks good now.
I just noticed, that the code generator generates a word reg-reg move instruction (MOVW) also for the tinyavr core (ATtiny10). This is not support according to the datasheet.
See attached example.
avrtest.zip