https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113027
Bug ID: 113027 Summary: aarch64 is missing vec_set and vec_extract for structure modes Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: rsandifo at gcc dot gnu.org Target Milestone: --- The lack of vec_set and vec_extract optabs for structure modes means that the following testcase spills to the stack when compiled at -O2: #include <arm_neon.h> float64x2x2_t f1 (float64x2x2_t x) { x.val[0][1] += 1.0; return x; } float64x2x3_t f2 (float64x2x3_t x) { x.val[0][0] = x.val[1][1] + x.val[2][0]; return x; } float64x2x4_t f3 (float64x2x4_t x) { x.val[0][0] = x.val[1][1] + x.val[2][0] - x.val[3][1]; return x; } For example: f1: sub sp, sp, #32 fmov d31, 1.0e+0 st1 {v0.2d - v1.2d}, [sp] ldr d30, [sp, 8] fadd d31, d31, d30 str d31, [sp, 8] ld1 {v0.2d - v1.2d}, [sp] add sp, sp, 32 ret With the extra patterns, we instead get: f1: dup d31, v0.d[1] fmov d30, 1.0e+0 fadd d30, d31, d30 ins v0.d[1], v30.d[0] ret f2: dup d31, v1.d[1] fadd d31, d31, d2 ins v0.d[0], v31.d[0] ret f3: dup d31, v1.d[1] dup d30, v3.d[1] fadd d31, d31, d2 fsub d30, d31, d30 ins v0.d[0], v30.d[0] ret Fixing this might also make it possible to use structure modes for arrays (c.f. PR109543).