Adds GCC options to disable SSE2 use by the compiler.

This commit is contained in:
Andrea Mazzoleni 2014-09-19 23:38:18 +02:00
parent facabeb5ef
commit 8a8408a5d0
2 changed files with 28 additions and 0 deletions

View file

@ -15,6 +15,18 @@
#include "internal.h"
#include "gf.h"
/**
* Disables in this file any use of SSE2/AVX2 registers by the compiler
* to avoid to messup with the registers use made by these functions.
*
* Note that this is just a precaution as there is no yet a known case
* of conflicting register use, even if formally possible.
*/
#ifdef CONFIG_X86
#pragma GCC push_options
#pragma GCC target ("no-sse2,no-avx2")
#endif
#ifdef CONFIG_X86
/*
* GEN1 (RAID5 with xor) SSE2 implementation
@ -2466,3 +2478,5 @@ void raid_recX_avx2(int nr, int *id, int *ip, int nd, size_t size, void **vv)
}
#endif
#pragma GCC pop_options

View file

@ -14,6 +14,18 @@
#include "internal.h"
/**
* Disables in this file any use of SSE2/AVX2 registers by the compiler
* to avoid to messup with the registers use made by these functions.
*
* Note that this is just a precaution as there is no yet a known case
* of conflicting register use, even if formally possible.
*/
#ifdef CONFIG_X86
#pragma GCC push_options
#pragma GCC target ("no-sse2,no-avx2")
#endif
#ifdef CONFIG_X86
static const struct gfzconst16 {
uint8_t poly[16];
@ -254,3 +266,5 @@ void raid_genz_avx2ext(int nd, size_t size, void **vv)
}
#endif
#pragma GCC pop_options