From owner-svn-src-head@freebsd.org Tue Jan 14 17:10:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B290A1F13E5; Tue, 14 Jan 2020 17:10:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47xxm43zsTz4QRC; Tue, 14 Jan 2020 17:10:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from ivaldir.etoilebsd.net (etoilebsd.net [178.32.217.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 6C2A9D761; Tue, 14 Jan 2020 17:10:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by ivaldir.etoilebsd.net (Postfix, from userid 1001) id 896D8EB5DF; Tue, 14 Jan 2020 18:10:10 +0100 (CET) Date: Tue, 14 Jan 2020 18:10:10 +0100 From: Baptiste Daroussin To: Ian Lepore 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> References: <202001140822.00E8MS1b024516@repo.freebsd.org> <24cb346dd9f6de0f094dfa15c592d211e0d8f4a1.camel@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xijlhnbavvbfggyk" Content-Disposition: inline In-Reply-To: <24cb346dd9f6de0f094dfa15c592d211e0d8f4a1.camel@freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jan 2020 17:10:12 -0000 --xijlhnbavvbfggyk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 > >=20 > > Log: > > When system calls indicate an error they return -1, not some > > arbitrary > > value < 0. errno is only updated in this case. > > =20 >=20 > What's the point of these changes, other than almost certainly leading > to worse code generation? >=20 > 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). >=20 our diff has forked from the OpenBSD one. The goal of those patches is to k= eep in sync code that is still close to the original OpenBSD one as much as possible. Best regards, Bapt --xijlhnbavvbfggyk Content-Type: application/pgp-signature; name="signature.asc" -----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----- --xijlhnbavvbfggyk--