- added missing base in two test cases
[libfirm] / ir / be / test / am_possibilities.c
1 /*
2  B  - base
3  IN - index
4  IS - index (shifted)
5  C  - const
6  SC - symconst
7
8     #   |   B   |   I   |  IS   |   C   |  SC   |             note
9  -------+-------+-------+-------+-------+-------+-------------------------------
10      00 |       |       |       |       |       | senseless
11      01 |       |       |       |       |   x   |
12      02 |       |       |       |   x   |       | senseless ?
13      03 |       |       |       |   x   |   x   |
14      04 |       |       |   x   |       |       | missing base ?
15      05 |       |       |   x   |       |   x   | missing base ?
16      06 |       |       |   x   |   x   |       | missing base ?
17      07 |       |       |   x   |   x   |   x   | missing base ?
18      08 |       |   x   |       |       |       | missing base
19      09 |       |   x   |       |       |   x   | missing base
20      10 |       |   x   |       |   x   |       | missing base
21      11 |       |   x   |       |   x   |   x   | missing base
22      12 |       |   x   |   x   |       |       | impossible
23      13 |       |   x   |   x   |       |   x   | impossible
24      14 |       |   x   |   x   |   x   |       | impossible
25      15 |       |   x   |   x   |   x   |   x   | impossible
26      16 |   x   |       |       |       |       |
27      17 |   x   |       |       |       |   x   |
28      18 |   x   |       |       |   x   |       |
29      19 |   x   |       |       |   x   |   x   |
30      20 |   x   |       |   x   |       |       |
31      21 |   x   |       |   x   |       |   x   |
32      22 |   x   |       |   x   |   x   |       |
33      23 |   x   |       |   x   |   x   |   x   |
34      24 |   x   |   x   |       |       |       |
35      25 |   x   |   x   |       |       |   x   |
36      26 |   x   |   x   |       |   x   |       |
37      27 |   x   |   x   |       |   x   |   x   |
38      28 |   x   |   x   |   x   |       |       | impossible
39      29 |   x   |   x   |   x   |       |   x   | impossible
40      30 |   x   |   x   |   x   |   x   |       | impossible
41      31 |   x   |   x   |   x   |   x   |   x   | impossible
42  */
43
44 char sc[100];
45 char c;
46
47 int main(int argc, char **argv)
48 {
49         return 0;
50 }
51
52 /* Source address modes */
53
54 void load_01(void)
55 {
56         c = sc[0];
57 }
58
59 void load_03(void)
60 {
61         c = sc[1];
62 }
63
64 void load_16(char* base)
65 {
66         c = base[0];
67 }
68
69 void load_17(int base)
70 {
71         c = sc[base];
72 }
73
74 void load_18(char* base)
75 {
76         c = base[1];
77 }
78
79 void load_19(int base)
80 {
81         c = sc[base + 1];
82 }
83
84 void load_20_add(char* base, int index)
85 {
86         c = base[2 * index];
87 }
88
89 void load_20_shift(char* base, int index)
90 {
91         c = base[4 * index];
92 }
93
94 void load_21_add(int base, int index)
95 {
96         c = sc[base + 2 * index];
97 }
98
99 void load_21_shift(int base, int index)
100 {
101         c = sc[base + 4 * index];
102 }
103
104 void load_22_add(char* base, int index)
105 {
106         c = base[2 * index + 1];
107 }
108
109 void load_22_shift(char* base, int index)
110 {
111         c = base[4 * index + 1];
112 }
113
114 void load_23_add(int base, int index)
115 {
116         c = sc[base + 2 * index + 1];
117 }
118
119 void load_23_shift(int base, int index)
120 {
121         c = sc[base + 4 * index + 1];
122 }
123
124 void load_24(char* base, int index)
125 {
126         c = base[index];
127 }
128
129 void load_25(int base, int index)
130 {
131         c = sc[base + index];
132 }
133
134 void load_26(char* base, int index)
135 {
136         c = base[index + 1];
137 }
138
139 void load_27(int base, int index)
140 {
141         c = sc[base + index + 1];
142 }
143
144 /* Destination address modes */
145
146 void store_01(void)
147 {
148         sc[0] = c;
149 }
150
151 void store_03(void)
152 {
153         sc[1] = c;
154 }
155
156 void store_16(char* base)
157 {
158         base[0] = c;
159 }
160
161 void store_17(int base)
162 {
163         sc[base] = c;
164 }
165
166 void store_18(char* base)
167 {
168         base[1] = c;
169 }
170
171 void store_19(int base)
172 {
173         sc[base + 1] = c;
174 }
175
176 void store_20_add(char* base, int index)
177 {
178         base[2 * index] = c;
179 }
180
181 void store_20_shift(char* base, int index)
182 {
183         base[4 * index] = c;
184 }
185
186 void store_21_add(int base, int index)
187 {
188         sc[base + 2 * index] = c;
189 }
190
191 void store_21_shift(int base, int index)
192 {
193         sc[base + 4 * index] = c;
194 }
195
196 void store_22_add(char* base, int index)
197 {
198         base[2 * index + 1] = c;
199 }
200
201 void store_22_shift(char* base, int index)
202 {
203         base[4 * index + 1] = c;
204 }
205
206 void store_23_add(int base, int index)
207 {
208         sc[base + 2 * index + 1] = c;
209 }
210
211 void store_23_shift(int base, int index)
212 {
213         sc[base + 4 * index + 1] = c;
214 }
215
216 void store_24(char* base, int index)
217 {
218         base[index] = c;
219 }
220
221 void store_25(int base, int index)
222 {
223         sc[base + index] = c;
224 }
225
226 void store_26(char* base, int index)
227 {
228         base[index + 1] = c;
229 }
230
231 void store_27(int base, int index)
232 {
233         sc[base + index + 1] = c;
234 }