Commit | Line | Data |
---|---|---|
4a71579b PC |
1 | .data 32 |
2 | dfmt: | |
3 | .c "%1.0f\n" | |
4 | ifmt: | |
5 | .c "%d\n" | |
6 | ||
7 | .code | |
8 | jmpi main | |
9 | ||
10 | #define def_test_double(a, b, c) \ | |
11 | name test_double_##a##_##b##_##c \ | |
12 | test_double_##a##_##b##_##c: \ | |
13 | prolog \ | |
14 | arg_d $d0 \ | |
15 | arg_d $d1 \ | |
16 | getarg_d %b $d0 \ | |
17 | getarg_d %c $d1 \ | |
18 | subr_d %a %b %c \ | |
19 | retr_d %a \ | |
20 | epilog | |
21 | #define test_double(a, b, c, x, y) \ | |
22 | prepare \ | |
23 | pushargi_d x \ | |
24 | pushargi_d y \ | |
25 | finishi test_double_##a##_##b##_##c \ | |
26 | retval_d %f0 \ | |
27 | prepare \ | |
28 | pushargi dfmt \ | |
29 | ellipsis \ | |
30 | pushargr_d %f0 \ | |
31 | finishi @printf | |
32 | ||
33 | #define def_test_int(a, b, c) \ | |
34 | name test_int_##a##_##b##_##c \ | |
35 | test_int_##a##_##b##_##c: \ | |
36 | prolog \ | |
37 | arg $i0 \ | |
38 | arg $i1 \ | |
39 | getarg %b $i0 \ | |
40 | getarg %c $i1 \ | |
41 | subr %a %b %c \ | |
42 | retr %a \ | |
43 | epilog | |
44 | #define test_int(a, b, c, x, y) \ | |
45 | prepare \ | |
46 | pushargi x \ | |
47 | pushargi y \ | |
48 | finishi test_int_##a##_##b##_##c \ | |
49 | retval %r0 \ | |
50 | prepare \ | |
51 | pushargi ifmt \ | |
52 | ellipsis \ | |
53 | pushargr %r0 \ | |
54 | finishi @printf | |
55 | ||
56 | def_test_double(f0, f0, f0) | |
57 | def_test_double(f0, f0, f1) | |
58 | def_test_double(f0, f1, f0) | |
59 | def_test_double(f0, f1, f2) | |
60 | ||
61 | def_test_double(f3, f3, f3) | |
62 | def_test_double(f3, f3, f1) | |
63 | def_test_double(f3, f1, f3) | |
64 | def_test_double(f3, f1, f2) | |
65 | ||
66 | def_test_double(f3, f0, f0) | |
67 | def_test_double(f3, f0, f3) | |
68 | def_test_double(f3, f3, f0) | |
69 | ||
70 | def_test_int(r0, r0, r0) | |
71 | def_test_int(r0, r0, r1) | |
72 | def_test_int(r0, r1, r0) | |
73 | def_test_int(r0, r1, r2) | |
74 | ||
75 | def_test_int(v0, v0, v0) | |
76 | def_test_int(v0, v0, r1) | |
77 | def_test_int(v0, r1, v0) | |
78 | def_test_int(v0, r1, r2) | |
79 | ||
80 | def_test_int(v0, r0, r0) | |
81 | def_test_int(v0, r0, v0) | |
82 | def_test_int(v0, v0, r0) | |
83 | ||
84 | ||
85 | name main | |
86 | main: | |
87 | prolog | |
88 | ||
89 | test_double(f0, f0, f0, 3.0, 2.0) | |
90 | test_double(f0, f0, f1, 3.0, 2.0) | |
91 | test_double(f0, f1, f0, 3.0, 2.0) | |
92 | test_double(f0, f1, f2, 3.0, 2.0) | |
93 | ||
94 | test_double(f3, f3, f3, 3.0, 2.0) | |
95 | test_double(f3, f3, f1, 3.0, 2.0) | |
96 | test_double(f3, f1, f3, 3.0, 2.0) | |
97 | test_double(f3, f1, f2, 3.0, 2.0) | |
98 | ||
99 | test_double(f3, f0, f0, 3.0, 2.0) | |
100 | test_double(f3, f0, f3, 3.0, 2.0) | |
101 | test_double(f3, f3, f0, 3.0, 2.0) | |
102 | ||
103 | test_int(r0, r0, r0, 3, 2) | |
104 | test_int(r0, r0, r1, 3, 2) | |
105 | test_int(r0, r1, r0, 3, 2) | |
106 | test_int(r0, r1, r2, 3, 2) | |
107 | ||
108 | test_int(v0, v0, v0, 3, 2) | |
109 | test_int(v0, v0, r1, 3, 2) | |
110 | test_int(v0, r1, v0, 3, 2) | |
111 | test_int(v0, r1, r2, 3, 2) | |
112 | ||
113 | test_int(v0, r0, r0, 3, 2) | |
114 | test_int(v0, r0, v0, 3, 2) | |
115 | test_int(v0, v0, r0, 3, 2) | |
116 | ||
117 | ret | |
118 | epilog |