3 ms·
Do the intrinsics allow to load and store registers from and to memory? That's kind of the whole point why assembly is required. Most cross-platform co-routine
by flohofwoe 4y ago
Do the intrinsics allow to load and store registers from and to memory? That's kind of the whole point why assembly is required.
Most cross-platform co-routine libraries I've seens for C or C++ use a small separate assembly file for the stack switching magic on MSVC, so if it's possible to do the same with intrinsics, then it's definitely not a well known technique ;)
PS: at least the list of cross-platform intrinsics looks way too high level for a self-rolled setjmp/longjmp: https://learn.microsoft.com/en-us/cpp/intrinsics/intrinsics-available-on-all-architectures?view=msvc-170 https://learn.microsoft.com/en-us/cpp/intrinsics/intrinsics-...
- megous 4y agosetjmp/longjmp don't switch stacks (they just "move" up the current stack)