Closed
Description
Bugzilla Link | 13259 |
Resolution | FIXED |
Resolved on | Dec 09, 2015 10:51 |
Version | trunk |
OS | All |
Blocks | llvm/llvm-bugzilla-archive#18926 |
CC | @rengolin |
Extended Description
LDR ,[pc, #0]
Should form a valid syntax for a pc-relative load. Currently the Thumb assembler only generates the wide encoding for this instruction, when the narrow encoding should be available.
Reproduce with:
echo "LDR r0,[pc, #4]" | ./llvm-oss/build-dbg/bin/llvm-mc -triple thumbv7 -show-encoding -show-inst
MC appears to treat immediates as offsets form the pc in this context (which I think is more than a little questionable). Assembling "LDR r0,#4" gives the narrow encoding.