From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1704E3858430; Mon, 19 Jun 2023 14:26:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1704E3858430 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687184760; bh=JfO3zrjA/CREzFmNJ6t21pqVRGnSPvp8L7Oxceco964=; h=From:To:Subject:Date:In-Reply-To:References:From; b=clQDtMIK5mznvNEdcvt1xagJPn+9j1QO2lx+DzehqWlg57PWKKTxq05RynVKwZPX0 B8BEB3U6TOAlt7KH1qv4yk4qkEMiWNw3BSWeVQF40EAG5Zva/jPmH2faL7za0EPa1W 8aoRYOCNk5czlG2PAcqzX3Cqy/uY7y0S+M4cCOCk= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110277] RISC-V: ICE when build RVV intrinsic float reduction with "-march=rv32gc_zve64d -mabi=ilp32d", both GCC 14 and 13. Date: Mon, 19 Jun 2023 14:25:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit 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: Message-ID: In-Reply-To: References: 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=3D110277 --- Comment #2 from CVS Commits --- The master branch has been updated by Pan Li : https://gcc.gnu.org/g:2ba7347aba59faa119345c7b374fbbf1f35bae85 commit r14-1945-g2ba7347aba59faa119345c7b374fbbf1f35bae85 Author: Pan Li Date: Sat Jun 17 22:11:02 2023 +0800 RISC-V: Bugfix for RVV float reduction in ZVE32/64 The rvv integer reduction has 3 different patterns for zve128+, zve64 and zve32. They take the same iterator with different attributions. However, we need the generated function code_for_reduc (code, mode1, mode2). The implementation of code_for_reduc may look like below. code_for_reduc (code, mode1, mode2) { if (code =3D=3D max && mode1 =3D=3D VNx1HF && mode2 =3D=3D VNx1HF) return CODE_FOR_pred_reduc_maxvnx1hfvnx16hf; // ZVE128+ if (code =3D=3D max && mode1 =3D=3D VNx1HF && mode2 =3D=3D VNx1HF) return CODE_FOR_pred_reduc_maxvnx1hfvnx8hf; // ZVE64 if (code =3D=3D max && mode1 =3D=3D VNx1HF && mode2 =3D=3D VNx1HF) return CODE_FOR_pred_reduc_maxvnx1hfvnx4hf; // ZVE32 } Thus there will be a problem here. For example zve32, we will have code_for_reduc (max, VNx1HF, VNx1HF) which will return the code of the ZVE128+ instead of the ZVE32 logically. This patch will merge the 3 patterns into pattern, and pass both the input_vector and the ret_vector of code_for_reduc. For example, ZVE32 will be code_for_reduc (max, VNx1HF, VNx2HF), then the correct code of ZVE32 will be returned as expectation. Please note both GCC 13 and 14 are impacted by this issue. Signed-off-by: Pan Li Co-Authored by: Juzhe-Zhong gcc/ChangeLog: PR target/110277 * config/riscv/riscv-vector-builtins-bases.cc: Adjust expand for ret_mode. * config/riscv/vector-iterators.md: Add VHF, VSF, VDF, VHF_LMUL1, VSF_LMUL1, VDF_LMUL1, and remove unused attr. * config/riscv/vector.md (@pred_reduc_): Removed. (@pred_reduc_): Ditto. (@pred_reduc_): Ditto. (@pred_reduc_plus): Ditto. (@pred_reduc_plus): Ditto. (@pred_reduc_plus): Ditto. (@pred_reduc_): New pattern. (@pred_reduc_): Ditto. (@pred_reduc_): Ditto. (@pred_reduc_plus): Ditto. (@pred_reduc_plus): Ditto. (@pred_reduc_plus): Ditto. gcc/testsuite/ChangeLog: PR target/110277 * gcc.target/riscv/rvv/base/pr110277-1.c: New test. * gcc.target/riscv/rvv/base/pr110277-1.h: New test. * gcc.target/riscv/rvv/base/pr110277-2.c: New test. * gcc.target/riscv/rvv/base/pr110277-2.h: New test.=