🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #12693

Re: How does compiled code use the floating point unit?

#12693
From: David S. Hayes
Date: Mon, 08 Dec 1986 14:36
38 lines
2047 bytes
In article <394@houxs.UUCP>, daw@houxs.UUCP (D.WOLVERTON) writes:
> In some systems, the hardware floating point (fp) unit is _optional_.

> 4)  Code generation emits code which always causes transfer to the
> OS, e.g. by illegal opcodes or TRAP instructions.  The OS then
> proceeds like (3a) or (3b) above except that the fp unit may be used 
> if present.
> 
> 	Are there other scenarios in use?

According to my memory, (which operates on fuzzy logic :-), the
Sun-2 had several different optional FPU boards.  The compiler
would generate code that always trapped to the OS.  Then:

No FPU:
	OS calls a subroutine to do the work.

FPU:
	OS replaces the user instruction (a 68010 TRAP) with
	the equivalent hardware instruction.  The user program
	is then restarted at the new instruction, which now
	causes the FPU to do the work.

I like this scheme.  The overhead of going into the OS is only
paid once (assuming you actually have a FPU).  Once the OS changes
the TRAP instruction, further FP work goes directly to the hardware,
without software intervention.

Of course, this had to be done once to each different FP instruction.
In a large program, that could take a while.  On the other hand, the
most popular instructions should be replace fairly quickly.

Anyone (particularly old Sun engineers) care to correct my memory?
-- 
	David S. Hayes, The Merlin of Avalon
	PhoneNet:	(202) 694-6900
	ARPA:		merlin%hqda-ai@brl
	UUCP:		...!seismo!sundc!hqda-ai!merlin
Technical Details
Message-ID: <164@hqda-ai.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!sundc!hqda-ai!merlin
References: <394@houxs.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!sundc!hqda-ai!merlin
From: merlin@hqda-ai.UUCP (David S. Hayes)
Newsgroups: comp.arch
Subject: Re: How does compiled code use the floating point unit?
Message-ID: <164@hqda-ai.UUCP>
Date: Mon, 8-Dec-86 09:36:22 EST
Article-I.D.: hqda-ai.164
Posted: Mon Dec  8 09:36:22 1986
Date-Received: Mon, 8-Dec-86 21:04:53 EST
References: <394@houxs.UUCP>
Organization: Army AI Center, Pentagon
Lines: 38
Summary: Sun-2 replaced OS trap at execution time.