How to do that ?

How to do that ?

if two short type integers add to store in Integers type, 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?


3 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

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 for description of SSE2.

The Intel compiler links and documents can be accessed from


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


Laisser un commentaire

Veuillez ouvrir une session pour ajouter un commentaire. Pas encore membre ? Rejoignez-nous dès aujourd’hui