This is an archive of the discontinued LLVM Phabricator instance.

[libc] Add memcmp implementation.
ClosedPublic

Authored by cheng.w on Dec 10 2020, 12:30 AM.

Diff Detail

Event Timeline

cheng.w created this revision.Dec 10 2020, 12:30 AM
cheng.w requested review of this revision.Dec 10 2020, 12:30 AM
cheng.w added inline comments.Dec 10 2020, 12:40 AM
libc/src/string/memcmp.cpp
16

There is a TODO in strcmp.cpp (reviews.llvm.org/D82134) about speeding up. I did not find out the answer. Should I leave a TODO here too?

This simple implementation is probably OK to start with. But, I will add @gchatelet as he might also be having plans to add optimized versions of memcmp.

gchatelet accepted this revision.Dec 14 2020, 12:53 AM
gchatelet added inline comments.
libc/src/string/memcmp.cpp
16

Yes please, let's add the TODO in the meantime (I have an optimized version to contribute).

23

[nit] No need for the dot / Capitalization.
count is 0 or _lhs and _rhs are the same.

This revision is now accepted and ready to land.Dec 14 2020, 12:53 AM

Thanks Siva, have a nice holiday!

cheng.w updated this revision to Diff 311516.Dec 14 2020, 1:25 AM
cheng.w marked 2 inline comments as done.Dec 14 2020, 1:33 AM

Thanks Chatelet, I thought you started holiday.
Add TODO, fix nit.

This revision was automatically updated to reflect the committed changes.