From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JwMYR-0004HM-Fn for qemu-devel@nongnu.org; Wed, 14 May 2008 15:22:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JwMYQ-0004Gc-Ht for qemu-devel@nongnu.org; Wed, 14 May 2008 15:22:23 -0400 Received: from [199.232.76.173] (port=46828 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JwMYQ-0004GR-DU for qemu-devel@nongnu.org; Wed, 14 May 2008 15:22:22 -0400 Received: from savannah.gnu.org ([199.232.41.3]:33316 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JwMYP-0006Mn-PD for qemu-devel@nongnu.org; Wed, 14 May 2008 15:22:21 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1JwMYK-0000Ey-2R for qemu-devel@nongnu.org; Wed, 14 May 2008 19:22:17 +0000 Received: from blueswir1 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1JwMYH-0000ES-3f for qemu-devel@nongnu.org; Wed, 14 May 2008 19:22:14 +0000 MIME-Version: 1.0 Errors-To: blueswir1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Blue Swirl Message-Id: Date: Wed, 14 May 2008 19:22:13 +0000 Subject: [Qemu-devel] [4457] Fix compilation on Sparc host, implement ld and st Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 4457 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4457 Author: blueswir1 Date: 2008-05-14 19:22:05 +0000 (Wed, 14 May 2008) Log Message: ----------- Fix compilation on Sparc host, implement ld and st Modified Paths: -------------- trunk/cpu-exec.c trunk/tcg/sparc/tcg-target.c trunk/tcg/sparc/tcg-target.h Modified: trunk/cpu-exec.c =================================================================== --- trunk/cpu-exec.c 2008-05-13 23:51:49 UTC (rev 4456) +++ trunk/cpu-exec.c 2008-05-14 19:22:05 UTC (rev 4457) @@ -53,19 +53,14 @@ // Work around ugly bugs in glibc that mangle global register contents static volatile void *saved_env; -static volatile unsigned long saved_t0, saved_i7; #undef SAVE_GLOBALS #define SAVE_GLOBALS() do { \ saved_env = env; \ - saved_t0 = T0; \ - asm volatile ("st %%i7, [%0]" : : "r" (&saved_i7)); \ } while(0) #undef RESTORE_GLOBALS #define RESTORE_GLOBALS() do { \ env = (void *)saved_env; \ - T0 = saved_t0; \ - asm volatile ("ld [%0], %%i7" : : "r" (&saved_i7)); \ } while(0) static int sparc_setjmp(jmp_buf buf) Modified: trunk/tcg/sparc/tcg-target.c =================================================================== --- trunk/tcg/sparc/tcg-target.c 2008-05-13 23:51:49 UTC (rev 4456) +++ trunk/tcg/sparc/tcg-target.c 2008-05-14 19:22:05 UTC (rev 4457) @@ -266,13 +266,19 @@ 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 @@ 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, Modified: trunk/tcg/sparc/tcg-target.h =================================================================== --- trunk/tcg/sparc/tcg-target.h 2008-05-13 23:51:49 UTC (rev 4456) +++ trunk/tcg/sparc/tcg-target.h 2008-05-14 19:22:05 UTC (rev 4457) @@ -84,8 +84,9 @@ /* optional instructions */ //#define TCG_TARGET_HAS_bswap_i32 //#define TCG_TARGET_HAS_bswap_i64 +//#define TCG_TARGET_HAS_neg_i32 +//#define TCG_TARGET_HAS_neg_i64 -#define TCG_TARGET_NEEDS_PROLOGUE 1 /* Note: must be synced with dyngen-exec.h */ #ifdef HOST_SOLARIS