Commit f843e5282a67aeaafd6309e9ce6b633e13e6744c

Authored by blueswir1
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
tcg/sparc/tcg-target.c
... ... @@ -578,9 +578,11 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args,
578 578 global registers */
579 579 // delay slot
580 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 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 587 /* data_reg = sign_extend(arg0) */
586 588 switch(opc) {
... ... @@ -781,9 +783,11 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args,
781 783 global registers */
782 784 // delay slot
783 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 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 792 /* will become:
789 793 ba label2 */
... ... @@ -905,9 +909,11 @@ static inline void tcg_out_op(TCGContext *s, int opc, const TCGArg *args,
905 909 global registers */
906 910 // delay slot
907 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 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 917 break;
912 918 case INDEX_op_jmp:
913 919 case INDEX_op_br:
... ...
tcg/sparc/tcg-target.h
... ... @@ -75,12 +75,14 @@ enum {
75 75 #define TCG_REG_CALL_STACK TCG_REG_I6
76 76 #ifdef __arch64__
77 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 81 #define TCG_TARGET_STACK_ALIGN 16
81 82 #else
82 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 86 #define TCG_TARGET_CALL_STACK_OFFSET TCG_TARGET_STACK_MINFRAME
85 87 #define TCG_TARGET_STACK_ALIGN 8
86 88 #endif
... ...