summaryrefslogtreecommitdiff
path: root/newlib/libc/machine/w65/mulsi3.c
blob: b48fe97acd12d1b6030d7afb00422371eb75d114 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17


long
__mulsi3(unsigned long a, unsigned long b)
{
  long res = 0;
  while (a) 
    {
      if (a & 1)
	{
	  res += b;
	}
      b <<= 1;
      a >>=1;
    }
  return res;
}