Skip to content

Commit

Permalink
tcg: Remove tcg_regset_clear
Browse files Browse the repository at this point in the history
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
  • Loading branch information
rth7680 committed Sep 17, 2017
1 parent be0f34b commit ccb1bb6
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion tcg/aarch64/tcg-target.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1940,7 +1940,7 @@ static void tcg_target_init(TCGContext *s)
(1 << TCG_REG_X16) | (1 << TCG_REG_X17) |
(1 << TCG_REG_X18) | (1 << TCG_REG_X30));

tcg_regset_clear(s->reserved_regs);
s->reserved_regs = 0;
tcg_regset_set_reg(s->reserved_regs, TCG_REG_SP);
tcg_regset_set_reg(s->reserved_regs, TCG_REG_FP);
tcg_regset_set_reg(s->reserved_regs, TCG_REG_TMP);
Expand Down
2 changes: 1 addition & 1 deletion tcg/arm/tcg-target.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2173,7 +2173,7 @@ static void tcg_target_init(TCGContext *s)
(1 << TCG_REG_R12) |
(1 << TCG_REG_R14));

tcg_regset_clear(s->reserved_regs);
s->reserved_regs = 0;
tcg_regset_set_reg(s->reserved_regs, TCG_REG_CALL_STACK);
tcg_regset_set_reg(s->reserved_regs, TCG_REG_TMP);
tcg_regset_set_reg(s->reserved_regs, TCG_REG_PC);
Expand Down
4 changes: 2 additions & 2 deletions tcg/i386/tcg-target.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2649,7 +2649,7 @@ static void tcg_target_init(TCGContext *s)
tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I32], 0, 0xff);
}

tcg_regset_clear(tcg_target_call_clobber_regs);
tcg_target_call_clobber_regs = 0;
tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_EAX);
tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_EDX);
tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_ECX);
Expand All @@ -2664,7 +2664,7 @@ static void tcg_target_init(TCGContext *s)
tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_R11);
}

tcg_regset_clear(s->reserved_regs);
s->reserved_regs = 0;
tcg_regset_set_reg(s->reserved_regs, TCG_REG_CALL_STACK);
}

Expand Down
2 changes: 1 addition & 1 deletion tcg/mips/tcg-target.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2629,7 +2629,7 @@ static void tcg_target_init(TCGContext *s)
(1 << TCG_REG_T8) |
(1 << TCG_REG_T9));

tcg_regset_clear(s->reserved_regs);
s->reserved_regs = 0;
tcg_regset_set_reg(s->reserved_regs, TCG_REG_ZERO); /* zero register */
tcg_regset_set_reg(s->reserved_regs, TCG_REG_K0); /* kernel use only */
tcg_regset_set_reg(s->reserved_regs, TCG_REG_K1); /* kernel use only */
Expand Down
2 changes: 1 addition & 1 deletion tcg/ppc/tcg-target.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2788,7 +2788,7 @@ static void tcg_target_init(TCGContext *s)
(1 << TCG_REG_R11) |
(1 << TCG_REG_R12));

tcg_regset_clear(s->reserved_regs);
s->reserved_regs = 0;
tcg_regset_set_reg(s->reserved_regs, TCG_REG_R0); /* tcg temp */
tcg_regset_set_reg(s->reserved_regs, TCG_REG_R1); /* stack pointer */
#if defined(_CALL_SYSV)
Expand Down
8 changes: 4 additions & 4 deletions tcg/s390/tcg-target.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,12 +413,12 @@ static const char *target_parse_constraint(TCGArgConstraint *ct,
break;
case 'a': /* force R2 for division */
ct->ct |= TCG_CT_REG;
tcg_regset_clear(ct->u.regs);
ct->u.regs = 0;
tcg_regset_set_reg(ct->u.regs, TCG_REG_R2);
break;
case 'b': /* force R3 for division */
ct->ct |= TCG_CT_REG;
tcg_regset_clear(ct->u.regs);
ct->u.regs = 0;
tcg_regset_set_reg(ct->u.regs, TCG_REG_R3);
break;
case 'A':
Expand Down Expand Up @@ -2522,7 +2522,7 @@ static void tcg_target_init(TCGContext *s)
tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I32], 0, 0xffff);
tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I64], 0, 0xffff);

tcg_regset_clear(tcg_target_call_clobber_regs);
tcg_target_call_clobber_regs = 0;
tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_R0);
tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_R1);
tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_R2);
Expand All @@ -2535,7 +2535,7 @@ static void tcg_target_init(TCGContext *s)
/* The return register can be considered call-clobbered. */
tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_R14);

tcg_regset_clear(s->reserved_regs);
s->reserved_regs = 0;
tcg_regset_set_reg(s->reserved_regs, TCG_TMP0);
/* XXX many insns can't be used with R0, so we better avoid it for now */
tcg_regset_set_reg(s->reserved_regs, TCG_REG_R0);
Expand Down
2 changes: 1 addition & 1 deletion tcg/sparc/tcg-target.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1771,7 +1771,7 @@ static void tcg_target_init(TCGContext *s)
(1 << TCG_REG_O5) |
(1 << TCG_REG_O7));

tcg_regset_clear(s->reserved_regs);
s->reserved_regs = 0;
tcg_regset_set_reg(s->reserved_regs, TCG_REG_G0); /* zero */
tcg_regset_set_reg(s->reserved_regs, TCG_REG_G6); /* reserved for os */
tcg_regset_set_reg(s->reserved_regs, TCG_REG_G7); /* thread pointer */
Expand Down
5 changes: 2 additions & 3 deletions tcg/tcg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ static void process_op_defs(TCGContext *s)
/* Incomplete TCGTargetOpDef entry. */
tcg_debug_assert(ct_str != NULL);

tcg_regset_clear(def->args_ct[i].u.regs);
def->args_ct[i].u.regs = 0;
def->args_ct[i].ct = 0;
while (*ct_str != '\0') {
switch(*ct_str) {
Expand Down Expand Up @@ -2664,9 +2664,8 @@ static void tcg_reg_alloc_call(TCGContext *s, int nb_oargs, int nb_iargs,
tcg_out_mov(s, ts->type, reg, ts->reg);
}
} else {
TCGRegSet arg_set;
TCGRegSet arg_set = 0;

tcg_regset_clear(arg_set);
tcg_regset_set_reg(arg_set, reg);
temp_load(s, ts, arg_set, allocated_regs);
}
Expand Down
1 change: 0 additions & 1 deletion tcg/tcg.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ typedef enum TCGOpcode {
NB_OPS,
} TCGOpcode;

#define tcg_regset_clear(d) (d) = 0
#define tcg_regset_set(d, s) (d) = (s)
#define tcg_regset_set32(d, reg, val32) (d) |= (val32) << (reg)
#define tcg_regset_set_reg(d, r) (d) |= 1L << (r)
Expand Down
2 changes: 1 addition & 1 deletion tcg/tci/tcg-target.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ static void tcg_target_init(TCGContext *s)
tcg_regset_set32(tcg_target_call_clobber_regs, 0,
BIT(TCG_TARGET_NB_REGS) - 1);

tcg_regset_clear(s->reserved_regs);
s->reserved_regs = 0;
tcg_regset_set_reg(s->reserved_regs, TCG_REG_CALL_STACK);

/* We use negative offsets from "sp" so that we can distinguish
Expand Down

0 comments on commit ccb1bb6

Please sign in to comment.