From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 728D23ACBCB2; Tue, 10 Oct 2023 22:38:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 728D23ACBCB2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696977520; bh=K/HCgbaQUEyDY9X4R3hk33uosz1iK7RbhzhKdSEcl/g=; h=From:To:Subject:Date:From; b=wjUupuzvLfwoXIbsUE7pYca5QsOHlz5N+BgIOe6t8DSGXLHllvJ4UIoac8VyK0wVs CVINAYZMqsBhKwKK3VZZ75OJU3yUqztYhuqw7BwOZpjdBWkYoJ6TTwtQ2qs8DUUO/1 TuFnqpF5gwK3LBudRBVL2NZs5kuG3ld82elTHqrM= From: "juzhe.zhong at rivai dot ai" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/111765] New: RISC-V: Faild to vectorize gen-vect-34.c Date: Tue, 10 Oct 2023 22:38:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: juzhe.zhong at rivai dot ai 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=3D111765 Bug ID: 111765 Summary: RISC-V: Faild to vectorize gen-vect-34.c Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: juzhe.zhong at rivai dot ai Target Milestone: --- https://godbolt.org/z/17qYYKWPM float summul(int n, float *arg1, float *arg2) {=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20 int i;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 float res1 =3D 1.0; for(i =3D 0; i < n; i++) { if(arg2[i])=20 res1 *=3D arg1[i]; }=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20 return res1;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 } I found both ARM SVE and RVV failed to vectorize this case wheras X86 can vectorize it with -mavx2. It seems that we need some tricks on both SVE and RVV backend ?=