qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 14/18] TCG/PPC: use TCG_REG_CALL_STACK instead of TCG_REG_R1
@ 2011-05-28 10:08 Blue Swirl
  0 siblings, 0 replies; 4+ messages in thread
From: Blue Swirl @ 2011-05-28 10:08 UTC (permalink / raw)
  To: qemu-devel, malc

Use TCG_REG_CALL_STACK instead of TCG_REG_R1 etc. for consistency.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 tcg/ppc/tcg-target.c   |   17 ++++++++++-------
 tcg/ppc64/tcg-target.c |   16 +++++++++-------
 2 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c
index dde4e18..729061f 100644
--- a/tcg/ppc/tcg-target.c
+++ b/tcg/ppc/tcg-target.c
@@ -921,15 +921,16 @@ static void tcg_target_qemu_prologue (TCGContext *s)
     }
 #endif
     tcg_out32 (s, MFSPR | RT (0) | LR);
-    tcg_out32 (s, STWU | RS (1) | RA (1) | (-frame_size & 0xffff));
+    tcg_out32 (s, STWU | RS (REG_CALL_STACK) | RA (REG_CALL_STACK)
+               | (-frame_size & 0xffff));
     for (i = 0; i < ARRAY_SIZE (tcg_target_callee_save_regs); ++i)
         tcg_out32 (s, (STW
                        | RS (tcg_target_callee_save_regs[i])
-                       | RA (1)
+                       | RA (REG_CALL_STACK)
                        | (i * 4 + LINKAGE_AREA_SIZE +
TCG_STATIC_CALL_ARGS_SIZE)
                        )
             );
-    tcg_out32 (s, STW | RS (0) | RA (1) | (frame_size + LR_OFFSET));
+    tcg_out32 (s, STW | RS (0) | RA (REG_CALL_STACK) | (frame_size +
LR_OFFSET));

 #ifdef CONFIG_USE_GUEST_BASE
     if (GUEST_BASE) {
@@ -946,13 +947,15 @@ static void tcg_target_qemu_prologue (TCGContext *s)
     for (i = 0; i < ARRAY_SIZE (tcg_target_callee_save_regs); ++i)
         tcg_out32 (s, (LWZ
                        | RT (tcg_target_callee_save_regs[i])
-                       | RA (1)
+                       | RA (REG_CALL_STACK)
                        | (i * 4 + LINKAGE_AREA_SIZE +
TCG_STATIC_CALL_ARGS_SIZE)
                        )
             );
-    tcg_out32 (s, LWZ | RT (0) | RA (1) | (frame_size + LR_OFFSET));
+    tcg_out32 (s, LWZ | RT (0) | RA (REG_CALL_STACK)
+               | (frame_size + LR_OFFSET));
     tcg_out32 (s, MTSPR | RS (0) | LR);
-    tcg_out32 (s, ADDI | RT (1) | RA (1) | frame_size);
+    tcg_out32 (s, ADDI | RT (REG_CALL_STACK) | RA (REG_CALL_STACK)
+               | frame_size);
     tcg_out32 (s, BCLR | BO_ALWAYS);
 }

@@ -1910,7 +1913,7 @@ static void tcg_target_init(TCGContext *s)

     tcg_regset_clear(s->reserved_regs);
     tcg_regset_set_reg(s->reserved_regs, TCG_REG_R0);
-    tcg_regset_set_reg(s->reserved_regs, TCG_REG_R1);
+    tcg_regset_set_reg(s->reserved_regs, TCG_REG_CALL_STACK);
 #ifndef _CALL_DARWIN
     tcg_regset_set_reg(s->reserved_regs, TCG_REG_R2);
 #endif
diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c
index 3218438..d48cf7e 100644
--- a/tcg/ppc64/tcg-target.c
+++ b/tcg/ppc64/tcg-target.c
@@ -887,15 +887,16 @@ static void tcg_target_qemu_prologue (TCGContext *s)

     /* Prologue */
     tcg_out32 (s, MFSPR | RT (0) | LR);
