Skip to content
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

Closed
llvmbot opened this issue Aug 6, 2009 · 6 comments
Closed

arm10tdmi (armv5) does not support strd #5059

llvmbot opened this issue Aug 6, 2009 · 6 comments
Labels
backend:ARM bugzilla Issues migrated from bugzilla

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 6, 2009

Bugzilla Link 4687
Resolution FIXED
Resolved on Sep 29, 2009 02:08
Version trunk
OS Linux
Attachments testcase
Reporter LLVM Bugzilla Contributor
CC @asl

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.)

@llvmbot
Copy link
Collaborator Author

llvmbot commented Aug 19, 2009

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, ..."

@llvmbot
Copy link
Collaborator Author

llvmbot commented Aug 19, 2009

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.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Aug 27, 2009

STRD and LDRD instruction definitions fixed in r80244, the other issue still remains.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Sep 27, 2009

@llvmbot
Copy link
Collaborator Author

llvmbot commented Sep 27, 2009

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.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Sep 29, 2009

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:ARM bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

1 participant