On 1/1/21 6:34 AM, H.J. Lu via Gcc-patches wrote:
> _mm_extract_pi16 is intrinsic for pextrw, which should be zero-extended,
> not sign-extended.
>
> gcc/
>
> PR target/98495
> * config/i386/xmmintrin.h (_mm_extract_pi16): Cast to unsigned
> short first.
I'd tend to prefer masking with 0xffff rather than relying on the size
of a particular type being what we need. But this header is limited to
just x86 and it doesn't look like there's any variance in the size of a
short, across the x86 platforms.
So, OK.
jeff