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

            Bug ID: 23227
           Summary: MCExpr evaluation shouldn't always be signed
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: MC
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Consider:

echo 'movz x1, ((0xfffffffffffffffc & 0xffff000000000000) >> 48), LSL #48' |
llvm-mc -arch aarch64

<stdin>:1:10: error: immediate must be an integer in range [0, 65535].
movz x1, ((0xfffffffffffffffc & 0xffff000000000000) >> 48), LSL #48

That's not true with a logical shift, but MCExpr evaluation works on int64_t,
and propagates the "sign" bit.

There's a FIXME for this, but, to my knowledge, no PR:
    // FIXME: We need target hooks for the evaluation. It may be limited in
    // width, and gas defines the result of comparisons and right shifts
    // differently from Apple as.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to