Re: test machines; illegal instructions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Oct 07, 2001 at 03:39:10AM +0200, Ralf Baechle wrote:
> On Fri, Oct 05, 2001 at 10:48:15AM -0700, Jun Sun wrote:
> 
> > If your cpu does not have ll/sc instruction, you might be suffering the famous
> > sysmips() problem.  The latest kernel should get you going.
> > 
> > There is also FPU emulation bug which may cause this problem, but that only
> > happens on heavy context switches and FPU usages.
> 
> I've checked in a major bundle of FPU emu fixes last week.  The kernel
> fp code should now produce accurate results and handle exceptions and
> the Flush to Zero bit as per spec.
> 

This particular problem seems still there.  Anybody can try the following
test program on a CPU *without* fpu.

Jun


/* mipel-linux-gcc -O -o kfpe_chk3 kfpe_chk3.c */

#include <stdio.h>
#include <math.h>
#include <signal.h>
#include <sys/time.h>


double count;
int dummy;
struct itimerval ival;
int icnt=0;

static void alarm_sig_handler(int signum)
{
    int i,j;
    double d;

    if( icnt++ > 500 ){
	icnt = 0;
	/*	printf("count = %f\n", count);*/
    }
    for( i = 0, d = 0.0; d < 1.0; i++, d+=0.1 ){
	count = d;
    }
    setitimer(ITIMER_REAL, &ival, NULL);
    //    alarm(1);
}

int main()
{
    int i,j;
    double d;
    signal(SIGALRM, alarm_sig_handler);

    ival.it_interval.tv_sec = 0;
    ival.it_interval.tv_usec = 0;
    ival.it_value.tv_sec = 0;
    ival.it_value.tv_usec = 10000;
    setitimer(ITIMER_REAL, &ival, NULL);
    //    alarm(1);
    for(;;){
	for( i = 0, d = 0.0; d < 10000.0; i++, d+=0.1 ){
	    count = d;
	}
	signal(SIGALRM, alarm_sig_handler);
    }
    return 0;
}

[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux