Re: i686 quirk for AMD Geode

Matteo Croce
2009-10-03T03:08:20Z

[-- Attachment #1: Type: text/plain, Size: 654 bytes --]

On Sat, Oct 3, 2009 at 4:34 AM, H. Peter Anvin <hpa@zytor.com> wrote:
> On 10/02/2009 07:12 PM, Matteo Croce wrote:
>> Hi,
>>
>> the AMD GEode LX has an x86 id of 5 (i586) tought it's technically an i686:
>>
>
> a) Wrong place - it should be in cpu/amd.c.
> b) You need to also make sure that it has FCOMI and the long NOP\
>   instructions.
>
>        -hpa
>
> --
> H. Peter Anvin, Intel Open Source Technology Center
> I work for Intel.  I don't speak on their behalf.
>
>

I've run the attached files and I get this:

root@alix:/usr/src# ./longnop
Long NOPs supported: no
root@alix:/usr/src# ./fcomi
Long FCOMi supported: yes

[-- Attachment #2: longnop.c --]
[-- Type: text/x-csrc, Size: 346 bytes --]

#include <stdio.h>
#include <signal.h>
#include <setjmp.h>

static sigjmp_buf out;

void sigill(int signal)
{
siglongjmp(out, 1);
}

int main(void)
{
int died;

signal(SIGILL, sigill);

died = sigsetjmp(out, 1);

if (!died)
asm volatile("nopl 0(%eax)");

printf("Long NOPs supported: %s\n", died ? "no" : "yes");
return died;
}

[-- Attachment #3: fcomi.c --]
[-- Type: text/x-csrc, Size: 353 bytes --]

#include <stdio.h>
#include <signal.h>
#include <setjmp.h>

static sigjmp_buf out;

void sigill(int signal)
{
siglongjmp(out, 1);
}

int main(void)
{
int died;

signal(SIGILL, sigill);

died = sigsetjmp(out, 1);

if (!died)
asm volatile("fcomi st(0), st(1)");

printf("Long FCOMi supported: %s\n", died ? "no" : "yes");
return died;
}