[LLVMbugs] [Bug 8785] New: Suboptimal for logical test -> 0/1 with width > 8bit.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Dec 13 17:15:00 PST 2010


           Summary: Suboptimal for logical test -> 0/1 with width > 8bit.
           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

Test program:

int testf(int f)
    return f != 0;

Resulting assembler:
    testl    %edi, %edi
    setne    %al
    movzbl    %al, %eax

More compact assembler:
    xorl    %eax, %eax
    testl    %edi, %edi
    setne    %al

This saves one byte and may result in better scheduling.

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