From owner-freebsd-arch@FreeBSD.ORG Fri Jan 21 06:15:19 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85BCF1065673 for ; Fri, 21 Jan 2011 06:15:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 0B0F38FC18 for ; Fri, 21 Jan 2011 06:15:18 +0000 (UTC) Received: from c122-106-165-206.carlnfd1.nsw.optusnet.com.au (c122-106-165-206.carlnfd1.nsw.optusnet.com.au [122.106.165.206]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p0L6FBJM017016 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 21 Jan 2011 17:15:13 +1100 Date: Fri, 21 Jan 2011 17:15:11 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Matthew Jacob In-Reply-To: <4D38D49A.2010909@feral.com> Message-ID: <20110121162202.S2816@besplex.bde.org> References: <4D38CAEE.2060705@feral.com> <4D38D49A.2010909@feral.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-arch@freebsd.org Subject: Re: removing -frename-registers from sys/conf.mk X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 06:15:19 -0000 On Thu, 20 Jan 2011, Matthew Jacob wrote: > Never mind this ill thought out request. > > On 1/20/2011 3:53 PM, Matthew Jacob wrote: >> It helps substantially in trying to debug amd64 kernels to remove this >> flag. >> >> Has anyone heard of a good reason we need to keep this? Whom else should I >> ask? What's ill-thought out about it? It may be bad for debugging, but can hardly be as bad as -O2 and a couple other optimizations now under -O, at least with ddb. gdb with full debugging info can sometimes follow when the code was reordered, but it has to show all the reordering when stepping. I didn't know about -frename-registers and just tried it on libm. It gives only pessimizations of up to 60% on (uncommitted) log functions in the float precision case. This turned out to be just a pessimization that I've seen before and had worked around, but the workaround stopped working with -frename-registers. gcc and clang in FreeBSD don't really understand SSE, so they like to try to generate partial register stalls, which cost 20-30 cycles on at least AthlonXP, Athlon64 and core2. Fortunately, the stall doesn't occur in most cases where it might happen. Bruce