[Committed] check_GNU_style.py: Skip .md square bracket linting

2023-09-29 Thread Patrick O'Neill
On 9/29/23 12:05, Jeff Law wrote: On 9/12/23 12:54, Patrick O'Neill wrote: This testcase causes lots of false-positives for machine description files. contrib/ChangeLog: * check_GNU_style_lib.py: Skip machine description file bracket linting. OK.  We probably need a compl

[PATCH] RISC-V: Specify -mabi=lp64d in wredsum_vlmax.c testcase

2023-09-29 Thread Patrick O'Neill
/ChangeLog: * gcc.target/riscv/rvv/vsetvl/wredsum_vlmax.c: Specify -mabi=lp64d. Signed-off-by: Patrick O'Neill --- gcc/testsuite/gcc.target/riscv/rvv/vsetvl/wredsum_vlmax.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/wre

Re: [Committed] RISC-V: Specify -mabi=lp64d in wredsum_vlmax.c testcase

2023-09-29 Thread Patrick O'Neill
On 9/29/23 14:59, Jeff Law wrote: On 9/29/23 15:37, Patrick O'Neill wrote: Resolves this error on rv32gcv: cc1: error: ABI requires '-march=rv32' compiler exited with status 1 FAIL: gcc.target/riscv/rvv/vsetvl/wredsum_vlmax.c   -O0  (test for excess errors) Tested for re

Re: [PATCH] vec.h: Guard most of static assertions for GCC >= 5

2023-09-30 Thread Patrick O'Neill
Hi Jakub, A follow-up commit of yours (9d249b7e31e) is causing bootstrap failures for riscv*-*-* targets. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111649 Patrick On 9/29/23 03:42, Jakub Jelinek wrote: Hi! As reported by Jonathan on IRC, my vec.h patch broke build with GCC 4.8.x or 4.9.x

[PATCH] RISC-V: Use safe_grow_cleared for vector info [PR111469]

2023-09-30 Thread Patrick O'Neill
Resolves a riscv*-*-* bootstrap failure due to a newly-turned-on assert. 2023-09-30 Jakub Jelinek PR target/111649 gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (vector_infos_manager::vector_infos_manager): Replace safe_grow with safe_grow_cleared. --- https://gcc.gnu.org/bu

[Committed] RISC-V: Use safe_grow_cleared for vector info [PR111469]

2023-09-30 Thread Patrick O'Neill
Committed. Thanks Juzhe! I had to adjust the changelog's PR formatting to get the pre-commit hooks to accept it. Here's the committed patch: From f446cf5d58568e406cc81f434a63b3045942e9a9 Mon Sep 17 00:00:00 2001 From: Patrick O'Neill Date: Sat, 30 Sep 2023 15:50:11 -0700

[PATCH] RISC-V: Unescape chars in pr111566.f90 test

2023-10-03 Thread Patrick O'Neill
. Signed-off-by: Patrick O'Neill --- gcc/testsuite/gcc.target/riscv/rvv/fortran/pr111566.f90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/gcc.target/riscv/rvv/fortran/pr111566.f90 b/gcc/testsuite/gcc.target/riscv/rvv/fortran/pr111566.f90 index 265e91

Re: [PATCH] RISC-V: Use stdint-gcc.h in rvv testsuite

2023-10-03 Thread Patrick O'Neill
On 10/2/23 06:57, Kito Cheng wrote: On Tue, Sep 26, 2023 at 10:59 AM Patrick O'Neill wrote: stdint.h can be replaced with stdint-gcc.h to resolve some missing system headers in non-multilib installations. Tested using glibc rv32gcv and rv64gcv on r14-4258-gc9837443075. gcc/Chan

[Committed] RISC-V: Unescape chars in pr111566.f90 test

2023-10-03 Thread Patrick O'Neill
On 10/3/23 14:55, Jeff Law wrote: On 10/3/23 14:19, Patrick O'Neill wrote: Some characters are escaped which causes the testcase to fail. This patch restores the original characters. Tested for regressions using multilib rv32gcv-ilp32d, rv64gcv-lp64d. gcc/testsuite/Chan

[RFC gcc13 backport 0/3] Add Ztso atomic mappings

2023-10-03 Thread Patrick O'Neill
][committed] Remove spurious newline in ztso sequence Patrick O'Neill (2): RISC-V: Add Ztso atomic mappings RISC-V: Specify -mabi for ztso testcases gcc/common/config/riscv/riscv-common.cc | 6 + gcc/config/riscv/riscv-opts.h | 4 + gcc/config/riscv/ris

[RFC gcc13 backport 3/3] [RISCV][committed] Remove spurious newline in ztso sequence

2023-10-03 Thread Patrick O'Neill
could have easily missed it. Regardless, fixing the extraneous newline is easy :-) gcc/ * config/riscv/sync-ztso.md (atomic_load_ztso): Avoid extraenous newline. Signed-off-by: Patrick O'Neill --- gcc/config/riscv/sync-ztso.md | 4 ++-- 1 file changed, 2 insertions(+), 2 del

[RFC gcc13 backport 2/3] RISC-V: Specify -mabi for ztso testcases

2023-10-03 Thread Patrick O'Neill
On rv32 targets, this patch fixes ztso testcases errors like this: cc1: error: ABI requires '-march=rv32' 2023-08-11 Patrick O'Neill gcc/testsuite/ChangeLog: * gcc.target/riscv/amo-table-ztso-amo-add-1.c: Add -mabi=lp64d to dg-options. * gcc.target/riscv

[RFC gcc13 backport 1/3] RISC-V: Add Ztso atomic mappings

