Home   News   Concept   AMIGA-Compatible   Hardware   Forum   Questions+Answers   Pictures   Contact & Team

Welcome to the Natami / Amiga Forum

This forum is for AMIGA fans interested in the new NATAMI platform.
Please read the forum usage manual.


All TopicsNewsQAFeaturesTalkTEAMLogin to post    Create account
Do you have ideas and feature wishes? Post them here and discuss your ideas.

N050 Saturation Arithmetic
Gabriele Budelacci
Italy

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

Team Chaos Leader
USA
(Natami Team Member)
Posts 1199
10 Mar 2010 23:23


Gabriele Budelacci wrote:

  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!

Yes!  That would be very cool!  I would love that!

But Gunnar is going to grumble about needing 3 extra ALUs :)

Gabriele Budelacci
Italy

Posts 92
10 Mar 2010 23:46


Team Chaos Leader wrote:

  But Gunnar is going to grumble about needing 3 extra ALUs :)

:-)

Maybe it's can be done using the same ALU, just using the 4 carry bits of each single  byte in the register.

One Thousand
USA
(Natami Team Member)
Posts 716
11 Mar 2010 00:14


We had talked about saturation arithmetic before within the team.  It might be included in Robin sometime down the line because that is going to be the media processor.

posts 4