[LLVMbugs] [Bug 21994] New: Integrated aarch64 assembler should exchange cmp/cmn given negative immediates

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Dec 19 16:43:34 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=21994

            Bug ID: 21994
           Summary: Integrated aarch64 assembler should exchange cmp/cmn
                    given negative immediates
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: AArch64
          Assignee: unassignedbugs at nondot.org
          Reporter: simon.hosie at arm.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Given:
foo:
    cmp     x0, #-1
    ret

`clang -c --target=aarch64-linux-gnu -integrated-as cmn_aarch64.s` gives:
cmn_aarch64.s:2:17: error: expected compatible register, symbol or integer in
range [0, 4095]

while `clang -c --target=aarch64-linux-gnu -no-integrated-as cmn_aarch64.s`
succeeds and gives code that disassembles to:
0000000000000000 <foo>:
   0:   b100041f        cmn     x0, #0x1
   4:   d65f03c0        ret

gas appears to accept negative immediates an implicitly changes the cmp to a
cmn to make the instruction legal, while llvm simply rejects the immediate.  I
don't think GCC generates this.  It's just handwritten assembly which stumbles
into the incompatibility.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141220/96a43515/attachment.html>


More information about the llvm-bugs mailing list