README.FPE 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. The following describes the current state of the NetWinder's floating point
  2. emulator.
  3. In the following nomenclature is used to describe the floating point
  4. instructions. It follows the conventions in the ARM manual.
  5. <S|D|E> = <single|double|extended>, no default
  6. {P|M|Z} = {round to +infinity,round to -infinity,round to zero},
  7. default = round to nearest
  8. Note: items enclosed in {} are optional.
  9. Floating Point Coprocessor Data Transfer Instructions (CPDT)
  10. ------------------------------------------------------------
  11. LDF/STF - load and store floating
  12. <LDF|STF>{cond}<S|D|E> Fd, Rn
  13. <LDF|STF>{cond}<S|D|E> Fd, [Rn, #<expression>]{!}
  14. <LDF|STF>{cond}<S|D|E> Fd, [Rn], #<expression>
  15. These instructions are fully implemented.
  16. LFM/SFM - load and store multiple floating
  17. Form 1 syntax:
  18. <LFM|SFM>{cond}<S|D|E> Fd, <count>, [Rn]
  19. <LFM|SFM>{cond}<S|D|E> Fd, <count>, [Rn, #<expression>]{!}
  20. <LFM|SFM>{cond}<S|D|E> Fd, <count>, [Rn], #<expression>
  21. Form 2 syntax:
  22. <LFM|SFM>{cond}<FD,EA> Fd, <count>, [Rn]{!}
  23. These instructions are fully implemented. They store/load three words
  24. for each floating point register into the memory location given in the
  25. instruction. The format in memory is unlikely to be compatible with
  26. other implementations, in particular the actual hardware. Specific
  27. mention of this is made in the ARM manuals.
  28. Floating Point Coprocessor Register Transfer Instructions (CPRT)
  29. ----------------------------------------------------------------
  30. Conversions, read/write status/control register instructions
  31. FLT{cond}<S,D,E>{P,M,Z} Fn, Rd Convert integer to floating point
  32. FIX{cond}{P,M,Z} Rd, Fn Convert floating point to integer
  33. WFS{cond} Rd Write floating point status register
  34. RFS{cond} Rd Read floating point status register
  35. WFC{cond} Rd Write floating point control register
  36. RFC{cond} Rd Read floating point control register
  37. FLT/FIX are fully implemented.
  38. RFS/WFS are fully implemented.
  39. RFC/WFC are fully implemented. RFC/WFC are supervisor only instructions, and
  40. presently check the CPU mode, and do an invalid instruction trap if not called
  41. from supervisor mode.
  42. Compare instructions
  43. CMF{cond} Fn, Fm Compare floating
  44. CMFE{cond} Fn, Fm Compare floating with exception
  45. CNF{cond} Fn, Fm Compare negated floating
  46. CNFE{cond} Fn, Fm Compare negated floating with exception
  47. These are fully implemented.
  48. Floating Point Coprocessor Data Instructions (CPDT)
  49. ---------------------------------------------------
  50. Dyadic operations:
  51. ADF{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - add
  52. SUF{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - subtract
  53. RSF{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - reverse subtract
  54. MUF{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - multiply
  55. DVF{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - divide
  56. RDV{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - reverse divide
  57. These are fully implemented.
  58. FML{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - fast multiply
  59. FDV{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - fast divide
  60. FRD{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - fast reverse divide
  61. These are fully implemented as well. They use the same algorithm as the
  62. non-fast versions. Hence, in this implementation their performance is
  63. equivalent to the MUF/DVF/RDV instructions. This is acceptable according
  64. to the ARM manual. The manual notes these are defined only for single
  65. operands, on the actual FPA11 hardware they do not work for double or
  66. extended precision operands. The emulator currently does not check
  67. the requested permissions conditions, and performs the requested operation.
  68. RMF{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - IEEE remainder
  69. This is fully implemented.
  70. Monadic operations:
  71. MVF{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - move
  72. MNF{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - move negated
  73. These are fully implemented.
  74. ABS{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - absolute value
  75. SQT{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - square root
  76. RND{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - round
  77. These are fully implemented.
  78. URD{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - unnormalized round
  79. NRM{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - normalize
  80. These are implemented. URD is implemented using the same code as the RND
  81. instruction. Since URD cannot return a unnormalized number, NRM becomes
  82. a NOP.
  83. Library calls:
  84. POW{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - power
  85. RPW{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - reverse power
  86. POL{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - polar angle (arctan2)
  87. LOG{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - logarithm to base 10
  88. LGN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - logarithm to base e
  89. EXP{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - exponent
  90. SIN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - sine
  91. COS{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - cosine
  92. TAN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - tangent
  93. ASN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - arcsine
  94. ACS{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - arccosine
  95. ATN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - arctangent
  96. These are not implemented. They are not currently issued by the compiler,
  97. and are handled by routines in libc. These are not implemented by the FPA11
  98. hardware, but are handled by the floating point support code. They should
  99. be implemented in future versions.
  100. Signalling:
  101. Signals are implemented. However current ELF kernels produced by Rebel.com
  102. have a bug in them that prevents the module from generating a SIGFPE. This
  103. is caused by a failure to alias fp_current to the kernel variable
  104. current_set[0] correctly.
  105. The kernel provided with this distribution (vmlinux-nwfpe-0.93) contains
  106. a fix for this problem and also incorporates the current version of the
  107. emulator directly. It is possible to run with no floating point module
  108. loaded with this kernel. It is provided as a demonstration of the
  109. technology and for those who want to do floating point work that depends
  110. on signals. It is not strictly necessary to use the module.
  111. A module (either the one provided by Russell King, or the one in this
  112. distribution) can be loaded to replace the functionality of the emulator
  113. built into the kernel.