[PATCH] D94557: [ARM] Fixed incorrect lowering when using GNUEABI (libgcc) and 16bit floats

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 15 03:35:52 PST 2021


psmith added a comment.

As I understand it, this is about what library call should be made when there is an eabi target such as arm-none-eabi which should target the Run Time ABI for the Arm Architecture https://github.com/ARM-software/abi-aa/blob/master/rtabi32/rtabi32.rst and other Arm targets such as Linux or Android. I think if we're arguing from the specification then clang is compliant with the eabi, so relocatable objects produced by clang should be compatible with eabi compliant toolchains that supply the eabi functions, this includes non GNU toolchains as well like IAR.

I believe that in this case GNUEABI is intending to be compliant with eabi, as it does supply aeabi prefixed functions. I think in this case it is likely an omission in gcc/libgcc as even arm-none-eabi-gcc with -mfp16-format=ieee which is supposed to be targeting the bare-metal eabi uses `__gnu_d2h_ieee` however even if this is fixed then there will be lots of libgcc libraries without the function.

I've asked the Arm GNU team if they can remember why the aeabi functions were not used for FP16 in GCC https://gcc.gnu.org/pipermail/gcc-patches/2016-November/462046.html

Having said that, even if this is working around a bug in libgcc, if this is restricted to GNUEABI then it may be the right thing to do as there will be many existing libgcc libraries without it.

As an aside, the `__aeabi_memcpy`, `__aeabi_memmove`, `__aeabi_memset`  functions are a bit of a special case in that these are intended to be "optimized" functions, all libraries have `memcpy`, `memmove` and `memset` so it is always safe to put out a call to one of these and be compatible with everything. Emitting a call to `__gnu_d2h_ieee` is unlikely to be present in a toolchain not trying to be compatible with GCC so it is more of a risk to do so.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94557/new/

https://reviews.llvm.org/D94557



More information about the llvm-commits mailing list