jit: fix test-vector-* failures

Fix failures seen on i686 due to relying on exact floating-point
equality when testing results of vector division.

gcc/testsuite/ChangeLog:
	* jit.dg/test-vector-rvalues.cc (check_div): Add specialization
	for v4f, to avoid relying on exact floating-point equality.
	* jit.dg/test-vector-types.cc (check_div): Likewise.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
This commit is contained in:
David Malcolm 2021-06-25 19:07:30 -04:00
parent 176289e50e
commit 99585d88a0
2 changed files with 16 additions and 0 deletions

View File

@ -165,6 +165,14 @@ check_div (const V &a, const V &b, const V &c)
CHECK_VALUE (c[i], a[i] / b[i]);
}
template <>
void
check_div<v4f> (const v4f &a, const v4f &b, const v4f &c)
{
for (int i = 0; i < 4; i++)
CHECK_DOUBLE_VALUE (c[i], a[i] / b[i]);
}
template <typename V, typename E>
void
verify_vec_code (gcc_jit_context *ctxt, gcc_jit_result *result,

View File

@ -139,6 +139,14 @@ check_div (const T &a, const T &b, const T &c)
CHECK_VALUE (c[i], a[i] / b[i]);
}
template <>
void
check_div<v4f> (const v4f &a, const v4f &b, const v4f &c)
{
for (int i = 0; i < 4; i++)
CHECK_DOUBLE_VALUE (c[i], a[i] / b[i]);
}
template <typename T>
void
verify_vec_code (gcc_jit_context *ctxt, gcc_jit_result *result,