Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!mit-eddie!genrad!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: comp.arch Subject: Re: How does compiled code use the floating point unit? Message-ID: <10249@sun.uucp> Date: Tue, 9-Dec-86 12:19:31 EST Article-I.D.: sun.10249 Posted: Tue Dec 9 12:19:31 1986 Date-Received: Wed, 10-Dec-86 04:18:49 EST References: <394@houxs.UUCP> <164@hqda-ai.UUCP> Organization: Sun Microsystems, Inc. Lines: 33 Summary: No, Sun didn't do anything like that > Anyone (particularly old Sun engineers) care to correct my memory? Yes. The Sun-2 did, in fact, have an FPU option, namely a Sky floating point board. However, unless we did so in release 1.x, Sun NEVER generated code to trap to the OS. In 2.0, I think the compiler generated subroutine calls for floating-point operations. By default, the subroutines either jumped to software floating-point routines or to Sky floating-point routines, depending on whether the program detected that there was a Sky board on the machine when it started (the C startup code did this check). An option could tell the compiler to generate direct calls to the Sky routines. In 3.0 and later releases, the same scheme was used to support the 3 possibilities for Sun-3 floating point support: no hardware, MC68881, and FPA. There were now options to tell the compiler to generate code to call the "switched" floating-point routines (that used the information on what hardware was present to choose which routines to jump to), to call the software routines directly, to call the Sky routines, to use the 68881 instructions, or to use the FPA "instructions" ("move"s, etc. to the FPA registers). Since it took *several* 68010 instructions to make the Sky board perform a floating-point operation (unless you're talking about the 68881 or, in some cases, the FPA, there aren't any single-instruction floating-point operations on Suns; there certainly weren't any on the Sun-2), you couldn't just replace a TRAP with the operation in question. And, since many Sun-2s didn't have a Sky board, the overhead of doing floating point in the OS would have been prohibitive in most cases, so the OS certainly wouldn't have done floating-point computations if there wasn't a Sky board. -- Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com (or guy@sun.arpa)