Skip to content

[WIP] Add SIMD support #686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

[WIP] Add SIMD support #686

wants to merge 1 commit into from

Conversation

ludfjig
Copy link
Contributor

@ludfjig ludfjig commented Jul 2, 2025

KVM done, TODO windows & mshv

@ludfjig ludfjig added the kind/enhancement For PRs adding features, improving functionality, docs, tests, etc. label Jul 2, 2025
@ludfjig ludfjig force-pushed the simd branch 2 times, most recently from a196a11 to 83ef4bb Compare July 2, 2025 22:43
Signed-off-by: Ludvig Liljenberg <[email protected]>
return Err(new_error!("AVX support not detected on the host machine"));
}
// avx2 is EAX=7, EBX bit 5
if !entries
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we error on all of these, rather than mirroring the host cpuid & being careful to only configure the features that actually exist on this platform?

Copy link
Contributor Author

@ludfjig ludfjig Jul 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if a guest is compiled with for example +avx, but the host doesn't support it? We won't be able to run it so I thought it'd be better to error early than get InvalidOp exception in guest.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like that might just need to be a "you have to be careful about this when using simd if not using feature detection" thing? (a lot of software nowdays has feature detection for advanced simd anyway). I feel it probably doesn't make sense to statically decide in Hyperlight what simd features will be supported; this both rules out using hyperlight on older hardware & prevents using newer simd features on newer hardware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement For PRs adding features, improving functionality, docs, tests, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants