From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KUodo-0001x9-9y for qemu-devel@nongnu.org; Sun, 17 Aug 2008 16:14:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KUodn-0001ww-Bz for qemu-devel@nongnu.org; Sun, 17 Aug 2008 16:14:19 -0400 Received: from [199.232.76.173] (port=56824 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KUodn-0001wt-5X for qemu-devel@nongnu.org; Sun, 17 Aug 2008 16:14:19 -0400 Received: from savannah.gnu.org ([199.232.41.3]:35450 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 1KUodm-0008R8-PS for qemu-devel@nongnu.org; Sun, 17 Aug 2008 16:14:18 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KUodl-0003S5-NC for qemu-devel@nongnu.org; Sun, 17 Aug 2008 20:14:17 +0000 Received: from blueswir1 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KUodl-0003S1-Dj for qemu-devel@nongnu.org; Sun, 17 Aug 2008 20:14:17 +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: Sun, 17 Aug 2008 20:14:17 +0000 Subject: [Qemu-devel] [5020] Fix 64 bit constant generation 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: 5020 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5020 Author: blueswir1 Date: 2008-08-17 20:14:16 +0000 (Sun, 17 Aug 2008) Log Message: ----------- Fix 64 bit constant generation Modified Paths: -------------- trunk/tcg/sparc/tcg-target.c Modified: trunk/tcg/sparc/tcg-target.c =================================================================== --- trunk/tcg/sparc/tcg-target.c 2008-08-17 16:13:02 UTC (rev 5019) +++ trunk/tcg/sparc/tcg-target.c 2008-08-17 20:14:16 UTC (rev 5020) @@ -268,8 +268,8 @@ INSN_RS2(rs2)); } -static inline void tcg_out_arithi(TCGContext *s, int rd, int rs1, int offset, - int op) +static inline void tcg_out_arithi(TCGContext *s, int rd, int rs1, + uint32_t offset, int op) { tcg_out32(s, op | INSN_RD(rd) | INSN_RS1(rs1) | INSN_IMM13(offset)); @@ -292,7 +292,7 @@ static inline void tcg_out_movi_imm32(TCGContext *s, int ret, uint32_t arg) { - if (check_fit_i32(arg, 12)) + if (check_fit_tl(arg, 12)) tcg_out_movi_imm13(s, ret, arg); else { tcg_out_sethi(s, ret, arg); @@ -310,9 +310,16 @@ tcg_out_arithi(s, TCG_REG_I4, TCG_REG_I4, 32, SHIFT_SLLX); tcg_out_movi_imm32(s, ret, arg); tcg_out_arith(s, ret, ret, TCG_REG_I4, ARITH_OR); - } else + } else if (check_fit_tl(arg, 12)) + tcg_out_movi_imm13(s, ret, arg); + else { + tcg_out_sethi(s, ret, arg); + if (arg & 0x3ff) + tcg_out_arithi(s, ret, ret, arg & 0x3ff, ARITH_OR); + } +#else + tcg_out_movi_imm32(s, ret, arg); #endif - tcg_out_movi_imm32(s, ret, arg); } static inline void tcg_out_ld_raw(TCGContext *s, int ret,