summary refs log tree commit diff
path: root/test/isel3.ssa
blob: 5e8862ac911fbbba5e0422d72fae9e87bbeff889 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
export function w $slt(w %x, w %y) {
@start
	%r =w csltw %x, %y
	ret %r
}

export function w $sle(w %x, w %y) {
@start
	%r =w cslew %x, %y
	ret %r
}

export function w $sgt(w %x, w %y) {
@start
	%r =w csgtw %x, %y
	ret %r
}

export function w $sge(w %x, w %y) {
@start
	%r =w csgew %x, %y
	ret %r
}

export function w $ult(w %x, w %y) {
@start
	%r =w cultw %x, %y
	ret %r
}

export function w $ule(w %x, w %y) {
@start
	%r =w culew %x, %y
	ret %r
}

export function w $ugt(w %x, w %y) {
@start
	%r =w cugtw %x, %y
	ret %r
}

export function w $uge(w %x, w %y) {
@start
	%r =w cugew %x, %y
	ret %r
}

export function w $eq(w %x, w %y) {
@start
	%r =w ceqw %x, %y
	ret %r
}

export function w $ne(w %x, w %y) {
@start
	%r =w cnew %x, %y
	ret %r
}

# >>> driver
# #include <math.h>
# extern int slt(int, int);
# extern int sle(int, int);
# extern int sgt(int, int);
# extern int sge(int, int);
# extern int ult(unsigned, unsigned);
# extern int ule(unsigned, unsigned);
# extern int ugt(unsigned, unsigned);
# extern int uge(unsigned, unsigned);
# extern int eq(unsigned, unsigned);
# extern int ne(unsigned, unsigned);
# int main(void) {
# 	/*     LessThan      Equal        GreaterThan */
# 	return !slt(-1, 0) + slt(0, 0)  + slt(0, -1)
# 	     + !sle(-1, 0) + !sle(0, 0) + sle(0, -1)
# 	     + sgt(-1, 0)  + sgt(0, 0)  + !sgt(0, -1)
# 	     + sge(-1, 0)  + !sge(0, 0) + !sge(0, -1)
# 	     + !ult(0, -1) + ult(0, 0)  + ult(-1, 0)
# 	     + !ule(0, -1) + !ule(0, 0) + ule(-1, 0)
# 	     + ugt(0, -1)  + ugt(0, 0)  + !ugt(-1, 0)
# 	     + uge(0, -1)  + !uge(0, 0) + !uge(-1, 0)
# 	     + eq(0, 1)    + !eq(0, 0)  + eq(1, 0)
# 	     + !ne(0, 1)   + ne(0, 0)   + !ne(1, 0)
# 	     ;
# }
# <<<