convert bitfield initializer tarvals before using them
[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* sc_pointers[100];
46 char c;
47
48 int main(int argc, char **argv)
49 {
50         return 0;
51 }
52
53 /* Source address modes */
54
55 void load_01(void)
56 {
57         c = sc[0];
58 }
59
60 void load_03(void)
61 {
62         c = sc[1];
63 }
64
65 void load_16(char* base)
66 {
67         c = base[0];
68 }
69
70 void load_17(int base)
71 {
72         c = sc[base];
73 }
74
75 void load_18(char* base)
76 {
77         c = base[1];
78 }
79
80 void load_19(int base)
81 {
82         c = sc[base + 1];
83 }
84
85 void load_20_add(char* base, int index)
86 {
87         c = base[2 * index];
88 }
89
90 void load_20_shift(char* base, int index)
91 {
92         c = base[4 * index];
93 }
94
95 void load_21_add(int base, int index)
96 {
97         c = sc[base + 2 * index];
98 }
99
100 void load_21_shift(int base, int index)
101 {
102         c = sc[base + 4 * index];
103 }
104
105 void load_22_add(char* base, int index)
106 {
107         c = base[2 * index + 1];
108 }
109
110 void load_22_shift(char* base, int index)
111 {
112         c = base[4 * index + 1];
113 }
114
115 void load_23_add(int base, int index)
116 {
117         c = sc[base + 2 * index + 1];
118 }
119
120 void load_23_shift(int base, int index)
121 {
122         c = sc[base + 4 * index + 1];
123 }
124
125 void load_24(char* base, int index)
126 {
127         c = base[index];
128 }
129
130 void load_25(int base, int index)
131 {
132         c = sc[base + index];
133 }
134
135 void load_26(char* base, int index)
136 {
137         c = base[index + 1];
138 }
139
140 void load_27(int base, int index)
141 {
142         c = sc[base + index + 1];
143 }
144
145 /* Destination address modes */
146
147 void store_immediate_01(void)
148 {
149         sc_pointers[0] = sc + 42;
150 }
151
152 void store_immediate_03(void)
153 {
154         sc_pointers[1] = sc + 42;
155 }
156
157 void store_immediate_16(char** base)
158 {
159         base[0] = sc + 42;
160 }
161
162 void store_immediate_17(int base)
163 {
164         sc_pointers[base] = sc + 42;
165 }
166
167 void store_immediate_18(char** base)
168 {
169         base[1] = sc + 42;
170 }
171
172 void store_immediate_19(int base)
173 {
174         sc_pointers[base + 1] = sc + 42;
175 }
176
177 void store_immediate_20_add(char** base, int index)
178 {
179         base[2 * index] = sc + 42;
180 }
181
182 void store_immediate_20_shift(char** base, int index)
183 {
184         base[4 * index] = sc + 42;
185 }
186
187 void store_immediate_21_add(int base, int index)
188 {
189         sc_pointers[base + 2 * index] = sc + 42;
190 }
191
192 void store_immediate_21_shift(int base, int index)
193 {
194         sc_pointers[base + 4 * index] = sc + 42;
195 }
196
197 void store_immediate_22_add(char** base, int index)
198 {
199         base[2 * index + 1] = sc + 42;
200 }
201
202 void store_immediate_22_shift(char** base, int index)
203 {
204         base[4 * index + 1] = sc + 42;
205 }
206
207 void store_immediate_23_add(int base, int index)
208 {
209         sc_pointers[base + 2 * index + 1] = sc + 42;
210 }
211
212 void store_immediate_23_shift(int base, int index)
213 {
214         sc_pointers[base + 4 * index + 1] = sc + 42;
215 }
216
217 void store_immediate_24(char** base, int index)
218 {
219         base[index] = sc + 42;
220 }
221
222 void store_immediate_25(int base, int index)
223 {
224         sc_pointers[base + index] = sc + 42;
225 }
226
227 void store_immediate_26(char** base, int index)
228 {
229         base[index + 1] = sc + 42;
230 }
231
232 void store_immediate_27(int base, int index)
233 {
234         sc_pointers[base + index + 1] = sc + 42;
235 }