From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 10326 invoked from network); 24 Oct 1999 13:04:50 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 24 Oct 1999 13:04:50 -0000 Received: from julia.creaholic.com (euclid.creaholic.com [194.209.56.210]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id JAA02506 for ; Sun, 24 Oct 1999 09:04:48 -0400 Received: from amazing.ch ([194.209.56.213]) by julia.creaholic.com (Post.Office MTA v3.1.2 release (PO205-101c) ID# 0-44790U100L100S0) with SMTP id AAA7683 for ; Sun, 24 Oct 1999 15:04:42 +0100 Received: by amazing.ch id ; Sun, 24 Oct 1999 15:04:00 GMT To: axp-list@redhat.com In-Reply-To: <19991023133917.A15599@twiddle.net> (from Richard Henderson ) (at Sat, 23 Oct 1999 13:39:17 -0700) Organization: sometimes private, sometimes creaholic sa MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable From: axp@amazing.ch (Christoph Dworzak) Subject: Re: patch_v2: (on Alpha) emulating missing instructions Message-Id: <2906e107.u10t12e.d9cd7-axp@amazing.ch> Date: Sun, 24 Oct 1999 15:04:00 GMT Hi On Oct 23 Richard Henderson (rth@twiddle.net) wrote: > On Mon, Oct 18, 1999 at 04:31:25PM +0100, Phil Carmody wrote: > > D =3D (A & M) | (B & ~M); I used the same sequence twice to exchange bits between two variables depending on a mask: t =3D (A & M) | (B & ~M); B =3D (B & M) | (A & ~M); A =3D t; > > can be turned into=20 > > D =3D A ^ ((A ^ B) & M); >=20 > I'll note that the former expression, given an andnot operation, > has 3 ops and a tree height of 2. The later expression has 3 ops > and a tree height of 3. I.e. the former expression takes better > advantage of instruction-level parallelism. =20 In my App the later is faster (4 ops instead of 6): t =3D (A ^ B) & M; A ^=3D t; B ^=3D t; Can it get any better? Bye =20dworz