https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98856
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> --- For arithmetic >> (element_precision - 1) one can just use {,v}pxor + {,v}pcmpgtq, as in instead of return vec >> 63; do return vec < 0; (in C++-ish way), aka VEC_COND_EXPR vec < 0, { all ones }, { 0 } For other arithmetic shifts by scalar constant, perhaps one can replace return vec >> 17; with return (vectype) ((uvectype) vec >> 17) | ((vec < 0) << (64 - 17)); - it will actually work even for non-constant scalar shift amounts because {,v}psllq treats shift counts > 63 as 0.