Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

How to do that ?

ivanming
Beginner
780 Views
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

0 Kudos
2 Replies
Ganesh_R_Intel
Employee
780 Views
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
0 Kudos
Ganesh_R_Intel
Employee
780 Views
Also, welcome to the forum. Hope you are finding it useful.

Cheers!
Ganesh
0 Kudos
Reply