[LLVMbugs] [Bug 14613] New: X86: Need to implement a pattern for saturated add/sub

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Dec 14 23:13:44 PST 2012


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

             Bug #: 14613
           Summary: X86: Need to implement a pattern for saturated add/sub
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nrotem at apple.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


GZIP has the following loop:

    for (n = 0; n < HASH_SIZE; n++) {
            m = head[n];
            head[n] = (Pos)(m >= WSIZE ? m-WSIZE : NIL);
        }


When vectorized we get this code:

        pxor    %xmm3, %xmm3
        pcmpgtw %xmm2, %xmm3
        pxor    %xmm0, %xmm2
        pand    %xmm3, %xmm2
        pandn   %xmm1, %xmm3
        por     %xmm2, %xmm3


The same can be implemented using:
        psubusw %xmm0, %xmm2

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