天嵌 ARM开发社区

 找回密码
 注册
查看: 2076|回复: 3

TQ3358-linux-浮点运算-编译选项

[复制链接]
areslion 发表于 2013-7-17 13:55:59 | 显示全部楼层 |阅读模式
在TQ3358的Linux,要生成支持否点运算的可执行程序,编译选项如何设置?
下面是我目前的设置,是否正确?
arm-linux-g++ -g -Wall -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize -ffast-math -mfloat-abi=softfp  *.cpp  -o  tqbug  -lpthread  -lsqlite3
亚瑟王 发表于 2013-7-17 15:12:08 | 显示全部楼层
没有这么复杂,直接arm-linux-gcc编译的。
 楼主| areslion 发表于 2013-7-17 16:00:25 | 显示全部楼层
亚瑟王 发表于 2013-7-17 15:12
没有这么复杂,直接arm-linux-gcc编译的。

请参看

Neon and VFP both support floating point, which should I use?
The VFPv3 is fully compliant with IEEE 754
Neon is not fully compliant with IEEE 754, so it is mainly targeted for multimedia applications
Here is an example of showing how Neon pipelining will outperform VFP:
Taking the same C function from earlier, but using floating point types instead:
void NeonTest(float * __restrict a, float * __restrict b, float * __restrict z)
{
    int i;
    for(i=0;i<200;i++) {
       z = a * b;
    }
}
Compile the above code using CodeSourcery: GCC: (CodeSourcery Sourcery G++ Lite 2007q3-51) 4.2.1
Compile the above function for both Neon and VFP and compare results:
arm-none-linux-gnueabi-gcc -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp
arm-none-linux-gnueabi-gcc -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=vfp -ftree-vectorize -mfloat-abi=softfp
Running on OMAP3EVM under Linux with a Cortex-A8 clock speed of 600MHz
VFP/NEON        Time to execute this function 500,000 times
VFP        7.36 seconds
Neon        0.94 seconds


3358中的浮点协处理器NEON的使用需要在编译的时候设置编译选项,否则不能启动浮点协处理器的功能,详情请参看网址
http://processors.wiki.ti.com/index.php/Cortex-A8
亚瑟王 发表于 2013-7-17 19:03:27 | 显示全部楼层
areslion 发表于 2013-7-17 16:00
请参看

Neon and VFP both support floating point, which should I use?

我们提供的编译器在制作的时候就已经设置过了。不过你可以测试一下两者的差别,我也想知道这个差异。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

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

GMT+8, 2024-4-26 07:54 , Processed in 1.031250 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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