From owner-svn-src-head@freebsd.org Fri Feb 15 15:27:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 248D614DE4EE; Fri, 15 Feb 2019 15:27:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 8C8C96E78A; Fri, 15 Feb 2019 15:27:21 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 08CFE10588B1; Sat, 16 Feb 2019 02:27:19 +1100 (AEDT) Date: Sat, 16 Feb 2019 02:27:17 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344118 - head/sys/i386/include In-Reply-To: <20190215140409.GQ24863@kib.kiev.ua> Message-ID: <20190216022142.I2745@besplex.bde.org> References: <201902141353.x1EDrB0Z076223@repo.freebsd.org> <20190215071604.GA89653@FreeBSD.org> <20190215103644.GN24863@kib.kiev.ua> <20190215233444.F2229@besplex.bde.org> <20190215140409.GQ24863@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=UJetJGXy c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=FUjRFFY_C4EnPHvrLvMA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 8C8C96E78A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.92)[-0.921,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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: Fri, 15 Feb 2019 15:27:22 -0000 On Fri, 15 Feb 2019, Konstantin Belousov wrote: > On Sat, Feb 16, 2019 at 12:27:16AM +1100, Bruce Evans wrote: >> On Fri, 15 Feb 2019, Konstantin Belousov wrote: >> >>> On Fri, Feb 15, 2019 at 07:16:04AM +0000, Alexey Dokuchaev wrote: >>>> Is there a reason to prefer pushl+movl+popl instead of movl+xchgl? >>> ... >>> xchgl seems to be slower even in registers format (where no implicit >>> lock is used). If you can demonstrate that your fragment is better in >>> some microbenchmark, I can change it. But also note that its use is not >>> on the critical path. >> >> The should have the same speed on modern x86. xchgl %reg1,%reg2 is >> not slow, but it changes 2 visible registers and a needs somwhere to >> hold one of the registers while changing it, so on 14 year old AthlonXP >> ... > I think on modern Intels xchgl is implemented by renaming. Still it is slower > than typically highly optimized push/pops. > > That said, what is your preference ? My version or xchgl ? > My own preference is to leave it as is, since it is slightly slower, > and I do not want to spend several hours again, re-testing libc changes. I like the push/pop instructions, so like it like it is. Bruce