Re: [AD] Faster hsv_to_rgb()

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


AE wrote:
I am using a 600MhZ AMD Athlon with a 64K data-cache, 64K Instruction-cache,
512K L2 Cache and 256MB of 100MhZ Ram (CAS 2 latency).
  ^^^^^^^
Your L2 cache isn't running at full CPU clock, so there's some additional latencies involved on L1 misses.


I just wonder how
these results will compare on more modern processors with greater L1/L2
cache

No other consummer CPU has more cache. On the other hand, those caches are far faster.


or older processors where multiply is slower and with smaller caches
so that there will be more things likely to cause cache-misses, or for that
matter, non x86-based processors.

You can bet those will have an optimized multiplier.


However, I slightly tweaked the lookup table so that 0.FF * 0.FF = 0.FF
instead of 0.FE (as the macro returns), so the results will use the full
range of 00-FF.

You could also change the macro to:

#define cpMUL8(a,b) ((((a)+1)*((b)+1))>>8)

Which ought to scale the multiply properly (note: untested).


--
- Robert Jr Ohannessian
http://bob.allegronetwork.com/






Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/