Commit 1cbab34
x64: Use 8-bit jumps in pseudo-insts (bytecodealliance#11271)
* x64: Use 8-bit jumps in pseudo-insts
Cranelift does not currently implement any form of "relaxation" of
instructions where, for example, a 32-bit jump is shrunk to an 8-bit
jump if the destination actually fits. In lieu of this Cranelift
pessimistically emits 32-bit jumps on x64, for example, for all jumps
between basic blocks. This is a difficult problem to solve in general
but for pseudo-instructions it's a much more targeted problem which
should be easier to solve.
This commit updates all pseudo-instructions in the x64 backend to use
8-bit jumps instead of full 32-bit jumps within their code bodies. It's
statically known that the instructions bodies being generate are all
small enough to fit in 8 bits. This helps shrink the generated code for
a number of instructions whenever a pseudo-inst is used instead of basic
blocks.
Optimizing jumps between basic blocks is left as a future optimization
as it's likely to be much more difficult to implement than this.
* Fix emit tests1 parent 3fafbe0 commit 1cbab34
File tree
99 files changed
+995
-950
lines changed- cranelift
- codegen/src/isa/x64/inst
- filetests/filetests/isa/x64
- tests/disas
- winch/x64
- atomic/rmw
- and
- or
- xor
- f32_convert_i32_u
- f32_convert_i64_u
- f32_max
- f32_min
- f64_convert_i32_u
- f64_convert_i64_u
- f64_max
- f64_min
- i32_rems
- i32_trunc_f32_s
- i32_trunc_f32_u
- i32_trunc_f64_s
- i32_trunc_f64_u
- i64_rems
- i64_trunc_f32_s
- i64_trunc_f32_u
- i64_trunc_f64_s
- i64_trunc_f64_u
- select
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
99 files changed
+995
-950
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
42 | 51 | | |
43 | 52 | | |
44 | 53 | | |
| |||
86 | 95 | | |
87 | 96 | | |
88 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
89 | 126 | | |
90 | 127 | | |
91 | 128 | | |
| |||
253 | 290 | | |
254 | 291 | | |
255 | 292 | | |
256 | | - | |
| 293 | + | |
257 | 294 | | |
258 | 295 | | |
259 | 296 | | |
| |||
343 | 380 | | |
344 | 381 | | |
345 | 382 | | |
346 | | - | |
| 383 | + | |
347 | 384 | | |
348 | 385 | | |
349 | 386 | | |
| |||
421 | 458 | | |
422 | 459 | | |
423 | 460 | | |
424 | | - | |
| 461 | + | |
425 | 462 | | |
426 | 463 | | |
427 | 464 | | |
| |||
939 | 976 | | |
940 | 977 | | |
941 | 978 | | |
942 | | - | |
943 | | - | |
| 979 | + | |
| 980 | + | |
944 | 981 | | |
945 | 982 | | |
946 | 983 | | |
| |||
957 | 994 | | |
958 | 995 | | |
959 | 996 | | |
960 | | - | |
| 997 | + | |
961 | 998 | | |
962 | 999 | | |
963 | 1000 | | |
| |||
1020 | 1057 | | |
1021 | 1058 | | |
1022 | 1059 | | |
1023 | | - | |
| 1060 | + | |
1024 | 1061 | | |
1025 | 1062 | | |
1026 | 1063 | | |
| |||
1159 | 1196 | | |
1160 | 1197 | | |
1161 | 1198 | | |
1162 | | - | |
| 1199 | + | |
1163 | 1200 | | |
1164 | 1201 | | |
1165 | 1202 | | |
1166 | 1203 | | |
1167 | 1204 | | |
1168 | 1205 | | |
1169 | | - | |
| 1206 | + | |
1170 | 1207 | | |
1171 | 1208 | | |
1172 | 1209 | | |
| |||
1194 | 1231 | | |
1195 | 1232 | | |
1196 | 1233 | | |
1197 | | - | |
| 1234 | + | |
1198 | 1235 | | |
1199 | 1236 | | |
1200 | 1237 | | |
| |||
1387 | 1424 | | |
1388 | 1425 | | |
1389 | 1426 | | |
1390 | | - | |
| 1427 | + | |
1391 | 1428 | | |
1392 | 1429 | | |
1393 | 1430 | | |
1394 | 1431 | | |
1395 | | - | |
| 1432 | + | |
1396 | 1433 | | |
1397 | 1434 | | |
1398 | 1435 | | |
| |||
1413 | 1450 | | |
1414 | 1451 | | |
1415 | 1452 | | |
1416 | | - | |
| 1453 | + | |
1417 | 1454 | | |
1418 | 1455 | | |
1419 | 1456 | | |
| |||
1448 | 1485 | | |
1449 | 1486 | | |
1450 | 1487 | | |
1451 | | - | |
| 1488 | + | |
1452 | 1489 | | |
1453 | 1490 | | |
1454 | 1491 | | |
| |||
1633 | 1670 | | |
1634 | 1671 | | |
1635 | 1672 | | |
1636 | | - | |
| 1673 | + | |
1637 | 1674 | | |
1638 | 1675 | | |
1639 | 1676 | | |
| |||
1753 | 1790 | | |
1754 | 1791 | | |
1755 | 1792 | | |
1756 | | - | |
| 1793 | + | |
1757 | 1794 | | |
1758 | 1795 | | |
1759 | 1796 | | |
| |||
1793 | 1830 | | |
1794 | 1831 | | |
1795 | 1832 | | |
1796 | | - | |
| 1833 | + | |
1797 | 1834 | | |
1798 | 1835 | | |
1799 | 1836 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
| 295 | + | |
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
| 307 | + | |
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
| 319 | + | |
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| |||
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
331 | | - | |
| 331 | + | |
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
343 | | - | |
| 343 | + | |
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
359 | | - | |
| 359 | + | |
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
373 | | - | |
| 373 | + | |
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
| |||
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
387 | | - | |
| 387 | + | |
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | | - | |
| 401 | + | |
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| |||
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
412 | | - | |
| 412 | + | |
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1562 | 1562 | | |
1563 | 1563 | | |
1564 | 1564 | | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
1565 | 1573 | | |
1566 | 1574 | | |
1567 | 1575 | | |
| |||
1573 | 1581 | | |
1574 | 1582 | | |
1575 | 1583 | | |
| 1584 | + | |
1576 | 1585 | | |
1577 | 1586 | | |
1578 | 1587 | | |
1579 | 1588 | | |
1580 | 1589 | | |
1581 | 1590 | | |
| 1591 | + | |
1582 | 1592 | | |
1583 | 1593 | | |
1584 | 1594 | | |
1585 | 1595 | | |
1586 | 1596 | | |
1587 | 1597 | | |
| 1598 | + | |
1588 | 1599 | | |
1589 | 1600 | | |
1590 | 1601 | | |
| |||
1599 | 1610 | | |
1600 | 1611 | | |
1601 | 1612 | | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
1602 | 1616 | | |
1603 | 1617 | | |
1604 | 1618 | | |
| |||
1610 | 1624 | | |
1611 | 1625 | | |
1612 | 1626 | | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
1613 | 1636 | | |
1614 | 1637 | | |
1615 | 1638 | | |
1616 | 1639 | | |
1617 | 1640 | | |
1618 | | - | |
| 1641 | + | |
1619 | 1642 | | |
1620 | 1643 | | |
1621 | 1644 | | |
| |||
1625 | 1648 | | |
1626 | 1649 | | |
1627 | 1650 | | |
1628 | | - | |
| 1651 | + | |
1629 | 1652 | | |
1630 | 1653 | | |
1631 | 1654 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
0 commit comments