PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

floating point lib

Hi folks.

I just want to share my excitement about the software float code from Peter Teichmann.

http://www.peter-teichmann.de/download/fp.zip

I did some number crunching (inversion and matrix multiplication of a 300*300 float-matrix). The timing shows an average increase by factor 1.8. If I consider how much time is spent in housekeeping and index calculation I'd expect speedup of the raw math primitives of at least factor two.

The code needs a bit love to compile with EVC, also it does not do any special case handling like NANs and infinites. Rounding modes are ignored as far as I can see, so the results are a bit imprecise bit still good enough to invert a 300*300 matrix.


I think for cases where some floating point precision is needed this might be a very good alternative to the built in float emulation code.
torus wrote: The timing shows an average increase by factor 1.8.

That's compared to compiler-provided float? How does this compare to fixed point math?

- HM
did you compare it to code generated with the Intel XScale compiler (which in general creates much faster floating-point code)?

Daniel
drgoldie wrote:did you compare it to code generated with the Intel XScale compiler (which in general creates much faster floating-point code)?

Daniel


No, I haven't, I don't have the intel compiler.

If I don't mind I'll attach the test code. Could you please compile it and send me the executable back? I'd like to see how much faster it is.

Thanks,
Nils
Attachments:
matrix.cpp (8 KB)
hm":3qml0myt]

It is still a lot slower. I just checked the multiplication. It needs ca. 50 simple instructions to multiply two floats.

That makes it about twice as fast as a integer division performance wise. Float addition needs more work. Guess it's on par with a division.

I can run a test against integer, but I'll have to write a new test case. The matrix multiplication stuff I did won't give a usefull result if I just change float to fixedpoint.
Here are my test results, all were run on an X50v at 624MHz.

eVC3 Invert: 20575 ticks
eVC3 Multiply: 24515 ticks

eVC4 Invert: 20736 ticks
eVC4 Multiply: 24217 ticks

IntelCC Invert: 8981 ticks
IntelCC Multiply: 10161 ticks

i used the folling Intel C++ Compiler specific settings:
/Qipo /Ox /QTPxsc3 /Qvec_report1

this represents my previous experiences that the Intel XScale compiler is about 2x as fast with floating-point intensive code. besides that it has less "Internal Compiler Error" problems with complex C++ code.

bye,
Daniel
drgoldie wrote:
this represents my previous experiences that the Intel XScale compiler is about 2x as fast with floating-point intensive code. besides that it has less "Internal Compiler Error" problems with complex C++ code.


Looks familiar.

Intel c++ even wins over the floating point lib. Guess they have some special cases for float macs (a+=b*c). I use these a lot, and they can be written more efficient in one function.

If intel only would make the compiler free for hobby use. I like to write some code every once in a while, but it just does not satisfy to buy the compiler. I do my serious programming at work for win32 and consoles.
Nobody tried with the ARM compiler of VS2005 ? It's better than evc4 and evc3..
StephC,

I would do so, I already installed the VS.net beta, but I can't find the download link of the mobile resource kit (or whatever it is called nowadays).
torus wrote:StephC,

I would do so, I already installed the VS.net beta, but I can't find the download link of the mobile resource kit (or whatever it is called nowadays).

Microsoft Pocket PC 2003 SDK ?
torus wrote:StephC,

I would do so, I already installed the VS.net beta, but I can't find the download link of the mobile resource kit (or whatever it is called nowadays).

http://msdn.microsoft.com/mobility/windowsmobile/howto/resourcekit/default.aspx

- HM
i thought VS.NET 2005 only supports Windows Mobile 2005...

Daniel
No, the compiler support any WinCE OS, you just have to tell him...

Code:

Set CEVersion=310
Set CePlatform=WIN32_PLATFORM_PSPC
Set CESubsystem=windowsce,3.00

Set CPP_PROJ=/nologo /O1 /W0 /GS- /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /c


And it works on any ARM based PocketPC.
great news!
but since the final version of VS.NET 2005 should be out pretty soon i'll wait for that.

thanks,
Daniel