mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-28 05:50:37 +00:00
tcg/ppc: Don't hardcode register numbers
Also assure i64 alignment where necessary. Alignment code optimization suggested by malc. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
c1696d94c1
commit
d831fdb051
@ -552,7 +552,7 @@ static void tcg_out_qemu_ld (TCGContext *s, const TCGArg *args, int opc)
|
|||||||
{
|
{
|
||||||
int addr_reg, data_reg, data_reg2, r0, r1, rbase, bswap;
|
int addr_reg, data_reg, data_reg2, r0, r1, rbase, bswap;
|
||||||
#ifdef CONFIG_SOFTMMU
|
#ifdef CONFIG_SOFTMMU
|
||||||
int mem_index, s_bits, r2;
|
int mem_index, s_bits, r2, ir;
|
||||||
void *label1_ptr, *label2_ptr;
|
void *label1_ptr, *label2_ptr;
|
||||||
#if TARGET_LONG_BITS == 64
|
#if TARGET_LONG_BITS == 64
|
||||||
int addr_reg2;
|
int addr_reg2;
|
||||||
@ -614,14 +614,17 @@ static void tcg_out_qemu_ld (TCGContext *s, const TCGArg *args, int opc)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* slow path */
|
/* slow path */
|
||||||
|
ir = 3;
|
||||||
#if TARGET_LONG_BITS == 32
|
#if TARGET_LONG_BITS == 32
|
||||||
tcg_out_mov (s, TCG_TYPE_I32, 3, addr_reg);
|
tcg_out_mov (s, TCG_TYPE_I32, ir++, addr_reg);
|
||||||
tcg_out_movi (s, TCG_TYPE_I32, 4, mem_index);
|
|
||||||
#else
|
#else
|
||||||
tcg_out_mov (s, TCG_TYPE_I32, 3, addr_reg2);
|
#ifdef TCG_TARGET_CALL_ALIGN_ARGS
|
||||||
tcg_out_mov (s, TCG_TYPE_I32, 4, addr_reg);
|
ir |= 1;
|
||||||
tcg_out_movi (s, TCG_TYPE_I32, 5, mem_index);
|
|
||||||
#endif
|
#endif
|
||||||
|
tcg_out_mov (s, TCG_TYPE_I32, ir++, addr_reg2);
|
||||||
|
tcg_out_mov (s, TCG_TYPE_I32, ir++, addr_reg);
|
||||||
|
#endif
|
||||||
|
tcg_out_movi (s, TCG_TYPE_I32, ir, mem_index);
|
||||||
|
|
||||||
tcg_out_call (s, (tcg_target_long) qemu_ld_helpers[s_bits], 1);
|
tcg_out_call (s, (tcg_target_long) qemu_ld_helpers[s_bits], 1);
|
||||||
switch (opc) {
|
switch (opc) {
|
||||||
@ -810,13 +813,15 @@ static void tcg_out_qemu_st (TCGContext *s, const TCGArg *args, int opc)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* slow path */
|
/* slow path */
|
||||||
|
ir = 3;
|
||||||
#if TARGET_LONG_BITS == 32
|
#if TARGET_LONG_BITS == 32
|
||||||
tcg_out_mov (s, TCG_TYPE_I32, 3, addr_reg);
|
tcg_out_mov (s, TCG_TYPE_I32, ir++, addr_reg);
|
||||||
ir = 4;
|
|
||||||
#else
|
#else
|
||||||
tcg_out_mov (s, TCG_TYPE_I32, 3, addr_reg2);
|
#ifdef TCG_TARGET_CALL_ALIGN_ARGS
|
||||||
tcg_out_mov (s, TCG_TYPE_I32, 4, addr_reg);
|
ir |= 1;
|
||||||
ir = 5;
|
#endif
|
||||||
|
tcg_out_mov (s, TCG_TYPE_I32, ir++, addr_reg2);
|
||||||
|
tcg_out_mov (s, TCG_TYPE_I32, ir++, addr_reg);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (opc) {
|
switch (opc) {
|
||||||
@ -841,7 +846,7 @@ static void tcg_out_qemu_st (TCGContext *s, const TCGArg *args, int opc)
|
|||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
#ifdef TCG_TARGET_CALL_ALIGN_ARGS
|
#ifdef TCG_TARGET_CALL_ALIGN_ARGS
|
||||||
ir = 5;
|
ir |= 1;
|
||||||
#endif
|
#endif
|
||||||
tcg_out_mov (s, TCG_TYPE_I32, ir++, data_reg2);
|
tcg_out_mov (s, TCG_TYPE_I32, ir++, data_reg2);
|
||||||
tcg_out_mov (s, TCG_TYPE_I32, ir, data_reg);
|
tcg_out_mov (s, TCG_TYPE_I32, ir, data_reg);
|
||||||
|
Loading…
Reference in New Issue
Block a user