fpsp.doc 10 KB

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