[libc-commits] [libc] 791d88f - [libc] Align to 32B instead of 16B for optimized memcmp

Guillaume Chatelet via libc-commits libc-commits at lists.llvm.org
Fri Aug 20 06:09:47 PDT 2021


Author: Guillaume Chatelet
Date: 2021-08-20T13:09:35Z
New Revision: 791d88f35f93c3b728bc263ff8e9826852b828be

URL: https://github.com/llvm/llvm-project/commit/791d88f35f93c3b728bc263ff8e9826852b828be
DIFF: https://github.com/llvm/llvm-project/commit/791d88f35f93c3b728bc263ff8e9826852b828be.diff

LOG: [libc] Align to 32B instead of 16B for optimized memcmp

Added: 
    

Modified: 
    libc/src/string/memcmp.cpp

Removed: 
    


################################################################################
diff  --git a/libc/src/string/memcmp.cpp b/libc/src/string/memcmp.cpp
index 2bb9552d9361..bb2b5e2f3779 100644
--- a/libc/src/string/memcmp.cpp
+++ b/libc/src/string/memcmp.cpp
@@ -39,7 +39,7 @@ static int memcmp_impl(const char *lhs, const char *rhs, size_t count) {
     return ThreeWayCompare<HeadTail<_32>>(lhs, rhs, count);
   if (count <= 128)
     return ThreeWayCompare<HeadTail<_64>>(lhs, rhs, count);
-  return ThreeWayCompare<Align<_16>::Then<Loop<_32>>>(lhs, rhs, count);
+  return ThreeWayCompare<Align<_32>::Then<Loop<_32>>>(lhs, rhs, count);
 }
 
 LLVM_LIBC_FUNCTION(int, memcmp,


        


More information about the libc-commits mailing list