public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "crazylht at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/101956] New: Miss vectorization from v4hi to v4df
Date: Wed, 18 Aug 2021 06:00:02 +0000	[thread overview]
Message-ID: <bug-101956-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             reply	other threads:[~2021-08-18  6:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18  6:00 crazylht at gmail dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-101956-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).