meson.build 6.6 KB

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