*BSD News Article 23547


Return to BSD News archive

Newsgroups: comp.os.386bsd.questions
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!elroy.jpl.nasa.gov!swrinde!gatech!howland.reston.ans.net!pipex!uknet!cf-cm!paul
From: paul@myrddin.isl.cf.ac.uk (Paul)
Subject: Re: FPU in FreeBSD?
Message-ID: <1993Nov10.003426.21244@cm.cf.ac.uk>
Sender: news@cm.cf.ac.uk (Network News System)
Organization: Intelligent Systems Lab, ELSYM, University of Wales, Cardiff
References: <2bo8s7$c0r@nic.lth.se>
Date: Wed, 10 Nov 1993 00:34:24 +0000
Lines: 34

In article <2bo8s7$c0r@nic.lth.se> jh@efd.lth.se (Joergen Haegg) writes:
>I noticed that some files in gcc was compiled with -NOFPU.
>Does this mean that I don't use the FPU in my 486 DX2?
>
>What should I do to get maximum floating-point performance in FreeBSD
>and my own programs?
>Is it enough to add '-m486'?
>

Simply - no.

gcc2 uses quite a few FPU instructions and relies on the underlying OS
to provide emulation for hardware that doesn't have one. The current
emulator doesn't handle sin/cos/sqrt so the generation of these
instructions was inhibited in current releases using the NOFPU flag.

If you have an FPU you can recompile gcc2 without this flag and it will
generate these instructions. They only get generated at -O2 (I think from
memory) and even then they may call the standard lib functions to handle error
checking.

The -m486 flag will buy you some performance at the cost of size, it aligns
things better for the 486 and makes slightly different instruction choices
to improve performance.

To really get *significant* performance improvements for math functions
you need a true FPU libm, the GNU  mathlib is good, I've used it
exstensively but it's unlikely to ever be part of FreeBSD because of the
GPL. I'm sure we'll get one done at some point though.
-- 
  Paul Richards, University of Wales, College Cardiff

  Internet: paul@isl.cf.ac.uk
  JANET: RICHARDSDP@CARDIFF.AC.UK