xref: /netbsd-src/sys/external/bsd/compiler_rt/dist/lib/builtins/umoddi3.c (revision f7f78b3373aafafa211473d7733a8806c0e402c0)
1*156cd587Sjoerg /* ===-- umoddi3.c - Implement __umoddi3 -----------------------------------===
2*156cd587Sjoerg  *
3*156cd587Sjoerg  *                    The LLVM Compiler Infrastructure
4*156cd587Sjoerg  *
5*156cd587Sjoerg  * This file is dual licensed under the MIT and the University of Illinois Open
6*156cd587Sjoerg  * Source Licenses. See LICENSE.TXT for details.
7*156cd587Sjoerg  *
8*156cd587Sjoerg  * ===----------------------------------------------------------------------===
9*156cd587Sjoerg  *
10*156cd587Sjoerg  * This file implements __umoddi3 for the compiler_rt library.
11*156cd587Sjoerg  *
12*156cd587Sjoerg  * ===----------------------------------------------------------------------===
13*156cd587Sjoerg  */
14*156cd587Sjoerg 
15*156cd587Sjoerg #include "int_lib.h"
16*156cd587Sjoerg 
17*156cd587Sjoerg /* Returns: a % b */
18*156cd587Sjoerg 
19*156cd587Sjoerg COMPILER_RT_ABI du_int
__umoddi3(du_int a,du_int b)20*156cd587Sjoerg __umoddi3(du_int a, du_int b)
21*156cd587Sjoerg {
22*156cd587Sjoerg     du_int r;
23*156cd587Sjoerg     __udivmoddi4(a, b, &r);
24*156cd587Sjoerg     return r;
25*156cd587Sjoerg }
26