~mcf/cproc

ref: 16c718729adfaf40cf22aa4efeafb0d92ef5ee3c cproc/test/do-loop.qbe -rw-r--r-- 445 bytes
16c71872Michael Forney Prepare for supporting architecture-specific va_list type 8 months ago
                                                                                
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
export
function w $main() {
@start.1
	%.1 =l alloc4 4
	%.2 =l alloc4 4
@body.2
	storew 2, %.1
	storew 0, %.2
@do_body.3
	%.3 =w loadw %.1
	%.4 =w ceqw %.3, 1
	jnz %.4, @if_true.6, @if_false.7
@if_true.6
	jmp @do_cond.4
@if_false.7
	%.5 =w loadw %.2
	%.6 =w add %.5, 1
	storew %.6, %.2
@do_cond.4
	%.7 =w loadw %.1
	%.8 =w sub %.7, 1
	storew %.8, %.1
	jnz %.7, @do_body.3, @do_join.5
@do_join.5
	%.9 =w loadw %.2
	%.10 =w cnew %.9, 2
	ret %.10
}