|
5 | 5 | using System.Numerics;
|
6 | 6 | using System.Runtime.CompilerServices;
|
7 | 7 | #if SUPPORTS_RUNTIME_INTRINSICS
|
| 8 | +using System.Runtime.InteropServices; |
8 | 9 | using System.Runtime.Intrinsics;
|
9 | 10 | using System.Runtime.Intrinsics.X86;
|
10 | 11 | #endif
|
@@ -77,7 +78,14 @@ public Vector4 ConvolveCore(ref Vector4 rowStartRef)
|
77 | 78 | float* bufferEnd = bufferStart + (this.Length & ~3);
|
78 | 79 | Vector256<float> result256_0 = Vector256<float>.Zero;
|
79 | 80 | Vector256<float> result256_1 = Vector256<float>.Zero;
|
80 |
| - var mask = Vector256.Create(0, 0, 0, 0, 1, 1, 1, 1); |
| 81 | + ReadOnlySpan<byte> maskBytes = new byte[] |
| 82 | + { |
| 83 | + 0, 0, 0, 0, 0, 0, 0, 0, |
| 84 | + 0, 0, 0, 0, 0, 0, 0, 0, |
| 85 | + 1, 0, 0, 0, 1, 0, 0, 0, |
| 86 | + 1, 0, 0, 0, 1, 0, 0, 0, |
| 87 | + }; |
| 88 | + Vector256<int> mask = Unsafe.ReadUnaligned<Vector256<int>>(ref MemoryMarshal.GetReference(maskBytes)); |
81 | 89 |
|
82 | 90 | while (bufferStart < bufferEnd)
|
83 | 91 | {
|
|
0 commit comments