-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypedef.h
69 lines (59 loc) · 1.44 KB
/
typedef.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef __include_fnv1_typedef_h__
#define __include_fnv1_typedef_h__
#define PACKED __attribute__((__packed__))
typedef struct _fnv1 fnv1_t;
typedef void (*fnv1_dump_f)(const fnv1_t *fnv1);
typedef int (*fnv1_f)(const fnv1_t *fnv1);
#include <stdint.h> /* for uint32_t, uint64_t, uint8_t */
#include <sys/types.h> /* for size_t */
struct PACKED _fnv1 {
uint8_t avalanche : 1;
uint8_t binary : 1;
uint8_t bitidx : 3;
uint8_t clock : 1;
int fd;
const char *filename;
fnv1_f function;
void *hash;
const char *progname;
void *readbuf;
size_t readbufsize;
void *work;
};
typedef union PACKED {
struct PACKED {
uint64_t lo;
uint64_t hi;
};
__uint128_t packed;
uint32_t vector_dword[4];
uint64_t vector_qword[2];
} uint128_u;
typedef union PACKED {
struct PACKED {
uint128_u lo;
uint128_u hi;
};
unsigned long long __attribute__((__vector_size__(32), __aligned__(32))) packed;
uint32_t vector_dword[8];
uint64_t vector_qword[4];
} uint256_u;
typedef union PACKED {
struct PACKED {
uint256_u lo;
uint256_u hi;
};
unsigned long long __attribute__((__vector_size__(64), __aligned__(64))) packed;
uint32_t vector_dword[16];
uint64_t vector_qword[8];
} uint512_u;
typedef union PACKED {
struct PACKED {
uint512_u lo;
uint512_u hi;
};
unsigned long long __attribute__((__vector_size__(128), __aligned__(128))) packed;
uint32_t vector_dword[32];
uint64_t vector_qword[16];
} uint1024_u;
#endif /* __include_fnv1_typedef_h__ */