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

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

问题描述

我正在为 ARM 编译一个程序.makefile 有一个标志 -msoft-float,它告诉编译器使用软件浮点模拟.我的问题是如何在 makefile 中指定使用硬件浮点指令代替.我试过 -mhard-float,但如果我这样做,我会出错.我还尝试了 -msoftfp-float,正如 这个站点 但编译器甚至不识别该标志.所以,请告诉我应该如何解决这个问题.

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.

推荐答案

Soft float 是配置 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天全站免登陆