blob: 3541ab6e91d8dfa686fb52b076df8f77a58137ed [file] [log] [blame]
Edward O'Callaghan55836322009-08-07 20:30:091/* ===-- umoddi3.c - Implement __umoddi3 -----------------------------------===
2 *
3 * The LLVM Compiler Infrastructure
4 *
Howard Hinnant5b791f62010-11-16 22:13:335 * This file is dual licensed under the MIT and the University of Illinois Open
6 * Source Licenses. See LICENSE.TXT for details.
Edward O'Callaghan55836322009-08-07 20:30:097 *
8 * ===----------------------------------------------------------------------===
9 *
10 * This file implements __umoddi3 for the compiler_rt library.
11 *
12 * ===----------------------------------------------------------------------===
13 */
Daniel Dunbarfd089992009-06-26 16:47:0314
15#include "int_lib.h"
16
Anton Korobeynikove63da932011-04-19 17:52:0917du_int COMPILER_RT_ABI __udivmoddi4(du_int a, du_int b, du_int* rem);
Daniel Dunbarfd089992009-06-26 16:47:0318
Edward O'Callaghan55836322009-08-07 20:30:0919/* Returns: a % b */
Daniel Dunbarfd089992009-06-26 16:47:0320
Anton Korobeynikove63da932011-04-19 17:52:0921COMPILER_RT_ABI du_int
Daniel Dunbarfd089992009-06-26 16:47:0322__umoddi3(du_int a, du_int b)
23{
24 du_int r;
25 __udivmoddi4(a, b, &r);
26 return r;
27}