Open zhongsir1 opened 1 year ago
test: https://godbolt.org/z/qjzhsY8c1
int s331(void) { // search loops int j = -1; for (int i = 0; i < LEN_1D; i++) { if (a[i] < (real_t)0.) { j = i; } } return j+1; }
gcc: generate a sve loop
.L2: punpkhi p7.h, p15.b punpklo p5.h, p15.b ld1d z31.d, p7/z, [x4, x0, lsl 3] ld1d z28.d, p5/z, [x2, x0, lsl 3] fcmlt p14.d, p6/z, z31.d, #0.0 add x0, x0, x3 fcmlt p7.d, p6/z, z28.d, #0.0 uzp1 p7.s, p7.s, p14.s and p7.b, p7/z, p15.b, p15.b whilelo p15.s, w0, w1 clastb s29, p7, s29, z30.s incw z30.s b.any .L2
llvm:
.LBB0_1: // =>This Inner Loop Header: Depth=1 ldr d0, [x10, x8, lsl #3] fcmp d0, #0.0 csel w9, w8, w9, mi add x8, x8, #1 cmp x8, x11 b.ne .LBB0_1
@llvm/issue-subscribers-backend-aarch64
This may be addressed with https://reviews.llvm.org/D143465 or https://reviews.llvm.org/D150851 or one of the related reviews.
test: https://godbolt.org/z/qjzhsY8c1
gcc: generate a sve loop
llvm: