Skip to content

Commit 4c1ecfa

Browse files
Fix v128 narrowing.
1 parent 28025e7 commit 4c1ecfa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,10 +1030,10 @@ internal static void NormalizedFloatToByteSaturate(
10301030
w2 = Vector128_.Clamp(w2, min, max);
10311031
w3 = Vector128_.Clamp(w3, min, max);
10321032

1033-
Vector128<short> u0 = Vector128.Narrow(w0, w1);
1034-
Vector128<short> u1 = Vector128.Narrow(w2, w3);
1033+
Vector128<ushort> u0 = Vector128.Narrow(w0, w1).AsUInt16();
1034+
Vector128<ushort> u1 = Vector128.Narrow(w2, w3).AsUInt16();
10351035

1036-
Unsafe.Add(ref destinationBase, i) = Vector128.Narrow(u0, u1).AsByte();
1036+
Unsafe.Add(ref destinationBase, i) = Vector128.Narrow(u0, u1);
10371037
}
10381038
}
10391039
}

0 commit comments

Comments
 (0)