IRIX's libm is terrible

IRIX/Nekoware development, porting and related topics.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
mattst88
Posts: 397
Joined: Wed Jul 13, 2005 9:54 am
Location: Hillsboro, OR
Contact:

IRIX's libm is terrible

Unread postby mattst88 » Fri Oct 29, 2010 5:53 pm

In evaluating Compaq's Alpha optimized math library (libcpml) a few months ago, we discovered Ulrich Drepper's "Math Library Quality Check" which is a program to evaluate the accuracy of various math library functions like sin, cos, tan, exp, and sqrt.

A few months ago I would have been able to explain the method for testing, but I guess it's not that important.

Anyway, the results are here http://www.akkadia.org/drepper/libm/index.html

Looks like IRIX's libm is bad.

Thought I'd share. :)
My computers including Alphas, MIPS, PA-RISCs, VAX, and SPARCs.

zuluchas
Posts: 269
Joined: Wed Jun 25, 2008 10:41 am
Location: Washington, DC, USA

Re: IRIX's libm is terrible

Unread postby zuluchas » Fri Oct 29, 2010 8:08 pm

mattst88 wrote:Anyway, the results are here http://www.akkadia.org/drepper/libm/index.html


The testing software is only vaguely cross-platform, but I've put together a patch that lets it compile and run on IRIX 6.5:
zelibm-irix.patch
this patch compiles with libfastm. to use libm, change Makefile and (optionally) re-enable sinh, cosh, and tanh in libmtest.c
(5.21 KiB) Downloaded 27 times


I tried it with libm and libfastm, with basically identical results:
zelibm-irix65-cos.png
libmtest-lm -x cos on left, libmtest-fastm -x cos on right. running on an octane2 under 6.5.22, displayed on a peecee with maxx desktop.


Interesting -- looks like not much has changed since 1998. Any truth to his conjecture that SGI had a "real" version of libm sold as a separate product back then?
:A350R: :Onyx2: :4D220VGX: :Fuel: :Indigo: :Octane2: :O2: :O3x0: :Indy:

tingo
Posts: 262
Joined: Sat Jun 26, 2010 5:40 pm
Location: Oslo, Norway

Re: IRIX's libm is terrible

Unread postby tingo » Sat Oct 30, 2010 2:04 pm

A bit OT perhaps - does Maxx Desktop run on FreeBSD?
Torfinn

User avatar
legalize
Posts: 115
Joined: Fri Sep 14, 2007 4:04 pm
Location: Salt Lake City, UT, USA
Contact:

Re: IRIX's libm is terrible

Unread postby legalize » Mon Nov 22, 2010 1:59 pm

mattst88 wrote:Looks like IRIX's libm is bad.


Wouldn't it be more accurate to say that the MIPSpro libm is bad?

gcc provides its own libm implementation, IIRC.

User avatar
mattst88
Posts: 397
Joined: Wed Jul 13, 2005 9:54 am
Location: Hillsboro, OR
Contact:

Re: IRIX's libm is terrible

Unread postby mattst88 » Mon Nov 22, 2010 3:09 pm

legalize wrote:
mattst88 wrote:Looks like IRIX's libm is bad.


Wouldn't it be more accurate to say that the MIPSpro libm is bad?

gcc provides its own libm implementation, IIRC.


No. libm is a part of the C library, so it's provided with IRIX whether you have MIPSPro or not. Likewise, it's part of glibc and not gcc.
My computers including Alphas, MIPS, PA-RISCs, VAX, and SPARCs.

User avatar
legalize
Posts: 115
Joined: Fri Sep 14, 2007 4:04 pm
Location: Salt Lake City, UT, USA
Contact:

Re: IRIX's libm is terrible

Unread postby legalize » Mon Nov 22, 2010 3:31 pm

Well then you can use the glibc implementation of the math library, right?

User avatar
PymbleSoftware
Posts: 1887
Joined: Tue Jul 15, 2008 5:48 pm
Location: P.O. Box 121, Pymble, Sydney, NSW 2073, Australia.
Contact:

Re: IRIX's libm is terrible

Unread postby PymbleSoftware » Mon Nov 22, 2010 3:46 pm

legalize wrote:Well then you can use the glibc implementation of the math library, right?


Mixing libraries between MIPS Pro and gcc is problematic. Which is why nekoware is MIPS Pro built and remains that way even though gcc improved MIPS optimization such that the difference is not as great as it once was, although I think that vendor platform specific compilers should mostly outperform an all-things-to-all-platforms compiler suite like gcc. I am thinking aCC, SunSoft C SPARC, xlC, Intel Compiler suite, etc.


Oh, and I use gcc on ARM and x86 everyday, from 9 to 5..

R.
Last edited by PymbleSoftware on Mon Nov 22, 2010 3:50 pm, edited 1 time in total.
死の神はりんごだけ食べる

