public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "me+gcc.gnu at lelf dot lu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/99517] New: __builtin_convertvector with casts
Date: Wed, 10 Mar 2021 13:27:14 +0000	[thread overview]
Message-ID: <bug-99517-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 99517
           Summary: __builtin_convertvector with casts
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: me+gcc.gnu at lelf dot lu
  Target Milestone: ---

#include<stdint.h>

typedef int8_t  GV __attribute__((vector_size(32),aligned(1)));

typedef int32_t IV __attribute__((vector_size(16),aligned(1)));
typedef int64_t JV __attribute__((vector_size(32),aligned(1)));
typedef double  FV __attribute__((vector_size(32),aligned(1)));

GV FI(IV x){return(GV)__builtin_convertvector(x,FV);}
GV JI(IV x){return(GV)__builtin_convertvector(x,JV);}


x86_64
-Os or -O2
$ gcc-11x -Os -c cv.c -mavx2


FI is ok

0000000000000000 <FI>:
   0:   c5 fa e6 c8             vcvtdq2pd %xmm0,%xmm1
   4:   c5 f9 70 c0 ee          vpshufd $0xee,%xmm0,%xmm0
   9:   c5 fa e6 c0             vcvtdq2pd %xmm0,%xmm0
   d:   c4 e3 75 18 c0 01       vinsertf128 $0x1,%xmm0,%ymm1,%ymm0
  13:   c3                      retq   


but JI is wrong (body of FI)

0000000000000014 <JI>:
  14:   c5 fa e6 c8             vcvtdq2pd %xmm0,%xmm1
  18:   c5 f9 70 c0 ee          vpshufd $0xee,%xmm0,%xmm0
  1d:   c5 fa e6 c0             vcvtdq2pd %xmm0,%xmm0
  21:   c4 e3 75 18 c0 01       vinsertf128 $0x1,%xmm0,%ymm1,%ymm0
  27:   c3                      retq   




versions:
gcc-10x (GCC) 10.2.1 20210227
gcc-11x (GCC) 11.0.1 20210228 (experimental)

             reply	other threads:[~2021-03-10 13:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 13:27 me+gcc.gnu at lelf dot lu [this message]
2021-03-10 13:53 ` [Bug c/99517] " rguenth at gcc dot gnu.org
2021-03-10 14:02 ` [Bug ipa/99517] " jakub at gcc dot gnu.org
2021-03-10 14:09 ` marxin at gcc dot gnu.org
2021-03-10 14:14 ` jakub at gcc dot gnu.org
2021-03-10 14:57 ` jakub at gcc dot gnu.org
2021-03-11  8:09 ` rguenth at gcc dot gnu.org
2021-03-11 10:18 ` cvs-commit at gcc dot gnu.org
2021-03-11 10:30 ` [Bug ipa/99517] [10 Regression] " jakub at gcc dot gnu.org
2021-03-19 23:30 ` cvs-commit at gcc dot gnu.org
2021-03-20  8:09 ` jakub at gcc dot gnu.org

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