public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/99517] New: __builtin_convertvector with casts
@ 2021-03-10 13:27 me+gcc.gnu at lelf dot lu
  2021-03-10 13:53 ` [Bug c/99517] " rguenth at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: me+gcc.gnu at lelf dot lu @ 2021-03-10 13:27 UTC (permalink / raw)
  To: gcc-bugs

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)

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

end of thread, other threads:[~2021-03-20  8:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 13:27 [Bug c/99517] New: __builtin_convertvector with casts me+gcc.gnu at lelf dot lu
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

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