mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
Add AltiVec RAID-Z
Implements the RAID-Z function using AltiVec SIMD. This is basically the NEON code translated to AltiVec. Note that the 'fletcher' algorithm requires 64-bits operations, and the initial implementations of AltiVec (PPC74xx a.k.a. G4, PPC970 a.k.a. G5) only has up to 32-bits operations, so no 'fletcher'. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Romain Dolbeau <romain.dolbeau@european-processor-initiative.eu> Closes #9539
This commit is contained in:
committed by
Brian Behlendorf
parent
1a69856034
commit
35b07497c6
@@ -437,6 +437,46 @@ zfs_avx512vbmi_available(void)
|
||||
#define kfpu_begin() do {} while (0)
|
||||
#define kfpu_end() do {} while (0)
|
||||
|
||||
#elif defined(__powerpc__)
|
||||
|
||||
#define kfpu_allowed() 1
|
||||
#define kfpu_initialize(tsk) do {} while (0)
|
||||
#define kfpu_begin() do {} while (0)
|
||||
#define kfpu_end() do {} while (0)
|
||||
|
||||
/*
|
||||
* Check if AltiVec instruction set is available
|
||||
* No easy way beyond 'altivec works' :-(
|
||||
*/
|
||||
#include <signal.h>
|
||||
#include <setjmp.h>
|
||||
|
||||
#ifdef __ALTIVEC__
|
||||
static jmp_buf env;
|
||||
static void sigillhandler(int x)
|
||||
{
|
||||
longjmp(env, 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline boolean_t
|
||||
zfs_altivec_available(void)
|
||||
{
|
||||
boolean_t has_altivec = B_FALSE;
|
||||
#ifdef __ALTIVEC__
|
||||
sighandler_t savesig;
|
||||
savesig = signal(SIGILL, sigillhandler);
|
||||
if (setjmp(env)) {
|
||||
signal(SIGILL, savesig);
|
||||
has_altivec = B_FALSE;
|
||||
} else {
|
||||
__asm__ __volatile__("vor 0,0,0\n" : : : "v0");
|
||||
signal(SIGILL, savesig);
|
||||
has_altivec = B_TRUE;
|
||||
}
|
||||
#endif
|
||||
return (has_altivec);
|
||||
}
|
||||
#else
|
||||
|
||||
#define kfpu_allowed() 0
|
||||
|
||||
@@ -130,6 +130,7 @@ KERNEL_C = \
|
||||
vdev_raidz_math_scalar.c \
|
||||
vdev_raidz_math_sse2.c \
|
||||
vdev_raidz_math_ssse3.c \
|
||||
vdev_raidz_math_powerpc_altivec.c \
|
||||
vdev_removal.c \
|
||||
vdev_root.c \
|
||||
vdev_trim.c \
|
||||
@@ -201,3 +202,8 @@ libzpool_la_LIBADD += $(ZLIB) -ldl
|
||||
libzpool_la_LDFLAGS = -pthread -version-info 2:0:0
|
||||
|
||||
EXTRA_DIST = $(USER_C)
|
||||
|
||||
if TARGET_CPU_POWERPC
|
||||
vdev_raidz_math_powerpc_altivec.$(OBJEXT): CFLAGS += -maltivec
|
||||
vdev_raidz_math_powerpc_altivec.l$(OBJEXT): CFLAGS += -maltivec
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user