Patchwork [09/62] tcg-s390: Mark R0 & R15 reserved.

login
register
mail settings
Submitter Richard Henderson
Date May 27, 2010, 8:45 p.m.
Message ID <1274993204-30766-10-git-send-email-rth@twiddle.net>
Download mbox | patch
Permalink /patch/53798/
State New
Headers show

Comments

Richard Henderson - May 27, 2010, 8:45 p.m.
Don't merely exclude them from the register allocation order.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/s390/tcg-target.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

Patch

diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c
index eb3ca38..6988937 100644
--- a/tcg/s390/tcg-target.c
+++ b/tcg/s390/tcg-target.c
@@ -124,8 +124,7 @@  static const int tcg_target_reg_alloc_order[] = {
     TCG_REG_R12,
     TCG_REG_R13,
     TCG_REG_R14,
-    /* XXX many insns can't be used with R0, so we better avoid it for now */
-    /* TCG_REG_R0 */
+    TCG_REG_R0,
     TCG_REG_R1,
     TCG_REG_R2,
     TCG_REG_R3,
@@ -1304,6 +1303,10 @@  void tcg_target_init(TCGContext *s)
     tcg_regset_set_reg(s->reserved_regs, TCG_REG_R13);
     /* another temporary */
     tcg_regset_set_reg(s->reserved_regs, TCG_REG_R12);
+    /* 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);
+    /* The stack pointer.  */
+    tcg_regset_set_reg(s->reserved_regs, TCG_REG_R15);
 
     tcg_add_target_add_op_defs(s390_op_defs);
 }