From owner-svn-src-head@FreeBSD.ORG Sun Jan 1 16:49:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E6E7106564A; Sun, 1 Jan 2012 16:49:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id E10C48FC0A; Sun, 1 Jan 2012 16:49:35 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:e165:a097:747b:93eb] (unknown [IPv6:2001:7b8:3a7:0:e165:a097:747b:93eb]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 3365A5C37; Sun, 1 Jan 2012 17:49:35 +0100 (CET) Message-ID: <4F008EA0.3080800@FreeBSD.org> Date: Sun, 01 Jan 2012 17:49:36 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201112221503.pBMF3m0w021930@svn.freebsd.org> <20120101020442.GA94452@zim.MIT.EDU> In-Reply-To: <20120101020442.GA94452@zim.MIT.EDU> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r228801 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 01 Jan 2012 16:49:36 -0000 On 2012-01-01 03:04, David Schultz wrote: > On Thu, Dec 22, 2011, Dimitry Andric wrote: >> Remove -mfancy-math from LIB32CPUFLAGS for amd64. It has been default >> for our gcc since more than three years (see r181534, which is also in >> stable/9 and stable/8). This flag used to be for the benefit of the old >> in-kernel math emulator, which was removed more than eight years ago. > > Quite the opposite, actually. gcc/freebsd used to be hard-coded to > use -mno-fancy-math-387 by default, which was really only appropriate for > FPUless x86 chips back when FreeBSD supported them. The makefile > setting overrides the old gcc default. The flag isn't "for the > benefit of the in-kernel math emulator"; it's actually to reap the > benefits of *not* having an in-kernel math emulator! > > Do you know if clang has the correct default here, or if it picked up > trunk gcc's bogus default? It doesn't seem to support the flag to > change the behavior, and it seems to default to -mno-fancy-math-387. > (The flag should only affect things when -ffast-math is also specified.) As far as I can see, clang always generates calls to sin(), cos() etc. It never inlines them to direct 387 instructions. Isn't that what we want? In any case, I don't see a quick way of getting it to emit 387 instructions directly. It simply looks like it is not supported. The -funsafe-math-optimizations is not recognized, and the -ffast-math option is accepted, but ignored.