#68882 in C
6 messages in this thread
Help!!!! I am trying to write some functions that take advantage of my
68882. If I understand the RKMs, I need to open the MathIeeeDoubBas
library — I've done this. I've included all the files in the RKM
examples and I keep getting linker messages that it can't find stcl_h,
stcl_d, flsbf, etc. I am especially disturbed that it can't find @main.
Exactly what do I need to do to use this library? I'm using SAS C v5.10a
(it might be 5.10b). Thanks in advance!
Steve
SAS/C can generate 68881/2 instructions in-line with your code. Or it can use
the IEEE libraries. It just the simple matter of throwing a compiler switch or
two. Your compiler manual should have all the info you need.
Steve,
I suggest just using the -m8 option on your 5.10 compiler (for any
V6 users out there, MATH=68882). This will not use the mathieee
library, but it will generate inline 68881/68882 code.
If your code must run on machines that do not have a coprocessor,
use the -mi switch instead. Assuming you're linking with our provided
startup, you don't need to do anything else.
Make sure that you link with the math library that matches your
-m option, though! That's a common mistake that has many people
puzzled. In V6 we added a warning message from the linker if you
mix math options, but in V5 you're on your own.
–Doug
Doug,
I'm not sure what the -m8 option is. It is not documented in my manuals.
If I use it, do I need to open MathIeeeDoubBas.library? If I open the
IEEE library, do I also need to open the ffp library to get the conversion
routines? Are these questions making any sense?
Steve
The -m8 option causes the compiler to add in-line FPU instructions into your
code instead of calling library routines to do the math operations. This type
of code will only work if you have an FPU, but it is the fastest way of using
said FPU.
The IEEE math libraries and the FFP math libraries are quite different.
Normally, if you plan on using an FPU, you have no need to use the FFP
libraries. They are slower and less accurate than the FPU. The FFP "Fast
Floating Point" libraries were developed by Motorola some time ago for medium
accuracy and good speed using a special format to represent numbers. The IEEE
libraries are slower but more accurate. The 68881/2 also use IEEE format
numbers.
If you use the right option, link with the right libraries, and
use our startup, you do not need to open any libraries. The
startup/library code does that automatically for you.
I don't know what version of the manuals you can possibly be
looking at that doesn't have -m8 documented. As far as I know, it's
been around since the version 5.0 days at least, possibly before
that. In any event, it works just like the other math options except
you must link with the lcm881.lib instead of one of the other math
libraries.