Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 433884 | Differences between
and this patch

Collapse All | Expand All

(-)file_not_specified_in_diff (-36 / +39 lines)
Line  Link Here
0
--
0
++ sysdeps/x86_64/fpu/multiarch/e_atan2.c
1
-- sysdeps/x86_64/fpu/multiarch/e_atan2.c
Lines 14-20 extern double __ieee754_atan2_fma4 (double, double); Link Here
14
14
15
libm_ifunc (__ieee754_atan2,
15
libm_ifunc (__ieee754_atan2,
16
	    HAS_FMA4 ? __ieee754_atan2_fma4
16
	    HAS_FMA4 ? __ieee754_atan2_fma4
17
	    : (HAS_AVX ? __ieee754_atan2_avx : __ieee754_atan2_sse2));
17
	    : (HAS_YMM_USABLE ? __ieee754_atan2_avx : __ieee754_atan2_sse2));
18
strong_alias (__ieee754_atan2, __atan2_finite)
18
strong_alias (__ieee754_atan2, __atan2_finite)
19
19
20
# define __ieee754_atan2 __ieee754_atan2_sse2
20
# define __ieee754_atan2 __ieee754_atan2_sse2
21
-- sysdeps/x86_64/fpu/multiarch/e_exp.c
21
++ sysdeps/x86_64/fpu/multiarch/e_exp.c
Lines 14-20 extern double __ieee754_exp_fma4 (double); Link Here
14
14
15
libm_ifunc (__ieee754_exp,
15
libm_ifunc (__ieee754_exp,
16
	    HAS_FMA4 ? __ieee754_exp_fma4
16
	    HAS_FMA4 ? __ieee754_exp_fma4
17
	    : (HAS_AVX ? __ieee754_exp_avx : __ieee754_exp_sse2));
17
	    : (HAS_YMM_USABLE ? __ieee754_exp_avx : __ieee754_exp_sse2));
18
strong_alias (__ieee754_exp, __exp_finite)
18
strong_alias (__ieee754_exp, __exp_finite)
19
19
20
# define __ieee754_exp __ieee754_exp_sse2
20
# define __ieee754_exp __ieee754_exp_sse2
21
-- sysdeps/x86_64/fpu/multiarch/e_log.c
21
++ sysdeps/x86_64/fpu/multiarch/e_log.c
Lines 14-20 extern double __ieee754_log_fma4 (double); Link Here
14
14
15
libm_ifunc (__ieee754_log,
15
libm_ifunc (__ieee754_log,
16
	    HAS_FMA4 ? __ieee754_log_fma4
16
	    HAS_FMA4 ? __ieee754_log_fma4
17
	    : (HAS_AVX ? __ieee754_log_avx
17
	    : (HAS_YMM_USABLE ? __ieee754_log_avx
18
	       : __ieee754_log_sse2));
18
	       : __ieee754_log_sse2));
19
strong_alias (__ieee754_log, __log_finite)
19
strong_alias (__ieee754_log, __log_finite)
20
20
21
-- sysdeps/x86_64/fpu/multiarch/s_atan.c
21
++ sysdeps/x86_64/fpu/multiarch/s_atan.c
Lines 12-18 extern double __atan_fma4 (double); Link Here
12
#  define __atan_fma4 ((void *) 0)
12
#  define __atan_fma4 ((void *) 0)
13
# endif
13
# endif
14
14
15
libm_ifunc (atan, HAS_FMA4 ? __atan_fma4 : HAS_AVX ? __atan_avx : __atan_sse2);
15
libm_ifunc (atan, (HAS_FMA4 ? __atan_fma4 :
16
		   HAS_YMM_USABLE ? __atan_avx : __atan_sse2));
16
17
17
# define atan __atan_sse2
18
# define atan __atan_sse2
18
#endif
19
#endif
19
-- sysdeps/x86_64/fpu/multiarch/s_sin.c
20
++ sysdeps/x86_64/fpu/multiarch/s_sin.c
Lines 17-26 extern double __sin_fma4 (double); Link Here
17
#  define __sin_fma4 ((void *) 0)
17
#  define __sin_fma4 ((void *) 0)
18
# endif
18
# endif
19
19
20
libm_ifunc (__cos, HAS_FMA4 ? __cos_fma4 : HAS_AVX ? __cos_avx : __cos_sse2);
20
libm_ifunc (__cos, (HAS_FMA4 ? __cos_fma4 :
21
		    HAS_YMM_USABLE ? __cos_avx : __cos_sse2));
