public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/114514] New: v16qi >> 7 can be optimized with vpcmpgtb
@ 2024-03-28  9:38 liuhongt at gcc dot gnu.org
  2024-03-28 23:09 ` [Bug target/114514] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: liuhongt at gcc dot gnu.org @ 2024-03-28  9:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114514

            Bug ID: 114514
           Summary: v16qi >> 7 can be optimized with vpcmpgtb
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: liuhongt at gcc dot gnu.org
  Target Milestone: ---

v16qi
foo2 (v16qi a, v16qi b)
{
    return a >> 7;
}

it can be optimized with
        vpxor   xmm1, xmm1, xmm1
        vpcmpgtb        xmm0, xmm1, xmm0
        ret

currently we generate(emulated with v16hi)

        movl    $16843009, %eax
        vpsraw  $7, %xmm0, %xmm0
        vmovd   %eax, %xmm1
        vpbroadcastd    %xmm1, %xmm1
        vpandn  %xmm1, %xmm0, %xmm0
        vpsubb  %xmm1, %xmm0, %xmm0

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-29  1:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-28  9:38 [Bug target/114514] New: v16qi >> 7 can be optimized with vpcmpgtb liuhongt at gcc dot gnu.org
2024-03-28 23:09 ` [Bug target/114514] " pinskia at gcc dot gnu.org
2024-03-28 23:14 ` pinskia at gcc dot gnu.org
2024-03-29  1:03 ` liuhongt at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).