From owner-freebsd-sparc64@FreeBSD.ORG Fri Feb 2 20:36:57 2007 Return-Path: X-Original-To: freebsd-sparc64@freebsd.org Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D7DC016A401 for ; Fri, 2 Feb 2007 20:36:57 +0000 (UTC) (envelope-from evultrole@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.168]) by mx1.freebsd.org (Postfix) with ESMTP id 4EA8D13C47E for ; Fri, 2 Feb 2007 20:36:57 +0000 (UTC) (envelope-from evultrole@gmail.com) Received: by ug-out-1314.google.com with SMTP id o2so841666uge for ; Fri, 02 Feb 2007 12:36:56 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=ddubRoqCOlMlWtf7/z4p2KiJ48u53R/Y35uxX/vbcjMWrTrzKPnBDg7Xv8ixuWfr0cZglIZ1Ynida11ibyQhN4FBn52CwE8MHmaJjlQPDDNJRrigaE9V5VAETX73Pl9tErlJ4VSKnYdpkxosF290lQygCpUPv+63cTSZX5owkso= Received: by 10.78.204.7 with SMTP id b7mr865704hug.1170447176040; Fri, 02 Feb 2007 12:12:56 -0800 (PST) Received: by 10.78.184.7 with HTTP; Fri, 2 Feb 2007 12:12:56 -0800 (PST) Message-ID: <340594530702021212x63266109yf2f1d4b7b5833c9e@mail.gmail.com> Date: Fri, 2 Feb 2007 12:12:56 -0800 From: "Steven Hillis" To: freebsd-sparc64@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: good (working) CFLAGS for SPARC64 (Christian Baer) X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Feb 2007 20:36:58 -0000 Chris, I've personally had some success with the following: -O2 -mcpu=ultrasparc -pipe -fomit-frame-pointer -ffast-math -finline-functions -fweb -frename-registers -mapp-regs Now, I'm pretty sure there are people who would scold me about a few of those uses, mapp-regs and fast-math specifically, but I don't have any troubles as a result of them in what I do... I don't know the default setting of mapp-regs, it varies from system to system (on in Linux, off in Solaris, dunno in any BSD), this may be an unneeded flag. Likewise, fomit-frame-pointer may be enabled by default or it may not, depends on how gcc may decide if "doing so does not interfere with debugging"... I personally don't care half a crap about debugging, so I stick it in just to be sure. Most of the extra flags in there mess up debugging, so toss them out if you care about that. Really I guess most of that is either just being sure something is enabled or going a little past -O3 without the funswitch-loops bit (I don't like that option so I don't use it, don't ask me why, it's completely irrational, I don't even know what it does. It broke a program one time during compile and I've never used it since.) Also, the fact that I get it to compile and run everything with those flags may be a complete fluke, I've had problems with -O3 in the past (when -O was the most recommended on the kernel) and I don't know what has changed since, but what I have enabled now seems to be ok for me. Also, I don't use -m64 as there is no 32-bit environment support in FreeBSD-Sparc64 anyway, so it seems that adding it would be... redundant? if this is not the case someone please chime in. I don't claim to know how longs and pointers are set in binaries by default, it just seems it would be the case. Message: 1 > Date: Thu, 1 Feb 2007 13:52:25 +0100 (CET) > From: Christian Baer > Subject: good (working) CFLAGS for SPARC64 > To: freebsd-sparc64@freebsd.org > Message-ID: > > Hello everybody! :-) > > I've been reading up a little on how to make my system a little faster. > If you are running some Core2 Duo or a fast AMD64, you might not bother > to even think about this, as the system will be fast enough "as is". But > the fastest CPUs supported by FreeBSD are UltraSPARC II with 450MHz, > probably making the U60 and U80 the fastest current SPARC64 machines for > FreeBSD. Just the same, my U60 with 2GB auf RAM and 2 450MHz CPUs isn't > exactly Formular 1. :-) > > Since the SPARC plattform in general seems to benifit a great deal from > optimization flags at compile time (much more than i386) I thought it > might be a good idea to look at a few options. > > First of all, I can't really find the options FreeBSD seems to have, no > matter if I'm compiling world, kernel or something else. The file that > the handbook states: /usr/share/examples/etc/make.conf doesn't exist. > Actually, /usr/share/examples/etc/ doesn't even exist on my machine. I > am running FreeBSD 6.2-STABLE (updated late night; CET). There is a file > in /usr/src/share/examples/etc/ but it seems to be from the i386 > platform (CPU-type is PIII) and doesn't contain really sane defaults for > SPARC64 and certainly doesn't seem to contain the defaults that apply to > my system (from what I've observed). Is there such thing as a make.conf > that contains all the defaults for sparc64? If so, where is it? > > Looking at what I see when compiling just about anything, I'd say the > CFLAGS are set to "-O2 -pipe", where the second option doesn't really do > much about the code being created. CXXFLAGS probably isn't set so the > options there are the same as for CFLAGS. If these are the only settings > passed on to the cc, it will probably create code that is "optimized" > for the V7. At least, that would be the default according to the > documentation of the gcc. V7 code isn't really all that good for any v9 > CPU, including my UltraSPARC II, as the istruction set is rather > restricted. > > I was thinking of setting the CFLAGS to something like > -O2 -pipe -mcpu=ultrasparc -m64 > > Is that a sane configuration? Will the world and the kernel run with > those? Has anyone ever tried that? :-) > > Since -O3 doesn't really help speeding up the result much (exept when > you aretrying to kill time while compiling), I haven't bothered with > that one. Does FreeBSD even compile with that on? > > Regards > Chris >