summaryrefslogtreecommitdiff
path: root/libc/sysdeps/x86_64
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2009-09-03 14:33:58 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2009-09-03 14:33:58 +0000
commitee5040cd9d4d799667f7f1e1a1203df5b58e4e6c (patch)
tree6b14e79ee0910febe6fedb0090ae974cc033d586 /libc/sysdeps/x86_64
parent5ae64e3ae4a65a25176fe6b5d34946f49fd9d910 (diff)
downloadeglibc2-ee5040cd9d4d799667f7f1e1a1203df5b58e4e6c.tar.gz
Merge changes between r8878 and r8915 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@8916 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/sysdeps/x86_64')
-rw-r--r--libc/sysdeps/x86_64/fpu/bits/mathinline.h16
-rw-r--r--libc/sysdeps/x86_64/multiarch/init-arch.c10
-rw-r--r--libc/sysdeps/x86_64/multiarch/s_fma.c4
-rw-r--r--libc/sysdeps/x86_64/multiarch/s_fmaf.c4
-rw-r--r--libc/sysdeps/x86_64/multiarch/strcasestr-c.c3
-rw-r--r--libc/sysdeps/x86_64/multiarch/strstr-c.c3
6 files changed, 23 insertions, 17 deletions
diff --git a/libc/sysdeps/x86_64/fpu/bits/mathinline.h b/libc/sysdeps/x86_64/fpu/bits/mathinline.h
index 8d4850dfc..dc58f67d6 100644
--- a/libc/sysdeps/x86_64/fpu/bits/mathinline.h
+++ b/libc/sysdeps/x86_64/fpu/bits/mathinline.h
@@ -22,6 +22,8 @@
# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
#endif
+#include <bits/wordsize.h>
+
#ifndef __extern_inline
# define __MATH_INLINE __inline
#else
@@ -35,16 +37,26 @@
__MATH_INLINE int
__NTH (__signbitf (float __x))
{
+#if __WORDSIZE == 32
+ __extension__ union { float __f; int __i; } __u = { __f: __x };
+ return __u.__i < 0;
+#else
int __m;
- asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
+ __asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
return __m & 0x8;
+#endif
}
__MATH_INLINE int
__NTH (__signbit (double __x))
{
+#if __WORDSIZE == 32
+ __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
+ return __u.__i[1] < 0;
+#else
int __m;
- asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
+ __asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
return __m & 0x80;
+#endif
}
__MATH_INLINE int
__NTH (__signbitl (long double __x))
diff --git a/libc/sysdeps/x86_64/multiarch/init-arch.c b/libc/sysdeps/x86_64/multiarch/init-arch.c
index c152ab29e..9a1e776c9 100644
--- a/libc/sysdeps/x86_64/multiarch/init-arch.c
+++ b/libc/sysdeps/x86_64/multiarch/init-arch.c
@@ -64,15 +64,7 @@ __init_cpu_features (void)
__cpu_features.model += extended_model;
}
else if (__cpu_features.family == 0x06)
- {
- __cpu_features.model += extended_model;
-
-#ifndef ENABLE_SSSE3_ON_ATOM
- if (__cpu_features.model == 0x1c)
- /* Avoid SSSE3 on Atom since it is slow. */
- __cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx &= ~(1 << 9);
-#endif
- }
+ __cpu_features.model += extended_model;
}
/* This spells out "AuthenticAMD". */
else if (ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65)
diff --git a/libc/sysdeps/x86_64/multiarch/s_fma.c b/libc/sysdeps/x86_64/multiarch/s_fma.c
index 40601e9a6..cfecf9b41 100644
--- a/libc/sysdeps/x86_64/multiarch/s_fma.c
+++ b/libc/sysdeps/x86_64/multiarch/s_fma.c
@@ -24,10 +24,10 @@
#ifdef HAVE_AVX_SUPPORT
-extern double __fma_sse2 (double x, double y, double z);
+extern double __fma_sse2 (double x, double y, double z) attribute_hidden;
-double
+static double
__fma_fma (double x, double y, double z)
{
asm ("vfmadd213sd %3, %2, %0" : "=x" (x) : "0" (x), "x" (y), "xm" (z));
diff --git a/libc/sysdeps/x86_64/multiarch/s_fmaf.c b/libc/sysdeps/x86_64/multiarch/s_fmaf.c
index f3d37f8f4..de1c4b6f4 100644
--- a/libc/sysdeps/x86_64/multiarch/s_fmaf.c
+++ b/libc/sysdeps/x86_64/multiarch/s_fmaf.c
@@ -23,10 +23,10 @@
#ifdef HAVE_AVX_SUPPORT
-extern float __fmaf_sse2 (float x, float y, float z);
+extern float __fmaf_sse2 (float x, float y, float z) attribute_hidden;
-float
+static float
__fmaf_fma (float x, float y, float z)
{
asm ("vfmadd213ss %3, %2, %0" : "=x" (x) : "0" (x), "x" (y), "xm" (z));
diff --git a/libc/sysdeps/x86_64/multiarch/strcasestr-c.c b/libc/sysdeps/x86_64/multiarch/strcasestr-c.c
index e6879531b..3cb5557b6 100644
--- a/libc/sysdeps/x86_64/multiarch/strcasestr-c.c
+++ b/libc/sysdeps/x86_64/multiarch/strcasestr-c.c
@@ -7,7 +7,8 @@
#include "string/strcasestr.c"
-extern char *__strcasestr_sse42 (const char *, const char *);
+extern char *__strcasestr_sse42 (const char *, const char *) attribute_hidden;
+extern __typeof (__strcasestr_sse2) __strcasestr_sse2 attribute_hidden;
#if 1
libc_ifunc (__strcasestr,
diff --git a/libc/sysdeps/x86_64/multiarch/strstr-c.c b/libc/sysdeps/x86_64/multiarch/strstr-c.c
index cff99b71e..d593089a8 100644
--- a/libc/sysdeps/x86_64/multiarch/strstr-c.c
+++ b/libc/sysdeps/x86_64/multiarch/strstr-c.c
@@ -7,6 +7,7 @@
#include "string/strstr.c"
-extern char *__strstr_sse42 (const char *, const char *);
+extern char *__strstr_sse42 (const char *, const char *) attribute_hidden;
+extern __typeof (__strstr_sse2) __strstr_sse2 attribute_hidden;
libc_ifunc (strstr, HAS_SSE4_2 ? __strstr_sse42 : __strstr_sse2);