Reputation: 703
Is it possible to do non-homegenous (two datatypes which are not the same) comparison using SIMD instructions (intrinsics) , specifically in SSE2 uptil SSE4.x instruction set? . i.e. float and double? or 32bit and 64 bit integers? even a float with an integer etc?
Upvotes: 1
Views: 87
Reputation: 129524
You mean you have, say, an array of integer and you want to compare it with the values in an array of doubles? You will unfortunately have to perform some sort of conversion to achieve that. There are a group of cvtXX2YY
instructions that do that, and they should be available in the intrinsic functions. You just have to pick out the one that does the right conversion, e.g. _mm_cvtpi32_ps - as can be seen in this example, you can't convert four integers to four floats... Just two at a time. Don't ask me why...
If you are asking about "Can you convert one integer and one float at with another integer and float", then no, that's not available.
Upvotes: 2