[libc-commits] [PATCH] D148717: [libc] Improve memcmp latency and codegen

Guillaume Chatelet via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Jun 27 02:40:50 PDT 2023


gchatelet reopened this revision.
gchatelet added a comment.
This revision is now accepted and ready to land.
Herald added a subscriber: wangpc.

Upon investigation the patch seems correct but some libraries need to be updated to conform to `memcmp` semantic.
One example is `sqlite3` which reverses ordering by negating the result of `memcmp`. Since signed arithmetic is not symmetric (e.g., `uint8_t` ∈ [-128, 127]) negating does not //negate// when value is `INT_MIN` (e.g., godbolt <https://godbolt.org/z/nYqvTn39z>).


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