ARM-software / LLVM-embedded-toolchain-for-Arm

A project dedicated to building LLVM toolchain for 32-bit Arm embedded targets.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What are the differences between armv8.1m libraries

SeanMeng0509 opened this issue · comments

Following up #301 with LLVM-ET-Arm-18.1.3-Linux-x86_64

Using -mcpu=cortex-m85 -mfloat-abi=hard, multilib system picks armv8.1m.main_hard_fpdp_nomve. We are not sure it is the best choice for Cotex-M85 device that has a FPU compliant with the ANSI/IEEE Std 754-2008 scalar half, single, and double-precision floating-point operation, and supports MVE/MVE-F.

Could you help to explain the detailed differences between these libraries?

armv8.1m.main_hard_fpdp_nomve   armv8.1m.main_hard_fp_nomve  armv8.1m.main_hard_nofp_mve armv8.1m.main_soft_nofp_nomve

These map on to different compiler command line-options. I would expect armv8.1m.main_hard_fpdp_nomve to be the best choice unless you know your programs are integer only.

We don't currently build an all in armv8.1m.main_hard_fpdp_mve option at the moment. Our expectation is that the opportunity for use of MVE in the scalar C-library is small so we didn't think the extra variants were worth the additional build and test time. A quick scan of the code for the C-library with MVE show that it does get used in a small number of places, but unless your code actually uses these library functions it is unlikely to see any difference in performance/code-size. Obviously if there is any floating point used then the library with hardware floating point support will do a lot better.

armv8.1m.main_hard_fpdp_nomve
Enables both single and double precision hardware floating point instructions. Passes floating point parameters in floating-point/simd registers. Does not enable the MVE instructions (largely so this can be compatible with configurations with and without MVE).

armv8.1m.main_hard_fp_nomve
As above but only single precision floating point is enabled, double precision is done using software emulation. This is only useful for configurations without double precision hardware.

armv8.1m.main_hard_nofp_mve
Floating point parameters are passed in simd registers, but all floating point operations are done in software. This option is for "integer-only" MVE. Some benefit can be gained by using the additional MVE registers (the hard-float calling convention), but there is no floating point hardware.

armv8.1m.main_soft_nofp_nomve
This is for configurations with no floating point and no MVE. Only core-registers are available so floating point values have to be passed in core-registers and all floating point operations done in software.