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