[PATCH] D94557: [ARM] Fixed incorrect lowering when using GNUEABI (libgcc) and 16bit floats
Fernando De La Garza via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 14 18:43:39 PST 2021
fdelagarza added a comment.
Here's some observations that might help figure out what path to take
According to the discussion on this ticket <https://reviews.llvm.org/D12413> , there are only four arm `__aeabi` prefixed functions in compiter-rt that aren't present in libgcc:
__aeabi_memcpy
__aeabi_memmove
__aeabi_memset
__aeabi_d2h
`memcpy`, `memmove` and `memset` default to being lowered to the non `__aebi` prefixed functions in `include/llvm/IR/RuntimeLibcalls.def`:
HANDLE_LIBCALL(MEMCPY, "memcpy")
HANDLE_LIBCALL(MEMMOVE, "memmove")
HANDLE_LIBCALL(MEMSET, "memset")
A code path in `ARMISelLowering.cpp` switches them to `__aeabi_memcpy`, `__aeabi_memmove` and `__aeabi_memset` if the "EABIVersion" option is set to `EABI4` or `EABI5`.
Also in `include/llvm/IR/RuntimeLibcalls.def`, the `FPROUND_F32_F16` and `FPROUND_F32_F16` library calls default to `__gnu` prefixed functions:
HANDLE_LIBCALL(FPEXT_F16_F32, "__gnu_h2f_ieee")
HANDLE_LIBCALL(FPROUND_F32_F16, "__gnu_f2h_ieee")
HANDLE_LIBCALL(FPROUND_F64_F16, "__truncdfhf2")
Code in `ARMISelLowering.cpp` is currently unconditionally switching the `FPROUND_F64_F16` default lowering to `__aeabi_d2h`. Kevin's change would make it default to `__gnu_d2h_ieee`
There is a code path in ` ARMISelLowering.cpp` that changes `FPROUND_F32_F16`, `FPROUND_F64_F16`, and `FPEXT_F16_F32` to the `__eabui` prefixed functions when `EABI4` or `EABI5` is requested (mentioned in Kevin's last comment)
To me it seems the proposed change would make the default `FPROUND_F64_F16` lowering more consistent with that of `FPEXT_F16_F32` and `FPROUND_F32_F16`
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94557/new/
https://reviews.llvm.org/D94557
More information about the llvm-commits
mailing list