2023-10-03 Thread Patrick O'Neill
-psabi-doc/pull/391 2023-08-08 Patrick O'Neill gcc/ChangeLog: * common/config/riscv/riscv-common.cc: Add Ztso and mark Ztso as dependent on 'a' extension. * config/riscv/riscv-opts.h (MASK_ZTSO): New mask. (TARGET_ZTSO): New target. * config

Re: [RISC-V]: Re: cpymem for RISCV with v extension

2023-10-04 Thread Patrick O'Neill
Hi Joern, I'm seeing new failures introduced by this patch (9464e72bcc9123b619215af8cfef491772a3ebd9). On rv64gcv: FAIL: gcc.dg/pr90263.c scan-assembler memcpy FAIL: gfortran.fortran-torture/execute/intrinsic_count.f90 execution,  -O2 -fomit-frame-pointer -finline-functions -funroll-loops D

Re: [RISC-V]: Re: cpymem for RISCV with v extension

2023-10-04 Thread Patrick O'Neill
On 10/4/23 12:19, Joern Rennecke wrote: On Wed, 4 Oct 2023 at 18:38, Patrick O'Neill wrote: Hi Joern, I'm seeing new failures introduced by this patch (9464e72bcc9123b619215af8cfef491772a3ebd9). On rv64gcv: FAIL: gcc.dg/pr90263.c scan-assembler memcpy My testing didn't flag

[PATCH] RISC-V: xfail gcc.dg/pr90263.c for riscv_v

2023-10-04 Thread Patrick O'Neill
Since r14-4358-g9464e72bcc9 riscv_v targets use vector instructions to perform a memcpy. We no longer expect memcpy for riscv_v targets. gcc/testsuite/ChangeLog: * gcc.dg/pr90263.c: xfail riscv_v targets. Signed-off-by: Patrick O'Neill Co-authored-by: Joern Rennecke --- gcc/test

Re: [PATCH] RISC-V: xfail gcc.dg/pr90263.c for riscv_v

2023-10-04 Thread Patrick O'Neill
On 10/4/23 15:14, Jeff Law wrote: On 10/4/23 15:57, Patrick O'Neill wrote: Since r14-4358-g9464e72bcc9 riscv_v targets use vector instructions to perform a memcpy. We no longer expect memcpy for riscv_v targets. gcc/testsuite/ChangeLog: * gcc.dg/pr90263.c: xfail riscv_v target

[PATCH v2] RISC-V: Test memcpy inlined on riscv_v

2023-10-04 Thread Patrick O'Neill
Since r14-4358-g9464e72bcc9 riscv_v targets use vector instructions to perform a memcpy. We no longer expect memcpy for riscv_v targets. gcc/testsuite/ChangeLog: * gcc.dg/pr90263.c: Skip riscv_v targets. * gcc.target/riscv/rvv/base/pr90263.c: New test. Signed-off-by: Patrick

Re: [PATCH] RISC-V: xfail gcc.dg/pr90263.c for riscv_v

2023-10-05 Thread Patrick O'Neill
On 10/4/23 15:29, Jeff Law wrote: On 10/4/23 16:21, Patrick O'Neill wrote: On 10/4/23 15:14, Jeff Law wrote: On 10/4/23 15:57, Patrick O'Neill wrote: Since r14-4358-g9464e72bcc9 riscv_v targets use vector instructions to perform a memcpy. We no longer expect memcpy for riscv

[Committed] RISC-V: Test memcpy inlined on riscv_v

2023-10-05 Thread Patrick O'Neill
On 10/5/23 15:14, Jeff Law wrote: On 10/4/23 16:55, Patrick O'Neill wrote: Since r14-4358-g9464e72bcc9 riscv_v targets use vector instructions to perform a memcpy. We no longer expect memcpy for riscv_v targets. gcc/testsuite/ChangeLog: * gcc.dg/pr90263.c: Skip riscv_v ta

[PATCH v2] RISC-V: Use stdint-gcc.h in rvv testsuite

2023-10-05 Thread Patrick O'Neill
. * gcc.target/riscv/rvv/vsetvl/pr111255.c: Ditto. * gcc.target/riscv/rvv/vsetvl/wredsum_vlmax.c: Ditto. Signed-off-by: Patrick O'Neill --- Changes from v1: - Avoid changing riscv_vector.h Failures looked like this: In file included from /riscv-gnu-toolchain/build/sysroot/usr/in

[Committed] RISC-V: Use stdint-gcc.h in rvv testsuite

2023-10-05 Thread Patrick O'Neill
Committed, thanks! Patrick On 10/5/23 17:51, Kito Cheng wrote: LGTM Patrick O'Neill 於 2023年10月6日 週五 07:46 寫道: stdint.h can be replaced with stdint-gcc.h to resolve some missing system headers in non-multilib installations. Tested using glibc rv32gcv and rv64gcv on r14

Re: [RFC gcc13 backport 0/3] Add Ztso atomic mappings

2023-10-10 Thread Patrick O'Neill
On 10/4/23 08:53, Jeff Law wrote: On 10/3/23 16:26, Patrick O'Neill wrote: I vaugely recall some discussion about backporting the Ztso mappings along with the RVWMO mappings. Now that the RVWMO mappings have been backported for 13.3, is there interest in also backporting the Ztso map

Re: [PATCH V2 00/14] Refactor and cleanup vsetvl pass

2023-10-17 Thread Patrick O'Neill
Hi Lehua! I ran the gcc testsuite on qemu before/after applying your patches to 305034e3 rv32/64gcv [1]. Baseline    = Summary of gcc testsuite =     | # of unexpected case / # of unique unexpected case     |

Re: [PATCH V2 00/14] Refactor and cleanup vsetvl pass

