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

how do i write negative variables using sse2 intrinsics?

Smart_Lubobya
Beginner
462 Views
example:
y= (-x)*b

tried checking in chapter 10,11 of the intel mannuals and emmintrin.h file. could not figure out. please help
0 Kudos
1 Reply
piet_de_weer
Beginner
462 Views
-x = 0-x

So something like:
y = _mm_mul_type(_mm_sub_type(_mm_setzero(), x), b)

Fill in 'type' appropriately.

0 Kudos
Reply