tile: optimize memcmp

System Internals / glibc - Chris Metcalf [tilera.com] - 6 October 2014 10:20 UTC

Customize memcmp.c for tile, using similar tricks from memcpy:

- replace MERGE macro with dblalign.
- replace memcmp_bytes function with revbytes.
- use __glibc_likely.
- use post-increment addressing.

The schedule is still not perfect: the compiler is not hoisting code above the comparison branch, which could save a bundle or two. memcmp speeds up by 30-40% on shorter aligned tests in benchtest, with some tests with unaligned lengths taking a small performance hit.

d9cd52e tile: optimize memcmp
ChangeLog | 2 +
sysdeps/tile/memcmp.c | 367 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 369 insertions(+)

Upstream: sourceware.org


  • Share