New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arm10tdmi (armv5) does not support strd #5059
Comments
The problem is that ArmInstrInfo.td defines STRD as requiring HasV5T whereas it should require HasV5TE. LDRD has the same bug. Research: "ARM1020T is built around the ARM10TDMI processor unit. This is an ARMv5T implementation ..." ARMv5T has no STRD -- it only has STR, STRH, and STRB. Same for LDRD. "Architecture v5TE and later processors provide LDRD and STRD instructions to load/store 64-bit data, ..." |
Changing as I described above makes the test case not output STRD, but only if I also remove the line target triple = "armv5-unknown-linux-gnueabi" from the .ll file and recompile. Leaving it there overrides my command-line -mcpu flag and still generates STRD instructions while also printing out the line .cpu arm10tdmi which is contradictory. So, while we should just fix the STRD and LDRD definitions, there's another bug here. |
STRD and LDRD instruction definitions fixed in r80244, the other issue still remains. |
I believe I've just bumped in the remainder of this bug, i.e. ldrd/strd instructions were still generated despite having selected a pre-ARM v5TE architecture. I've created a simple patch for ARMPreAllocLoadStoreOpt::CanFormLdStDWord() which fixes my problem. |
Thanks. I've applied the patch. |
Extended Description
LLVM is emitting bad assembly for the attached testcase:
$ llc -O2 -mcpu=arm10tdmi x.bc -o - | grep cpu
.cpu arm10tdmi
$ llc -O2 -mcpu=arm10tdmi x.bc -o - | grep strd
strd r0, [r6]
strd r0, [r6, #+8]
$ llc -O2 -mcpu=arm10tdmi x.bc -o - | as
{standard input}: Assembler messages:
{standard input}:545: Error: selected processor does not support
strd r0,[r6]' {standard input}:551: Error: selected processor does not support
strd r0,[r6,#+8]'Apparently ARMv5 is too old for the 'strd' instruction. (Or perhaps my binutils just thinks it is.)
The text was updated successfully, but these errors were encountered: