diff options
author | Matthias Gehre <matthias.gehre@xilinx.com> | 2022-02-22 15:09:54 +0000 |
---|---|---|
committer | Matthias Gehre <matthias.gehre@xilinx.com> | 2022-04-08 07:43:15 +0100 |
commit | bf2dc4b37623e1b4f7d39570e1b5a6f3ef5db107 (patch) | |
tree | daa968956f6c9e26ea46e687cac2997991e9dce9 /clang/lib/Frontend/TestModuleFileExtension.cpp | |
parent | 36d3efea15e6202edd64b05de38d8379e2baddb2 (diff) | |
download | llvm-bf2dc4b37623e1b4f7d39570e1b5a6f3ef5db107.zip llvm-bf2dc4b37623e1b4f7d39570e1b5a6f3ef5db107.tar.gz llvm-bf2dc4b37623e1b4f7d39570e1b5a6f3ef5db107.tar.bz2 |
compiler-rt: Add udivmodei5 to builtins and add bitint library
According to the RFC [0], this review contains the compiler-rt parts of large integer divison for _BitInt.
It adds the functions
```
/// Computes the unsigned division of a / b for two large integers
/// composed of n significant words.
/// Writes the quotient to quo and the remainder to rem.
///
/// \param quo The quotient represented by n words. Must be non-null.
/// \param rem The remainder represented by n words. Must be non-null.
/// \param a The dividend represented by n + 1 words. Must be non-null.
/// \param b The divisor represented by n words. Must be non-null.
/// \note The word order is in host endianness.
/// \note Might modify a and b.
/// \note The storage of 'a' needs to hold n + 1 elements because some
/// implementations need extra scratch space in the most significant word.
/// The value of that word is ignored.
COMPILER_RT_ABI void __udivmodei5(su_int *quo, su_int *rem, su_int *a,
su_int *b, unsigned int n);
/// Computes the signed division of a / b.
/// See __udivmodei5 for details.
COMPILER_RT_ABI void __divmodei5(su_int *quo, su_int *rem, su_int *a, su_int *b,
unsigned int words);
```
into builtins.
In addition it introduces a new "bitint" library containing only those new functions,
which is meant as a way to provide those when using libgcc as runtime.
[0] https://discourse.llvm.org/t/rfc-add-support-for-division-of-large-bitint-builtins-selectiondag-globalisel-clang/60329
Differential Revision: https://reviews.llvm.org/D120327
Diffstat (limited to 'clang/lib/Frontend/TestModuleFileExtension.cpp')
0 files changed, 0 insertions, 0 deletions