This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Disable x87 inline functions when SSE math is enabled


On Thu, Jun 14, 2012 at 11:19 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Jun 14, 2012 at 11:01 AM, Roland McGrath <roland@hack.frob.com> wrote:
>> I think this is probably OK, but I just don't know that much about the area.
>> Does this leave any function that previously had an inline and now has none?
>>
>> The GCC manual seems to indicate that -mfpath=sse -msse (without -msse2)
>> will use x87 code for double-precision operations. ?So it seems appropriate
>> that this mode have x87 inlines for double libm calls too.
>
> It makes no difference for x86-64 since SSE2 is available.
> But it will change ia32. I think it is too late for 2.16.
>
> Here is the updated patch to only disable x87 inline functions for x86-64.
> It makes -m32 and -m64 behave the same as before. ?OK to install?
>
> Thanks.

Most of changes are just re-indenting. "git diff -w" output is

diff --git a/sysdeps/i386/fpu/bits/mathinline.h
b/sysdeps/i386/fpu/bits/mathinline.h
index 5ee40a3..f9507cd 100644
--- a/sysdeps/i386/fpu/bits/mathinline.h
+++ b/sysdeps/i386/fpu/bits/mathinline.h
@@ -382,7 +382,8 @@ __END_NAMESPACE_C99
 # endif

 #if ((!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
-     && defined __OPTIMIZE__)
+     && !defined __x86_64__ && defined __OPTIMIZE__)
+/* Not used by x86-64.  */

 /* The inline functions do not set errno or raise necessarily the
    correct exceptions.  */
@@ -520,8 +521,8 @@ __END_NAMESPACE_C99
 #endif


-#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
-/* Miscellaneous functions */
+# if !defined __x86_64__ && !defined __NO_MATH_INLINES && defined __OPTIMIZE__
+/* Miscellaneous functions.  Not used by x86-64.   */

 /* __FAST_MATH__ is defined by gcc -ffast-math.  */
 #ifdef __FAST_MATH__
@@ -952,8 +953,8 @@ __NTH (__finite (double __x))
 #endif /* __NO_MATH_INLINES  */


-/* This code is used internally in the GNU libc.  */
-#ifdef __LIBC_INTERNAL_MATH_INLINES
+/* This code is used internally in the GNU libc.  Not used by x86-64.  */
+# if !defined __x86_64__ && defined __LIBC_INTERNAL_MATH_INLINES
 __inline_mathop (__ieee754_sqrt, "fsqrt")
 __inline_mathcode2 (__ieee754_atan2, __y, __x,
 		    register long double __value;


-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]