https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101809
Bug ID: 101809 Summary: emulated gather capability doesn't support 32-bit target Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: hjl.tools at gmail dot com CC: crazylht at gmail dot com, rguenth at gcc dot gnu.org Target Milestone: --- On Linux/x86-64, I get [hjl@gnu-cfl-2 xxx]$ cat x.c #include <stdint.h> #define loop_t uint32_t #define idx_t uint32_t void loop(double * const __restrict__ dst, double const * const __restrict__ src, idx_t const * const __restrict__ idx, loop_t const begin, loop_t const end) { for (loop_t i = begin; i < end; ++i) dst[i] = 42.0 * src[idx[i]]; } [hjl@gnu-cfl-2 xxx]$ make x.s /export/build/gnu/tools-build/gcc-gitlab-debug/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/tools-build/gcc-gitlab-debug/build-x86_64-linux/gcc/ -O3 -m32 -march=x86-64 -mfpmath=sse -S x.c [hjl@gnu-cfl-2 xxx]$ cat x.s .file "x.c" .text .p2align 4 .globl loop .type loop, @function loop: .LFB0: .cfi_startproc pushl %edi .cfi_def_cfa_offset 8 .cfi_offset 7, -8 pushl %esi .cfi_def_cfa_offset 12 .cfi_offset 6, -12 pushl %ebx .cfi_def_cfa_offset 16 .cfi_offset 3, -16 movl 28(%esp), %eax movl 32(%esp), %ecx movl 16(%esp), %ebx movl 20(%esp), %esi movl 24(%esp), %edi cmpl %ecx, %eax jnb .L1 movsd .LC0, %xmm1 .p2align 4,,10 .p2align 3 .L3: movl (%edi,%eax,4), %edx movsd (%esi,%edx,8), %xmm0 mulsd %xmm1, %xmm0 movsd %xmm0, (%ebx,%eax,8) addl $1, %eax cmpl %eax, %ecx jne .L3 .L1: popl %ebx .cfi_restore 3 .cfi_def_cfa_offset 12 popl %esi .cfi_restore 6 .cfi_def_cfa_offset 8 popl %edi .cfi_restore 7 .cfi_def_cfa_offset 4 ret .cfi_endproc .LFE0: .size loop, .-loop .section .rodata.cst8,"aM",@progbits,8 .align 8 .LC0: .long 0 .long 1078263808 .ident "GCC: (GNU) 12.0.0 20210806 (experimental)" .section .note.GNU-stack,"",@progbits [hjl@gnu-cfl-2 xxx]$ emulated gather capability isn't enabled.