You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add AVX-512 Ice Lake decoder and retarget the library to .NET 10.
Port simdutf's Ice Lake base64 kernel (VPERMI2B lookup, VPCOMPRESSB
whitespace compression, masked 48-byte stores) using the .NET 10
AVX-512 VBMI/VBMI2 intrinsics. Dispatch prefers AVX-512 VBMI2, then
AVX2, SSSE3, or scalar. Benchmarks on a Xeon Gold 6548N reach 11.3 GB/s
versus 4.7 GB/s for System.Buffers.Text.Base64.DecodeFromUtf8.
As for .NET 9, the support for AVX-512 remains incomplete in C#. In particular, important
67
-
VBMI2 instructions are missing. Hence, we are not using AVX-512 under x64 systems at this time.
68
-
However, as soon as .NET offers the necessary support, we will update our results.
68
+
On .NET 10, we use AVX-512 VBMI / VBMI2 when the CPU supports them (Ice Lake and later,
69
+
including the Xeon Gold 6548N numbers above). The kernel is a C# port of the
70
+
[simdutf Ice Lake decoder](https://github.com/simdutf/simdutf): a 64-byte
71
+
`VPERMI2B` lookup, `VPCOMPRESSB` to strip white space, and a masked 48-byte store.
72
+
On older x64 CPUs the library still dispatches to AVX2 or SSSE3.
69
73
70
74
## Requirements
71
75
72
-
We require .NET 9 or better: https://dotnet.microsoft.com/en-us/download/dotnet/9.0
76
+
We require .NET 10 or better: https://dotnet.microsoft.com/en-us/download/dotnet/10.0
73
77
74
78
## Usage
75
79
@@ -177,6 +181,7 @@ You can convert an integer to a hex string like so: `$"0x{MyVariable:X}"`.
177
181
## Performance tips
178
182
179
183
- Be careful: `Vector128.Shuffle` is not the same as `Ssse3.Shuffle` nor is `Vector256.Shuffle` the same as `Avx2.Shuffle`. Prefer the latter.
184
+
- Likewise `Vector512.Shuffle` is a full 64-byte permute; `Avx512BW.Shuffle` is lane-wise `VPSHUFB`. For the Ice Lake kernel use `Avx512Vbmi.PermuteVar64x8` / `PermuteVar64x8x2`.
180
185
- Similarly `Vector128.Shuffle` is not the same as `AdvSimd.Arm64.VectorTableLookup`, use the latter.
181
186
-`stackalloc` arrays should probably not be used in class instances.
182
187
- In C#, `struct` might be preferable to `class` instances as it makes it clear that the data is thread local.
0 commit comments