<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Visual C++/x86:<BR>
 <BR>
 <BR>
#include <stdio.h><BR>
int main()<BR>{<BR> printf("%u %u\n", __alignof(double), __alignof(__int64));<BR> return 0;<BR>}<BR><BR>gcc/Linux/x86:<BR>
#include <stdio.h><BR>
int main()<BR>{<BR> printf("%u %u\n", __alignof(double), __alignof(long long));<BR> return 0;<BR>}<BR>
 <BR>
 <BR>
both print "8 8".<BR>
 <BR>
 <BR>
Fixing this would break some pickles that contain LONGINT and/or LONGREAL, depending on if they needed padding to align.<BR>
 <BR>
 <BR>
 - Jay<BR><BR> <BR>
<HR id=stopSpelling>
From: jay.krell@cornell.edu<BR>To: m3devel@elegosoft.com<BR>Subject: max_align<BR>Date: Tue, 26 Jan 2010 12:15:21 +0000<BR><BR>
<STYLE>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Verdana;}
</STYLE>
I kind of think max_align ought to left up at 64 for all platforms, or better yet, just removed.<BR> <BR>In particular, this align LONGINT on 64bit boundaries on 32bit x86 systems.<BR>And also double (LONGFLOAT, whatever).<BR> <BR>This would help with atomic compare exchange on 64 bit values on x86.<BR>It would probably let us drop the m3cg x86 -mno-align-double switch.<BR>  That would have saved me quite some debugging time a while ago....<BR>Not sure about -munaligned-doubles though on Linux/sparc.<BR> <BR>I'd have to check what the language allows, but if there is "adequate" and<BR>"ideal" alignment, then users should maybe be able to ask for "adequate"<BR>if they have large arrays and want to optimize for memory.<BR> <BR>Note that some platforms (PA64_HPUX, PPC_LINUX) have 128bit-aligned jmpbuf.<BR>Though max_align doesn't appear to be applied to jmpbufs.<BR> <BR>Notice that the language doesn't let you declare such high alignment.<BR> <BR>- Jay<BR><BR>                                      </body>
</html>