Path: blob/master/libs/compiler-rt/lib/builtins/divmoddi4.c
4395 views
/*===-- divmoddi4.c - Implement __divmoddi4 --------------------------------===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 __divmoddi4 for the compiler_rt library.10*11* ===----------------------------------------------------------------------===12*/1314#include "int_lib.h"1516/* Returns: a / b, *rem = a % b */1718COMPILER_RT_ABI di_int19__divmoddi4(di_int a, di_int b, di_int* rem)20{21di_int d = __divdi3(a,b);22*rem = a - (d*b);23return d;24}252627