How to do that ?

How to do that ?

if two short type integers add to store in Integers type,
i.e.in c/c++
int a[8];
short b[8];
short c[8];
int i;
for (i=0;i<8;i++)
a = b+;c

how to implement it with sse2 instruction?
becuase paddb, the result remain short type,

how to do the casting efficiently?

Thankyou~
Ivan

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

For simple loops such as this, the compiler should just be able to vectorize.
Build this app with -QaxW on windows and -axW on Linux.
(If you are using a Pentium 4. Substitute 'W' with a 'K' if you are using a Pentium III).

Please read the Intel Pentium 4 optimization guide at http://developer.intel.com/design/Pentium4/manuals/ for description of SSE2.

The Intel compiler links and documents can be accessed from http://www.intel.com/software/products/compilers.

Thanks,
Ganesh

Also, welcome to the forum. Hope you are finding it useful.

Cheers!
Ganesh

Leave a Comment

Please sign in to add a comment. Not a member? Join today