Skip to content

Commit

Permalink
Try to fix streflop and fail
Browse files Browse the repository at this point in the history
  • Loading branch information
andy5995 committed Feb 8, 2025
1 parent 254da38 commit dbc00f4
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 101 deletions.
5 changes: 5 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ extra_flags = [
'-DUSE_FTGL',
'-DUSE_STREFLOP',
'-DSTREFLOP_SSE',
'-DSTREFLOP_RANDOM_GEN_SIZE=32',
'-DLIBM_COMPILING_FLT32',
'-DN_SPECIALIZED=32',
'-mfpmath=sse',
'-msse'
]

add_project_arguments(cc.get_supported_arguments(extra_flags), language: 'c')
Expand Down
2 changes: 1 addition & 1 deletion source/shared_lib/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,14 @@ lib_megaglest = static_library(
inc_miniupnpc,
],
dependencies: [
dep_streflop,
shared_lib_game_deps,
lua_dep,
dep_sdl,
dep_openal,
dep_feathery_ftp,
dep_miniupnpc,
dep_ftgl,
dep_streflop
]
)

Expand Down
207 changes: 107 additions & 100 deletions source/shared_lib/sources/streflop/meson.build
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
src = [
'SMath.cpp',
'Random.cpp',
'streflopC.cpp',
'SoftFloatWrapper.cpp',
'softfloat/softfloat.cpp',
includes = [
'../../include/streflop',
'../../include/streflop/libm/flt-32',
'../../include/streflop/libm/headers',
]

add_cpp_args = [
'-DSTREFLOP_SSE',
'-fno-strict-aliasing',
'-mieee-fp',
'-mfpmath=sse',
'-msse',
'-msse2',
'-fPIC',
]

#Random_lib = static_library('Random', 'Random.cpp', cpp_args: add_cpp_args, include_directories : includes)

#src = [
# 'SMath.cpp',
# 'streflopC.cpp',
#]

# src_basename = [
# 'e_expf.c',
# 'w_expf.c',
Expand All @@ -15,102 +30,94 @@ src = [
# src += [join_paths('libm/', file)]
# endforeach

# src_basename = [
# 'e_acosf.cpp',
# 'e_acoshf.cpp',
# 'e_asinf.cpp',
# 'e_atan2f.cpp',
# 'e_atanhf.cpp',
# 'e_coshf.cpp',
# 'e_exp2f.cpp',
# 'e_expf.cpp',
# 'e_fmodf.cpp',
# 'e_gammaf_r.cpp',
# 'e_hypotf.cpp',
# 'e_j0f.cpp',
# 'e_j1f.cpp',
# 'e_jnf.cpp',
# 'e_lgammaf_r.cpp',
# 'e_log10f.cpp',
# 'e_log2f.cpp',
# 'e_logf.cpp',
# 'e_powf.cpp',
# 'e_remainderf.cpp',
# 'e_rem_pio2f.cpp',
# 'e_sinhf.cpp',
# 'e_sqrtf.cpp',
# 'k_cosf.cpp',
# 'k_rem_pio2f.cpp',
# 'k_sinf.cpp',
# 'k_tanf.cpp',
# 's_asinhf.cpp',
# 's_atanf.cpp',
# 's_cbrtf.cpp',
# 's_ceilf.cpp',
# 's_copysignf.cpp',
# 's_cosf.cpp',
# 's_erff.cpp',
# 's_expm1f.cpp',
# 's_fabsf.cpp',
# 's_finitef.cpp',
# 's_floorf.cpp',
# 's_fpclassifyf.cpp',
# 's_frexpf.cpp',
# 's_ilogbf.cpp',
# 's_isinff.cpp',
# 's_isnanf.cpp',
# 's_ldexpf.cpp',
# 's_llrintf.cpp',
# 's_llroundf.cpp',
# 's_log1pf.cpp',
# 's_logbf.cpp',
# 's_lrintf.cpp',
# 's_lroundf.cpp',
# 's_modff.cpp',
# 's_nearbyintf.cpp',
# 's_nextafterf.cpp',
# 's_remquof.cpp',
# 's_rintf.cpp',
# 's_roundf.cpp',
# 's_scalblnf.cpp',
# 's_scalbnf.cpp',
# 's_signbitf.cpp',
# 's_sincosf.cpp',
# 's_sinf.cpp',
# 's_tanf.cpp',
# 's_tanhf.cpp',
# 's_truncf.cpp',
# 'w_expf.cpp',
# ]

# foreach file : src_basename
# src += [join_paths('libm/flt-32', file)]
# endforeach

includes = [
'../../include/streflop/libm/flt-32',
# '../../include/streflop/libm/headers',
'../../include/streflop/libm',
'../../include/streflop/softfloat',
'../../include/streflop',
'../../include/platform/common',
# '../../include/streflop/libm_flt32_source',
src_basename = [
'e_acosf.cpp',
'e_acoshf.cpp',
'e_asinf.cpp',
'e_atan2f.cpp',
'e_atanhf.cpp',
'e_coshf.cpp',
'e_exp2f.cpp',
'e_expf.cpp',
'e_fmodf.cpp',
'e_gammaf_r.cpp',
'e_hypotf.cpp',
'e_j0f.cpp',
'e_j1f.cpp',
'e_jnf.cpp',
'e_lgammaf_r.cpp',
'e_log10f.cpp',
'e_log2f.cpp',
'e_logf.cpp',
'e_powf.cpp',
'e_remainderf.cpp',
'e_rem_pio2f.cpp',
'e_sinhf.cpp',
'e_sqrtf.cpp',
'k_cosf.cpp',
'k_rem_pio2f.cpp',
'k_sinf.cpp',
'k_tanf.cpp',
's_asinhf.cpp',
's_atanf.cpp',
's_cbrtf.cpp',
's_ceilf.cpp',
's_copysignf.cpp',
's_cosf.cpp',
's_erff.cpp',
's_expm1f.cpp',
's_fabsf.cpp',
's_finitef.cpp',
's_floorf.cpp',
's_fpclassifyf.cpp',
's_frexpf.cpp',
's_ilogbf.cpp',
's_isinff.cpp',
's_isnanf.cpp',
's_ldexpf.cpp',
's_llrintf.cpp',
's_llroundf.cpp',
's_log1pf.cpp',
's_logbf.cpp',
's_lrintf.cpp',
's_lroundf.cpp',
's_modff.cpp',
's_nearbyintf.cpp',
's_nextafterf.cpp',
's_remquof.cpp',
's_rintf.cpp',
's_roundf.cpp',
's_scalblnf.cpp',
's_scalbnf.cpp',
's_signbitf.cpp',
's_sincosf.cpp',
's_sinf.cpp',
's_tanf.cpp',
's_tanhf.cpp',
's_truncf.cpp',
'w_expf.cpp',
]

add_cpp_args = [
'-DUSE_STREFLOP',
'-DSTREFLOP_SSE',
'-DSTREFLOP_RANDOM_GEN_SIZE=32',
'-DLIBM_COMPILING_FLT32',
'-DN_SPECIALIZED=32',
]
libm32_lib_src = []
foreach file : src_basename
libm32_lib_src += [join_paths('libm/flt-32', file)]
endforeach

libm32_lib = static_library(
'libm32',
libm32_lib_src,
include_directories: includes,
)

lib_streflop = static_library(
'streflop',
src,
cpp_args : add_cpp_args,
include_directories : includes,
# dependencies: [dep_curl, dep_sdl]
)
'streflop',
cpp_args: add_cpp_args,
include_directories: includes,
link_with: [libm32_lib],
# dependencies: [dep_curl, dep_sdl]
)

dep_streflop = declare_dependency(link_with: lib_streflop, include_directories : includes)
dep_streflop = declare_dependency(
link_with: lib_streflop,
include_directories: includes,
)

0 comments on commit dbc00f4

Please sign in to comment.