2023-10-18 Thread Patrick O'Neill
_run-1.exe PASS: gcc.target/riscv/rvv/autovec/cond/cond_convert_float2int_run-1.c (test for excess errors) spawn riscv64-unknown-elf-run ./cond_convert_float2int_run-1.exe bbl loader On 2023/10/18 4:25, Patrick O'Neill wrote: Hi Lehua! I ran the gcc testsuite on qemu before/after applying your

[RFC v2] RISC-V: Add Ztso atomic mappings

2023-07-17 Thread Patrick O'Neill
mappings.rst [2] https://inbox.sourceware.org/gcc-patches/ZFV8pNAstwrF2qBb@andrea/T/#t [3] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/391 gcc/ChangeLog: 2023-07-17 Patrick O'Neill * common/config/riscv/riscv-common.cc: Add Ztso and mark Ztso as depend

[gcc13 backport 00/12] RISC-V: Implement ISA Manual Table A.6 Mappings

2023-07-25 Thread Patrick O'Neill
riscv: fix error: control reaches end of non-void function Patrick O'Neill (11): RISC-V: Eliminate SYNC memory models RISC-V: Enforce Libatomic LR/SC SEQ_CST RISC-V: Enforce subword atomic LR/SC SEQ_CST RISC-V: Enforce atomic compare_exchange SEQ_CST RISC-V: Add AMO releas

[gcc13 backport 01/12] RISC-V: Eliminate SYNC memory models

2023-07-25 Thread Patrick O'Neill
Remove references to MEMMODEL_SYNC_* models by converting via memmodel_base(). 2023-04-27 Patrick O'Neill gcc/ChangeLog: * config/riscv/riscv.cc: Remove MEMMODEL_SYNC_* cases and sanitize memmodel input with memmodel_base. Signed-off-by: Patrick O'Neill --- gcc/co

[gcc13 backport 03/12] RISC-V: Enforce subword atomic LR/SC SEQ_CST

2023-07-25 Thread Patrick O'Neill
Replace LR.aq/SC.rl pairs with the SEQ_CST LR.aqrl/SC.rl pairs recommended by table A.6 of the ISA manual. 2023-04-27 Patrick O'Neill gcc/ChangeLog: * config/riscv/sync.md: Change LR.aq/SC.rl pairs into sequentially consistent LR.aqrl/SC.rl pairs. Signed-off-by: Pa

[gcc13 backport 04/12] RISC-V: Enforce atomic compare_exchange SEQ_CST

2023-07-25 Thread Patrick O'Neill
This patch enforces SEQ_CST for atomic compare_exchange ops. Replace Fence/LR.aq/SC.aq pairs with SEQ_CST LR.aqrl/SC.rl pairs recommended by table A.6 of the ISA manual. 2023-04-27 Patrick O'Neill gcc/ChangeLog: * config/riscv/sync.md (atomic_cas_value_strong): Change

[gcc13 backport 02/12] RISC-V: Enforce Libatomic LR/SC SEQ_CST

2023-07-25 Thread Patrick O'Neill
Replace LR.aq/SC.rl pairs with the SEQ_CST LR.aqrl/SC.rl pairs recommended by table A.6 of the ISA manual. 2023-04-27 Patrick O'Neill libgcc/ChangeLog: * config/riscv/atomic.c: Change LR.aq/SC.rl pairs into sequentially consistent LR.aqrl/SC.rl pairs. Signed-off-by: Pa

[gcc13 backport 06/12] RISC-V: Strengthen atomic stores

2023-07-25 Thread Patrick O'Neill
This change makes atomic stores strictly stronger than table A.6 of the ISA manual. This mapping makes the overall patchset compatible with table A.7 as well. 2023-04-27 Patrick O'Neill PR target/89835 gcc/ChangeLog: * config/riscv/sync.md (atomic_store): Use simple

[gcc13 backport 09/12] RISC-V: Weaken mem_thread_fence

2023-07-25 Thread Patrick O'Neill
This change brings atomic fences in line with table A.6 of the ISA manual. Relax mem_thread_fence according to the memmodel given. 2023-04-27 Patrick O'Neill gcc/ChangeLog: * config/riscv/sync.md (mem_thread_fence_1): Change fence depending on the given memory model. S

[gcc13 backport 08/12] RISC-V: Weaken LR/SC pairs

2023-07-25 Thread Patrick O'Neill
ordering of both given models. This change brings LR/SC ops in line with table A.6 of the ISA manual. 2023-04-27 Patrick O'Neill gcc/ChangeLog: * config/riscv/riscv-protos.h (riscv_union_memmodels): Expose riscv_union_memmodels function to sync.md. * config/riscv/ris

[gcc13 backport 05/12] RISC-V: Add AMO release bits

2023-07-25 Thread Patrick O'Neill
This patch sets the relevant .rl bits on amo operations. 2023-04-27 Patrick O'Neill gcc/ChangeLog: * config/riscv/riscv.cc (riscv_print_operand): Change behavior of %A to include release bits. Signed-off-by: Patrick O'Neill --- gcc/config/riscv/riscv.cc | 7 +

[gcc13 backport 07/12] RISC-V: Eliminate AMO op fences

2023-07-25 Thread Patrick O'Neill
Atomic operations with the appropriate bits set already enfore release semantics. Remove unnecessary release fences from atomic ops. This change brings AMO ops in line with table A.6 of the ISA manual. 2023-04-27 Patrick O'Neill gcc/ChangeLog: * config/riscv/ris

[gcc13 backport 11/12] RISC-V: Table A.6 conformance tests

