Skip to content

Instantly share code, notes, and snippets.

@richlander
Created January 29, 2019 17:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richlander/47a3e854c3114fd3012b8508b4935b47 to your computer and use it in GitHub Desktop.
Save richlander/47a3e854c3114fd3012b8508b4935b47 to your computer and use it in GitHub Desktop.
Using Unsafe API
Vector256<double> SoftwareFallback(double x)
{
var pResult = stackalloc double[4]
{
x,
x,
x,
x,
};
return Unsafe.AsRef<Vector256<double>>(pResult);
}
// https://github.com/dotnet/coreclr/blob/57fd77e6f8f7f2c37cc5c3b36df3ea4f302e143b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector256.cs#L110
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment