[compiler-rt][builtins] Add helper functions for uint16/sint16/uint8/sint8 div and mod
authorBen Shi <ben.shi@streamcomputing.com>
Thu, 5 May 2022 07:35:09 +0000 (07:35 +0000)
committerBen Shi <ben.shi@streamcomputing.com>
Thu, 5 May 2022 23:29:14 +0000 (23:29 +0000)
commit70a66c08fc6534c78eb5104b3293a9fa81350da3
tree1764d2d825d6b3bf8c9d92ab98dd096fbded5bad
parent0098f2aebb43218f0040f0b739897b0bfe0e259e
[compiler-rt][builtins] Add helper functions for uint16/sint16/uint8/sint8 div and mod

__udivmodhi4 : uint16 div and mod
__udivmodqi4 : uint8 div and mod
__divmodhi4  : sint16 div and mod
__divmodqi4  : sint8 div and mod

The above helper functions in libgcc have special ABI as described at
https://gcc.gnu.org/wiki/avr-gcc#Exceptions_to_the_Calling_Convention .

Reviewed By: aykevl

Differential Revision: https://reviews.llvm.org/D124600
compiler-rt/lib/builtins/CMakeLists.txt
compiler-rt/lib/builtins/avr/divmodhi4.S [new file with mode: 0644]
compiler-rt/lib/builtins/avr/divmodqi4.S [new file with mode: 0644]
compiler-rt/lib/builtins/avr/udivmodhi4.S [new file with mode: 0644]
compiler-rt/lib/builtins/avr/udivmodqi4.S [new file with mode: 0644]