Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Sep 2018 19:50:29 +0200
From:      Jilles Tjoelker <jilles@stack.nl>
To:        Mark Millard <marklmi@yahoo.com>
Cc:        freebsd-arm <freebsd-arm@freebsd.org>, FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: FYI: devel/kyua 14 failures for head -r338518M based build in a Pine64+ 2GB (aarch64 / cortexA53 / A64) context
Message-ID:  <20180916175029.GA55717@stack.nl>
In-Reply-To: <CF050D05-FA7A-4AA8-8013-90EC1293F76C@yahoo.com>
References:  <C7047A90-89C6-4CB9-A1F2-339A6E1256A4@yahoo.com> <CF050D05-FA7A-4AA8-8013-90EC1293F76C@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Sep 11, 2018 at 08:48:03AM -0700, Mark Millard wrote:
> [Adding listing broken tests, but ignoring sys/cddl/zfs/ ones.
> lib/libc/string/memcmp_test:diff is one of them.]

> ===> Broken tests
> lib/libc/string/memcmp_test:diff  ->  broken: Premature exit; test case received signal 6 (core dumped)  [3.962s]

The problem here is that our definition of memcmp() is tighter than the
one in the standards and glibc. We define the return value to be the
difference between the first differing bytes, while the standards and
glibc only define the sign (negative, zero or positive).

Looking at contrib/cortex-strings/src/aarch64/memcmp.S, a
bic pos, pos, #7  after the clz may help.

On another note, the comment just below that,

        /* But we need to zero-extend (char is unsigned) the value and then
           perform a signed 32-bit subtraction.  */

shows a wrong reason for doing the right thing since memcmp (as well as
strcmp and strncmp) are defined to compare based on unsigned chars,
regardless of the signedness of char.

-- 
Jilles Tjoelker



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180916175029.GA55717>