mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-21 07:26:29 -05:00
Adds SSSE3 and AVX parity computation.
This commit is contained in:
parent
1b46d03d70
commit
823bc8a8c0
8 changed files with 871 additions and 325 deletions
18
cpu.h
18
cpu.h
|
|
@ -91,6 +91,15 @@ static inline int cpu_has_sse2(void)
|
|||
return (reg[3] >> 26) & 1;
|
||||
}
|
||||
|
||||
static inline int cpu_has_ssse3(void)
|
||||
{
|
||||
uint32_t reg[4];
|
||||
|
||||
cpuid(1, reg);
|
||||
|
||||
return (reg[2] >> 9) & 1;
|
||||
}
|
||||
|
||||
static inline int cpu_has_sse42(void)
|
||||
{
|
||||
uint32_t reg[4];
|
||||
|
|
@ -100,6 +109,15 @@ static inline int cpu_has_sse42(void)
|
|||
return (reg[2] >> 20) & 1;
|
||||
}
|
||||
|
||||
static inline int cpu_has_avx(void)
|
||||
{
|
||||
uint32_t reg[4];
|
||||
|
||||
cpuid(1, reg);
|
||||
|
||||
return (reg[2] >> 28) & 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the processor has a slow MULT implementation.
|
||||
* If yes, it's better to use a hash not based on multiplication.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue