1 if 'CONFIG_TCG' not in config_all_accel
4 # There are namespace pollution issues on Windows, due to osdep.h
5 # bringing in Windows headers that define a FLOAT128 type.
6 if host_os == 'windows'
10 # By default tests run with the usual 30s timeout; particularly
11 # slow tests can have that overridden here. The keys here are
12 # the testnames without their fp-test- prefix.
22 '-DSOFTFLOAT_ROUND_ODD',
24 '-DSOFTFLOAT_FAST_DIV32TO16',
25 '-DSOFTFLOAT_FAST_DIV64TO32',
26 '-DSOFTFLOAT_FAST_INT64',
35 '-DLONG_DOUBLE_IS_EXTFLOAT80',
38 libsoftfloat_proj = subproject('berkeley-softfloat-3', required: true,
39 default_options: 'defines=' + ','.join(sfcflags))
40 libsoftfloat = libsoftfloat_proj.get_variable('libsoftfloat_dep')
42 libtestfloat_proj = subproject('berkeley-testfloat-3', required: true,
43 default_options: 'defines=' + ','.join(tfcflags))
44 libtestfloat = libtestfloat_proj.get_variable('libtestfloat_dep')
45 libslowfloat = libtestfloat_proj.get_variable('libslowfloat_dep')
48 # work around TARGET_* poisoning
50 # define a target to match testfloat's implementation-defined choices, such as
51 # whether to raise the invalid flag when dealing with NaNs in muladd.
53 # FIXME: uiZ may be used uninitialized in this function
59 ['fp-test.c', '../../fpu/softfloat.c'],
60 dependencies: [qemuutil, libsoftfloat, libtestfloat, libslowfloat],
63 softfloat_conv_tests = {
64 'float-to-float': 'f16_to_f32 f16_to_f64 f16_to_extF80 f16_to_f128 ' +
65 'f32_to_f16 f32_to_f64 f32_to_extF80 ' +
66 'f64_to_f16 f64_to_f32 ' +
67 'extF80_to_f16 extF80_to_f32 ' +
68 'extF80_to_f64 extF80_to_f128 ' +
70 'int-to-float': 'i32_to_f16 i64_to_f16 i32_to_f32 i64_to_f32 ' +
71 'i32_to_f64 i64_to_f64 ' +
72 'i32_to_extF80 i64_to_extF80 ' +
73 'i32_to_f128 i64_to_f128',
74 'uint-to-float': 'ui32_to_f16 ui64_to_f16 ui32_to_f32 ui64_to_f32 ' +
75 'ui32_to_f64 ui64_to_f64 ui64_to_f128 ' +
76 'ui32_to_extF80 ui64_to_extF80',
77 'float-to-int': 'f16_to_i32 f16_to_i32_r_minMag ' +
78 'f32_to_i32 f32_to_i32_r_minMag ' +
79 'f64_to_i32 f64_to_i32_r_minMag ' +
80 'extF80_to_i32 extF80_to_i32_r_minMag ' +
81 'f128_to_i32 f128_to_i32_r_minMag ' +
82 'f16_to_i64 f16_to_i64_r_minMag ' +
83 'f32_to_i64 f32_to_i64_r_minMag ' +
84 'f64_to_i64 f64_to_i64_r_minMag ' +
85 'extF80_to_i64 extF80_to_i64_r_minMag ' +
86 'f128_to_i64 f128_to_i64_r_minMag',
87 'float-to-uint': 'f16_to_ui32 f16_to_ui32_r_minMag ' +
88 'f32_to_ui32 f32_to_ui32_r_minMag ' +
89 'f64_to_ui32 f64_to_ui32_r_minMag ' +
90 'extF80_to_ui32 extF80_to_ui32_r_minMag ' +
91 'f128_to_ui32 f128_to_ui32_r_minMag ' +
92 'f16_to_ui64 f16_to_ui64_r_minMag ' +
93 'f32_to_ui64 f32_to_ui64_r_minMag ' +
94 'f64_to_ui64 f64_to_ui64_r_minMag ' +
95 'extF80_to_ui64 extF80_to_ui64_r_minMag ' +
96 'f128_to_ui64 f128_to_ui64_r_minMag',
97 'round-to-integer': 'f16_roundToInt f32_roundToInt ' +
98 'f64_roundToInt extF80_roundToInt f128_roundToInt'
101 'eq_signaling' : 'compare',
103 'le_quiet' : 'compare',
104 'lt_quiet' : 'compare',
112 # The full test suite can take a bit of time, default to a quick run
113 # "-l 2 -r all" can take more than a day for some operations and is best
115 fptest_args = ['-q', '-s', '-l', '1']
116 fptest_rounding_args = ['-r', 'all']
118 # Conversion Routines:
119 foreach k, v : softfloat_conv_tests
120 test('fp-test-' + k, fptest,
121 args: fptest_args + fptest_rounding_args + v.split(),
122 timeout: slow_fp_tests.get(k, 30),
123 suite: ['softfloat', 'softfloat-conv'])
126 foreach k, v : softfloat_tests
127 test('fp-test-' + k, fptest,
128 args: fptest_args + fptest_rounding_args +
129 ['f16_' + k, 'f32_' + k, 'f64_' + k, 'f128_' + k, 'extF80_' + k],
130 timeout: slow_fp_tests.get(k, 30),
131 suite: ['softfloat', 'softfloat-' + v])
134 # FIXME: extF80_{mulAdd} (missing)
135 test('fp-test-mulAdd', fptest,
136 # no fptest_rounding_args
138 ['f16_mulAdd', 'f32_mulAdd', 'f64_mulAdd', 'f128_mulAdd'],
139 timeout: slow_fp_tests.get('mulAdd', 30),
140 suite: ['softfloat-slow', 'softfloat-ops-slow', 'slow'])
144 ['fp-bench.c', '../../fpu/softfloat.c'],
145 dependencies: [qemuutil, libtestfloat, libsoftfloat],
149 fptestlog2 = executable(
151 ['fp-test-log2.c', '../../fpu/softfloat.c'],
152 dependencies: [qemuutil, libsoftfloat],
155 test('fp-test-log2', fptestlog2,
156 timeout: slow_fp_tests.get('log2', 30),
157 suite: ['softfloat', 'softfloat-ops'])