From owner-freebsd-toolchain@FreeBSD.ORG Fri Dec 17 15:27:47 2010 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E2971065670; Fri, 17 Dec 2010 15:27:47 +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 E28748FC34; Fri, 17 Dec 2010 15:27:46 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:69eb:75a0:fbff:997] (unknown [IPv6:2001:7b8:3a7:0:69eb:75a0:fbff:997]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 3EFD85C43; Fri, 17 Dec 2010 16:27:46 +0100 (CET) Message-ID: <4D0B8178.9010609@FreeBSD.org> Date: Fri, 17 Dec 2010 16:27:52 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.14pre) Gecko/20101211 Lanikai/3.1.8pre MIME-Version: 1.0 To: Alexander Best References: <20101211114707.GA60390@freebsd.org> <4D051FD1.7070100@FreeBSD.org> <20101214204006.GA81772@freebsd.org> In-Reply-To: <20101214204006.GA81772@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-toolchain@freebsd.org Subject: Re: clang and -mfpmath=387 on ARCH=amd64 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 15:27:47 -0000 On 2010-12-14 21:40, Alexander Best wrote: > On Sun Dec 12 10, Dimitry Andric wrote: ... >> I have compiled two GENERIC kernels on amd64 with and without the >> -mfpmath=386 option, and those resulted in exactly the same binaries >> (apart from the compilation timestamp). >> >> So I think the whole -mfpmath=387 option is nonsensical anyway. The >> comment just above those CFLAGS in sys/conf/kern.mk says: > > i think for i386 the case is clear: -mfpmath=387 *is* the default. for amd64 it > depends. On amd64 -mfpmath=sse is the default. However, floating point is not allowed at all in the kernel, and even if it were used, it would result in a compile error, because -mno-sse is also used. You can verify this by compiling a small program on amd64 that uses floating point, and passing the -mno-sse option. > if we can be sure that the -mno-sse[2-3]? options will set > -mfpmath=387 there is no need to set -mfpmath=387. it seems from your tests and > also from a logical sense of point that this is the case. however the gcc > manual doesn't really state this matter. so it could in fact be possible that > even with -mno-sse[2-3]? set, -mfpmath=sse remains the default setting for > amd64. Yes it is the default; but as I said, it makes no difference. Neither i387 nor sse hardware FP instructions should ever be generated in the kernel. It would be nice if gcc/clang had an option "-mdie-on-any-fp", but they don't, unfortunately. :)