public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/101956] New: Miss vectorization from v4hi to v4df
@ 2021-08-18  6:00 crazylht at gmail dot com
  2021-08-18  6:11 ` [Bug target/101956] " crazylht at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: crazylht at gmail dot com @ 2021-08-18  6:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101956
           Summary: Miss vectorization from v4hi to v4df
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: crazylht at gmail dot com
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-*-* i?86-*-*

void
foo (double* p, short* q)
{
   p[0] = q[0];
   p[1] = q[1];
   p[2] = q[2];
   p[3] = q[3];
}

clang generates 

        vpmovsxwd       xmm0, qword ptr [rsi]
        vcvtdq2pd       ymm0, xmm0
        vmovups ymmword ptr [rdi], ymm0
        vzeroupper

gcc generates

foo(double*, short*):
  movswl (%rsi), %eax
  vxorps %xmm0, %xmm0, %xmm0
  vcvtsi2sdl %eax, %xmm0, %xmm1
  movswl 2(%rsi), %eax
  vcvtsi2sdl %eax, %xmm0, %xmm2
  movswl 4(%rsi), %eax
  vmovsd %xmm2, %xmm2, %xmm3
  vcvtsi2sdl %eax, %xmm0, %xmm2
  movswl 6(%rsi), %eax
  vcvtsi2sdl %eax, %xmm0, %xmm0
  vunpcklpd %xmm0, %xmm2, %xmm2
  vunpcklpd %xmm3, %xmm1, %xmm0
  vinsertf128 $0x1, %xmm2, %ymm0, %ymm0
  vmovupd %ymm0, (%rdi)
  vzeroupper
  ret

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

end of thread, other threads:[~2023-11-01  3:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-18  6:00 [Bug target/101956] New: Miss vectorization from v4hi to v4df crazylht at gmail dot com
2021-08-18  6:11 ` [Bug target/101956] " crazylht at gmail dot com
2021-08-18  6:49 ` crazylht at gmail dot com
2021-08-18  6:54 ` [Bug tree-optimization/101956] " rguenth at gcc dot gnu.org
2022-03-07 21:42 ` pinskia at gcc dot gnu.org
2023-11-01  3:35 ` crazylht at gmail dot com

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