From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NM3PJ-00012y-P3 for qemu-devel@nongnu.org; Sat, 19 Dec 2009 12:47:57 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NM3PI-0000zN-2P for qemu-devel@nongnu.org; Sat, 19 Dec 2009 12:47:57 -0500 Received: from [199.232.76.173] (port=57931 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NM3PH-0000z6-OH for qemu-devel@nongnu.org; Sat, 19 Dec 2009 12:47:55 -0500 Received: from are.twiddle.net ([75.149.56.221]:44711) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NM3PH-0000A2-DT for qemu-devel@nongnu.org; Sat, 19 Dec 2009 12:47:55 -0500 Message-ID: <4B2D11C8.6040507@twiddle.net> Date: Sat, 19 Dec 2009 09:47:52 -0800 From: Richard Henderson MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 5/7] tcg-sparc: Implement setcond, movcond, setcond2, brcond2. References: <4259c837ce1a62fcb495e57f18b588eb7365d286.1261012798.git.rth@twiddle.net> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org On 12/19/2009 02:31 AM, Blue Swirl wrote: >> static inline void tcg_out_movi_imm32(TCGContext *s, int ret, uint32_t arg) >> { >> - if (check_fit_tl(arg, 12)) >> + if (check_fit_tl(arg, 13)) >> tcg_out_movi_imm13(s, ret, arg); > > IIRC sign extension prevents this. Pardon? check_fit_tl checks a signed value, the OR opcode provides one. Where's the conflict? >> - if (const_arg2&& arg2 == 0) >> - /* orcc %g0, r, %g0 */ >> - tcg_out_arith(s, TCG_REG_G0, TCG_REG_G0, arg1, ARITH_ORCC); >> - else >> - /* subcc r1, r2, %g0 */ >> - tcg_out_arith(s, TCG_REG_G0, arg1, arg2, ARITH_SUBCC); >> - tcg_out_branch_i32(s, tcg_cond_to_bcond[cond], label_index); >> + tcg_out_cmp(s, arg1, arg2, const_arg2); > > What's wrong with 'orcc' (produces the synthetic instruction 'tst')? What result does "orcc" give that isn't produced by "subcc"? Unlike i386 where "test x,x" is one byte smaller than "cmp $0,x", it seems to me there's no reason to distingish the arg2 == constant zero case on sparc. r~