[all-commits] [llvm/llvm-project] 6dfea5: [builtins] Start to refactor int to fp conversion ...
Alex Bradbury via All-commits
all-commits at lists.llvm.org
Sun Oct 15 08:15:08 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6dfea561ba96974b205c31546c5e2069429c75b1
https://github.com/llvm/llvm-project/commit/6dfea561ba96974b205c31546c5e2069429c75b1
Author: Alex Bradbury <asb at igalia.com>
Date: 2023-10-15 (Sun, 15 Oct 2023)
Changed paths:
M compiler-rt/lib/builtins/floatdidf.c
M compiler-rt/lib/builtins/floatundidf.c
A compiler-rt/lib/builtins/int_to_fp.h
A compiler-rt/lib/builtins/int_to_fp_impl.inc
Log Message:
-----------
[builtins] Start to refactor int to fp conversion functions to use a common implementation (#66903)
After this patch, the softfp implementations of floatdidf and floatundidf
use a common implementation (int_to_fp.h and int_to_fp_impl.inc). This
roughly follows the pattern used for a wide range of other builtins,
e.g. fp_trunc_impl.inc.
Currently there is substantial copy and paste for the various int to fp
conversion functions, with just a few constants being changed. This is a
barrier to maintainability, and it's also not attractive to copy this
approach as we introduce additional int to fp conversion functions for
bf16 and half (which we currently lack, but need - see
<https://reviews.llvm.org/D157509>).
I've opted to conservatively start by replacing just two functions,
leaving a follow-up patch to replace others that follow the same
pattern. Also, for better or worse I've left the logic in float[un]didf
largely unchanged other than using a similar approach to
fp_trunc_impl.inc to remove the constants that are tied to a specific
output floating point format.
More information about the All-commits
mailing list