home *** CD-ROM | disk | FTP | other *** search
/ MacFormat España 17 / MacFormat 17 (Spain) / MacFormat 17.bin / Recursos / SoftwareFPU 3.03 / SoftwareFPU Documentation / Programmer Info (.txt) < prev   
Encoding:
Common Ground  |  1995-02-18  |  16.3 KB  |  121 lines  |  [CGDC/CGVM]

  1. Programmer Info
  2. CGDCCGVM
  3. Times
  4. John Neil & Associates
  5. P.O. Box 2156
  6. Cupertino, CA 95015  USA
  7. Orders:
  8. E-Mail:
  9. (800) 663-2943
  10. (415) 661-2944
  11. johnneil@netcom.com
  12. lUUUU
  13. HUUUU
  14. I$UUUU
  15. ------
  16. <<<<<<
  17. KKKKKK
  18. ZZZZZZ
  19. iiiiii
  20. xxxxxx
  21. Programmer Information
  22.     John Neil
  23. February 10, 1995
  24. What SoftwareFPU Does
  25. YSoftwareFPU is a control panel which emulates a Motorola 68881 Floating Point Unit (FPU).
  26. )\It is intended to be used in any 68020, 68030, or 68LC040 Macintosh computer without an FPU.
  27. ^It can also be used on Power Macintosh machines, since the Apple 68K emulator does not emulate
  28. _FPU instructions.  It works by patching out the F-Line exception vector of the machine with one
  29. 1that points to FPU emulation code in SoftwareFPU.
  30. /Differences Between a 68881 FPU and SoftwareFPU
  31. RThe differences between the hardware FPU and SoftwareFPU are minimal.  The current
  32. )7differences between SoftwareFPU and a hardware FPU are:
  33. /FRESTORE does not support the busy state frame.
  34. Mid-instruction exceptio
  35. )s/ns are reported as post-instruction exceptions.
  36. ZIf an exception occurs in trace mode, two instructions will execute before control returns
  37. to the debugger.
  38. TCode which puts data below the stack pointer and then issues an FPU instruction will
  39. Xnot work.  This is of course a no-no since data below the stack pointer can be clobbered
  40. by interrupt routines as well.
  41. OSome emulated FPU instructions may produce slightly different results than on a
  42. hardware FPU.
  43. ;YIn addition, on PowerPC machines in 64-bit accuracy mode the following differences exist:
  44. UThe rounding precision in the FPU Mode Control Byte is ignored.  All calculations are
  45. Pperformed as if double-precision rounding was selected in the Mode Control Byte.
  46. SFor performance reasons, the PowerPC emulator cannot emulate address and bus errors
  47. Xproperly.  If an FPU instruction causes an address or bus error, the emulator will break
  48. Pinto MacsBug at a location inside the emulator, rather than at the offending FPU
  49. instruction.
  50. ;<The current list of known application incompatibilities are:
  51. IAny program which replaces the F-line exception vector will not work with
  52. RSoftwareFPU.  A typical example is a source-level debugger in a development system
  53. Mlike MPW or THINK C/Symantec C++.  SoftwareFPU 3.0 provides a new facility so
  54. Xapplications like this can detect whether SoftwareFPU is installed, to determine whether
  55. Bor not the F-Line exception vector should be replaced (see below).
  56. Times
  57. QA bug in the MPW 3.1 nan() function means that any program calling nan() will not
  58. Swork.  Because of this, the MPW functions atan2(), asin(), and acos() will not work
  59. Twhen they try to  produce QNANs.  Also, fscanf will not read in NANs correctly.  The
  60. bug has been fixed in MPW 3.2.
  61. MCode which assumes that calls to SANE affect the FPU will  not work.  The MPW
  62. [functions sinh() and cosh() may produce incorrect results in the exception status register,
  63. *as the library code makes this assumption.
  64. SCode that depends on 68882 or 68040 FPU stack frames or instructions will not work.
  65. FSoftwareFPU currently only emulates a 68881 FPU, even on 68LC040 CPUs.
  66. VApplications that depend upon a particular FPU should verify the type of FPU installed
  67.     with the 
  68. Courier
  69. gestaltFPUType
  70.  Gestalt selector.
  71. Performance
  72. _Because of the overhead in emulating all the intricacies of the FPU, executing FPU instructions
  73. )Rthrough SoftwareFPU is slower than calling SANE.  SoftwareFPU is aware of existing
  74. [applications that can switch between hardware or software floating-point (such as Microsoft
  75. SExcel), and does not report the presence of an FPU, so they will not slow down with
  76. bSoftwareFPU installed.  However, if you are writing a new application with this functionality, you
  77. \should check whether SoftwareFPU is installed using the new facility in SoftwareFPU 3.0 (see
  78. 0below) before selecting hardware floating point.
  79. %Detecting the Presence of SoftwareFPU
  80. YSoftwareFPU adds a new Gestalt selector when it is installed in the system.  To determine
  81. )Iwhether SoftwareFPU is installed, simply make the following Gestalt call:
  82. long 
  83.     response;
  84. result 
  85. estalt(
  86. &response);
  87. If the result of the call is 
  88. noErr
  89. ;, then SoftwareFPU is installed, and the 68881 FPU reported
  90. by the 
  91. gestaltFPUType
  92. )TD selector is an emulated FPU.  The value returned in the response is
  93. )9private to John Neil & Associates, and should be ignored.
  94. 68LC040 CPU Chip Bug
  95. MThe 68LC040 chip bug mentioned in the user documentation is that with certain
  96. )Xinstructions streams, pending CPU writes to memory never arrive when an F-Line exception
  97. ^occurs.  Most Macintosh applications are not affected by the bug, since an F-Line exception is
  98. Vnormally a fatal error.   However, software that depends on F-Line exceptions, such as
  99. WSoftwareFPU, will not work properly.  There is no known work-around for the bug once an
  100. Zexception has occurred (the only possible work-around that SoftwareFPU could use).  At the
  101. dapplication level, putting a NOP in front of every F-Line instruction will eliminate the problem, at
  102. [the expense of reducing performance on machines with hardware FPUs.  Despite this bug, some
  103. [FPU applications still work with SoftwareFPU on 68LC040 machines, because their instruction
  104. Ystreams do not trigger the bug.  For more information on the bug, please contact Motorola
  105. Semiconductor Inc.
  106. *6(@4
  107. =8 >+'
  108. /    .#+
  109.     temp.0001
  110. g,YO0.
  111. John M. Neil
  112. John M. Neil
  113. Microsoft Word
  114. Times
  115. Courier
  116. rPREC
  117. ~PRVS
  118. Programmer Info
  119. CGDCCGVM
  120. CGDCCGVM
  121.