From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8EF733860763; Thu, 14 Dec 2023 22:44:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8EF733860763 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1702593880; bh=uXAnC4VQcFy2Os/8H3hEKRNeL31JxNn7FJ5kOkrQVfY=; h=From:To:Subject:Date:From; b=aVExS3lhD73h4ebqs05bYnmpU031RpLfVcQr2hPEnJHVTLrLG2qHCD1sA9Q2ls1ox F+9xWSRk6r9lddvv25AAKJQXAj2m7Wdc9h2i6McamzLhrhrcKX52Q9loa2UGx84vCQ SgK6HkrUlLlp0OlypiHV6U48+hHG2nKQPjgHzdMk= From: "rsandifo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/113027] New: aarch64 is missing vec_set and vec_extract for structure modes Date: Thu, 14 Dec 2023 22:44:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rsandifo at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113027 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 t= he following testcase spills to the stack when compiled at -O2: #include float64x2x2_t f1 (float64x2x2_t x) { x.val[0][1] +=3D 1.0; return x; } float64x2x3_t f2 (float64x2x3_t x) { x.val[0][0] =3D x.val[1][1] + x.val[2]= [0]; return x; } float64x2x4_t f3 (float64x2x4_t x) { x.val[0][0] =3D 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).=