Forum > General

Question on portable code

<< < (3/3)

MathMan:

--- Quote from: Leledumbo on August 11, 2015, 11:33:02 am ---
...

As can be seen, they're only equal in -O2 optimization. Note that I'm cross compiling from x86_64 to i386 and x must be of 32-bit integer type, in x86_64 even when the integer type matches processor native pointer size (64-bit) they're never equal.

--- End quote ---

Thanks - I should have been more specific. My target platform is x86_64 and I do see differences in asm when compiling with -O3. Speed varies up to 50% between standard and Inc/Dec variant. I never compiled for 32bit target ...

However after reading your response and Thaddy I'll double check again this evening - maybe I made a simple mistake in the compiler setup.

Kind regards,
MathMan

MathMan:

--- Quote from: MathMan on August 11, 2015, 11:52:42 am ---
--- Quote from: Leledumbo on August 11, 2015, 11:33:02 am ---
...

As can be seen, they're only equal in -O2 optimization. Note that I'm cross compiling from x86_64 to i386 and x must be of 32-bit integer type, in x86_64 even when the integer type matches processor native pointer size (64-bit) they're never equal.

--- End quote ---

Thanks - I should have been more specific. My target platform is x86_64 and I do see differences in asm when compiling with -O3. Speed varies up to 50% between standard and Inc/Dec variant. I never compiled for 32bit target ...

However after reading your response and Thaddy I'll double check again this evening - maybe I made a simple mistake in the compiler setup.

Kind regards,
MathMan

--- End quote ---

To rev things up. I converted my sources to Inc/Dec yesterday and did some testing and benchmarking. Compiler target is x86-64 with maximum optimization (-O3).

Execution speed increased across the board - varying from 15% to 50% on basic primitives. The computation of 1 mio. digits of e (with a very crude algorithm so only consider the relative timing) went down from 80 seconds to 63 seconds.

Pure Pascal now is only 5 times slower than pure asm - which I find is a very good ratio considering that I had to emulate all the carry handling in Pascal.

Kind regards,
Jens

Navigation

[0] Message Index

[*] Previous page

Go to full version