From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 4866 invoked from network); 25 Oct 1999 12:21:24 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 25 Oct 1999 12:21:24 -0000 Received: from mgw-x2.nokia.com (mgw-x2.nokia.com [131.228.20.22]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id IAA24128 for ; Mon, 25 Oct 1999 08:21:23 -0400 Received: from mgw-i2.ntc.nokia.com (mgw-i2.ntc.nokia.com [131.228.118.61]) by mgw-x2.nokia.com (8.9.3/8.9.3) with ESMTP id PAA11061 for ; Mon, 25 Oct 1999 15:21:14 +0300 (EETDST) Received: from ducati.uk.ntc.nokia.com (ducati.uk.ntc.nokia.com [131.228.132.169]) by mgw-i2.ntc.nokia.com (8.9.3/8.9.3) with SMTP id MAA01013 for ; Mon, 25 Oct 1999 12:47:48 +0300 (EETDST) Received: from scooby.uk.ntc.nokia.com by ducati.uk.ntc.nokia.com (SMI-8.6/SMI-SVR4) id KAA06048; Mon, 25 Oct 1999 10:47:42 +0100 Date: Mon, 25 Oct 1999 10:47:42 +0100 (WET DST) From: Phil Carmody X-Sender: carmody@scooby.uk.ntc.nokia.com To: axp-list@redhat.com Subject: Re: patch_v2: (on Alpha) emulating missing instructions In-Reply-To: <2906e107.u10t12e.d9cd7-axp@amazing.ch> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Sun, 24 Oct 1999, EXT axp@amazing.ch (Christoph Dworzak) wrote: > Hi > > On Oct 23 Richard Henderson (rth@twiddle.net) wrote: > > On Mon, Oct 18, 1999 at 04:31:25PM +0100, Phil Carmody wrote: > > > D = (A & M) | (B & ~M); > > I used the same sequence twice to exchange bits between two > variables depending on a mask: > > t = (A & M) | (B & ~M); > B = (B & M) | (A & ~M); > A = t; > > > > can be turned into > > > D = A ^ ((A ^ B) & M); > > > > 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. Accepted, yes. However, with registers coming out of your ears there should be plenty of other things that can fill the gaps. (and OOOE goes a long way to filling the gaps anyway). I merely wanted people to have to tool in their toolkit, should it be needed (as it was for Cristoph). > In my App the later is faster (4 ops instead of 6): > > t = (A ^ B) & M; > A ^= t; > B ^= t; > > Can it get any better? Yes, get a TI DSP processor (the MVP/MP will do) which can do 'insert bit string' operations in a single processor cycle. t=A A=A with bits from B B=B with bits from t three ticks. Phil -- Phil Carmody Not speaking for or on behalf of Nokia Telecommunications Resistrance : Peaceful and passive resistance