From f6dd35cf9300ae482038c26655b3cee3e72cefb1 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 5 Jan 2021 10:57:20 -0800 Subject: [PATCH] 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. --- gcc/testsuite/gcc.target/i386/sse2-mmx-pextrw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]; } -- 2.30.2