From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=47951 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PftIP-0002GI-DA for qemu-devel@nongnu.org; Thu, 20 Jan 2011 07:07:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PftIN-0006Nc-Oo for qemu-devel@nongnu.org; Thu, 20 Jan 2011 07:07:21 -0500 Received: from eu1sys200aog109.obsmtp.com ([207.126.144.127]:42429) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PftIN-0006NJ-HR for qemu-devel@nongnu.org; Thu, 20 Jan 2011 07:07:19 -0500 Message-ID: <4D382550.1080708@st.com> Date: Thu, 20 Jan 2011 13:06:40 +0100 From: Christophe Lyon MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Support saturation with shift=0. References: <4D370D0C.5040706@st.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: "qemu-devel@nongnu.org" On 19.01.2011 17:51, Peter Maydell wrote: > On 19 January 2011 16:10, Christophe Lyon wrote: >> >> This patch fixes corner-case saturations, when the target range is >> zero. It merely removes the guard against (sh == 0), and makes: >> __ssat(0x87654321, 1) return 0xffffffff and set the saturation flag > > did you mean __ssat(0x87654321, 0) here? (they give the same > result, of course, but it's the sh==0 case the patch is changing...) Well... the ARM ARM says that the position for saturation is in the range 1 to 32, so I think the assembler encodes 1 less than what the user actually wrote. Hence at user level we use '1', but '0' is encoded and then parsed by qemu. Am I wrong? Obviously, I can rephrase the commit message :-) > >> __usat(0x87654321, 0) return 0 and set the saturation flag >> >> Signed-off-by: Christophe Lyon > > Checked against the ARM ARM and tested by > random-instruction-sequence generation. > Thanks.