From 0b1cbaaef5ccc21baf2c35d4698fb28e82eab385 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 24 Jun 2011 14:15:32 -0400 Subject: Optimized st{r,p}{,n}cpy for SSE2/SSSE3 on x86-32 --- sysdeps/x86_64/multiarch/init-arch.c | 11 ++++++++--- sysdeps/x86_64/multiarch/init-arch.h | 6 ++++++ 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'sysdeps/x86_64/multiarch') diff --git a/sysdeps/x86_64/multiarch/init-arch.c b/sysdeps/x86_64/multiarch/init-arch.c index 809d105c77..81b2378467 100644 --- a/sysdeps/x86_64/multiarch/init-arch.c +++ b/sysdeps/x86_64/multiarch/init-arch.c @@ -97,13 +97,18 @@ __init_cpu_features (void) case 0x2c: case 0x2e: case 0x2f: - /* Rep string instructions and copy backward are fast on - Intel Core i3, i5 and i7. */ + /* Rep string instructions, copy backward and unaligned loads + are fast on Intel Core i3, i5 and i7. */ #if index_Fast_Rep_String != index_Fast_Copy_Backward # error index_Fast_Rep_String != index_Fast_Copy_Backward +#endif +#if index_Fast_Rep_String != index_Fast_Unaligned_Load +# error index_Fast_Rep_String != index_Fast_Unaligned_Load #endif __cpu_features.feature[index_Fast_Rep_String] - |= bit_Fast_Rep_String | bit_Fast_Copy_Backward; + |= (bit_Fast_Rep_String + | bit_Fast_Copy_Backward + | bit_Fast_Unaligned_Load); break; } } diff --git a/sysdeps/x86_64/multiarch/init-arch.h b/sysdeps/x86_64/multiarch/init-arch.h index 6e409b8f17..addf5f3dde 100644 --- a/sysdeps/x86_64/multiarch/init-arch.h +++ b/sysdeps/x86_64/multiarch/init-arch.h @@ -20,6 +20,7 @@ #define bit_Fast_Copy_Backward (1 << 1) #define bit_Slow_BSF (1 << 2) #define bit_Prefer_SSE_for_memop (1 << 3) +#define bit_Fast_Unaligned_Load (1 << 4) #ifdef __ASSEMBLER__ @@ -39,6 +40,7 @@ # define index_Fast_Copy_Backward FEATURE_INDEX_1*FEATURE_SIZE # define index_Slow_BSF FEATURE_INDEX_1*FEATURE_SIZE # define index_Prefer_SSE_for_memop FEATURE_INDEX_1*FEATURE_SIZE +# define index_Fast_Unaligned_Load FEATURE_INDEX_1*FEATURE_SIZE #else /* __ASSEMBLER__ */ @@ -112,6 +114,7 @@ extern const struct cpu_features *__get_cpu_features (void) # define index_Fast_Copy_Backward FEATURE_INDEX_1 # define index_Slow_BSF FEATURE_INDEX_1 # define index_Prefer_SSE_for_memop FEATURE_INDEX_1 +# define index_Fast_Unaligned_Load FEATURE_INDEX_1 #define HAS_ARCH_FEATURE(idx, bit) \ ((__get_cpu_features ()->feature[idx] & (bit)) != 0) @@ -128,4 +131,7 @@ extern const struct cpu_features *__get_cpu_features (void) #define HAS_PREFER_SSE_FOR_MEMOP \ HAS_ARCH_FEATURE (index_Prefer_SSE_for_memop, bit_Prefer_SSE_for_memop) +#define HAS_FAST_UNALIGNED_LOAD \ + HAS_ARCH_FEATURE (index_Fast_Unaligned_Load, bit_Fast_Unaligned_Load) + #endif /* __ASSEMBLER__ */ -- cgit v1.2.3-70-g09d2