qemu
220 строк · 6.6 Кб
1project('berkeley-testfloat-3', 'c',
2default_options: ['warning_level=1', 'c_std=gnu99'])
3
4fpcflags = get_option('defines')
5
6platform_data = configuration_data()
7platform_data.set('INLINE', 'static inline')
8platform_data.set('LITTLEENDIAN', host_machine.endian() == 'little')
9configure_file(output: 'platform.h', configuration: platform_data)
10
11tfdir = 'source'
12tfinc = include_directories('.', tfdir)
13
14add_project_arguments(
15[
16'-Wno-implicit-fallthrough',
17'-Wno-strict-prototypes',
18'-Wno-unknown-pragmas',
19'-Wno-uninitialized',
20'-Wno-missing-prototypes',
21'-Wno-return-type',
22'-Wno-unused-function',
23'-Wno-missing-format-attribute',
24'-Wno-error',
25] + meson.get_compiler('c').get_supported_arguments('-Wno-ignored-pragmas'),
26native: false, language: 'c')
27
28tfgencases = [
29tfdir / 'genCases_ui32.c',
30tfdir / 'genCases_ui64.c',
31tfdir / 'genCases_i32.c',
32tfdir / 'genCases_i64.c',
33tfdir / 'genCases_f16.c',
34tfdir / 'genCases_f32.c',
35tfdir / 'genCases_f64.c',
36tfdir / 'genCases_extF80.c',
37tfdir / 'genCases_f128.c',
38]
39
40tfwritecase = [
41tfdir / 'writeCase_a_ui32.c',
42tfdir / 'writeCase_a_ui64.c',
43tfdir / 'writeCase_a_f16.c',
44tfdir / 'writeCase_ab_f16.c',
45tfdir / 'writeCase_abc_f16.c',
46tfdir / 'writeCase_a_f32.c',
47tfdir / 'writeCase_ab_f32.c',
48tfdir / 'writeCase_abc_f32.c',
49tfdir / 'writeCase_a_f64.c',
50tfdir / 'writeCase_ab_f64.c',
51tfdir / 'writeCase_abc_f64.c',
52tfdir / 'writeCase_a_extF80M.c',
53tfdir / 'writeCase_ab_extF80M.c',
54tfdir / 'writeCase_a_f128M.c',
55tfdir / 'writeCase_ab_f128M.c',
56tfdir / 'writeCase_abc_f128M.c',
57tfdir / 'writeCase_z_bool.c',
58tfdir / 'writeCase_z_ui32.c',
59tfdir / 'writeCase_z_ui64.c',
60tfdir / 'writeCase_z_f16.c',
61tfdir / 'writeCase_z_f32.c',
62tfdir / 'writeCase_z_f64.c',
63tfdir / 'writeCase_z_extF80M.c',
64tfdir / 'writeCase_z_f128M.c',
65]
66
67tftest = [
68tfdir / 'test_a_ui32_z_f16.c',
69tfdir / 'test_a_ui32_z_f32.c',
70tfdir / 'test_a_ui32_z_f64.c',
71tfdir / 'test_a_ui32_z_extF80.c',
72tfdir / 'test_a_ui32_z_f128.c',
73tfdir / 'test_a_ui64_z_f16.c',
74tfdir / 'test_a_ui64_z_f32.c',
75tfdir / 'test_a_ui64_z_f64.c',
76tfdir / 'test_a_ui64_z_extF80.c',
77tfdir / 'test_a_ui64_z_f128.c',
78tfdir / 'test_a_i32_z_f16.c',
79tfdir / 'test_a_i32_z_f32.c',
80tfdir / 'test_a_i32_z_f64.c',
81tfdir / 'test_a_i32_z_extF80.c',
82tfdir / 'test_a_i32_z_f128.c',
83tfdir / 'test_a_i64_z_f16.c',
84tfdir / 'test_a_i64_z_f32.c',
85tfdir / 'test_a_i64_z_f64.c',
86tfdir / 'test_a_i64_z_extF80.c',
87tfdir / 'test_a_i64_z_f128.c',
88tfdir / 'test_a_f16_z_ui32_rx.c',
89tfdir / 'test_a_f16_z_ui64_rx.c',
90tfdir / 'test_a_f16_z_i32_rx.c',
91tfdir / 'test_a_f16_z_i64_rx.c',
92tfdir / 'test_a_f16_z_ui32_x.c',
93tfdir / 'test_a_f16_z_ui64_x.c',
94tfdir / 'test_a_f16_z_i32_x.c',
95tfdir / 'test_a_f16_z_i64_x.c',
96tfdir / 'test_a_f16_z_f32.c',
97tfdir / 'test_a_f16_z_f64.c',
98tfdir / 'test_a_f16_z_extF80.c',
99tfdir / 'test_a_f16_z_f128.c',
100tfdir / 'test_az_f16.c',
101tfdir / 'test_az_f16_rx.c',
102tfdir / 'test_abz_f16.c',
103tfdir / 'test_abcz_f16.c',
104tfdir / 'test_ab_f16_z_bool.c',
105tfdir / 'test_a_f32_z_ui32_rx.c',
106tfdir / 'test_a_f32_z_ui64_rx.c',
107tfdir / 'test_a_f32_z_i32_rx.c',
108tfdir / 'test_a_f32_z_i64_rx.c',
109tfdir / 'test_a_f32_z_ui32_x.c',
110tfdir / 'test_a_f32_z_ui64_x.c',
111tfdir / 'test_a_f32_z_i32_x.c',
112tfdir / 'test_a_f32_z_i64_x.c',
113tfdir / 'test_a_f32_z_f16.c',
114tfdir / 'test_a_f32_z_f64.c',
115tfdir / 'test_a_f32_z_extF80.c',
116tfdir / 'test_a_f32_z_f128.c',
117tfdir / 'test_az_f32.c',
118tfdir / 'test_az_f32_rx.c',
119tfdir / 'test_abz_f32.c',
120tfdir / 'test_abcz_f32.c',
121tfdir / 'test_ab_f32_z_bool.c',
122tfdir / 'test_a_f64_z_ui32_rx.c',
123tfdir / 'test_a_f64_z_ui64_rx.c',
124tfdir / 'test_a_f64_z_i32_rx.c',
125tfdir / 'test_a_f64_z_i64_rx.c',
126tfdir / 'test_a_f64_z_ui32_x.c',
127tfdir / 'test_a_f64_z_ui64_x.c',
128tfdir / 'test_a_f64_z_i32_x.c',
129tfdir / 'test_a_f64_z_i64_x.c',
130tfdir / 'test_a_f64_z_f16.c',
131tfdir / 'test_a_f64_z_f32.c',
132tfdir / 'test_a_f64_z_extF80.c',
133tfdir / 'test_a_f64_z_f128.c',
134tfdir / 'test_az_f64.c',
135tfdir / 'test_az_f64_rx.c',
136tfdir / 'test_abz_f64.c',
137tfdir / 'test_abcz_f64.c',
138tfdir / 'test_ab_f64_z_bool.c',
139tfdir / 'test_a_extF80_z_ui32_rx.c',
140tfdir / 'test_a_extF80_z_ui64_rx.c',
141tfdir / 'test_a_extF80_z_i32_rx.c',
142tfdir / 'test_a_extF80_z_i64_rx.c',
143tfdir / 'test_a_extF80_z_ui32_x.c',
144tfdir / 'test_a_extF80_z_ui64_x.c',
145tfdir / 'test_a_extF80_z_i32_x.c',
146tfdir / 'test_a_extF80_z_i64_x.c',
147tfdir / 'test_a_extF80_z_f16.c',
148tfdir / 'test_a_extF80_z_f32.c',
149tfdir / 'test_a_extF80_z_f64.c',
150tfdir / 'test_a_extF80_z_f128.c',
151tfdir / 'test_az_extF80.c',
152tfdir / 'test_az_extF80_rx.c',
153tfdir / 'test_abz_extF80.c',
154tfdir / 'test_ab_extF80_z_bool.c',
155tfdir / 'test_a_f128_z_ui32_rx.c',
156tfdir / 'test_a_f128_z_ui64_rx.c',
157tfdir / 'test_a_f128_z_i32_rx.c',
158tfdir / 'test_a_f128_z_i64_rx.c',
159tfdir / 'test_a_f128_z_ui32_x.c',
160tfdir / 'test_a_f128_z_ui64_x.c',
161tfdir / 'test_a_f128_z_i32_x.c',
162tfdir / 'test_a_f128_z_i64_x.c',
163tfdir / 'test_a_f128_z_f16.c',
164tfdir / 'test_a_f128_z_f32.c',
165tfdir / 'test_a_f128_z_f64.c',
166tfdir / 'test_a_f128_z_extF80.c',
167tfdir / 'test_az_f128.c',
168tfdir / 'test_az_f128_rx.c',
169tfdir / 'test_abz_f128.c',
170tfdir / 'test_abcz_f128.c',
171tfdir / 'test_ab_f128_z_bool.c',
172]
173
174libsoftfloat_proj = subproject('berkeley-softfloat-3', required: true)
175libsoftfloat = libsoftfloat_proj.get_variable('libsoftfloat_dep')
176
177libtestfloat = static_library(
178'testfloat',
179files(
180tfdir / 'uint128_inline.c',
181tfdir / 'uint128.c',
182tfdir / 'fail.c',
183tfdir / 'functions_common.c',
184tfdir / 'functionInfos.c',
185tfdir / 'standardFunctionInfos.c',
186tfdir / 'random.c',
187tfdir / 'genCases_common.c',
188tfgencases,
189tfdir / 'genCases_writeTestsTotal.c',
190tfdir / 'verCases_inline.c',
191tfdir / 'verCases_common.c',
192tfdir / 'verCases_writeFunctionName.c',
193tfdir / 'readHex.c',
194tfdir / 'writeHex.c',
195tfwritecase,
196tfdir / 'testLoops_common.c',
197tftest,
198),
199dependencies: libsoftfloat.partial_dependency(includes: true, compile_args: true),
200c_args: fpcflags,
201)
202
203libtestfloat_dep = declare_dependency(
204link_with: libtestfloat,
205dependencies: libsoftfloat,
206include_directories: tfinc,
207compile_args: fpcflags)
208
209libslowfloat = static_library(
210'slowfloat',
211tfdir / 'slowfloat.c',
212dependencies: libsoftfloat.partial_dependency(includes: true, compile_args: true),
213c_args: fpcflags,
214)
215
216libslowfloat_dep = declare_dependency(
217link_with: libslowfloat,
218dependencies: libsoftfloat,
219include_directories: tfinc,
220compile_args: fpcflags)
221