mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
tcg-i386: Remove some ifdefs in qemu_ld/st.
Tidy some code by replacing ifdefs by C ifs. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
8516a04467
commit
82bb07db0c
1 changed files with 38 additions and 47 deletions
|
@ -842,7 +842,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args,
|
||||||
int data_reg, data_reg2 = 0;
|
int data_reg, data_reg2 = 0;
|
||||||
int addrlo_idx;
|
int addrlo_idx;
|
||||||
#if defined(CONFIG_SOFTMMU)
|
#if defined(CONFIG_SOFTMMU)
|
||||||
int mem_index, s_bits;
|
int mem_index, s_bits, arg_idx;
|
||||||
uint8_t *label_ptr[3];
|
uint8_t *label_ptr[3];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -877,12 +877,14 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX: move that code at the end of the TB */
|
/* XXX: move that code at the end of the TB */
|
||||||
#if TARGET_LONG_BITS == 32
|
/* EAX is already loaded. */
|
||||||
tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_EDX, mem_index);
|
arg_idx = 1;
|
||||||
#else
|
if (TARGET_LONG_BITS == 64) {
|
||||||
tcg_out_mov(s, TCG_REG_EDX, args[addrlo_idx + 1]);
|
tcg_out_mov(s, tcg_target_call_iarg_regs[arg_idx++],
|
||||||
tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_ECX, mem_index);
|
args[addrlo_idx + 1]);
|
||||||
#endif
|
}
|
||||||
|
tcg_out_movi(s, TCG_TYPE_I32, tcg_target_call_iarg_regs[arg_idx],
|
||||||
|
mem_index);
|
||||||
tcg_out_calli(s, (tcg_target_long)qemu_ld_helpers[s_bits]);
|
tcg_out_calli(s, (tcg_target_long)qemu_ld_helpers[s_bits]);
|
||||||
|
|
||||||
switch(opc) {
|
switch(opc) {
|
||||||
|
@ -1018,28 +1020,17 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX: move that code at the end of the TB */
|
/* XXX: move that code at the end of the TB */
|
||||||
#if TARGET_LONG_BITS == 32
|
if (TARGET_LONG_BITS == 32) {
|
||||||
if (opc == 3) {
|
|
||||||
tcg_out_mov(s, TCG_REG_EDX, data_reg);
|
tcg_out_mov(s, TCG_REG_EDX, data_reg);
|
||||||
|
if (opc == 3) {
|
||||||
tcg_out_mov(s, TCG_REG_ECX, data_reg2);
|
tcg_out_mov(s, TCG_REG_ECX, data_reg2);
|
||||||
tcg_out_pushi(s, mem_index);
|
tcg_out_pushi(s, mem_index);
|
||||||
stack_adjust = 4;
|
stack_adjust = 4;
|
||||||
} else {
|
} else {
|
||||||
switch(opc) {
|
|
||||||
case 0:
|
|
||||||
tcg_out_ext8u(s, TCG_REG_EDX, data_reg);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
tcg_out_ext16u(s, TCG_REG_EDX, data_reg);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
tcg_out_mov(s, TCG_REG_EDX, data_reg);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_ECX, mem_index);
|
tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_ECX, mem_index);
|
||||||
stack_adjust = 0;
|
stack_adjust = 0;
|
||||||
}
|
}
|
||||||
#else
|
} else {
|
||||||
if (opc == 3) {
|
if (opc == 3) {
|
||||||
tcg_out_mov(s, TCG_REG_EDX, args[addrlo_idx + 1]);
|
tcg_out_mov(s, TCG_REG_EDX, args[addrlo_idx + 1]);
|
||||||
tcg_out_pushi(s, mem_index);
|
tcg_out_pushi(s, mem_index);
|
||||||
|
@ -1062,7 +1053,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args,
|
||||||
tcg_out_pushi(s, mem_index);
|
tcg_out_pushi(s, mem_index);
|
||||||
stack_adjust = 4;
|
stack_adjust = 4;
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
tcg_out_calli(s, (tcg_target_long)qemu_st_helpers[s_bits]);
|
tcg_out_calli(s, (tcg_target_long)qemu_st_helpers[s_bits]);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue