Skip to content

ARM Assembler does not support [pc, #offset] syntax for Thumb narrow LDR instructions. #13631

Closed
@RichBarton-Arm

Description

@RichBarton-Arm
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions