Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address comments
  • Loading branch information
Prashanth Govindarajan committed Jul 28, 2020
commit 9c2b8a7f0e9ef55a6c386f1c915c8b01f83d326d
Original file line number Diff line number Diff line change
Expand Up @@ -1006,14 +1006,11 @@ private static void NarrowFourUtf16CharsToAsciiAndWriteToBuffer(ref byte outputB
else if (AdvSimd.Arm64.IsSupported)
{
// Narrows a vector of words [ w0 w1 w2 w3 ] to a vector of bytes
// [ b0 b1 b2 b3 b0 b1 b2 b3 ], then writes 4 bytes (32 bits) to the destination.
// [ b0 b1 b2 b3 * * * * ], then writes 4 bytes (32 bits) to the destination.

Vector128<short> vecWide = Vector128.CreateScalarUnsafe(value).AsInt16();
Vector64<byte> lower = AdvSimd.ExtractNarrowingSaturateUnsignedLower(vecWide);
unsafe
{
AdvSimd.StoreSelectedScalar((byte*)Unsafe.AsPointer(ref outputBuffer), lower, 0);
}
Unsafe.WriteUnaligned<uint>(ref outputBuffer, lower.AsUInt32().ToScalar());
}

else
Expand Down