21
weak_alias (__cos, cos)
22
weak_alias (__cos, cos)
22
23
23
libm_ifunc (__sin, HAS_FMA4 ? __sin_fma4 : HAS_AVX ? __sin_avx : __sin_sse2);
24
libm_ifunc (__sin, (HAS_FMA4 ? __sin_fma4 :
25
		    HAS_YMM_USABLE ? __sin_avx : __sin_sse2));
24
weak_alias (__sin, sin)
26
weak_alias (__sin, sin)
25
27
26
# define __cos __cos_sse2
28
# define __cos __cos_sse2
27
-- sysdeps/x86_64/fpu/multiarch/s_tan.c
29
++ sysdeps/x86_64/fpu/multiarch/s_tan.c
Lines 12-18 extern double __tan_fma4 (double); Link Here
12
#  define __tan_fma4 ((void *) 0)
12
#  define __tan_fma4 ((void *) 0)
13
# endif
13
# endif
14
14
15
libm_ifunc (tan, HAS_FMA4 ? __tan_fma4 : HAS_AVX ? __tan_avx : __tan_sse2);
15
libm_ifunc (tan, (HAS_FMA4 ? __tan_fma4 :
16
		  HAS_YMM_USABLE ? __tan_avx : __tan_sse2));
16
17
17
# define tan __tan_sse2
18
# define tan __tan_sse2
18
#endif
19
#endif
19
-- sysdeps/x86_64/multiarch/init-arch.c
20
++ sysdeps/x86_64/multiarch/init-arch.c
Lines 147-159 __init_cpu_features (void) Link Here
147
  if (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & bit_AVX)
147
  if (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & bit_AVX)
148
    {
148
    {
149
      /* Reset the AVX bit in case OSXSAVE is disabled.  */
149
      /* Reset the AVX bit in case OSXSAVE is disabled.  */
150
      if ((__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & bit_OSXSAVE) == 0
150
      if ((__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & bit_OSXSAVE) != 0
151
	  || ({ unsigned int xcrlow;
151
	  && ({ unsigned int xcrlow;
152
	      unsigned int xcrhigh;
152
		unsigned int xcrhigh;
153
	      asm ("xgetbv"
153
		asm ("xgetbv"
154
		   : "=a" (xcrlow), "=d" (xcrhigh) : "c" (0));
154
		     : "=a" (xcrlow), "=d" (xcrhigh) : "c" (0));
155
	      (xcrlow & 6) != 6; }))
155
		(xcrlow & 6) == 6; }))
156
	__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx &= ~bit_AVX;
156
	__cpu_features.feature[index_YMM_Usable] |= bit_YMM_Usable;
157
    }
157
    }
158
158
159
  __cpu_features.family = family;
159
  __cpu_features.family = family;