2023-07-25 Thread Patrick O'Neill
These tests cover basic cases to ensure the atomic mappings follow the strengthened Table A.6 mappings that are compatible with Table A.7. 2023-04-27 Patrick O'Neill gcc/testsuite/ChangeLog: * gcc.target/riscv/amo-table-a-6-amo-add-1.c: New test. * gcc.target/riscv/amo-ta

[gcc13 backport 10/12] RISC-V: Weaken atomic loads

2023-07-25 Thread Patrick O'Neill
This change brings atomic loads in line with table A.6 of the ISA manual. 2023-04-27 Patrick O'Neill gcc/ChangeLog: * config/riscv/sync.md (atomic_load): Implement atomic load mapping. Signed-off-by: Patrick O'Neill --- gcc/config/riscv/sy

[gcc13 backport 12/12] riscv: fix error: control reaches end of non-void function

2023-07-25 Thread Patrick O'Neill
From: Martin Liska Fixes: gcc/config/riscv/sync.md:66:1: error: control reaches end of non-void function [-Werror=return-type] 66 | [(set (attr "length") (const_int 4))]) | ^ PR target/109713 gcc/ChangeLog: * config/riscv/sync.md: Add gcc_unreachable to a switch. --- gcc

Re: [gcc13 backport 12/12] riscv: fix error: control reaches end of non-void function

2023-07-26 Thread Patrick O'Neill
This final patch fixes an error introduced by patch 9/12 in this series. I'll backport alongside the other patches once the 13 branch is unfrozen :) On 7/25/23 18:22, Kito Cheng wrote: OK for backport :) On Wed, Jul 26, 2023 at 2:11 AM Patrick O'Neill wrote: From: Martin Liska

Re: [PATCH] RISC-V: Fix uninitialized and redundant use of which_alternative

2023-07-27 Thread Patrick O'Neill
The newly added testcase fails on rv32 targets with this message: FAIL: gcc.target/riscv/rvv/autovec/madd-split2-1.c -O3 -ftree-vectorize (test for excess errors) verbose log: compiler exited with status 1 output is: cc1: error: ABI requires '-march=rv32' Something like this appears to fix the

[Committed] RISC-V: Specify -mabi in rv64 autovec testcase

2023-07-28 Thread Patrick O'Neill
dg-options. Signed-off-by: Patrick O'Neill --- gcc/testsuite/gcc.target/riscv/rvv/autovec/madd-split2-1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/madd-split2-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/madd-split2-1.c in

Re: [PATCH] RISC-V: Fix uninitialized and redundant use of which_alternative

2023-07-28 Thread Patrick O'Neill
Thanks! Here's the comitted patch: https://inbox.sourceware.org/gcc-patches/20230728163758.377962-1-patr...@rivosinc.com/T/#u On 7/27/23 15:11, juzhe.zhong wrote: LGTM.Thanks. You can go ahead commit it. Replied Message FromPatrick O'Neill <mailto:patr...@rivosinc.co

Re: [PATCH] RISC-V: Fix uninitialized and redundant use of which_alternative

2023-07-28 Thread Patrick O'Neill
No worries! I'm glad it was an easy fix ;) On 7/27/23 19:55, Demin Han wrote: Sorry for not consider rv32 config. The fix is OK. If convenient, please commit it. On 2023/7/28 4:46, Patrick O'Neill wrote: The newly added testcase fails on rv32 targets with this message: FAIL: gcc.ta

[Committed] RISC-V: Implement ISA Manual Table A.6 Mappings

2023-07-31 Thread Patrick O'Neill
GCC 13.2 released[2] so I merged the series now that the branch is unfrozen. Thanks, Patrick [2] https://inbox.sourceware.org/gcc/ZMJeq%2FY5SN+7i8a+@tucnak/T/#u On 7/25/23 11:01, Patrick O'Neill wrote: Discussed during the weekly RISC-V GCC meeting[1] and pre-approved by Jeff Law. If

[PATCH v3] RISC-V: Add Ztso atomic mappings

2023-08-08 Thread Patrick O'Neill
-psabi-doc/pull/391 2023-08-08 Patrick O'Neill gcc/ChangeLog: * common/config/riscv/riscv-common.cc: Add Ztso and mark Ztso as dependent on 'a' extension. * config/riscv/riscv-opts.h (MASK_ZTSO): New mask. (TARGET_ZTSO): New target. * config

Re: [RFC v2] RISC-V: Add Ztso atomic mappings

2023-08-08 Thread Patrick O'Neill
On 7/31/23 22:04, Jeff Law wrote: On 7/17/23 15:28, Patrick O'Neill wrote: The RISC-V Ztso extension currently has no effect on generated code. With the additional ordering constraints guarenteed by Ztso, we can emit more optimized atomic mappings than the RVWMO mappings. This PR defi

[Committed] RISC-V: Add Ztso atomic mappings

2023-08-10 Thread Patrick O'Neill
Committed - thanks! On 8/8/23 14:54, Palmer Dabbelt wrote: On Tue, 08 Aug 2023 14:52:14 PDT (-0700), Patrick O'Neill wrote: The RISC-V Ztso extension currently has no effect on generated code. With the additional ordering constraints guarenteed by Ztso, we can emit more optimized a

[PATCH] RISC-V: Specify -mabi for ztso testcases

2023-08-11 Thread Patrick O'Neill
On rv32 targets, this patch fixes ztso testcases errors like this: cc1: error: ABI requires '-march=rv32' 2023-08-11 Patrick O'Neill gcc/testsuite/ChangeLog: * gcc.target/riscv/amo-table-ztso-amo-add-1.c: Add -mabi=lp64d to dg-options. * gcc.target/riscv

