[comp.sys.hp] C math library under HPUX-6.21

quale@uhura.cs.wisc.edu (Douglas E. Quale) (01/27/89)

HPUX-5.3 for the HP-9000/300s allowed the ld library -l881 to use the
MC68881 math coprocessor to perform the math functions in the -lm library.
Even though I never saw this documented, it seemed to work.

Now that we've upgraded to 6.21 this library is gone, and the code generated
using -lm is a bit bulkier than the code generated by 5.3 using -l881.

What's up?

 -- Doug Quale
 uhura.cs.wisc.edu

mike@hpfcdc.HP.COM (Mike McNelly) (01/31/89)

> HPUX-5.3 for the HP-9000/300s allowed the ld library -l881 to use the
> MC68881 math coprocessor to perform the math functions in the -lm library.
> Even though I never saw this documented, it seemed to work.

> Now that we've upgraded to 6.21 this library is gone, and the code generated
> using -lm is a bit bulkier than the code generated by 5.3 using -l881.

> What's up?

 > -- Doug Quale
 > uhura.cs.wisc.edu

lib881.a, usually accessed via -l881 on the cc line, was an interim
solution to providing MC68881 support for our compilers.  At the time it
was introduced, the compilers were not capable of generating code to use
the coprocessor directly; instead, function calls to the library were
made which then called the coprocessor via handwritten assembly code.

The library was only needed for one release because we modified the
compilers to use coprocessor instructions directly, thereby improving
performance and executable file size considerably.  The library has not
been needed for several releases.

libm.a, usually accessed via -lm, contains code for math functions other
than the basic arithmetic ones such as add, subtract, multiply, and
divide.  The floating point versions of these routines have been written
to use the MC68881/2 instructions if the coprocessor is installed on the
machine.  Otherwise, software emulation takes place.  We provide only a
single version of libm.a to run on both the MC68010 systems, which do
not have coprocessors, and MC68020/MC68030 machines, which do.

I hope this explains things a bit.

Mike McNelly	mike%hpfcla@hplabs.hp.com

markm@hpfcdc.HP.COM (Mark McDowell) (01/31/89)

	The purpose of lib881.a was to provide access to the 68881 as a
	temporary solution before the compilers supported the 68881.  As
	such, it only contained code for the 68881.  Newer libm.a
	routines not only support the 68881, but also contain code to
	perform their functions in software and on the older 98635A
	floating point card.  Based upon what hardware is available at
	run time, the code in a given routine will decide which version
	to use.

	Mark McDowell