Re: [PATCH] RISC-V: Fix wrong tune parameters on int_div

2023-10-27 Thread Jeff Law
On 10/27/23 11:39, Andrew Waterman wrote: On Fri, Oct 27, 2023 at 6:44 AM Jeff Law wrote: On 10/27/23 01:37, juzhe.zh...@rivai.ai wrote: LGTM from my side. The original integer division COST seems too low. Almost certainly, though there may be good reasons why it was initially set so l

Re: [PATCH] RISC-V: Fix wrong tune parameters on int_div

2023-10-27 Thread Andrew Waterman
On Fri, Oct 27, 2023 at 6:44 AM Jeff Law wrote: > > > > On 10/27/23 01:37, juzhe.zh...@rivai.ai wrote: > > LGTM from my side. > > > > The original integer division COST seems too low. > Almost certainly, though there may be good reasons why it was initially > set so low. I'm generally hesitant to

Re: [PATCH] RISC-V: Fix wrong tune parameters on int_div

2023-10-27 Thread Andrew Waterman
On Fri, Oct 27, 2023 at 6:55 AM Jeff Law wrote: > > > > On 10/27/23 01:49, Robin Dapp wrote: > >> @@ -346,7 +346,7 @@ static const struct riscv_tune_param rocket_tune_info > >> = { > >> {COSTS_N_INSNS (4), COSTS_N_INSNS (5)}, /* fp_mul */ > >> {COSTS_N_INSNS (20), COSTS_N_INSNS (20)},

Re: [PATCH] RISC-V: Fix wrong tune parameters on int_div

2023-10-27 Thread Jeff Law
On 10/26/23 12:50, Yangyu Chen wrote: This patch fixes an issue with the cost on "int_div" in various RISC-V tune parameters including those for Rocket, SiFive U7 series, and T-Head C906. This incorrect cost value interferes with the optimization process. For example, it prevents the optimizat

Re: [PATCH] RISC-V: Fix wrong tune parameters on int_div

2023-10-27 Thread Jeff Law
On 10/27/23 01:49, Robin Dapp wrote: @@ -346,7 +346,7 @@ static const struct riscv_tune_param rocket_tune_info = { {COSTS_N_INSNS (4), COSTS_N_INSNS (5)}, /* fp_mul */ {COSTS_N_INSNS (20), COSTS_N_INSNS (20)}, /* fp_div */ {COSTS_N_INSNS (4), COSTS_N_INSNS (4)}, /* int_mu

Re: [PATCH] RISC-V: Fix wrong tune parameters on int_div

2023-10-27 Thread Jeff Law
On 10/27/23 01:37, juzhe.zh...@rivai.ai wrote: LGTM from my side. The original integer division COST seems too low. Almost certainly, though there may be good reasons why it was initially set so low. I'm generally hesitant to change things like that without either someone with knowledge of

Re: [PATCH] RISC-V: Fix wrong tune parameters on int_div

2023-10-27 Thread Robin Dapp
> @@ -346,7 +346,7 @@ static const struct riscv_tune_param rocket_tune_info = { >{COSTS_N_INSNS (4), COSTS_N_INSNS (5)},/* fp_mul */ >{COSTS_N_INSNS (20), COSTS_N_INSNS (20)}, /* fp_div */ >{COSTS_N_INSNS (4), COSTS_N_INSNS (4)},/* int_mul */ > - {COSTS_N_INSNS (6), COSTS_N_IN