[Committed] RISC-V: Specify -mabi for ztso testcases

2023-08-11 Thread Patrick O'Neill
On 8/11/23 13:44, Jeff Law wrote: On 8/11/23 13:15, Patrick O'Neill wrote: On rv32 targets, this patch fixes ztso testcases errors like this: cc1: error: ABI requires '-march=rv32' 2023-08-11 Patrick O'Neill gcc/testsuite/ChangeLog: * gcc.target/riscv/amo-table-z

[PATCH] RISC-V: Add rotate immediate regression test

2023-08-16 Thread Patrick O'Neill
case. Co-authored-by: Charlie Jenkins Signed-off-by: Patrick O'Neill --- Trunk optimized these added testcases correctly. GCC 13.2 and earlier do not optimize these cases correctly. Expands on testcases added in: https://gcc.gnu.org/git/?p=gcc.git;a=commit;f=gcc/testsuite/gcc.t

[PATCH v2] RISCV: Add rotate immediate regression test

2023-08-16 Thread Patrick O'Neill
: Patrick O'Neill --- Trunk optimized these added testcases correctly. GCC 13.2 and earlier do not optimize these cases correctly. Expands on testcases added in: https://gcc.gnu.org/git/?p=gcc.git;a=commit;f=gcc/testsuite/gcc.target/riscv/zbb-rol-ror-04.c;h=0ccf520d349a82dafca0deb3d307a1080e8

[Committed] RISCV: Add rotate immediate regression test

2023-08-17 Thread Patrick O'Neill
On 8/16/23 21:36, Jeff Law wrote: On 8/16/23 19:17, Patrick O'Neill wrote: This adds new regression tests to ensure half-register rotations are correctly optimized into rori instructions. gcc/testsuite/ChangeLog: * gcc.target/riscv/zbb-rol-ror-08.c: New test. * gcc.target/risc

Re: [PATCH V3 00/11] Refactor and cleanup vsetvl pass

2023-10-19 Thread Patrick O'Neill
FAIL: gfortran.dg/host_assoc_function_7.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  execution test FAIL: gfortran.dg/host_assoc_function_7.f90   -O3 -g  execution test Thanks for the quick revision Lehua! Tested-by: Patrick O'Neill Patrick On 10/19/2

Re: [PATCH V3 00/11] Refactor and cleanup vsetvl pass

2023-10-23 Thread Patrick O'Neill
execution test FAIL: gfortran.dg/host_assoc_function_7.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  execution test FAIL: gfortran.dg/host_assoc_function_7.f90   -O3 -g  execution test Thanks for the quick revision Lehua! Tested-by: Patrick O'Neill

Re: [PATCH V3 00/11] Refactor and cleanup vsetvl pass

2023-10-23 Thread Patrick O'Neill
.zh...@rivai.ai *From:* Patrick O'Neill <mailto:patr...@rivosinc.com> *Date:* 2023-10-24 02:30 *To:* Lehua Ding <mailto:lehua.d...@rivai.ai> *CC:* kito.cheng <mailto:kito.ch...@gmail.com>; rdapp.gcc <mailto:rdapp@gmail.com>; palmer <mailto:pal.

Re: [PATCH V3 00/11] Refactor and cleanup vsetvl pass

2023-10-23 Thread Patrick O'Neill
del=medlow' 'CXXFLAGS_FOR_TARGET=-O2    -mcmodel=medlow' On 10/23/23 15:50, 钟居哲 wrote: I didn't reproduce it. How to enable RTL checking ? juzhe.zh...@rivai.ai *From:* Patrick O'Neill <mailto:patr...@rivo

Re: [PATCH V3 00/11] Refactor and cleanup vsetvl pass

2023-10-23 Thread Patrick O'Neill
_TARGET=-Os    -mcmodel=medany' 'CXXFLAGS_FOR_TARGET=-Os    -mcmodel=medany' Thread model: single Supported LTO compression algorithms: zlib gcc version 14.0.0 20231023 (experimental) (g70b66ac9bcb-dirty) -------- juzh

Re: [PATCH] RISC-V: Add AVL propagation PASS for RVV auto-vectorization

2023-10-23 Thread Patrick O'Neill
The CI just picked it up: https://github.com/ewlu/gcc-precommit-ci/issues/449#issue-1958483272 Since it doesn't apply to the CI's baseline hash it's only performing a build. I'll re-run it in the morning once the baseline has been updated. In the meantime I started a full build+test run on my l

[PATCH] RISC-V: Pass abi to g++ rvv testsuite

2023-10-25 Thread Patrick O'Neill
g++.target/riscv/rvv/rvv.exp: Add -mabi argument to CFLAGS. Signed-off-by: Patrick O'Neill --- Resolved failures: FAIL: g++.target/riscv/rvv/base/bug-18.C (test for excess errors) FAIL: g++.target/riscv/rvv/base/bug-19.C (test for excess errors) FAIL: g++.target/riscv/rvv/base/bug-20.C (

[Committed] RISC-V: Pass abi to g++ rvv testsuite

2023-10-26 Thread Patrick O'Neill
On 10/26/23 06:30, Jeff Law wrote: On 10/25/23 18:13, Patrick O'Neill wrote: On rv32gcv testcases like g++.target/riscv/rvv/base/bug-22.C fail with: FAIL: g++.target/riscv/rvv/base/bug-22.C (test for excess errors) Excess errors: cc1plus: error: ABI requires '-march=rv32'

Re: [Ready to commit V3] RISC-V: Add AVL propagation PASS for RVV auto-vectorization

