旋转数字计算机 [英] Cordic

查看:66
本文介绍了旋转数字计算机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在为一个函数库实现CORDIC

算法的实现。

CORDIC算法的一个好处是你可以通过简单的数字添加来实现它。

除以两个幂的分数(双打) 。然而,那里有
似乎不是C / C ++语言中的任何机制

来指导编译器进行这种有效的划分形式,

有什么想法,经验吗?


dave

Hi,

I''m working on an implementation of the CORDIC
algorithm for a library of functions.

One of the benefits of the CORDIC algorithm is that you
can implement it with simple additions of numbers and
division of (doubles) by powers of two. However, there
doesn''t seem to be any mechanism in the C/C++ language
to direct the compiler to do this efficient form of division,
any ideas, experiences out there please?

dave

推荐答案

Dave Townsend写道:
Dave Townsend wrote:
我正在为一个函数库实现CORDIC算法的实现。

CORDIC算法的一个好处就是你
可以通过简单的数字添加来实现它,并且可以通过两个幂来划分(双精度)。然而,在C / C ++语言中似乎没有任何机制可以指导编译器进行这种有效的划分形式,
任何想法,经验都在那里吗?
I''m working on an implementation of the CORDIC
algorithm for a library of functions.

One of the benefits of the CORDIC algorithm is that you
can implement it with simple additions of numbers and
division of (doubles) by powers of two. However, there
doesn''t seem to be any mechanism in the C/C++ language
to direct the compiler to do this efficient form of division,
any ideas, experiences out there please?




我很好奇你是如何得出[明显的]结论

无论编译器做什么(没有你的指示)是某种方式

低效。


V

-

请从我的地址中删除资金通过邮件回复时



I am curious about how you''ve arrived to the [apparent] conclusion
that whatever the compiler does (without your direction) is somehow
inefficient.

V
--
Please remove capital As from my address when replying by mail




" Victor Bazarov" <五******** @ comAcast.net>在消息中写道

新闻:Xs ****************************** @ comcast.com。 ..

"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:Xs******************************@comcast.com. ..
Dave Townsend写道:
Dave Townsend wrote:
我正在为一个函数库实现CORDIC
算法的实现。

任何想法,经验都在那里吗?
I''m working on an implementation of the CORDIC
algorithm for a library of functions.

One of the benefits of the CORDIC algorithm is that you
can implement it with simple additions of numbers and
division of (doubles) by powers of two. However, there
doesn''t seem to be any mechanism in the C/C++ language
to direct the compiler to do this efficient form of division,
any ideas, experiences out there please?



我很好奇你是如何得出[明显的]结论
无论编译器做什么(没有你的指示)都是某种程度上效率低下的。

V
-
请通过邮件回复从我的地址删除资金



I am curious about how you''ve arrived to the [apparent] conclusion
that whatever the compiler does (without your direction) is somehow
inefficient.

V
--
Please remove capital As from my address when replying by mail



我发生了看看生成的汇编代码 - 虽然在VC6上调试

模式。


9:双d = 100.00;

00401028 mov dword ptr [ebp-8],0

0040102F mov dword ptr [ebp-4],40590000h

10:double e = d / 2;

00401036 fld qword ptr [ebp-8]

00401039 fdiv qword ptr [__real @ 8 @ 40008000000000000000(00423ff0)]

0040103F fstp qword ptr [ebp- 10 h]

11:双倍f = d / 2.5;

00401042 fld qword ptr [ebp-8]

00401045 fdiv qword ptr [__real @ 8 @ 40008000000000000000(00423030)]

0040104B fstp qword ptr [ebp-18h]


I happend to have looked at the assembly code generated - albeit in Debug
mode on VC6.

9: double d = 100.00;
00401028 mov dword ptr [ebp-8],0
0040102F mov dword ptr [ebp-4],40590000h
10: double e = d / 2 ;
00401036 fld qword ptr [ebp-8]
00401039 fdiv qword ptr [__real@8@40008000000000000000 (00423ff0)]
0040103F fstp qword ptr [ebp-10h]
11: double f = d / 2.5;
00401042 fld qword ptr [ebp-8]
00401045 fdiv qword ptr [__real@8@40008000000000000000 (00423030)]
0040104B fstp qword ptr [ebp-18h]


Dave Townsend skrev:
Dave Townsend skrev:
Victor Bazarov <五******** @ comAcast.net>在消息中写道
新闻:Xs ****************************** @ comcast.com。 ..
"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:Xs******************************@comcast.com. ..
Dave Townsend写道:
Dave Townsend wrote:
我正在为一个函数库实现CORDIC
算法的实现。

任何想法,经验都在那里吗?我很好奇你是如何得出[明显的]结论
无论编译器做什么(没有你的指示)都是某种程度上无效的。

V -
请通过邮件回复时从我的地址删除资金
I''m working on an implementation of the CORDIC
algorithm for a library of functions.

One of the benefits of the CORDIC algorithm is that you
can implement it with simple additions of numbers and
division of (doubles) by powers of two. However, there
doesn''t seem to be any mechanism in the C/C++ language
to direct the compiler to do this efficient form of division,
any ideas, experiences out there please? I am curious about how you''ve arrived to the [apparent] conclusion
that whatever the compiler does (without your direction) is somehow
inefficient.

V
--
Please remove capital As from my address when replying by mail


我发生了查看生成的汇编代码 - 虽然在Debug
模式下VC6。


I happend to have looked at the assembly code generated - albeit in Debug
mode on VC6.




您是否根据调试代码将编译器视为低效?

9:double d = 100.00;
00401028 mov dword ptr [ebp-8],0
0040102F mov dword ptr [ebp-4],40590000h
10:double e = d / 2;
00401036 fld qword ptr [ebp- 8]
00401039 fdiv qword ptr [__real @ 8 @ 40008000000000000000(00423ff0)]
0040103F fstp qword ptr [ebp-10h]
11:double f = d / 2.5;
00401042 fld qword ptr [ebp-8]
00401045 fdiv qword ptr [__real @ 8 @ 40008000000000000000(00423030)]
0040104B fstp qword ptr [ebp-18h]



Are you trashing a compiler as inefficient based on the debug code?

9: double d = 100.00;
00401028 mov dword ptr [ebp-8],0
0040102F mov dword ptr [ebp-4],40590000h
10: double e = d / 2 ;
00401036 fld qword ptr [ebp-8]
00401039 fdiv qword ptr [__real@8@40008000000000000000 (00423ff0)]
0040103F fstp qword ptr [ebp-10h]
11: double f = d / 2.5;
00401042 fld qword ptr [ebp-8]
00401045 fdiv qword ptr [__real@8@40008000000000000000 (00423030)]
0040104B fstp qword ptr [ebp-18h]




您认为什么是更有效的替代品?


-

TB @ SWEDEN



And what do you deem as a more efficient substitute?

--
TB @ SWEDEN


这篇关于旋转数字计算机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