Saturated Integer Arithmetic

  • Follow


Has anyone implemented i386 assembler integer versions of saturated
add, sub, mul and div?

Specifically I am interested in a "4-way parallell saturated add" used
to add rgba32 pixels with saturation. Does GCC have builtins for this
to make the code portable?

/Nordl�w

0
Reply ISO 11/30/2008 9:38:46 PM

Nordl�w wrote:
> Has anyone implemented i386 assembler integer versions of saturated
> add, sub, mul and div?
> 
> Specifically I am interested in a "4-way parallell saturated add" used
> to add rgba32 pixels with saturation. Does GCC have builtins for this
> to make the code portable?

Not as far as I know, but some SSE or MMX code should do it easily.

Using macros it is also possible to handle PowerPC/Altivec with the same 
source code.

Terje

-- 
- <Terje.Mathisen@hda.hydro.com>
"almost all programming can be viewed as an exercise in caching"

0
Reply Terje 12/1/2008 9:35:08 AM


1 Replies
316 Views

(page loaded in 0.04 seconds)

Similiar Articles:





7/25/2012 4:51:08 AM


Reply: