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


Groups > comp.arch.embedded > #27762

Re: Use of soft float?

Subject Re: Use of soft float?
Newsgroups comp.arch.embedded
References <pdrgnm$6lg$1@solani.org> <pdrltg$945$1@dont-email.me>
From Clifford Heath <no.spam@please.net>
Message-ID <htnMC.187010$RM2.165435@fx05.iad> (permalink)
Date 2018-05-21 09:24 +1000

Show all headers | View raw


On 20/05/18 21:24, Dimiter_Popoff wrote:
> On 20.5.2018 г. 12: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?
>>
>> Philipp
>>
> 
> I can only speak for myself of course, here it goes.
> 
> Some 20 years ago on our first Nukeman
> ( http://tgi-sci.com/tgi/nmtb.htm ) I needed floating point.
> The need came late in the project, during spectrum evaluation
> one has to calculate isotope decay during the time acquisition
> has taken place (some isotopes have short half lives so this
> matters a lot). This took e^x or something like that, and the
> processor was an MC68340 - a CPU32 core (sort of a downgraded 68020)
> which had no FPU.
> So I wrote the FPU functions I needed - just those I needed, basic
> arithmetic plus the exponential thing I believe, may be something
> else I don't remember at the moment. The format was that the 68K
> series used, called "extended precision", 96 bit. However the
> precision was far far from it - the 68340 had 32*32->64 bit
> multiplication so I left the mantissa precision at just 32 bits,
> was plenty.

How much precision did you even need? If you have a regular clock
tick and not to many decays in parallel you can do exponential
decay just by subtracting some fraction (shift and subtract)
on each cycle.

Most recently, I used division by fractional multiplication
to speed up calculation of DDS delta words. The master clock
is fixed, and so is the calibration factor to use, so you
can calculate how many bits of headroom you have and do the
division by a multiplication plus a shift back by the headroom
amount. That's a kind of floating point:

<https://github.com/cjheath/AD9959/blob/master/AD9959.h#L220-L230>
<https://github.com/cjheath/AD9959/blob/master/AD9959.h#L220-L230>

Even a crappy little Arduino UNO can do that in 100usec, which
isn't bad for effectively a 64-bit divide. The precision averages
better than 1/10 LSB compared to the full divide.

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