Skip to content
Commit c8391752 authored by Lexi Shao's avatar Lexi Shao Committed by Szabolcs Nagy
Browse files

aarch64: fix strcpy and strnlen for big-endian [BZ #25824]



This patch fixes the optimized implementation of strcpy and strnlen
on a big-endian arm64 machine.

The optimized method uses neon, which can process 128bit with one
instruction. On a big-endian machine, the bit order should be reversed
for the whole 128-bits double word. But with instuction
	rev64	datav.16b, datav.16b
it reverses 64bits in the two halves rather than reversing 128bits.
There is no such instruction as rev128 to reverse the 128bits, but we
can fix this by loading the data registers accordingly.

Fixes 0237b615("aarch64: Optimized implementation of strcpy") and
2911cb68("aarch64: Optimized implementation of strnlen").

Signed-off-by: default avatarLexi Shao <shaolexi@huawei.com>
Reviewed-by: default avatarSzabolcs Nagy <szabolcs.nagy@arm.com>
(cherry picked from commit 59b64f9c)
parent 10947412
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment