1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

Improve libm-test XFAILing for ibm128-libgcc.

This patch further improves XFAILing for ibm128-libgcc of tests in
auto-libm-test-*.

The bulk of the cases needing XFAILing are
xfail-rounding:ibm128-libgcc used for inputs where (possibly after
rounding the inputs to another floating-point type) the result
overflows (and the result in non-default rounding modes may be wildly
wrong with unpatched libgcc) or underflows near 0 (and the result in
non-default rounding modes may end up having the wrong sign).  This
patch makes gen-auto-libm-tests detect such cases and apply
xfail-rounding:ibm128-libgcc automatically to them, so most of the
manual XFAILs in auto-libm-test-in are no longer needed (some are
still needed if e.g. the result is very close to overflow, resulting
in an internal overflow in libgcc in some rounding modes).  A few
manual XFAILs are added for cases not covered by this
gen-auto-libm-tests change, and a few existing such XFAILs are left
in.

Tested for powerpc.

	* math/gen-auto-libm-tests.c (output_for_one_input_case): Apply
	xfail-rounding:ibm128-libgcc automatically to tests overflowing
	and those that can underflow to zero.
	* math/auto-libm-test-in: Remove most XFAILs for ibm128-libgcc and
	add others.
	* math/auto-libm-test-out: Regenerated.
This commit is contained in:
Joseph Myers
2017-01-09 22:40:59 +00:00
parent c6be839efd
commit 08f7b95dbd
4 changed files with 16686 additions and 16664 deletions

View File

@@ -1907,6 +1907,7 @@ output_for_one_input_case (FILE *fp, const char *filename, test_function *tf,
error (EXIT_FAILURE, errno, "write to '%s'", filename);
/* Print outputs. */
bool must_erange = false;
bool some_underflow_zero = false;
for (size_t i = 0; i < tf->num_ret; i++)
{
generic_value g;
@@ -1924,6 +1925,10 @@ output_for_one_input_case (FILE *fp, const char *filename, test_function *tf,
&& (all_exc_before[i][m]
& (1U << exc_underflow)) != 0)
must_erange = true;
if (mpfr_zero_p (all_res[i][rm_towardzero])
&& (all_exc_before[i][m]
& (1U << exc_underflow)) != 0)
some_underflow_zero = true;
mpfr_init2 (g.value.f, fp_formats[f].mant_dig);
assert_exact (mpfr_set (g.value.f, all_res[i][m],
MPFR_RNDN));
@@ -1971,6 +1976,16 @@ output_for_one_input_case (FILE *fp, const char *filename, test_function *tf,
default:
break;
}
/* For the ibm128 format, expect incorrect overflowing
results in rounding modes other than to nearest;
likewise incorrect results where the result may
underflow to 0. */
if (f == fp_ldbl_128ibm
&& m != rm_tonearest
&& (some_underflow_zero
|| (merged_exc_before[m] & (1U << exc_overflow)) != 0))
if (fputs (" xfail:ibm128-libgcc", fp) < 0)
error (EXIT_FAILURE, errno, "write to '%s'", filename);
/* Print exception flags and compute errno
expectations where not already computed. */
bool may_edom = false;