This is an archive of the discontinued LLVM Phabricator instance.

[libc][NFC] Simplify memcpy implementation
ClosedPublic

Authored by gchatelet on May 20 2020, 5:07 AM.

Details

Summary

This is a NFC, it aims at simplifying both the code and build files.

Diff Detail

Event Timeline

gchatelet created this revision.May 20 2020, 5:07 AM
abrachet accepted this revision.May 21 2020, 2:07 PM
abrachet added inline comments.
libc/src/string/CMakeLists.txt
78

While we're here maybe we could call this LIBC_STRING_TARGET_DIR?

But as a second thought maybe we just call this LIBC_STRING_TARGET_ARCH. There are already a few places where we don't care about x86/x86_64. For example in memory_utils/CMakeLists.txt we can use the data file as cacheline_size_${LIBC_STRING_TARGET_ARCH}.h.inc and not need two identical cacheline_size files.

This revision is now accepted and ready to land.May 21 2020, 2:07 PM
sivachandra accepted this revision.May 24 2020, 9:30 PM
sivachandra added inline comments.
libc/src/string/CMakeLists.txt
78

+1.

gchatelet updated this revision to Diff 266165.May 26 2020, 4:36 AM
  • Address comments
This revision was automatically updated to reflect the committed changes.
tschuett added a comment.EditedMay 26 2020, 11:44 AM

Would it help the reader to say: The function is written in pure C++ *and not in assembler/intrinsics* for several reasons:

Shouldn't "kRepMovsBSize = -1" be "kRepMovsBSize =SIZE_MAX"?

libc/src/string/x86/memcpy.cpp