Skip to content

Add SIMD support to context switches#6

Merged
AdrianGjerstad merged 3 commits into
mainfrom
feature/fibers-simdguard-adgjerstad
Mar 20, 2026
Merged

Add SIMD support to context switches#6
AdrianGjerstad merged 3 commits into
mainfrom
feature/fibers-simdguard-adgjerstad

Conversation

@AdrianGjerstad

Copy link
Copy Markdown
Owner

loom::SwitchStack is only designed to save what is absolutely necessary to save. SIMDGuard is designed to save everything else so that SIMD applications can safely yield execution while working.

By default, the context switching that the earlier code implements is
intended to be light. In other words, it only saves what is absolutely
necessary to save.
Unfortunately, properly testing this feature requires more assembly,
though it is done. SIMD is verifiably saved across stack switches using
SIMDGuard. Some changes were made to make the test pass, namely the fact
that the simd_buffer_ is now allocated using `std::aligned_alloc`
because `xsave` was originally segfaulting.
@AdrianGjerstad AdrianGjerstad merged commit 4c0c6e7 into main Mar 20, 2026
1 check passed
@AdrianGjerstad AdrianGjerstad deleted the feature/fibers-simdguard-adgjerstad branch March 20, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant