1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-22 23:58:48 +00:00

refactor: remove TODOs (resolves #71)

This commit is contained in:
Oliver Booth 2023-04-03 14:19:47 +01:00
parent b68c804b46
commit a748010a38
No known key found for this signature in database
GPG Key ID: 20BEB9DC87961025
3 changed files with 0 additions and 16 deletions

View File

@ -32,9 +32,6 @@ public static class IntrinsicExtensions
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
public static Vector64<byte> CorrectBoolean(this Vector64<byte> vector) public static Vector64<byte> CorrectBoolean(this Vector64<byte> vector)
{ {
// TODO: AdvSimd implementation.
// TODO: WasmSimd implementation. (?)
Vector64<byte> output = IntrinsicUtility.GetUninitializedVector64<byte>(); Vector64<byte> output = IntrinsicUtility.GetUninitializedVector64<byte>();
for (var i = 0; i < Vector64<byte>.Count; i++) for (var i = 0; i < Vector64<byte>.Count; i++)

View File

@ -150,9 +150,6 @@ public static class IntrinsicUtility
return HorizontalOr_Sse(left, right); return HorizontalOr_Sse(left, right);
} }
// TODO: AdvSimd implementation.
// TODO: WasmSimd implementation. (?)
return HorizontalOrInternal_Fallback(left, right); return HorizontalOrInternal_Fallback(left, right);
} }

View File

@ -79,14 +79,6 @@ public static class SpanExtensions
public static bool Contains<T>(this ReadOnlySpan<T> span, T value) where T : struct, Enum public static bool Contains<T>(this ReadOnlySpan<T> span, T value) where T : struct, Enum
{ {
#if NET6_0_OR_GREATER #if NET6_0_OR_GREATER
// Use MemoryMarshal.CreateSpan instead of using creating new Span instance from pointer will trim down a lot of
// instructions on Release mode.
// Also use reference instead of MemoryMarshal.Cast to remove boundary check (or something, it just result in something
// like that).
// TODO: Figure out some kind of way to directly pass the Span directly into Contains call, which make method smaller and
// more prone to inlining...
unsafe unsafe
{ {
#pragma warning disable CS8500 #pragma warning disable CS8500
@ -481,7 +473,6 @@ public static class SpanExtensions
{ {
fixed (bool* pSource = source) fixed (bool* pSource = source)
{ {
// TODO Hasn't been tested since March 6th 2023 (Reason: Unavailable hardware).
Vector128<ulong> vector1 = AdvSimd.LoadVector128((byte*)pSource).CorrectBoolean().AsUInt64(); Vector128<ulong> vector1 = AdvSimd.LoadVector128((byte*)pSource).CorrectBoolean().AsUInt64();
Vector128<ulong> vector2 = AdvSimd.LoadVector128((byte*)(pSource + 16)).CorrectBoolean().AsUInt64(); Vector128<ulong> vector2 = AdvSimd.LoadVector128((byte*)(pSource + 16)).CorrectBoolean().AsUInt64();
@ -566,7 +557,6 @@ public static class SpanExtensions
{ {
fixed (bool* pSource = source) fixed (bool* pSource = source)
{ {
// TODO Hasn't been tested since March 6th 2023 (Reason: Unavailable hardware).
Vector64<byte> load = AdvSimd.LoadVector64((byte*)pSource); Vector64<byte> load = AdvSimd.LoadVector64((byte*)pSource);
return unchecked((byte)(IntegerPackingMagic * load.CorrectBoolean().AsUInt64().GetElement(0) >> 56)); return unchecked((byte)(IntegerPackingMagic * load.CorrectBoolean().AsUInt64().GetElement(0) >> 56));
} }