projects
/
mono.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
2004-11-28 Martin Baulig <martin@ximian.com>
[mono.git]
/
mono
/
benchmark
/
cmov4.cs
1
using System;
2
class T {
3
// some more advanced versions.
4
static void Main () {
5
int a = 0, b = 0, c = 0, d = 0, e = 0;
6
for (int i = 0; i < 50000000; i ++) {
7
// sgn (x)
8
if (a == 0)
9
a = 0;
10
else if (a < 0)
11
a = -1;
12
else
13
a = 1;
14
15
// cond incr
16
if (a <= 0)
17
a ++;
18
19
// buffer ring
20
if (b == 49)
21
b = 0;
22
else
23
b ++;
24
25
// max
26
c = a > b ? a : b;
27
28
// abs
29
d = a > 0 ? a : -a;
30
}
31
}
32
33
}