Date: Tue, 14 Jan 2020 18:10:10 +0100 From: Baptiste Daroussin <bapt@FreeBSD.org> To: Ian Lepore <ian@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r356725 - head/usr.bin/diff Message-ID: <20200114171010.zdxpwpawn7mogaqy@ivaldir.net> In-Reply-To: <24cb346dd9f6de0f094dfa15c592d211e0d8f4a1.camel@freebsd.org> References: <202001140822.00E8MS1b024516@repo.freebsd.org> <24cb346dd9f6de0f094dfa15c592d211e0d8f4a1.camel@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] 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 possible. Best regards, Bapt [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAl4d9e8ACgkQY4mL3PG3 PloJJhAAq9sd849eoyglZw4YMZ1dJ/YOeS6iz0fICptfdUyBT0w69AUsnR2ijFuR GREfAhsqqHrO5DK/xkMHWAldKpWQohTxN1y5qWtPrNy2nu0U7NthxZDM9VRGOhJ5 tk/ZbYPAy/YRG22fFvtaJqBnmRVAsnZFyzZmleDKWPJ3qEGoNiGXCGFFgd34BKaK A5LbjCswYagnySWz/O4rO8RS1wwgdwd6bkfF0Gb1jCppbv1TnNX720BP1+rS6dpk mXszdl2hTBEIQ+DlVYjALwtt2ED8KUmYZYI8LSgN+1rCeCi7dPsChaetrjeRE9NG tSHnEtblGMTWOjvXSxJS7LaHtsZ0Np4RzEJHdwc/Wmy3RijiU/7pEJ9/ldYeptuN WBQPUKHqgzswBW8jJfyog5Q8uevh2NG1BiZL6uFoKwd8Oc4YEB1+j0EypJbus2xo wcwJQcrbMxHwdtQA6v3IsKZGlpSYvEca7aZ4gTyk1AIC374ODfdR9B2DDKj8dr43 G2tGhOi/KDZtGeLWJGTz1KmHOlJFlG5YEH8B/0zP1069LvSbcJ1L525O7lIlvu0p r/1aJFoZ+AiFd1kGhJlgc8O1Xhide4TxGnI7rcZRdpdJVXCvMJET3gTeYSrJT4Ar lh+W8XCEYsaugjECV18+Mt7dedleCyeQ3F1PhG2ocVM7knOH2f8= =7R7p -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200114171010.zdxpwpawn7mogaqy>
