如何告诉编译器使用与ARM硬件浮点指令 [英] How to tell the compiler to use hardware floating point instructions with ARM

查看:361
本文介绍了如何告诉编译器使用与ARM硬件浮点指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我进行ARM编译程序。这个makefile有一个标志的 -msoft浮动的是告诉编译器使用软件浮点仿真。我的问题是我怎么能在makefile指定要使用的硬件浮点指令代替。我试过的 -mhard浮动的,但如果我这样做,我得到的错误。我也试过的 -msoftfp浮动的通过的本网站但是编译器甚至不承认该标志。所以,请告诉我,我应该怎么解决这个问题。

I am compiling a program for ARM. The makefile has a flag -msoft-float which is telling the compiler to use software floating point emulation. My question is how can I specify in the makefile to use the hardware floating point instructions instead. I tried -mhard-float, but if I do so I get errors. I also tried -msoftfp-float as told by this site but the compiler doesn't even recognize that flag. So, please tell me how should I solve this problem.

推荐答案

软浮动是一个选项,可配置的 GCC ,它是开源的,任何人都可以配置工具链有/无的软浮动的支持。请参见 http://crosstool-ng.org/ 以建立自己的编译器的工具。我把它从引用链接 GCC 4.1.2 的正在使用;你可能会与 -mfloat-ABI = softfp 好运。有ARM的三个变种。该 Debian的ARM浮点维基确实描述的差异非常出色。此外 Debian的VFP比较可能会感兴趣的。

Soft float is an option to configure gcc, it is open source and anyone can configure a tool chain with/without soft float support. See http://crosstool-ng.org/ for a tool to build your own compiler. I take it from the referenced link that gcc 4.1.2 is being used; You will probably have the best luck with -mfloat-abi=softfp. There are three variants on the ARM. The Debian ARM floating point wiki does an excellent job of describing the differences. Also Debian VFP comparison may be of interest.

这篇关于如何告诉编译器使用与ARM硬件浮点指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