From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NM8AR-0001lt-F7 for qemu-devel@nongnu.org; Sat, 19 Dec 2009 17:52:55 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NM8AQ-0001lZ-Nh for qemu-devel@nongnu.org; Sat, 19 Dec 2009 17:52:55 -0500 Received: from [199.232.76.173] (port=46942 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NM8AQ-0001lW-Ld for qemu-devel@nongnu.org; Sat, 19 Dec 2009 17:52:54 -0500 Received: from are.twiddle.net ([75.149.56.221]:36422) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NM8AQ-0000Wu-96 for qemu-devel@nongnu.org; Sat, 19 Dec 2009 17:52:54 -0500 Message-ID: <4B2D5944.9000704@twiddle.net> Date: Sat, 19 Dec 2009 14:52: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> <4B2D11C8.6040507@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 01:25 PM, Blue Swirl wrote: > On Sat, Dec 19, 2009 at 5:47 PM, Richard Henderson wrote: >> 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? > > Long time ago I tried the same change, but the generated code was not > correct. But now it seems to work. I can't imagine why. I've looked at the instruction encodings very carefully and double-checked the arithmetic vs GCC. I still think the change is correct. I can probably dig up access to a sparc machine and verify, but I don't know that would convince you. r~