This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, i386]: Introduce usadv8qi


We can vectorize the testcase to:

        movq    pix1(%rip), %xmm0
        movq    pix2(%rip), %xmm1
        psadbw  %xmm1, %xmm0
        movd    %xmm0, %edx
*       pextrq  $1, %xmm0, %eax
*       addl    %edx, %eax
        ret

The instructions, marked with (*) are generated due to middle end
limitation that generates SImode vector (V2SImode) temporary for int
summing variable. This is not the case with psadbw, which natively
sums to V1DImode. The code is still way better that the un-vectorized
loop.

2019-08-01  Uroš Bizjak  <ubizjak@gmail.com>

    PR target/85693
    * config/i386/mmx.md (usadv8qi): New expander.

testsuite/ChangeLog:

2019-08-01  Uroš Bizjak  <ubizjak@gmail.com>

    PR target/85693
    * gcc.target/i386/pr85693-1.c: New test.

Bootstrapped and regression tested on x86_64-linux-gnu.

Committed to mainline SVN.

Uros.

Attachment: p.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]