https://bugs.llvm.org/show_bug.cgi?id=50664

            Bug ID: 50664
           Summary: [MC][Thumb2] .w suffix rejected for certain ldr and
                    str operands
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: ARM
          Assignee: unassignedb...@nondot.org
          Reporter: rprich...@google.com
                CC: llvm-bugs@lists.llvm.org, smithp...@googlemail.com,
                    ties.st...@arm.com

LLVM can assemble this Thumb2 code (clang --target=armv7a-linux-gnueabi):

    .syntax unified
    .thumb
    ldr.w r0, [r1, #0xf00]

But not this:

    .syntax unified
    .thumb
    ldr.w r0, [r1, #-2]

test.S:3:15: error: invalid operand for instruction
    ldr.w r0, [r1, #-2]
              ^

It will assemble if I remove the ".w" suffix. The disassembly is then:

00000000 <.text>:
   0:   f851 0c02       ldr.w   r0, [r1, #-2]

... which indicates a wide instruction.

Maybe the fix for bug #49118 was incomplete?

There are some similar instructions that, IIRC, use the same encoding, and have
the same problem. They're wide instructions that can only be assembled if the
".w" suffix is omitted:

    ldr.w r0, [r1, #2]!
    ldr.w r0, [r1], #2
    ldr.w r0, [r1, #-0]

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to