What is the proper way to convert an __int64 value to an __m64 value for use with SSE?
What is the proper way to convert an __int64 value to an __m64 value
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
With gcc you can just use
_mm_set_pi64x:Note that not all compilers have
_mm_set_pi64xdefined inmmintrin.h. For gcc it’s defined like this:which suggests that you could probably just use a cast if you prefer, e.g.
Failing that, if you’re stuck with an overly picky compiler such as Visual C/C++, as a last resort you can just use a union and implement your own intrinsic:
Note that strictly speaking this is UB, since we are writing to one variant of a union and reading from another, but it should work in this instance.