Re: Re: [PATCH] RISC-V: Support in-order floating-point reduction

2023-07-20 Thread juzhe.zh...@rivai.ai
bne a1,zero,.L3 ret juzhe.zh...@rivai.ai From: Kito Cheng Date: 2023-07-20 16:24 To: juzhe.zh...@rivai.ai CC: Robin Dapp; gcc-patches; kito.cheng; jeffreyalaw Subject: Re: Re: [PATCH] RISC-V: Support in-order floating-point reduction reduction_type = reduction_type::UNORDERED On Thu, Jul 20

Re: Re: [PATCH] RISC-V: Support in-order floating-point reduction

2023-07-20 Thread Kito Cheng via Gcc-patches
1 > > ../../../riscv-gcc/gcc/cfgexpand.cc:3880 > > 0xf62f0f expand_gimple_stmt > > ../../../riscv-gcc/gcc/cfgexpand.cc:4044 > > 0xf6b8a9 expand_gimple_basic_block > > ../../../riscv-gcc/gcc/cfgexpand.cc:6096 > > > > This ICE happens when compiling vcond.cc tests > > > > juzhe.zh...@rivai.ai > > > > > > From: Robin Dapp > > Date: 2023-07-20 15:57 > > To: juzhe.zh...@rivai.ai; gcc-patches > > CC: rdapp.gcc; kito.cheng; Kito.cheng; jeffreyalaw > > Subject: Re: [PATCH] RISC-V: Support in-order floating-point reduction > > > The UNORDERED enum will cause ICE since we have UNORDERED in rtx_code. > > > > > > Could you give me another enum name? > > > > I would have expected it to work when it's namespaced. > > > > Regards > > Robin > > > > >

Re: Re: [PATCH] RISC-V: Support in-order floating-point reduction

2023-07-20 Thread juzhe.zh...@rivai.ai
16:03 To: juzhe.zh...@rivai.ai CC: Robin Dapp; gcc-patches; kito.cheng; jeffreyalaw Subject: Re: Re: [PATCH] RISC-V: Support in-order floating-point reduction Seems like because you ` using namespace riscv_vector;` so the UNORDERED in expand_vec_cmp_float used reduction_type::UNORDERED Hmmm

Re: Re: [PATCH] RISC-V: Support in-order floating-point reduction

2023-07-20 Thread Kito Cheng via Gcc-patches
/../../riscv-gcc/gcc/cfgexpand.cc:6096 > > This ICE happens when compiling vcond.cc tests > ________________ > juzhe.zh...@rivai.ai > > > From: Robin Dapp > Date: 2023-07-20 15:57 > To: juzhe.zh...@rivai.ai; gcc-patches > CC: rdapp.gcc; kito.cheng; Kito.che

Re: Re: [PATCH] RISC-V: Support in-order floating-point reduction

2023-07-20 Thread juzhe.zh...@rivai.ai
appens when compiling vcond.cc tests juzhe.zh...@rivai.ai From: Robin Dapp Date: 2023-07-20 15:57 To: juzhe.zh...@rivai.ai; gcc-patches CC: rdapp.gcc; kito.cheng; Kito.cheng; jeffreyalaw Subject: Re: [PATCH] RISC-V: Support in-order floating-point reduction > The UNORDERED enum will cause ICE si

Re: [PATCH] RISC-V: Support in-order floating-point reduction

2023-07-20 Thread Robin Dapp via Gcc-patches
> The UNORDERED enum will cause ICE since we have UNORDERED in rtx_code. > > Could you give me another enum name? I would have expected it to work when it's namespaced. Regards Robin

Re: Re: [PATCH] RISC-V: Support in-order floating-point reduction

2023-07-20 Thread juzhe.zh...@rivai.ai
scalar move insn. juzhe.zh...@rivai.ai From: Kito Cheng Date: 2023-07-20 15:42 To: Juzhe-Zhong CC: gcc-patches; kito.cheng; jeffreyalaw; rdapp.gcc Subject: Re: [PATCH] RISC-V: Support in-order floating-point reduction Seems like there is a potential vsetvli optimization chance in the example

Re: [PATCH] RISC-V: Support in-order floating-point reduction

2023-07-20 Thread Kito Cheng via Gcc-patches
Seems like there is a potential vsetvli optimization chance in the example? > After this patch: > foo: > lui a5,%hi(.LC0) > flw fa0,%lo(.LC0)(a5) > ble a1,zero,.L4 > .L3: > vsetvli a5,a1,e32,m1,ta,ma > vle32.v v1,0(a0) > sllia4,a5,2 >

Re: Re: [PATCH] RISC-V: Support in-order floating-point reduction

2023-07-20 Thread juzhe.zh...@rivai.ai
The UNORDERED enum will cause ICE since we have UNORDERED in rtx_code. Could you give me another enum name? juzhe.zh...@rivai.ai From: Robin Dapp Date: 2023-07-20 15:41 To: Juzhe-Zhong; gcc-patches CC: rdapp.gcc; kito.cheng; kito.cheng; jeffreyalaw Subject: Re: [PATCH] RISC-V: Support in

Re: [PATCH] RISC-V: Support in-order floating-point reduction

2023-07-20 Thread Robin Dapp via Gcc-patches
> +enum reduction_type > +{ > + UNORDERED_REDUDUCTION, > + FOLD_LEFT_REDUDUCTION, > + MASK_LEN_FOLD_LEFT_REDUDUCTION, > +}; There are redundant 'DU's here ;) Wouldn't it be sufficient to have an enum enum reduction_type { UNORDERED, FOLD_LEFT, MASK_LEN_FOLD_LEFT, }; ? Regards Robin

[PATCH] RISC-V: Support in-order floating-point reduction

2023-07-20 Thread Juzhe-Zhong
This patch is depending on: https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624995.html Consider this following case: float foo (float *__restrict a, int n) { float result = 1.0; for (int i = 0; i < n; i++) result += a[i]; return result; } Compile with **NO** -ffast-math: Before thi