Re:KolibriOS – operating system written entirely in assembly...
by pjmlp on Wednesday April 15, 2020 @05:31AM
(#22875934)
I fail to see why not just use a __m64 variable and do the conversion.
https://software.intel.com/sites/landingpage/IntrinsicsGuide...
You can also try to make a union whose one field is a __m64, but beware not to trigger UB conditions.
Re:KolibriOS – operating system written entirely in assembly...
by saagarjha on Wednesday April 15, 2020 @05:27AM
(#22875911)
Type punning in general would be somewhat difficult to do here in a way that vectorized but was still defined by the standard. You’d need to put a branch with undefined behavior in it when alignment wasn’t satisfied, then do a memcpy into a vector type, and hope that the compiler understands what you’re doing and doesn’t deoptimize it.
That's trivial in ASM I believe, but don't know how well it's possible in C/C++, if at all.