diff options
author | Pedro Artigas <partigas@apple.com> | 2013-02-26 23:33:20 +0000 |
---|---|---|
committer | Pedro Artigas <partigas@apple.com> | 2013-02-26 23:33:20 +0000 |
commit | b3201c5cf1e183d840f7c99ff779d57f1549d8e5 (patch) | |
tree | f32bcd59978eb3b4c9bf9057ce74e40e3446beb5 /include/llvm/Transforms/Utils/IntegerDivision.h | |
parent | bdc98d3510c1b3d32679ed3188becdc6d6dfd545 (diff) | |
download | external_llvm-b3201c5cf1e183d840f7c99ff779d57f1549d8e5.zip external_llvm-b3201c5cf1e183d840f7c99ff779d57f1549d8e5.tar.gz external_llvm-b3201c5cf1e183d840f7c99ff779d57f1549d8e5.tar.bz2 |
Enhance integer division emulation support to handle types smaller than 32 bits,
enhancement done the trivial way; by extending inputs and truncating outputs
which is addequate for targets with little or no support for integer arithmetic
on integer types less than 32 bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176139 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms/Utils/IntegerDivision.h')
-rw-r--r-- | include/llvm/Transforms/Utils/IntegerDivision.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/llvm/Transforms/Utils/IntegerDivision.h b/include/llvm/Transforms/Utils/IntegerDivision.h index ff4a31f..27d3c58 100644 --- a/include/llvm/Transforms/Utils/IntegerDivision.h +++ b/include/llvm/Transforms/Utils/IntegerDivision.h @@ -43,6 +43,20 @@ namespace llvm { /// @brief Replace Div with generated code. bool expandDivision(BinaryOperator* Div); + /// Generate code to calculate the remainder of two integers, replacing Rem + /// with the generated code. Uses the above 32bit routine, therefore adequate + /// for targets with little or no support for less than 32 bit arithmetic. + /// + /// @brief Replace Rem with generated code. + bool expandRemainderUpTo32Bits(BinaryOperator *Rem); + + /// Generate code to divide two integers, replacing Div with the generated + /// code. Uses the above 32bit routine, therefore adequate for targets with + /// little or no support for less than 32 bit arithmetic. + /// + /// @brief Replace Rem with generated code. + bool expandDivisionUpTo32Bits(BinaryOperator *Div); + } // End llvm namespace #endif |