Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Oct 2007 08:04:33 +0200
From:      "Daan Vreeken [PA4DAN]" <Danovitsch@vitsch.net>
To:        soralx@cydem.org
Cc:        FreeBSD-Hackers@freebsd.org
Subject:   Re: Floating point in interrupt handler
Message-ID:  <200710230804.33120.Danovitsch@vitsch.net>
In-Reply-To: <20071022183509.3bdbc65d@soralx>
References:  <200710222211.51590.Danovitsch@vitsch.net> <20071022183509.3bdbc65d@soralx>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200710230804.33120.Danovitsch>