Re: Mersenne: HLLLL and HLL....

2000-06-24 Thread Guillermo Ballester Valor

Hi:

[EMAIL PROTECTED] wrote:
 On IA32 systems, how the code is aligned is also a factor. To compare
   accurately, you'd really need the separate code fragments to be in
   their own dedicated segments. This is not the way that un*x or Win32
   applications are usually coded.
 
 Not being up on the latest HLL compilers, I would still suspect that some
 compiler directives/options would be available to handle alignment properly
 without much headache, especially if it is as important as you suggest.
 
 I have the teensiest fraction of knowledge about C (I'm trying to learn it
 now), but I know a little about compiling C programs.  With DJGPP, you can
 enable cool options like -malign-double which can really speed up some
 programs.  Is this the "alignment" that you're speaking of?
 
On IA32 system, the alignment is one of the most important factors to
achieve a decent performance. Unfortunately, some compilers (GNU/gcc) do
not make the alignment correctly in a easy way. When writing Glucas, I
discovered than -malign-double only aligns double when they are
global-static variables. The local variables on the stack are not
aligned, there is only a 50% chance of that (because they are 4-byte
aligned). In a bad alignment scenery the performance can drop to the
half (or even more).  To achieve good performance I had to try the the
same trick based in a built-in malloc than FFTW uses, i.e., allocate
conditionally 4 bytes in the calling routine and so the doubles on the
called are properly aligned, an ugly solution, you see. 

Regards

Guillermo.
_
Unsubscribe  list info -- http://www.scruz.net/~luke/signup.htm
Mersenne Prime FAQ  -- http://www.tasam.com/~lrwiman/FAQ-mers



Mersenne: HLLLL and HLL....

2000-06-23 Thread STL137

 (High-level-language Lucas-Lehmer; how's that for a tortured acronym? :) 

Ew.  I suggest calling it HL4.  Compression is always a good thing!

On IA32 systems, how the code is aligned is also a factor. To compare 
  accurately, you'd really need the separate code fragments to be in 
  their own dedicated segments. This is not the way that un*x or Win32 
  applications are usually coded.

Not being up on the latest HLL compilers, I would still suspect that some
compiler directives/options would be available to handle alignment properly
without much headache, especially if it is as important as you suggest.

I have the teensiest fraction of knowledge about C (I'm trying to learn it 
now), but I know a little about compiling C programs.  With DJGPP, you can 
enable cool options like -malign-double which can really speed up some 
programs.  Is this the "alignment" that you're speaking of?

Stephan Lavavej
_
Unsubscribe  list info -- http://www.scruz.net/~luke/signup.htm
Mersenne Prime FAQ  -- http://www.tasam.com/~lrwiman/FAQ-mers