adding or comapring 8 bit unsigned data in XMM register

adding or comapring 8 bit unsigned data in XMM register

Please can anyone suggest if there is any way to set, compare and add 16 unsigned 8-bit data elements of two XMM __m128i registers. What I am finding isthe signed operations and that everything after 127 is turned around and made to start from negative end. But I wish to do set, add and compare two __m128i registers having unsigned values more than 127.

Any suggestions on this is greatly appreciable.

Thanks.

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

Any help in this regard ??

You can use an offset of -128 for all your data. As long as you only add and compare numbers, this will work.

Alternatively, you can convert the 8bit values to 16bit values for processing using pmovzxbw or pshufb. This way, you can only process 8 values in parallel but it is still better than not using SSE at all.

Kind regards

Thomas

Thanks for ur suggestions.. I have used another alternative... instead of comparing for 16 unsigned 8-bit elements, I subtracted and checked the resultant to be less than the minuend.. If found more, that suggests subrahend is greater than minuend... For my purpose, this trick would do...

Leave a Comment

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