完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
我注意到KEIL包括使用Prtff/Savf的全部(不是小的,不是紧凑的,而是大的)浮点例程库,即使从不使用浮点类型参数。是否有一个相对干净和简单的方法来防止FP例程被加载?
以上来自于百度翻译 以下为原文 I have noticed that Keil includes the full (not the small, not the compact, but the large) library of floating point routines when you use printf/sprinf even if the float type parameter is never used. Is there a relatively clean and simple way to prevent the fp routines from being loaded? |
|
相关推荐
4个回答
|
|
我一直认为程序中未使用的部分在项目-gt;构建设置-gt;keil 8051 & gt;链接器中,“删除未使用的段”选项设置为true。
鲍勃 以上来自于百度翻译 以下为原文 I always thought that unused parts of a program are optimized-out when in Project -> Build settings -> Keil 8051 -> Linker the option "Remove unused Segments" is set to true. Bob |
|
|
|
这是一个新的转折点。我注释了所有的SaveTFF调用,看看FP例程实际使用了多少空间。代码大小下降了大约1K,但我注意到在地图文件中,FP模块仍在链接。唯一使用FP的其他地方是ADC,它具有使用浮点的两个功能,但是这些功能在不使用时被优化。通过交叉引用LST和MAP文件来验证,LST文件中的FP例程调用的所有发生在显示在MAP文件中的函数中。此外,在地图文件的顶部附近,它陈述了以下内容:“内存模型:浮点运算大”。
这里是另一个拷贝和粘贴从地图文件: 公共符号模块:.DP8051 KEILY903发布(项目)OMF(LCD) 值类类型公共符号名 事业单位 … 01000 243H代码?C?FCASTC 01000?C?FCASTI 01000?C?FCASTL 01000 1C2H代码?C?FPCMP 代码?C?FPCMP3 01000 123H代码?C?FPDI 01000?C?FPGETOPN2 010001AH代码?C?FPMUL 01000 2E3H代码?C?FPNA结果 01000 2EDH代码?C?贫困流 01000 2C5H代码?C?砰砰声 01000 2D9H代码?C?FPROULT2 01000 2EAH代码?C?流下流动 … 以上来自于百度翻译 以下为原文 Here's a new twist. I commented out all of my sprintf calls to see how much space the FP routines were actually using. The code size dropped by about 1k, but I noticed in the MAP file that the FP modules were still being linked. The only other place that uses any FP is the ADC which has two functions that use floats, but those functions are optimized out as they are not being used. I verified by cross referencing the LST and MAP files that all occurences of a FP routine call in the LST file were in functions that were shown as being deleted in the MAP file. Also, right near the top of the MAP file it states the following: "MEMORY MODEL: LARGE WITH FLOATING POINT ARITHMETIC". Here are another copy and paste from the MAP file: PUBLIC SYMBOLS OF MODULE: .DP8051_Keil_903Release(project).omf (LCD) VALUE CLASS TYPE PUBLIC SYMBOL NAME ================================================= ... 01000243H CODE --- ?C?FCASTC 0100023EH CODE --- ?C?FCASTI 01000239H CODE --- ?C?FCASTL 010001C2H CODE --- ?C?FPCMP 010001C0H CODE --- ?C?FPCMP3 01000123H CODE --- ?C?FPDIV 010002AEH CODE --- ?C?FPGETOPN2 0100001AH CODE --- ?C?FPMUL 010002E3H CODE --- ?C?FPNANRESULT 010002EDH CODE --- ?C?FPOVERFLOW 010002C5H CODE --- ?C?FPRESULT 010002D9H CODE --- ?C?FPRESULT2 010002EAH CODE --- ?C?FPUNDERFLOW ... |
|
|
|
我刚刚创建了一个新的空项目。地图文件中没有浮动。当我插入一个浮点并给它分配一个值时,我得到了与.map文件中一样的标题,结果文件只是代码中的12位。
鲍勃 以上来自于百度翻译 以下为原文 I just created a new empty project. There was no float in the map-file. When I inserted a float and assigned it a value, I got the same header as you in the .Map-file, the resulting file was just 12 bits larger in code. Bob |
|
|
|
我尝试了NoDebug库链接器指令,然后添加了C51 LIB,但由于ADC API中的FP使用,它不会链接。我猜想链接发生在未使用段的优化和删除之前。如果优化被扩展到库例程以及API,那就太好了。看起来无论我是否使用FP程序,我都被困在FP程序中。还有人有这个问题的经验吗?
以上来自于百度翻译 以下为原文 I tried the NODEFAULTLIBRARY linker directive and then added the C51L.LIB, but it wouldn't link because of the FP usage in the ADC API. I guess the linking happens prior to the optimization and deletion of unused segments. It would be nice if that optimization was extended to the library routines as well as the APIs. It looks like I'm stuck with the FP routines whether I use them or not. Anyone else have any experience with this issue? |
|
|
|
只有小组成员才能发言,加入小组>>
748个成员聚集在这个小组
加入小组2051 浏览 1 评论
1805 浏览 1 评论
3615 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1742 浏览 6 评论
1496 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
472浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
328浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
396浏览 2评论
337浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
759浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-2 15:14 , Processed in 0.718323 second(s), Total 53, Slave 46 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号