Re: [PATCH 1/2] [x86] Support vector float_truncate for SF to BF.

2024-11-07 Thread Hongtao Liu
On Thu, Nov 7, 2024 at 3:52 PM Jakub Jelinek wrote: > > On Thu, Nov 07, 2024 at 01:57:21PM +0800, Hongtao Liu wrote: > > > Does it turn the sNaNs into infinities or qNaNs silently? > > Yes. > > Into infinities? Into qNaNs(Sorry, I didn't see it clearly.) > > > > Given the rounding, flag_rounding_m

Re: [PATCH 1/2] [x86] Support vector float_truncate for SF to BF.

2024-11-06 Thread Jakub Jelinek
On Thu, Nov 07, 2024 at 01:57:21PM +0800, Hongtao Liu wrote: > > Does it turn the sNaNs into infinities or qNaNs silently? > Yes. Into infinities? > > Given the rounding, flag_rounding_math should avoid the hw instructions, > The default rounding mode for flag_rounding_math is rounding to > neare

Re: [PATCH 1/2] [x86] Support vector float_truncate for SF to BF.

2024-11-06 Thread Hongtao Liu
On Tue, Nov 5, 2024 at 5:19 PM Jakub Jelinek wrote: > > On Tue, Nov 05, 2024 at 05:12:56PM +0800, Hongtao Liu wrote: > > Yes, there's a mismatch between scalar and vector code, I assume users > > may not care much about precision/NAN/INF/denormal behaviors for > > vector code. > > Just like we sup

Re: [PATCH 1/2] [x86] Support vector float_truncate for SF to BF.

2024-11-05 Thread Jakub Jelinek
On Tue, Nov 05, 2024 at 05:12:56PM +0800, Hongtao Liu wrote: > Yes, there's a mismatch between scalar and vector code, I assume users > may not care much about precision/NAN/INF/denormal behaviors for > vector code. > Just like we support > #define RECIP_MASK_DEFAULT (RECIP_MASK_VEC_DIV | RECIP_MAS

Re: [PATCH 1/2] [x86] Support vector float_truncate for SF to BF.

2024-11-05 Thread Hongtao Liu
On Tue, Nov 5, 2024 at 4:46 PM Jakub Jelinek wrote: > > On Tue, Oct 29, 2024 at 07:19:38PM -0700, liuhongt wrote: > > Generate native instruction whenever possible, otherwise use vector > > permutation with odd indices. > > > > Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. > > Ready pu

Re: [PATCH 1/2] [x86] Support vector float_truncate for SF to BF.

2024-11-05 Thread Jakub Jelinek
On Tue, Oct 29, 2024 at 07:19:38PM -0700, liuhongt wrote: > Generate native instruction whenever possible, otherwise use vector > permutation with odd indices. > > Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. > Ready push to trunk. > > gcc/ChangeLog: > > * config/i386/i386-exp

[PATCH 1/2] [x86] Support vector float_truncate for SF to BF.

2024-10-29 Thread liuhongt
Generate native instruction whenever possible, otherwise use vector permutation with odd indices. Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. Ready push to trunk. gcc/ChangeLog: * config/i386/i386-expand.cc (ix86_expand_vector_sf2bf_with_vec_perm): New function.