- Notifications
You must be signed in to change notification settings - Fork5.2k
Commit12ecfe7
[release/9.0] [mono][mini] Interlocked.CompareExchange and Interlocked.Exchange intrinsics for small types and enums (#106897)
* [mono][mini][arm64] Interlocked.CompareExchange for byte/sbyte* rewrite cas_i1 with zext cmp and sign ext result* [sample] fixup HelloWorld to work with full aot* [mini][llvm] support OP_ATOMIC_CAS_U1* [mini][amd64] support OP_ATOMIC_CAS_U1* [mini][wasm] support OP_ATOMIC_CAS_U1 in LLVM AOT* make intrinsic must-expand on arm64,amd64,wasm on mono* [interp] MINT_MONO_CMPXCHG_U1also add mono_atomic_cas_u8 utility function* [mini] CompareExchange(i16/u16)* [mono] must expand CompareExchange(i16/u16)* [interp] Interlocked.CompareExchange(u16/i16)* fix gcc intrinsics build* fix amd64 supported ops* [mini] zext unsigned CAS results for small types* [interp] signed small CAS ops* HACK: fix x64 crashes?maybe we can't actually do a 1 or 2 byte move from RAX ?* [amd64] fixup 8- and 16-bit cmpxchg encoding* fix operand order* ok to always emit rex?* Apply suggestions from code reviewfixup u16 win32 atomic* [interp] remove if guarding a switch* Interlocked.Exchange u1/i1/u2/i2 interp,llvm,amd64,arm64* fix windows build* [amd64] give u2 CMPXCHG and XCHG one more bytefor the 16-bit addressing prefix* If jiterpreter is engaged before the thread is fully initialized, just fail to allocate a table index and generate a warning. This shouldn't happen in prod anywayImplement cmpxchg atomics natively in jiterpreterRemove unnecessary jiterp cas helpersDo cmpxchg result fixups as neededAdd runtime option for jiterpreter atomicsImplement atomic exchanges in the jiterpreter* Interlocked.Exchange(int) for interp and jiterp---------Co-authored-by: Aleksey Kliger <alklig@microsoft.com>Co-authored-by: Aleksey Kliger <aleksey@lambdageek.org>Co-authored-by: Katelyn Gadd <kg@luminance.org>Co-authored-by: Jeff Schwartz <jeffschw@microsoft.com>1 parente107da8 commit12ecfe7
File tree
24 files changed
+711
-104
lines changed- src
- libraries/System.Private.CoreLib/src/System/Threading
- mono
- browser/runtime
- mono
- arch
- amd64
- arm64
- mini
- interp
- utils
- sample/HelloWorld
24 files changed
+711
-104
lines changedLines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
325 | | - | |
| 325 | + | |
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | | - | |
| 368 | + | |
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
| |||
153 | 156 | | |
154 | 157 | | |
155 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
156 | 162 | | |
157 | 163 | | |
158 | 164 | | |
| |||
257 | 263 | | |
258 | 264 | | |
259 | 265 | | |
260 | | - | |
261 | 266 | | |
| 267 | + | |
262 | 268 | | |
263 | 269 | | |
264 | 270 | | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
265 | 278 | | |
266 | 279 | | |
267 | 280 | | |
| |||
517 | 530 | | |
518 | 531 | | |
519 | 532 | | |
520 | | - | |
| 533 | + | |
521 | 534 | | |
522 | 535 | | |
523 | 536 | | |
| |||
1900 | 1913 | | |
1901 | 1914 | | |
1902 | 1915 | | |
| 1916 | + | |
1903 | 1917 | | |
1904 | 1918 | | |
1905 | 1919 | | |
| |||
1946 | 1960 | | |
1947 | 1961 | | |
1948 | 1962 | | |
| 1963 | + | |
1949 | 1964 | | |
1950 | 1965 | | |
1951 | 1966 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
328 | 346 | | |
329 | 347 | | |
330 | 348 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
244 | 245 | | |
245 | 246 | | |
246 | 247 | | |
247 | | - | |
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| |||
1465 | 1465 | | |
1466 | 1466 | | |
1467 | 1467 | | |
1468 | | - | |
1469 | | - | |
1470 | | - | |
1471 | | - | |
1472 | | - | |
1473 | | - | |
1474 | | - | |
1475 | | - | |
1476 | | - | |
1477 | | - | |
1478 | | - | |
1479 | | - | |
1480 | | - | |
1481 | | - | |
1482 | | - | |
1483 | | - | |
1484 | | - | |
1485 | | - | |
1486 | | - | |
1487 | | - | |
1488 | 1468 | | |
1489 | 1469 | | |
1490 | 1470 | | |
| |||
1647 | 1627 | | |
1648 | 1628 | | |
1649 | 1629 | | |
| 1630 | + | |
1650 | 1631 | | |
1651 | 1632 | | |
1652 | | - | |
1653 | | - | |
| 1633 | + | |
1654 | 1634 | | |
1655 | 1635 | | |
1656 | | - | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
1657 | 1643 | | |
1658 | 1644 | | |
1659 | 1645 | | |
| |||
1740 | 1726 | | |
1741 | 1727 | | |
1742 | 1728 | | |
1743 | | - | |
| 1729 | + | |
1744 | 1730 | | |
1745 | 1731 | | |
1746 | 1732 | | |
| |||
3963 | 3949 | | |
3964 | 3950 | | |
3965 | 3951 | | |
| 3952 | + | |
| 3953 | + | |
| 3954 | + | |
| 3955 | + | |
| 3956 | + | |
| 3957 | + | |
| 3958 | + | |
| 3959 | + | |
| 3960 | + | |
| 3961 | + | |
| 3962 | + | |
| 3963 | + | |
| 3964 | + | |
| 3965 | + | |
| 3966 | + | |
| 3967 | + | |
| 3968 | + | |
| 3969 | + | |
| 3970 | + | |
| 3971 | + | |
| 3972 | + | |
| 3973 | + | |
| 3974 | + | |
| 3975 | + | |
| 3976 | + | |
| 3977 | + | |
| 3978 | + | |
| 3979 | + | |
| 3980 | + | |
| 3981 | + | |
| 3982 | + | |
| 3983 | + | |
| 3984 | + | |
| 3985 | + | |
| 3986 | + | |
| 3987 | + | |
| 3988 | + | |
| 3989 | + | |
| 3990 | + | |
| 3991 | + | |
| 3992 | + | |
| 3993 | + | |
| 3994 | + | |
| 3995 | + | |
| 3996 | + | |
| 3997 | + | |
| 3998 | + | |
| 3999 | + | |
| 4000 | + | |
| 4001 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | | - | |
287 | | - | |
288 | 286 | | |
289 | 287 | | |
290 | 288 | | |
| |||
629 | 627 | | |
630 | 628 | | |
631 | 629 | | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | 630 | | |
652 | 631 | | |
653 | 632 | | |
| |||
896 | 875 | | |
897 | 876 | | |
898 | 877 | | |
899 | | - | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
900 | 884 | | |
901 | 885 | | |
902 | 886 | | |
| |||
0 commit comments
Comments
(0)