開いた括弧は必ず閉じる -- あるプログラマー

:Tezro: :Tezro: :Onyx2R: :Onyx2RE: :Onyx2: :O3x04R: :O3x0: :O200: :Octane: :Octane2: :O2: :O2: :Indigo2IMP: :PI: :PI: :1600SW: :1600SW: :Indy: :Indy: :Indy: :Indy: :Indy:
:hpserv: J5600, 2 x Mac, 3 x SUN, Alpha DS20E, Alpha 800 5/550, 3 x RS/6000, Amiga 4000 VideoToaster, Amiga4000 -030, 733MHz Sam440 AmigaOS 4.1 update 1.

Sold: :Indy: :Indy: :Indy: :Indigo: Tandem Himalaya S-Series Nonstop S72000 ServerNet.

@PymbleSoftware
Current Apps -> https://itunes.apple.com/au/artist/pymb ... d553990081
Cortex ---> http://www.facebook.com/pages/Cortex-th ... 11?sk=info
Minnie ---> http://www.facebook.com/pages/Minnie-th ... 02?sk=info
Github ---> https://github.com/pymblesoftware
Visit http://www.pymblesoftware.com
Search for "Pymble", "InstaElf", "CryWhy" or "Cricket Score Sheet" in the iPad App store or search for "Pymble" or "CryWhy" in the iPhone App store.

User avatar
mattst88
Posts: 397
Joined: Wed Jul 13, 2005 9:54 am
Location: Hillsboro, OR
Contact:

Re: IRIX's libm is terrible

Unread postby mattst88 » Mon Nov 22, 2010 3:50 pm

legalize wrote:Well then you can use the glibc implementation of the math library, right?


I guess in theory, though glibc almost definitely doesn't compile on IRIX, since... well... why should IRIX need another C library, right? :)
My computers including Alphas, MIPS, PA-RISCs, VAX, and SPARCs.

User avatar
zizban
Moderator
Moderator
Posts: 1359
Joined: Sun Dec 21, 2003 6:59 pm
Location: Cheshire, MA
Contact:

Re: IRIX's libm is terrible

Unread postby zizban » Mon Nov 22, 2010 4:19 pm

tingo wrote:A bit OT perhaps - does Maxx Desktop run on FreeBSD?


It probably won't ever run on FreeBSD because of license restrictions from SGI.

User avatar
legalize
Posts: 115
Joined: Fri Sep 14, 2007 4:04 pm
Location: Salt Lake City, UT, USA
Contact:

Re: IRIX's libm is terrible

Unread postby legalize » Mon Nov 22, 2010 4:38 pm

PymbleSoftware wrote:
legalize wrote:Well then you can use the glibc implementation of the math library, right?


Mixing libraries between MIPS Pro and gcc is problematic. Which is why nekoware is MIPS Pro built and remains that way even though gcc improved MIPS optimization such that the difference is not as great as it once was [...]


Well, given that almost every program is going to use something like stdio or libm, doesn't that imply that gcc isn't a suitable development environment?

User avatar
PymbleSoftware
Posts: 1887
Joined: Tue Jul 15, 2008 5:48 pm
Location: P.O. Box 121, Pymble, Sydney, NSW 2073, Australia.
Contact:

Re: IRIX's libm is terrible

Unread postby PymbleSoftware » Mon Nov 22, 2010 4:46 pm

legalize wrote:
PymbleSoftware wrote:
legalize wrote:Well then you can use the glibc implementation of the math library, right?


Mixing libraries between MIPS Pro and gcc is problematic. Which is why nekoware is MIPS Pro built and remains that way even though gcc improved MIPS optimization such that the difference is not as great as it once was [...]


Well, given that almost every program is going to use something like stdio or libm, doesn't that imply that gcc isn't a suitable development environment?



I don't understand you. stdio is in (g)libc and libm is available with both compilers.

I use MIPS Pro on IRIX for stuff like GtK, stereo-graphics and spaceball programming. I use gcc when gcc-ism are too overwhelming when trying to poert something... Like when I ported the Hercules IBM mainframe emulator, (tarball in IBM forum somewhere)..

R.
死の神はりんごだけ食べる

開いた括弧は必ず閉じる -- あるプログラマー

:Tezro: :Tezro: :Onyx2R: :Onyx2RE: :Onyx2: :O3x04R: :O3x0: :O200: :Octane: :Octane2: :O2: :O2: :Indigo2IMP: :PI: :PI: :1600SW: :1600SW: :Indy: :Indy: :Indy: :Indy: :Indy:
:hpserv: J5600, 2 x Mac, 3 x SUN, Alpha DS20E, Alpha 800 5/550, 3 x RS/6000, Amiga 4000 VideoToaster, Amiga4000 -030, 733MHz Sam440 AmigaOS 4.1 update 1.

