News for hackers. Stuff that matters.
Re:KolibriOS – operating system written entirely in assembly... by pjmlp on Wednesday April 15, 2020 @04:41AM (#22875715)
CPU intrinsics are just another way of doing inline Assembly.
Re:KolibriOS – operating system written entirely in assembly... by throwaway_pdp09 on Wednesday April 15, 2020 @04:58AM (#22875789)
IANA C/C++/ASM expert, but one thing I've been thinking of would greatly benefit from type-punning (overlaying 2 kinds of data and interpreting one as the other) because it can use a 64-bit register to parallelise 4 ops at once where speed really, really matters.

That's trivial in ASM I believe, but don't know how well it's possible in C/C++, if at all.

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.
Re:KolibriOS – operating system written entirely in assembly... by dhhwrongagain on Wednesday April 15, 2020 @04:56AM (#22875776)
False or vacuously true