bgqsl11 发表于 2010-07-01 22:03

GCC ARM的-mfloat-abi选项

GCC的ARM编译选项-mfloat-abi=name,其中soft和softfp有什么区别?

下面是GCC ARM的解释,我的理解是:

hard表示编译成浮点运算指令,一般是CPU内带有支持浮点运算的FPU

soft表示软件实现浮点运算,一般是在glibc里有软件的方法实现浮点运算(以前好像有种FPE的方法,在内核里面实现浮点运算,因为性能低下,现在很少使用)

softfp按照他的翻译是,虽然生成了浮点指定,但是仍然使用软浮点运算的调用规则? 什么意思。。

-mfloat-abi=name
Specifies which floating-point ABI to use. Permissible values are: `soft', `softfp' and `hard'.
Specifying `soft' causes GCC to generate output containing library calls for floating-point operations. `softfp' allows the generation of code using hardware floating-point instructions, but still uses the soft-float calling conventions. `hard' allows generation of floating-point instructions and uses FPU-specific calling conventions.

The default depends on the specific target configuration. Note that the hard-float and soft-float ABIs are not link-compatible; you must compile your entire program with the same ABI, and link with a compatible set of libraries.

EricFisher 发表于 2010-07-02 15:32

> FPU-specific calling conventions

不熟悉arm,但看起来arm的FPU有特定的调用约定。

linux初学三月 发表于 2010-07-07 07:35

GCC的ARM编译选项-mfloat-abi=name,其中哪有soft和softfp

EricFisher 发表于 2010-07-07 17:27

> Permissible values are: `soft', `softfp' and `hard'.
页: [1]
查看完整版本: GCC ARM的-mfloat-abi选项