[libc-commits] [libc] [libc] Process words in inline_strcmp 8 bytes at a time (PR #214363)
Michael Jones via libc-commits
libc-commits at lists.llvm.org
Mon Aug 17 10:20:42 PDT 2026
================
@@ -31,14 +67,45 @@ LIBC_INLINE constexpr int inline_strncmp(const char *left, const char *right,
if (n == 0)
return 0;
- // TODO: Look at benefits for comparing words at a time.
- for (; n > 1; --n, ++left, ++right) {
+ if (LIBC_UNLIKELY((reinterpret_cast<uintptr_t>(left) & 4095) > 4088 ||
+ (reinterpret_cast<uintptr_t>(right) & 4095) > 4088)) {
----------------
michaelrj-google wrote:
these should use the `PAGE_MASK` and `PAGE_SAFE_OFFSET` defined above
https://github.com/llvm/llvm-project/pull/214363
More information about the libc-commits
mailing list