Path: blob/master/libs/compiler-rt/lib/builtins/divmodsi4.c
4395 views
/*===-- divmodsi4.c - Implement __divmodsi4 --------------------------------===1*2* The LLVM Compiler Infrastructure3*4* This file is dual licensed under the MIT and the University of Illinois Open5* Source Licenses. See LICENSE.TXT for details.6*7* ===----------------------------------------------------------------------===8*9* This file implements __divmodsi4 for the compiler_rt library.10*11* ===----------------------------------------------------------------------===12*/1314#include "int_lib.h"1516/* Returns: a / b, *rem = a % b */1718COMPILER_RT_ABI si_int19__divmodsi4(si_int a, si_int b, si_int* rem)20{21si_int d = __divsi3(a,b);22*rem = a - (d*b);23return d;24}252627