Remove blank elements in tcg_target_reg_alloc_order[] (Stuart Brady)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4039 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
db4a4ea4ee
commit
0954d0d9e2
4
osdep.h
4
osdep.h
|
@ -26,6 +26,10 @@
|
||||||
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
|
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef ARRAY_SIZE
|
||||||
|
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef always_inline
|
#ifndef always_inline
|
||||||
#if (__GNUC__ < 3) || defined(__APPLE__)
|
#if (__GNUC__ < 3) || defined(__APPLE__)
|
||||||
#define always_inline inline
|
#define always_inline inline
|
||||||
|
|
|
@ -32,7 +32,7 @@ const char *tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
|
||||||
"%edi",
|
"%edi",
|
||||||
};
|
};
|
||||||
|
|
||||||
int tcg_target_reg_alloc_order[TCG_TARGET_NB_REGS] = {
|
int tcg_target_reg_alloc_order[] = {
|
||||||
TCG_REG_EAX,
|
TCG_REG_EAX,
|
||||||
TCG_REG_EDX,
|
TCG_REG_EDX,
|
||||||
TCG_REG_ECX,
|
TCG_REG_ECX,
|
||||||
|
|
|
@ -57,7 +57,7 @@ static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
|
||||||
"%i7",
|
"%i7",
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int tcg_target_reg_alloc_order[TCG_TARGET_NB_REGS] = {
|
static const int tcg_target_reg_alloc_order[] = {
|
||||||
TCG_REG_L0,
|
TCG_REG_L0,
|
||||||
TCG_REG_L1,
|
TCG_REG_L1,
|
||||||
TCG_REG_L2,
|
TCG_REG_L2,
|
||||||
|
|
|
@ -1212,14 +1212,14 @@ static int tcg_reg_alloc(TCGContext *s, TCGRegSet reg1, TCGRegSet reg2)
|
||||||
tcg_regset_andnot(reg_ct, reg1, reg2);
|
tcg_regset_andnot(reg_ct, reg1, reg2);
|
||||||
|
|
||||||
/* first try free registers */
|
/* first try free registers */
|
||||||
for(i = 0; i < TCG_TARGET_NB_REGS; i++) {
|
for(i = 0; i < ARRAY_SIZE(tcg_target_reg_alloc_order); i++) {
|
||||||
reg = tcg_target_reg_alloc_order[i];
|
reg = tcg_target_reg_alloc_order[i];
|
||||||
if (tcg_regset_test_reg(reg_ct, reg) && s->reg_to_temp[reg] == -1)
|
if (tcg_regset_test_reg(reg_ct, reg) && s->reg_to_temp[reg] == -1)
|
||||||
return reg;
|
return reg;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX: do better spill choice */
|
/* XXX: do better spill choice */
|
||||||
for(i = 0; i < TCG_TARGET_NB_REGS; i++) {
|
for(i = 0; i < ARRAY_SIZE(tcg_target_reg_alloc_order); i++) {
|
||||||
reg = tcg_target_reg_alloc_order[i];
|
reg = tcg_target_reg_alloc_order[i];
|
||||||
if (tcg_regset_test_reg(reg_ct, reg)) {
|
if (tcg_regset_test_reg(reg_ct, reg)) {
|
||||||
tcg_reg_free(s, reg);
|
tcg_reg_free(s, reg);
|
||||||
|
|
|
@ -40,7 +40,7 @@ const char *tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
|
||||||
"%r15",
|
"%r15",
|
||||||
};
|
};
|
||||||
|
|
||||||
int tcg_target_reg_alloc_order[TCG_TARGET_NB_REGS] = {
|
int tcg_target_reg_alloc_order[] = {
|
||||||
TCG_REG_RDI,
|
TCG_REG_RDI,
|
||||||
TCG_REG_RSI,
|
TCG_REG_RSI,
|
||||||
TCG_REG_RDX,
|
TCG_REG_RDX,
|
||||||
|
|
Loading…
Reference in New Issue