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

--- Comment #2 from Rodrigo <rcc.dark at gmail dot com> ---
(In reply to H.J. Lu from comment #1)
> The problem is with the default -mtune=generic.
> 
> [hjl@gnu-cfl-1 gcc]$ cat /tmp/foo.cc
> #include <x86intrin.h>
> 
> using data = long long __attribute__((vector_size(64)));
> void f(data& a, const data& x1, const data& x2) {
>     a ^= x1 ^ x2;
> }
> [hjl@gnu-cfl-1 gcc]$ ./xgcc -B./ -O3 -mtune=skylake -mavx2 /tmp/foo.cc -S
> 
> [hjl@gnu-cfl-1 gcc]$ cat foo.s
>       .file   "foo.cc"
>       .text
>       .p2align 4
>       .globl  _Z1fRDv8_xRKS_S2_
>       .type   _Z1fRDv8_xRKS_S2_, @function
> _Z1fRDv8_xRKS_S2_:
> .LFB5519:
>       .cfi_startproc
>       pushq   %rbp
>       .cfi_def_cfa_offset 16
>       .cfi_offset 6, -16
>       movq    %rsp, %rbp
>       .cfi_def_cfa_register 6
>       andq    $-64, %rsp
>       subq    $200, %rsp
>       vmovdqa (%rsi), %ymm2
>       vmovdqa 32(%rsi), %ymm0
>       vpxor   (%rdx), %ymm2, %ymm1
>       vpxor   32(%rdx), %ymm0, %ymm0
>       vpxor   (%rdi), %ymm1, %ymm1
>       vpxor   32(%rdi), %ymm0, %ymm0
>       vmovaps %ymm1, (%rdi)
>       vmovaps %ymm0, 32(%rdi)
>       vzeroupper
>       leave
>       .cfi_def_cfa 7, 8
>       ret
>       .cfi_endproc
> .LFE5519:
>       .size   _Z1fRDv8_xRKS_S2_, .-_Z1fRDv8_xRKS_S2_
>       .ident  "GCC: (GNU) 9.0.1 20190412 (experimental)"
>       .section        .note.GNU-stack,"",@progbits
> [hjl@gnu-cfl-1 gcc]$

Hi! Using -mtune=skylake or -mtune=haswell doesn't fix the problem in my
installation (GCC 8.2, MingW64) or in GodBolt (8.2, 8.3 and trunk). Do you know
why could it be?

Reply via email to