meson: rename config_all
[qemu/ar7.git] / tests / fp / meson.build
blob9ef322afc426d44cc8f2d336bf959d545c060aac
1 if 'CONFIG_TCG' not in config_all_accel
2   subdir_done()
3 endif
4 # There are namespace pollution issues on Windows, due to osdep.h
5 # bringing in Windows headers that define a FLOAT128 type.
6 if targetos == 'windows'
7   subdir_done()
8 endif
10 sfcflags = [
11   # softfloat defines
12   '-DSOFTFLOAT_ROUND_ODD',
13   '-DINLINE_LEVEL=5',
14   '-DSOFTFLOAT_FAST_DIV32TO16',
15   '-DSOFTFLOAT_FAST_DIV64TO32',
16   '-DSOFTFLOAT_FAST_INT64',
18 tfcflags = [
19   # testfloat defines
20   '-DFLOAT16',
21   '-DFLOAT64',
22   '-DEXTFLOAT80',
23   '-DFLOAT128',
24   '-DFLOAT_ROUND_ODD',
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')
37 fpcflags = [
38   # work around TARGET_* poisoning
39   '-DHW_POISON_H',
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.
42   '-DTARGET_ARM',
43   # FIXME: uiZ may be used uninitialized in this function
44   '-Wno-uninitialized',
47 fptest = executable(
48   'fp-test',
49   ['fp-test.c', '../../fpu/softfloat.c'],
50   dependencies: [qemuutil, libsoftfloat, libtestfloat, libslowfloat],
51   c_args: fpcflags,
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 ' +
59                       'f128_to_f16',
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'
90 softfloat_tests = {
91     'eq_signaling' : 'compare',
92     'le' : 'compare',
93     'le_quiet' : 'compare',
94     'lt_quiet' : 'compare',
95     'add': 'ops',
96     'sub': 'ops',
97     'mul': 'ops',
98     'div': 'ops',
99     'rem': 'ops',
100     'sqrt': 'ops'
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
104 # run manually
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'])
113 endforeach
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])
120 endforeach
122 # FIXME: extF80_{mulAdd} (missing)
123 test('fp-test-mulAdd', fptest,
124      # no fptest_rounding_args
125      args: fptest_args +
126            ['f16_mulAdd', 'f32_mulAdd', 'f64_mulAdd', 'f128_mulAdd'],
127      suite: ['softfloat-slow', 'softfloat-ops-slow', 'slow'], timeout: 90)
129 executable(
130   'fp-bench',
131   ['fp-bench.c', '../../fpu/softfloat.c'],
132   dependencies: [qemuutil, libtestfloat, libsoftfloat],
133   c_args: fpcflags,
136 fptestlog2 = executable(
137   'fp-test-log2',
138   ['fp-test-log2.c', '../../fpu/softfloat.c'],
139   dependencies: [qemuutil, libsoftfloat],
140   c_args: fpcflags,
142 test('fp-test-log2', fptestlog2,
143      suite: ['softfloat', 'softfloat-ops'])