Re: Re: Question about dynamic choosing vectorization factor for RVV

2023-08-31 Thread Richard Biener via Gcc
t; vadd.vv v4,v4,v8 > > sub a2,a2,a5 > > vsetvli zero,a5,e32,m4,ta,ma > > vse32.v v4,0(a4) > > add a0,a0,a3 > > add a1,a1,a3 > > add a4,a4,a3 > > bne a2,zero,.L3 > > > > Fantastic architecture of GCC Vector Cost model! > > > > Th

Re: Re: Question about dynamic choosing vectorization factor for RVV

2023-08-31 Thread juzhe.zh...@rivai.ai
Biener Date: 2023-08-31 19:29 To: juzhe.zh...@rivai.ai CC: gcc; richard.sandiford Subject: Re: Re: Question about dynamic choosing vectorization factor for RVV On Thu, 31 Aug 2023, juzhe.zh...@rivai.ai wrote: > Hi. Thanks Richard and Richi. > > Now, I figure out how to choose sma

Re: Re: Question about dynamic choosing vectorization factor for RVV

2023-08-31 Thread juzhe.zh...@rivai.ai
Subject: Re: Re: Question about dynamic choosing vectorization factor for RVV On Thu, 31 Aug 2023, juzhe.zh...@rivai.ai wrote: > Hi. Thanks Richard and Richi. > > Now, I figure out how to choose smaller LMUL now. > > void > costs::finish_cost (const vector_costs *scalar_costs) >

Re: Re: Question about dynamic choosing vectorization factor for RVV

2023-08-31 Thread Richard Biener via Gcc
,v4,v8 > sub a2,a2,a5 > vsetvli zero,a5,e32,m4,ta,ma > vse32.v v4,0(a4) > add a0,a0,a3 > add a1,a1,a3 > add a4,a4,a3 > bne a2,zero,.L3 > > Fantastic architecture of GCC Vector Cost model! > > Thanks a lot. > > > juzhe.zh...@rivai.ai > > From: Richard Bi

Re: Re: Question about dynamic choosing vectorization factor for RVV

2023-08-31 Thread juzhe.zh...@rivai.ai
diford Subject: Re: Re: Question about dynamic choosing vectorization factor for RVV On Thu, 31 Aug 2023, juzhe.zh...@rivai.ai wrote: > Thanks Richi. > > I am trying to figure out how to adjust finish_cost to lower the LMUL > > For example: > > void > foo (int32_t *__res

Re: Re: Question about dynamic choosing vectorization factor for RVV

2023-08-31 Thread Richard Biener via Gcc
On Thu, 31 Aug 2023, juzhe.zh...@rivai.ai wrote: > Thanks Richi. > > I am trying to figure out how to adjust finish_cost to lower the LMUL > > For example: > > void > foo (int32_t *__restrict a, int32_t *__restrict b, int n) > { > for (int i = 0; i < n; i++) > a[i] = a[i] + b[i]; > } > >

Re: Re: Question about dynamic choosing vectorization factor for RVV

2023-08-31 Thread juzhe.zh...@rivai.ai
Thanks Richi. I am trying to figure out how to adjust finish_cost to lower the LMUL For example: void foo (int32_t *__restrict a, int32_t *__restrict b, int n) { for (int i = 0; i < n; i++) a[i] = a[i] + b[i]; } preferred_simd_mode pick LMUL = 8 (RVVM8SImode) Is is possible that we can a