Re: Selective Computation...

Saru <saru@jeyan.eclipse.co.uk>
30 Dec 2002 23:55:50 -0500

          From comp.compilers

Related articles
Selective Computation... saru@jeyan.eclipse.co.uk (Saru) (2002-12-26)
Re: Selective Computation... jeyan@jeyan.eclipse.co.uk (Saru) (2002-12-30)
Re: Selective Computation... saru@jeyan.eclipse.co.uk (Saru) (2002-12-30)
Re: Selective Computation... joachim_d@gmx.de (Joachim Durchholz) (2002-12-31)
Re: Selective Computation... thp@cs.ucr.edu (2003-01-17)
Re: Selective Computation... Patrick.Volteau@st.com (Patrick Volteau) (2003-01-20)
Re: Selective Computation... strohm@airmail.net (John R. Strohm) (2003-01-21)
Re: Selective Computation... andreas.gieriet@externsoft.ch (Andreas Gieriet) (2003-01-21)
Re: Selective Computation... liekweg@freenet.de (Florian Liekweg) (2003-01-21)
[1 later articles]
| List of all articles for this month |

From: Saru <saru@jeyan.eclipse.co.uk>
Newsgroups: comp.compilers
Date: 30 Dec 2002 23:55:50 -0500
Organization: Ye 'Ol Disorganized NNTPCache groupie
References: <UTC200212270952.gBR9qMI09875.pmontgom@smtp.cwi.nl>
Keywords: optimize
Posted-Date: 30 Dec 2002 23:55:50 EST

Hi again,
  As Peter Montgomery wrote, the following version runs slightly faster
than the original version.


  ((-k1) & (p + q)) + ((-k2) & (p + q')) + ((-k3) & (p' + q))




  I am looking into the issue of using pointer to pickup the computation
of (p or p') + (q or q'). Also, as I responded to John, p, q, p' and
q' are array based computations and (unfortunately), they are not loop
invariants.


Thanks again.


Saru


Peter-Lawrence.Montgomery@cwi.nl wrote:


> If the variables are integer, try replacing k1, k2, k3
>by their negatives (two's complement), the same width as X.
>The integer computation
>
> ((-k1) & (p + q)) + ((-k2) & (p + q')) + ((-k3) & (p' + q))
>
>should go fast if p, q, p', q' are simple array references
>(or, better, loop invariants which can be kept in registers).
>
> Can you use pointers dependent upon k1, k2, k3,
>to pick up
>
> (p or p') + (q or q')
>
>(this assumes k1 = k2 = k3 = 0 is impossible,
>or perhaps you multiply by k1+k2+k3 at the end.)


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.