Revision a42bceec
b/tcg/hppa/tcg-target.c | ||
---|---|---|
646 | 646 |
int arg1, int arg2) |
647 | 647 |
{ |
648 | 648 |
/* Store both words into the stack for copy to the FPU. */ |
649 |
tcg_out_ldst(s, arg1, TCG_REG_SP, STACK_TEMP_OFS, INSN_STW);
|
|
650 |
tcg_out_ldst(s, arg2, TCG_REG_SP, STACK_TEMP_OFS + 4, INSN_STW);
|
|
649 |
tcg_out_ldst(s, arg1, TCG_REG_CALL_STACK, STACK_TEMP_OFS, INSN_STW);
|
|
650 |
tcg_out_ldst(s, arg2, TCG_REG_CALL_STACK, STACK_TEMP_OFS + 4, INSN_STW);
|
|
651 | 651 |
|
652 | 652 |
/* Load both words into the FPU at the same time. We get away |
653 | 653 |
with this because we can address the left and right half of the |
654 | 654 |
FPU registers individually once loaded. */ |
655 | 655 |
/* fldds stack_temp(sp),fr22 */ |
656 |
tcg_out32(s, INSN_FLDDS | INSN_R2(TCG_REG_SP)
|
|
656 |
tcg_out32(s, INSN_FLDDS | INSN_R2(TCG_REG_CALL_STACK)
|
|
657 | 657 |
| INSN_IM5(STACK_TEMP_OFS) | INSN_T(22)); |
658 | 658 |
|
659 | 659 |
/* xmpyu fr22r,fr22,fr22 */ |
... | ... | |
661 | 661 |
|
662 | 662 |
/* Store the 64-bit result back into the stack. */ |
663 | 663 |
/* fstds stack_temp(sp),fr22 */ |
664 |
tcg_out32(s, INSN_FSTDS | INSN_R2(TCG_REG_SP)
|
|
664 |
tcg_out32(s, INSN_FSTDS | INSN_R2(TCG_REG_CALL_STACK)
|
|
665 | 665 |
| INSN_IM5(STACK_TEMP_OFS) | INSN_T(22)); |
666 | 666 |
|
667 | 667 |
/* Load the pieces of the result that the caller requested. */ |
668 | 668 |
if (reth) { |
669 |
tcg_out_ldst(s, reth, TCG_REG_SP, STACK_TEMP_OFS, INSN_LDW);
|
|
669 |
tcg_out_ldst(s, reth, TCG_REG_CALL_STACK, STACK_TEMP_OFS, INSN_LDW);
|
|
670 | 670 |
} |
671 | 671 |
if (retl) { |
672 |
tcg_out_ldst(s, retl, TCG_REG_SP, STACK_TEMP_OFS + 4, INSN_LDW); |
|
672 |
tcg_out_ldst(s, retl, TCG_REG_CALL_STACK, STACK_TEMP_OFS + 4, |
|
673 |
INSN_LDW); |
|
673 | 674 |
} |
674 | 675 |
} |
675 | 676 |
|
... | ... | |
1198 | 1199 |
} |
1199 | 1200 |
tcg_out_mov(s, TCG_TYPE_I32, TCG_REG_R23, datahi_reg); |
1200 | 1201 |
tcg_out_mov(s, TCG_TYPE_I32, TCG_REG_R24, datalo_reg); |
1201 |
tcg_out_st(s, TCG_TYPE_I32, argreg, TCG_REG_SP,
|
|
1202 |
tcg_out_st(s, TCG_TYPE_I32, argreg, TCG_REG_CALL_STACK,
|
|
1202 | 1203 |
TCG_TARGET_CALL_STACK_OFFSET - 4); |
1203 | 1204 |
break; |
1204 | 1205 |
default: |
... | ... | |
1616 | 1617 |
& -TCG_TARGET_STACK_ALIGN); |
1617 | 1618 |
|
1618 | 1619 |
/* The return address is stored in the caller's frame. */ |
1619 |
tcg_out_st(s, TCG_TYPE_PTR, TCG_REG_RP, TCG_REG_SP, -20);
|
|
1620 |
tcg_out_st(s, TCG_TYPE_PTR, TCG_REG_RP, TCG_REG_CALL_STACK, -20);
|
|
1620 | 1621 |
|
1621 | 1622 |
/* Allocate stack frame, saving the first register at the same time. */ |
1622 | 1623 |
tcg_out_ldst(s, tcg_target_callee_save_regs[0], |
1623 |
TCG_REG_SP, frame_size, INSN_STWM);
|
|
1624 |
TCG_REG_CALL_STACK, frame_size, INSN_STWM);
|
|
1624 | 1625 |
|
1625 | 1626 |
/* Save all callee saved registers. */ |
1626 | 1627 |
for (i = 1; i < ARRAY_SIZE(tcg_target_callee_save_regs); i++) { |
1627 | 1628 |
tcg_out_st(s, TCG_TYPE_PTR, tcg_target_callee_save_regs[i], |
1628 |
TCG_REG_SP, -frame_size + i * 4);
|
|
1629 |
TCG_REG_CALL_STACK, -frame_size + i * 4);
|
|
1629 | 1630 |
} |
1630 | 1631 |
|
1631 | 1632 |
#ifdef CONFIG_USE_GUEST_BASE |
... | ... | |
1642 | 1643 |
tcg_out_mov(s, TCG_TYPE_I32, TCG_REG_R18, TCG_REG_R31); |
1643 | 1644 |
|
1644 | 1645 |
/* Restore callee saved registers. */ |
1645 |
tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_RP, TCG_REG_SP, -frame_size - 20); |
|
1646 |
tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_RP, TCG_REG_CALL_STACK, |
|
1647 |
-frame_size - 20); |
|
1646 | 1648 |
for (i = 1; i < ARRAY_SIZE(tcg_target_callee_save_regs); i++) { |
1647 | 1649 |
tcg_out_ld(s, TCG_TYPE_PTR, tcg_target_callee_save_regs[i], |
1648 |
TCG_REG_SP, -frame_size + i * 4);
|
|
1650 |
TCG_REG_CALL_STACK, -frame_size + i * 4);
|
|
1649 | 1651 |
} |
1650 | 1652 |
|
1651 | 1653 |
/* Deallocate stack frame and return. */ |
1652 | 1654 |
tcg_out32(s, INSN_BV | INSN_R2(TCG_REG_RP)); |
1653 | 1655 |
tcg_out_ldst(s, tcg_target_callee_save_regs[0], |
1654 |
TCG_REG_SP, -frame_size, INSN_LDWM);
|
|
1656 |
TCG_REG_CALL_STACK, -frame_size, INSN_LDWM);
|
|
1655 | 1657 |
} |
1656 | 1658 |
|
1657 | 1659 |
static void tcg_target_init(TCGContext *s) |
... | ... | |
1678 | 1680 |
tcg_regset_set_reg(s->reserved_regs, TCG_REG_R19); /* clobbered w/o pic */ |
1679 | 1681 |
tcg_regset_set_reg(s->reserved_regs, TCG_REG_R20); /* reserved */ |
1680 | 1682 |
tcg_regset_set_reg(s->reserved_regs, TCG_REG_DP); /* data pointer */ |
1681 |
tcg_regset_set_reg(s->reserved_regs, TCG_REG_SP); /* stack pointer */
|
|
1683 |
tcg_regset_set_reg(s->reserved_regs, TCG_REG_CALL_STACK); /* stack pointer */
|
|
1682 | 1684 |
tcg_regset_set_reg(s->reserved_regs, TCG_REG_R31); /* ble link reg */ |
1683 | 1685 |
|
1684 | 1686 |
tcg_add_target_add_op_defs(hppa_op_defs); |
Also available in: Unified diff