qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 01/12] TCG/HPPA: use TCG_REG_CALL_STACK instead of TCG_REG_SP
@ 2011-06-26 19:20 Blue Swirl
  2011-06-26 21:02 ` Richard Henderson
  0 siblings, 1 reply; 3+ messages in thread
From: Blue Swirl @ 2011-06-26 19:20 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson

Use TCG_REG_CALL_STACK instead of TCG_REG_SP for consistency.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 tcg/hppa/tcg-target.c |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/tcg/hppa/tcg-target.c b/tcg/hppa/tcg-target.c
index 79bca63..bd40954 100644
--- a/tcg/hppa/tcg-target.c
+++ b/tcg/hppa/tcg-target.c
@@ -646,14 +646,14 @@ static void tcg_out_xmpyu(TCGContext *s, int
retl, int reth,
                           int arg1, int arg2)
 {
     /* Store both words into the stack for copy to the FPU.  */
-    tcg_out_ldst(s, arg1, TCG_REG_SP, STACK_TEMP_OFS, INSN_STW);
-    tcg_out_ldst(s, arg2, TCG_REG_SP, STACK_TEMP_OFS + 4, INSN_STW);
+    tcg_out_ldst(s, arg1, TCG_REG_CALL_STACK, STACK_TEMP_OFS, INSN_STW);
+    tcg_out_ldst(s, arg2, TCG_REG_CALL_STACK, STACK_TEMP_OFS + 4, INSN_STW);

     /* Load both words into the FPU at the same time.  We get away
        with this because we can address the left and right half of the
        FPU registers individually once loaded.  */
     /* fldds stack_temp(sp),fr22 */
-    tcg_out32(s, INSN_FLDDS | INSN_R2(TCG_REG_SP)
+    tcg_out32(s, INSN_FLDDS | INSN_R2(TCG_REG_CALL_STACK)
               | INSN_IM5(STACK_TEMP_OFS) | INSN_T(22));

     /* xmpyu fr22r,fr22,fr22 */
@@ -661,15 +661,16 @@ static void tcg_out_xmpyu(TCGContext *s, int
retl, int reth,

     /* Store the 64-bit result back into the stack.  */
     /* fstds stack_temp(sp),fr22 */
-    tcg_out32(s, INSN_FSTDS | INSN_R2(TCG_REG_SP)
+    tcg_out32(s, INSN_FSTDS | INSN_R2(TCG_REG_CALL_STACK)
               | INSN_IM5(STACK_TEMP_OFS) | INSN_T(22));

     /* Load the pieces of the result that the caller requested.  */
     if (reth) {
-        tcg_out_ldst(s, reth, TCG_REG_SP, STACK_TEMP_OFS, INSN_LDW);
+        tcg_out_ldst(s, reth, TCG_REG_CALL_STACK, STACK_TEMP_OFS, INSN_LDW);
     }
     if (retl) {
-        tcg_out_ldst(s, retl, TCG_REG_SP, STACK_TEMP_OFS + 4, INSN_LDW);
+        tcg_out_ldst(s, retl, TCG_REG_CALL_STACK, STACK_TEMP_OFS + 4,
+                     INSN_LDW);
     }
 }

@@ -1198,7 +1199,7 @@ static void tcg_out_qemu_st(TCGContext *s, const
TCGArg *args, int opc)
         }
         tcg_out_mov(s, TCG_TYPE_I32, TCG_REG_R23, datahi_reg);
         tcg_out_mov(s, TCG_TYPE_I32, TCG_REG_R24, datalo_reg);
-        tcg_out_st(s, TCG_TYPE_I32, argreg, TCG_REG_SP,
+        tcg_out_st(s, TCG_TYPE_I32, argreg, TCG_REG_CALL_STACK,
                    TCG_TARGET_CALL_STACK_OFFSET - 4);
         break;
     default:
@@ -1616,16 +1617,16 @@ static void tcg_target_qemu_prologue(TCGContext *s)
                   & -TCG_TARGET_STACK_ALIGN);

     /* The return address is stored in the caller's frame.  */
-    tcg_out_st(s, TCG_TYPE_PTR, TCG_REG_RP, TCG_REG_SP, -20);
+    tcg_out_st(s, TCG_TYPE_PTR, TCG_REG_RP, TCG_REG_CALL_STACK, -20);

     /* Allocate stack frame, saving the first register at the same time.  */
     tcg_out_ldst(s, tcg_target_callee_save_regs[0],
-                 TCG_REG_SP, frame_size, INSN_STWM);
+                 TCG_REG_CALL_STACK, frame_size, INSN_STWM);

     /* Save all callee saved registers.  */
     for (i = 1; i < ARRAY_SIZE(tcg_target_callee_save_regs); i++) {
         tcg_out_st(s, TCG_TYPE_PTR, tcg_target_callee_save_regs[i],
-                   TCG_REG_SP, -frame_size + i * 4);
+                   TCG_REG_CALL_STACK, -frame_size + i * 4);
     }

 #ifdef CONFIG_USE_GUEST_BASE
@@ -1642,16 +1643,17 @@ static void tcg_target_qemu_prologue(TCGContext *s)
     tcg_out_mov(s, TCG_TYPE_I32, TCG_REG_R18, TCG_REG_R31);

     /* Restore callee saved registers.  */
-    tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_RP, TCG_REG_SP, -frame_size - 20);
+    tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_RP, TCG_REG_CALL_STACK,
+               -frame_size - 20);
     for (i = 1; i < ARRAY_SIZE(tcg_target_callee_save_regs); i++) {
         tcg_out_ld(s, TCG_TYPE_PTR, tcg_target_callee_save_regs[i],
-                   TCG_REG_SP, -frame_size + i * 4);
+                   TCG_REG_CALL_STACK, -frame_size + i * 4);
     }

     /* Deallocate stack frame and return.  */
     tcg_out32(s, INSN_BV | INSN_R2(TCG_REG_RP));
     tcg_out_ldst(s, tcg_target_callee_save_regs[0],
-                 TCG_REG_SP, -frame_size, INSN_LDWM);
+                 TCG_REG_CALL_STACK, -frame_size, INSN_LDWM);
 }

 static void tcg_target_init(TCGContext *s)
@@ -1678,7 +1680,7 @@ static void tcg_target_init(TCGContext *s)
     tcg_regset_set_reg(s->reserved_regs, TCG_REG_R19); /* clobbered w/o pic */
     tcg_regset_set_reg(s->reserved_regs, TCG_REG_R20); /* reserved */
     tcg_regset_set_reg(s->reserved_regs, TCG_REG_DP);  /* data pointer */
-    tcg_regset_set_reg(s->reserved_regs, TCG_REG_SP);  /* stack pointer */
+    tcg_regset_set_reg(s->reserved_regs, TCG_REG_CALL_STACK);  /*
stack pointer */
     tcg_regset_set_reg(s->reserved_regs, TCG_REG_R31); /* ble link reg */

     tcg_add_target_add_op_defs(hppa_op_defs);
-- 
1.6.2.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH 01/12] TCG/HPPA: use TCG_REG_CALL_STACK instead of TCG_REG_SP
  2011-06-26 19:20 [Qemu-devel] [PATCH 01/12] TCG/HPPA: use TCG_REG_CALL_STACK instead of TCG_REG_SP Blue Swirl
@ 2011-06-26 21:02 ` Richard Henderson
  2011-07-01 21:11   ` Blue Swirl
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Henderson @ 2011-06-26 21:02 UTC (permalink / raw)
  To: Blue Swirl; +Cc: qemu-devel

On 06/26/2011 12:20 PM, Blue Swirl wrote:
> Use TCG_REG_CALL_STACK instead of TCG_REG_SP for consistency.
> 
> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

Acked-by: Richard Henderson <rth@twiddle.net>


r~

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH 01/12] TCG/HPPA: use TCG_REG_CALL_STACK instead of TCG_REG_SP
  2011-06-26 21:02 ` Richard Henderson
@ 2011-07-01 21:11   ` Blue Swirl
  0 siblings, 0 replies; 3+ messages in thread
From: Blue Swirl @ 2011-07-01 21:11 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-devel

On Mon, Jun 27, 2011 at 12:02 AM, Richard Henderson <rth@twiddle.net> wrote:
> On 06/26/2011 12:20 PM, Blue Swirl wrote:
>> Use TCG_REG_CALL_STACK instead of TCG_REG_SP for consistency.
>>
>> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
>
> Acked-by: Richard Henderson <rth@twiddle.net>

Thanks for the Ack, applied both patches.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-01 21:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-26 19:20 [Qemu-devel] [PATCH 01/12] TCG/HPPA: use TCG_REG_CALL_STACK instead of TCG_REG_SP Blue Swirl
2011-06-26 21:02 ` Richard Henderson
2011-07-01 21:11   ` Blue Swirl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).