From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18459 invoked by alias); 15 Oct 2002 04:01:59 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 18452 invoked from network); 15 Oct 2002 04:01:59 -0000 Received: from unknown (HELO localhost.localdomain) (66.60.148.227) by sources.redhat.com with SMTP; 15 Oct 2002 04:01:59 -0000 Received: from warlock.codesourcery.com (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.11.6/8.11.6) with ESMTP id g9F3xdh01205; Mon, 14 Oct 2002 20:59:39 -0700 Date: Mon, 14 Oct 2002 22:22:00 -0000 From: Mark Mitchell To: Zack Weinberg , David Edelsohn cc: Stefan Bylund , gcc@gcc.gnu.org Subject: Re: GCC floating point usage Message-ID: <10330000.1034649460@localhost> In-Reply-To: <20021014165900.GC3271@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-SW-Source: 2002-10/txt/msg00778.txt.bz2 --On Monday, October 14, 2002 09:59:00 AM -0700 Zack Weinberg wrote: > On Mon, Oct 14, 2002 at 12:37:14PM -0400, David Edelsohn wrote: >> >>>>> Stefan Bylund writes: >> >> Stefan> Is it possible to somehow instruct GCC to only generate >> Stefan> floating point instructions for C/C++ float/double >> Stefan> operations and not for internal non-floating point >> Stefan> optimizations etc? >> >> If you do not want to use the FPU, then invoke the compiler with >> the -msoft-float PowerPC option. If the FPRs are present and it is >> efficient to use them, the compiler will use them. > > Come now, what he wants is not unreasonable. "If floating point > operations appeared in the source code, generate hardware floating > point instructions; otherwise, generate only integer-unit > instructions." I (that is, CodeSourcery) have a customer that needs > precisely this; in fact I posted a patch to implement it for PPC last > fall. Now seems like a reasonable time to bring this issue back up. I agree, on all points: (1) Clearly, many people have a real need for this fuctionality. (2) You are correct; if the user has told the compiler not to use hardware FP unless floating point operations appear in the code, then the MD should not pretend it knows how to do moves that it can only do with FP registers. With the caveat that you perserve the current default behavior, the patch is OK for the b-i-b, assuming that you do not hear objections from the RS6000 maintainers within a couple of days. If they do object, we will figure out what to do. -- Mark Mitchell mark@codesourcery.com CodeSourcery, LLC http://www.codesourcery.com