summaryrefslogtreecommitdiff
path: root/project/config
diff options
context:
space:
mode:
Diffstat (limited to 'project/config')
-rw-r--r--project/config/cfgdefs.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh
index c04c86d..fc13f41 100644
--- a/project/config/cfgdefs.sh
+++ b/project/config/cfgdefs.sh
@@ -239,6 +239,11 @@ cfgdefs_perform_common_tests()
cfgtest_newline
cfgtest_comment 'toolchain'
+ # math configuration
+ cfghost_x87_asm=
+ cfghost_x64_asm=
+ cfghost_aarch64_types=
+
# x87
mb_code_snippet=''
mb_code_snippet="$mb_code_snippet "'void fn(void)'
@@ -247,6 +252,7 @@ cfgdefs_perform_common_tests()
if cfgtest_code_snippet_asm "$mb_code_snippet"; then
cfgtest_cflags_append '-DHAVE_GCC_ASM_FOR_X87'
+ cfghost_x87_asm='yes'
fi
# x64
@@ -256,6 +262,30 @@ cfgdefs_perform_common_tests()
if cfgtest_code_snippet_asm "$mb_code_snippet"; then
cfgtest_cflags_append '-DHAVE_GCC_ASM_FOR_X64'
+ cfghost_x64_asm='yes'
+ fi
+
+ # aarch64
+ mb_code_snippet='__uint128_t aarch64_dummy = 0;'
+
+ if cfgtest_code_snippet_asm "$mb_code_snippet"; then
+ cfgtest_cflags_append '-DHAVE_GCC_UINT128_T'
+ cfghost_aarch64_types='yes'
+ fi
+
+ # math configuration selection
+ if [ $cfghost_aarch64_types = 'yes' ]; then
+ cfgtest_cflags_append '-DCONFIG_64'
+ cfgtest_cflags_append '-DANSI'
+ cfgtest_cflags_append '-DHAVE_UINT128_T'
+
+ elif [ $cfghost_x64_asm = 'yes' ]; then
+ cfgtest_cflags_append '-DCONFIG_64'
+ cfgtest_cflags_append '-DASM'
+
+ elif [ $cfghost_x87_asm = 'yes' ]; then
+ cfgtest_cflags_append '-DCONFIG_32'
+ cfgtest_cflags_append '-DANSI'
fi
# IEEE 754: little endian / big endian