aarch64 SVE emulation breaks strnlen and strrchr
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Richard Henderson |
Bug Description
arm optimized-routines have sve string functions with test code.
the test worked up until recently: with qemu-5.2.0 i see
$ qemu-aarch64 build/bin/
PASS strnlen
PASS __strnlen_aarch64
__strnlen_
input: "abcdefghijklmn
__strnlen_
input: "abcdefghijklmn
__strnlen_
input: "abcdefghijklmn
__strnlen_
input: "abcdefghijklmn
__strnlen_
input: "abcdefghijklmn
__strnlen_
input: "abcdefghijklmn
__strnlen_
input: "abcdefghijklmn
__strnlen_
input: "abcdefghijklmn
__strnlen_
input: "abcdefghijklmn
__strnlen_
input: "abcdefghijklmn
FAIL __strnlen_
however the test passes with
qemu-aarch64 -cpu max,sve-max-vq=2
there should be nothing vector length specific in the code.
i haven't debugged it further, to reproduce the issue clone
https:/
and run 'make build/bin/
SUBS = string
ARCH = aarch64
CROSS_COMPILE = aarch64-
CC = $(CROSS_COMPILE)gcc
CFLAGS = -std=c99 -pipe -O3
CFLAGS += -march=
EMULATOR = qemu-aarch64
(native compilation works too, and you can run 'make check' to
run all string tests) this will build a static linked executable
into build/bin/test. if you want a smaller test case edit
string/
Changed in qemu: | |
status: | New → Confirmed |
assignee: | nobody → Richard Henderson (rth) |
I don't know why the test worked previously, and I did not
investigate, but as far as I can tell, the test is broken.
The test is returning a value >= maxlen because it it using
the wrong increment. Fixed thus.