Andreas Jaeger wrote:
Waldek Hebisch hebisch@math.uni.wroc.pl writes:
In detail: gpc shares code generator (about 80% of the compiler) with gcc. To make compiler for AMD 64 one has to apply a patch to gcc --
Which patch is this? Why is it non yet in GCC 3.3 or 3.4?
[ cc to Jan Hubicka ] We discussed the problem in June. Gpc runtime uses sets, and to build gpc the backend have to be able to pass sets as parameters. With the patch below cross compiler from i386 to x86_64 is able to build gpc runtime. I am not able to cross-build glibc (I used glibc headers, but I faked libc.a) so the resulting executables have no chance to run, and I have no acces to AMD 64 machine to test ... But the resulting assembly code looks reasonable, so I think that with true glibc the compiler should build OK.
The patch is one possible implementation of passing set arguments. I do not not what Jan Hubicka wants to have in the backend -- in June he did not answer when I sent him the code.
Sorry for the delay. I must have missed your mail twice. The patch is OK for mainline/3.3 branch.
Honza
diff -ru gcc-3.3.1.orig/gcc/config/i386/i386.c gcc-3.3.1/gcc/config/i386/i386.c --- gcc-3.3.1.orig/gcc/config/i386/i386.c Tue Jul 8 21:16:44 2003 +++ gcc-3.3.1/gcc/config/i386/i386.c Thu Oct 16 00:25:52 2003 @@ -1853,6 +1853,31 @@ } } }
else if (TREE_CODE (type) == SET_TYPE)
{
if (bytes <= 4)
{
classes[0] = X86_64_INTEGERSI_CLASS;
return 1;
}
else if (bytes <= 8)
{
classes[0] = X86_64_INTEGER_CLASS;
return 1;
}
else if (bytes <= 12)
{
classes[0] = X86_64_INTEGER_CLASS;
classes[1] = X86_64_INTEGERSI_CLASS;
return 2;
}
else
{
classes[0] = X86_64_INTEGER_CLASS;
classes[1] = X86_64_INTEGER_CLASS;
return 2;
}
- } else abort ();
-- Waldek Hebisch hebisch@math.uni.wroc.pl