Home | History | Annotate | Line # | Download | only in dist
      1  1.1       is #
      2  1.2  msaitoh # $NetBSD: fpsp.doc,v 1.2 2007/04/29 20:23:35 msaitoh Exp $
      3  1.1       is #
      4  1.1       is 
      5  1.1       is #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      6  1.1       is # MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
      7  1.1       is # M68000 Hi-Performance Microprocessor Division
      8  1.1       is # M68060 Software Package Production Release 
      9  1.1       is # 
     10  1.1       is # M68060 Software Package Copyright (C) 1993, 1994, 1995, 1996 Motorola Inc.
     11  1.1       is # All rights reserved.
     12  1.1       is # 
     13  1.1       is # THE SOFTWARE is provided on an "AS IS" basis and without warranty.
     14  1.1       is # To the maximum extent permitted by applicable law,
     15  1.1       is # MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
     16  1.1       is # INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS
     17  1.1       is # FOR A PARTICULAR PURPOSE and any warranty against infringement with
     18  1.1       is # regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF)
     19  1.1       is # and any accompanying written materials. 
     20  1.1       is # 
     21  1.1       is # To the maximum extent permitted by applicable law,
     22  1.1       is # IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
     23  1.1       is # (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
     24  1.1       is # BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS)
     25  1.1       is # ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
     26  1.1       is # 
     27  1.1       is # Motorola assumes no responsibility for the maintenance and support
     28  1.1       is # of the SOFTWARE.  
     29  1.1       is # 
     30  1.1       is # You are hereby granted a copyright license to use, modify, and distribute the
     31  1.1       is # SOFTWARE so long as this entire notice is retained without alteration
     32  1.1       is # in any modified and/or redistributed versions, and that such modified
     33  1.1       is # versions are clearly identified as such.
     34  1.1       is # No licenses are granted by implication, estoppel or otherwise under any
     35  1.1       is # patents or trademarks of Motorola, Inc.
     36  1.1       is #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     37  1.1       is 
     38  1.1       is 68060 FLOATING-POINT SOFTWARE PACKAGE (Kernel version)
     39  1.1       is -------------------------------------------------------
     40  1.1       is 
     41  1.1       is The file fpsp.sa contains the 68060 Floating-Point Software
     42  1.1       is Package. This package is essentially a set of exception handlers
     43  1.1       is that can be integrated into an operating system. 
     44  1.1       is These exception handlers emulate Unimplemented FP instructions,
     45  1.1       is instructions using unimplemented data types, and instructions
     46  1.1       is using unimplemented addressing modes. In addition, this package
     47  1.1       is includes exception handlers to provide full IEEE-754 compliant
     48  1.1       is exception handling.
     49  1.1       is 
     50  1.1       is Release file format:
     51  1.1       is --------------------
     52  1.1       is The file fpsp.sa is essentially a hexadecimal image of the
     53  1.1       is release package. This is the ONLY format which will be supported.
     54  1.1       is The hex image was created by assembling the source code and
     55  1.1       is then converting the resulting binary output image into an
     56  1.1       is ASCII text file. The hexadecimal numbers are listed
     57  1.1       is using the Motorola Assembly Syntax assembler directive "dc.l"
     58  1.1       is (define constant longword). The file can be converted to other
     59  1.1       is assembly syntaxes by using any word processor with a global
     60  1.1       is search and replace function.
     61  1.1       is 
     62  1.1       is To assist in assembling and linking this module with other modules,
     63  1.1       is the installer should add a symbolic label to the top of the file.
     64  1.1       is This will allow calling routines to access the entry points
     65  1.1       is of this package.
     66  1.1       is 
     67  1.1       is The source code fpsp.s has also been included but only for
     68  1.1       is documentation purposes.
     69  1.1       is 
     70  1.1       is Release file structure:
     71  1.1       is -----------------------
     72  1.1       is 
     73  1.1       is (top of module)
     74  1.1       is 	----------------- 
     75  1.1       is 	|		| - 128 byte-sized section
     76  1.1       is    (1)  |   Call-Out	| - 4 bytes per entry (user fills these in)
     77  1.1       is 	|		| - example routines in fskeleton.s
     78  1.1       is 	-----------------
     79  1.1       is 	|		| - 8 bytes per entry
     80  1.1       is    (2)  | Entry Point	| - user does "bra" or "jmp" to this address
     81  1.1       is 	|		| 
     82  1.1       is 	-----------------
     83  1.1       is 	|		| - code section
     84  1.1       is    (3)  ~		~
     85  1.1       is 	|		|
     86  1.1       is 	-----------------
     87  1.1       is (bottom of module)
     88  1.1       is 
     89  1.1       is The first section of this module is the "Call-out" section. This section
     90  1.1       is is NOT INCLUDED in fpsp.sa (an example "Call-out" section is provided at
     91  1.1       is the end of the file fskeleton.s). The purpose of this section is to allow 
     92  1.1       is the FPSP routines to reference external functions that must be provided 
     93  1.1       is by the host operating system. This section MUST be exactly 128 bytes in 
     94  1.1       is size. There are 32 fields, each 4 bytes in size. Each field corresponds
     95  1.1       is to a function required by the FPSP (these functions and their location are
     96  1.1       is listed in "68060FPSP call-outs" below). Each field entry should contain
     97  1.1       is the address of the corresponding function RELATIVE to the starting address
     98  1.1       is of the "call-out" section. The "Call-out" section must sit adjacent to the 
     99  1.1       is fpsp.sa image in memory.
    100  1.1       is 
    101  1.1       is The second section, the "Entry-point" section, is used by external routines
    102  1.1       is to access the functions within the FPSP. Since the fpsp.sa hex file contains
    103  1.1       is no symbol names, this section contains function entry points that are fixed
    104  1.1       is with respect to the top of the package. The currently defined entry-points
    105  1.1       is are listed in section "68060 FPSP entry points" below. A calling routine
    106  1.1       is would simply execute a "bra" or "jmp" that jumped to the selected function
    107  1.1       is entry-point.
    108  1.1       is 
    109  1.1       is For example, if the 68060 hardware took a "Line-F Emulator" exception 
    110  1.1       is (vector #11), the operating system should execute something similar to:
    111  1.1       is 
    112  1.1       is 	bra	_060FPSP_TOP+128+48
    113  1.1       is 
    114  1.1       is (_060FPSP_TOP is the starting address of the "Call-out" section; the "Call-out"
    115  1.1       is section is 128 bytes long; and the F-Line FPSP handler entry point is located
    116  1.1       is 48 bytes from the top of the "Entry-point" section.)
    117  1.1       is 
    118  1.1       is The third section is the code section. After entering through an "Entry-point",
    119  1.1       is the entry code jumps to the appropriate emulation code within the code section.
    120  1.1       is 
    121  1.1       is 68060FPSP call-outs: (details in fskeleton.s)
    122  1.1       is --------------------
    123  1.1       is 0x000:	_060_real_bsun
    124  1.1       is 0x004:	_060_real_snan
    125  1.1       is 0x008:	_060_real_operr
    126  1.1       is 0x00c:	_060_real_ovfl
    127  1.1       is 0x010:	_060_real_unfl
    128  1.1       is 0x014:	_060_real_dz
    129  1.1       is 0x018:	_060_real_inex
    130  1.1       is 0x01c:	_060_real_fline
    131  1.1       is 0x020:	_060_real_fpu_disabled
    132  1.1       is 0x024:	_060_real_trap
    133  1.1       is 0x028:	_060_real_trace
    134  1.1       is 0x02c:	_060_real_access
    135  1.1       is 0x030:	_060_fpsp_done
    136  1.1       is 
    137  1.1       is 0x034:	(Motorola reserved)
    138  1.1       is 0x038:	(Motorola reserved)
    139  1.1       is 0x03c:	(Motorola reserved)
    140  1.1       is 
    141  1.1       is 0x040:	_060_imem_read
    142  1.1       is 0x044:	_060_dmem_read
    143  1.1       is 0x048:	_060_dmem_write
    144  1.1       is 0x04c:	_060_imem_read_word
    145  1.1       is 0x050:	_060_imem_read_long
    146  1.1       is 0x054:	_060_dmem_read_byte
    147  1.1       is 0x058:	_060_dmem_read_word
    148  1.1       is 0x05c:	_060_dmem_read_long
    149  1.1       is 0x060:	_060_dmem_write_byte
    150  1.1       is 0x064:	_060_dmem_write_word
    151  1.1       is 0x068:	_060_dmem_write_long
    152  1.1       is 
    153  1.1       is 0x06c:	(Motorola reserved)
    154  1.1       is 0x070:	(Motorola reserved)
    155  1.1       is 0x074:	(Motorola reserved)
    156  1.1       is 0x078:	(Motorola reserved)
    157  1.1       is 0x07c:	(Motorola reserved)
    158  1.1       is 
    159  1.1       is 68060FPSP entry points:
    160  1.1       is -----------------------
    161  1.1       is 0x000:	_060_fpsp_snan
    162  1.1       is 0x008:	_060_fpsp_operr
    163  1.1       is 0x010:	_060_fpsp_ovfl
    164  1.1       is 0x018:	_060_fpsp_unfl
    165  1.1       is 0x020:	_060_fpsp_dz
    166  1.1       is 0x028:	_060_fpsp_inex
    167  1.1       is 0x030:	_060_fpsp_fline
    168  1.1       is 0x038:	_060_fpsp_unsupp
    169  1.1       is 0x040:	_060_fpsp_effadd
    170  1.1       is 
    171  1.1       is 
    173  1.1       is Miscellaneous:
    174  1.1       is --------------
    175  1.1       is 
    176  1.1       is _060_fpsp_snan:
    177  1.1       is ----------------
    178  1.1       is - documented in 3.5 of 060SP spec.
    179  1.1       is - Basic flow:
    180  1.1       is 	exception taken ---> enter _060_fpsp_snan --|
    181  1.1       is 						    |
    182  1.1       is             always exits through _060_real_snan <----
    183  1.1       is 
    184  1.1       is _060_fpsp_operr:
    185  1.1       is ----------------
    186  1.1       is - documented in 3.5 of 060SP spec.
    187  1.1       is - Basic flow:
    188  1.1       is 	exception taken ---> enter _060_fpsp_operr --|
    189  1.1       is 						     |
    190  1.1       is            always exits through _060_real_operr <-----
    191  1.1       is 
    192  1.1       is _060_fpsp_dz:
    193  1.1       is ----------------
    194  1.1       is - documented in 3.7 of 060SP spec.
    195  1.1       is - Basic flow:
    196  1.1       is 	exception taken ---> enter _060_fpsp_dz   --|
    197  1.1       is 						    |
    198  1.1       is             always exits through _060_real_dz   <----
    199  1.1       is 
    200  1.1       is _060_fpsp_inex:
    201  1.1       is ----------------
    202  1.1       is - documented in 3.6 of 060SP spec.
    203  1.1       is - Basic flow:
    204  1.1       is 	exception taken ---> enter _060_fpsp_inex --|
    205  1.1       is 						    |
    206  1.1       is             always exits through _060_real_inex <----
    207  1.1       is 
    209  1.1       is _060_fpsp_ovfl:
    210  1.1       is ----------------
    211  1.1       is - documented in 3.4 of 060SP spec.
    212  1.1       is - Basic flow:
    213  1.1       is 	exception taken ---> enter _060_fpsp_ovfl --|
    214  1.1       is 						    |
    215  1.1       is             may exit through _060_real_inex     <---|
    216  1.1       is 						 or |
    217  1.1       is             may exit through _060_real_ovfl     <---|
    218  1.1       is 						 or |
    219  1.1       is             may exit through _060_fpsp_done     <---|
    220  1.1       is 
    221  1.1       is _060_fpsp_unfl:
    222  1.1       is ----------------
    223  1.1       is - documented in 3.4 of 060SP spec.
    224  1.1       is - Basic flow:
    225  1.1       is 	exception taken ---> enter _060_fpsp_unfl --|
    226  1.1       is 						    |
    227  1.1       is             may exit through _060_real_inex     <---|
    228  1.1       is 						 or |
    229  1.1       is             may exit through _060_real_unfl     <---|
    230  1.1       is 						 or |
    231  1.1       is             may exit through _060_fpsp_done     <---|
    232  1.1       is 
    234  1.1       is _060_fpsp_fline:
    235  1.1       is -----------------
    236  1.1       is - not fully documented in 060SP spec.
    237  1.1       is - Basic flow:
    238  1.1       is 	exception taken ---> enter _060_fpsp_fline --|
    239  1.1       is 						     |
    240  1.1       is             -------------------------------------------
    241  1.1       is             |               |                     |
    242  1.1       is             v               v                     v
    243  1.1       is    (unimplemented   (fpu disabled)       (possible F-line illegal)
    244  1.1       is      stack frame)           |                     v
    245  1.1       is             |               v               special case "fmovecr"?
    246  1.1       is             |         exit through                    |
    247  1.1       is             |     _060_real_fpu_disabled        -------------
    248  1.1       is             |                                   |           |
    249  1.1       is             |               ^                   v           v
    250  1.1       is             |               |                 (yes)        (no)
    251  1.1       is             |               |                   v           v
    252  1.1       is             |               |             fpu disabled?   exit through
    253  1.1       is             |               |                   |         _060_real_fline
    254  1.1       is             v               |             -------------
    255  1.1       is             |               |             |           |
    256  1.1       is             |               |             v           v
    257  1.1       is             |               |-----------(yes)        (no)
    258  1.1       is             |                                         |
    259  1.1       is             |----<------------------------------------|
    260  1.1       is             |
    261  1.1       is             |
    262  1.1       is             |----> may exit through _060_real_trace
    263  1.2  msaitoh             |
    264  1.1       is             |----> may exit through _060_real_trap
    265  1.1       is             |
    266  1.1       is             |----> may exit through _060_real_bsun
    267  1.1       is             |
    268  1.1       is             |----> may exit through _060_fpsp_done
    269  1.1       is 
    271  1.1       is _060_fpsp_unsupp:
    272  1.1       is ------------------
    273  1.1       is - documented in 3.1 of 060SP spec.
    274  1.1       is - Basic flow:
    275  1.1       is 	exception taken ---> enter _060_fpsp_unsupp --|
    276  1.1       is 						      |
    277  1.1       is 						      |
    278  1.1       is             may exit through _060_real_snan      <----|
    279  1.1       is 						  or  |
    280  1.1       is             may exit through _060_real_operr     <----|
    281  1.1       is 						  or  |
    282  1.1       is             may exit through _060_real_ovfl      <----|
    283  1.1       is 						  or  |
    284  1.1       is             may exit through _060_real_unfl      <----|
    285  1.1       is 						  or  |
    286  1.1       is             may exit through _060_real_inex      <----|
    287  1.1       is 						  or  |
    288  1.1       is             may exit through _060_real_trace     <----|
    289  1.1       is 						  or  |
    290  1.1       is             may exit through _060_fpsp_done      <----|
    291  1.1       is 
    293  1.1       is _060_fpsp_effadd:
    294  1.1       is ------------------
    295  1.1       is - documented in 3.3 of 060 spec.
    296  1.1       is - Basic flow:
    297  1.1       is 	exception taken ---> enter _060_fpsp_effadd --|
    298  1.1       is 						      |
    299  1.1       is 						      |
    300                           may exit through _060_real_trace     <----|
    301               						  or  |
    302                    may exit through _060_real_fpu_disabled     <----|
    303               						  or  |
    304                           may exit through _060_fpsp_done      <----|
    305