Re: FPU emulation incorrect for 68LC040?

Mattias Engdegård
2010-07-22T19:55:43Z

22 jul 2010 kl. 03.05 skrev Finn Thain:

> But if you send me some inline asm, I'll patch it into busybox and
> test a
> 2.6.34 initramfs for you.

Thanks! Try this:

void test_postinc(void)
{
double x = 0.0;
double a[2] = {3.5, 0.0};
double *p = a;
__asm__ volatile ("fneg.d (%0)+,%1" : "+a"(p), "+f"(x));
printf("postinc: result %f (expected %f), address %p
(expected %p)\n",
x, -3.5, p, a + 1);
}

void test_predec(void)
{
double x = 0.0;
double a[2] = {-1.75, 0.0};
double *p = a + 1;
__asm__ volatile ("fneg.d -(%0),%1" : "+a"(p), "+f"(x));
printf("predec: result %f (expected %f), address %p (expected
%p)\n",
x, 1.75, p, a);
}