xref: /freebsd/sys/contrib/libb2/blake2-config.h (revision 6829dae12bb055451fa467da4589c43bd03b1e64)
1 /*
2    BLAKE2 reference source code package - optimized C implementations
3 
4    Written in 2012 by Samuel Neves <sneves@dei.uc.pt>
5 
6    To the extent possible under law, the author(s) have dedicated all copyright
7    and related and neighboring rights to this software to the public domain
8    worldwide. This software is distributed without any warranty.
9 
10    You should have received a copy of the CC0 Public Domain Dedication along with
11    this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
12 */
13 #pragma once
14 #ifndef __BLAKE2_CONFIG_H__
15 #define __BLAKE2_CONFIG_H__
16 
17 #if defined(__SSE2__)
18 #define HAVE_SSE2
19 #endif
20 
21 #if defined(__SSSE3__)
22 #define HAVE_SSSE3
23 #endif
24 
25 #if defined(__SSE4_1__)
26 #define HAVE_SSE4_1
27 #endif
28 
29 #if defined(__AVX__)
30 #define HAVE_AVX
31 #endif
32 
33 #if defined(__XOP__)
34 #define HAVE_XOP
35 #endif
36 
37 
38 #ifdef HAVE_AVX2
39 #ifndef HAVE_AVX
40 #define HAVE_AVX
41 #endif
42 #endif
43 
44 #ifdef HAVE_XOP
45 #ifndef HAVE_AVX
46 #define HAVE_AVX
47 #endif
48 #endif
49 
50 #ifdef HAVE_AVX
51 #ifndef HAVE_SSE4_1
52 #define HAVE_SSE4_1
53 #endif
54 #endif
55 
56 #ifdef HAVE_SSE41
57 #ifndef HAVE_SSSE3
58 #define HAVE_SSSE3
59 #endif
60 #endif
61 
62 #ifdef HAVE_SSSE3
63 #define HAVE_SSE2
64 #endif
65 
66 #if !defined(HAVE_SSE2)
67 #error "This code requires at least SSE2."
68 #endif
69 
70 #endif
71 
72