|
|
|
@ -222,7 +222,7 @@ internal static partial class SimdUtils |
|
|
|
ref Vector256<float> destBase = |
|
|
|
ref Unsafe.As<float, Vector256<float>>(ref MemoryMarshal.GetReference(dest)); |
|
|
|
|
|
|
|
nint n = (nint)(uint)(dest.Length / Vector256<float>.Count); |
|
|
|
nint n = (nint)dest.Vector256Count<float>(); |
|
|
|
nint m = Numerics.Modulo4(n); |
|
|
|
nint u = n - m; |
|
|
|
|
|
|
|
@ -392,7 +392,7 @@ internal static partial class SimdUtils |
|
|
|
ref Vector128<byte> destBase = |
|
|
|
ref Unsafe.As<byte, Vector128<byte>>(ref MemoryMarshal.GetReference(dest)); |
|
|
|
|
|
|
|
nuint n = (uint)source.Length / (uint)Vector128<byte>.Count; |
|
|
|
nuint n = source.Vector128Count<byte>(); |
|
|
|
|
|
|
|
for (nuint i = 0; i < n; i += 3) |
|
|
|
{ |
|
|
|
@ -455,7 +455,7 @@ internal static partial class SimdUtils |
|
|
|
ref Vector128<byte> destBase = |
|
|
|
ref Unsafe.As<byte, Vector128<byte>>(ref MemoryMarshal.GetReference(dest)); |
|
|
|
|
|
|
|
nuint n = (uint)source.Length / (uint)Vector128<byte>.Count; |
|
|
|
nuint n = source.Vector128Count<byte>(); |
|
|
|
|
|
|
|
for (nuint i = 0, j = 0; i < n; i += 3, j += 4) |
|
|
|
{ |
|
|
|
@ -499,7 +499,7 @@ internal static partial class SimdUtils |
|
|
|
ref Vector128<byte> destBase = |
|
|
|
ref Unsafe.As<byte, Vector128<byte>>(ref MemoryMarshal.GetReference(dest)); |
|
|
|
|
|
|
|
nuint n = (uint)source.Length / (uint)Vector128<byte>.Count; |
|
|
|
nuint n = source.Vector128Count<byte>(); |
|
|
|
|
|
|
|
for (nuint i = 0, j = 0; i < n; i += 4, j += 3) |
|
|
|
{ |
|
|
|
@ -679,7 +679,7 @@ internal static partial class SimdUtils |
|
|
|
{ |
|
|
|
VerifySpanInput(source, dest, Vector256<byte>.Count); |
|
|
|
|
|
|
|
nuint n = (uint)dest.Length / (uint)Vector256<byte>.Count; |
|
|
|
nuint n = dest.Vector256Count<byte>(); |
|
|
|
|
|
|
|
ref Vector256<float> destBase = |
|
|
|
ref Unsafe.As<float, Vector256<float>>(ref MemoryMarshal.GetReference(dest)); |
|
|
|
@ -712,7 +712,7 @@ internal static partial class SimdUtils |
|
|
|
// Sse
|
|
|
|
VerifySpanInput(source, dest, Vector128<byte>.Count); |
|
|
|
|
|
|
|
nuint n = (uint)dest.Length / (uint)Vector128<byte>.Count; |
|
|
|
nuint n = dest.Vector128Count<byte>(); |
|
|
|
|
|
|
|
ref Vector128<float> destBase = |
|
|
|
ref Unsafe.As<float, Vector128<float>>(ref MemoryMarshal.GetReference(dest)); |
|
|
|
@ -811,7 +811,7 @@ internal static partial class SimdUtils |
|
|
|
{ |
|
|
|
VerifySpanInput(source, dest, Vector256<byte>.Count); |
|
|
|
|
|
|
|
nuint n = (uint)dest.Length / (uint)Vector256<byte>.Count; |
|
|
|
nuint n = dest.Vector256Count<byte>(); |
|
|
|
|
|
|
|
ref Vector256<float> sourceBase = |
|
|
|
ref Unsafe.As<float, Vector256<float>>(ref MemoryMarshal.GetReference(source)); |
|
|
|
@ -850,7 +850,7 @@ internal static partial class SimdUtils |
|
|
|
// Sse
|
|
|
|
VerifySpanInput(source, dest, Vector128<byte>.Count); |
|
|
|
|
|
|
|
nuint n = (uint)dest.Length / (uint)Vector128<byte>.Count; |
|
|
|
nuint n = dest.Vector128Count<byte>(); |
|
|
|
|
|
|
|
ref Vector128<float> sourceBase = |
|
|
|
ref Unsafe.As<float, Vector128<float>>(ref MemoryMarshal.GetReference(source)); |
|
|
|
@ -893,7 +893,7 @@ internal static partial class SimdUtils |
|
|
|
ref Vector256<byte> bBase = ref Unsafe.As<byte, Vector256<byte>>(ref MemoryMarshal.GetReference(blueChannel)); |
|
|
|
ref byte dBase = ref Unsafe.As<Rgb24, byte>(ref MemoryMarshal.GetReference(destination)); |
|
|
|
|
|
|
|
nuint count = (uint)redChannel.Length / (uint)Vector256<byte>.Count; |
|
|
|
nuint count = redChannel.Vector256Count<byte>(); |
|
|
|
|
|
|
|
ref byte control1Bytes = ref MemoryMarshal.GetReference(PermuteMaskEvenOdd8x32); |
|
|
|
Vector256<uint> control1 = Unsafe.As<byte, Vector256<uint>>(ref control1Bytes); |
|
|
|
@ -965,7 +965,7 @@ internal static partial class SimdUtils |
|
|
|
ref Vector256<byte> bBase = ref Unsafe.As<byte, Vector256<byte>>(ref MemoryMarshal.GetReference(blueChannel)); |
|
|
|
ref Vector256<byte> dBase = ref Unsafe.As<Rgba32, Vector256<byte>>(ref MemoryMarshal.GetReference(destination)); |
|
|
|
|
|
|
|
nuint count = (uint)redChannel.Length / (uint)Vector256<byte>.Count; |
|
|
|
nuint count = redChannel.Vector256Count<byte>(); |
|
|
|
ref byte control1Bytes = ref MemoryMarshal.GetReference(PermuteMaskEvenOdd8x32); |
|
|
|
Vector256<uint> control1 = Unsafe.As<byte, Vector256<uint>>(ref control1Bytes); |
|
|
|
var a = Vector256.Create((byte)255); |
|
|
|
|