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 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

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

发表评论

登录添加评论。还不是成员?立即加入