-    tcg_out32 (s, STDU | RS (1) | RA (1) | (-frame_size & 0xffff));
+    tcg_out32 (s, STDU | RS (REG_CALL_STACK) | RA (REG_CALL_STACK)
+               | (-frame_size & 0xffff));
     for (i = 0; i < ARRAY_SIZE (tcg_target_callee_save_regs); ++i)
         tcg_out32 (s, (STD
                        | RS (tcg_target_callee_save_regs[i])
-                       | RA (1)
+                       | RA (REG_CALL_STACK)
                        | (i * 8 + 48 + TCG_STATIC_CALL_ARGS_SIZE)
                        )
             );
-    tcg_out32 (s, STD | RS (0) | RA (1) | (frame_size + 16));
+    tcg_out32 (s, STD | RS (0) | RA (REG_CALL_STACK) | (frame_size + 16));

 #ifdef CONFIG_USE_GUEST_BASE
     if (GUEST_BASE) {
@@ -914,13 +915,14 @@ static void tcg_target_qemu_prologue (TCGContext *s)
     for (i = 0; i < ARRAY_SIZE (tcg_target_callee_save_regs); ++i)
         tcg_out32 (s, (LD
                        | RT (tcg_target_callee_save_regs[i])
-                       | RA (1)
+                       | RA (REG_CALL_STACK)
                        | (i * 8 + 48 + TCG_STATIC_CALL_ARGS_SIZE)
                        )
             );
-    tcg_out32 (s, LD | RT (0) | RA (1) | (frame_size + 16));
+    tcg_out32 (s, LD | RT (0) | RA (REG_CALL_STACK) | (frame_size + 16));
     tcg_out32 (s, MTSPR | RS (0) | LR);
-    tcg_out32 (s, ADDI | RT (1) | RA (1) | frame_size);
+    tcg_out32 (s, ADDI | RT (REG_CALL_STACK) | RA (REG_CALL_STACK)
+               | frame_size);
     tcg_out32 (s, BCLR | BO_ALWAYS);
 }

@@ -1689,7 +1691,7 @@ static void tcg_target_init (TCGContext *s)

     tcg_regset_clear (s->reserved_regs);
     tcg_regset_set_reg (s->reserved_regs, TCG_REG_R0);
-    tcg_regset_set_reg (s->reserved_regs, TCG_REG_R1);
+    tcg_regset_set_reg (s->reserved_regs, TCG_REG_CALL_STACK);
 #ifndef __APPLE__
     tcg_regset_set_reg (s->reserved_regs, TCG_REG_R2);
 #endif
-- 
1.6.2.4

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

