string: Add internal memswap implementation
commitfccf38c51746e0817c2409bb361398f9465e0760
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 3 Oct 2023 12:22:45 +0000 (3 09:22 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 31 Oct 2023 17:17:33 +0000 (31 14:17 -0300)
tree7a2bda6afb6080ae03c68e84a99362ab125eca7e
parente3397cae92af83ddbf7b9cb89d8c18cb7382fde4
string: Add internal memswap implementation

The prototype is:

  void __memswap (void *restrict p1, void *restrict p2, size_t n)

The function swaps the content of two memory blocks P1 and P2 of
len N.  Memory overlap is NOT handled.

It will be used on qsort optimization.

Checked on x86_64-linux-gnu and aarch64-linux-gnu.
Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
string/Makefile
string/test-memswap.c [new file with mode: 0644]
sysdeps/generic/memswap.h [new file with mode: 0644]