[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [f-cpu] Are 8 bits SIMD mode usefull ?



Hi,

Le sam 11/01/2003 à 00:24, nico a écrit :
> Half the bandwith consumption but many more operations to avoid
> overflow/underflow problems !

Why more operations ? If your channel is 8-bit, the dynamic
range will be 0-255. If it's 16-bit, the range will be 0-65535.
But it is a difference in precision ; it remains some fixed
point arithmetic in the interval [0.0, 1.0].
In _both_ cases, you will have to manage overflow when doing
multiplications or additions. The problem is the same. The
difference is that not only 8-bit muls and adds may be faster,
but you can also do twice more at the same time (SIMD). This
means you may be more than twice faster in 8-bit than in
16-bit ! (not counting memory bandwidth issues)


On a side note, it would be useful to have something to
correct some kind of "rounding problems". For example, if I
multiply FF * FF, I get FE01. Which is fine. But if the first
FF is a brightness value (maximum = full white) and the second
FF is an alpha mask value (maximum = full transparency / opacity),
it's obvious that I want the end result to be FF, not FE (because
full white with full opacity is still full white ;-)). So a
correction needs to be made. I don't know how a program like
GIMP handles it, though. Maybe when the alpha is higher than
0x80, it adds the brightness value one more time ;)


>  I beleive that GPU use float to avoid such
> mess !

I don't think so, not for texturing. Until recently 
the so-called "3d" cards were only 2d texturing devices
with a Z-correction mechanism and other useful stuff 
like Z-buffer. All this is integer. (I am talking about
consumer grade video cards, I don't know about "pro"
ones)

Also, in general, it is faster to use 16-bit textures
(4-bit per channel !) than 32-bit ones, because of
GPU bandwidth. Which seems to contradict your statement
that less bits is slower because there are more overflows.


But anyway, apart from 3D calculations there are far
many more applications which use plain bytes. To me
it seems foolish to design a general-purpose CPU that
doesn't know to handle bytes ;) Also I don't see any
advantage.

Regards

Antoine.


*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/