From owner-svn-src-all@freebsd.org Mon Mar 2 18:27:05 2020 Return-Path: Delivered-To: svn-src-all@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 83C68256A7B; Mon, 2 Mar 2020 18:27:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48WTBc2Q7Qz4q4M; Mon, 2 Mar 2020 18:27:04 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 022IQrDO031971 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 2 Mar 2020 20:26:56 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 022IQrDO031971 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 022IQr8M031970; Mon, 2 Mar 2020 20:26:53 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 2 Mar 2020 20:26:53 +0200 From: Konstantin Belousov To: "Alexander V. Chernikov" Cc: Ryan Libby , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r358439 - head/sys/amd64/include Message-ID: <20200302182653.GQ29554@kib.kiev.ua> References: <202002281832.01SIWaEL071685@repo.freebsd.org> <5767791583138727@sas1-c7aad230fe87.qloud-c.yandex.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 48WTBc2Q7Qz4q4M X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.98 / 15.00]; NEURAL_HAM_MEDIUM(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2020 18:27:05 -0000 On Mon, Mar 02, 2020 at 09:13:53AM -0800, Ryan Libby wrote: > On Mon, Mar 2, 2020 at 12:45 AM Alexander V. Chernikov wrote: > > > > 28.02.2020, 18:32, "Ryan Libby" : > > > Author: rlibby > > > Date: Fri Feb 28 18:32:36 2020 > > > New Revision: 358439 > > > URL: https://svnweb.freebsd.org/changeset/base/358439 > > > > > > Log: > > > amd64 atomic.h: minor codegen optimization in flag access > > > > > > Previously the pattern to extract status flags from inline assembly > > > blocks was to use setcc in the block to write the flag to a register. > > > This was suboptimal in a few ways: > > > - It would lead to code like: sete %cl; test %cl; jne, i.e. a flag > > > would just be loaded into a register and then reloaded to a flag. > > > - The setcc would force the block to use an additional register. > > > - If the client code didn't care for the flag value then the setcc > > > would be entirely pointless but could not be eliminated by the > > > optimizer. > > > > > > A more modern inline asm construct (since gcc 6 and clang 9) allows for > > This effectively restricts kernel builds by all older compilers. > > Is there any chance of making it conditional depending on the compiler version/features? What is the older compiler you need to use for base system ? And why ? > > Yes, it is possible to test for __GCC_ASM_FLAG_OUTPUTS__. It is more > maintenance effort going forward. If building current with an old cross > compiler is an important scenario, we can either revert this and the > following revision or work up a patch to make it conditional. I'll see > what that might look like.