Motorola M68060 User Manual page 383

Table of Contents

Advertisement

MC68060 Software Package
C.3.4 Module 5: Floating-Point Library (M68060FPLSP)
The M68060SP provides a library version of the unimplemented general monadic and
dyadic floating-point instructions shown in Table C-3. These routines are System V ABI
compliant as well as IEEE exception-reporting compliant. They are not, however, UNIX
exception-reporting compliant. This library implementation can be compiled with user appli-
cations desiring the functionality of these instructions without having to incur the overhead
of the floating-point unimplemented instruction" exception. The floating-point library contains
floating-point instructions that are implemented by the MC68060. The floating-point library
requires the partial floating-point kernel or full floating-point kernel to be ported to the system
for proper operation.
In addition, the FABS, FADD, FDIV, FINT, FINTRZ, FMUL, FNEG, FSQRT, and FSUB
functions are provided for the convenience of older compilers that make subroutine calls for
all floating-point instructions. The code does not emulate these instructions in integer, but
rather simply executes them.
All input variables must be pushed onto the stack prior to calling the supplied library rou-
tine. For each function, three entry points are provided, each accepting one of the three
possible input operand data types: single, double, and extended precision. For dyadic
operations both input operands are defined to have the same operand data type. For
instance, for a monadic instruction such as the FSIN instruction, the functions are:
_fsins(single-precision
_fsinx(extended-precision input operand). For dyadic operations such as the FDIV instruc-
tion, the entry points provided are: _fdivs(both single-precision input operands), _fdivd(both
double-precision input operands, _fdivx(both extended-precision input operands).
To properly call a monadic subroutine, the calling routine must push the input operand onto
the stack first. For instance:
* This example replaces the "fsin.x fp1,fp0" instruction
* Note that _fsinx is actually implemented as an offset from the
* top of the Floating-point Library Module.
fmove.x fp1,-(sp)
bsr
_fsinx
add.w
#12,sp
To properly call a dyadic subroutine, the calling routine must push the second operand
onto the stack before pushing the first operand onto the stack. For instance:
* This example replaces the "fdiv.x fp1,fp0" instruction
* Note that _fdivx is actually implemented as an offset from the
* top of the Floating-point Library Module.
fmove.x fp1,-(sp)
fmove.x fp0,-(sp)
bsr
_fdivx
add.w
#24,sp
All routines return the operation result in the register fp0. It is the responsibility of the calling
routine to remove the input operands from the stack after the routine has been executed.
The result's rounding precision and mode, as well as exception reporting, is dictated by the
value of the FPCR upon subroutine entry. The floating-point status register (FPSR) is set
C-22
input
operand),
; push operand to stack
; result returned in fp0
; clean up stack
; push 2nd operand to stack
; push 1st operand to stack
; result returned in fp0
; clean up stack
M68060 USER'S MANUAL
_fsind(double-precision
input
operand),
MOTOROLA

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mc68060Mc68lc060Mc68ec060

Table of Contents