0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
bmz-internal.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; version 3 of the
9  * License, or any later version.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with Hypertable. If not, see <http://www.gnu.org/licenses/>
18  */
19 
20 #ifndef BMZ_INTERNAL_H
21 #define BMZ_INTERNAL_H
22 
23 #include "bmz.h"
24 
25 /* Expert APIs for testing and experiement */
26 
27 /* MSB of flags */
28 #define BMZ_HASH_MOD 1
29 #define BMZ_HASH_MOD16X2 2
30 #define BMZ_HASH_MASK16X2 3
31 #define BMZ_HASH_MASK 4
32 #define BMZ_HASH_MASK32X2 5
33 
34 HT_EXTERN(size_t)
35 bmz_hash_mod(const void *in, size_t in_len, size_t b, size_t m);
36 
37 HT_EXTERN(size_t)
38 bmz_hash_mod16x2(const void *in, size_t in_len, size_t b1, size_t b2,
39  size_t m1, size_t m2);
40 
41 HT_EXTERN(size_t)
42 bmz_hash_mask16x2(const void *in, size_t in_len, size_t b1, size_t b2);
43 
44 HT_EXTERN(size_t)
45 bmz_hash_mask(const void *in, size_t in_len, size_t b);
46 
47 HT_EXTERN(size_t)
48 bmz_hash_mask32x2(const void *in, size_t in_len, size_t b1, size_t b2);
49 
50 HT_EXTERN(int)
51 bmz_check_hash_mod(const void *in, size_t in_len, size_t fp_len,
52  size_t b, size_t m);
53 
54 HT_EXTERN(int)
55 bmz_check_hash_mod16x2(const void *in, size_t in_len, size_t fp_len,
56  size_t b1, size_t b2, size_t m1, size_t m2);
57 
58 HT_EXTERN(int)
59 bmz_check_hash_mask16x2(const void *in, size_t in_len, size_t fp_len,
60  size_t b1, size_t b2);
61 
62 HT_EXTERN(int)
63 bmz_check_hash_mask(const void *in, size_t in_len, size_t fp_len, size_t b);
64 
65 HT_EXTERN(int)
66 bmz_check_hash_mask32x2(const void *in, size_t in_len, size_t fp_len,
67  size_t b1, size_t b2);
68 
69 HT_EXTERN(void)
70 bmz_bench_hash(const void *in, size_t in_len, unsigned type);
71 
72 HT_EXTERN(void)
73 bmz_bench_lut_mod(const void *in, size_t in_len, size_t fp_len, void *mem,
74  size_t b, size_t m);
75 
76 HT_EXTERN(void)
77 bmz_bench_lut_mod16x2(const void *in, size_t in_len, size_t fp_len, void *mem,
78  size_t b1, size_t b2, size_t m1, size_t m2);
79 
80 HT_EXTERN(void)
81 bmz_bench_lut_mask16x2(const void *in, size_t in_len, size_t fp_len, void *mem,
82  size_t b1, size_t b2);
83 
84 HT_EXTERN(void)
85 bmz_bench_lut_mask(const void *in, size_t in_len, size_t fp_len, void *mem,
86  size_t b);
87 
88 HT_EXTERN(void)
89 bmz_bench_lut_mask32x2(const void *in, size_t in_len, size_t fp_len, void *mem,
90  size_t b1, size_t b2);
91 
92 /* Note: for bmz_bm_pack*, unlike in bmz_pack*, work_mem needs to be
93  * 64-bit word aligned
94  */
95 
96 HT_EXTERN(int)
97 bmz_pack_mod(const void *in, size_t in_len, void *out, size_t *out_len_p,
98  size_t offset, size_t fp_len, unsigned flags, void *work_mem,
99  size_t b, size_t m);
100 
101 HT_EXTERN(int)
102 bmz_pack_mod16x2(const void *in, size_t in_len, void *out, size_t *out_len_p,
103  size_t offset, size_t fp_len, unsigned flags, void *work_mem,
104  size_t b1, size_t b2, size_t m1, size_t m2);
105 
106 HT_EXTERN(int)
107 bmz_pack_mask16x2(const void *in, size_t in_len, void *out, size_t *out_len_p,
108  size_t offset, size_t fp_len, unsigned flags, void *work_mem,
109  size_t b1, size_t b2);
110 
111 HT_EXTERN(int)
112 bmz_pack_mask(const void *in, size_t in_len, void *out, size_t *out_len_p,
113  size_t offset, size_t fp_len, unsigned flags, void *work_mem,
114  size_t b);
115 
116 HT_EXTERN(int)
117 bmz_pack_mask32x2(const void *in, size_t in_len, void *out, size_t *out_len_p,
118  size_t offset, size_t fp_len, unsigned flags, void *work_mem,
119  size_t b1, size_t b2);
120 
121 HT_EXTERN(int)
122 bmz_bm_pack_mod(const void *in, size_t in_len, void *out, size_t *out_len_p,
123  size_t offset, size_t fp_len, void *work_mem,
124  size_t b, size_t m);
125 
126 HT_EXTERN(int)
127 bmz_bm_pack_mod16x2(const void *in, size_t in_len, void *out, size_t *out_len_p,
128  size_t offset, size_t fp_len, void *work_mem,
129  size_t b1, size_t b2, size_t m1, size_t m2);
130 
131 HT_EXTERN(int)
132 bmz_bm_pack_mask16x2(const void *in, size_t in_len, void *out,
133  size_t *out_len_p, size_t offset, size_t fp_len,
134  void *work_mem, size_t b1, size_t b2);
135 
136 HT_EXTERN(int)
137 bmz_bm_pack_mask(const void *in, size_t in_len, void *out, size_t *out_len_p,
138  size_t offset, size_t fp_len, void *work_mem, size_t b);
139 
140 HT_EXTERN(int)
141 bmz_bm_pack_mask32x2(const void *in, size_t in_len, void *out,
142  size_t *out_len_p, size_t offset, size_t fp_len,
143  void *work_mem, size_t b1, size_t b2);
144 
145 HT_EXTERN(size_t)
146 bmz_bm_pack_worklen(size_t in_len, size_t fp_len);
147 
148 HT_EXTERN(int)
149 bmz_bm_dump(const void *in, size_t in_len);
150 
151 HT_EXTERN(int)
152 bmz_bm_unpack(const void *in, size_t in_len, void *out, size_t *out_len_p);
153 
154 HT_EXTERN(int)
155 bmz_lz_pack(const void *in, size_t in_len, void *out, size_t *out_len_p,
156  void *work_mem);
157 
158 HT_EXTERN(size_t)
159 bmz_lz_pack_worklen(size_t in_len);
160 
161 HT_EXTERN(int)
162 bmz_lz_unpack(const void *in, size_t in_len, void *out, size_t *out_len_p);
163 
164 HT_EXTERN(int)
165 bmz_set_collision_thresh(int thresh);
166 
167 #endif /* BMZ_INTERNAL_H */
168 /* vim: et sw=2
169  */
bmz_bm_unpack(const void *in, size_t in_len, void *out, size_t *out_len_p)
Definition: bmz.c:1338
bmz_bm_pack_mod16x2(const void *in, size_t in_len, void *out, size_t *out_len_p, size_t offset, size_t fp_len, void *work_mem, size_t b1, size_t b2, size_t m1, size_t m2)
Definition: bmz.c:1107
bmz_hash_mask32x2(const void *in, size_t in_len, size_t b1, size_t b2)
Definition: bmz.c:535
bmz_hash_mask16x2(const void *in, size_t in_len, size_t b1, size_t b2)
Definition: bmz.c:525
bmz_pack_mod16x2(const void *in, size_t in_len, void *out, size_t *out_len_p, size_t offset, size_t fp_len, unsigned flags, void *work_mem, size_t b1, size_t b2, size_t m1, size_t m2)
Definition: bmz.c:1222
bmz_bm_pack_worklen(size_t in_len, size_t fp_len)
Definition: bmz.c:1172
bmz_bench_lut_mod(const void *in, size_t in_len, size_t fp_len, void *mem, size_t b, size_t m)
Definition: bmz.c:741
bmz_hash_mod16x2(const void *in, size_t in_len, size_t b1, size_t b2, size_t m1, size_t m2)
Definition: bmz.c:519
bmz_check_hash_mask32x2(const void *in, size_t in_len, size_t fp_len, size_t b1, size_t b2)
Definition: bmz.c:662
bmz_bench_lut_mask16x2(const void *in, size_t in_len, size_t fp_len, void *mem, size_t b1, size_t b2)
Definition: bmz.c:764
bmz_bench_lut_mask32x2(const void *in, size_t in_len, size_t fp_len, void *mem, size_t b1, size_t b2)
Definition: bmz.c:786
bmz_lz_unpack(const void *in, size_t in_len, void *out, size_t *out_len_p)
Definition: bmz.c:1465
#define HT_EXTERN(ret_type)
Definition: compat-c.h:52
bmz_bm_pack_mod(const void *in, size_t in_len, void *out, size_t *out_len_p, size_t offset, size_t fp_len, void *work_mem, size_t b, size_t m)
Definition: bmz.c:1096
bmz_bm_pack_mask16x2(const void *in, size_t in_len, void *out, size_t *out_len_p, size_t offset, size_t fp_len, void *work_mem, size_t b1, size_t b2)
Definition: bmz.c:1122
bmz_pack_mask(const void *in, size_t in_len, void *out, size_t *out_len_p, size_t offset, size_t fp_len, unsigned flags, void *work_mem, size_t b)
Definition: bmz.c:1238
bmz_pack_mask16x2(const void *in, size_t in_len, void *out, size_t *out_len_p, size_t offset, size_t fp_len, unsigned flags, void *work_mem, size_t b1, size_t b2)
Definition: bmz.c:1230
bmz_check_hash_mod16x2(const void *in, size_t in_len, size_t fp_len, size_t b1, size_t b2, size_t m1, size_t m2)
Definition: bmz.c:594
bmz_bench_hash(const void *in, size_t in_len, unsigned type)
Definition: bmz.c:686
bmz_set_collision_thresh(int thresh)
Definition: bmz.c:260
bmz_bench_lut_mask(const void *in, size_t in_len, size_t fp_len, void *mem, size_t b)
Definition: bmz.c:776
bmz_pack_mask32x2(const void *in, size_t in_len, void *out, size_t *out_len_p, size_t offset, size_t fp_len, unsigned flags, void *work_mem, size_t b1, size_t b2)
Definition: bmz.c:1246
bmz_hash_mask(const void *in, size_t in_len, size_t b)
Definition: bmz.c:530
bmz_lz_pack(const void *in, size_t in_len, void *out, size_t *out_len_p, void *work_mem)
Definition: bmz.c:1451
bmz_pack_mod(const void *in, size_t in_len, void *out, size_t *out_len_p, size_t offset, size_t fp_len, unsigned flags, void *work_mem, size_t b, size_t m)
Definition: bmz.c:1214
bmz_lz_pack_worklen(size_t in_len)
Definition: bmz.c:1460
bmz_check_hash_mod(const void *in, size_t in_len, size_t fp_len, size_t b, size_t m)
Definition: bmz.c:573
bmz_bm_dump(const void *in, size_t in_len)
Definition: bmz.c:1396
bmz_bm_pack_mask32x2(const void *in, size_t in_len, void *out, size_t *out_len_p, size_t offset, size_t fp_len, void *work_mem, size_t b1, size_t b2)
Definition: bmz.c:1147
bmz_bench_lut_mod16x2(const void *in, size_t in_len, size_t fp_len, void *mem, size_t b1, size_t b2, size_t m1, size_t m2)
Definition: bmz.c:751
bmz_check_hash_mask16x2(const void *in, size_t in_len, size_t fp_len, size_t b1, size_t b2)
Definition: bmz.c:618
bmz_hash_mod(const void *in, size_t in_len, size_t b, size_t m)
Definition: bmz.c:514
bmz_bm_pack_mask(const void *in, size_t in_len, void *out, size_t *out_len_p, size_t offset, size_t fp_len, void *work_mem, size_t b)
Definition: bmz.c:1136
bmz_check_hash_mask(const void *in, size_t in_len, size_t fp_len, size_t b)
Definition: bmz.c:642