Add test of compare-sections command.
[riscv-tests.git] / benchmarks / multiply / multiply.c
1 // See LICENSE for license details.
2
3 // *************************************************************************
4 // multiply function (c version)
5 // -------------------------------------------------------------------------
6
7 int multiply( int x, int y )
8 {
9
10 int i;
11 int result = 0;
12
13 for (i = 0; i < 32; i++) {
14 if ((x & 0x1) == 1)
15 result = result + y;
16
17 x = x >> 1;
18 y = y << 1;
19 }
20
21 return result;
22
23 }
24