Universal SIMD Mathlibrary

HDe
Posts: 4
Joined: Tue Aug 19, 2008 3:46 pm

Universal SIMD Mathlibrary

Post by HDe »

Mathfunctions for single precision floating point vector datatypes are provided for the SIMD-platforms x86 (SSE2), PowerPC and Cell. In most cases, speed and/or accuracy compare favourable with existing SIMD-libraries (MacOS Accelerate Framework, Cell SDK). Most of the algorithms are based on those of the Cephes library, while the implementation is branchfree and parallelized for minimum pipeline stalls. The Universal SIMD Mathlibrary (usm) provides the functions sin, cos, tan, asin, acos, atan, atan2, sqrt, exp, log, pow, abs, ceil, floor, ldexp, and frexp. It is licensed under the GPL3.

Testresults for various platforms and libraries:
http://www.fh-furtwangen.de/~dersch/libsimdmath.pdf
Sources and documentation
http://www.fh-furtwangen.de/~dersch/libsimdmath.tar.gz

Helmut Dersch
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Universal SIMD Mathlibrary

Post by Erwin Coumans »

Thanks for sharing the results and work.

1) Reference [3] link to an obsolete URL at sourceforge, can you please link to the new repository at http://bullet.googlecode.com?
The Cell-SDK functions exhibit a couple of serious errors (RMS-error: atan; peak-error: sin, cos, atan, log) and deficiencies (atan2), which are corrected in usm.
2) Do you have any details on those serious errors and deficiencies? In particular how to reproduce those errors, with specific input and expected exact output etc.

3) The GPL3 license is incompatible with most commercial game development. Console publishers won't accept this license on PlayStation 3, XBox 360 etc. Can you consider making it available under the MIT, BSD or Zlib license?

Erwin
HDe
Posts: 4
Joined: Tue Aug 19, 2008 3:46 pm

Re: Universal SIMD Mathlibrary

Post by HDe »

The simdmath-library mentioned in the tests is the IBM-library included in the cell-sdk, and referenced in the first link given in References [3[; the second link is wrong, sorry, I will correct this later. The errors and deficiencies mentioned in the text are those quantified in tables 2 and 3, and which can be reproduced by compiling and running the included testprogram 'tps3m'.

Regards

Helmut Dersch
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Universal SIMD Mathlibrary

Post by Erwin Coumans »

which can be reproduced by compiling and running the included testprogram 'tps3m'.
That is convenient, we'll check it out.

Although similar, the IBM Cell SDK simdlibrary is different/separated from the Sony simdmath library provided in Bullet. Unless they show identical performance and errors/deficiencies, could you separate them into different references?

How about the license, do you consider making your Universal SIMD Mathlibrary (usm) available under Zlib,BSD or MIT, or even dual-license it (Zlib+GPL3)?

Thanks,
Erwin
HDe
Posts: 4
Joined: Tue Aug 19, 2008 3:46 pm

Re: Universal SIMD Mathlibrary

Post by HDe »

The IBM and Sony/Bullet SIMDlibraries are indeed quite different, not only the implementation, but apparently also some of the algorithms. I expect different testresults.

Sorry again for listing them under one reference. For now I have removed the link to the Sony/Bullet library. I will apply the same tests in the next days and post the results here. I'll also check the license.

Regards

Helmut Dersch
HDe
Posts: 4
Joined: Tue Aug 19, 2008 3:46 pm

Re: Universal SIMD Mathlibrary

Post by HDe »

The testresults for the Bullet/Sony library:
http://www.fh-furtwangen.de/~dersch/libsimdmath2.pdf

The ppu-version is very slow. The spu-version is fast, but has some accuracy problems (relative errors of sin/cos/tan). It is not as disastrous as it looks from the tables since it affects only small function values: The absolute errors are smaller, but still >10x as large as in the ppu-version.

Regards

Helmut Dersch
Christer Ericson
Posts: 23
Joined: Mon Jun 27, 2005 4:30 pm
Location: Los Angeles

Re: Universal SIMD Mathlibrary

Post by Christer Ericson »

HDe wrote:Mathfunctions for single precision floating point vector datatypes are provided for the SIMD-platforms x86 (SSE2), PowerPC and Cell. In most cases, speed and/or accuracy compare favourable with existing SIMD-libraries (MacOS Accelerate Framework, Cell SDK). Most of the algorithms are based on those of the Cephes library, while the implementation is branchfree and parallelized for minimum pipeline stalls. The Universal SIMD Mathlibrary (usm) provides the functions sin, cos, tan, asin, acos, atan, atan2, sqrt, exp, log, pow, abs, ceil, floor, ldexp, and frexp. It is licensed under the GPL3.
I hate to be Mr Negativity, but this is a terrible test that shows absolutely nothing about the relative qualities of these libraries! Not to mention that the majority of our SIMD code (which is probably typical game code) pretty much doesn't involve any of the above-mentioned functions (perhaps with the exception of abs).