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

            Bug ID: 40806
           Summary: [AMDGPU][MC] Different conversion rules for literals
                    and inlinable constants
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: AMDGPU
          Assignee: unassignedb...@nondot.org
          Reporter: dpreobrazhen...@luxoft.com
                CC: llvm-bugs@lists.llvm.org

Currently assembler has different conversion rules for integer literals and
integer inlinable constants which may confuse users.

For integer inlinable constants the input number is truncated to the size of
expected operand type without any checks. For example:

    // src0 is encoded as -1
    // high bits "101" are ignored
    v_add_f32 v0, 0x101ffffffff, v0

For integer literals, assembler checks that the truncated bits are either all
zero or all ones. In the latter case the MSB of the result after truncation
must be 1. For example, the following code will trigger an error:

    v_add_f32 v0, 0x101ffffff00, v0

I believe conversion rules for inlinable constants and for literals should be
as close as possible.

-- 
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