Add missing returns and remove unnecessary postfix increments.
2020-11-27 Uroš Bizjak <ubizjak@gmail.com>
PR testsuite/98036
gcc/testsuite/
* gcc.target/i386/fma4-256-maccXX.c (check_maccps):
Remove unnecessary postfix increment on a returned variable.
(check_maccpd): Ditto.
* gcc.target/i386/fma4-256-msubXX.c (check_msubps): Ditto.
(check_msubpd): Ditto.
* gcc.target/i386/fma4-256-nmaccXX.c (check_nmaccps): Ditto.
(check_nmaccpd): Ditto.
* gcc.target/i386/fma4-256-nmsubXX.c (check_nmsubps): Ditto.
(check_nmsubpd): Ditto.
* gcc.target/i386/fma4-maccXX.c (check_maccps): Ditto.
(check_maccpd): Ditto.
(check_maccss): Ditto.
(check_maccsd): Ditto.
* gcc.target/i386/fma4-msubXX.c (check_msubps): Ditto.
(check_msubpd): Ditto.
(check_msubss): Ditto.
(check_msubsd): Ditto.
* gcc.target/i386/fma4-nmaccXX.c (check_nmaccps): Ditto.
(check_nmaccpd): Ditto.
(check_nmaccss): Ditto.
(check_nmaccsd): Ditto.
* gcc.target/i386/fma4-nmsubXX.c (check_nmsubps): Ditto.
(check_nmsubpd): Ditto.
(check_nmsubss): Ditto.
(check_nmsubsd): Ditto.
* gcc.target/i386/xop-haddX.c (check_sbyte2word): Add missing return.
(check_sbyte2dword):
Remove unnecessary postfix increment on a returned value.
(check_sbyte2qword): Ditto.
(check_sword2dword): Add missing return.
(check_sword2qword):
Remove unnecessary postfix increment on a returned value.
(check_dword2qword): Add missing return.
* gcc.target/i386/xop-hadduX.c (check_byte2word): Add missing return.
(check_byte2dword):
Remove unnecessary postfix increment on a returned value.
(check_byte2qword): Ditto.
(check_word2dword): Add missing return.
(check_word2qword):
Remove unnecessary postfix increment on a returned value.
(check_word2qword): Add missing return.
* gcc.target/i386/xop-hsubX.c (check_sbyte2word): Add missing return.
(check_sword2dword): Ditto.
(check_sword2qword): Ditto.
double d[NUM * 4];
} dst, res, src1, src2, src3;
-
/* Note that in macc*,msub*,mnmacc* and mnsub* instructions, the intermdediate
product is not rounded, only the addition is rounded. */
if (dst.f[i + j] != res.f[i + j])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
static int
if (dst.d[i + j] != res.d[i + j])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
static void
if (dst.f[i + j] != res.f[i + j])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
static int
if (dst.d[i + j] != res.d[i + j])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
static void
if (check_msubpd ())
abort ();
-
}
if (dst.f[i + j] != res.f[i + j])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
static int
if (dst.d[i + j] != res.d[i + j])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
static void
if (check_nmaccpd ())
abort ();
-
}
if (dst.f[i + j] != res.f[i + j])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
static int
if (dst.d[i + j] != res.d[i + j])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
static void
if (check_nmsubpd (&dst.y[i], &src1.d[i * 2], &src2.d[i * 2], &src3.d[i * 2]))
abort ();
-
}
double d[NUM * 2];
} dst, res, src1, src2, src3;
-
/* Note that in macc*,msub*,mnmacc* and mnsub* instructions, the intermdediate
product is not rounded, only the addition is rounded. */
if (dst.f[i + j] != res.f[i + j])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
static int
if (dst.d[i + j] != res.d[i + j])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
if (dst.f[i] != res.f[i])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
static int
if (dst.d[i] != res.d[i])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
static void
if (check_maccsd ())
abort ();
-
}
if (dst.f[i + j] != res.f[i + j])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
static int
if (dst.d[i + j] != res.d[i + j])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
-
static int
check_msubss ()
{
if (dst.f[i] != res.f[i])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
static int
if (dst.d[i] != res.d[i])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
static void
if (dst.f[i + j] != res.f[i + j])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
static int
if (dst.d[i + j] != res.d[i + j])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
-
static int
check_nmaccss ()
{
if (dst.f[i] != res.f[i])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
static int
if (dst.d[i] != res.d[i])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
static void
if (check_nmaccps ())
abort ();
-
for (i = 0; i < NUM; i++)
dst.x[i] = _mm_nmacc_ss (src1.x[i], src2.x[i], src3.x[i]);
if (check_nmaccpd ())
abort ();
-
for (i = 0; i < NUM; i++)
dst.y[i] = _mm_nmacc_sd (src1.y[i], src2.y[i], src3.y[i]);
if (check_nmaccsd ())
abort ();
-
}
if (dst.f[i + j] != res.f[i + j])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
static int
if (dst.d[i + j] != res.d[i + j])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
-
static int
check_nmsubss ()
{
if (dst.f[i] != res.f[i])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
static int
if (dst.d[i] != res.d[i])
check_fails++;
}
- return check_fails++;
+ return check_fails;
}
static void
if (check_nmsubps (&dst.x[i], &src1.f[i * 4], &src2.f[i * 4], &src3.f[i * 4]))
abort ();
-
for (i = 0; i < NUM; i++)
dst.x[i] = _mm_nmsub_ss (src1.x[i], src2.x[i], src3.x[i]);
if (check_nmsubpd (&dst.y[i], &src1.d[i * 2], &src2.d[i * 2], &src3.d[i * 2]))
abort ();
-
for (i = 0; i < NUM; i++)
dst.y[i] = _mm_nmsub_sd (src1.y[i], src2.y[i], src3.y[i]);
if (check_nmsubsd (&dst.y[i], &src1.d[i * 2], &src2.d[i * 2], &src3.d[i * 2]))
abort ();
-
}
src1.si[i] = i;
}
-
static void
init_sdword ()
{
check_fails++;
}
}
+ return check_fails;
}
static int
check_fails++;
}
}
- return check_fails++;
+ return check_fails;
}
static int
check_fails++;
}
}
- return check_fails++;
+ return check_fails;
}
static int
check_sword2dword ()
{
int i, j, s, t, check_fails = 0;
- for (i = 0; i < (NUM * 8); i = i + 8)
+ for (i = 0; i < NUM * 8; i = i + 8)
{
for (j = 0; j < 4; j++)
{
check_fails++;
}
}
+ return check_fails;
}
static int
check_fails++;
}
}
- return check_fails++;
+ return check_fails;
}
static int
check_dword2qword ()
{
int i, j, s, t, check_fails = 0;
- for (i = 0; i < (NUM * 4); i = i + 4)
+ for (i = 0; i < NUM * 4; i = i + 4)
{
for (j = 0; j < 2; j++)
{
check_fails++;
}
}
+ return check_fails;
}
static void
dst.x[i] = _mm_haddw_epi8 (src1.x[i]);
if (check_sbyte2word())
- abort ();
-
+ abort ();
- for (i = 0; i < (NUM ); i++)
+ for (i = 0; i < NUM; i++)
dst.x[i] = _mm_haddd_epi8 (src1.x[i]);
if (check_sbyte2dword())
abort ();
-
for (i = 0; i < NUM; i++)
dst.x[i] = _mm_haddq_epi8 (src1.x[i]);
if (check_sbyte2qword())
abort ();
-
init_sword ();
- for (i = 0; i < (NUM ); i++)
+ for (i = 0; i < NUM; i++)
dst.x[i] = _mm_haddd_epi16 (src1.x[i]);
if (check_sword2dword())
if (check_sword2qword())
abort ();
-
init_sdword ();
- for (i = 0; i < NUM; i++)
+ for (i = 0; i < NUM; i++)
dst.x[i] = _mm_haddq_epi32 (src1.x[i]);
if (check_dword2qword())
abort ();
-
}
src1.si[i] = i;
}
-
static void
init_dword ()
{
check_fails++;
}
}
+ return check_fails;
}
static int
check_fails++;
}
}
- return check_fails++;
+ return check_fails;
}
static int
check_fails++;
}
}
- return check_fails++;
+ return check_fails;
}
static int
check_word2dword ()
{
int i, j, s, t, check_fails = 0;
- for (i = 0; i < (NUM * 8); i = i + 8)
+ for (i = 0; i < NUM * 8; i = i + 8)
{
for (j = 0; j < 4; j++)
{
check_fails++;
}
}
+ return check_fails;
}
static int
check_fails++;
}
}
- return check_fails++;
+ return check_fails;
}
static int
check_dword2qword ()
{
int i, j, s, t, check_fails = 0;
- for (i = 0; i < (NUM * 4); i = i + 4)
+ for (i = 0; i < NUM * 4; i = i + 4)
{
for (j = 0; j < 2; j++)
{
check_fails++;
}
}
+ return check_fails;
}
static void
abort ();
/* Check haddubd */
- for (i = 0; i < (NUM ); i++)
+ for (i = 0; i < NUM; i++)
dst.x[i] = _mm_haddd_epu8 (src1.x[i]);
if (check_byte2dword())
/* Check hadduwd */
init_word ();
- for (i = 0; i < (NUM ); i++)
+ for (i = 0; i < NUM; i++)
dst.x[i] = _mm_haddd_epu16 (src1.x[i]);
if (check_word2dword())
abort ();
/* Check haddbuwq */
-
for (i = 0; i < NUM; i++)
dst.x[i] = _mm_haddq_epu16 (src1.x[i]);
/* Check hadudq */
init_dword ();
- for (i = 0; i < NUM; i++)
+
+ for (i = 0; i < NUM; i++)
dst.x[i] = _mm_haddq_epu32 (src1.x[i]);
if (check_dword2qword())
src1.si[i] = i;
}
-
static void
init_sdword ()
{
check_fails++;
}
}
+ return check_fails;
}
static int
check_sword2dword ()
{
int i, j, s, t, check_fails = 0;
- for (i = 0; i < (NUM * 8); i = i + 8)
+ for (i = 0; i < NUM * 8; i = i + 8)
{
for (j = 0; j < 4; j++)
{
check_fails++;
}
}
+ return check_fails;
}
static int
check_dword2qword ()
{
int i, j, s, t, check_fails = 0;
- for (i = 0; i < (NUM * 4); i = i + 4)
+ for (i = 0; i < NUM * 4; i = i + 4)
{
for (j = 0; j < 2; j++)
{
check_fails++;
}
}
+ return check_fails;
}
static void
dst.x[i] = _mm_hsubw_epi8 (src1.x[i]);
if (check_sbyte2word())
- abort ();
-
+ abort ();
/* Check hsubwd */
init_sword ();
- for (i = 0; i < (NUM ); i++)
+ for (i = 0; i < NUM; i++)
dst.x[i] = _mm_hsubd_epi16 (src1.x[i]);
if (check_sword2dword())
/* Check hsubdq */
init_sdword ();
- for (i = 0; i < NUM; i++)
+
+ for (i = 0; i < NUM; i++)
dst.x[i] = _mm_hsubq_epi32 (src1.x[i]);
if (check_dword2qword())