From owner-freebsd-toolchain@FreeBSD.ORG Tue Dec 14 20:40:06 2010 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id CF7891065696; Tue, 14 Dec 2010 20:40:06 +0000 (UTC) Date: Tue, 14 Dec 2010 20:40:06 +0000 From: Alexander Best To: Dimitry Andric Message-ID: <20101214204006.GA81772@freebsd.org> References: <20101211114707.GA60390@freebsd.org> <4D051FD1.7070100@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D051FD1.7070100@FreeBSD.org> 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: Tue, 14 Dec 2010 20:40:06 -0000 On Sun Dec 12 10, Dimitry Andric wrote: > On 2010-12-11 12:47, Alexander Best wrote: > >clang doesn't seem to make use of -mfpmath=387 on ARCH=amd64 and complains > >about it (e.g. during TARGET=buildkernel). > > > >any thoughts about the attached patch? > > 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. 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. cheers. alex > > # For AMD64, we explicitly prohibit the use of FPU, SSE and other SIMD > # operations inside the kernel itself. These operations are exclusively > # reserved for user applications. > > However, according to the gcc manual, the -mfpmath option does *not* > disable FPU instructions at all, but simply switches the default (for > amd64) from SSE to 387 instructions: > > http://gcc.gnu.org/onlinedocs/gcc-4.2.4/gcc/i386-and-x86_002d64-Options.html#index-march-1052 > > Since -mno-sse is already specified, this flag may actually be worse > than not specifying it at all! :) > > I suggest to just remove the entire -mfpmath=387 option unconditionally. -- a13x