0001 =============
0002 Current State
0003 =============
0004
0005 The following describes the current state of the NetWinder's floating point
0006 emulator.
0007
0008 In the following nomenclature is used to describe the floating point
0009 instructions. It follows the conventions in the ARM manual.
0010
0011 ::
0012
0013 <S|D|E> = <single|double|extended>, no default
0014 {P|M|Z} = {round to +infinity,round to -infinity,round to zero},
0015 default = round to nearest
0016
0017 Note: items enclosed in {} are optional.
0018
0019 Floating Point Coprocessor Data Transfer Instructions (CPDT)
0020 ------------------------------------------------------------
0021
0022 LDF/STF - load and store floating
0023
0024 <LDF|STF>{cond}<S|D|E> Fd, Rn
0025 <LDF|STF>{cond}<S|D|E> Fd, [Rn, #<expression>]{!}
0026 <LDF|STF>{cond}<S|D|E> Fd, [Rn], #<expression>
0027
0028 These instructions are fully implemented.
0029
0030 LFM/SFM - load and store multiple floating
0031
0032 Form 1 syntax:
0033 <LFM|SFM>{cond}<S|D|E> Fd, <count>, [Rn]
0034 <LFM|SFM>{cond}<S|D|E> Fd, <count>, [Rn, #<expression>]{!}
0035 <LFM|SFM>{cond}<S|D|E> Fd, <count>, [Rn], #<expression>
0036
0037 Form 2 syntax:
0038 <LFM|SFM>{cond}<FD,EA> Fd, <count>, [Rn]{!}
0039
0040 These instructions are fully implemented. They store/load three words
0041 for each floating point register into the memory location given in the
0042 instruction. The format in memory is unlikely to be compatible with
0043 other implementations, in particular the actual hardware. Specific
0044 mention of this is made in the ARM manuals.
0045
0046 Floating Point Coprocessor Register Transfer Instructions (CPRT)
0047 ----------------------------------------------------------------
0048
0049 Conversions, read/write status/control register instructions
0050
0051 FLT{cond}<S,D,E>{P,M,Z} Fn, Rd Convert integer to floating point
0052 FIX{cond}{P,M,Z} Rd, Fn Convert floating point to integer
0053 WFS{cond} Rd Write floating point status register
0054 RFS{cond} Rd Read floating point status register
0055 WFC{cond} Rd Write floating point control register
0056 RFC{cond} Rd Read floating point control register
0057
0058 FLT/FIX are fully implemented.
0059
0060 RFS/WFS are fully implemented.
0061
0062 RFC/WFC are fully implemented. RFC/WFC are supervisor only instructions, and
0063 presently check the CPU mode, and do an invalid instruction trap if not called
0064 from supervisor mode.
0065
0066 Compare instructions
0067
0068 CMF{cond} Fn, Fm Compare floating
0069 CMFE{cond} Fn, Fm Compare floating with exception
0070 CNF{cond} Fn, Fm Compare negated floating
0071 CNFE{cond} Fn, Fm Compare negated floating with exception
0072
0073 These are fully implemented.
0074
0075 Floating Point Coprocessor Data Instructions (CPDT)
0076 ---------------------------------------------------
0077
0078 Dyadic operations:
0079
0080 ADF{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - add
0081 SUF{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - subtract
0082 RSF{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - reverse subtract
0083 MUF{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - multiply
0084 DVF{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - divide
0085 RDV{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - reverse divide
0086
0087 These are fully implemented.
0088
0089 FML{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - fast multiply
0090 FDV{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - fast divide
0091 FRD{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - fast reverse divide
0092
0093 These are fully implemented as well. They use the same algorithm as the
0094 non-fast versions. Hence, in this implementation their performance is
0095 equivalent to the MUF/DVF/RDV instructions. This is acceptable according
0096 to the ARM manual. The manual notes these are defined only for single
0097 operands, on the actual FPA11 hardware they do not work for double or
0098 extended precision operands. The emulator currently does not check
0099 the requested permissions conditions, and performs the requested operation.
0100
0101 RMF{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - IEEE remainder
0102
0103 This is fully implemented.
0104
0105 Monadic operations:
0106
0107 MVF{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - move
0108 MNF{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - move negated
0109
0110 These are fully implemented.
0111
0112 ABS{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - absolute value
0113 SQT{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - square root
0114 RND{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - round
0115
0116 These are fully implemented.
0117
0118 URD{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - unnormalized round
0119 NRM{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - normalize
0120
0121 These are implemented. URD is implemented using the same code as the RND
0122 instruction. Since URD cannot return a unnormalized number, NRM becomes
0123 a NOP.
0124
0125 Library calls:
0126
0127 POW{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - power
0128 RPW{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - reverse power
0129 POL{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - polar angle (arctan2)
0130
0131 LOG{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - logarithm to base 10
0132 LGN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - logarithm to base e
0133 EXP{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - exponent
0134 SIN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - sine
0135 COS{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - cosine
0136 TAN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - tangent
0137 ASN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - arcsine
0138 ACS{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - arccosine
0139 ATN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - arctangent
0140
0141 These are not implemented. They are not currently issued by the compiler,
0142 and are handled by routines in libc. These are not implemented by the FPA11
0143 hardware, but are handled by the floating point support code. They should
0144 be implemented in future versions.
0145
0146 Signalling:
0147
0148 Signals are implemented. However current ELF kernels produced by Rebel.com
0149 have a bug in them that prevents the module from generating a SIGFPE. This
0150 is caused by a failure to alias fp_current to the kernel variable
0151 current_set[0] correctly.
0152
0153 The kernel provided with this distribution (vmlinux-nwfpe-0.93) contains
0154 a fix for this problem and also incorporates the current version of the
0155 emulator directly. It is possible to run with no floating point module
0156 loaded with this kernel. It is provided as a demonstration of the
0157 technology and for those who want to do floating point work that depends
0158 on signals. It is not strictly necessary to use the module.
0159
0160 A module (either the one provided by Russell King, or the one in this
0161 distribution) can be loaded to replace the functionality of the emulator
0162 built into the kernel.