summaryrefslogtreecommitdiffstats
path: root/arch/parisc/lib/libgcc/__modsi3.c
blob: 62f773efaeea7dc123a16e740d4ef8389aef0bd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "libgcc.h"

s32 __modsi3(s32 num, s32 den)
{
	int minus = 0;
	s32 v;

	if (num < 0) {
		num = -num;
		minus = 1;
	}
	if (den < 0) {
		den = -den;
		minus ^= 1;
	}

	(void)__udivmodsi4(num, den, (u32 *) & v);
	if (minus)
		v = -v;

	return v;
}
EXPORT_SYMBOL(__modsi3);