Sold: :Indy: :Indy: :Indy: :Indigo: Tandem Himalaya S-Series Nonstop S72000 ServerNet.

@PymbleSoftware
Current Apps -> https://itunes.apple.com/au/artist/pymb ... d553990081
Cortex ---> http://www.facebook.com/pages/Cortex-th ... 11?sk=info
Minnie ---> http://www.facebook.com/pages/Minnie-th ... 02?sk=info
Github ---> https://github.com/pymblesoftware
Visit http://www.pymblesoftware.com
Search for "Pymble", "InstaElf", "CryWhy" or "Cricket Score Sheet" in the iPad App store or search for "Pymble" or "CryWhy" in the iPhone App store.

User avatar
mattst88
Posts: 397
Joined: Wed Jul 13, 2005 9:54 am
Location: Hillsboro, OR
Contact:

Re: IRIX's libm is terrible

Unread postby mattst88 » Mon Nov 22, 2010 4:48 pm

legalize wrote:
PymbleSoftware wrote:
legalize wrote:Well then you can use the glibc implementation of the math library, right?


Mixing libraries between MIPS Pro and gcc is problematic. Which is why nekoware is MIPS Pro built and remains that way even though gcc improved MIPS optimization such that the difference is not as great as it once was [...]


Well, given that almost every program is going to use something like stdio or libm, doesn't that imply that gcc isn't a suitable development environment?


No, you misunderstand what gcc provides vs what the C library provides. (And I think PymbleSoftware does as well.)

gcc doesn't require glibc or any C library for that matter. If you compile an application using the cosine function (provided by libm) on IRIX with gcc, gcc will link this binary against IRIX's libm.

You seem to be trying to make this into some sort of disagreement, though I don't understand over what.
My computers including Alphas, MIPS, PA-RISCs, VAX, and SPARCs.

User avatar
legalize
Posts: 115
Joined: Fri Sep 14, 2007 4:04 pm
Location: Salt Lake City, UT, USA
Contact:

Re: IRIX's libm is terrible

Unread postby legalize » Mon Nov 22, 2010 6:53 pm

mattst88 wrote:
legalize wrote:
PymbleSoftware wrote:
legalize wrote:Well then you can use the glibc implementation of the math library, right?


Mixing libraries between MIPS Pro and gcc is problematic. Which is why nekoware is MIPS Pro built and remains that way even though gcc improved MIPS optimization such that the difference is not as great as it once was [...]


Well, given that almost every program is going to use something like stdio or libm, doesn't that imply that gcc isn't a suitable development environment?


No, you misunderstand what gcc provides vs what the C library provides. (And I think PymbleSoftware does as well.)


Actually, I'm clear on that. Yes, I misspoke earlier when I said gcc and not properly glibc.

gcc doesn't require glibc or any C library for that matter. If you compile an application using the cosine function (provided by libm) on IRIX with gcc, gcc will link this binary against IRIX's libm.


Right, but just above there you said that it was problematic to link between MIPSpro produced code and gcc produced code. Since the libm provided with IRIX is compiled with MIPSpro, that would seem to imply that using gcc at all is going to be problematic. Either that, or you meant glibc above when you said gcc, or you mean something else when you say "mixing libraries".

You seem to be trying to make this into some sort of disagreement, though I don't understand over what.


I'm just trying to understand your statement about mixing gcc and MIPSpro.

User avatar
mattst88
Posts: 397
Joined: Wed Jul 13, 2005 9:54 am
Location: Hillsboro, OR
Contact:

Re: IRIX's libm is terrible

Unread postby mattst88 » Mon Nov 22, 2010 7:07 pm

legalize wrote:Right, but just above there you said that it was problematic to link between MIPSpro produced code and gcc produced code. Since the libm provided with IRIX is compiled with MIPSpro, that would seem to imply that using gcc at all is going to be problematic. Either that, or you meant glibc above when you said gcc, or you mean something else when you say "mixing libraries".

legalize wrote:I'm just trying to understand your statement about mixing gcc and MIPSpro.


I think you're confusing me with PymbleSoftware. :) I didn't say that. I also don't really know what he means. Code compiled with gcc can certainly be linked with IRIX's libm which is compiled with MIPSPro.
My computers including Alphas, MIPS, PA-RISCs, VAX, and SPARCs.

User avatar
legalize
Posts: 115
Joined: Fri Sep 14, 2007 4:04 pm
Location: Salt Lake City, UT, USA
Contact:

Re: IRIX's libm is terrible

Unread postby legalize » Mon Nov 22, 2010 7:19 pm

mattst88 wrote:I think you're confusing me with PymbleSoftware. :) I didn't say that. I also don't really know what he means. Code compiled with gcc can certainly be linked with IRIX's libm which is compiled with MIPSPro.


Yes, you're correct about my confusion, sorry about that.


Return to “SGI: Development”

Who is online

Users browsing this forum: No registered users and 1 guest