On Thu, Feb 14, 2019 at 9:21 PM Uros Bizjak <[email protected]> wrote:
>
> On Thu, Feb 14, 2019 at 1:30 PM H.J. Lu <[email protected]> wrote:
> >
> > Since we now emulate MMX intrinsics with SSE in 64-bit mode, we can
> > enable SSSE3 __m64 tests even when AVX is enabled.
> >
> > PR target/89021
> > * gcc.target/i386/ssse3-pabsb.c: Also enable __m64 check in
> > 64-bit mode.
> > * gcc.target/i386/ssse3-pabsd.c: Likewise.
> > * gcc.target/i386/ssse3-pabsw.c: Likewise.
> > * gcc.target/i386/ssse3-palignr.c: Likewise.
> > * gcc.target/i386/ssse3-phaddd.c: Likewise.
> > * gcc.target/i386/ssse3-phaddsw.c: Likewise.
> > * gcc.target/i386/ssse3-phaddw.c: Likewise.
> > * gcc.target/i386/ssse3-phsubd.c: Likewise.
> > * gcc.target/i386/ssse3-phsubsw.c: Likewise.
> > * gcc.target/i386/ssse3-phsubw.c: Likewise.
> > * gcc.target/i386/ssse3-pmaddubsw.c: Likewise.
> > * gcc.target/i386/ssse3-pmulhrsw.c: Likewise.
> > * gcc.target/i386/ssse3-pshufb.c: Likewise.
> > * gcc.target/i386/ssse3-psignb.c: Likewise.
> > * gcc.target/i386/ssse3-psignd.c: Likewise.
> > * gcc.target/i386/ssse3-psignw.c: Likewise.
> > ---
> > gcc/testsuite/gcc.target/i386/ssse3-pabsb.c | 4 ++--
> > gcc/testsuite/gcc.target/i386/ssse3-pabsd.c | 4 ++--
> > gcc/testsuite/gcc.target/i386/ssse3-pabsw.c | 4 ++--
> > gcc/testsuite/gcc.target/i386/ssse3-palignr.c | 6 +++---
> > gcc/testsuite/gcc.target/i386/ssse3-phaddd.c | 4 ++--
> > gcc/testsuite/gcc.target/i386/ssse3-phaddsw.c | 4 ++--
> > gcc/testsuite/gcc.target/i386/ssse3-phaddw.c | 4 ++--
> > gcc/testsuite/gcc.target/i386/ssse3-phsubd.c | 4 ++--
> > gcc/testsuite/gcc.target/i386/ssse3-phsubsw.c | 4 ++--
> > gcc/testsuite/gcc.target/i386/ssse3-phsubw.c | 4 ++--
> > gcc/testsuite/gcc.target/i386/ssse3-pmaddubsw.c | 4 ++--
> > gcc/testsuite/gcc.target/i386/ssse3-pmulhrsw.c | 4 ++--
> > gcc/testsuite/gcc.target/i386/ssse3-pshufb.c | 6 +++---
> > gcc/testsuite/gcc.target/i386/ssse3-psignb.c | 4 ++--
> > gcc/testsuite/gcc.target/i386/ssse3-psignd.c | 4 ++--
> > gcc/testsuite/gcc.target/i386/ssse3-psignw.c | 4 ++--
> > 16 files changed, 34 insertions(+), 34 deletions(-)
> >
> > diff --git a/gcc/testsuite/gcc.target/i386/ssse3-pabsb.c
> > b/gcc/testsuite/gcc.target/i386/ssse3-pabsb.c
> > index 7caa1b6c3a6..eef4ccae222 100644
> > --- a/gcc/testsuite/gcc.target/i386/ssse3-pabsb.c
> > +++ b/gcc/testsuite/gcc.target/i386/ssse3-pabsb.c
> > @@ -15,7 +15,7 @@
> > #include "ssse3-vals.h"
> > #include <tmmintrin.h>
> >
> > -#ifndef __AVX__
> > +#if !defined __AVX__ || defined __x86_64__
>
> Better add || defined __x86_64__.
>
> I also wonder why AVX has to be disabled here. MMX should be orthogonal to
> AVX.
Actually, current trunk passes tests with #ifndef __AVX__ removed and:
gmake -k check-gcc
RUNTESTFLAGS="--target_board=unix\{,-m32\}\{,-mavx\}
i386.exp=ssse3-*.c"
=== gcc tests ===
Schedule of variations:
unix
unix/-mavx
unix/-m32
unix/-m32/-mavx
=== gcc Summary ===
# of expected passes 128
Uros.
Index: gcc.target/i386/ssse3-pabsb.c
===================================================================
--- gcc.target/i386/ssse3-pabsb.c (revision 268854)
+++ gcc.target/i386/ssse3-pabsb.c (working copy)
@@ -15,7 +15,6 @@
#include "ssse3-vals.h"
#include <tmmintrin.h>
-#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_pabsb (int *i1, int *r)
@@ -24,7 +23,6 @@
*(__m64 *) r = _mm_abs_pi8 (t1);
_mm_empty ();
}
-#endif
/* Test the 128-bit form */
static void
@@ -63,12 +61,10 @@
/* Manually compute the result */
compute_correct_result(&vals[i + 0], ck);
-#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_pabsb (&vals[i + 0], &r[0]);
ssse3_test_pabsb (&vals[i + 2], &r[2]);
fail += chk_128 (ck, r);
-#endif
/* Run the 128-bit tests */
ssse3_test_pabsb128 (&vals[i + 0], r);
Index: gcc.target/i386/ssse3-pabsd.c
===================================================================
--- gcc.target/i386/ssse3-pabsd.c (revision 268854)
+++ gcc.target/i386/ssse3-pabsd.c (working copy)
@@ -16,7 +16,6 @@
#include <tmmintrin.h>
-#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_pabsd (int *i1, int *r)
@@ -25,7 +24,6 @@
*(__m64 *) r = _mm_abs_pi32 (t1);
_mm_empty ();
}
-#endif
/* Test the 128-bit form */
static void
@@ -62,12 +60,10 @@
/* Manually compute the result */
compute_correct_result(&vals[i + 0], ck);
-#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_pabsd (&vals[i + 0], &r[0]);
ssse3_test_pabsd (&vals[i + 2], &r[2]);
fail += chk_128 (ck, r);
-#endif
/* Run the 128-bit tests */
ssse3_test_pabsd128 (&vals[i + 0], r);
Index: gcc.target/i386/ssse3-pabsw.c
===================================================================
--- gcc.target/i386/ssse3-pabsw.c (revision 268854)
+++ gcc.target/i386/ssse3-pabsw.c (working copy)
@@ -16,7 +16,6 @@
#include <tmmintrin.h>
-#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_pabsw (int *i1, int *r)
@@ -25,7 +24,6 @@
*(__m64 *) r = _mm_abs_pi16 (t1);
_mm_empty ();
}
-#endif
/* Test the 128-bit form */
static void
@@ -64,12 +62,10 @@
/* Manually compute the result */
compute_correct_result (&vals[i + 0], ck);
-#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_pabsw (&vals[i + 0], &r[0]);
ssse3_test_pabsw (&vals[i + 2], &r[2]);
fail += chk_128 (ck, r);
-#endif
/* Run the 128-bit tests */
ssse3_test_pabsw128 (&vals[i + 0], r);
Index: gcc.target/i386/ssse3-palignr.c
===================================================================
--- gcc.target/i386/ssse3-palignr.c (revision 268854)
+++ gcc.target/i386/ssse3-palignr.c (working copy)
@@ -17,7 +17,6 @@
#include <tmmintrin.h>
#include <string.h>
-#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_palignr (int *i1, int *i2, unsigned int imm, int *r)
@@ -82,7 +81,6 @@
_mm_empty();
}
-#endif
/* Test the 128-bit form */
static void
@@ -214,7 +212,6 @@
bout[i] = buf[imm + i];
}
-#ifndef __AVX__
static void
compute_correct_result_64 (int *i1, int *i2, unsigned int imm, int *r)
{
@@ -242,7 +239,6 @@
else
bout[i + 8] = buf[imm + i];
}
-#endif
static void
TEST (void)
@@ -256,7 +252,6 @@
for (i = 0; i < 256; i += 8)
for (imm = 0; imm < 100; imm++)
{
-#ifndef __AVX__
/* Manually compute the result */
compute_correct_result_64 (&vals[i + 0], &vals[i + 4], imm, ck);
@@ -264,7 +259,6 @@
ssse3_test_palignr (&vals[i + 0], &vals[i + 4], imm, &r[0]);
ssse3_test_palignr (&vals[i + 2], &vals[i + 6], imm, &r[2]);
fail += chk_128 (ck, r);
-#endif
/* Recompute the results for 128-bits */
compute_correct_result_128 (&vals[i + 0], &vals[i + 4], imm, ck);
Index: gcc.target/i386/ssse3-phaddd.c
===================================================================
--- gcc.target/i386/ssse3-phaddd.c (revision 268854)
+++ gcc.target/i386/ssse3-phaddd.c (working copy)
@@ -16,7 +16,6 @@
#include <tmmintrin.h>
-#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_phaddd (int *i1, int *i2, int *r)
@@ -26,7 +25,6 @@
*(__m64 *) r = _mm_hadd_pi32 (t1, t2);
_mm_empty();
}
-#endif
/* Test the 128-bit form */
static void
@@ -64,12 +62,10 @@
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
-#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_phaddd (&vals[i + 0], &vals[i + 2], &r[0]);
ssse3_test_phaddd (&vals[i + 4], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
-#endif
/* Run the 128-bit tests */
ssse3_test_phaddd128 (&vals[i + 0], &vals[i + 4], r);
Index: gcc.target/i386/ssse3-phaddsw.c
===================================================================
--- gcc.target/i386/ssse3-phaddsw.c (revision 268854)
+++ gcc.target/i386/ssse3-phaddsw.c (working copy)
@@ -16,7 +16,6 @@
#include <tmmintrin.h>
-#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_phaddsw (int *i1, int *i2, int *r)
@@ -26,7 +25,6 @@
*(__m64 *) r = _mm_hadds_pi16 (t1, t2);
_mm_empty ();
}
-#endif
/* Test the 128-bit form */
static void
@@ -78,12 +76,10 @@
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
-#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_phaddsw (&vals[i + 0], &vals[i + 2], &r[0]);
ssse3_test_phaddsw (&vals[i + 4], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
-#endif
/* Run the 128-bit tests */
ssse3_test_phaddsw128 (&vals[i + 0], &vals[i + 4], r);
Index: gcc.target/i386/ssse3-phaddw.c
===================================================================
--- gcc.target/i386/ssse3-phaddw.c (revision 268854)
+++ gcc.target/i386/ssse3-phaddw.c (working copy)
@@ -16,7 +16,6 @@
#include <tmmintrin.h>
-#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_phaddw (int *i1, int *i2, int *r)
@@ -26,7 +25,6 @@
*(__m64 *) r = _mm_hadd_pi16 (t1, t2);
_mm_empty ();
}
-#endif
/* Test the 128-bit form */
static void
@@ -67,12 +65,10 @@
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
-#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_phaddw (&vals[i + 0], &vals[i + 2], &r[0]);
ssse3_test_phaddw (&vals[i + 4], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
-#endif
/* Run the 128-bit tests */
ssse3_test_phaddw128 (&vals[i + 0], &vals[i + 4], r);
Index: gcc.target/i386/ssse3-phsubd.c
===================================================================
--- gcc.target/i386/ssse3-phsubd.c (revision 268854)
+++ gcc.target/i386/ssse3-phsubd.c (working copy)
@@ -16,7 +16,6 @@
#include <tmmintrin.h>
-#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_phsubd (int *i1, int *i2, int *r)
@@ -26,7 +25,6 @@
*(__m64 *) r = _mm_hsub_pi32(t1, t2);
_mm_empty ();
}
-#endif
/* Test the 128-bit form */
static void
@@ -63,12 +61,10 @@
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
-#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_phsubd (&vals[i + 0], &vals[i + 2], &r[0]);
ssse3_test_phsubd (&vals[i + 4], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
-#endif
/* Run the 128-bit tests */
ssse3_test_phsubd128 (&vals[i + 0], &vals[i + 4], r);
Index: gcc.target/i386/ssse3-phsubsw.c
===================================================================
--- gcc.target/i386/ssse3-phsubsw.c (revision 268854)
+++ gcc.target/i386/ssse3-phsubsw.c (working copy)
@@ -16,7 +16,6 @@
#include <tmmintrin.h>
-#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_phsubsw (int *i1, int *i2, int *r)
@@ -28,7 +27,6 @@
_mm_empty ();
}
-#endif
/* Test the 128-bit form */
static void
@@ -81,12 +79,10 @@
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
-#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_phsubsw (&vals[i + 0], &vals[i + 2], &r[0]);
ssse3_test_phsubsw (&vals[i + 4], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
-#endif
/* Run the 128-bit tests */
ssse3_test_phsubsw128 (&vals[i + 0], &vals[i + 4], r);
Index: gcc.target/i386/ssse3-phsubw.c
===================================================================
--- gcc.target/i386/ssse3-phsubw.c (revision 268854)
+++ gcc.target/i386/ssse3-phsubw.c (working copy)
@@ -15,7 +15,6 @@
#include <tmmintrin.h>
-#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_phsubw (int *i1, int *i2, int *r)
@@ -25,7 +24,6 @@
*(__m64 *) r = _mm_hsub_pi16 (t1, t2);
_mm_empty ();
}
-#endif
/* Test the 128-bit form */
static void
@@ -66,12 +64,10 @@
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
-#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_phsubw (&vals[i + 0], &vals[i + 2], &r[0]);
ssse3_test_phsubw (&vals[i + 4], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
-#endif
/* Run the 128-bit tests */
ssse3_test_phsubw128 (&vals[i + 0], &vals[i + 4], r);
Index: gcc.target/i386/ssse3-pmaddubsw.c
===================================================================
--- gcc.target/i386/ssse3-pmaddubsw.c (revision 268854)
+++ gcc.target/i386/ssse3-pmaddubsw.c (working copy)
@@ -16,7 +16,6 @@
#include <tmmintrin.h>
-#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_pmaddubsw (int *i1, int *i2, int *r)
@@ -26,7 +25,6 @@
*(__m64 *) r = _mm_maddubs_pi16 (t1, t2);
_mm_empty ();
}
-#endif
/* Test the 128-bit form */
static void
@@ -81,12 +79,10 @@
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
-#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_pmaddubsw (&vals[i + 0], &vals[i + 4], &r[0]);
ssse3_test_pmaddubsw (&vals[i + 2], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
-#endif
/* Run the 128-bit tests */
ssse3_test_pmaddubsw128 (&vals[i + 0], &vals[i + 4], r);
Index: gcc.target/i386/ssse3-pmulhrsw.c
===================================================================
--- gcc.target/i386/ssse3-pmulhrsw.c (revision 268854)
+++ gcc.target/i386/ssse3-pmulhrsw.c (working copy)
@@ -16,7 +16,6 @@
#include <tmmintrin.h>
-#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_pmulhrsw (int *i1, int *i2, int *r)
@@ -26,7 +25,6 @@
*(__m64 *) r = _mm_mulhrs_pi16 (t1, t2);
_mm_empty ();
}
-#endif
/* Test the 128-bit form */
static void
@@ -68,12 +66,10 @@
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
-#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_pmulhrsw (&vals[i + 0], &vals[i + 4], &r[0]);
ssse3_test_pmulhrsw (&vals[i + 2], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
-#endif
/* Run the 128-bit tests */
ssse3_test_pmulhrsw128 (&vals[i + 0], &vals[i + 4], r);
Index: gcc.target/i386/ssse3-pshufb.c
===================================================================
--- gcc.target/i386/ssse3-pshufb.c (revision 268854)
+++ gcc.target/i386/ssse3-pshufb.c (working copy)
@@ -16,7 +16,6 @@
#include <tmmintrin.h>
-#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_pshufb (int *i1, int *i2, int *r)
@@ -26,7 +25,6 @@
*(__m64 *)r = _mm_shuffle_pi8 (t1, t2);
_mm_empty ();
}
-#endif
/* Test the 128-bit form */
static void
@@ -38,7 +36,6 @@
*(__m128i *)r = _mm_shuffle_epi8 (t1, t2);
}
-#ifndef __AVX__
/* Routine to manually compute the results */
static void
compute_correct_result_64 (int *i1, int *i2, int *r)
@@ -60,7 +57,6 @@
bout[i] = b1[8 + (select & 0x7)];
}
}
-#endif
static void
compute_correct_result_128 (int *i1, int *i2, int *r)
@@ -91,7 +87,6 @@
for (i = 0; i < 256; i += 8)
{
-#ifndef __AVX__
/* Manually compute the result */
compute_correct_result_64 (&vals[i + 0], &vals[i + 4], ck);
@@ -99,7 +94,6 @@
ssse3_test_pshufb (&vals[i + 0], &vals[i + 4], &r[0]);
ssse3_test_pshufb (&vals[i + 2], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
-#endif
/* Recompute the result for 128-bits */
compute_correct_result_128 (&vals[i + 0], &vals[i + 4], ck);
Index: gcc.target/i386/ssse3-psignb.c
===================================================================
--- gcc.target/i386/ssse3-psignb.c (revision 268854)
+++ gcc.target/i386/ssse3-psignb.c (working copy)
@@ -15,7 +15,6 @@
#include <tmmintrin.h>
-#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_psignb (int *i1, int *i2, int *r)
@@ -25,7 +24,6 @@
*(__m64 *) r = _mm_sign_pi8 (t1, t2);
_mm_empty ();
}
-#endif
/* Test the 128-bit form */
static void
@@ -68,12 +66,10 @@
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
-#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_psignb (&vals[i + 0], &vals[i + 4], &r[0]);
ssse3_test_psignb (&vals[i + 2], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
-#endif
/* Run the 128-bit tests */
ssse3_test_psignb128 (&vals[i + 0], &vals[i + 4], r);
Index: gcc.target/i386/ssse3-psignd.c
===================================================================
--- gcc.target/i386/ssse3-psignd.c (revision 268854)
+++ gcc.target/i386/ssse3-psignd.c (working copy)
@@ -15,7 +15,6 @@
#include <tmmintrin.h>
-#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_psignd (int *i1, int *i2, int *r)
@@ -25,7 +24,6 @@
*(__m64 *) r = _mm_sign_pi32 (t1, t2);
_mm_empty ();
}
-#endif
/* Test the 128-bit form */
static void
@@ -65,12 +63,10 @@
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
-#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_psignd (&vals[i + 0], &vals[i + 4], &r[0]);
ssse3_test_psignd (&vals[i + 2], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
-#endif
/* Run the 128-bit tests */
ssse3_test_psignd128 (&vals[i + 0], &vals[i + 4], r);
Index: gcc.target/i386/ssse3-psignw.c
===================================================================
--- gcc.target/i386/ssse3-psignw.c (revision 268854)
+++ gcc.target/i386/ssse3-psignw.c (working copy)
@@ -15,7 +15,6 @@
#include <tmmintrin.h>
-#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_psignw (int *i1, int *i2, int *r)
@@ -25,7 +24,6 @@
*(__m64 *) r = _mm_sign_pi16 (t1, t2);
_mm_empty ();
}
-#endif
/* Test the 128-bit form */
static void
@@ -68,12 +66,10 @@
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
-#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_psignw (&vals[i + 0], &vals[i + 4], &r[0]);
ssse3_test_psignw (&vals[i + 2], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
-#endif
/* Run the 128-bit tests */
ssse3_test_psignw128 (&vals[i + 0], &vals[i + 4], r);