Frank Denis
c8b6906c60
has_armcrypto_aes -> has_armcrypto
5 years ago
Frank Denis
a8dc93192d
On Apple devices, the ARM64_V8 subtype always has the crypto extensions
5 years ago
Frank Denis
dd5fbb632b
Check for AT_HWCAP2 instead of AT_HWCAP where it's used
5 years ago
Frank Denis
1910ca83d8
Detect NEON and ARMCRYPTO on ARM32
Which doesn't mean that the compiler will support these opcodes, so
we need to autoconf magic as well.
5 years ago
Frank Denis
456a57f235
__arm__ => __ARM_ARCH
5 years ago
Frank Denis
acaed459ce
Add ARM NEON and AES runtime checks
5 years ago
Frank Denis
06e4a485c4
More tests
5 years ago
Frank Denis
e614671fc8
More paranoid AVX512 detection
6 years ago
Frank Denis
cfb0f94704
Visual Studio documentation states that eax/ecx/edx don't need to be
preserved in inline assembly code. But that doesn't seem to always
hold true on Visual Studio 2010.
6 years ago
Frank Denis
ee2403deba
Check for RDRAND presence
7 years ago
Frank Denis
1c0677b09f
Check for AVX512F support
7 years ago
Frank Denis
ea7f03d9b4
Define HAVE_INTRIN_H on Windows; no need to reinclude it in runtime.c
7 years ago
Frank Denis
ab05ce906b
Add missing preprocessor continuation, indent by the way
7 years ago
Frank Denis
e5a196a8ee
Always include intrin.h if available
7 years ago
Frank Denis
9eea164007
Check for _xgetbv() presence
7 years ago
Frank Denis
03f27b4204
Use _xgetbv() on Visual Studio, when available
7 years ago
Frank Denis
0e4a05d558
MSVC can only assembly x86 instructions
7 years ago
Frank Denis
cc55a084f8
MSC_VER -> _MSC_VER typo
7 years ago
Frank Denis
45160a0f78
Define the HAVE_* macros for SIMD instructions on Visual Studio
This avoids a lot of redundant preprocessor checks
7 years ago
Frank Denis
0ccc6d7661
Indent
7 years ago
Frank Denis
4c2cf071f8
Include <intrin.h> on Visual Studio for __cpuid()
7 years ago
Frank Denis
efb81c7290
CRLF
8 years ago
Thomas Waldmann
b9c266181b
fix avx2 feature detection, fixes #395
cpuid needed to get called with EAX = 7 to get the "extended features"
(not with EAX = 1 for the "features").
8 years ago
Frank Denis
22ab28be0a
Require Visual Studio 2010+ for AESNI
8 years ago
Frank Denis
da448c38e4
Nits
8 years ago
Frank Denis
33f406892f
Rename CPUID bits constants for clarity
8 years ago
Frank Denis
fd440e7b4d
AVX2 bit is in %ebx, not %ecx
8 years ago
Frank Denis
7611ea6018
Add AVX2 detection
8 years ago
Frank Denis
5f4763ce74
Simplify AVX availabity detection, add support for Visual Studio
9 years ago
Frank Denis
2ee3db59e7
Use HAVE_AVX_ASM instead of HAVE_AMD64_ASM
9 years ago
Frank Denis
ab4bade488
Check the extended control register to see if AVX is actually usable
9 years ago
Frank Denis
0ad21a218c
Return CPU features in Visual Studio builds
Please note that on other platforms, we keep checking if intrinsics are available.
has_*() means that not only a CPU feature is present, but also that Sodium can
use it.
9 years ago
Frank Denis
049fd8fd6a
Add sodium_runtime_has_avx()
9 years ago
Frank Denis
094dac655e
Don't export sodium_runtime_get_cpu_features()
9 years ago
Frank Denis
26fdfec99b
Add sodium_runtime_has_ssse3() and sodium_runtime_has_sse41()
9 years ago
Frank Denis
e83e9b2d8e
Check for AESNI & PCLMUL presence/usability
9 years ago
Frank Denis
7821009bff
Do not assume that _MSC_VER being defined implied x86 or x64
9 years ago
Frank Denis
5fc704cbf0
lcov exclusions
10 years ago
Frank Denis
f812967fb8
Coverage exclusion when relevant
10 years ago
Frank Denis
59a207e4ff
__cpuidex() is not really required for now, just use __cpuid()
10 years ago
Frank Denis
1e0eafc541
Fix inverted sse2/sse3 detection
10 years ago
Frank Denis
96ea56a471
Rename cpu_features global to _cpu_features
10 years ago
Frank Denis
a234e505f9
Saving %rbx may actually be required depending on the memory model.
10 years ago
Frank Denis
f8c49ac54f
cpuid is not going to change more than ebx, even on x86_64
10 years ago
Frank Denis
f601e6e471
Preserve (e|r)bx register when calling cpuid
10 years ago
Frank Denis
cb4f3e4f06
Use SSE2 or portable scrypt implementation according to what the CPU supports.
10 years ago
Frank Denis
42e4ebe3e3
autoconf uses HAVE_*, but runtime_have_* sounds really awkward
10 years ago
Frank Denis
cb8544715b
Check for SSE2/SSE3/NEON support at runtime.
10 years ago