Commit f843e5282a67aeaafd6309e9ce6b633e13e6744c
1 parent
762e8230
Allocate space for static call args, increase stack frame size on Sparc64
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6973 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
17 additions
and
9 deletions
tcg/sparc/tcg-target.c
@@ -578,9 +578,11 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, | @@ -578,9 +578,11 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, | ||
578 | global registers */ | 578 | global registers */ |
579 | // delay slot | 579 | // delay slot |
580 | tcg_out_ldst(s, TCG_AREG0, TCG_REG_CALL_STACK, | 580 | tcg_out_ldst(s, TCG_AREG0, TCG_REG_CALL_STACK, |
581 | - TCG_TARGET_CALL_STACK_OFFSET - sizeof(long), HOST_ST_OP); | 581 | + TCG_TARGET_CALL_STACK_OFFSET - TCG_STATIC_CALL_ARGS_SIZE - |
582 | + sizeof(long), HOST_ST_OP); | ||
582 | tcg_out_ldst(s, TCG_AREG0, TCG_REG_CALL_STACK, | 583 | tcg_out_ldst(s, TCG_AREG0, TCG_REG_CALL_STACK, |
583 | - TCG_TARGET_CALL_STACK_OFFSET - sizeof(long), HOST_LD_OP); | 584 | + TCG_TARGET_CALL_STACK_OFFSET - TCG_STATIC_CALL_ARGS_SIZE - |
585 | + sizeof(long), HOST_LD_OP); | ||
584 | 586 | ||
585 | /* data_reg = sign_extend(arg0) */ | 587 | /* data_reg = sign_extend(arg0) */ |
586 | switch(opc) { | 588 | switch(opc) { |
@@ -781,9 +783,11 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, | @@ -781,9 +783,11 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, | ||
781 | global registers */ | 783 | global registers */ |
782 | // delay slot | 784 | // delay slot |
783 | tcg_out_ldst(s, TCG_AREG0, TCG_REG_CALL_STACK, | 785 | tcg_out_ldst(s, TCG_AREG0, TCG_REG_CALL_STACK, |
784 | - TCG_TARGET_CALL_STACK_OFFSET - sizeof(long), HOST_ST_OP); | 786 | + TCG_TARGET_CALL_STACK_OFFSET - TCG_STATIC_CALL_ARGS_SIZE - |
787 | + sizeof(long), HOST_ST_OP); | ||
785 | tcg_out_ldst(s, TCG_AREG0, TCG_REG_CALL_STACK, | 788 | tcg_out_ldst(s, TCG_AREG0, TCG_REG_CALL_STACK, |
786 | - TCG_TARGET_CALL_STACK_OFFSET - sizeof(long), HOST_LD_OP); | 789 | + TCG_TARGET_CALL_STACK_OFFSET - TCG_STATIC_CALL_ARGS_SIZE - |
790 | + sizeof(long), HOST_LD_OP); | ||
787 | 791 | ||
788 | /* will become: | 792 | /* will become: |
789 | ba label2 */ | 793 | ba label2 */ |
@@ -905,9 +909,11 @@ static inline void tcg_out_op(TCGContext *s, int opc, const TCGArg *args, | @@ -905,9 +909,11 @@ static inline void tcg_out_op(TCGContext *s, int opc, const TCGArg *args, | ||
905 | global registers */ | 909 | global registers */ |
906 | // delay slot | 910 | // delay slot |
907 | tcg_out_ldst(s, TCG_AREG0, TCG_REG_CALL_STACK, | 911 | tcg_out_ldst(s, TCG_AREG0, TCG_REG_CALL_STACK, |
908 | - TCG_TARGET_CALL_STACK_OFFSET - sizeof(long), HOST_ST_OP); | 912 | + TCG_TARGET_CALL_STACK_OFFSET - TCG_STATIC_CALL_ARGS_SIZE - |
913 | + sizeof(long), HOST_ST_OP); | ||
909 | tcg_out_ldst(s, TCG_AREG0, TCG_REG_CALL_STACK, | 914 | tcg_out_ldst(s, TCG_AREG0, TCG_REG_CALL_STACK, |
910 | - TCG_TARGET_CALL_STACK_OFFSET - sizeof(long), HOST_LD_OP); | 915 | + TCG_TARGET_CALL_STACK_OFFSET - TCG_STATIC_CALL_ARGS_SIZE - |
916 | + sizeof(long), HOST_LD_OP); | ||
911 | break; | 917 | break; |
912 | case INDEX_op_jmp: | 918 | case INDEX_op_jmp: |
913 | case INDEX_op_br: | 919 | case INDEX_op_br: |
tcg/sparc/tcg-target.h
@@ -75,12 +75,14 @@ enum { | @@ -75,12 +75,14 @@ enum { | ||
75 | #define TCG_REG_CALL_STACK TCG_REG_I6 | 75 | #define TCG_REG_CALL_STACK TCG_REG_I6 |
76 | #ifdef __arch64__ | 76 | #ifdef __arch64__ |
77 | // Reserve space for AREG0 | 77 | // Reserve space for AREG0 |
78 | -#define TCG_TARGET_STACK_MINFRAME (176 + 2 * (int)sizeof(long)) | ||
79 | -#define TCG_TARGET_CALL_STACK_OFFSET (2047 + TCG_TARGET_STACK_MINFRAME) | 78 | +#define TCG_TARGET_STACK_MINFRAME (176 + 4 * (int)sizeof(long) + \ |
79 | + TCG_STATIC_CALL_ARGS_SIZE) | ||
80 | +#define TCG_TARGET_CALL_STACK_OFFSET (2047 - 16) | ||
80 | #define TCG_TARGET_STACK_ALIGN 16 | 81 | #define TCG_TARGET_STACK_ALIGN 16 |
81 | #else | 82 | #else |
82 | // AREG0 + one word for alignment | 83 | // AREG0 + one word for alignment |
83 | -#define TCG_TARGET_STACK_MINFRAME (92 + (2 + 1) * (int)sizeof(long)) | 84 | +#define TCG_TARGET_STACK_MINFRAME (92 + (2 + 1) * (int)sizeof(long) + \ |
85 | + TCG_STATIC_CALL_ARGS_SIZE) | ||
84 | #define TCG_TARGET_CALL_STACK_OFFSET TCG_TARGET_STACK_MINFRAME | 86 | #define TCG_TARGET_CALL_STACK_OFFSET TCG_TARGET_STACK_MINFRAME |
85 | #define TCG_TARGET_STACK_ALIGN 8 | 87 | #define TCG_TARGET_STACK_ALIGN 8 |
86 | #endif | 88 | #endif |