HomePhabricator

[builtins] Make __umodsi3/__udivdi3/__umoddi3 standalone (shift and subtract)

Authored by MaskRay on Apr 10 2020, 3:14 PM.

Description

[builtins] Make umodsi3/udivdi3/__umoddi3 standalone (shift and subtract)

@kamleshbhalui reported that when the Standard Extension M
(Multiplication and Division) is disabled for RISC-V,
__udivdi3 will call __udivmodti4 which will in turn calls __udivdi3.

This patch moves __udivsi3 (shift and subtract) to int_div_impl.inc
__udivXi3, optimize a bit, add a __umodXi3, and use __udivXi3 and
__umodXi3 to define __udivsi3 __umodsi3 __udivdi3 __umoddi3.

Reviewed By: kamleshbhalui

Differential Revision: https://reviews.llvm.org/D77912