aboutsummaryrefslogtreecommitdiff
path: root/benchmarks/multiply/multiply.c
blob: 98b279b94085c31d90c1514fe9b8bd5946a82b5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// *************************************************************************
// multiply function (c version)
// -------------------------------------------------------------------------

int multiply( int x, int y )
{

 int i;
 int result = 0;

 for (i = 0; i < 32; i++) {
   if ((x & 0x1) == 1)
     result = result + y;
       
   x = x >> 1;
   y = y << 1;
 } 
 
 return result;

}