旋转数字计算机

编程入门 行业动态 更新时间:2024-10-13 18:26:50
本文介绍了旋转数字计算机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在为一个函数库实现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>在消息中写道 新闻:Xs ****************************** @ comcast。 .. "Victor Bazarov" <v.********@comAcast> wrote in message news:Xs******************************@comcast. .. 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>在消息中写道新闻:Xs ****************************** @ comcast。 .. "Victor Bazarov" <v.********@comAcast> wrote in message news:Xs******************************@comcast. .. 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

更多推荐

旋转数字计算机

本文发布于:2023-11-30 09:11:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1649471.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数字计算机

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!