Lines Matching defs:nbperf

1 /*	$NetBSD: nbperf-chm.c,v 1.2 2009/08/24 17:12:46 joerg Exp $	*/
38 __RCSID("$NetBSD: nbperf-chm.c,v 1.2 2009/08/24 17:12:46 joerg Exp $");
46 #include "nbperf.h"
137 print_hash(struct nbperf *nbperf, struct state *state)
143 fprintf(nbperf->output, "#include <stdlib.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");
164 fprintf(nbperf->output, "\tstatic const %s g[%" PRId32 "] = {\n",
167 fprintf(nbperf->output, "%s0x%0*" PRIx32 ",%s",
173 fprintf(nbperf->output, "\n\t};\n");
175 fprintf(nbperf->output, "\t};\n");
176 fprintf(nbperf->output, "\tuint32_t h[%zu];\n\n", nbperf->hash_size);
177 (*nbperf->print_hash)(nbperf, "\t", "key", "keylen", "h");
179 fprintf(nbperf->output, "\treturn (g[h[0] %% %" PRIu32 "] + "
184 fprintf(nbperf->output, "\treturn (g[h[0] %% %" PRIu32 "] + "
188 fprintf(nbperf->output, "}\n");
190 if (nbperf->map_output != NULL) {
192 fprintf(nbperf->map_output, "%" PRIu32 "\n", i);
198 chm3_compute(struct nbperf *nbperf)
200 chm_compute(struct nbperf *nbperf)
208 if (nbperf->c == 0)
209 nbperf-> c = 1.24;
211 if (nbperf->c < 1.24)
214 if (nbperf->hash_size < 3)
217 if (nbperf->c == 0)
218 nbperf-> c = 2;
220 if (nbperf->c < 2)
223 if (nbperf->hash_size < 2)
227 (*nbperf->seed_hash)(nbperf);
228 e = nbperf->n;
229 v = nbperf->c * nbperf->n;
231 if (v == 1.24 * nbperf->n)
236 if (v == 2 * nbperf->n)
247 if (graph3_hash(nbperf, &state.graph))
253 if (graph2_hash(nbperf, &state.graph))
259 print_hash(nbperf, &state);