Use ReadOnlySpan<byte> compiler optimization for static data (#3130)

This commit is contained in:
Berkan Diler 2022-02-17 21:38:50 +01:00 committed by GitHub
parent 7e9011673b
commit 9ca040c0ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 23 additions and 19 deletions

View file

@ -824,7 +824,7 @@ namespace ARMeilleure.Instructions
return (ulong)(size - 1);
}
private static readonly byte[] ClzNibbleTbl = { 4, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };
private static ReadOnlySpan<byte> ClzNibbleTbl => new byte[] { 4, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };
public static ulong CountLeadingZeros(ulong value, int size) // size is 8, 16, 32 or 64 (SIMD&FP or Base Inst.).
{