Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch.embedded > #27774

Re: Use of soft float?

Subject Re: Use of soft float?
Newsgroups comp.arch.embedded
References <pdrgnm$6lg$1@solani.org> <pdu62b$olo$1@dont-email.me> <v5c6gd164b04kfvve19ie6u7qiqf567j0q@4ax.com>
From Clifford Heath <no.spam@please.net>
Message-ID <xMIMC.76821$7H4.21630@fx12.iad> (permalink)
Date 2018-05-22 09:39 +1000

Show all headers | View raw


On 22/05/18 07:36, upsidedown@downunder.com wrote:
> On Mon, 21 May 2018 12:12:26 +0200, David Brown
> <david.brown@hesbynett.no> wrote:
> 
>> On 20/05/18 11:56, Philipp Klaus Krause wrote:
>>> While those who make heavy use of floating-point computations in
>>> embedded sytems probably go for systems with hardware support for
>>> floating-point calculations, there are plenty of systems without such
>>> support out there.
>>> And the existence of soft float implementations indicates that there is
>>> a real need for doing floating-point computations on systems without
>>> hardware floating-point support. I'd like to know a bit more about that.
>>>
>>> * What kind of computations do people use soft float for? Any real-world
>>> examples?
>>> * Which types of soft float do they use? IEEE 32- or 64-bit? Some other
>>> C standard-compliant type? 16-bit IEEE? Other 16-bit?
>>>
>>
>> Any C compiler will provide software floating point for IEEE 32-bit
>> "float".  Most also provide 64-bit "double" support, but for 8-bit
>> targets it is not unusual to have non-standard 32-bit "double".
>>
>> I would expect the vast majority of software floating point usage to be
>> directly from a C compiler.  Some few people write their own functions
>> optimised to their particular needs (such as unusual accuracy
>> requirements), but that is rare.  For the basic arithmetic, you are
>> unlikely to make significantly better general-purpose floating point
>> functions than the ones provided by the compiler, and you have the huge
>> advantage of convenience of use.
>>
>> Maths functions (like trig functions) are a different matter.  In
>> embedded systems, even those with floating point hardware, it is not
>> uncommon to have your own functions with a more appropriate balance
>> between speed and accuracy than the slow but IEEE bit-perfect standard
>> functions.
> 
> What is so "bit perfect" about IEEE floats ?

It's not that they're perfect. It's that they're
predictably imperfect, so the same program yields
the same results on different implementations.

> In practice, it is not a big issue using any proprietary (non IEEE)
> float library internally, unless you need to handle INF or other
> special values or need to communicate binary floats to/from  the
> external world.

Or you want to develop & test the program on a
different computer than it will run on.

My AD9969 Arduino code runs its tests on Intel
just fine. Much easier to diagnose issues there
before moving to target hardware.

Clifford Heath.

Back to comp.arch.embedded | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Use of soft float? Philipp Klaus Krause <pkk@spth.de> - 2018-05-20 11:56 +0200
  Re: Use of soft float? Dimiter_Popoff <dp@tgi-sci.com> - 2018-05-20 14:24 +0300
    Re: Use of soft float? Clifford Heath <no.spam@please.net> - 2018-05-21 09:24 +1000
      Re: Use of soft float? Dimiter_Popoff <dp@tgi-sci.com> - 2018-05-21 10:35 +0300
        Re: Use of soft float? Clifford Heath <no.spam@please.net> - 2018-05-22 09:33 +1000
  Re: Use of soft float? Grant Edwards <invalid@invalid.invalid> - 2018-05-20 23:39 +0000
  Re: Use of soft float? David Brown <david.brown@hesbynett.no> - 2018-05-21 12:12 +0200
    Re: Use of soft float? upsidedown@downunder.com - 2018-05-22 00:36 +0300
      Re: Use of soft float? Grant Edwards <invalid@invalid.invalid> - 2018-05-21 21:49 +0000
        Re: Use of soft float? upsidedown@downunder.com - 2018-05-22 01:41 +0300
      Re: Use of soft float? Clifford Heath <no.spam@please.net> - 2018-05-22 09:39 +1000
      Re: Use of soft float? David Brown <david.brown@hesbynett.no> - 2018-05-22 11:23 +0200
  Re: Use of soft float? Luke A. Guest <laguest@archeia.com> - 2018-06-06 04:37 +0100
    Re: Use of soft float? Reinhardt Behm <rbehm@hushmail.com> - 2018-06-06 12:54 +0800

csiph-web