Math Trans Help
12 messages in this thread
I'd like to use the IEEE math translation libraries in a Manx 3.6 program,
to convert some 64 bit IEEE doubles to FFP single precision format. (I
know, I'll lose precision.) Any tips on creating and using these
functions, if I'm currently compiled with Motorola FFP floats? I'll start
studying the Manx source code for these libraries, but any tips would be
appreciated.
Language warriors please drop dead, I haven't the time to argue "Why?".
We don't provide any routines for converting from IEEE<->FFP. However, I
think there are some routines provided by C= to do such a conversion. I'm
at home at the moment and don't have my RKMs handy, but I can check for you
tomorrow if you'd like.
-Mike
Yes, they can be found in the 'mathtrans' libraries. However, double IEEE
numbers are 64 bit entities. Commodore's routines require these to be
passed in d0/d1 for instance. How could Manx 3.6 handle this? Perhaps I
need to code a little assembler glue to get this to work… The 32 bit
things could be passed like any long value.
Yep, some assembler glue code would be in order.
-Mike
Any ideas on a reference on IEEE numbers, short of ordering some obscure
$50 article from IEEE? I'd at least like to confirm that the 8087 32 and
64 bit floats are the same as the ones used in the Amiga IEEE, and that I
don't need to do any byte swapping, etc. I'm reading some data in PC IEEE
format into the Amiga…
The Motorola 68881 reference manual describes the IEEE formats (all of
'em). I don't see an ISBN on it or anything so I guess you have to order it
directly from Motorola.
I'm 95% sure that the 8087's format is identical to the Amiga IEEE (both
single and double precision).
-Mike
Why wasn't any support provided in Manx to use these extended math
libraries, aside from choosing which math model to use? What I mean is,
shouldn't I be able to call these functions directly, instead of building
my own glue for them?
I think (not sure though) that 3.6 came out before we knew the exact
formats of the calls. In any case 5.0 has glue and #pragmas for all the
1.3 functions (and version 5.0d will have all 2.0 stuff).
-Mike
Language warriors please drop dead? <- may I use this? <grin>
Sure. My royalties are low. 🙂 When the Manx vs. Lattice wars get
started, I rarely hear debate about the most important issue to me, as
exemplified my this situation. I've got a couple megs of code in the
InterChange/InterFont products, and can't make the switch to Lattice
without a long period of testing. And in other projects at Syndesis, we use
Lattice, but would like to interface to other Manx code… Switching is
not an issue. Getting things done is the issue.
Well said! I never EVER met a person who was luke warm over his computer
choice or him main language. Nuff said!