* [Qemu-devel] [PATCH 14/18] TCG/PPC: use TCG_REG_CALL_STACK instead of TCG_REG_R1
@ 2011-06-19 21:06 Blue Swirl
  2011-06-19 22:14 ` malc
  0 siblings, 1 reply; 4+ messages in thread
From: Blue Swirl @ 2011-06-19 21:06 UTC (permalink / raw)
  To: qemu-devel

Use TCG_REG_CALL_STACK instead of TCG_REG_R1 etc. for consistency.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 tcg/ppc/tcg-target.c   |   17 ++++++++++-------
 tcg/ppc64/tcg-target.c |   16 +++++++++-------
 2 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c
index dde4e18..729061f 100644
--- a/tcg/ppc/tcg-target.c
+++ b/tcg/ppc/tcg-target.c
@@ -921,15 +921,16 @@ static void tcg_target_qemu_prologue (TCGContext *s)
     }
 #endif
     tcg_out32 (s, MFSPR | RT (0) | LR);
-    tcg_out32 (s, STWU | RS (1) | RA (1) | (-frame_size & 0xffff));
+    tcg_out32 (s, STWU | RS (REG_CALL_STACK) | RA (REG_CALL_STACK)
+               | (-frame_size & 0xffff));
     for (i = 0; i < ARRAY_SIZE (tcg_target_callee_save_regs); ++i)
         tcg_out32 (s, (STW
                        | RS (tcg_target_callee_save_regs[i])
-                       | RA (1)
+                       | RA (REG_CALL_STACK)
                        | (i * 4 + LINKAGE_AREA_SIZE +
TCG_STATIC_CALL_ARGS_SIZE)
                        )
             );
-    tcg_out32 (s, STW | RS (0) | RA (1) | (frame_size + LR_OFFSET));
+    tcg_out32 (s, STW | RS (0) | RA (REG_CALL_STACK) | (frame_size +
LR_OFFSET));

 #ifdef CONFIG_USE_GUEST_BASE
     if (GUEST_BASE) {
@@ -946,13 +947,15 @@ static void tcg_target_qemu_prologue (TCGContext *s)
     for (i = 0; i < ARRAY_SIZE (tcg_target_callee_save_regs); ++i)
         tcg_out32 (s, (LWZ
                        | RT (tcg_target_callee_save_regs[i])
-                       | RA (1)
+                       | RA (REG_CALL_STACK)
                        | (i * 4 + LINKAGE_AREA_SIZE +
TCG_STATIC_CALL_ARGS_SIZE)
                        )
             );
-    tcg_out32 (s, LWZ | RT (0) | RA (1) | (frame_size + LR_OFFSET));
+    tcg_out32 (s, LWZ | RT (0) | RA (REG_CALL_STACK)
+               | (frame_size + LR_OFFSET));
     tcg_out32 (s, MTSPR | RS (0) | LR);
-    tcg_out32 (s, ADDI | RT (1) | RA (1) | frame_size);
+    tcg_out32 (s, ADDI | RT (REG_CALL_STACK) | RA (REG_CALL_STACK)
+               | frame_size);
     tcg_out32 (s, BCLR | BO_ALWAYS);
 }

@@ -1910,7 +1913,7 @@ static void tcg_target_init(TCGContext *s)

     tcg_regset_clear(s->reserved_regs);
     tcg_regset_set_reg(s->reserved_regs, TCG_REG_R0);
-    tcg_regset_set_reg(s->reserved_regs, TCG_REG_R1);
+    tcg_regset_set_reg(s->reserved_regs, TCG_REG_CALL_STACK);
 #ifndef _CALL_DARWIN
     tcg_regset_set_reg(s->reserved_regs, TCG_REG_R2);
 #endif
diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c
index 3218438..d48cf7e 100644
--- a/tcg/ppc64/tcg-target.c
+++ b/tcg/ppc64/tcg-target.c
@@ -887,15 +887,16 @@ static void tcg_target_qemu_prologue (TCGContext *s)

     /* Prologue */
     tcg_out32 (s, MFSPR | RT (0) | LR);
-    tcg_out32 (s, STDU | RS (1) | RA (1) | (-frame_size & 0xffff));
+    tcg_out32 (s, STDU | RS (REG_CALL_STACK) | RA (REG_CALL_STACK)
+               | (-frame_size & 0xffff));
     for (i = 0; i < ARRAY_SIZE (tcg_target_callee_save_regs); ++i)
         tcg_out32 (s, (STD
                        | RS (tcg_target_callee_save_regs[i])
-                       | RA (1)
+                       | RA (REG_CALL_STACK)
                        | (i * 8 + 48 + TCG_STATIC_CALL_ARGS_SIZE)
                        )
             );
-    tcg_out32 (s, STD | RS (0) | RA (1) | (frame_size + 16));
+    tcg_out32 (s, STD | RS (0) | RA (REG_CALL_STACK) | (frame_size + 16));

 #ifdef CONFIG_USE_GUEST_BASE
     if (GUEST_BASE) {
@@ -914,13 +915,14 @@ static void tcg_target_qemu_prologue (TCGContext *s)
     for (i = 0; i < ARRAY_SIZE (tcg_target_callee_save_regs); ++i)
         tcg_out32 (s, (LD
                        | RT (tcg_target_callee_save_regs[i])
-                       | RA (1)
+                       | RA (REG_CALL_STACK)
                        | (i * 8 + 48 + TCG_STATIC_CALL_ARGS_SIZE)
                        )
             );
-    tcg_out32 (s, LD | RT (0) | RA (1) | (frame_size + 16));
+    tcg_out32 (s, LD | RT (0) | RA (REG_CALL_STACK) | (frame_size + 16));
     tcg_out32 (s, MTSPR | RS (0) | LR);
-    tcg_out32 (s, ADDI | RT (1) | RA (1) | frame_size);
+    tcg_out32 (s, ADDI | RT (REG_CALL_STACK) | RA (REG_CALL_STACK)
+               | frame_size);
     tcg_out32 (s, BCLR | BO_ALWAYS);
 }

@@ -1689,7 +1691,7 @@ static void tcg_target_init (TCGContext *s)

     tcg_regset_clear (s->reserved_regs);
     tcg_regset_set_reg (s->reserved_regs, TCG_REG_R0);
-    tcg_regset_set_reg (s->reserved_regs, TCG_REG_R1);
+    tcg_regset_set_reg (s->reserved_regs, TCG_REG_CALL_STACK);
 #ifndef __APPLE__
     tcg_regset_set_reg (s->reserved_regs, TCG_REG_R2);
 #endif
-- 
1.6.2.4

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

* Re: [Qemu-devel] [PATCH 14/18] TCG/PPC: use TCG_REG_CALL_STACK instead of TCG_REG_R1
  2011-06-19 21:06 Blue Swirl
@ 2011-06-19 22:14 ` malc
  2011-06-20 21:23   ` Blue Swirl
  0 siblings, 1 reply; 4+ messages in thread
From: malc @ 2011-06-19 22:14 UTC (permalink / raw)
  To: Blue Swirl; +Cc: qemu-devel

On Mon, 20 Jun 2011, Blue Swirl wrote:

> Use TCG_REG_CALL_STACK instead of TCG_REG_R1 etc. for consistency.

You spell it TCG_REG_CALL_STACK in the subject/comment but 
REG_CALL_STACK in the patch, which suggest that it was never
even compile tested.

[..snip..]

-- 
mailto:av1474@comtv.ru

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

* Re: [Qemu-devel] [PATCH 14/18] TCG/PPC: use TCG_REG_CALL_STACK instead of TCG_REG_R1
  2011-06-19 22:14 ` malc
