From 0567678636c46265af80b3e5be463539dd84b893 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Wed, 2 Sep 2026 13:06:42 +0300 Subject: [PATCH 1/2] gh-153740: refine test for _Float16 (check support from libm) --- configure | 4 +++- configure.ac | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/configure b/configure index e0ad04b036aeb13..dbc71e5b27d64f6 100755 --- a/configure +++ b/configure @@ -16745,12 +16745,14 @@ else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include int main(void) { _Float16 val = 1.0f16; + int test = !isfinite(val) || isinf(val) || isnan(val); double d = 3.14; val = d; - return 0; + return test; } _ACEOF diff --git a/configure.ac b/configure.ac index 2b8a5b052878c91..e367d2dd71682a6 100644 --- a/configure.ac +++ b/configure.ac @@ -4474,12 +4474,14 @@ AC_CACHE_CHECK([for _Float16 support], [ac_cv_float16_supported], WITH_SAVE_ENV([ CFLAGS="$CFLAGS -O0" AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include int main(void) { _Float16 val = 1.0f16; + int test = !isfinite(val) || isinf(val) || isnan(val); double d = 3.14; val = d; - return 0; + return test; } ]])], [ac_cv_float16_supported=yes], [ac_cv_float16_supported=no], From 8daf2de17e5d8b27422326049459ba95fe7117e2 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Wed, 2 Sep 2026 15:58:26 +0300 Subject: [PATCH 2/2] + comment on test --- configure | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index dbc71e5b27d64f6..a2ca40de07d54ec 100755 --- a/configure +++ b/configure @@ -16749,7 +16749,7 @@ else case e in #( int main(void) { _Float16 val = 1.0f16; - int test = !isfinite(val) || isinf(val) || isnan(val); + int test = isinf(val) || isnan(val); /* basic support from libm */ double d = 3.14; val = d; return test; diff --git a/configure.ac b/configure.ac index e367d2dd71682a6..e1333230fefa688 100644 --- a/configure.ac +++ b/configure.ac @@ -4478,7 +4478,7 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[ int main(void) { _Float16 val = 1.0f16; - int test = !isfinite(val) || isinf(val) || isnan(val); + int test = isinf(val) || isnan(val); /* basic support from libm */ double d = 3.14; val = d; return test;