FLOATING POINT with rtems

Mohammed Khoory mkhoory at eiast.ae
Mon Dec 2 01:10:06 UTC 2013


Ah, a small mistake:

For #1, what I meant to say was, in sparc.h in line 72, you should see the
following:

#if defined(_SOFT_FLOAT)
#define SPARC_HAS_FPU 0
#else
#define SPARC_HAS_FPU 1
#endif

What should be done is remove all the lines except:
#define SPARC_HAS_FPU 1

As mentioned in the wiki 

>-----Original Message-----
>From: rtems-users-bounces at rtems.org [mailto:rtems-users-
>bounces at rtems.org] On Behalf Of Mohammed Khoory
>Sent: Monday, December 02, 2013 10:05 AM
>To: 'Luca Cinquepalmi'; rtems-users at rtems.org
>Subject: RE: FLOATING POINT with rtems
>
>I've had this issue before as well. The main reason this is happening is
because
>with a default build of RTEMS, the FPU doesn't get enabled on startup, and
so
>when you try to use any hardware fpu instructions, you get a trap. I
followed
>this wiki article to help fix it
>http://www.rtems.org/wiki/index.php/Floating_Point_Support
>
>What I did was:
>1. In the RTEMS Source, go to cpukit/score/cpu/sparc/rtems/score/sparc.h,
>and add the following
>#define SPARC_HAS_FPU 1
>
>This will cause the RTEMS build to add a few instructions on bootup so that
the
>FPU is enabled. Also, it will also make sure that context switches will
also store
>the FPU context. You can see this in cpu.h line 119, and in cpu_asm.S
>
>2. Before building RTEMS, set these environment variables
>CFLAGS_FOR_BUILD="-mhard-float -mcpu=v8"
>CFLAGS_FOR_TARGET="-mhard-float -mcpu=v8"
>
>3. After building and installing RTEMS, make sure that when building your
>application, you also pass "-mhard-float -mcpu=v8" to the compiler options
>
>This isn't exactly an elegant solution but it has worked for me. Ideally
this
>whole process would be managed by the build process.
>
> I hope this helps.
>
>_______________________________________________
>rtems-users mailing list
>rtems-users at rtems.org
>http://www.rtems.org/mailman/listinfo/rtems-users




More information about the users mailing list