Lines Matching defs:nbperf

1 /*	$NetBSD: nbperf-bdz.c,v 1.4.4.1 2012/10/17 21:37:11 riz Exp $	*/
39 __RCSID("$NetBSD: nbperf-bdz.c,v 1.4.4.1 2012/10/17 21:37:11 riz Exp $");
47 #include "nbperf.h"
137 print_hash(struct nbperf *nbperf, struct state *state)
142 fprintf(nbperf->output, "#include <stdlib.h>\n");
143 fprintf(nbperf->output, "#include <strings.h>\n\n");
145 fprintf(nbperf->output, "%suint32_t\n",
146 nbperf->static_hash ? "static " : "");
147 fprintf(nbperf->output,
149 nbperf->hash_name);
150 fprintf(nbperf->output, "{\n");
152 fprintf(nbperf->output,
159 fprintf(nbperf->output, "%s0x%016" PRIx64 "ULL,%s",
167 fprintf(nbperf->output, "%s0x%016" PRIx64 "ULL,%s",
172 fprintf(nbperf->output, "%s\t};\n", (i % 2 ? "\n" : ""));
174 fprintf(nbperf->output,
181 fprintf(nbperf->output, "%s0x%016" PRIx64 "ULL,%s",
189 fprintf(nbperf->output, "%s0x%016" PRIx64 "ULL,%s",
194 fprintf(nbperf->output, "%s\t};\n", (i % 2 ? "\n" : ""));
196 fprintf(nbperf->output,
200 fprintf(nbperf->output, "%s0x%08" PRIx32 ",%s",
204 fprintf(nbperf->output, "%s\t};\n", (i / 65536 % 4 ? "\n" : ""));
206 fprintf(nbperf->output,
210 fprintf(nbperf->output, "%s0x%04" PRIx32 ",%s",
214 fprintf(nbperf->output, "%s\t};\n", (i / 64 % 4 ? "\n" : ""));
216 fprintf(nbperf->output, "\tuint64_t m;\n");
217 fprintf(nbperf->output, "\tuint32_t idx, i, idx2;\n");
218 fprintf(nbperf->output, "\tuint32_t h[%zu];\n\n", nbperf->hash_size);
220 (*nbperf->print_hash)(nbperf, "\t", "key", "keylen", "h");
222 fprintf(nbperf->output, "\n\th[0] = h[0] %% %" PRIu32 ";\n",
224 fprintf(nbperf->output, "\th[1] = h[1] %% %" PRIu32 ";\n",
226 fprintf(nbperf->output, "\th[2] = h[2] %% %" PRIu32 ";\n",
229 fprintf(nbperf->output,
238 fprintf(nbperf->output,
240 fprintf(nbperf->output,
246 fprintf(nbperf->output, "}\n");
248 if (nbperf->map_output != NULL) {
250 fprintf(nbperf->map_output, "%" PRIu32 "\n",
256 bpz_compute(struct nbperf *nbperf)
262 if (nbperf->c == 0)
263 nbperf->c = 1.24;
264 if (nbperf->c < 1.24)
266 if (nbperf->hash_size < 3)
269 (*nbperf->seed_hash)(nbperf);
270 e = nbperf->n;
271 v = nbperf->c * nbperf->n;
272 if (1.24 * nbperf->n > v)
290 if (graph3_hash(nbperf, &state.graph))
295 print_hash(nbperf, &state);