Posts 92 10 Mar 2010 22:38
| Maybe I'm wrong, maybe not... Just a simple question: it's possible to implement a saturation arithmetic into N050? I think this feature really good for multimedia processing (eg: image processing, shaders, etc..) Something like this: adds.b d0,d1 adds.w d2,d3 adds.l d4,d5
the semantics of the three instructions are respectively: - Add with saturation the byte in D0 into the byte in D1: D1.B=saturated(D1.B+D0.B) - Like previous, but operates with word: D3.W=saturated(D3.W+D2.W) - Like previous, but operates with longword: D5.L=saturated(D5.L+D4.l) Where saturated will limit the max value at 0xFF, 0xFFFF and 0xFFFFFFFF respectively. The subtractions are duals of the addictions (subs.b, subs.w, subs.l), where lower values are limited to 0. Maybe this can be implemented with a little extension to the ALU (saturation may controlled throug the carry flag into a full adder). A great extension will be this: addsb.l d0,d1
which operates with the entire content of a register, but with 4 separated bytes values (add with saturation bytes). This is very useful with 32 bit ARGB color values! Cheers
|