divmodsi4.c revision 222625
1219719Sed/*===-- divmodsi4.c - Implement __divmodsi4 --------------------------------=== 2219719Sed * 3219719Sed * The LLVM Compiler Infrastructure 4219719Sed * 5219719Sed * This file is dual licensed under the MIT and the University of Illinois Open 6219719Sed * Source Licenses. See LICENSE.TXT for details. 7219719Sed * 8219719Sed * ===----------------------------------------------------------------------=== 9219719Sed * 10219719Sed * This file implements __divmodsi4 for the compiler_rt library. 11219719Sed * 12219719Sed * ===----------------------------------------------------------------------=== 13219719Sed */ 14222625Sed#include "abi.h" 15219719Sed 16219719Sed#include "int_lib.h" 17219719Sed 18222625Sedextern COMPILER_RT_ABI si_int __divsi3(si_int a, si_int b); 19219719Sed 20219719Sed 21219719Sed/* Returns: a / b, *rem = a % b */ 22219719Sed 23222625SedCOMPILER_RT_ABI si_int 24219719Sed__divmodsi4(si_int a, si_int b, si_int* rem) 25219719Sed{ 26219719Sed si_int d = __divsi3(a,b); 27219719Sed *rem = a - (d*b); 28219719Sed return d; 29219719Sed} 30219719Sed 31219719Sed 32