^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) TODO LIST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) =========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) POW{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) RPW{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - reverse power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) POL{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - polar angle (arctan2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) LOG{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - logarithm to base 10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) LGN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - logarithm to base e
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) EXP{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - exponent
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) SIN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - sine
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) COS{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - cosine
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) TAN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - tangent
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) ASN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - arcsine
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) ACS{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - arccosine
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) ATN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - arctangent
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) These are not implemented. They are not currently issued by the compiler,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) and are handled by routines in libc. These are not implemented by the FPA11
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) hardware, but are handled by the floating point support code. They should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) be implemented in future versions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) There are a couple of ways to approach the implementation of these. One
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) method would be to use accurate table methods for these routines. I have
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) a couple of papers by S. Gal from IBM's research labs in Haifa, Israel that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) seem to promise extreme accuracy (in the order of 99.8%) and reasonable speed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) These methods are used in GLIBC for some of the transcendental functions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) Another approach, which I know little about is CORDIC. This stands for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) Coordinate Rotation Digital Computer, and is a method of computing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) transcendental functions using mostly shifts and adds and a few
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) multiplications and divisions. The ARM excels at shifts and adds,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) so such a method could be promising, but requires more research to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) determine if it is feasible.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) Rounding Methods
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) ----------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) The IEEE standard defines 4 rounding modes. Round to nearest is the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) default, but rounding to + or - infinity or round to zero are also allowed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) Many architectures allow the rounding mode to be specified by modifying bits
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) in a control register. Not so with the ARM FPA11 architecture. To change
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) the rounding mode one must specify it with each instruction.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) This has made porting some benchmarks difficult. It is possible to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) introduce such a capability into the emulator. The FPCR contains
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) bits describing the rounding mode. The emulator could be altered to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) examine a flag, which if set forced it to ignore the rounding mode in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) the instruction, and use the mode specified in the bits in the FPCR.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) This would require a method of getting/setting the flag, and the bits
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) in the FPCR. This requires a kernel call in ArmLinux, as WFC/RFC are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) supervisor only instructions. If anyone has any ideas or comments I
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) would like to hear them.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) NOTE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) pulled out from some docs on ARM floating point, specifically
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) for the Acorn FPE, but not limited to it:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) The floating point control register (FPCR) may only be present in some
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) implementations: it is there to control the hardware in an implementation-
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) specific manner, for example to disable the floating point system. The user
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) mode of the ARM is not permitted to use this register (since the right is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) reserved to alter it between implementations) and the WFC and RFC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) instructions will trap if tried in user mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) Hence, the answer is yes, you could do this, but then you will run a high
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) risk of becoming isolated if and when hardware FP emulation comes out
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) -- Russell.