bug#69770: [PATCH] build: strengthen 16 bit float support checks

2024-03-15 Thread Pádraig Brady
On 15/03/2024 05:21, Paul Eggert wrote: On 2024-03-14 06:03, Pádraig Brady wrote: How about leaving it AC_COMPILE_IFELSE, but ensuring that -O1 or better is used when the compiler supports -O1? That way we don't have to worry about running the program, because (with the "volatile") clang will

bug#69770: [PATCH] build: strengthen 16 bit float support checks

2024-03-14 Thread Paul Eggert
On 2024-03-14 06:03, Pádraig Brady wrote: How about leaving it AC_COMPILE_IFELSE, but ensuring that -O1 or better is used when the compiler supports -O1? That way we don't have to worry about running the program, because (with the "volatile") clang will error out. Alternatively perhaps

bug#69770: [PATCH] build: strengthen 16 bit float support checks

2024-03-14 Thread Collin Funk
On 3/14/24 7:48 AM, Pádraig Brady wrote: > For completeness I should add that the above check can be > overridden if cross-compiling or whatever like: > > ./configure utils_cv_ieee_16_bit_supported=yes > utils_cv_brain_16_bit_supported=yes Ah, thanks. I wasn't aware of this. > Interesting. >

bug#69770: [PATCH] build: strengthen 16 bit float support checks

2024-03-14 Thread Pádraig Brady
On 14/03/2024 13:35, Collin Funk wrote: On 3/14/24 6:03 AM, Pádraig Brady wrote: It would disable this feature for cross-compilation yes, but this isn't the first instance of AC_RUN_IFELSE we use. For completeness I should add that the above check can be overridden if cross-compiling or

bug#69770: [PATCH] build: strengthen 16 bit float support checks

2024-03-14 Thread Collin Funk
On 3/14/24 6:03 AM, Pádraig Brady wrote: > It would disable this feature for cross-compilation yes, > but this isn't the first instance of AC_RUN_IFELSE we use. Sorry if this is not the proper place to ask, but would it be possible to make Autoconf use an emulator when cross-compiling? This issue

bug#69770: [PATCH] build: strengthen 16 bit float support checks

2024-03-14 Thread Pádraig Brady
On 14/03/2024 05:59, Paul Eggert wrote: On 2024-03-12 19:24, Grisha Levit wrote: - AC_COMPILE_IFELSE( + AC_RUN_IFELSE( This sort of change would break cross-compilation, no? It would disable this feature for cross-compilation yes, but this isn't the first instance of AC_RUN_IFELSE we use.

bug#69770: [PATCH] build: strengthen 16 bit float support checks

2024-03-14 Thread Paul Eggert
On 2024-03-12 19:24, Grisha Levit wrote: - AC_COMPILE_IFELSE( + AC_RUN_IFELSE( This sort of change would break cross-compilation, no? How about leaving it AC_COMPILE_IFELSE, but ensuring that -O1 or better is used when the compiler supports -O1? That way we don't have to worry about running

bug#69770: [PATCH] build: strengthen 16 bit float support checks

2024-03-13 Thread Pádraig Brady
On 13/03/2024 02:24, Grisha Levit wrote: Recent clang provides __bf16 on aarch64 but it is broken. If built with -O0, the conversion is wrong: $ printf '\x3F\x80' | od --end=big -An -tfB | tr -d ' ' 1.875 If built with -O1 or higher, compilation fails: fatal error: error in

bug#69770: [PATCH] build: strengthen 16 bit float support checks

2024-03-12 Thread Grisha Levit
Recent clang provides __bf16 on aarch64 but it is broken. If built with -O0, the conversion is wrong: $ printf '\x3F\x80' | od --end=big -An -tfB | tr -d ' ' 1.875 If built with -O1 or higher, compilation fails: fatal error: error in backend: Cannot select: 0xb47a58d29780: f32