1
0
Fork 0
mirror of https://github.com/BLAKE3-team/BLAKE3 synced 2024-05-09 07:36:06 +02:00

Compare commits

...

3 Commits

Author SHA1 Message Date
divinity76 5733ed7184
Merge 2ae92376b7 into 0816badf3a 2024-04-15 11:52:26 +02:00
Javier Blazquez 0816badf3a fix Windows ARM64 build and detect ARM64EC as ARM64 2024-04-07 11:48:02 -04:00
divinity76 2ae92376b7
BLAKE3_FORCE_PORTABLE
simple flag to only compile the portable implementation

got the idea from https://github.com/BLAKE3-team/BLAKE3/issues/364#issuecomment-2001979018

could name it BLAKE3_PORTABLE instead, maybe, idk
2024-03-16 15:03:11 +01:00
2 changed files with 14 additions and 3 deletions

View File

@ -4,9 +4,12 @@
#include "blake3_impl.h"
#if defined(IS_X86)
#if defined(_MSC_VER)
#include <Windows.h>
#endif
#if defined(IS_X86)
#if defined(_MSC_VER)
#include <intrin.h>
#elif defined(__GNUC__)
#include <immintrin.h>

View File

@ -20,6 +20,14 @@ enum blake3_flags {
DERIVE_KEY_MATERIAL = 1 << 6,
};
#ifdef BLAKE3_FORCE_PORTABLE
#define BLAKE3_NO_SSE2
#define BLAKE3_NO_SSE41
#define BLAKE3_NO_AVX2
#define BLAKE3_NO_AVX512
#define BLAKE3_USE_NEON 0
#endif
// This C implementation tries to support recent versions of GCC, Clang, and
// MSVC.
#if defined(_MSC_VER)
@ -28,7 +36,7 @@ enum blake3_flags {
#define INLINE static inline __attribute__((always_inline))
#endif
#if defined(__x86_64__) || defined(_M_X64)
#if (defined(__x86_64__) || defined(_M_X64)) && !defined(_M_ARM64EC)
#define IS_X86
#define IS_X86_64
#endif
@ -38,7 +46,7 @@ enum blake3_flags {
#define IS_X86_32
#endif
#if defined(__aarch64__) || defined(_M_ARM64)
#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
#define IS_AARCH64
#endif