1214152Sed/* ===-- modsi3.c - Implement __modsi3 -------------------------------------===
2214152Sed *
3214152Sed *                     The LLVM Compiler Infrastructure
4214152Sed *
5222656Sed * This file is dual licensed under the MIT and the University of Illinois Open
6222656Sed * Source Licenses. See LICENSE.TXT for details.
7214152Sed *
8214152Sed * ===----------------------------------------------------------------------===
9214152Sed *
10214152Sed * This file implements __modsi3 for the compiler_rt library.
11214152Sed *
12214152Sed * ===----------------------------------------------------------------------===
13214152Sed */
14214152Sed
15214152Sed#include "int_lib.h"
16214152Sed
17222656Sedsu_int COMPILER_RT_ABI __divsi3(si_int a, si_int b);
18222656Sed
19214152Sed/* Returns: a % b */
20214152Sed
21222656SedCOMPILER_RT_ABI si_int
22214152Sed__modsi3(si_int a, si_int b)
23214152Sed{
24222656Sed    return a - __divsi3(a, b) * b;
25214152Sed}
26