[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] ia64 long double alignment test
From: |
Brett Cundal |
Subject: |
[Help-smalltalk] ia64 long double alignment test |
Date: |
Thu, 3 Jun 2004 09:00:29 -0700 |
User-agent: |
Mutt/1.5.5.1+cvs20040105i |
Heya,
I've received some assistance in trying to track down the cause for
the build failures on most 64-bit archs, and I think I may have
tracked it down at least for ia64.
There's a test in aclocal.m4 (included from config/align.m4) which
attempts to determine the alignment of double and long double
types. This test gives the following result on ia64:
checking for double... yes
checking size of double... 8
checking for double alignment... 8
checking for long double... yes
checking size of long double... 16
checking for long double alignment... 8
However, according to this:
http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,180,00.html
The correct alignment for long double on Itanium is 16 bytes.
So the test appears to be bad. I found the following test:
http://sources.redhat.com/ml/autoconf/1999-07/msg00002.html
struct foo {
union align {
double d;
long l;
void *p;
} u;
char c;
};
int main() {
struct foo f[2];
printf("sizeof(foo)=%ld\n", (long) sizeof(struct foo));
printf("sizeof(align)=%ld\n", (long) sizeof(union align));
printf("sizeof(f2)=%ld\n", (long) sizeof(f));
if( 2*sizeof(union align) != sizeof(f) ) {
printf("union may be aligned on %ld byte boundaries.\n",
(long)(sizeof(struct foo) - sizeof(union align)));
return 1;
}
printf("union must be aligned on %ld byte boundaries.\n",
(long)sizeof(union align));
return 0;
}
Does this test work? I don't have access to any 64-bit archs to test
this.
How would I turn this into a replacement test in config/align.m4?
Thanks for any assistance.
-- Brett
signature.asc
Description: Digital signature
- [Help-smalltalk] ia64 long double alignment test,
Brett Cundal <=