[LLVMbugs] [Bug 23100] New: Suboptimal encoding of 64 bit and with small immediate

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 1 13:01:55 PDT 2015


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

            Bug ID: 23100
           Summary: Suboptimal encoding of 64 bit and with small immediate
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: benny.kra at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

$ cat t.c                                                                       
long long foo(long long x) { return x & 42; }

$ clang -S -o - t.c -O3|grep and|llvm-mc -show-encoding
        andq    $42, %rdi               # encoding: [0x48,0x83,0xe7,0x2a]

$ gcc -S -o - t.c -O3|grep and|llvm-mc -show-encoding
        andl    $42, %eax               # encoding: [0x83,0xe0,0x2a]

We have a pattern for this in X86InstrCompiler.td but it's not getting selected
for some reason.

-- 
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/20150401/85088731/attachment.html>


More information about the llvm-bugs mailing list