Changes between Version 5 and Version 6 of TBR/UserManual/Floating_Point_Support


Ignore:
Timestamp:
Jul 12, 2009, 5:29:13 AM (10 years ago)
Author:
Kptrs
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • TBR/UserManual/Floating_Point_Support

    v5 v6  
    88RTEMS provides software and hardware floating-point support. However, there are some issues to beware of when building RTEMS and when building your applications.
    99
    10 This page has been written from a SPARC BSP perspective, so some things here may not be generally applicable.
     10This page has been written from a SPARC BSP perspective, so some things here may not be generally applicable. And it has been initially written by an experienced RTEMS user, but not by an actual RTEMS developer, so this is not definitive and there could be misunderstandings here. Feel free to improve this page.
    1111= Task/Thread Support =
    1212
     
    6767    name
    6868  );
    69 = RTEMS Library Build Support =
     69= RTEMS Library Support =
    7070
    7171
     
    107107}}}
    108108
    109 For more details about this precompiler definition and others related to floating point specializations, read the comments in any {{{cpu.h</code> file, and (even more informative) the file in the RTEMS source tree {{{doc/porting/taskcontext.t</code>, which gets built into a nice document somewhere if you have TeX, but is readable as-is.
     109For more details about this precompiler definition and others related to floating point specializations, read the comments in any {{{cpu.h</code> file, and (even more informative) the file in the RTEMS source tree {{{doc/porting/taskcontext.t</code>, which gets built into a nice document somewhere if you build the docs, but is readable as-is.
    110110
    111 Most CPUs are really a CPU family, some members of which have hardware floating point and some do not. Thus, in the example above, the definition of {{{SPARC_HAS_FPU</code> comes from another header file depending on the member of the CPU family:
     111Most CPUs are really a CPU family, some members of which have hardware floating point and some do not. Thus, in the example above, the definition of {{{SPARC_HAS_FPU</code> comes from another header file that specifies the different members of the CPU family, typically {{{cpukit/score/cpu/<cpu name>/rtems/score/<cpu name>.h</code>. For eample, for the {{{sparc}}}
    112112
     113 #if defined(_SOFT_FLOAT)
     114 #define SPARC_HAS_FPU 0
     115 #else
     116 #define SPARC_HAS_FPU 1
     117 #endif
     118
     119In theory, the determination of whether the CPU has a hardware FPU should be made based on knowledge of which CPU is involved. In practice, the determination is commonly made based on a definition set by the compiler based on compiler command line arguments such as -msoft-float (in the example above, if that compiler option is provided, then the SPARC cross-compiler automatically sets the preprocessor definition {{{_SOFT_FLOAT</code>). '''<big>This is often a mistake,</big>''' because there are other reasons for telling the compiler to use software floating point besides absence of a hardware FPU (see below).
    113120= Compiler Support =