Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using the Compaq Math lib natively

0 views
Skip to first unread message

gall...@cs.duke.edu

unread,
Aug 2, 2000, 3:00:00 AM8/2/00
to

Andrei A. Dergatchev writes:
> Digital' docs is the most useful thing I found - pretty detailed description of
> ieee_get_fp_control:
>

Thanks.. This is the OSF/1 definition, but seems to agree with what I
found in the linux header files.

> errno_location seems to be LinuxThreads thing - couldn't find anything
> in onlne DEC documents.

I've emperically determined this is just a pointer to errno.

The following wrapper should allow you to use the static version
of the cpml:

/* ------ cut here ---------------------------- */
#include <sys/types.h>
#include <math.h>
#include <errno.h>

u_int64_t
__ieee_get_fp_control(void)
{
return fpgetmask();
}

int *
__errno_location(void)
{
return &errno;
}
/* ------ cut here ---------------------------- */


BTW, I'm typing this from an native FreeBSD/alpha X server linked with
the cpml ;-) It seems to be faster than it used to be when linked
with the native libm.

Drew


To Unsubscribe: send mail to majo...@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message

A.Derg...@tn.utwente.nl

unread,
Aug 2, 2000, 3:00:00 AM8/2/00
to
> Does anybody know where to find a description of ieee_get_fp_control()
> and errno_location()?

Digital' docs is the most useful thing I found - pretty detailed description of
ieee_get_fp_control:

http://decline.epfl.ch/docs/DUV40E/HTML/MAN/MAN3/1089____.HTM

and even examples:

http://www.physik.fu-berlin.de/DOKU/DEC_Unix_4.0/HTML/AA-PS30D-TET1_html/peg12.html

errno_location seems to be LinuxThreads thing - couldn't find anything
in onlne DEC documents.

> The RH 6.2 linux/alpha box I set up doesn't
> seem to have a man page for ieee_get_fp_control().., but it seems to
> be in the libc. Is the source available somehow for the libc.a from
> RH6.2?
>
> Also, I haven't examined cxml yet. I imagine that this will be usable
> as well. (cxml used to be called DXML and has BLAS, LAPACK, and other
> useful math bits in it).
>
> Cheers,
>
> Drew

>
>
> ------------------------------------------------------------------------------
> Andrew Gallatin, Sr Systems Programmer http://www.cs.duke.edu/~gallatin
> Duke University Email: gall...@cs.duke.edu
> Department of Computer Science Phone: (919) 660-6590

Andrei

gall...@cs.duke.edu

unread,
Aug 2, 2000, 3:00:00 AM8/2/00
to

Compaq has a math library that they've put out for linux. Its
available from http://www.compaq.com/math/introduction/index.html

I started looking at it while doing the linux/alpha emulation work. I
noticed that it contains no system calls. It has external references
to libots (another compaq lib). Between libots and libcpml, only 2
external symbols are referenced:

U __errno_location
U __ieee_get_fp_control

I think that we might be able to use libcpml & libots natively if we
wrap them with another library to provide those 2 symbols.

To test the theory, I built bladenc, added 'int __errno_location,
__ieee_get_fp_control;' to one of the C files and linked with libcpml.
The resulting binary ran (I guess I didn't take any exceptionsl
phew!), produced a playable mp3, and was about 43% faster than a
binary linked with our libm.

Here's a table of the total time taken to produce an mp3 from a 1:40
.wav file given a variety of bladenc binaries on a 600MHz UP1000
(600MHz 21264a, 2MB L2 cache). For comparison, a 733MHz PIII Xeon
takes about 45.47 for the same file (using the gcc from 4.0-RELEASE).

Linux ccc / libcpml: 29.61
FreeBSD gcc/ libcpml: 42.51
FreeBSD gcc/ libm: 53.93

Does anybody know where to find a description of ieee_get_fp_control()

and errno_location()? The RH 6.2 linux/alpha box I set up doesn't


seem to have a man page for ieee_get_fp_control().., but it seems to
be in the libc. Is the source available somehow for the libc.a from
RH6.2?

Also, I haven't examined cxml yet. I imagine that this will be usable
as well. (cxml used to be called DXML and has BLAS, LAPACK, and other
useful math bits in it).

Cheers,

Drew

------------------------------------------------------------------------------
Andrew Gallatin, Sr Systems Programmer http://www.cs.duke.edu/~gallatin
Duke University Email: gall...@cs.duke.edu
Department of Computer Science Phone: (919) 660-6590

0 new messages