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

            Bug ID: 41952
           Summary: [x86] shiftAmountMod should be more eager?
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

unsigned test(unsigned val, unsigned a, unsigned b) {
    unsigned shift = (32 - a) - b;
    return val << shift;
}

clang produces 

        mov     eax, 32
        sub     eax, esi
        sub     eax, edx
        shlx    eax, edi, eax

icc produces

        neg       esi      # <- yay
        sub       esi, edx
        mov       ecx, esi
        shl       edi, cl

https://godbolt.org/z/gdGx_u

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

Reply via email to