diff options
author | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-05-14 19:22:05 +0000 |
---|---|---|
committer | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-05-14 19:22:05 +0000 |
commit | 7d55170268abe2fedc96a662edff52bfe68763a6 (patch) | |
tree | f5b6989581e774abeeb0d81e9ed653b4abade6e1 /tcg/sparc/tcg-target.c | |
parent | 2e56350ef10e06373b4c6aa715bb2f8b3db50f51 (diff) |
Fix compilation on Sparc host, implement ld and st
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4457 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'tcg/sparc/tcg-target.c')
-rw-r--r-- | tcg/sparc/tcg-target.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tcg/sparc/tcg-target.c b/tcg/sparc/tcg-target.c index fc58d50560..6e18f03cde 100644 --- a/tcg/sparc/tcg-target.c +++ b/tcg/sparc/tcg-target.c @@ -266,13 +266,19 @@ static inline void tcg_out_ldst(TCGContext *s, int ret, int addr, int offset, in static inline void tcg_out_ld(TCGContext *s, TCGType type, int ret, int arg1, tcg_target_long arg2) { - fprintf(stderr, "unimplemented %s\n", __func__); + if (type == TCG_TYPE_I32) + tcg_out_ldst(s, ret, arg1, arg2, LDUW); + else + tcg_out_ldst(s, ret, arg1, arg2, LDX); } static inline void tcg_out_st(TCGContext *s, TCGType type, int arg, int arg1, tcg_target_long arg2) { - fprintf(stderr, "unimplemented %s\n", __func__); + if (type == TCG_TYPE_I32) + tcg_out_ldst(s, arg, arg1, arg2, STW); + else + tcg_out_ldst(s, arg, arg1, arg2, STX); } static inline void tcg_out_arith(TCGContext *s, int rd, int rs1, int rs2, @@ -312,10 +318,14 @@ static inline void tcg_out_nop(TCGContext *s) tcg_out32(s, SETHI | INSN_RD(TCG_REG_G0) | 0); } -static inline void tcg_target_prologue(TCGContext *s) +/* Generate global QEMU prologue and epilogue code */ +void tcg_target_qemu_prologue(TCGContext *s) { tcg_out32(s, SAVE | INSN_RD(TCG_REG_O6) | INSN_RS1(TCG_REG_O6) | INSN_IMM13(-TCG_TARGET_STACK_MINFRAME)); + tcg_out32(s, JMPL | INSN_RD(TCG_REG_G0) | INSN_RS1(TCG_REG_O0) | + INSN_RS2(TCG_REG_G0)); + tcg_out_nop(s); } static inline void tcg_out_op(TCGContext *s, int opc, const TCGArg *args, |