Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
7644 Discussions

how do i write negative variables using sse2 intrinsics?

Smart_Lubobya
Beginner
189 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
189 Views
-x = 0-x

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

Fill in 'type' appropriately.

Reply