[PATCH 29/59] x86: math: Avoid the use of __libgcc_cmp_return__ for __gcc_CMPtype

H.J. Lu hjl.tools@gmail.com
Fri Oct 17 22:41:00 GMT 2025


On Sat, Oct 18, 2025 at 3:44 AM Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
>
> clang does not support '__attribute__ ((mode (__libgcc_cmp_return__)))',
> so use a more close related type instead fo the default 'int'.

Can you add a configure test for __attribute__ ((mode (__libgcc_cmp_return__)))
instead?

> ---
>  sysdeps/x86/fpu/sfp-machine.h | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/sysdeps/x86/fpu/sfp-machine.h b/sysdeps/x86/fpu/sfp-machine.h
> index 5892f4f5fe..625dfeaccf 100644
> --- a/sysdeps/x86/fpu/sfp-machine.h
> +++ b/sysdeps/x86/fpu/sfp-machine.h
> @@ -1,9 +1,17 @@
>  /* Configure soft-fp for building sqrtf128.  Based on sfp-machine.h in
>     libgcc, with soft-float and other irrelevant parts removed.  */
>
> +#if !defined(__clang__) && defined(__GNUC__)
>  /* The type of the result of a floating point comparison.  This must
>     match `__libgcc_cmp_return__' in GCC for the target.  */
> -typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__)));
> +typedef int __gcc_CMPtype_GCC __attribute__ ((mode (__libgcc_cmp_return__)));
> +#else
> +# if defined __x86_64__ && defined __ILP32__
> +typedef long long int __gcc_CMPtype;
> +#else
> +typedef long int __gcc_CMPtype;
> +# endif
> +#endif
>  #define CMPtype __gcc_CMPtype
>
>  #ifdef __x86_64__
> --
> 2.43.0
>


-- 
H.J.


More information about the Libc-alpha mailing list