x86-asm: move stats code
The old place (tccasm.c) didn't have access to the variables anymore and was ifdefed out. Move it to i386-asm.c.
This commit is contained in:
32
tccasm.c
32
tccasm.c
@ -757,38 +757,6 @@ static int tcc_assemble_internal(TCCState *s1, int do_preprocess)
|
||||
{
|
||||
int opcode;
|
||||
|
||||
#if 0
|
||||
/* print stats about opcodes */
|
||||
{
|
||||
const ASMInstr *pa;
|
||||
int freq[4];
|
||||
int op_vals[500];
|
||||
int nb_op_vals, i, j;
|
||||
|
||||
nb_op_vals = 0;
|
||||
memset(freq, 0, sizeof(freq));
|
||||
for(pa = asm_instrs; pa->sym != 0; pa++) {
|
||||
freq[pa->nb_ops]++;
|
||||
for(i=0;i<pa->nb_ops;i++) {
|
||||
for(j=0;j<nb_op_vals;j++) {
|
||||
if (pa->op_type[i] == op_vals[j])
|
||||
goto found;
|
||||
}
|
||||
op_vals[nb_op_vals++] = pa->op_type[i];
|
||||
found: ;
|
||||
}
|
||||
}
|
||||
for(i=0;i<nb_op_vals;i++) {
|
||||
int v = op_vals[i];
|
||||
if ((v & (v - 1)) != 0)
|
||||
printf("%3d: %08x\n", i, v);
|
||||
}
|
||||
printf("size=%d nb=%d f0=%d f1=%d f2=%d f3=%d\n",
|
||||
sizeof(asm_instrs), sizeof(asm_instrs) / sizeof(ASMInstr),
|
||||
freq[0], freq[1], freq[2], freq[3]);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* XXX: undefine C labels */
|
||||
|
||||
ch = file->buf_ptr[0];
|
||||
|
||||
Reference in New Issue
Block a user