Lines Matching refs:logtab
41 #define DO_USE_LOGTAB__TABLE ( logtab->size == 4096 && LOG_SCALE == 1024)
45 void create_lookup_log(log_table_info *logtab, int num_bits) in create_lookup_log() argument
50 ASSERT(logtab); in create_lookup_log()
52 logtab->size = 0x01 << num_bits; in create_lookup_log()
53 logtab->mask = 0x01; in create_lookup_log()
56 logtab->mask = (logtab->mask << 1) | 0x01; in create_lookup_log()
57 logtab->mask = ~logtab->mask; in create_lookup_log()
59 logtab->scale = LOG_SCALE; in create_lookup_log()
61 logtab->shift = (int)(val + 0.5); in create_lookup_log()
63 logtab->table = logtab__table; in create_lookup_log()
65 int* table = (int *) CALLOC(logtab->size + 1, sizeof(int), "cfront.logtable"); in create_lookup_log()
66 logtab->table = table; in create_lookup_log()
67 PRINT_SOME_CODE("#define DO_USE_LOGTAB__TABLE ( (logtab->size == %d) \\\n", logtab->size); in create_lookup_log()
69 PRINT_SOME_CODE("int logtab__table[%d] = { 0, ", logtab->size); /* filler for pos 0 */ in create_lookup_log()
70 for (ii = 1; ii <= logtab->size; ii++) in create_lookup_log()
84 int log_lookup(log_table_info *logtab, int operand, int shift) in log_lookup() argument
88 ASSERT(logtab); in log_lookup()
91 while ((operand & logtab->mask)) in log_lookup()
96 if (operand >= logtab->size) in log_lookup()
103 (int)((shift) *(logtab->shift) + logtab->table[operand])); in log_lookup()
105 return ((int)((shift) *(logtab->shift) + logtab->table[operand])); in log_lookup()
108 void destroy_lookup_log(log_table_info *logtab) in destroy_lookup_log() argument
110 ASSERT(logtab); in destroy_lookup_log()
111 ASSERT(logtab->table); in destroy_lookup_log()
113 FREE((char *)logtab->table); in destroy_lookup_log()