2023-10-26 Thread Patrick O'Neill
inter -finline-functions FAIL: gfortran.fortran-torture/execute/intrinsic_matmul.f90 execution,  -O3 -g rv64gcv: FAIL: gfortran.dg/matmul_6.f90   -O2  execution test Tested-by: Patrick O'Neill Patrick On 10/26/23 01:13, Juzhe-Zhong wrote: This patch addresses the redundant AVL/VL toggl

Re: [Ready to commit V3] RISC-V: Add AVL propagation PASS for RVV auto-vectorization

2023-10-26 Thread Patrick O'Neill
On 10/26/23 11:15, Robin Dapp wrote: rv32gcv: FAIL: gfortran.dg/intrinsic_pack_6.f90   -O2  execution test FAIL: gfortran.dg/intrinsic_pack_6.f90   -O3 -g  execution test FAIL: gfortran.dg/matmul_3.f90   -O2  execution test FAIL: gfortran.fortran-torture/execute/intrinsic_matmul.f90 execution, 

Re: [committed] RISC-V: Make stack_save_restore tests more robust

2023-10-27 Thread Patrick O'Neill
On 8/25/23 15:36, Jeff Law wrote: Spurred by Jivan's patch and a desire for cleaner testresults, I went ahead and make the stack_save_restore tests independent of the precise stack size by using a regexp. Pushed to the trunk. Jeff Hi Jeff, A recent change that I'm still bisecting [1] cause

[PATCH] RISC-V: Make stack_save_restore_2 more robust

2023-10-27 Thread Patrick O'Neill
number after __riscv_save_ and __riscv_restore_. Signed-off-by: Patrick O'Neill --- Tested using glibc rv64gc on r14-4980-g2672c60917d. --- gcc/testsuite/gcc.target/riscv/stack_save_restore_2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/gcc.t

Re: [PATCH] RISC-V: Make stack_save_restore_2 more robust

2023-10-27 Thread Patrick O'Neill
On 10/27/23 11:02, Jeff Law wrote: On 10/27/23 11:56, Patrick O'Neill wrote: GCC recently changed to emit __riscv_restore_5 which causes this testcase to fail. This patch updates the regex to be more robust to change by accepting any number after __riscv_save_ and __riscv_restore_.

[PATCH] RISC-V: Make rv32i_zcmp testcase more robust

2023-10-30 Thread Patrick O'Neill
register in the range of 1-9 for cm.push and cm.popret insns. Signed-off-by: Patrick O'Neill --- Tested using glibc rv64gc on r14-4980-g2672c60917d. --- gcc/testsuite/gcc.target/riscv/rv32i_zcmp.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git

Re: [PATCH v3] RISC-V: elide unnecessary sign extend when expanding cmp_and_jump

2023-10-30 Thread Patrick O'Neill
/issues/499#issuecomment-1784446631 The patch was applied to this baseline: https://github.com/gcc-mirror/gcc/commit/c6929b085580cf00cbc52b0f5b0afe2b9caa2a22 and no new failures or resolved failures were found when running the testsuite. Tested-by: Patrick O'Neill Thanks! Patrick gcc/Ch

[Committed] RISC-V: Make rv32i_zcmp testcase more robust

2023-10-30 Thread Patrick O'Neill
On 10/30/23 09:55, Jeff Law wrote: On 10/30/23 10:37, Patrick O'Neill wrote: GCC recently changed its register allocator which causes this testcase to fail. This patch updates the regex to be more robust to change by accepting any s register in the range of 1-9 for cm.push and cm.p

[PATCH] RISC-V: Enable ztso tests on rv32

2023-10-30 Thread Patrick O'Neill
the Ztso extension or add it to an existing -march. Signed-off-by: Patrick O'Neill --- .../riscv/amo-table-ztso-amo-add-1.c | 3 ++- .../riscv/amo-table-ztso-amo-add-2.c | 3 ++- .../riscv/amo-table-ztso-amo-add-3.c | 3 ++- .../riscv/amo-table-ztso-amo-ad

[PATCH 1/2] RISC-V: Let non-atomic targets use optimized amo loads/stores

2023-10-30 Thread Patrick O'Neill
. * config/riscv/sync-ztso.md (atomic_load_ztso): Ditto. (atomic_store_ztso): Ditto. * config/riscv/sync.md (atomic_load): Ditto. (atomic_store): Ditto. Signed-off-by: Patrick O'Neill --- gcc/config/riscv/sync-rvwmo.md | 4 ++-- gcc/config/riscv/sync-ztso.md

[PATCH 2/2] RISC-V: Require a extension for testcases with atomic insns

2023-10-30 Thread Patrick O'Neill
/target-supports.exp: Add testing infrastructure to require the A extension or add it to an existing -march. Signed-off-by: Patrick O'Neill --- This patch relies on the previous one in the series. If applied seperately, amo-table-a-6-store-compat-3.c and amo-table-a-6-load-3.c mu

[Committed 1/2] RISC-V: Let non-atomic targets use optimized amo loads/stores

2023-10-31 Thread Patrick O'Neill
On 10/31/23 06:05, Jeff Law wrote: On 10/30/23 18:49, Patrick O'Neill wrote: Non-atomic targets are currently prevented from using the optimized fencing for seq_cst load/seq_cst store. This patch removes that constraint. gcc/ChangeLog: * config/riscv/sync-rvwmo.md (atomic_load_

[Committed 2/2] RISC-V: Require a extension for testcases with atomic insns

2023-10-31 Thread Patrick O'Neill
On 10/31/23 06:07, Jeff Law wrote: On 10/30/23 18:49, Patrick O'Neill wrote: Add testsuite infrastructure for the A extension and use it to require the A extension for dg-do run and add the add extension for non-A dg-do compile. gcc/testsuite/ChangeLog: * gcc.target/risc

