x86/raid6: correctly check for assembler capabilities
authorJan Beulich <JBeulich@suse.com>
Fri, 23 Jan 2015 08:29:50 +0000 (08:29 +0000)
committerNeilBrown <neilb@suse.de>
Tue, 3 Feb 2015 21:35:51 +0000 (08:35 +1100)
Just like for AVX2 (which simply needs an #if -> #ifdef conversion),
SSSE3 assembler support should be checked for before using it.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Jim Kukunas <james.t.kukunas@linux.intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: NeilBrown <neilb@suse.de>
arch/x86/Makefile
lib/raid6/algos.c
lib/raid6/recov_avx2.c
lib/raid6/recov_ssse3.c

index 920e6160c5353cda685d3e9d0e22ceacbdceded1..5ba2d9ce82dcb8f72d5184004756c1d917e8a3fe 100644 (file)
@@ -148,6 +148,7 @@ cfi-sections := $(call as-instr,.cfi_sections .debug_frame,-DCONFIG_AS_CFI_SECTI
 
 # does binutils support specific instructions?
 asinstr := $(call as-instr,fxsaveq (%rax),-DCONFIG_AS_FXSAVEQ=1)
+asinstr += $(call as-instr,pshufb %xmm0$(comma)%xmm0,-DCONFIG_AS_SSSE3=1)
 asinstr += $(call as-instr,crc32l %eax$(comma)%eax,-DCONFIG_AS_CRC32=1)
 avx_instr := $(call as-instr,vxorps %ymm0$(comma)%ymm1$(comma)%ymm2,-DCONFIG_AS_AVX=1)
 avx2_instr :=$(call as-instr,vpbroadcastb %xmm0$(comma)%ymm1,-DCONFIG_AS_AVX2=1)
index 7d0e5cd7b570c32952ea966986f32fb1f55fd13b..dbef2314901ed39c54b61d9511e0dbce37ddaa83 100644 (file)
@@ -89,10 +89,10 @@ void (*raid6_datap_recov)(int, size_t, int, void **);
 EXPORT_SYMBOL_GPL(raid6_datap_recov);
 
 const struct raid6_recov_calls *const raid6_recov_algos[] = {
-#if (defined(__i386__) || defined(__x86_64__)) && !defined(__arch_um__)
 #ifdef CONFIG_AS_AVX2
        &raid6_recov_avx2,
 #endif
+#ifdef CONFIG_AS_SSSE3
        &raid6_recov_ssse3,
 #endif
        &raid6_recov_intx1,
index e1eea433a4939537a67c22305f1f88eee29d0faf..53fe3d7bdfb3b4de498c19001c2e8d49352e22c3 100644 (file)
@@ -8,7 +8,7 @@
  * of the License.
  */
 
-#if CONFIG_AS_AVX2
+#ifdef CONFIG_AS_AVX2
 
 #include <linux/raid/pq.h>
 #include "x86.h"
index a9168328f03b3dac26f9f2fbd15fe1397147ee2e..cda33e56a5e34633f608703bcb92410d8035dcb9 100644 (file)
@@ -7,6 +7,8 @@
  * of the License.
  */
 
+#ifdef CONFIG_AS_SSSE3
+
 #include <linux/raid/pq.h>
 #include "x86.h"
 
@@ -330,3 +332,7 @@ const struct raid6_recov_calls raid6_recov_ssse3 = {
 #endif
        .priority = 1,
 };
+
+#else
+#warning "your version of binutils lacks SSSE3 support"
+#endif