From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LJuDI-00076A-4W for qemu-devel@nongnu.org; Mon, 05 Jan 2009 13:30:08 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LJuDG-000735-FU for qemu-devel@nongnu.org; Mon, 05 Jan 2009 13:30:07 -0500 Received: from [199.232.76.173] (port=57022 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LJuDG-00072o-6i for qemu-devel@nongnu.org; Mon, 05 Jan 2009 13:30:06 -0500 Received: from mx20.gnu.org ([199.232.41.8]:3598) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LJuDD-0000Vf-Va for qemu-devel@nongnu.org; Mon, 05 Jan 2009 13:30:04 -0500 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LJuD9-0003C0-Uc for qemu-devel@nongnu.org; Mon, 05 Jan 2009 13:30:00 -0500 Date: Mon, 5 Jan 2009 10:29:56 -0800 From: Nathan Froyd Subject: Re: [Qemu-devel] [PATCH 20/40] Add vs{l,r} instructions. Message-ID: <20090105182956.GA28711@codesourcery.com> References: <1230693022-18380-1-git-send-email-froydnj@codesourcery.com> <1230693022-18380-21-git-send-email-froydnj@codesourcery.com> <20090103212655.GC18974@volta.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090103212655.GC18974@volta.aurel32.net> 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 On Sat, Jan 03, 2009 at 10:26:55PM +0100, Aurelien Jarno wrote: > On Tue, Dec 30, 2008 at 07:10:02PM -0800, Nathan Froyd wrote: > > +#define VSHIFT(suffix, leftp) \ > > + void helper_vs##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ > > + { \ > > + int shift = b->u8[LO_IDX*0x15] & 0x7; \ > > + int doit = 1; \ > > + int i; \ > > + for (i = 0; i < ARRAY_SIZE(r->u8); i++) { \ > > + doit = doit && ((b->u8[i] & 0x7) == shift); \ > > + } \ > > According to the specification, the result is undefined in that case. I > think that always doing the computation is fine. FWIW, doing the check has the nice property of delivering the same results as real hardware. If you're using a comparison program like ppctester, reducing those spurious failures is a win. (There's already spurious failures for div instructions in corner cases.) -Nathan