On Mon, Apr 20, 2009 at 3:35 PM, Jason Moxham <[email protected]> wrote:
>> cc -c jeff32.s jeff32.c gives no errors
>> but linking it does. gcc gives errors as well.
>
> that because your gcc is 64 bit
Of course, should have thought of that.
> gcc on a 32bit K7 compiles those files you attached No problem
>
> gmp-4.3.0 config.guess does the same thing , can you see what files it creates
gmp has a two-stage system at the end. It generates two different .s
files, first it tries:
cc dummy-278371.s dummy-278372.c -o dummy
If that fails (which it does and looks similar to the mpir
config.guess output) it tries the other .s file:
cc dummy-278370.s dummy-278372.c -o dummy
which succeeds. Running the binary returns "core2". I will attach
both .s and the .c file for you to look at.
Jeff.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"mpir-devel" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/mpir-devel?hl=en
-~----------~----~----~----~------~----~------~--~---
.globl cpuid
.globl _cpuid
cpuid:
_cpuid:
pushl %esi
pushl %ebx
movl 16(%esp),%eax
.byte 0x0f
.byte 0xa2
movl 12(%esp),%esi
movl %ebx,(%esi)
movl %edx,4(%esi)
movl %ecx,8(%esi)
popl %ebx
popl %esi
ret
.globl cpuid
.globl _cpuid
cpuid:
_cpuid:
push %rbx
mov %esi,%eax
.byte 0x0f
.byte 0xa2
mov %ebx,(%rdi)
mov %edx,4(%rdi)
mov %ecx,8(%rdi)
pop %rbx
ret
main ()
{
char vendor_string[13];
char dummy_string[12];
long fms;
int family, model, stepping;
char *modelstr;
cpuid (vendor_string, 0);
vendor_string[12] = 0;
fms = cpuid (dummy_string, 1);
family = ((fms >> 8) & 0xf) + ((fms >> 20) & 0xff);
model = ((fms >> 4) & 0xf) + ((fms >> 12) & 0xf0);
stepping = fms & 0xf;
modelstr = "x86_64";
if (strcmp (vendor_string, "GenuineIntel") == 0)
{
switch (family)
{
case 5:
if (model <= 2) modelstr = "pentium";
else if (model >= 4) modelstr = "pentiummmx";
break;
case 6:
if (model <= 1) modelstr = "pentiumpro";
else if (model <= 6) modelstr = "pentium2";
else if (model <= 8) modelstr = "pentium3";
else if (model <= 9) modelstr = "pentiumm";
else if (model <= 12) modelstr = "pentium3";
else if (model <= 14) modelstr = "pentiumm";
else if (model <= 27) modelstr = "core2";
else modelstr = "atom";
break;
case 15:
modelstr = "pentium4";
break;
}
}
else if (strcmp (vendor_string, "AuthenticAMD") == 0)
{
switch (family)
{
case 5:
if (model <= 3) modelstr = "k5";
else if (model <= 7) modelstr = "k6";
else if (model == 8) modelstr = "k62";
else if (model == 9) modelstr = "k63";
else if (model == 10) modelstr = "geode";
else if (model == 13) modelstr = "k63";
break;
case 6:
modelstr = "athlon";
break;
case 15:
case 16:
modelstr = "athlon64";
break;
}
}
else if (strcmp (vendor_string, "CyrixInstead") == 0)
{
/* Should recognize Cyrix' processors too. */
}
else if (strcmp (vendor_string, "CentaurHauls") == 0)
{
switch (family)
{
case 6:
if (model < 9) modelstr = "viac3";
else modelstr = "viac32";
break;
}
}
printf ("%s\n", modelstr);
return 0;
}