[LLVMbugs] [Bug 3206] New: lack of select use (cmov)

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Dec 12 17:53:52 PST 2008


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

           Summary: lack of select use (cmov)
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: alexr at leftfield.org
                CC: llvmbugs at cs.uiuc.edu


On i386-apple-darwin, built with "llvmc -O3 -S select_reduced.c" with or
without -clang. At the end of each case should be a select/cmov.

inline __attribute__((always_inline))
unsigned short _OSSwapInt16(unsigned short _data)
{
    return ((_data << 8) | (_data >> 8));
}

inline __attribute__((always_inline))
unsigned short ReadSwapShort(unsigned char* data, unsigned int offset)
{
        return _OSSwapInt16(*(unsigned short*) &data[offset]);
}

unsigned short* myfunc(unsigned short* endCodes, unsigned short probe, unsigned
short entrySelector, unsigned short c)
{
    #define PROBE_SHIFT \
        {\
                probe >>= 1;\
                if (c > _OSSwapInt16(endCodes[probe >> 1]))\
                        endCodes = &endCodes[probe >> 1];\
        }       

        switch (entrySelector)
        {
                case 15:        PROBE_SHIFT;    // FALL-THRU
                case 14:        PROBE_SHIFT;    // FALL-THRU
                case 13:        PROBE_SHIFT;    // FALL-THRU
                case 12:        PROBE_SHIFT;    // FALL-THRU
                case 11:        PROBE_SHIFT;    // FALL-THRU
                case 10:        PROBE_SHIFT;    // FALL-THRU
                case  9:        PROBE_SHIFT;    // FALL-THRU
                case  8:        PROBE_SHIFT;    // FALL-THRU
                case  7:        PROBE_SHIFT;    // FALL-THRU
                case  6:        PROBE_SHIFT;    // FALL-THRU
                case  5:        PROBE_SHIFT;    // FALL-THRU
                case  4:        PROBE_SHIFT;    // FALL-THRU
        }

    return endCodes;    
}


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