[libc] Add rep;movsb as an accelerator under x86

This commit is contained in:
Guillaume Chatelet 2021-10-08 14:31:55 +00:00
parent f256c39541
commit ad82fe7b28

View File

@ -163,6 +163,12 @@ using _64 = __llvm_libc::Repeated<_8, 8>;
using _128 = __llvm_libc::Repeated<_8, 16>;
#endif
struct Accelerator {
static void Copy(char *dst, const char *src, size_t count) {
asm volatile("rep movsb" : "+D"(dst), "+S"(src), "+c"(count) : : "memory");
}
};
} // namespace x86
} // namespace __llvm_libc