AVR如何执行浮点运算 [英] How does an AVR perform floating point Arithmetic
本文介绍了AVR如何执行浮点运算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在没有FPU的CPU上实现对double
和float
的支持以及相应的基本算法.
I'm trying to implement a support for double
and float
and corresponding basic arithmetic on a CPU without an FPU.
我知道所有AVR ATmega controllers
都有可能. ATmega也没有FPU.因此,出现了一个问题:它是如何工作的?是否有关于文学的建议或带有解释和示例的链接?
I know that it is possible on all AVR ATmega controllers
. An ATmega also has no FPU. So here comes the question: How does it work? If there any suggestions for literature or links with explanations and examples?
在最佳情况下,我将为以下代码提供支持:
At the best case I will provide a support for code like this:
double twice ( double x )
{
return x*x;
}
非常感谢, 亚历克斯
推荐答案
以下是与AVR相关的链接,其中包含有关实现软双精度的说明和示例:
Here are AVR related links with explanations and examples for implementing soft double: