搜索
bottom↓
回复: 3

请教MDK怎么使用软浮点。(已解决)

[复制链接]

出0入0汤圆

发表于 2017-4-18 18:29:56 | 显示全部楼层 |阅读模式
本帖最后由 haistart 于 2017-4-18 20:02 编辑

我正使用MDK裸机开发新唐972,arm9没有硬浮点,所以要用软浮点,但发现添加mdk自带的<math.h>之后发现不带浮点。万能的坛友,怎么办呢?要用到的函数是log(x)。

解决方法:log(10000.0f/RES),必须要把“f”加上。都是自己的问题,照搬了IAR的习惯。

出0入0汤圆

 楼主| 发表于 2017-4-18 19:23:23 | 显示全部楼层
4.41 Default selection of hardware or software floating-point support
The default target FPU architecture is derived from use of the --cpu option.

If the processor specified with --cpu has a VFP coprocessor, the default target FPU architecture is the VFP architecture for that processor. For example, the option --cpu ARM1136JF-S implies the option --fpu vfpv2.
If a VFP coprocessor is present, VFP instructions are generated. If there is no VFP coprocessor, the compiler generates code that makes calls to the software floating-point library fplib to carry out floating-point operations. fplib is available as part of the standard distribution of the ARM compilation tools suite of C libraries.

根据说明书我在misc control选项那里添加 --fpu vfpv2之后,整个程序都不能正常运行了。

出0入0汤圆

发表于 2017-4-18 19:47:32 | 显示全部楼层
发现不带浮点


怎么发现的? 要是MDK的ARMCC编译器和 libm 不支持软浮点,那MDK早没人用了。

出0入0汤圆

 楼主| 发表于 2017-4-18 20:01:53 | 显示全部楼层
aozima 发表于 2017-4-18 19:47
怎么发现的? 要是MDK的ARMCC编译器和 libm 不支持软浮点,那MDK早没人用了。 ...

不好意思,是我的错。照搬了IAR的习惯。
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-4-20 08:36

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表