aboutsummaryrefslogtreecommitdiff
path: root/test/varargs+riscv64.qbe
blob: 1b0851e174b747cfe4954e37171dbe121cc5a9bb (plain)
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
export
function w $f1(w %.1, l %.3) {
@start.1
	%.2 =l alloc4 4
	storew %.1, %.2
	%.4 =l alloc8 8
	storel %.3, %.4
@body.2
	%.5 =w vaarg %.4
	ret %.5
}
export
function w $f2(w %.1, ...) {
@start.3
	%.2 =l alloc4 4
	storew %.1, %.2
	%.3 =l alloc4 4
	%.4 =l alloc8 8
@body.4
	vastart %.4
	%.5 =w loadw %.2
	%.6 =l loadl %.4
	%.7 =w call $f1(w %.5, l %.6)
	storew %.7, %.3
	%.8 =l loadl %.4
	%.9 =w loadw %.3
	ret %.9
}
export
function $f3(w %.1, ...) {
@start.5
	%.2 =l alloc4 4
	storew %.1, %.2
	%.3 =l alloc8 8
@body.6
	vastart %.3
@while_cond.7
	%.4 =w loadw %.2
	jnz %.4, @while_body.8, @while_join.9
@while_body.8
	%.5 =w vaarg %.3
	%.6 =s vaarg %.3
	%.7 =l vaarg %.3
	%.8 =w loadw %.2
	%.9 =w sub %.8, 1
	storew %.9, %.2
	jmp @while_cond.7
@while_join.9
	%.10 =l loadl %.3
	ret
}
export
function $f4(...) {
@start.10
	%.1 =l alloc8 8
@body.11
	vastart %.1
	%.2 =d vaarg %.1
	%.3 =w vaarg %.1
	%.4 =l loadl %.1
	ret
}