fplsp.doc 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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 (Library version)
  26. --------------------------------------------------------
  27. The file fplsp.sa contains the "Library version" of the
  28. 68060SP Floating-Point Software Package. The routines
  29. included in this module can be used to emulate the
  30. FP instructions not implemented in 68060 hardware. These
  31. instructions normally take exception vector #11
  32. "FP Unimplemented Instruction".
  33. By re-compiling a program that uses these instructions, and
  34. making subroutine calls in place of the unimplemented
  35. instructions, a program can avoid the overhead associated
  36. with taking the exception.
  37. Release file format:
  38. --------------------
  39. The file fplsp.sa is essentially a hexadecimal image of the
  40. release package. This is the ONLY format which will be supported.
  41. The hex image was created by assembling the source code and
  42. then converting the resulting binary output image into an
  43. ASCII text file. The hexadecimal numbers are listed
  44. using the Motorola Assembly Syntax assembler directive "dc.l"
  45. (define constant longword). The file can be converted to other
  46. assembly syntaxes by using any word processor with a global
  47. search and replace function.
  48. To assist in assembling and linking this module with other modules,
  49. the installer should add a symbolic label to the top of the file.
  50. This will allow calling routines to access the entry points
  51. of this package.
  52. The source code fplsp.s has also been included but only for
  53. documentation purposes.
  54. Release file structure:
  55. -----------------------
  56. The file fplsp.sa contains an "Entry-Point" section and a
  57. code section. The FPLSP has no "Call-Out" section. The first section
  58. is the "Entry-Point" section. In order to access a function in the
  59. package, a program must "bsr" or "jsr" to the location listed
  60. below in "68060FPLSP entry points" that corresponds to the desired
  61. function. A branch instruction located at the selected entry point
  62. within the package will then enter the correct emulation code routine.
  63. The entry point addresses at the beginning of the package will remain
  64. fixed so that a program calling the routines will not have to be
  65. re-compiled with every new 68060FPLSP release.
  66. There are 3 entry-points for each instruction type: single precision,
  67. double precision, and extended precision.
  68. As an example, the "fsin" library instruction can be passed an
  69. extended precision operand if program executes:
  70. # fsin.x fp0
  71. fmovm.x &0x01,-(%sp) # pass operand on stack
  72. bsr.l _060FPLSP_TOP+0x1a8 # branch to fsin routine
  73. add.l &0xc,%sp # clear operand from stack
  74. Upon return, fp0 holds the correct result. The FPSR is
  75. set correctly. The FPCR is unchanged. The FPIAR is undefined.
  76. Another example. This time, a dyadic operation:
  77. # frem.s %fp1,%fp0
  78. fmov.s %fp1,-(%sp) # pass src operand
  79. fmov.s %fp0,-(%sp) # pass dst operand
  80. bsr.l _060FPLSP_TOP+0x168 # branch to frem routine
  81. addq.l &0x8,%sp # clear operands from stack
  82. Again, the result is returned in fp0. Note that BOTH operands
  83. are passed in single precision format.
  84. Exception reporting:
  85. --------------------
  86. The package takes exceptions according to the FPCR value upon subroutine
  87. entry. If an exception should be reported, then the package forces
  88. this exception using implemented floating-point instructions.
  89. For example, if the instruction being emulated should cause a
  90. floating-point Operand Error exception, then the library routine
  91. executes an FMUL of a zero and an infinity to force the OPERR
  92. exception. Although the FPIAR will be undefined for the enabled
  93. Operand Error exception handler, the user will at least be able
  94. to record that the event occurred.
  95. Miscellaneous:
  96. --------------
  97. The package does not attempt to correctly emulate instructions
  98. with Signalling NAN inputs. Use of SNANs should be avoided with
  99. this package.
  100. The fabs/fadd/fdiv/fint/fintrz/fmul/fneg/fsqrt/fsub entry points
  101. are provided for the convenience of older compilers that make
  102. subroutine calls for all fp instructions. The code does NOT emulate
  103. the instruction but rather simply executes it.
  104. 68060FPLSP entry points:
  105. ------------------------
  106. _060FPLSP_TOP:
  107. 0x000: _060LSP__facoss_
  108. 0x008: _060LSP__facosd_
  109. 0x010: _060LSP__facosx_
  110. 0x018: _060LSP__fasins_
  111. 0x020: _060LSP__fasind_
  112. 0x028: _060LSP__fasinx_
  113. 0x030: _060LSP__fatans_
  114. 0x038: _060LSP__fatand_
  115. 0x040: _060LSP__fatanx_
  116. 0x048: _060LSP__fatanhs_
  117. 0x050: _060LSP__fatanhd_
  118. 0x058: _060LSP__fatanhx_
  119. 0x060: _060LSP__fcoss_
  120. 0x068: _060LSP__fcosd_
  121. 0x070: _060LSP__fcosx_
  122. 0x078: _060LSP__fcoshs_
  123. 0x080: _060LSP__fcoshd_
  124. 0x088: _060LSP__fcoshx_
  125. 0x090: _060LSP__fetoxs_
  126. 0x098: _060LSP__fetoxd_
  127. 0x0a0: _060LSP__fetoxx_
  128. 0x0a8: _060LSP__fetoxm1s_
  129. 0x0b0: _060LSP__fetoxm1d_
  130. 0x0b8: _060LSP__fetoxm1x_
  131. 0x0c0: _060LSP__fgetexps_
  132. 0x0c8: _060LSP__fgetexpd_
  133. 0x0d0: _060LSP__fgetexpx_
  134. 0x0d8: _060LSP__fgetmans_
  135. 0x0e0: _060LSP__fgetmand_
  136. 0x0e8: _060LSP__fgetmanx_
  137. 0x0f0: _060LSP__flog10s_
  138. 0x0f8: _060LSP__flog10d_
  139. 0x100: _060LSP__flog10x_
  140. 0x108: _060LSP__flog2s_
  141. 0x110: _060LSP__flog2d_
  142. 0x118: _060LSP__flog2x_
  143. 0x120: _060LSP__flogns_
  144. 0x128: _060LSP__flognd_
  145. 0x130: _060LSP__flognx_
  146. 0x138: _060LSP__flognp1s_
  147. 0x140: _060LSP__flognp1d_
  148. 0x148: _060LSP__flognp1x_
  149. 0x150: _060LSP__fmods_
  150. 0x158: _060LSP__fmodd_
  151. 0x160: _060LSP__fmodx_
  152. 0x168: _060LSP__frems_
  153. 0x170: _060LSP__fremd_
  154. 0x178: _060LSP__fremx_
  155. 0x180: _060LSP__fscales_
  156. 0x188: _060LSP__fscaled_
  157. 0x190: _060LSP__fscalex_
  158. 0x198: _060LSP__fsins_
  159. 0x1a0: _060LSP__fsind_
  160. 0x1a8: _060LSP__fsinx_
  161. 0x1b0: _060LSP__fsincoss_
  162. 0x1b8: _060LSP__fsincosd_
  163. 0x1c0: _060LSP__fsincosx_
  164. 0x1c8: _060LSP__fsinhs_
  165. 0x1d0: _060LSP__fsinhd_
  166. 0x1d8: _060LSP__fsinhx_
  167. 0x1e0: _060LSP__ftans_
  168. 0x1e8: _060LSP__ftand_
  169. 0x1f0: _060LSP__ftanx_
  170. 0x1f8: _060LSP__ftanhs_
  171. 0x200: _060LSP__ftanhd_
  172. 0x208: _060LSP__ftanhx_
  173. 0x210: _060LSP__ftentoxs_
  174. 0x218: _060LSP__ftentoxd_
  175. 0x220: _060LSP__ftentoxx_
  176. 0x228: _060LSP__ftwotoxs_
  177. 0x230: _060LSP__ftwotoxd_
  178. 0x238: _060LSP__ftwotoxx_
  179. 0x240: _060LSP__fabss_
  180. 0x248: _060LSP__fabsd_
  181. 0x250: _060LSP__fabsx_
  182. 0x258: _060LSP__fadds_
  183. 0x260: _060LSP__faddd_
  184. 0x268: _060LSP__faddx_
  185. 0x270: _060LSP__fdivs_
  186. 0x278: _060LSP__fdivd_
  187. 0x280: _060LSP__fdivx_
  188. 0x288: _060LSP__fints_
  189. 0x290: _060LSP__fintd_
  190. 0x298: _060LSP__fintx_
  191. 0x2a0: _060LSP__fintrzs_
  192. 0x2a8: _060LSP__fintrzd_
  193. 0x2b0: _060LSP__fintrzx_
  194. 0x2b8: _060LSP__fmuls_
  195. 0x2c0: _060LSP__fmuld_
  196. 0x2c8: _060LSP__fmulx_
  197. 0x2d0: _060LSP__fnegs_
  198. 0x2d8: _060LSP__fnegd_
  199. 0x2e0: _060LSP__fnegx_
  200. 0x2e8: _060LSP__fsqrts_
  201. 0x2f0: _060LSP__fsqrtd_
  202. 0x2f8: _060LSP__fsqrtx_
  203. 0x300: _060LSP__fsubs_
  204. 0x308: _060LSP__fsubd_
  205. 0x310: _060LSP__fsubx_