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