Skip to content

Commit

Permalink
Remove >>> workaround now that dotnet#86841 is merged
Browse files Browse the repository at this point in the history
  • Loading branch information
MihaZupan committed Aug 4, 2023
1 parent 57f2c3b commit 5f46a3a
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,7 @@ private static (Vector128<byte> Low, Vector128<byte> High) GetNibbles(Vector128<
? input
: input & Vector128.Create((byte)0xF);

// X86 doesn't have a logical right shift intrinsic for bytes: https://github.com/dotnet/runtime/issues/82564
Vector128<byte> high = AdvSimd.IsSupported
? AdvSimd.ShiftRightLogical(input, 4)
: (input.AsInt32() >>> 4).AsByte() & Vector128.Create((byte)0xF);
Vector128<byte> high = input >>> 4;

return (low, high);
}
Expand All @@ -211,8 +208,7 @@ private static (Vector256<byte> Low, Vector256<byte> High) GetNibbles(Vector256<
// of doing an implicit 'AND 0xF' in order to skip the redundant AND.
Vector256<byte> low = input;

// X86 doesn't have a logical right shift intrinsic for bytes: https://github.com/dotnet/runtime/issues/82564
Vector256<byte> high = (input.AsInt32() >>> 4).AsByte() & Vector256.Create((byte)0xF);
Vector256<byte> high = input >>> 4;

return (low, high);
}
Expand All @@ -224,8 +220,7 @@ private static (Vector512<byte> Low, Vector512<byte> High) GetNibbles(Vector512<
// of doing an implicit 'AND 0xF' in order to skip the redundant AND.
Vector512<byte> low = input;

// X86 doesn't have a logical right shift intrinsic for bytes: https://github.com/dotnet/runtime/issues/82564
Vector512<byte> high = (input.AsInt32() >>> 4).AsByte() & Vector512.Create((byte)0xF);
Vector512<byte> high = input >>> 4;

return (low, high);
}
Expand Down

0 comments on commit 5f46a3a

Please sign in to comment.