2 * libgcc1 routines for Blackfin 5xx
4 * Copyright 2004-2009 Analog Devices Inc.
6 * Licensed under the Clear BSD license or the GPL-2 (or later)
9 #ifdef CONFIG_ARITHMETIC_OPS_L1
16 .type ___udivsi3, STT_FUNC;
18 .type ___umodsi3, STT_FUNC;
22 IF CC JUMP .LRETURN_R0; /* Return 0, if NR == 0 */
24 IF CC JUMP .LRETURN_ZERO_VAL; /* Return 0, if DR == 0 */
26 IF CC JUMP .LRETURN_ZERO_VAL; /* Return 0, if NR == DR */
28 IF CC JUMP .LRETURN_ZERO_VAL; /* Return 0, if DR == 1 */
30 IF CC JUMP .LRETURN_R0; /* Return dividend (R0),IF NR<DR */
32 [--SP] = (R7:6); /* Push registers and */
33 [--SP] = RETS; /* Return address */
34 R7 = R0; /* Copy of R0 */
36 SP += -12; /* Should always provide this space */
37 CALL ___udivsi3; /* Compute unsigned quotient using ___udiv32()*/
39 R0 *= R6; /* Quotient * divisor */
40 R0 = R7 - R0; /* Dividend - (quotient * divisor) */
41 RETS = [SP++]; /* Pop return address */
42 ( R7:6) = [SP++]; /* And registers */
43 RTS; /* Return remainder */
49 .size ___umodsi3, .-___umodsi3