Commit 54790a4
committed
[a64] Use VectorCodeGenerator rather than CodeBlock+CodeGenerator
The emitter doesn't actually hold onto executable code, but just
generates the assembly-data into a buffer for the currently-resolving
function before placing it into a code-cache. When code gets pushed into
the code-cache, it can just be copied from an `std::vector` and reset.
The code-cache itself maintains the actual executable memory and
stack-unwinding code and such.
This also fixes a bunch of errornous relative-addressing glitches where
relative addresses were calculated based on the address of the unused
CodeBlock rather than being position-independent. `MOVP2R` in particular
was generating different instructions depending on its distance from the
code block when it should always just use `MOV` and not do any
relative-address calculations since we can't predict where the actual
instruction's offset will be(we cannot predict what the program counter
will be). Oaknut probably needs a "position independent" policy or mode
or something so that it avoids PC-relative instructions.1 parent d926928 commit 54790a4
File tree
4 files changed
+36
-37
lines changed- src/xenia/cpu/backend/a64
4 files changed
+36
-37
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | 61 | | |
64 | 62 | | |
65 | 63 | | |
| |||
73 | 71 | | |
74 | 72 | | |
75 | 73 | | |
76 | | - | |
77 | | - | |
| 74 | + | |
78 | 75 | | |
79 | 76 | | |
80 | 77 | | |
| |||
138 | 135 | | |
139 | 136 | | |
140 | 137 | | |
141 | | - | |
142 | 138 | | |
143 | 139 | | |
144 | 140 | | |
145 | 141 | | |
146 | 142 | | |
147 | 143 | | |
148 | | - | |
| 144 | + | |
149 | 145 | | |
150 | 146 | | |
151 | 147 | | |
152 | | - | |
| 148 | + | |
153 | 149 | | |
154 | 150 | | |
155 | 151 | | |
156 | 152 | | |
157 | | - | |
| 153 | + | |
158 | 154 | | |
159 | 155 | | |
160 | 156 | | |
| |||
224 | 220 | | |
225 | 221 | | |
226 | 222 | | |
227 | | - | |
| 223 | + | |
| 224 | + | |
228 | 225 | | |
229 | 226 | | |
230 | 227 | | |
| |||
234 | 231 | | |
235 | 232 | | |
236 | 233 | | |
237 | | - | |
238 | | - | |
| 234 | + | |
| 235 | + | |
239 | 236 | | |
240 | 237 | | |
241 | 238 | | |
242 | 239 | | |
243 | 240 | | |
244 | 241 | | |
245 | 242 | | |
246 | | - | |
| 243 | + | |
| 244 | + | |
247 | 245 | | |
248 | 246 | | |
249 | 247 | | |
| |||
334 | 332 | | |
335 | 333 | | |
336 | 334 | | |
337 | | - | |
338 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
339 | 338 | | |
340 | 339 | | |
341 | 340 | | |
| |||
803 | 802 | | |
804 | 803 | | |
805 | 804 | | |
806 | | - | |
807 | | - | |
808 | | - | |
| 805 | + | |
809 | 806 | | |
810 | | - | |
| 807 | + | |
811 | 808 | | |
812 | 809 | | |
813 | 810 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
207 | | - | |
| 206 | + | |
| 207 | + | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
242 | 244 | | |
243 | 245 | | |
244 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
1007 | 1007 | | |
1008 | 1008 | | |
1009 | 1009 | | |
1010 | | - | |
| 1010 | + | |
1011 | 1011 | | |
1012 | 1012 | | |
1013 | 1013 | | |
| |||
1335 | 1335 | | |
1336 | 1336 | | |
1337 | 1337 | | |
1338 | | - | |
| 1338 | + | |
1339 | 1339 | | |
1340 | 1340 | | |
1341 | 1341 | | |
| |||
1435 | 1435 | | |
1436 | 1436 | | |
1437 | 1437 | | |
1438 | | - | |
| 1438 | + | |
1439 | 1439 | | |
1440 | 1440 | | |
1441 | 1441 | | |
| |||
1456 | 1456 | | |
1457 | 1457 | | |
1458 | 1458 | | |
1459 | | - | |
| 1459 | + | |
1460 | 1460 | | |
1461 | 1461 | | |
1462 | 1462 | | |
| |||
1478 | 1478 | | |
1479 | 1479 | | |
1480 | 1480 | | |
1481 | | - | |
| 1481 | + | |
1482 | 1482 | | |
1483 | 1483 | | |
1484 | 1484 | | |
| |||
1519 | 1519 | | |
1520 | 1520 | | |
1521 | 1521 | | |
1522 | | - | |
| 1522 | + | |
1523 | 1523 | | |
1524 | 1524 | | |
1525 | 1525 | | |
| |||
1740 | 1740 | | |
1741 | 1741 | | |
1742 | 1742 | | |
1743 | | - | |
| 1743 | + | |
1744 | 1744 | | |
1745 | 1745 | | |
1746 | 1746 | | |
| |||
1849 | 1849 | | |
1850 | 1850 | | |
1851 | 1851 | | |
1852 | | - | |
| 1852 | + | |
1853 | 1853 | | |
1854 | 1854 | | |
1855 | 1855 | | |
| |||
1892 | 1892 | | |
1893 | 1893 | | |
1894 | 1894 | | |
1895 | | - | |
| 1895 | + | |
1896 | 1896 | | |
1897 | 1897 | | |
1898 | 1898 | | |
| |||
1928 | 1928 | | |
1929 | 1929 | | |
1930 | 1930 | | |
1931 | | - | |
| 1931 | + | |
1932 | 1932 | | |
1933 | 1933 | | |
1934 | 1934 | | |
| |||
1972 | 1972 | | |
1973 | 1973 | | |
1974 | 1974 | | |
1975 | | - | |
| 1975 | + | |
1976 | 1976 | | |
1977 | 1977 | | |
1978 | 1978 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2758 | 2758 | | |
2759 | 2759 | | |
2760 | 2760 | | |
2761 | | - | |
| 2761 | + | |
2762 | 2762 | | |
2763 | 2763 | | |
2764 | 2764 | | |
| |||
0 commit comments