diff options
Diffstat (limited to 'sysdeps/x86_64/multiarch/init-arch.h')
-rw-r--r-- | sysdeps/x86_64/multiarch/init-arch.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sysdeps/x86_64/multiarch/init-arch.h b/sysdeps/x86_64/multiarch/init-arch.h index b2f2de3796..4a211c0864 100644 --- a/sysdeps/x86_64/multiarch/init-arch.h +++ b/sysdeps/x86_64/multiarch/init-arch.h @@ -17,6 +17,7 @@ 02111-1307 USA. */ #define bit_Fast_Rep_String (1 << 0) +#define bit_Fast_Copy_Backward (1 << 1) #ifdef __ASSEMBLER__ @@ -32,7 +33,8 @@ # define index_SSE4_1 COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET # define index_SSE4_2 COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET -#define index_Fast_Rep_String FEATURE_INDEX_1*FEATURE_SIZE +# define index_Fast_Rep_String FEATURE_INDEX_1*FEATURE_SIZE +# define index_Fast_Copy_Backward FEATURE_INDEX_1*FEATURE_SIZE #else /* __ASSEMBLER__ */ @@ -102,6 +104,16 @@ extern const struct cpu_features *__get_cpu_features (void) # define HAS_SSE4_2 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, 20) # define HAS_FMA HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, 12) -# define index_Fast_Rep_String FEATURE_INDEX_1 +# define index_Fast_Rep_String FEATURE_INDEX_1 +# define index_Fast_Copy_Backward FEATURE_INDEX_1 + +#define HAS_ARCH_FEATURE(idx, bit) \ + ((__get_cpu_features ()->feature[idx] & (bit)) != 0) + +#define HAS_FAST_REP_STRING \ + HAS_ARCH_FEATURE (index_Fast_Rep_String, bit_Fast_Rep_String) + +#define HAS_FAST_COPY_BACKWARD \ + HAS_ARCH_FEATURE (index_Fast_Copy_Backward, bit_Fast_Copy_Backward) #endif /* __ASSEMBLER__ */ |