160
-- sysdeps/x86_64/multiarch/init-arch.h
160
++ sysdeps/x86_64/multiarch/init-arch.h
Lines 22-27 Link Here
22
#define bit_Prefer_SSE_for_memop	(1 << 3)
22
#define bit_Prefer_SSE_for_memop	(1 << 3)
23
#define bit_Fast_Unaligned_Load		(1 << 4)
23
#define bit_Fast_Unaligned_Load		(1 << 4)
24
#define bit_Prefer_PMINUB_for_stringop	(1 << 5)
24
#define bit_Prefer_PMINUB_for_stringop	(1 << 5)
25
#define bit_YMM_Usable			(1 << 6)
25
26
26
#define bit_SSE2	(1 << 26)
27
#define bit_SSE2	(1 << 26)
27
#define bit_SSSE3	(1 << 9)
28
#define bit_SSSE3	(1 << 9)
Lines 49-54 Link Here
49
# define index_Prefer_SSE_for_memop	FEATURE_INDEX_1*FEATURE_SIZE
50
# define index_Prefer_SSE_for_memop	FEATURE_INDEX_1*FEATURE_SIZE
50
# define index_Fast_Unaligned_Load	FEATURE_INDEX_1*FEATURE_SIZE
51
# define index_Fast_Unaligned_Load	FEATURE_INDEX_1*FEATURE_SIZE
51
# define index_Prefer_PMINUB_for_stringop FEATURE_INDEX_1*FEATURE_SIZE
52
# define index_Prefer_PMINUB_for_stringop FEATURE_INDEX_1*FEATURE_SIZE
53
# define index_YMM_Usable		FEATURE_INDEX_1*FEATURE_SIZE
52
54
53
#else	/* __ASSEMBLER__ */
55
#else	/* __ASSEMBLER__ */
54
56
Lines 93-99 extern struct cpu_features Link Here
93
95
94
96
95
extern void __init_cpu_features (void) attribute_hidden;
97
extern void __init_cpu_features (void) attribute_hidden;
96
#define INIT_ARCH()\
98
# define INIT_ARCH() \
97
  do							\
99
  do							\
98
    if (__cpu_features.kind == arch_kind_unknown)	\
100
    if (__cpu_features.kind == arch_kind_unknown)	\
99
      __init_cpu_features ();				\
101
      __init_cpu_features ();				\
Lines 126-148 extern const struct cpu_features *__get_cpu_features (void) Link Here
126
# define index_Slow_BSF			FEATURE_INDEX_1
128
# define index_Slow_BSF			FEATURE_INDEX_1
127
# define index_Prefer_SSE_for_memop	FEATURE_INDEX_1
129
# define index_Prefer_SSE_for_memop	FEATURE_INDEX_1
128
# define index_Fast_Unaligned_Load	FEATURE_INDEX_1
130
# define index_Fast_Unaligned_Load	FEATURE_INDEX_1
131
# define index_YMM_Usable		FEATURE_INDEX_1
129
132
130
#define HAS_ARCH_FEATURE(idx, bit) \
133
# define HAS_ARCH_FEATURE(name) \
131
  ((__get_cpu_features ()->feature[idx] & (bit)) != 0)
134
  ((__get_cpu_features ()->feature[index_##name] & (bit_##name)) != 0)
132
135
133
#define HAS_FAST_REP_STRING \
136
# define HAS_FAST_REP_STRING	HAS_ARCH_FEATURE (Fast_Rep_String)
134
  HAS_ARCH_FEATURE (index_Fast_Rep_String, bit_Fast_Rep_String)
135
137
136
#define HAS_FAST_COPY_BACKWARD \
138
# define HAS_FAST_COPY_BACKWARD	HAS_ARCH_FEATURE (Fast_Copy_Backward)
137
  HAS_ARCH_FEATURE (index_Fast_Copy_Backward, bit_Fast_Copy_Backward)
138
139
139
#define HAS_SLOW_BSF \
140
# define HAS_SLOW_BSF		HAS_ARCH_FEATURE (Slow_BSF)
140
  HAS_ARCH_FEATURE (index_Slow_BSF, bit_Slow_BSF)
141
141
142
#define HAS_PREFER_SSE_FOR_MEMOP \
142
# define HAS_PREFER_SSE_FOR_MEMOP HAS_ARCH_FEATURE (Prefer_SSE_for_memop)
143
  HAS_ARCH_FEATURE (index_Prefer_SSE_for_memop, bit_Prefer_SSE_for_memop)
144
143
145
#define HAS_FAST_UNALIGNED_LOAD \
144
# define HAS_FAST_UNALIGNED_LOAD HAS_ARCH_FEATURE (Fast_Unaligned_Load)
146
  HAS_ARCH_FEATURE (index_Fast_Unaligned_Load, bit_Fast_Unaligned_Load)
145
146
# define HAS_YMM_USABLE		HAS_ARCH_FEATURE (YMM_Usable)
147
147
148
#endif	/* __ASSEMBLER__ */
148
#endif	/* __ASSEMBLER__ */

Return to bug 433884