|
5 | 5 | // #define BENCHMARKING
|
6 | 6 | using System;
|
7 | 7 | using System.Diagnostics;
|
| 8 | + |
8 | 9 | using SixLabors.ImageSharp.Formats.Jpeg.Components;
|
9 | 10 | using SixLabors.ImageSharp.Tests.Formats.Jpg.Utils;
|
10 |
| -using SixLabors.ImageSharp.Tests.TestUtilities; |
| 11 | + |
11 | 12 | using Xunit;
|
12 | 13 | using Xunit.Abstractions;
|
13 | 14 |
|
@@ -162,29 +163,42 @@ public void Load_Store_IntArray()
|
162 | 163 | }
|
163 | 164 |
|
164 | 165 | [Fact]
|
165 |
| - public void TransposeInto() |
| 166 | + public void TransposeIntoFallback() |
166 | 167 | {
|
167 |
| - static void RunTest() |
168 |
| - { |
169 |
| - float[] expected = Create8x8FloatData(); |
170 |
| - ReferenceImplementations.Transpose8x8(expected); |
| 168 | + float[] expected = Create8x8FloatData(); |
| 169 | + ReferenceImplementations.Transpose8x8(expected); |
171 | 170 |
|
172 |
| - var source = default(Block8x8F); |
173 |
| - source.LoadFrom(Create8x8FloatData()); |
| 171 | + var source = default(Block8x8F); |
| 172 | + source.LoadFrom(Create8x8FloatData()); |
174 | 173 |
|
175 |
| - var dest = default(Block8x8F); |
176 |
| - source.TransposeInto(ref dest); |
| 174 | + var dest = default(Block8x8F); |
| 175 | + source.TransposeIntoFallback(ref dest); |
177 | 176 |
|
178 |
| - float[] actual = new float[64]; |
179 |
| - dest.ScaledCopyTo(actual); |
| 177 | + float[] actual = new float[64]; |
| 178 | + dest.ScaledCopyTo(actual); |
180 | 179 |
|
181 |
| - Assert.Equal(expected, actual); |
182 |
| - } |
| 180 | + Assert.Equal(expected, actual); |
| 181 | + } |
183 | 182 |
|
184 |
| - FeatureTestRunner.RunWithHwIntrinsicsFeature( |
185 |
| - RunTest, |
186 |
| - HwIntrinsics.AllowAll | HwIntrinsics.DisableAVX); |
| 183 | +#if SUPPORTS_RUNTIME_INTRINSICS |
| 184 | + [Fact] |
| 185 | + public void TransposeIntoAvx() |
| 186 | + { |
| 187 | + float[] expected = Create8x8FloatData(); |
| 188 | + ReferenceImplementations.Transpose8x8(expected); |
| 189 | + |
| 190 | + var source = default(Block8x8F); |
| 191 | + source.LoadFrom(Create8x8FloatData()); |
| 192 | + |
| 193 | + var dest = default(Block8x8F); |
| 194 | + source.TransposeIntoAvx(ref dest); |
| 195 | + |
| 196 | + float[] actual = new float[64]; |
| 197 | + dest.ScaledCopyTo(actual); |
| 198 | + |
| 199 | + Assert.Equal(expected, actual); |
187 | 200 | }
|
| 201 | +#endif |
188 | 202 |
|
189 | 203 | private class BufferHolder
|
190 | 204 | {
|
|
0 commit comments