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