From 756f1cbdc47c2a22a7fa9971e3ca08658c347adb Mon Sep 17 00:00:00 2001 From: Amit Pawar Date: Tue, 17 Jul 2018 15:34:55 +0530 Subject: [PATCH] Enable Fast_Unaligned_Load for Zen family. SSE2 Unaligned loads are faster than SSSE3 on Zen. --- ChangeLog | 5 +++++ sysdeps/x86/cpu-features.c | 40 ++++++++++++++++++++++++++-------------- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 05d05f7..69ba7e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2018-07-17 Amit Pawar + + * sysdeps/x86/cpu-features.c (init_cpu_features): Enable + Fast_Unaligned_Load for Zen family. + 2018-07-16 H.J. Lu [BZ #21598] diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c index 0627f14..f29b2f1 100644 --- a/sysdeps/x86/cpu-features.c +++ b/sysdeps/x86/cpu-features.c @@ -355,23 +355,35 @@ init_cpu_features (struct cpu_features *cpu_features) |= bit_arch_FMA4_Usable; } - if (family == 0x15) - { + switch(family) + { + case 0x15: #if index_arch_Fast_Unaligned_Load != index_arch_Fast_Copy_Backward # error index_arch_Fast_Unaligned_Load != index_arch_Fast_Copy_Backward #endif - /* "Excavator" */ - if (model >= 0x60 && model <= 0x7f) - { - cpu_features->feature[index_arch_Fast_Unaligned_Load] - |= (bit_arch_Fast_Unaligned_Load - | bit_arch_Fast_Copy_Backward); - - /* Unaligned AVX loads are slower.*/ - cpu_features->feature[index_arch_AVX_Fast_Unaligned_Load] - &= ~bit_arch_AVX_Fast_Unaligned_Load; - } - } + /* "Excavator" */ + if (model >= 0x60 && model <= 0x7f) + { + cpu_features->feature[index_arch_Fast_Unaligned_Load] + |= (bit_arch_Fast_Unaligned_Load + | bit_arch_Fast_Copy_Backward); + + /* Unaligned AVX loads are slower.*/ + cpu_features->feature[index_arch_AVX_Fast_Unaligned_Load] + &= ~bit_arch_AVX_Fast_Unaligned_Load; + } + break; + + case 0x17: + + /* Unaligned load versions are faster than SSSE3 on Zen. */ + cpu_features->feature[index_arch_Fast_Unaligned_Load] + |= bit_arch_Fast_Unaligned_Load; + break; + + default: + break; + } } else { -- 2.7.4