From 5d8f7ae2d3ea618fe88695572b08a43e8195a920 Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 19 Jun 2021 16:52:38 +0000 Subject: project: pyext: _decimal extension: added refined host configuration. --- project/config/cfgdefs.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'project/config') 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 -- cgit v1.2.3