Re: Q: Fast computation of parity

From: Tom St Denis (tomstdenis_at_iahu.ca)
Date: 12/31/03


Date: Wed, 31 Dec 2003 18:15:14 GMT


"Michael J. Fromberger" <Michael.J.Fromberger@Clothing.Dartmouth.EDU> wrote
in message
news:Michael.J.Fromberger-81B301.12263031122003@merrimack.dartmouth.edu...
> Done. I had to increase the number of tests again to get the resolution
> high enough to see a difference on the P3.
>
> With:
> gcc -ansi -Wall -O3 -fomit-frame-pointer -funroll-loops -o pars pars2.c
>
> # On G4:
> % ./pars
> Lookup: 2
> XOR: 1
>
> # On PIII:
> % ./pars
> Lookup: 450000
> XOR: 460000

That's totally odd. Cuz on the x86 the dependency chain basically breaks
any form of parallelism. So I'd think the lookup would be faster...

Tom



Relevant Pages

  • Re: Algorithm to compare two binary numbers
    ... which processors might have such an instruction) and the compiler is ... > 10,000,000 XOR operations, and need to count the bits of every XOR result, ... > either by lookup table or by a real-time counting function. ... and ended with a CPU time of between 0.8 and 2 seconds for all of it ...
    (comp.programming)
  • Re: Q: Fast computation of parity
    ... So I'd think the lookup would be faster... ... x86 doesn't have enough general-purpose registers, so I suspect the XOR ... into] takes longer than one such sequence plus an access to the cache. ...
    (sci.crypt)
  • Re: Q: Fast computation of parity
    ... > Lookup: 2 ... > XOR: 1 ... This once again shows that the relative efficiency of ... algorithms/codes could be fairly hardware dependent. ...
    (sci.crypt)
  • Re: Q: Fast computation of parity
    ... > Xor: 11888907 ... Lookup: 50 ... This is consistent with my expectations for a register-rich RISC ...
    (sci.crypt)
  • Re: Set range or named range?
    ... that if for example I needed to add an extra row, I could do that on Lookup ... Ian ... >> Tom, ... If I do away with the Dim & Set ...
    (microsoft.public.excel.programming)