From: H.J. Lu Date: Tue, 5 Jan 2021 18:57:20 +0000 (-0800) Subject: x86: Use unsigned short to compute pextrw result X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f6dd35cf9300ae482038c26655b3cee3e72cefb1;p=gcc.git x86: Use unsigned short to compute pextrw result Use unsigned short to compute the zero-extended pextrw result. PR target/98495 * gcc.target/i386/sse2-mmx-pextrw.c (compute_correct_result): Use unsigned short to compute pextrw result. --- diff --git a/gcc/testsuite/gcc.target/i386/sse2-mmx-pextrw.c b/gcc/testsuite/gcc.target/i386/sse2-mmx-pextrw.c index bb48740a7ca..edbac919fd8 100644 --- a/gcc/testsuite/gcc.target/i386/sse2-mmx-pextrw.c +++ b/gcc/testsuite/gcc.target/i386/sse2-mmx-pextrw.c @@ -32,7 +32,7 @@ test_pextrw (__m64 *i, unsigned int imm, int *r) static void compute_correct_result (__m64 *src_p, unsigned int imm, int *res_p) { - short *src = (short *) src_p; + unsigned short *src = (unsigned short *) src_p; if (imm < 4) *res_p = src[imm]; }