Understanding hardfp Abi

Source: Internet
Author: User

Abi is "application binary interface", that is, the compilerCodeA rule used for compiling code.

Abi specifications generally include:

(1) Expression of C type (INT, short, long, union, struct ...)

(2) calling convention, including: how to pass function parameters and return values; if registers and stacks are used.

 

When compiling a function with floating-point parameters, there are three possible compilation options:-mfloat-Abi = soft/softfp/hard.

"Soft" option: indicates that the FPU hardware is not used, but the GCC integer arithmetic operation is used to simulate floating point operations.

"Softfp" option: indicates that you want to use FPU hardware for floating point operations, but the arguments of the function are passed to the integer register (r0-r3) and then passed to the FPU.

"Hard" option: indicates that you want to use FPU hardware for floating point operations, and the function parameters are directly transferred to the FPU register (S0, D0.

 

The hardfp abi and hardfloat operations are not the same thing.

Hardfp Abi is also known as the ABI in VFP mode. It is only a compilation rule, while hardfloat indicates that FPU is used for floating point operations.

Soft abi and softfp Abi are collectively referred to as the standard mode Abi.

 

Therefore, when a floating point function is called,

Apps or libraries compiled with-mfloat-Abi = soft can be run in OS compiled with-mfloat-Abi = softfp;

Apps or libraries compiled with-mfloat-Abi = softfp cannot be run in OS compiled with-mfloat-Abi = soft.

-Mfloat-Abi = softfp/soft and-mfloat-Abi = hard are incompatible.

 

Note: Code sourcery 2007/2008 does not support-mfloat-Abi = hard. It is supported from code sourcery 2009q1-mfloat-Abi = hard.

 

Meego starts from 1.2.0 and all basic libraries are compiled with-mfloat-Abi = hard. The RPM package architecture is called "armv7hl", while the scheduler in OBS is called "armv8el ".

Using "armv8el" instead of "armv7hl" as the OBS scheduler is a historical reason. meego officially planned to change the "armv8el" scheduler to "armv7hl" in the future ", but with the closure of the meego project, it may not be changed.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.