ts-7000
[Top] [All Lists]

Re: [ts-7000] Floating Point problems with supplied JFFS2 image

To: Jesse Off <>, Eddie Dawydiuk <>
Subject: Re: [ts-7000] Floating Point problems with supplied JFFS2 image
From: Jim Jackson <>
Date: Mon, 4 Apr 2005 15:41:23 +0100 (BST)


Hi guys,

Re. the floating point problem with ep9301 based ts7200 boards.

Others have recompiled their toolchains to use softfloat to get round the
problem. I'd rather not.

Given there is an FP emulator in the kernel, I sort of guessing that
because the EP9301 has FP H/W (albeit broken) the kernel never gets the
illegal instruction trap to get to the FP emulation code?

Is there anyway to tell the EP9301 to disable the FP H/W and generate
traps? I searched the chips user manual but didn't find anything.

Is there any way to fix this generally?

If not can anyone point me to a suitable double precision floating point
library I could build some code against to give me FP? Preferably one with
an open source style license.

cheers
Jim

On Sun, 27 Mar 2005, Jim Jackson wrote:

> Hi, Yes I see FP problems. I reported it to Technologics back in October
> last year, and Jesse said he'd take a look if he had time. To be honest
> it's not been a show stopper for me 'cos I tend to try and use integer or
> my own fixed point stuff. However busybox uses floats occasionally (e.g.
> in it's version of "top") and my recompiled busybox "top" gives crazy
> numbers at times :-(
>
> Sorry for only posting an AOL "me too" and not being able to offer any
> help.
>
> Jim
>
> On Sun, 27 Mar 2005, genosensor wrote:
>
> >
> >
> > Has anyone else tried running applications use floating
> > point under the minimal JFFS2 Linux distro supplied with
> > the TS-7200?
> >
> > I've been unable to get much of any non-trival floating
> > point operations work in this environment, even using the
> > compiler toolchain binaries provided on the CDROM.
> >
> > I'd be very grateful if a few people could run this test
> > program on their TS-7200's can get back to me.
> >
> > Remember, it works fine under Debian.  Boot from the
> > JFFS2 image to see the failures.  If anyone _can_ get this
> > to work in that environment, _please_ do tell me all
> > about your toolchain and/or any other relevant voodoo.
> >
> > Thanks :-)
> >
> > I build with:
> >
> > $ /arm/bin/gcc -o fptest -lm fptest.c
> >
> > Substitute the path to your arm gcc for /arm/bin/gcc
> >
> > On the TS-7200, run it with:
> >
> > $ fptest -4.3
> >
> > The correct output follows.
> > Note that under the JFFS2 image, a few of the
> > functions return bogus results and the exp() fn usually
> > causes a segfault.
> >
> >
> > atof(-4.3) = -4.3 = 33 33 11 c0 33 33 33 33
> > sscanf(-4.3, "%f", &f) assigns f = -4.3 = 9a 99 89 c0
> > (int)-4.3 = -4 = fc ff ff ff
> > fabs(-4.3) = 4.3 = 9a 99 89 40
> > ceilf(-4.3) = -4 = fc ff ff ff
> > ceil(-4.3) = -4 = 50 8e 00 00
> > exp(-4.3) = 0.0135686 = a7 4e 5e 3c
> >
> > -----------------
> > fptest.c
> > -----------------
> >
> > #include <stdio.h>
> > #include <stdlib.h>
> > #include <math.h>
> >
> > void dumphex (void *adr, size_t sz)
> > {
> >   char *ch = adr;
> >   printf (" =");
> >   do
> >     printf (" %02x", *ch++ & 0xff);
> >   while (--sz);
> >   puts ("");
> > }
> >
> > int main (int argc, char **argv)
> > {
> >   if (argc > 1) {
> >     double d = atof (argv[1]);
> >     float f, f2, f3;
> >     int i, i2, i3;
> >     printf ("atof(%s) = %g", argv[1], d);
> >     dumphex (&d, sizeof(d));
> >     sscanf (argv[1], "%f", &f);
> >     printf ("sscanf(%s, \"%%f\", &f) assigns f = %g", argv[1], f);
> >     dumphex (&f, sizeof(f));
> >     printf ("(int)%g = %d", f, i=(int)f);
> >     dumphex (&i, sizeof(i));
> >     printf ("fabs(%g) = %g", f, f2=fabs(f));
> >     dumphex (&f2, sizeof(f2));
> >     printf ("ceilf(%g) = %d", f, i2=ceilf(f));
> >     dumphex (&i2, sizeof(i2));
> >     printf ("ceil(%g) = %d", f, i2=ceil((double)f));
> >     dumphex (&i3, sizeof(i3));
> >     printf ("exp(%g) = %g", f, f3=exp((double)f));
> >     dumphex (&f3, sizeof(f3));
> >     return 0;
> >   }
> >   return 2;
> > }
> >
> >
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
>


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU