From owner-freebsd-toolchain@FreeBSD.ORG Sun Dec 12 19:17:31 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 A7432106564A; Sun, 12 Dec 2010 19:17:31 +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 68D068FC24; Sun, 12 Dec 2010 19:17:31 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:6456:15d6:3f8:ec76] (unknown [IPv6:2001:7b8:3a7:0:6456:15d6:3f8:ec76]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 4BAA85C43; Sun, 12 Dec 2010 20:17:29 +0100 (CET) Message-ID: <4D051FD1.7070100@FreeBSD.org> Date: Sun, 12 Dec 2010 20:17:37 +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> In-Reply-To: <20101211114707.GA60390@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: Sun, 12 Dec 2010 19:17:31 -0000 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: # 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. 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 From owner-freebsd-toolchain@FreeBSD.ORG Fri Dec 17 12:25:56 2010 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id C36681065670; Fri, 17 Dec 2010 12:25:56 +0000 (UTC) Date: Fri, 17 Dec 2010 12:25:56 +0000 From: Alexander Best To: Dimitry Andric Message-ID: <20101217122556.GA33864@freebsd.org> References: <20101211114707.GA60390@freebsd.org> <4D051FD1.7070100@FreeBSD.org> <20101214204006.GA81772@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101214204006.GA81772@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: Fri, 17 Dec 2010 12:25:56 -0000 On Tue Dec 14 10, Alexander Best wrote: > 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. any update on this issue? anybody voting against removing -mfpmath=387 entirely? cheers. alex > > 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 -- a13x From owner-freebsd-toolchain@FreeBSD.ORG Fri Dec 17 13:58:36 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 5D61A1065673 for ; Fri, 17 Dec 2010 13:58:36 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from csmtp1.one.com (csmtp1.one.com [195.47.247.21]) by mx1.freebsd.org (Postfix) with ESMTP id EA4528FC1F for ; Fri, 17 Dec 2010 13:58:35 +0000 (UTC) Received: from [192.168.0.72] (0x573fa596.cpe.ge-1-1-0-1109.ronqu1.customer.tele.dk [87.63.165.150]) by csmtp1.one.com (Postfix) with ESMTP id 8ECB61BC00E29 for ; Fri, 17 Dec 2010 13:58:34 +0000 (UTC) From: Erik Cederstrand Content-Type: multipart/signed; boundary=Apple-Mail-653-754501679; protocol="application/pkcs7-signature"; micalg=sha1 Date: Fri, 17 Dec 2010 14:58:34 +0100 Message-Id: <1522403D-B109-48A2-8211-8BD683AEE77B@cederstrand.dk> To: freebsd-toolchain@freebsd.org Mime-Version: 1.0 (Apple Message framework v1082) X-Mailer: Apple Mail (2.1082) X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: -integrated-as status? 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 13:58:36 -0000 --Apple-Mail-653-754501679 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hello toolchainers, It is my understanding that -integrated-as is supposed to work for ELF = on FreeBSD now. Is anybody working on supporting this flag for = buildworld/kernel? I asked Michael Spencer about his work on the integrated linker = (llvm-ld), but it's still in the design phase and won't happen for at = least the next year. Thanks, Erik= --Apple-Mail-653-754501679-- From owner-freebsd-toolchain@FreeBSD.ORG Fri Dec 17 14:10:36 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 1698E106566B for ; Fri, 17 Dec 2010 14:10:36 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from csmtp3.one.com (csmtp3.one.com [91.198.169.23]) by mx1.freebsd.org (Postfix) with ESMTP id AC0838FC18 for ; Fri, 17 Dec 2010 14:10:35 +0000 (UTC) Received: from [192.168.0.72] (0x573fa596.cpe.ge-1-1-0-1109.ronqu1.customer.tele.dk [87.63.165.150]) by csmtp3.one.com (Postfix) with ESMTP id 4677F2406A42; Fri, 17 Dec 2010 14:10:33 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: multipart/signed; boundary=Apple-Mail-654-755219668; protocol="application/pkcs7-signature"; micalg=sha1 From: Erik Cederstrand In-Reply-To: <20101217140208.GA83558@freebsd.org> Date: Fri, 17 Dec 2010 15:10:32 +0100 Message-Id: <45B90472-1A41-4E05-A6F9-C314446FA665@cederstrand.dk> References: <1522403D-B109-48A2-8211-8BD683AEE77B@cederstrand.dk> <20101217140208.GA83558@freebsd.org> To: Roman Divacky X-Mailer: Apple Mail (2.1082) X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-toolchain@freebsd.org Subject: Re: -integrated-as status? 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 14:10:36 -0000 --Apple-Mail-654-755219668 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Den 17/12/2010 kl. 15.02 skrev Roman Divacky: > On Fri, Dec 17, 2010 at 02:58:34PM +0100, Erik Cederstrand wrote: >> Hello toolchainers, >>=20 >> It is my understanding that -integrated-as is supposed to work for = ELF on FreeBSD now. Is anybody working on supporting this flag for = buildworld/kernel? >=20 > -integrated-as works quite well for compiler produces .s files, it > has some problems with human written .s/.S files. >=20 > bottom line - it cant compile kernel right now but we are working on = it Cool, thanks! Erik= --Apple-Mail-654-755219668-- From owner-freebsd-toolchain@FreeBSD.ORG Fri Dec 17 14:19:21 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 1F778106564A for ; Fri, 17 Dec 2010 14:19:21 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id D0E178FC14 for ; Fri, 17 Dec 2010 14:19:20 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 22DE99CB0BC; Fri, 17 Dec 2010 15:02:09 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Us4N801k36JO; Fri, 17 Dec 2010 15:02:08 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 8BFE49CB166; Fri, 17 Dec 2010 15:02:08 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id oBHE28O0083804; Fri, 17 Dec 2010 15:02:08 +0100 (CET) (envelope-from rdivacky) Date: Fri, 17 Dec 2010 15:02:08 +0100 From: Roman Divacky To: Erik Cederstrand Message-ID: <20101217140208.GA83558@freebsd.org> References: <1522403D-B109-48A2-8211-8BD683AEE77B@cederstrand.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1522403D-B109-48A2-8211-8BD683AEE77B@cederstrand.dk> User-Agent: Mutt/1.4.2.3i Cc: freebsd-toolchain@freebsd.org Subject: Re: -integrated-as status? 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 14:19:21 -0000 On Fri, Dec 17, 2010 at 02:58:34PM +0100, Erik Cederstrand wrote: > Hello toolchainers, > > It is my understanding that -integrated-as is supposed to work for ELF on FreeBSD now. Is anybody working on supporting this flag for buildworld/kernel? -integrated-as works quite well for compiler produces .s files, it has some problems with human written .s/.S files. bottom line - it cant compile kernel right now but we are working on it roman From owner-freebsd-toolchain@FreeBSD.ORG Fri Dec 17 15:14: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 6322C1065670; Fri, 17 Dec 2010 15:14: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 224DC8FC17; Fri, 17 Dec 2010 15:14:47 +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 376165C43; Fri, 17 Dec 2010 16:14:46 +0100 (CET) Message-ID: <4D0B7E6C.8010008@FreeBSD.org> Date: Fri, 17 Dec 2010 16:14: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: Erik Cederstrand References: <1522403D-B109-48A2-8211-8BD683AEE77B@cederstrand.dk> <20101217140208.GA83558@freebsd.org> <45B90472-1A41-4E05-A6F9-C314446FA665@cederstrand.dk> In-Reply-To: <45B90472-1A41-4E05-A6F9-C314446FA665@cederstrand.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-toolchain@freebsd.org Subject: Re: -integrated-as status? 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:14:47 -0000 On 2010-12-17 15:10, Erik Cederstrand wrote: > Den 17/12/2010 kl. 15.02 skrev Roman Divacky: >> On Fri, Dec 17, 2010 at 02:58:34PM +0100, Erik Cederstrand wrote: >>> It is my understanding that -integrated-as is supposed to work for ELF on FreeBSD now. Is anybody working on supporting this flag for buildworld/kernel? >> -integrated-as works quite well for compiler produces .s files, it >> has some problems with human written .s/.S files. >> bottom line - it cant compile kernel right now but we are working on it > Cool, thanks! Note integrated-as is now the default for clang ToT (at least for ELF on i386/amd64) so when we import the next snapshot, we will get it automatically. 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. :) From owner-freebsd-toolchain@FreeBSD.ORG Sat Dec 18 15:48:45 2010 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 0C2611065696; Sat, 18 Dec 2010 15:48:45 +0000 (UTC) Date: Sat, 18 Dec 2010 15:48:45 +0000 From: Alexander Best To: Dimitry Andric Message-ID: <20101218154845.GA36640@freebsd.org> References: <20101211114707.GA60390@freebsd.org> <4D051FD1.7070100@FreeBSD.org> <20101214204006.GA81772@freebsd.org> <4D0B8178.9010609@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="GvXjxJ+pjyke8COw" Content-Disposition: inline In-Reply-To: <4D0B8178.9010609@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: Sat, 18 Dec 2010 15:48:45 -0000 --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri Dec 17 10, Dimitry Andric wrote: > 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. so this patch should keep clang from complaing while compiling the kernel and in addition to that won't have any impact on gcc. cheers. alex > > It would be nice if gcc/clang had an option "-mdie-on-any-fp", but they > don't, unfortunately. :) -- a13x --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="kern.mk.diff2" diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 4d8636c..e277b74 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -66,7 +66,7 @@ INLINE_LIMIT?= 15000 # .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -mcmodel=kernel -mno-red-zone \ - -mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow \ + -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow \ -msoft-float -fno-asynchronous-unwind-tables INLINE_LIMIT?= 8000 .endif --GvXjxJ+pjyke8COw-- From owner-freebsd-toolchain@FreeBSD.ORG Sat Dec 18 17:21:30 2010 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id C43BC1065679; Sat, 18 Dec 2010 17:21:30 +0000 (UTC) Date: Sat, 18 Dec 2010 17:21:30 +0000 From: Alexander Best To: Dimitry Andric Message-ID: <20101218172130.GA49738@freebsd.org> References: <20101211114707.GA60390@freebsd.org> <4D051FD1.7070100@FreeBSD.org> <20101214204006.GA81772@freebsd.org> <4D0B8178.9010609@FreeBSD.org> <20101218154845.GA36640@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="/04w6evG8XlLl3ft" Content-Disposition: inline In-Reply-To: <20101218154845.GA36640@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: Sat, 18 Dec 2010 17:21:30 -0000 --/04w6evG8XlLl3ft Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat Dec 18 10, Alexander Best wrote: > On Fri Dec 17 10, Dimitry Andric wrote: > > 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. > > so this patch should keep clang from complaing while compiling the kernel and > in addition to that won't have any impact on gcc. maybe sorting the options just like in the i386 section is a better to have more consistency. cheers. alex > > cheers. > alex > > > > > It would be nice if gcc/clang had an option "-mdie-on-any-fp", but they > > don't, unfortunately. :) > > -- > a13x > diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk > index 4d8636c..e277b74 100644 > --- a/sys/conf/kern.mk > +++ b/sys/conf/kern.mk > @@ -66,7 +66,7 @@ INLINE_LIMIT?= 15000 > # > .if ${MACHINE_CPUARCH} == "amd64" > CFLAGS+= -mcmodel=kernel -mno-red-zone \ > - -mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow \ > + -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow \ > -msoft-float -fno-asynchronous-unwind-tables > INLINE_LIMIT?= 8000 > .endif -- a13x --/04w6evG8XlLl3ft Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="kern.mk.diff3" diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 4d8636c..baed1b2 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -66,7 +66,7 @@ INLINE_LIMIT?= 15000 # .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -mcmodel=kernel -mno-red-zone \ - -mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow \ + -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ -msoft-float -fno-asynchronous-unwind-tables INLINE_LIMIT?= 8000 .endif --/04w6evG8XlLl3ft--