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

            Bug ID: 87767
           Summary: Missing AVX512 memory broadcast for floating point
                    constant
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
  Target Milestone: ---
            Target: i386,x86-64

[hjl@gnu-efi-2 broadcast-4]$ cat c.c
#include <immintrin.h>

__m512
foo (__m512 x)
{
  return _mm512_add_ps (x, _mm512_set1_ps (2.0f));
}
[hjl@gnu-efi-2 broadcast-4]$ make c.s
/export/build/gnu/tools-build/gcc-test/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/tools-build/gcc-test/build-x86_64-linux/gcc/ -O2 -mavx512f
-S c.c
[hjl@gnu-efi-2 broadcast-4]$ cat c.s
        .file   "c.c"
        .text
        .p2align 4
        .globl  foo
        .type   foo, @function
foo:
.LFB5186:
        .cfi_startproc
        vbroadcastss    .LC0(%rip), %zmm1
        vaddps  %zmm1, %zmm0, %zmm0
        ret
        .cfi_endproc
.LFE5186:
        .size   foo, .-foo
        .section        .rodata.cst16,"aM",@progbits,16
        .align 16
.LC0:
        .long   1073741824
        .long   0
        .long   0
        .long   0
        .ident  "GCC: (GNU) 9.0.0 20181026 (experimental)"
        .section        .note.GNU-stack,"",@progbits
[hjl@gnu-efi-2 broadcast-4]$ 

vbroadcastss should be replaced by memory broadcast.

Reply via email to