This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Saturated integer addition in C


On Thu, Nov 06, 2008 at 10:42:51AM +0530, Rohit Garg wrote:
> You can use sse intrinsics. They are portable c and give you saturated
> arithmetic. They are probably limited to 16 bit though.

If this is a new project, you might want to consider looking at sseplus, which
is an attempt to abstract the various Intel and AMD SSE extensions, so that you
can write the code once, and then have the code use the appropriate
instructions on the machine (for example, if your machine has the SSE4 or SSE5
instructions, and your operations could use those instructions, you would get
the direct instruction, but if not, it would be emulated using the instructions
native to the machine)
http://sseplus.sourceforge.net/

-- 
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@linux.vnet.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]