Subject: Re: -mieee option
To: Anders Magnusson <ragge@ludd.luth.se>
From: Chris G. Demetriou <cgd@netbsd.org>
List: current-users
Date: 01/14/1999 10:38:11
Anders Magnusson <ragge@ludd.luth.se> writes:
> > Indeed, NetBSD/alpha does not support IEEE-conformant arithmetic.
> >
> Eh, what? How does the Alpha math lib work in that case???

There's a difference between "approximately IEEE" or "uses IEEE
formats and many operations" and "IEEE conformant" or "complete
implementation" for any nearly-strict sense of the word "conformant."

basically, NetBSD/alpha supports what the alpha hardware will do for
it.  That is things like:

	* floating point formats

	* basic operations

but does _not_ cover some of the corner cases re: exceptions and NaNs,
and (if i recall) doesn't completely cover some of the things that
some software likes to use (e.g. denormalized numbers).

i.e. basic math works, but if you're actually on the exception and/or
denorm, or other 'somewhat near the corner'-case IEEE math,
NetBSD/alpha won't do it.

Like i said, i'm approximately clueless when it comes to FP stuff.  If
you're interested in what the alpha architecture pushes off to
software completion (i.e. the OS and libraries), take a look at the
Alpha Architecture Reference Manual.

Looks like they've got the abridged (free) version of that up on the
web at:

http://ftp.digital.com/pub/Digital/info/semiconductor/literature/alphaahb.pdf

Interesting stuff for FP math fans can be found in:

	section 2.2.6	"IEEE Floating-Point Formats"

	section 4.7	"Floating-Point Instructions", especially
			section 4.7.10 "IEEE Standard" which describes
			the alpha architecture's behaviour for IEEE
			operations which are implementation dependent.
		
	appendix B	"IEEE Floating-Point Conformance," which
			begins:  "A subset of IEEE Standard for Binary
			Floating-Point Arithmetic (ANSI/IEEE Standard
			754-1985) is provided in the Alpha
			floating-point instructuctions.  This appendix
			describes how to construct a complete IEEE
			implementation."


You'll find that they describe much better than I do what the hardware
does and doesn't do, and what the OS should do to make up for it.  8-)


cgd
-- 
Chris Demetriou - cgd@netbsd.org - http://www.netbsd.org/People/Pages/cgd.html
Disclaimer: Not speaking for NetBSD, just expressing my own opinion.