aboutsummaryrefslogtreecommitdiff
path: root/tests/fp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fp')
-rw-r--r--tests/fp/fp-bench.c10
-rw-r--r--tests/fp/fp-test-log2.c2
-rw-r--r--tests/fp/fp-test.c9
-rw-r--r--tests/fp/meson.build16
4 files changed, 36 insertions, 1 deletions
diff --git a/tests/fp/fp-bench.c b/tests/fp/fp-bench.c
index 8ce0ca1..d90f542 100644
--- a/tests/fp/fp-bench.c
+++ b/tests/fp/fp-bench.c
@@ -488,6 +488,16 @@ static void run_bench(void)
{
bench_func_t f;
+ /*
+ * These implementation-defined choices for various things IEEE
+ * doesn't specify match those used by the Arm architecture.
+ */
+ set_float_2nan_prop_rule(float_2nan_prop_s_ab, &soft_status);
+ set_float_3nan_prop_rule(float_3nan_prop_s_cab, &soft_status);
+ set_float_infzeronan_rule(float_infzeronan_dnan_if_qnan, &soft_status);
+ set_float_default_nan_pattern(0b01000000, &soft_status);
+ set_float_ftz_detection(float_ftz_before_rounding, &soft_status);
+
f = bench_funcs[operation][precision];
g_assert(f);
f();
diff --git a/tests/fp/fp-test-log2.c b/tests/fp/fp-test-log2.c
index 4eae93e..79f619c 100644
--- a/tests/fp/fp-test-log2.c
+++ b/tests/fp/fp-test-log2.c
@@ -70,6 +70,8 @@ int main(int ac, char **av)
float_status qsf = {0};
int i;
+ set_float_2nan_prop_rule(float_2nan_prop_s_ab, &qsf);
+ set_float_default_nan_pattern(0b01000000, &qsf);
set_float_rounding_mode(float_round_nearest_even, &qsf);
test.d = 0.0;
diff --git a/tests/fp/fp-test.c b/tests/fp/fp-test.c
index 36b5712..c619e5d 100644
--- a/tests/fp/fp-test.c
+++ b/tests/fp/fp-test.c
@@ -935,6 +935,15 @@ void run_test(void)
{
unsigned int i;
+ /*
+ * These implementation-defined choices for various things IEEE
+ * doesn't specify match those used by the Arm architecture.
+ */
+ set_float_2nan_prop_rule(float_2nan_prop_s_ab, &qsf);
+ set_float_3nan_prop_rule(float_3nan_prop_s_cab, &qsf);
+ set_float_default_nan_pattern(0b01000000, &qsf);
+ set_float_infzeronan_rule(float_infzeronan_dnan_if_qnan, &qsf);
+
genCases_setLevel(test_level);
verCases_maxErrorCount = n_max_errors;
diff --git a/tests/fp/meson.build b/tests/fp/meson.build
index 114b4b4..9059a24 100644
--- a/tests/fp/meson.build
+++ b/tests/fp/meson.build
@@ -7,6 +7,16 @@ if host_os == 'windows'
subdir_done()
endif
+# By default tests run with the usual 30s timeout; particularly
+# slow tests can have that overridden here. The keys here are
+# the testnames without their fp-test- prefix.
+slow_fp_tests = {
+ 'rem': 60,
+ 'div': 60,
+ 'mul': 60,
+ 'mulAdd': 180,
+}
+
sfcflags = [
# softfloat defines
'-DSOFTFLOAT_ROUND_ODD',
@@ -109,6 +119,7 @@ fptest_rounding_args = ['-r', 'all']
foreach k, v : softfloat_conv_tests
test('fp-test-' + k, fptest,
args: fptest_args + fptest_rounding_args + v.split(),
+ timeout: slow_fp_tests.get(k, 30),
suite: ['softfloat', 'softfloat-conv'])
endforeach
@@ -116,6 +127,7 @@ foreach k, v : softfloat_tests
test('fp-test-' + k, fptest,
args: fptest_args + fptest_rounding_args +
['f16_' + k, 'f32_' + k, 'f64_' + k, 'f128_' + k, 'extF80_' + k],
+ timeout: slow_fp_tests.get(k, 30),
suite: ['softfloat', 'softfloat-' + v])
endforeach
@@ -124,7 +136,8 @@ test('fp-test-mulAdd', fptest,
# no fptest_rounding_args
args: fptest_args +
['f16_mulAdd', 'f32_mulAdd', 'f64_mulAdd', 'f128_mulAdd'],
- suite: ['softfloat-slow', 'softfloat-ops-slow', 'slow'], timeout: 180)
+ timeout: slow_fp_tests.get('mulAdd', 30),
+ suite: ['softfloat-slow', 'softfloat-ops-slow', 'slow'])
executable(
'fp-bench',
@@ -140,4 +153,5 @@ fptestlog2 = executable(
c_args: fpcflags,
)
test('fp-test-log2', fptestlog2,
+ timeout: slow_fp_tests.get('log2', 30),
suite: ['softfloat', 'softfloat-ops'])