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

            Bug ID: 128169
           Summary: [17 Regression] x86: vec_extract from V32BF now goes
                    through V2BF/V4BF subreg, emits vpsrldq $0
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lin1.hu at intel dot com
  Target Milestone: ---

Since r17-5483-gd5ac76d8da8 ("expand: Improve tuple-extraction handling"),
gcc.target/i386/vect-bfloat16-2b.c fails with -m32:

  FAIL: gcc.target/i386/vect-bfloat16-2b.c scan-assembler-times vpinsrw 68

(reported in
https://gcc.gnu.org/pipermail/gcc-patches/2026-October/735820.html)

The count drops 68 -> 63 (-m32) and 36 -> 32 (-m64, not scanned).  Only
vec_extract_v32bf_{5,8,14,16,24,28} change.  Testcase:

  typedef __bf16 v32bf __attribute__ ((__vector_size__ (64)));
  __attribute__((noipa)) __bf16 f (v32bf v) { return v[8]; }

  -O2 -mavx512f -mno-avx512bw

-m64, before:
        vmovdqa64       %zmm0, -64(%rsp)
        vpinsrw $0, -48(%rsp), %xmm0, %xmm0
-m64, after:
        vmovdqa64       %zmm0, -64(%rsp)
        vmovlps -48(%rsp), %xmm1, %xmm1         # *movv4bf_internal/13
        vpsrldq $0, %xmm1, %xmm0                # *mmx_pextrwv4bf/5

-m32, before:
        vmovdqa64       %zmm0, (%esp)
        vpinsrw $0, 16(%esp), %xmm0, %xmm0
-m32, after:
        vmovdqa64       %zmm0, (%esp)
        vmovss  16(%esp), %xmm1                 # *movv2bf_internal/4
        vpsrldq $0, %xmm1, %xmm0                # *pextrwv2bf/4

Reply via email to