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'
12 '-DSOFTFLOAT_ROUND_ODD',
14 '-DSOFTFLOAT_FAST_DIV32TO16',
15 '-DSOFTFLOAT_FAST_DIV64TO32',
16 '-DSOFTFLOAT_FAST_INT64',
25 '-DLONG_DOUBLE_IS_EXTFLOAT80',
28 libsoftfloat_proj = subproject('berkeley-softfloat-3', required: true,
29 default_options: 'defines=' + ','.join(sfcflags))
30 libsoftfloat = libsoftfloat_proj.get_variable('libsoftfloat_dep')
32 libtestfloat_proj = subproject('berkeley-testfloat-3', required: true,
33 default_options: 'defines=' + ','.join(tfcflags))
34 libtestfloat = libtestfloat_proj.get_variable('libtestfloat_dep')
35 libslowfloat = libtestfloat_proj.get_variable('libslowfloat_dep')
38 # work around TARGET_* poisoning
40 # define a target to match testfloat's implementation-defined choices, such as
41 # whether to raise the invalid flag when dealing with NaNs in muladd.
43 # FIXME: uiZ may be used uninitialized in this function
49 ['fp-test.c', '../../fpu/softfloat.c'],
50 dependencies: [qemuutil, libsoftfloat, libtestfloat, libslowfloat],
53 softfloat_conv_tests = {
54 'float-to-float': 'f16_to_f32 f16_to_f64 f16_to_extF80 f16_to_f128 ' +
55 'f32_to_f16 f32_to_f64 f32_to_extF80 ' +
56 'f64_to_f16 f64_to_f32 ' +
57 'extF80_to_f16 extF80_to_f32 ' +
58 'extF80_to_f64 extF80_to_f128 ' +
60 'int-to-float': 'i32_to_f16 i64_to_f16 i32_to_f32 i64_to_f32 ' +
61 'i32_to_f64 i64_to_f64 ' +
62 'i32_to_extF80 i64_to_extF80 ' +
63 'i32_to_f128 i64_to_f128',
64 'uint-to-float': 'ui32_to_f16 ui64_to_f16 ui32_to_f32 ui64_to_f32 ' +
65 'ui32_to_f64 ui64_to_f64 ui64_to_f128 ' +
66 'ui32_to_extF80 ui64_to_extF80',
67 'float-to-int': 'f16_to_i32 f16_to_i32_r_minMag ' +
68 'f32_to_i32 f32_to_i32_r_minMag ' +
69 'f64_to_i32 f64_to_i32_r_minMag ' +
70 'extF80_to_i32 extF80_to_i32_r_minMag ' +
71 'f128_to_i32 f128_to_i32_r_minMag ' +
72 'f16_to_i64 f16_to_i64_r_minMag ' +
73 'f32_to_i64 f32_to_i64_r_minMag ' +
74 'f64_to_i64 f64_to_i64_r_minMag ' +
75 'extF80_to_i64 extF80_to_i64_r_minMag ' +
76 'f128_to_i64 f128_to_i64_r_minMag',
77 'float-to-uint': 'f16_to_ui32 f16_to_ui32_r_minMag ' +
78 'f32_to_ui32 f32_to_ui32_r_minMag ' +
79 'f64_to_ui32 f64_to_ui32_r_minMag ' +
80 'extF80_to_ui32 extF80_to_ui32_r_minMag ' +
81 'f128_to_ui32 f128_to_ui32_r_minMag ' +
82 'f16_to_ui64 f16_to_ui64_r_minMag ' +
83 'f32_to_ui64 f32_to_ui64_r_minMag ' +
84 'f64_to_ui64 f64_to_ui64_r_minMag ' +
85 'extF80_to_ui64 extF80_to_ui64_r_minMag ' +
86 'f128_to_ui64 f128_to_ui64_r_minMag',
87 'round-to-integer': 'f16_roundToInt f32_roundToInt ' +
88 'f64_roundToInt extF80_roundToInt f128_roundToInt'
91 'eq_signaling' : 'compare',
93 'le_quiet' : 'compare',
94 'lt_quiet' : 'compare',
102 # The full test suite can take a bit of time, default to a quick run
103 # "-l 2 -r all" can take more than a day for some operations and is best
105 fptest_args = ['-q', '-s', '-l', '1']
106 fptest_rounding_args = ['-r', 'all']
108 # Conversion Routines:
109 foreach k, v : softfloat_conv_tests
110 test('fp-test-' + k, fptest,
111 args: fptest_args + fptest_rounding_args + v.split(),
112 suite: ['softfloat', 'softfloat-conv'])
115 foreach k, v : softfloat_tests
116 test('fp-test-' + k, fptest,
117 args: fptest_args + fptest_rounding_args +
118 ['f16_' + k, 'f32_' + k, 'f64_' + k, 'f128_' + k, 'extF80_' + k],
119 suite: ['softfloat', 'softfloat-' + v])
122 # FIXME: extF80_{mulAdd} (missing)
123 test('fp-test-mulAdd', fptest,
124 # no fptest_rounding_args
126 ['f16_mulAdd', 'f32_mulAdd', 'f64_mulAdd', 'f128_mulAdd'],
127 suite: ['softfloat-slow', 'softfloat-ops-slow', 'slow'], timeout: 180)
131 ['fp-bench.c', '../../fpu/softfloat.c'],
132 dependencies: [qemuutil, libtestfloat, libsoftfloat],
136 fptestlog2 = executable(
138 ['fp-test-log2.c', '../../fpu/softfloat.c'],
139 dependencies: [qemuutil, libsoftfloat],
142 test('fp-test-log2', fptestlog2,
143 suite: ['softfloat', 'softfloat-ops'])