[LLVMbugs] [Bug 9784] New: Inefficient encoding of cmp/test with immediate argument and dead register

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 22 18:09:11 PDT 2011


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

           Summary: Inefficient encoding of cmp/test with immediate
                    argument and dead register
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: joerg at NetBSD.org
                CC: llvmbugs at cs.uiuc.edu


64bit mode:

        cmpl    $0xffffffff, %eax       # 3 Bytes
        incl    %eax                    # 2 Bytes
        cmpl    $1, %eax                # 3 Bytes
        decl    %eax                    # 2 Byes
        cmpl    $128, %eax              # 5 Bytes
        addl    $-128, %eax             # 3 Bytes

        cmpq    $-1, %rax               # 4 Bytes
        incq    %rax                    # 3 Bytes
        cmpq    $1, %rax                # 4 Bytes
        decq    %rax                    # 3 Bytes
        cmpq    $128, %rax              # 6 Bytes
        addq    $-128, %rax             # 4 Bytes

        cmpw    $-1, %ax                # 4 Bytes
        incw    %ax                     # 3 Bytes
        cmpw    $1, %ax                 # 4 Bytes
        decw    %ax                     # 3 Bytes

        testl   $-1, %eax               # 5 Bytes
        andl    $-1, %eax               # 3 Bytes

        testq   $-1, %rax               # 6 Bytes
        andq    $-1, %rax               # 4 Bytes

32bit mode:

        cmpl    $0xffffffff, %eax       # 3 Bytes
        incl    %eax                    # 1 Bytes
        cmpl    $1, %eax                # 3 Bytes
        decl    %eax                    # 1 Byes
        cmpl    $128, %eax              # 5 Bytes
        addl    $-128, %eax             # 3 Bytes

        cmpw    $-1, %ax                # 4 Bytes
        incw    %ax                     # 2 Bytes
        cmpw    $1, %ax                 # 4 Bytes
        decw    %ax                     # 2 Bytes

        testl   $0xffffffff, %eax       # 5 Bytes
        andl    $-1, %eax               # 3 Bytes

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list