[Issue 231] long is 4-byte aligned in unittest with 4 character module name

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 29 12:21:55 PDT 2006


http://d.puremagic.com/issues/show_bug.cgi?id=231





------- Comment #3 from someidiot at earthlink.net  2006-06-29 14:21 -------
Seems like only FP-double has a problem being 32-bit aligned on the x86?


"On Pentium and PentiumPro, double and long double values should be aligned to
an 8 byte boundary (see -malign-double) or suffer significant run time
performance penalties. On Pentium III, the Streaming SIMD Extension (SSE) data
type __m128 suffers similar penalties if it is not 16 byte aligned."


"On the Pentium and subsequent x86 processors, there is a substantial
performance penalty if double-precision variables are not stored 8-byte
aligned; a factor of two or more is not unusual. Unfortunately, the stack (the
place that local variables and subroutine arguments live) is not guaranteed by
the Intel ABI to be 8-byte aligned."


This would suggest 'double' should be correctly aligned on the stack (for
better performance). In particular, a double[] should be correctly aligned (on
the heap also) ?


-- 




More information about the Digitalmars-d-bugs mailing list