mirror_zfs/include/linux
Gvozden Neskovic fc0c72b167 Support for vectorized algorithms on x86
This is initial support for x86 vectorized implementations of ZFS parity
and checksum algorithms.

For the compilation phase, configure step checks if toolchain supports relevant
instruction sets. Each implementation must ensure that the code is not passed
to compiler if relevant instruction set is not supported. For this purpose,
following new defines are provided if instruction set is supported:
	- HAVE_SSE,
	- HAVE_SSE2,
	- HAVE_SSE3,
	- HAVE_SSSE3,
	- HAVE_SSE4_1,
	- HAVE_SSE4_2,
	- HAVE_AVX,
	- HAVE_AVX2.

For detecting if an instruction set can be used in runtime, following functions
are provided in (include/linux/simd_x86.h):
	- zfs_sse_available()
	- zfs_sse2_available()
	- zfs_sse3_available()
	- zfs_ssse3_available()
	- zfs_sse4_1_available()
	- zfs_sse4_2_available()
	- zfs_avx_available()
	- zfs_avx2_available()
	- zfs_bmi1_available()
	- zfs_bmi2_available()

These function should be called once, on module load, or initialization.
They are safe to use from user and kernel space.
If an implementation is using more than single instruction set, both compiler
and runtime support for all relevant instruction sets should be checked.

Kernel fpu methods:
	- kfpu_begin()
	- kfpu_end()

Use __get_cpuid_max and __cpuid_count from <cpuid.h>
Both gcc and clang have support for these. They also handle ebx register
in case it is used for PIC code.

Signed-off-by: Gvozden Neskovic <neskovic@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Closes #4381
2016-03-21 09:24:34 -07:00
..
blkdev_compat.h Use uio for zvol_{read,write} 2015-12-15 16:21:43 -08:00
dcache_compat.h cstyle: Resolve C style issues 2013-12-18 16:46:35 -08:00
kmap_compat.h Add compatibility layer for {kmap,kunmap}_atomic 2015-08-24 10:13:25 -07:00
Makefile.am Support for vectorized algorithms on x86 2016-03-21 09:24:34 -07:00
simd_x86.h Support for vectorized algorithms on x86 2016-03-21 09:24:34 -07:00
utsname_compat.h Update utsname support 2014-10-17 14:58:57 -07:00
vfs_compat.h Linux 3.18 compat: Snapshot auto-mounting 2015-08-31 13:54:39 -07:00
xattr_compat.h Linux 4.5 compat: xattr list handler 2016-01-20 11:36:56 -08:00