Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
stenzek
GitHub Repository: stenzek/duckstation
Path: blob/master/dep/xxhash/include/xxh_x86dispatch.h
4251 views
1
/*
2
* xxHash - XXH3 Dispatcher for x86-based targets
3
* Copyright (C) 2020 Yann Collet
4
*
5
* BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php)
6
*
7
* Redistribution and use in source and binary forms, with or without
8
* modification, are permitted provided that the following conditions are
9
* met:
10
*
11
* * Redistributions of source code must retain the above copyright
12
* notice, this list of conditions and the following disclaimer.
13
* * Redistributions in binary form must reproduce the above
14
* copyright notice, this list of conditions and the following disclaimer
15
* in the documentation and/or other materials provided with the
16
* distribution.
17
*
18
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
*
30
* You can contact the author at:
31
* - xxHash homepage: https://www.xxhash.com
32
* - xxHash source repository: https://github.com/Cyan4973/xxHash
33
*/
34
35
#ifndef XXH_X86DISPATCH_H_13563687684
36
#define XXH_X86DISPATCH_H_13563687684
37
38
#include "xxhash.h" /* XXH64_hash_t, XXH3_state_t */
39
40
#if defined (__cplusplus)
41
extern "C" {
42
#endif
43
44
XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_dispatch(const void* input, size_t len);
45
XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_withSeed_dispatch(const void* input, size_t len, XXH64_hash_t seed);
46
XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_withSecret_dispatch(const void* input, size_t len, const void* secret, size_t secretLen);
47
XXH_PUBLIC_API XXH_errorcode XXH3_64bits_update_dispatch(XXH3_state_t* state, const void* input, size_t len);
48
49
XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_dispatch(const void* input, size_t len);
50
XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_withSeed_dispatch(const void* input, size_t len, XXH64_hash_t seed);
51
XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_withSecret_dispatch(const void* input, size_t len, const void* secret, size_t secretLen);
52
XXH_PUBLIC_API XXH_errorcode XXH3_128bits_update_dispatch(XXH3_state_t* state, const void* input, size_t len);
53
54
#if defined (__cplusplus)
55
}
56
#endif
57
58
59
/* automatic replacement of XXH3 functions.
60
* can be disabled by setting XXH_DISPATCH_DISABLE_REPLACE */
61
#ifndef XXH_DISPATCH_DISABLE_REPLACE
62
63
# undef XXH3_64bits
64
# define XXH3_64bits XXH3_64bits_dispatch
65
# undef XXH3_64bits_withSeed
66
# define XXH3_64bits_withSeed XXH3_64bits_withSeed_dispatch
67
# undef XXH3_64bits_withSecret
68
# define XXH3_64bits_withSecret XXH3_64bits_withSecret_dispatch
69
# undef XXH3_64bits_update
70
# define XXH3_64bits_update XXH3_64bits_update_dispatch
71
72
# undef XXH128
73
# define XXH128 XXH3_128bits_withSeed_dispatch
74
# define XXH3_128bits XXH3_128bits_dispatch
75
# undef XXH3_128bits
76
# define XXH3_128bits XXH3_128bits_dispatch
77
# undef XXH3_128bits_withSeed
78
# define XXH3_128bits_withSeed XXH3_128bits_withSeed_dispatch
79
# undef XXH3_128bits_withSecret
80
# define XXH3_128bits_withSecret XXH3_128bits_withSecret_dispatch
81
# undef XXH3_128bits_update
82
# define XXH3_128bits_update XXH3_128bits_update_dispatch
83
84
#endif /* XXH_DISPATCH_DISABLE_REPLACE */
85
86
#endif /* XXH_X86DISPATCH_H_13563687684 */
87
88