From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29192 invoked by alias); 30 Jul 2012 21:55:29 -0000 Received: (qmail 29183 invoked by uid 22791); 30 Jul 2012 21:55:28 -0000 X-SWARE-Spam-Status: No, hits=-3.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,TW_MF,TW_MG,TW_MX X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 30 Jul 2012 21:55:12 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1Svxvj-0004Eh-Dw from Sandra_Loosemore@mentor.com ; Mon, 30 Jul 2012 14:55:11 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 30 Jul 2012 14:55:11 -0700 Received: from [IPv6:::1] (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.1.289.1; Mon, 30 Jul 2012 14:55:10 -0700 Message-ID: <501702C5.4020800@codesourcery.com> Date: Mon, 30 Jul 2012 22:27:00 -0000 From: Sandra Loosemore User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: , Subject: Re: [PATCH, MIPS] -mno-float odds and ends References: <5016BE96.9000106@codesourcery.com> <874nop2g5h.fsf@talisman.home> In-Reply-To: <874nop2g5h.fsf@talisman.home> Content-Type: multipart/mixed; boundary="------------020801080200020707060705" Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-07/txt/msg01518.txt.bz2 --------------020801080200020707060705 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 2108 On 07/30/2012 01:38 PM, Richard Sandiford wrote: > > ...unfortunately, it doesn't prevent the use floating-point operations. > That's why it's such a bad option. The only difference from the compiler > proper's point of view between -msoft-float and -mno-float is that they > define different preprocessor macros. > > The onus is instead on the programmer to avoid writing anything that > might tempt the compiler into using floating-point operations. If the > user gets it wrong, they get (at best) a link-time error rather than a > compile-time error. > > I think we should document it that way. E.g. something like: > > @item -mno-float > @opindex mno-float > Equivalent to @option{-msoft-float}, but asserts that the user is > trying to avoid all floating-point operations. This option is presently > supported only by some bare-metal MIPS configurations, where it selects > a special set of libraries that lack all floating-point support > (including, for example, the floating-point @code{printf} formats). > If code compiled with @code{-mno-float} accidentally contains > floating-point operations, it is likely to suffer a link-time > or run-time failure. > > but you're better at the wordsmithing than I am. OK, I've gone with a slightly tweaked version of your wording. > Perhaps we should document the __mips_no_float preprocessor macro too, > since that's how things like printf() know that they don't need the > floating-point stuff. Hmmm, I don't think that's necessary, at least as part of this patch; we don't document the related __mips_hard_float or __mips_soft_float preprocessor definitions, either. > The mips.h part is OK though, thanks. Feel free to apply it separately > if that's more convenient than keeping the patch together. I've checked in the attached version of the patch. Thanks for the speedy review! :-) -Sandra 2012-07-30 Sandra Loosemore Julian Brown gcc/ * doc/invoke.texi (MIPS Options): Document -mno-float. * config/mips/mips.h (MIPS_ARCH_FLOAT_SPEC): Make it know about -mno-float. --------------020801080200020707060705 Content-Type: text/x-patch; name="no-float.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="no-float.patch" Content-length: 2102 Index: gcc/doc/invoke.texi =================================================================== --- gcc/doc/invoke.texi (revision 189950) +++ gcc/doc/invoke.texi (working copy) @@ -733,7 +733,8 @@ Objective-C and Objective-C++ Dialects}. -mabi=@var{abi} -mabicalls -mno-abicalls @gol -mshared -mno-shared -mplt -mno-plt -mxgot -mno-xgot @gol -mgp32 -mgp64 -mfp32 -mfp64 -mhard-float -msoft-float @gol --msingle-float -mdouble-float -mdsp -mno-dsp -mdspr2 -mno-dspr2 @gol +-mno-float -msingle-float -mdouble-float @gol +-mdsp -mno-dsp -mdspr2 -mno-dspr2 @gol -mmcu -mmno-mcu @gol -mfpu=@var{fpu-type} @gol -msmartmips -mno-smartmips @gol @@ -15633,6 +15634,18 @@ Use floating-point coprocessor instructi Do not use floating-point coprocessor instructions. Implement floating-point calculations using library calls instead. +@item -mno-float +@opindex mno-float +Equivalent to @option{-msoft-float}, but additionally asserts that the +program being compiled does not perform any floating-point operations. +This option is presently supported only by some bare-metal MIPS +configurations, where it may select a special set of libraries +that lack all floating-point support (including, for example, the +floating-point @code{printf} formats). +If code compiled with @code{-mno-float} accidentally contains +floating-point operations, it is likely to suffer a link-time +or run-time failure. + @item -msingle-float @opindex msingle-float Assume that the floating-point coprocessor only supports single-precision Index: gcc/config/mips/mips.h =================================================================== --- gcc/config/mips/mips.h (revision 189950) +++ gcc/config/mips/mips.h (working copy) @@ -713,7 +713,7 @@ struct mips_cpu_info { link-compatible. */ #define MIPS_ARCH_FLOAT_SPEC \ - "%{mhard-float|msoft-float|march=mips*:; \ + "%{mhard-float|msoft-float|mno-float|march=mips*:; \ march=vr41*|march=m4k|march=4k*|march=24kc|march=24kec \ |march=34kc|march=74kc|march=1004kc|march=5kc \ |march=octeon|march=xlr: -msoft-float; \ --------------020801080200020707060705--