[libc-commits] [PATCH] D148717: [libc] Improve memcmp latency and codegen
Tue Ly via Phabricator via libc-commits
libc-commits at lists.llvm.org
Wed Jun 28 07:00:46 PDT 2023
lntue added inline comments.
================
Comment at: libc/src/string/memory_utils/utils.h:198-201
+ // cmp rdi, rsi <- serializing
+ // mov ecx, -5 <- can be done in parallel
+ // mov eax, 5 <- can be done in parallel
+ // cmovb eax, ecx <- serializing
----------------
I wonder what's the tradeoffs between this and what is generated for 1 and -1? If this is better, then the compiler should just use this for 1 and -1 also, right?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148717/new/
https://reviews.llvm.org/D148717
More information about the libc-commits
mailing list