-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Vector64: Avoid GSCookies in Vector64 software fallback #98293
Conversation
Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics Issue DetailsWe are using On x86_64: var x = Vector64.Create(1, 2);
var y = Vector64.Create(2, 3);
Console.WriteLine(Vector64.Sum(x + y)); Before:
After:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just noting that this doesn't really benefit anything as the fallbacks aren't used for most platforms nor should the types be used if IsHardwareAccelerated
is false.
We are using
stackalloc
for Vector64 software fallbacks which results in GSCookies check in the codegen.It's slow as the code is not being hardware accelerated but let's at least initialize Vector64 directly to avoid the unnecessary check and skip the unnecessary zeroing.
As a sequence it also makes the software fallback of
Vector128
,Vector256
andVector512
faster as they all rely onVector64
when creating the vector.On x86_64:
Before:
After: