[Bug tree-optimization/126160] [x86] missed vectorization for __builtin_lrintf

"liuhongt at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126160

--- Comment #5 from Hongtao Liu <liuhongt at gcc dot gnu.org> ---

> Note there's also vectorizable_conversion which might be a better fit
> (that would also in theory support multi-step conversions).
> 
> Confirmed.  The code generation part for WIDEN isn't implemented.

vectorizable_conversion relies on vec_unpack optab to do the widen conversions,
but we don't have vec_unpack_lrint_{lo, hi}, can't reused existed code
vectorizable_conversion, need to manually do vec_unpack. maybe use
BIT_FIELD_REF and check vec_extract_lo/hi optab support

4361    CASE_CONVERT:                        
4362      c1 = VEC_UNPACK_LO_EXPR;           
4363      c2 = VEC_UNPACK_HI_EXPR;           
4364      break;                             
4365                                         
4366    case FLOAT_EXPR:                     
4367      c1 = VEC_UNPACK_FLOAT_LO_EXPR;     
4368      c2 = VEC_UNPACK_FLOAT_HI_EXPR;     
4369      break;                             
4370                                         
4371    case FIX_TRUNC_EXPR:                 
4372      c1 = VEC_UNPACK_FIX_TRUNC_LO_EXPR; 
4373      c2 = VEC_UNPACK_FIX_TRUNC_HI_EXPR; 
4374      break;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.