1238901Sandrew//===-- aeabi_idivmod.S - EABI idivmod implementation ---------------------===// 2238901Sandrew// 3238901Sandrew// The LLVM Compiler Infrastructure 4238901Sandrew// 5238901Sandrew// This file is dual licensed under the MIT and the University of Illinois Open 6238901Sandrew// Source Licenses. See LICENSE.TXT for details. 7238901Sandrew// 8238901Sandrew//===----------------------------------------------------------------------===// 9238901Sandrew 10238901Sandrew#include "../assembly.h" 11238901Sandrew 12238901Sandrew// struct { int quot, int rem} __aeabi_idivmod(int numerator, int denominator) { 13238901Sandrew// int rem, quot; 14238901Sandrew// quot = __divmodsi4(numerator, denominator, &rem); 15238901Sandrew// return {quot, rem}; 16238901Sandrew// } 17238901Sandrew 18238901Sandrew .syntax unified 19238901Sandrew .align 2 20238901SandrewDEFINE_COMPILERRT_FUNCTION(__aeabi_idivmod) 21238901Sandrew push { lr } 22238901Sandrew sub sp, sp, #4 23238901Sandrew mov r2, sp 24238901Sandrew bl SYMBOL_NAME(__divmodsi4) 25238901Sandrew ldr r1, [sp] 26238901Sandrew add sp, sp, #4 27238901Sandrew pop { pc } 28