Re: Floating point in interrupt handler
- From: "Daan Vreeken [PA4DAN]" <Danovitsch@xxxxxxxxxx>
- Date: Tue, 23 Oct 2007 08:04:33 +0200
Hi SorAlx
On Tuesday 23 October 2007 03:35:09 you wrote:
As a first test I've created a simple loop that uses integer
arithmetic and a lookup table to create a sine wave on one of the DAC
outputs. This works like a charm, but I really would like to be able
to use floating point instructions to create more advanced control
loops. So I've added asm inline functions to use the FPU's fsin and
fcos operands. At the start of my loop function I (try to) save the
FPU state with the following code :
why do you need floating point? Your ADCs and DACs are probably no more
than 16 bit anyway.
Because of several reasons. The most important one being that it's a work
related project. I'm the one developing the driver, not the one that's going
to write the control loop. I need this driver to be usable by anyone with
basic mathematical/programming skills.
The second reason would be : "because I know it can be done". The code I
currently have successfully uses floating point instructions in the kernel.
Any modern CPU can execute extreme amounts of floating point instructions per
second.
Please lets not try to discuss the (dis)advantages of integer math vs.
floating point. I know how to write integer math, but it's not what I'm
looking for for this project.
Thanks,
--
Daan
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"
- References:
- Floating point in interrupt handler
- From: Daan Vreeken [PA4DAN]
- Floating point in interrupt handler
- Prev by Date: Re: Segfault in _auditreduce_
- Next by Date: Re: Floating point in interrupt handler
- Previous by thread: Floating point in interrupt handler
- Next by thread: Re: Floating point in interrupt handler
- Index(es):
Relevant Pages
- Re: PIC + DDS = Frequency Synthesizer?
... thus the software calculation loop cycle time ... are 20 instructions
available to update the phase accumulator, ... lookup and control the DAC. ... software
loop cycle. ... (comp.arch.embedded) - Re: IBM System z9
... add hardware features to speed up operations for which there ... If one is going
to add new instructions to a machine at *all*, ... large company that sells computers.
... Decimal floating point, therefore, offers to extend this convenience - ... (comp.arch) - Re: ML matrices multiplication accuracy
... Core Duo Processor T2500), I got all 9 cases exactily the same: ... accept just
two floating point inputs and then round the result back down ... to 53 bits precision
each time. ... I know that there are such instructions ... (comp.soft-sys.matlab) - Re: /CLR floating point performance, inter-assembly function call performance
... results run very much against that conventional wisdom. ... Floating
point performance of managed code. ... function calls in that loop at all. ... The
expense of transitions. ... (microsoft.public.dotnet.languages.vc) - Re: Making a function safe for use in an ISR
... Floating point instructions should be avoided even if the instruction ...
floating point operations in the ISR without first saving the stack ... as well as restoring
the MMX state after the interrupt execution. ... (comp.arch.embedded)