#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
# M68000 Hi-Performance Microprocessor Division
# M68060 Software Package Production Release
#
# M68060 Software Package Copyright (C) 1993, 1994, 1995, 1996 Motorola Inc.
# All rights reserved.
#
# THE SOFTWARE is provided on an "AS IS" basis and without warranty.
# To the maximum extent permitted by applicable law,
# MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
# INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS
# FOR A PARTICULAR PURPOSE and any warranty against infringement with
# regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF)
# and any accompanying written materials.
#
# To the maximum extent permitted by applicable law,
# IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
# (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
# BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS)
# ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
#
# Motorola assumes no responsibility for the maintenance and support
# of the SOFTWARE.
#
# You are hereby granted a copyright license to use, modify, and distribute the
# SOFTWARE so long as this entire notice is retained without alteration
# in any modified and/or redistributed versions, and that such modified
# versions are clearly identified as such.
# No licenses are granted by implication, estoppel or otherwise under any
# patents or trademarks of Motorola, Inc.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The file fplsp.sa contains the "Library version" of the
68060SP Floating-Point Software Package. The routines
included in this module can be used to emulate the
FP instructions not implemented in 68060 hardware. These
instructions normally take exception vector #11
"FP Unimplemented Instruction".
By re-compiling a program that uses these instructions, and
making subroutine calls in place of the unimplemented
instructions, a program can avoid the overhead associated
with taking the exception.
Release file format:
--------------------
The file fplsp.sa is essentially a hexadecimal image of the
release package. This is the ONLY format which will be supported.
The hex image was created by assembling the source code and
then converting the resulting binary output image into an
ASCII text file. The hexadecimal numbers are listed
using the Motorola Assembly Syntax assembler directive "dc.l"
(define constant longword). The file can be converted to other
assembly syntaxes by using any word processor with a global
search and replace function.
To assist in assembling and linking this module with other modules,
the installer should add a symbolic label to the top of the file.
This will allow calling routines to access the entry points
of this package.
The source code fplsp.s has also been included but only for
documentation purposes.
Release file structure:
-----------------------
The file fplsp.sa contains an "Entry-Point" section and a
code section. The FPLSP has no "Call-Out" section. The first section
is the "Entry-Point" section. In order to access a function in the
package, a program must "bsr" or "jsr" to the location listed
below in "68060FPLSP entry points" that corresponds to the desired
function. A branch instruction located at the selected entry point
within the package will then enter the correct emulation code routine.
The entry point addresses at the beginning of the package will remain
fixed so that a program calling the routines will not have to be
re-compiled with every new 68060FPLSP release.
There are 3 entry-points for each instruction type: single precision,
double precision, and extended precision.
As an example, the "fsin" library instruction can be passed an
extended precision operand if program executes:
# fsin.x fp0
fmovm.x &0x01,-(%sp) # pass operand on stack
bsr.l _060FPLSP_TOP+0x1a8 # branch to fsin routine
add.l &0xc,%sp # clear operand from stack
Upon return, fp0 holds the correct result. The FPSR is
set correctly. The FPCR is unchanged. The FPIAR is undefined.
Another example. This time, a dyadic operation:
# frem.s %fp1,%fp0
fmov.s %fp1,-(%sp) # pass src operand
fmov.s %fp0,-(%sp) # pass dst operand
bsr.l _060FPLSP_TOP+0x168 # branch to frem routine
addq.l &0x8,%sp # clear operands from stack
Again, the result is returned in fp0. Note that BOTH operands
are passed in single precision format.
Exception reporting:
--------------------
The package takes exceptions according to the FPCR value upon subroutine
entry. If an exception should be reported, then the package forces
this exception using implemented floating-point instructions.
For example, if the instruction being emulated should cause a
floating-point Operand Error exception, then the library routine
executes an FMUL of a zero and an infinity to force the OPERR
exception. Although the FPIAR will be undefined for the enabled
Operand Error exception handler, the user will at least be able
to record that the event occurred.
Miscellaneous:
--------------
The package does not attempt to correctly emulate instructions
with Signalling NAN inputs. Use of SNANs should be avoided with
this package.
The fabs/fadd/fdiv/fint/fintrz/fmul/fneg/fsqrt/fsub entry points
are provided for the convenience of older compilers that make
subroutine calls for all fp instructions. The code does NOT emulate
the instruction but rather simply executes it.