aboutsummaryrefslogtreecommitdiff
path: root/tcg
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-03-11 21:01:02 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-03-11 21:01:02 +0000
commit0954d0d9e242b4bc122eeaefb8825cc8f8eb3ab5 (patch)
treed4b52e90807872daee359220a7f1518a9eca4cbc /tcg
parentdb4a4ea4eee11c41aae835012ddd9559a055f4ce (diff)
downloadqemu-0954d0d9e242b4bc122eeaefb8825cc8f8eb3ab5.zip
qemu-0954d0d9e242b4bc122eeaefb8825cc8f8eb3ab5.tar.gz
qemu-0954d0d9e242b4bc122eeaefb8825cc8f8eb3ab5.tar.bz2
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
Diffstat (limited to 'tcg')
-rw-r--r--tcg/i386/tcg-target.c2
-rw-r--r--tcg/sparc/tcg-target.c2
-rw-r--r--tcg/tcg.c4
-rw-r--r--tcg/x86_64/tcg-target.c2
4 files changed, 5 insertions, 5 deletions
diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c
index ceacb4f..9d6aa5c 100644
--- a/tcg/i386/tcg-target.c
+++ b/tcg/i386/tcg-target.c
@@ -32,7 +32,7 @@ const char *tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"%edi",
};
-int tcg_target_reg_alloc_order[TCG_TARGET_NB_REGS] = {
+int tcg_target_reg_alloc_order[] = {
TCG_REG_EAX,
TCG_REG_EDX,
TCG_REG_ECX,
diff --git a/tcg/sparc/tcg-target.c b/tcg/sparc/tcg-target.c
index b0fc429..d00aa5a 100644
--- a/tcg/sparc/tcg-target.c
+++ b/tcg/sparc/tcg-target.c
@@ -57,7 +57,7 @@ static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"%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_L1,
TCG_REG_L2,
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 5c8aad4..15e12b6 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1212,14 +1212,14 @@ static int tcg_reg_alloc(TCGContext *s, TCGRegSet reg1, TCGRegSet reg2)
tcg_regset_andnot(reg_ct, reg1, reg2);
/* 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];
if (tcg_regset_test_reg(reg_ct, reg) && s->reg_to_temp[reg] == -1)
return reg;
}
/* 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];
if (tcg_regset_test_reg(reg_ct, reg)) {
tcg_reg_free(s, reg);
diff --git a/tcg/x86_64/tcg-target.c b/tcg/x86_64/tcg-target.c
index 681a758..8b0f472 100644
--- a/tcg/x86_64/tcg-target.c
+++ b/tcg/x86_64/tcg-target.c
@@ -40,7 +40,7 @@ const char *tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"%r15",
};
-int tcg_target_reg_alloc_order[TCG_TARGET_NB_REGS] = {
+int tcg_target_reg_alloc_order[] = {
TCG_REG_RDI,
TCG_REG_RSI,
TCG_REG_RDX,