xref: /OK3568_Linux_fs/kernel/arch/m68k/ifpsp060/fpsp.doc (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2*4882a593SmuzhiyunMOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
3*4882a593SmuzhiyunM68000 Hi-Performance Microprocessor Division
4*4882a593SmuzhiyunM68060 Software Package
5*4882a593SmuzhiyunProduction Release P1.00 -- October 10, 1994
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunM68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunTHE SOFTWARE is provided on an "AS IS" basis and without warranty.
10*4882a593SmuzhiyunTo the maximum extent permitted by applicable law,
11*4882a593SmuzhiyunMOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
12*4882a593SmuzhiyunINCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
13*4882a593Smuzhiyunand any warranty against infringement with regard to the SOFTWARE
14*4882a593Smuzhiyun(INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunTo the maximum extent permitted by applicable law,
17*4882a593SmuzhiyunIN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
18*4882a593Smuzhiyun(INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
19*4882a593SmuzhiyunBUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS)
20*4882a593SmuzhiyunARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
21*4882a593SmuzhiyunMotorola assumes no responsibility for the maintenance and support of the SOFTWARE.
22*4882a593Smuzhiyun
23*4882a593SmuzhiyunYou are hereby granted a copyright license to use, modify, and distribute the SOFTWARE
24*4882a593Smuzhiyunso long as this entire notice is retained without alteration in any modified and/or
25*4882a593Smuzhiyunredistributed versions, and that such modified versions are clearly identified as such.
26*4882a593SmuzhiyunNo licenses are granted by implication, estoppel or otherwise under any patents
27*4882a593Smuzhiyunor trademarks of Motorola, Inc.
28*4882a593Smuzhiyun~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29*4882a593Smuzhiyun68060 FLOATING-POINT SOFTWARE PACKAGE (Kernel version)
30*4882a593Smuzhiyun-------------------------------------------------------
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunThe file fpsp.sa contains the 68060 Floating-Point Software
33*4882a593SmuzhiyunPackage. This package is essentially a set of exception handlers
34*4882a593Smuzhiyunthat can be integrated into an operating system.
35*4882a593SmuzhiyunThese exception handlers emulate Unimplemented FP instructions,
36*4882a593Smuzhiyuninstructions using unimplemented data types, and instructions
37*4882a593Smuzhiyunusing unimplemented addressing modes. In addition, this package
38*4882a593Smuzhiyunincludes exception handlers to provide full IEEE-754 compliant
39*4882a593Smuzhiyunexception handling.
40*4882a593Smuzhiyun
41*4882a593SmuzhiyunRelease file format:
42*4882a593Smuzhiyun--------------------
43*4882a593SmuzhiyunThe file fpsp.sa is essentially a hexadecimal image of the
44*4882a593Smuzhiyunrelease package. This is the ONLY format which will be supported.
45*4882a593SmuzhiyunThe hex image was created by assembling the source code and
46*4882a593Smuzhiyunthen converting the resulting binary output image into an
47*4882a593SmuzhiyunASCII text file. The hexadecimal numbers are listed
48*4882a593Smuzhiyunusing the Motorola Assembly Syntax assembler directive "dc.l"
49*4882a593Smuzhiyun(define constant longword). The file can be converted to other
50*4882a593Smuzhiyunassembly syntaxes by using any word processor with a global
51*4882a593Smuzhiyunsearch and replace function.
52*4882a593Smuzhiyun
53*4882a593SmuzhiyunTo assist in assembling and linking this module with other modules,
54*4882a593Smuzhiyunthe installer should add a symbolic label to the top of the file.
55*4882a593SmuzhiyunThis will allow calling routines to access the entry points
56*4882a593Smuzhiyunof this package.
57*4882a593Smuzhiyun
58*4882a593SmuzhiyunThe source code fpsp.s has also been included but only for
59*4882a593Smuzhiyundocumentation purposes.
60*4882a593Smuzhiyun
61*4882a593SmuzhiyunRelease file structure:
62*4882a593Smuzhiyun-----------------------
63*4882a593Smuzhiyun
64*4882a593Smuzhiyun(top of module)
65*4882a593Smuzhiyun	-----------------
66*4882a593Smuzhiyun	|		| - 128 byte-sized section
67*4882a593Smuzhiyun   (1)  |   Call-Out	| - 4 bytes per entry (user fills these in)
68*4882a593Smuzhiyun	|		| - example routines in fskeleton.s
69*4882a593Smuzhiyun	-----------------
70*4882a593Smuzhiyun	|		| - 8 bytes per entry
71*4882a593Smuzhiyun   (2)  | Entry Point	| - user does "bra" or "jmp" to this address
72*4882a593Smuzhiyun	|		|
73*4882a593Smuzhiyun	-----------------
74*4882a593Smuzhiyun	|		| - code section
75*4882a593Smuzhiyun   (3)  ~		~
76*4882a593Smuzhiyun	|		|
77*4882a593Smuzhiyun	-----------------
78*4882a593Smuzhiyun(bottom of module)
79*4882a593Smuzhiyun
80*4882a593SmuzhiyunThe first section of this module is the "Call-out" section. This section
81*4882a593Smuzhiyunis NOT INCLUDED in fpsp.sa (an example "Call-out" section is provided at
82*4882a593Smuzhiyunthe end of the file fskeleton.s). The purpose of this section is to allow
83*4882a593Smuzhiyunthe FPSP routines to reference external functions that must be provided
84*4882a593Smuzhiyunby the host operating system. This section MUST be exactly 128 bytes in
85*4882a593Smuzhiyunsize. There are 32 fields, each 4 bytes in size. Each field corresponds
86*4882a593Smuzhiyunto a function required by the FPSP (these functions and their location are
87*4882a593Smuzhiyunlisted in "68060FPSP call-outs" below). Each field entry should contain
88*4882a593Smuzhiyunthe address of the corresponding function RELATIVE to the starting address
89*4882a593Smuzhiyunof the "call-out" section. The "Call-out" section must sit adjacent to the
90*4882a593Smuzhiyunfpsp.sa image in memory.
91*4882a593Smuzhiyun
92*4882a593SmuzhiyunThe second section, the "Entry-point" section, is used by external routines
93*4882a593Smuzhiyunto access the functions within the FPSP. Since the fpsp.sa hex file contains
94*4882a593Smuzhiyunno symbol names, this section contains function entry points that are fixed
95*4882a593Smuzhiyunwith respect to the top of the package. The currently defined entry-points
96*4882a593Smuzhiyunare listed in section "68060 FPSP entry points" below. A calling routine
97*4882a593Smuzhiyunwould simply execute a "bra" or "jmp" that jumped to the selected function
98*4882a593Smuzhiyunentry-point.
99*4882a593Smuzhiyun
100*4882a593SmuzhiyunFor example, if the 68060 hardware took a "Line-F Emulator" exception
101*4882a593Smuzhiyun(vector #11), the operating system should execute something similar to:
102*4882a593Smuzhiyun
103*4882a593Smuzhiyun	bra	_060FPSP_TOP+128+48
104*4882a593Smuzhiyun
105*4882a593Smuzhiyun(_060FPSP_TOP is the starting address of the "Call-out" section; the "Call-out"
106*4882a593Smuzhiyunsection is 128 bytes long; and the F-Line FPSP handler entry point is located
107*4882a593Smuzhiyun48 bytes from the top of the "Entry-point" section.)
108*4882a593Smuzhiyun
109*4882a593SmuzhiyunThe third section is the code section. After entering through an "Entry-point",
110*4882a593Smuzhiyunthe entry code jumps to the appropriate emulation code within the code section.
111*4882a593Smuzhiyun
112*4882a593Smuzhiyun68060FPSP call-outs: (details in fskeleton.s)
113*4882a593Smuzhiyun--------------------
114*4882a593Smuzhiyun0x000:	_060_real_bsun
115*4882a593Smuzhiyun0x004:	_060_real_snan
116*4882a593Smuzhiyun0x008:	_060_real_operr
117*4882a593Smuzhiyun0x00c:	_060_real_ovfl
118*4882a593Smuzhiyun0x010:	_060_real_unfl
119*4882a593Smuzhiyun0x014:	_060_real_dz
120*4882a593Smuzhiyun0x018:	_060_real_inex
121*4882a593Smuzhiyun0x01c:	_060_real_fline
122*4882a593Smuzhiyun0x020:	_060_real_fpu_disabled
123*4882a593Smuzhiyun0x024:	_060_real_trap
124*4882a593Smuzhiyun0x028:	_060_real_trace
125*4882a593Smuzhiyun0x02c:	_060_real_access
126*4882a593Smuzhiyun0x030:	_060_fpsp_done
127*4882a593Smuzhiyun
128*4882a593Smuzhiyun0x034:	(Motorola reserved)
129*4882a593Smuzhiyun0x038:	(Motorola reserved)
130*4882a593Smuzhiyun0x03c:	(Motorola reserved)
131*4882a593Smuzhiyun
132*4882a593Smuzhiyun0x040:	_060_imem_read
133*4882a593Smuzhiyun0x044:	_060_dmem_read
134*4882a593Smuzhiyun0x048:	_060_dmem_write
135*4882a593Smuzhiyun0x04c:	_060_imem_read_word
136*4882a593Smuzhiyun0x050:	_060_imem_read_long
137*4882a593Smuzhiyun0x054:	_060_dmem_read_byte
138*4882a593Smuzhiyun0x058:	_060_dmem_read_word
139*4882a593Smuzhiyun0x05c:	_060_dmem_read_long
140*4882a593Smuzhiyun0x060:	_060_dmem_write_byte
141*4882a593Smuzhiyun0x064:	_060_dmem_write_word
142*4882a593Smuzhiyun0x068:	_060_dmem_write_long
143*4882a593Smuzhiyun
144*4882a593Smuzhiyun0x06c:	(Motorola reserved)
145*4882a593Smuzhiyun0x070:	(Motorola reserved)
146*4882a593Smuzhiyun0x074:	(Motorola reserved)
147*4882a593Smuzhiyun0x078:	(Motorola reserved)
148*4882a593Smuzhiyun0x07c:	(Motorola reserved)
149*4882a593Smuzhiyun
150*4882a593Smuzhiyun68060FPSP entry points:
151*4882a593Smuzhiyun-----------------------
152*4882a593Smuzhiyun0x000:	_060_fpsp_snan
153*4882a593Smuzhiyun0x008:	_060_fpsp_operr
154*4882a593Smuzhiyun0x010:	_060_fpsp_ovfl
155*4882a593Smuzhiyun0x018:	_060_fpsp_unfl
156*4882a593Smuzhiyun0x020:	_060_fpsp_dz
157*4882a593Smuzhiyun0x028:	_060_fpsp_inex
158*4882a593Smuzhiyun0x030:	_060_fpsp_fline
159*4882a593Smuzhiyun0x038:	_060_fpsp_unsupp
160*4882a593Smuzhiyun0x040:	_060_fpsp_effadd
161*4882a593Smuzhiyun
162*4882a593Smuzhiyun
163*4882a593Smuzhiyun
164*4882a593SmuzhiyunMiscellaneous:
165*4882a593Smuzhiyun--------------
166*4882a593Smuzhiyun
167*4882a593Smuzhiyun_060_fpsp_snan:
168*4882a593Smuzhiyun----------------
169*4882a593Smuzhiyun- documented in 3.5 of 060SP spec.
170*4882a593Smuzhiyun- Basic flow:
171*4882a593Smuzhiyun	exception taken ---> enter _060_fpsp_snan --|
172*4882a593Smuzhiyun						    |
173*4882a593Smuzhiyun            always exits through _060_real_snan <----
174*4882a593Smuzhiyun
175*4882a593Smuzhiyun_060_fpsp_operr:
176*4882a593Smuzhiyun----------------
177*4882a593Smuzhiyun- documented in 3.5 of 060SP spec.
178*4882a593Smuzhiyun- Basic flow:
179*4882a593Smuzhiyun	exception taken ---> enter _060_fpsp_operr --|
180*4882a593Smuzhiyun						     |
181*4882a593Smuzhiyun           always exits through _060_real_operr <-----
182*4882a593Smuzhiyun
183*4882a593Smuzhiyun_060_fpsp_dz:
184*4882a593Smuzhiyun----------------
185*4882a593Smuzhiyun- documented in 3.7 of 060SP spec.
186*4882a593Smuzhiyun- Basic flow:
187*4882a593Smuzhiyun	exception taken ---> enter _060_fpsp_dz   --|
188*4882a593Smuzhiyun						    |
189*4882a593Smuzhiyun            always exits through _060_real_dz   <----
190*4882a593Smuzhiyun
191*4882a593Smuzhiyun_060_fpsp_inex:
192*4882a593Smuzhiyun----------------
193*4882a593Smuzhiyun- documented in 3.6 of 060SP spec.
194*4882a593Smuzhiyun- Basic flow:
195*4882a593Smuzhiyun	exception taken ---> enter _060_fpsp_inex --|
196*4882a593Smuzhiyun						    |
197*4882a593Smuzhiyun            always exits through _060_real_inex <----
198*4882a593Smuzhiyun
199*4882a593Smuzhiyun
200*4882a593Smuzhiyun_060_fpsp_ovfl:
201*4882a593Smuzhiyun----------------
202*4882a593Smuzhiyun- documented in 3.4 of 060SP spec.
203*4882a593Smuzhiyun- Basic flow:
204*4882a593Smuzhiyun	exception taken ---> enter _060_fpsp_ovfl --|
205*4882a593Smuzhiyun						    |
206*4882a593Smuzhiyun            may exit through _060_real_inex     <---|
207*4882a593Smuzhiyun						 or |
208*4882a593Smuzhiyun            may exit through _060_real_ovfl     <---|
209*4882a593Smuzhiyun						 or |
210*4882a593Smuzhiyun            may exit through _060_fpsp_done     <---|
211*4882a593Smuzhiyun
212*4882a593Smuzhiyun_060_fpsp_unfl:
213*4882a593Smuzhiyun----------------
214*4882a593Smuzhiyun- documented in 3.4 of 060SP spec.
215*4882a593Smuzhiyun- Basic flow:
216*4882a593Smuzhiyun	exception taken ---> enter _060_fpsp_unfl --|
217*4882a593Smuzhiyun						    |
218*4882a593Smuzhiyun            may exit through _060_real_inex     <---|
219*4882a593Smuzhiyun						 or |
220*4882a593Smuzhiyun            may exit through _060_real_unfl     <---|
221*4882a593Smuzhiyun						 or |
222*4882a593Smuzhiyun            may exit through _060_fpsp_done     <---|
223*4882a593Smuzhiyun
224*4882a593Smuzhiyun
225*4882a593Smuzhiyun_060_fpsp_fline:
226*4882a593Smuzhiyun-----------------
227*4882a593Smuzhiyun- not fully documented in 060SP spec.
228*4882a593Smuzhiyun- Basic flow:
229*4882a593Smuzhiyun	exception taken ---> enter _060_fpsp_fline --|
230*4882a593Smuzhiyun						     |
231*4882a593Smuzhiyun            -------------------------------------------
232*4882a593Smuzhiyun            |               |                     |
233*4882a593Smuzhiyun            v               v                     v
234*4882a593Smuzhiyun   (unimplemented   (fpu disabled)       (possible F-line illegal)
235*4882a593Smuzhiyun     stack frame)           |                     v
236*4882a593Smuzhiyun            |               v               special case "fmovecr"?
237*4882a593Smuzhiyun            |         exit through                    |
238*4882a593Smuzhiyun            |     _060_real_fpu_disabled        -------------
239*4882a593Smuzhiyun            |                                   |           |
240*4882a593Smuzhiyun            |               ^                   v           v
241*4882a593Smuzhiyun            |               |                 (yes)        (no)
242*4882a593Smuzhiyun            |               |                   v           v
243*4882a593Smuzhiyun            |               |             fpu disabled?   exit through
244*4882a593Smuzhiyun            |               |                   |         _060_real_fline
245*4882a593Smuzhiyun            v               |             -------------
246*4882a593Smuzhiyun            |               |             |           |
247*4882a593Smuzhiyun            |               |             v           v
248*4882a593Smuzhiyun            |               |-----------(yes)        (no)
249*4882a593Smuzhiyun            |                                         |
250*4882a593Smuzhiyun            |----<------------------------------------|
251*4882a593Smuzhiyun            |
252*4882a593Smuzhiyun            |
253*4882a593Smuzhiyun            |----> may exit through _060_real_trace
254*4882a593Smuzhiyun            |
255*4882a593Smuzhiyun            |----> may exit through _060_real_trap
256*4882a593Smuzhiyun            |
257*4882a593Smuzhiyun            |----> may exit through _060_real_bsun
258*4882a593Smuzhiyun            |
259*4882a593Smuzhiyun            |----> may exit through _060_fpsp_done
260*4882a593Smuzhiyun
261*4882a593Smuzhiyun
262*4882a593Smuzhiyun_060_fpsp_unsupp:
263*4882a593Smuzhiyun------------------
264*4882a593Smuzhiyun- documented in 3.1 of 060SP spec.
265*4882a593Smuzhiyun- Basic flow:
266*4882a593Smuzhiyun	exception taken ---> enter _060_fpsp_unsupp --|
267*4882a593Smuzhiyun						      |
268*4882a593Smuzhiyun						      |
269*4882a593Smuzhiyun            may exit through _060_real_snan      <----|
270*4882a593Smuzhiyun						  or  |
271*4882a593Smuzhiyun            may exit through _060_real_operr     <----|
272*4882a593Smuzhiyun						  or  |
273*4882a593Smuzhiyun            may exit through _060_real_ovfl      <----|
274*4882a593Smuzhiyun						  or  |
275*4882a593Smuzhiyun            may exit through _060_real_unfl      <----|
276*4882a593Smuzhiyun						  or  |
277*4882a593Smuzhiyun            may exit through _060_real_inex      <----|
278*4882a593Smuzhiyun						  or  |
279*4882a593Smuzhiyun            may exit through _060_real_trace     <----|
280*4882a593Smuzhiyun						  or  |
281*4882a593Smuzhiyun            may exit through _060_fpsp_done      <----|
282*4882a593Smuzhiyun
283*4882a593Smuzhiyun
284*4882a593Smuzhiyun_060_fpsp_effadd:
285*4882a593Smuzhiyun------------------
286*4882a593Smuzhiyun- documented in 3.3 of 060 spec.
287*4882a593Smuzhiyun- Basic flow:
288*4882a593Smuzhiyun	exception taken ---> enter _060_fpsp_effadd --|
289*4882a593Smuzhiyun						      |
290*4882a593Smuzhiyun						      |
291*4882a593Smuzhiyun            may exit through _060_real_trace     <----|
292*4882a593Smuzhiyun						  or  |
293*4882a593Smuzhiyun     may exit through _060_real_fpu_disabled     <----|
294*4882a593Smuzhiyun						  or  |
295*4882a593Smuzhiyun            may exit through _060_fpsp_done      <----|
296