svn commit: r358439 - head/sys/amd64/include

Konstantin Belousov kostikbel at gmail.com
Mon Mar 2 18:27:05 UTC 2020


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 <melifaro at ipfw.ru> wrote:
> >
> > 28.02.2020, 18:32, "Ryan Libby" <rlibby at freebsd.org>:
> > > 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.


More information about the svn-src-all mailing list