Lines Matching refs:i

105 	size_t i;  in check_symbol_range()  local
108 for (i = 0; i < entries; ++i) { in check_symbol_range()
109 ar = &ranges[i]; in check_symbol_range()
186 size_t i; in symbol_in_range() local
189 for (i = 0; i < entries; ++i) { in symbol_in_range()
190 ar = &ranges[i]; in symbol_in_range()
241 unsigned int i, pos; in shrink_table() local
244 for (i = 0; i < table_cnt; i++) { in shrink_table()
245 if (symbol_valid(table[i])) { in shrink_table()
246 if (pos != i) in shrink_table()
247 table[pos] = table[i]; in shrink_table()
250 free(table[i]); in shrink_table()
354 unsigned int i, k, off; in write_src() local
381 for (i = 0; i < table_cnt; i++) { in write_src()
382 if ((i & 0xFF) == 0) in write_src()
383 markers[i >> 8] = off; in write_src()
384 table[i]->seq = i; in write_src()
387 if (table[i]->len == 0) { in write_src()
394 if (table[i]->len > 0x3FFF) { in write_src()
401 if (table[i]->len <= 0x7F) { in write_src()
403 printf("\t.byte 0x%02x", table[i]->len); in write_src()
404 off += table[i]->len + 1; in write_src()
408 (table[i]->len & 0x7F) | 0x80, in write_src()
409 (table[i]->len >> 7) & 0x7F); in write_src()
410 off += table[i]->len + 2; in write_src()
412 for (k = 0; k < table[i]->len; k++) in write_src()
413 printf(", 0x%02x", table[i]->sym[k]); in write_src()
419 expand_symbol(table[i]->sym, table[i]->len, buf); in write_src()
420 strcpy((char *)table[i]->sym, buf); in write_src()
421 printf("\t/* %s */\n", table[i]->sym); in write_src()
426 for (i = 0; i < markers_cnt; i++) in write_src()
427 printf("\t.long\t%u\n", markers[i]); in write_src()
434 for (i = 0; i < 256; i++) { in write_src()
435 best_idx[i] = off; in write_src()
436 expand_symbol(best_table[i], best_table_len[i], buf); in write_src()
443 for (i = 0; i < 256; i++) in write_src()
444 printf("\t.short\t%d\n", best_idx[i]); in write_src()
449 for (i = 0; i < table_cnt; i++) { in write_src()
461 offset = table[i]->addr - relative_base; in write_src()
463 } else if (symbol_absolute(table[i])) { in write_src()
464 offset = table[i]->addr; in write_src()
467 offset = relative_base - table[i]->addr - 1; in write_src()
473 symbol_absolute(table[i]) ? "absolute" : "relative", in write_src()
474 table[i]->addr); in write_src()
477 printf("\t.long\t%#x\t/* %s */\n", (int)offset, table[i]->sym); in write_src()
491 for (i = 0; i < table_cnt; i++) in write_src()
493 (unsigned char)(table[i]->seq >> 16), in write_src()
494 (unsigned char)(table[i]->seq >> 8), in write_src()
495 (unsigned char)(table[i]->seq >> 0), in write_src()
496 table[i]->sym); in write_src()
506 int i; in learn_symbol() local
508 for (i = 0; i < len - 1; i++) in learn_symbol()
509 token_profit[ symbol[i] + (symbol[i + 1] << 8) ]++; in learn_symbol()
515 int i; in forget_symbol() local
517 for (i = 0; i < len - 1; i++) in forget_symbol()
518 token_profit[ symbol[i] + (symbol[i + 1] << 8) ]--; in forget_symbol()
524 unsigned int i; in build_initial_token_table() local
526 for (i = 0; i < table_cnt; i++) in build_initial_token_table()
527 learn_symbol(table[i]->sym, table[i]->len); in build_initial_token_table()
533 int i; in find_token() local
535 for (i = 0; i < len - 1; i++) { in find_token()
536 if (str[i] == token[0] && str[i+1] == token[1]) in find_token()
537 return &str[i]; in find_token()
546 unsigned int i, len, size; in compress_symbols() local
549 for (i = 0; i < table_cnt; i++) { in compress_symbols()
551 len = table[i]->len; in compress_symbols()
552 p1 = table[i]->sym; in compress_symbols()
559 forget_symbol(table[i]->sym, len); in compress_symbols()
578 table[i]->len = len; in compress_symbols()
581 learn_symbol(table[i]->sym, len); in compress_symbols()
588 int i, best, bestprofit; in find_best_token() local
593 for (i = 0; i < 0x10000; i++) { in find_best_token()
594 if (token_profit[i] > bestprofit) { in find_best_token()
595 best = i; in find_best_token()
596 bestprofit = token_profit[i]; in find_best_token()
605 int i, best; in optimize_result() local
609 for (i = 255; i >= 0; i--) { in optimize_result()
613 if (!best_table_len[i]) { in optimize_result()
621 best_table_len[i] = 2; in optimize_result()
622 best_table[i][0] = best & 0xFF; in optimize_result()
623 best_table[i][1] = (best >> 8) & 0xFF; in optimize_result()
626 compress_symbols(best_table[i], i); in optimize_result()
634 unsigned int i, j, c; in insert_real_symbols_in_table() local
636 for (i = 0; i < table_cnt; i++) { in insert_real_symbols_in_table()
637 for (j = 0; j < table[i]->len; j++) { in insert_real_symbols_in_table()
638 c = table[i]->sym[j]; in insert_real_symbols_in_table()
730 unsigned int i; in make_percpus_absolute() local
732 for (i = 0; i < table_cnt; i++) in make_percpus_absolute()
733 if (symbol_in_range(table[i], &percpu_range, 1)) { in make_percpus_absolute()
739 table[i]->sym[0] = 'A'; in make_percpus_absolute()
740 table[i]->percpu_absolute = true; in make_percpus_absolute()
747 unsigned int i; in record_relative_base() local
749 for (i = 0; i < table_cnt; i++) in record_relative_base()
750 if (!symbol_absolute(table[i])) { in record_relative_base()
755 relative_base = table[i]->addr; in record_relative_base()