Skip to content

Commit 9d737b7

Browse files
Avoid downclocking
1 parent 89cd849 commit 9d737b7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ImageSharp/Common/Helpers/SimdUtils.HwIntrinsics.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,9 @@ internal static void NormalizedFloatToByteSaturateReduce(
896896
{
897897
DebugGuard.IsTrue(source.Length == destination.Length, nameof(source), "Input spans must be of same length!");
898898

899-
if (Avx512BW.IsSupported || Avx2.IsSupported || Sse2.IsSupported || AdvSimd.IsSupported)
899+
if ((Vector512.IsHardwareAccelerated && Avx512BW.IsSupported) ||
900+
(Vector256.IsHardwareAccelerated && Avx2.IsSupported) ||
901+
(Vector128.IsHardwareAccelerated && (Sse2.IsSupported || AdvSimd.IsSupported)))
900902
{
901903
int remainder;
902904

0 commit comments

Comments
 (0)