[PATCH v2] RISC-V: Enable ztso tests on rv32

2023-10-31 Thread Patrick O'Neill
the Ztso extension or add it to an existing -march. Signed-off-by: Patrick O'Neill --- Before committing v1, I ran the full testsuite as a sanity check and found failures that don't happen when running the testcases individually. v2 fixes those failures using common-sense fixes.

[PATCH] RISC-V: Use riscv_subword_address for atomic_test_and_set

2023-10-31 Thread Patrick O'Neill
: * config/riscv/sync.md: Use riscv_subword_address function to calculate the address and shift in atomic_test_and_set. Signed-off-by: Patrick O'Neill --- Tested using r14-5040-g5dc2ba333f8. This patch causes this codegen to regress (adds a mv) but *only* on -O0. extern void abort(); sh

Re: [PATCH] RISC-V: Support strided load/store

2023-10-31 Thread Patrick O'Neill
Hi Juzhe, The pre-commit CI is seeing these new failures after applying this patch [1]: |FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/mask_strided_load-1.c scan-tree-dump-times optimized " .MASK_LEN_STRIDED_LOAD" 132 FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/mask_strided_store-1

[PATCH v2] RISC-V: Use riscv_subword_address for atomic_test_and_set

2023-11-01 Thread Patrick O'Neill
: * config/riscv/sync.md: Use riscv_subword_address function to calculate the address and shift in atomic_test_and_set. Signed-off-by: Patrick O'Neill --- Changelog: v2: Comment out the diff in the foreword so git doesn't get confused when applying the patch --- Tested using r14-5040-g5

Re: [PATCH] RISC-V: fix TARGET_PROMOTE_FUNCTION_MODE hook for libcalls

2023-11-01 Thread Patrick O'Neill
ior. Oh, its a regression. I can add a Fixes: tag OK once CI finishes without regressions. Thx, -Vineet It passes precommit CI without any new failures: https://github.com/ewlu/gcc-precommit-ci/issues/526#issuecomment-1787891174 Tested-by: Patrick O'Neill Thanks, Patrick

[Committed] RISC-V: Enable ztso tests on rv32

2023-11-01 Thread Patrick O'Neill
On 11/1/23 12:03, Jeff Law wrote: On 10/31/23 17:25, Patrick O'Neill wrote: This patch transitions the ztso testcases to use the testsuite infrastructure, enabling the tests on both rv64 and rv32 targets. gcc/testsuite/ChangeLog: * gcc.target/riscv/amo-table-ztso-amo-ad

[Committed] RISC-V: Use riscv_subword_address for atomic_test_and_set

2023-11-01 Thread Patrick O'Neill
On 11/1/23 12:00, Jeff Law wrote: On 11/1/23 10:14, Patrick O'Neill wrote: Other subword atomic patterns use riscv_subword_address to calculate the aligned address, shift amount, mask and !mask. atomic_test_and_set was implemented before the common function was added. After this patc

[PATCH] gfortran: Rely on dg-do-what-default to avoid running pr85853.f90, pr107254.f90 and vect-alias-check-1.F90 on non-vector targets

2023-11-02 Thread Patrick O'Neill
: Ditto. Signed-off-by: Patrick O'Neill --- Tested using rv64gc & rv64gcv to make sure the testcases compile/run as expected. These files haven't been changed in a long time so I'm not sure why (or if) this hasn't been run into by other people before. --- gcc/testsuite/gfort

Re: [PATCH v1] RISC-V: Refactor prefix [I/L/LL] rounding API autovec iterator

2023-11-02 Thread Patrick O'Neill
Hi Pan, This patch is causing new failures (ICEs) on trunk: https://github.com/patrick-rivos/gcc-postcommit-ci/issues/110 Pre-commit CI run: https://github.com/ewlu/gcc-precommit-ci/issues/553#issuecomment-1790688172 New rv32gcv failures: |FAIL: gcc.dg/vect/fast-math-bb-slp-call-2.c (internal

[PATCH] g++: Rely on dg-do-what-default to avoid running pr102788.cc on non-vector targets

2023-11-02 Thread Patrick O'Neill
(while still running the tests on vector targets). gcc/testsuite/ChangeLog: * g++.dg/vect/pr102788.cc: Remove dg-do run directive. Signed-off-by: Patrick O'Neill --- Tested using rv64gc & rv64gcv to make sure the testcases compile/run as expected. Similar to https://inbox.sourc

[PATCH] g++: Add require-effective-target to multi-input file testcase pr95401.cc

2023-11-02 Thread Patrick O'Neill
d the case where the testcase is invoked with dg-do compile. gcc/testsuite/ChangeLog: * g++.dg/vect/pr95401.cc: Add require-effective-target vect_int. Signed-off-by: Patrick O'Neill --- Tested using rv64gc & rv64gcv to make sure the testcase runs/doesn't compile as expected

[committed gcc13 backport] RISCV: Inline subword atomic ops

2023-05-16 Thread Patrick O'Neill
On 5/15/23 21:32, Jeff Law wrote: On 5/9/23 10:01, Patrick O'Neill wrote: Ping. OK for backporting.  Sorry for the delay. jeff Committed. Thanks, Patrick

Re: RISC-V Test Errors and Failures

2023-05-16 Thread Patrick O'Neill
On 5/16/23 19:47, Palmer Dabbelt wrote: On Tue, 16 May 2023 19:46:28 PDT (-0700), Vineet Gupta wrote: On 5/16/23 19:21, Kito Cheng wrote: Palmer: For short-term, this should help your internal test: https://github.com/riscv-collab/riscv-gnu-toolchain/pull/1233 That only helps if using blee

