Van: Baptiste Daroussin <b...@freebsd.org>
Datum: dinsdag, 14 januari 2020 18:10
Aan: Ian Lepore <i...@freebsd.org>
CC: svn-src-h...@freebsd.org, firstname.lastname@example.org,
Onderwerp: Re: svn commit: r356725 - head/usr.bin/diff
On Tue, Jan 14, 2020 at 08:44:29AM -0700, Ian Lepore wrote:
> On Tue, 2020-01-14 at 08:22 +0000, Baptiste Daroussin wrote:
> > Author: bapt
> > Date: Tue Jan 14 08:22:28 2020
> > New Revision: 356725
> > URL: https://svnweb.freebsd.org/changeset/base/356725
> > Log:
> > When system calls indicate an error they return -1, not some
> > arbitrary
> > value < 0. errno is only updated in this case.
> What's the point of these changes, other than almost certainly leading
> to worse code generation?
> In most instruction sets, you can test for a value < 0 without using
> any instructions, you only need to examine the condition flags after
> loading the value. To compare equal to -1 typically requires at least
> 1 extra instruction, and on risc architectures typically at least two
> extra (load -1 to a register then compare).
our diff has forked from the OpenBSD one. The goal of those patches is to keep
in sync code that is still close to the original OpenBSD one as much as
This is a nice example that it is valuable to describe in the commit message *why* a
commit is made. Or "the goal" of the patches.
email@example.com mailing list
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"