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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
           Assignee|rguenth at gcc dot gnu.org         |unassigned at gcc dot 
gnu.org
           Keywords|                            |needs-bisection
      Known to work|                            |15.1.1
           Priority|P3                          |P1

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Hmm, V is vector(8) long long unsigned int, so we are correctly only using V.

Dump of assembler code for function foo:
=> 0x0000000000400566 <+0>:     vpermilpd $0xba,%zmm1,%zmm0
   0x000000000040056d <+7>:     ret

(gdb) p $zmm1.v8_int64
$2 = {1, 2, 3, 4, 5, 6, 0, 0}
(gdb) si
0x000000000040056d      9       }
(gdb) p $zmm0.v8_int64
$3 = {1, 2, 3, 4, 6, 6, 0, 0}

so this looks like a backend problem?  .final still has

(insn 8 4 15 2 (set (reg:V8DI 20 xmm0 [orig:103 _1 ] [103])
        (vec_select:V8DI (reg:V8DI 21 xmm1 [orig:104 v ] [104])
            (parallel [ 
                    (const_int 0 [0])
                    (const_int 1 [0x1])
                    (const_int 2 [0x2])
                    (const_int 5 [0x5])
                    (const_int 4 [0x4])
                    (const_int 5 [0x5])
                    (const_int 6 [0x6])
                    (const_int 7 [0x7])
                ]))) "t.c":7:9 9218 {*avx512f_vpermilpv8di}
     (expr_list:REG_DEAD (reg:V8DI 21 xmm1 [orig:104 v ] [104])
        (nil)))

I'll note that GCC 15 instead uses

(insn 8 4 9 2 (set (reg:V8DI 20 xmm0 [104])
        (mem/u/c:V8DI (symbol_ref/u:DI ("*.LC0") [flags 0x2]) [0  S64 A512]))
"t.c":7:9 2404 {movv8di_internal}
     (expr_list:REG_EQUIV (const_vector:V8DI [
                (const_int 0 [0])
                (const_int 1 [0x1])
                (const_int 2 [0x2])
                (const_int 5 [0x5])
                (const_int 4 [0x4])
                (const_int 5 [0x5])
                (const_int 6 [0x6])
                (const_int 7 [0x7])
            ])
        (nil)))
(insn 9 8 16 2 (set (reg:V8DI 20 xmm0 [orig:103 _1 ] [103])
        (unspec:V8DI [
                (reg:V8DI 21 xmm1 [orig:105 v ] [105])
                (reg:V8DI 20 xmm0 [104])
            ] UNSPEC_VPERMVAR)) "t.c":7:9 9049 {avx512f_permvarv8di}

thus

        vmovdqa64       .LC0(%rip), %zmm0
        vpermq  %zmm1, %zmm0, %zmm0

Reply via email to