[PATCH] RISCV: Strengthen libatomic lrsc pairs

2022-03-07 Thread Patrick O'Neill
patch enforces SEQ_CST by setting the .aqrl bits on the LR and SC ops. 2022-03-07 Patrick O'Neill PR target/104831 * atomic.c: Change LR.aq/SC.rl pairs into sequentially consistent LR.aqrl/SC.aqrl pair. Signed-off-by: Patrick O'Neill --- RISCV LRSC-BUGFIX { 0:

[PATCH v2] RISCV: Strengthen libatomic lrsc pairs

2022-03-07 Thread Patrick O'Neill
ts (1:x7=1 /\ 1:x5=0 /\ b=1) This patch enforces SEQ_CST by setting the .aqrl bits on the LR and .rl bits on SC ops. 2022-03-07 Patrick O'Neill PR target/104831 * atomic.c: Change LR.aq/SC.rl pairs into sequentially consistent LR.aqrl/SC.rl pair. Signed-off-by: Patri

[RFC] RISCV: Combine Pass Clobber Ops

2022-03-10 Thread Patrick O'Neill
concerned that this addition may restrict subsequent RTL pass optimizations. 2. Are there other concerns with implementing source-dest constraints within the combine pass? 3. Any other thoughts/input you have is welcome! 2022-03-10 Patrick O'Neill * combine.cc: Add register equalit

[RFC v2] RISCV: Combine Pass Clobber Ops

2022-03-10 Thread Patrick O'Neill
concerned that this addition may restrict subsequent RTL pass optimizations. 2. Are there other concerns with implementing source-dest constraints within the combine pass? 3. Any other thoughts/input you have is welcome! 2022-03-10 Patrick O'Neill * combine.cc: Add register equalit

[PATCH v2] RISCV: Add support for inlining subword atomics

2022-03-10 Thread Patrick O'Neill
-atomics command line flags. gcc/libgcc/config/riscv/atomic.c has the same logic implemented in asm. This will need to stay for backwards compatibility and the -mno-inline-atomics flag. 2022-02-15 Patrick O'Neill PR target/104338 * riscv.opt: Add command-line

[RFC 0/7] RISCV: Implement ISA Manual Table A.6 Mappings

2022-04-07 Thread Patrick O'Neill
ing. Note: LLVM implements fence rw,w + sw https://godbolt.org/z/n68P7ne1W That means that LLVM isn't compatible with libatomic's LR.aq/SC.rl. * PR target/89835: The RISC-V target uses amoswap.w for relaxed stores Patrick O'Neill (7): RISCV: Enforce Libatomic LR/SC SEQ_CST RISC

[RFC 1/7] RISCV: Enforce Libatomic LR/SC SEQ_CST

2022-04-07 Thread Patrick O'Neill
Replace LR.aq/SC.rl pairs with the SEQ_CST LR.aqrl/SC.rl pairs recommended by table A.6 of the ISA manual. 2022-03-31 Patrick O'Neill * atomic.c: Change LR.aq/SC.rl pairs into sequentially consistent LR.aqrl/SC.rl pair. Signed-off-by: Patrick O'Neill --- libgcc/co

[RFC 2/7] RISCV: Enforce Atomic Compare Exchange SEQ_CST

2022-04-07 Thread Patrick O'Neill
This patch enforces SEQ_CST for atomic compare_exchange ops. Replace Fence/LR.aq/SC.aq pairs with strong SEQ_CST LR.aqrl/SC.rl pairs recommended by table A.6 of the ISA manual. 2022-03-31 Patrick O'Neill * sync.md: Change LR.aq/SC.rl pairs into sequentially consistent LR

[RFC 3/7] RISCV: Add AMO release bits

2022-04-07 Thread Patrick O'Neill
This patch sets the relevant .rl bits on amo operations. 2022-03-31 Patrick O'Neill * riscv.cc (riscv_print_operand): change behavior of %A to include release bits. Signed-off-by: Patrick O'Neill --- gcc/config/riscv/riscv.cc | 7 ++- 1 file changed, 6 insert

[RFC 4/7] RISCV: Optimize AMO Ops

2022-04-07 Thread Patrick O'Neill
Atomic operations with the appropriate bits set already enfore release semantics. Remove unnecessary release fences from atomic ops. This change brings amo ops in line with table A.6 of the ISA manual. 2022-03-31 Patrick O'Neill * riscv.cc (riscv_memmodel_needs_amo_acquire): C

[RFC 5/7] RISCV: Optimize LR/SC Pairs

2022-04-07 Thread Patrick O'Neill
of both given models. This change brings LR/SC ops in line with table A.6 of the ISA manual. 2022-03-31 Patrick O'Neill * riscv.cc: Add functions to get the parent of two memmodels in sync.md. * riscv-protos.h: Likewise. * sync.md (atomic_cas_value_s

[RFC 6/7] RISCV: Optimize Atomic Stores

2022-04-07 Thread Patrick O'Neill
This change brings atomic stores in line with table A.6 of the ISA manual. 2022-03-31 Patrick O'Neill PR target/89835 * riscv.cc (atomic_cas_value_strong): Add %I flag for atomic store fences. * sync.md (atomic_store): Use simple store instructi

[RFC 7/7] RISCV: Relax mem_thread_fence

2022-04-07 Thread Patrick O'Neill
This change brings atomic fences in line with table A.6 of the ISA manual. Relax mem_thread_fence according to the memmodel given. 2022-03-31 Patrick O'Neill * riscv.cc: Expose helper functions to sync.md. * riscv-protos.h: Likewise. * sync.md (mem_thread_fe

  1   2   3   4   >