[libc-commits] [PATCH] D74397: [libc] Adding memcpy implementation for x86_64
Alex Brachet via Phabricator via libc-commits
libc-commits at lists.llvm.org
Tue Feb 11 22:44:31 PST 2020
abrachet added inline comments.
================
Comment at: libc/src/string/memcpy_x86_64.cpp:16
+static void CopyRepMovsb(char *dst, const char *src, size_t count) {
+ LIBC_INLINE_ASM("rep movsb" : "+c"(count), "+S"(src), "+D"(dst) : : "memory");
+}
----------------
MaskRay wrote:
> `LIBC_INLINE_ASM` does not improve readability.
>
> `asm volatile`
>
> Any reason using constraint modifier `+`? It adds two operands, one input and one output. Just use `"D"(dst), "S"(src), "c"(count)`
+1 I think the reasoning behind the macro is for MSVC, which as far as I can tell doesn't support GCC's syntax anyway https://docs.microsoft.com/en-us/cpp/assembler/inline/asm?view=vs-2019
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74397/new/
https://reviews.llvm.org/D74397
More information about the libc-commits
mailing list