Skip to content

Commit d9126ea

Browse files
Attempt to fix left shift
1 parent 4c47a78 commit d9126ea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ImageSharp/Common/Helpers/Vector128Utilities.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ public static Vector128<byte> ShiftRightBytesInVector(Vector128<byte> value, [Co
111111
{
112112
if (Sse2.IsSupported)
113113
{
114-
return Sse2.ShiftRightLogical128BitLane(value, numBytes);
114+
#pragma warning disable CA1857 // A constant is expected for the parameter
115+
return Sse2.ShiftRightLogical128BitLane(value, (byte)(16 - numBytes));
116+
#pragma warning restore CA1857 // A constant is expected for the parameter
115117
}
116118

117119
if (AdvSimd.IsSupported)

0 commit comments

Comments
 (0)