This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Disable x87 inline functions for SSE2 math
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 30 Jan 2014 00:46:55 +0530
- Subject: Re: [PATCH] Disable x87 inline functions for SSE2 math
- Authentication-results: sourceware.org; auth=none
- References: <20140129160258 dot GA10988 at intel dot com>
On Wed, Jan 29, 2014 at 08:02:58AM -0800, H.J. Lu wrote:
> * Slovenian translations for glibc messages have been contributed by the
> Translation Project's Slovenian team of translators.
> diff --git a/sysdeps/x86/fpu/bits/mathinline.h b/sysdeps/x86/fpu/bits/mathinline.h
> index acc82ca..b4b28f3 100644
> --- a/sysdeps/x86/fpu/bits/mathinline.h
> +++ b/sysdeps/x86/fpu/bits/mathinline.h
> @@ -384,7 +384,7 @@ __END_NAMESPACE_C99
> # endif
> #endif
>
> -#ifndef __x86_64__
> +#ifndef __SSE2_MATH__
> # if ((!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
> && defined __OPTIMIZE__)
>
> @@ -970,4 +970,4 @@ __inline_mathcode2 (__ieee754_atan2, __y, __x,
> return __value;)
> # endif
>
> -#endif /* !__x86_64__ */
> +#endif /* !__SSE2_MATH__ */
This looks OK to me.
llrint* still spews out only x87 code (looks like the compiler does
this, since we don't have anything useful for llrint for SSE in
glibc), which seems obvious since we can't get a 64-bit value from
cvt*2si directly in 32-bit mode. Maybe some hack is necessary here
since in case of an inexact conversion, the rounding will not be
according to the set rounding mode since we don't maintain x87 FP
state when SSE is available.
Siddhesh