天嵌 ARM开发社区

 找回密码
 注册
查看: 4441|回复: 4

请问ARM9下浮点运算的问题。

[复制链接]
zyp568 发表于 2012-7-20 08:00:37 | 显示全部楼层 |阅读模式
实验板:     TQ2440
实验环境: Ubuntu12.04 + arm-linux-gcc-3.4.5-glibc-2.3.6
在代码中使用到浮点数运算,单个源文件编译可以通过,链接时出现一串很长的错误提示,根据错误提示到网上搜索了下,大概是因为硬件不支持浮点运算的问题。
但是,都没有讲清楚具体是怎么回事,怎么解决。请各位指点一下呐。
我试过把浮点运算的地方全部改成整型运算,编译,链接都没问题。
另外还想请教下,TFTLCD实验中的那个画线的算法,不太看得明白 ,请各位给点提示吧。
具体错误信息如下:
  1. arm-linux-gcc -Wall -O2 -c -o output/Head.o source/Head.s
  2. arm-linux-gcc -Wall -O2 -c -o output/Init.o source/Init.c
  3. arm-linux-gcc -Wall -O2 -c -o output/MMU.o source/MMU.c
  4. arm-linux-gcc -Wall -O2 -c -o output/Nand_K9F2G08U0B.o source/Nand_K9F2G08U0B.c
  5. arm-linux-gcc -Wall -O2 -c -o output/Interrupt.o source/Interrupt.c
  6. arm-linux-gcc -Wall -O2 -c -o output/Test.o source/Test.c
  7. arm-linux-gcc -Wall -O2 -c -o output/TFTLCD.o source/TFTLCD.c
  8. arm-linux-ld -TTest.lds -o output/Test.elf output/Head.o output/Init.o output/MMU.o output/Nand_K9F2G08U0B.o output/Interrupt.o output/Test.o output/TFTLCD.o
  9. output/TFTLCD.o(.text+0xd0): In function `TFTDrawLine':
  10. : undefined reference to `__floatsisf'
  11. output/TFTLCD.o(.text+0xe4): In function `TFTDrawLine':
  12. : undefined reference to `__floatsisf'
  13. output/TFTLCD.o(.text+0xf0): In function `TFTDrawLine':
  14. : undefined reference to `__divsf3'
  15. output/TFTLCD.o(.text+0x10c): In function `TFTDrawLine':
  16. : undefined reference to `__addsf3'
  17. output/TFTLCD.o(.text+0x110): In function `TFTDrawLine':
  18. : undefined reference to `__fixunssfsi'
  19. output/TFTLCD.o(.text+0x12c): In function `TFTDrawLine':
  20. : undefined reference to `__floatsisf'
  21. output/TFTLCD.o(.text+0x134): In function `TFTDrawLine':
  22. : undefined reference to `__addsf3'
  23. output/TFTLCD.o(.text+0x13c): In function `TFTDrawLine':
  24. : undefined reference to `__addsf3'
  25. output/TFTLCD.o(.text+0x150): In function `TFTDrawLine':
  26. : undefined reference to `__floatsisf'
  27. output/TFTLCD.o(.text+0x15c): In function `TFTDrawLine':
  28. : undefined reference to `__subsf3'
  29. output/TFTLCD.o(.text+0x204): In function `TFTDrawLine':
  30. : undefined reference to `__floatsisf'
  31. output/TFTLCD.o(.text+0x218): In function `TFTDrawLine':
  32. : undefined reference to `__floatsisf'
  33. output/TFTLCD.o(.text+0x224): In function `TFTDrawLine':
  34. : undefined reference to `__divsf3'
  35. output/TFTLCD.o(.text+0x244): In function `TFTDrawLine':
  36. : undefined reference to `__addsf3'
  37. output/TFTLCD.o(.text+0x248): In function `TFTDrawLine':
  38. : undefined reference to `__fixunssfsi'
  39. output/TFTLCD.o(.text+0x264): In function `TFTDrawLine':
  40. : undefined reference to `__floatsisf'
  41. output/TFTLCD.o(.text+0x26c): In function `TFTDrawLine':
  42. : undefined reference to `__addsf3'
  43. output/TFTLCD.o(.text+0x274): In function `TFTDrawLine':
  44. : undefined reference to `__addsf3'
  45. output/TFTLCD.o(.text+0x288): In function `TFTDrawLine':
  46. : undefined reference to `__floatsisf'
  47. output/TFTLCD.o(.text+0x294): In function `TFTDrawLine':
  48. : undefined reference to `__subsf3'
  49. output/TFTLCD.o(.text+0x35c): In function `TFTDrawLine':
  50. : undefined reference to `__floatsisf'
  51. output/TFTLCD.o(.text+0x364): In function `TFTDrawLine':
  52. : undefined reference to `__addsf3'
  53. output/TFTLCD.o(.text+0x374): In function `TFTDrawLine':
  54. : undefined reference to `__floatsisf'
  55. output/TFTLCD.o(.text+0x37c): In function `TFTDrawLine':
  56. : undefined reference to `__addsf3'
  57. output/TFTLCD.o(.text+0x38c): In function `TFTDrawLine':
  58. : undefined reference to `__floatsisf'
  59. output/TFTLCD.o(.text+0x394): In function `TFTDrawLine':
  60. : undefined reference to `__addsf3'
  61. output/TFTLCD.o(.text+0x3a4): In function `TFTDrawLine':
  62. : undefined reference to `__floatsisf'
  63. output/TFTLCD.o(.text+0x3ac): In function `TFTDrawLine':
  64. : undefined reference to `__addsf3'
  65. output/TFTLCD.o(.text+0x3bc): In function `TFTDrawLine':
  66. : undefined reference to `__floatsisf'
  67. output/TFTLCD.o(.text+0x3c4): In function `TFTDrawLine':
  68. : undefined reference to `__addsf3'
  69. output/TFTLCD.o(.text+0x3d4): In function `TFTDrawLine':
  70. : undefined reference to `__floatsisf'
  71. output/TFTLCD.o(.text+0x3dc): In function `TFTDrawLine':
  72. : undefined reference to `__addsf3'
  73. output/TFTLCD.o(.text+0x3ec): In function `TFTDrawLine':
  74. : undefined reference to `__floatsisf'
  75. output/TFTLCD.o(.text+0x3f4): In function `TFTDrawLine':
  76. : undefined reference to `__addsf3'
  77. output/TFTLCD.o(.text+0x404): In function `TFTDrawLine':
  78. : undefined reference to `__floatsisf'
  79. output/TFTLCD.o(.text+0x40c): In function `TFTDrawLine':
  80. : undefined reference to `__addsf3'
  81. make: *** [Test.bin] Error 1
复制代码


TQ-lkp 发表于 2012-7-20 14:51:13 | 显示全部楼层
2440不支持硬件浮点运算
回复

使用道具 举报

cbncb 发表于 2012-7-20 15:34:08 | 显示全部楼层
可以看看bresenham算法
回复

使用道具 举报

 楼主| zyp568 发表于 2012-7-20 23:42:14 | 显示全部楼层
本帖最后由 zyp568 于 2012-7-20 23:44 编辑
TQ-lkp 发表于 2012-7-20 14:51
2440不支持硬件浮点运算

恩,在网上看过一些解决办法,是在MakeFile中添加一些东西,我对MF还不熟悉,看不懂那些语句是做什么用的。
应该不至于要自己写浮点数运算函数吧?
以前学过AVR单片机,也没有硬件浮点运算电路,但是通过MakeFile中的设置,就可以让编译器自动生成浮点运算代码。
回复

使用道具 举报

 楼主| zyp568 发表于 2012-7-20 23:47:10 | 显示全部楼层
cbncb 发表于 2012-7-20 15:34
可以看看bresenham算法

谢谢,没学过信号处理、图像处理之类的课程,呵呵。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号-2 )

GMT+8, 2025-6-17 09:37 , Processed in 2.040304 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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