On Tue, May 21, 2019 at 12:03 AM Uros Bizjak <ubiz...@gmail.com> wrote: > > On Mon, May 20, 2019 at 11:54 PM H.J. Lu <hjl.to...@gmail.com> wrote: > > > > > > Adjust gcc.target/i386/pr22076.c for 64-bit. > > > > > > > > > > * gcc.target/i386/pr22076.c: Adjusted for 64-bit. > > > > Well, it looks like you're just papering over a code quality regression? > > > > Or am I missing something? > > > > > > We have to load 64bit value from memory to 128 bit XMM register using > > > movq. > > > > > > OTOH, we could just use -mno-sse2 which disables XMM emulation. > > > > > > > Works for me. > > 2019-05-20 Uroš Bizjak <ubiz...@gmail.com> > > PR testsuite/90503 > * gcc.target/i386/pr22076.c (dg-options): Add -mno-sse2. > > Tested on x86_64-linux-gnu and committed.
While looking at the testcase, attached patch modernizes it a bit. 2019-05-20 Uroš Bizjak <ubiz...@gmail.com> PR testsuite/90503 * gcc.target/i386/pr22076.c (dg-options): Add -mno-sse2. Remove -flax-vector-conversions. (dg-additional-options): Remove. (test): Change to void. Declare m0 and m1 as __m64 and cast initializer in a proper way. Do not return result. (dg-final): Scan for 2 instances of movq. Uros.
Index: gcc.target/i386/pr22076.c =================================================================== --- gcc.target/i386/pr22076.c (revision 271442) +++ gcc.target/i386/pr22076.c (working copy) @@ -1,19 +1,17 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fomit-frame-pointer -flax-vector-conversions -mmmx -mno-sse2" } */ -/* { dg-additional-options "-mno-vect8-ret-in-mem" { target *-*-vxworks* } } */ +/* { dg-options "-O2 -fomit-frame-pointer -mmmx -mno-sse2" } */ #include <mmintrin.h> -__v8qi test () +__m64 x; + +void test () { - __v8qi mm0 = {1,2,3,4,5,6,7,8}; - __v8qi mm1 = {11,22,33,44,55,66,77,88}; - volatile __m64 x; + __m64 mm0 = (__m64)(__v8qi) {1,2,3,4,5,6,7,8}; + __m64 mm1 = (__m64)(__v8qi) {11,22,33,44,55,66,77,88}; x = _mm_add_pi8 (mm0, mm1); - - return x; } -/* { dg-final { scan-assembler-times "movq" 3 } } */ +/* { dg-final { scan-assembler-times "movq" 2 } } */ /* { dg-final { scan-assembler-not "movl" { target nonpic } } } */