@ 2011-06-20 21:23   ` Blue Swirl
  0 siblings, 0 replies; 4+ messages in thread
From: Blue Swirl @ 2011-06-20 21:23 UTC (permalink / raw)
  To: malc; +Cc: qemu-devel

On Mon, Jun 20, 2011 at 1:14 AM, malc <av1474@comtv.ru> wrote:
> On Mon, 20 Jun 2011, Blue Swirl wrote:
>
>> Use TCG_REG_CALL_STACK instead of TCG_REG_R1 etc. for consistency.
>
> You spell it TCG_REG_CALL_STACK in the subject/comment but
> REG_CALL_STACK in the patch, which suggest that it was never
> even compile tested.

Actually I seem to have used both versions. I didn't compile test, but
to make matters even worse, I didn't even read any reference manuals
or ABI descriptions for any of these patches but based all this on
bits gathered from */tcg-target.[ch]. But is the patch otherwise OK?
;-)

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

end of thread, other threads:[~2011-06-20 21:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-28 10:08 [Qemu-devel] [PATCH 14/18] TCG/PPC: use TCG_REG_CALL_STACK instead of TCG_REG_R1 Blue Swirl
  -- strict thread matches above, loose matches on Subject: below --
2011-06-19 21:06 Blue Swirl
2011-06-19 22:14 ` malc
2011-06-20 21:23   ` 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).