compiler-rt: remove len == 1 memcpy branch

This commit is contained in:
dweiller 2024-11-20 15:12:50 +11:00
parent a09acd2484
commit 8688b0a3cf

View File

@ -51,9 +51,10 @@ fn memcpy_fast(noalias dest: ?[*]u8, noalias src: ?[*]const u8, len: usize) call
if (len < 16) {
if (len < 4) {
if (len == 0) return dest;
const a = len & 2;
const b = a / 2;
dest.?[0] = src.?[0];
if (len == 1) return dest;
dest.?[1] = src.?[1];
dest.?[b] = src.?[b];
dest.?[len - 1] = src.?[len - 1];
return dest;
}