size down insn_map structructure by reducing the size of some fields. this alone makes lib binary size 2.6MB smaller

This commit is contained in:
Nguyen Anh Quynh 2013-12-20 17:35:15 +08:00
parent 1bdb23a76d
commit 18103e4a22
2 changed files with 5 additions and 5 deletions

View File

@ -71,7 +71,7 @@ unsigned int insn_reverse_id(insn_map *insns, unsigned int max, unsigned int id)
// count number of positive members in a list.
// NOTE: list must be guaranteed to end in 0
unsigned int count_positive(unsigned int *list)
unsigned int count_positive(unsigned char *list)
{
unsigned int c;

View File

@ -18,9 +18,9 @@ typedef struct Pair {
typedef struct insn_map {
unsigned int id;
unsigned int mapid;
unsigned int regs_use[32]; // list of implicit registers used by this instruction
unsigned int regs_mod[32]; // list of implicit registers modified by this instruction
unsigned int groups[8]; // list of group this instruction belong to
unsigned char regs_use[12]; // list of implicit registers used by this instruction
unsigned char regs_mod[20]; // list of implicit registers modified by this instruction
unsigned char groups[8]; // list of group this instruction belong to
bool branch; // branch instruction?
bool indirect_branch; // indirect branch instruction?
} insn_map;
@ -48,7 +48,7 @@ unsigned int insn_reverse_id(insn_map *insns, unsigned int max, unsigned int id)
// count number of positive members in a list.
// NOTE: list must be guaranteed to end in 0
unsigned int count_positive(unsigned int *list);
unsigned int count_positive(unsigned char *list);
#define ARR_SIZE(a) (sizeof(a)/sizeof(a[0]))