| 574 | <h4>S_ATOMIC_ADD</h4> |
| 575 | <p>Opcode: 130 (0x82) only for GCN 1.4<br /> |
| 576 | Syntax: S_ATOMIC_ADD SDATA, SBASE(2), OFFSET<br /> |
| 577 | Description: Add SDATA to value from memory address, and store result to memory address. |
| 578 | If GLC flag is set then return previous value from memory address to SDATA, |
| 579 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 580 | Operation:<br /> |
| 581 | <code>UINT32* VM = (UINT32*)((SMEM + (OFFSET & ~3)) |
| 582 | UINT32 P = *VM; *VM = *VM + SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 583 | <h4>S_ATOMIC_ADD_X2</h4> |
| 584 | <p>Opcode: 162 (0xa2) only for GCN 1.4<br /> |
| 585 | Syntax: S_ATOMIC_ADD_X2 SDATA(2), SBASE(2), OFFSET<br /> |
| 586 | Description: Add 64-bit SDATA to 64-bit value from memory address, |
| 587 | and store result to memory address. |
| 588 | If GLC flag is set then return previous value from memory address to SDATA, |
| 589 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 590 | Operation:<br /> |
| 591 | <code>UINT64* VM = (UINT64*)((SMEM + (OFFSET & ~3)) |
| 592 | UINT64 P = *VM; *VM = *VM + SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 593 | <h4>S_ATOMIC_AND</h4> |
| 594 | <p>Opcode: 136 (0x88) only for GCN 1.4<br /> |
| 595 | Syntax: S_ATOMIC_AND SDATA, SBASE(2), OFFSET<br /> |
| 596 | Description: Do bitwise AND on SDATA and value from memory address, |
| 597 | and store result to memory address. |
| 598 | If GLC flag is set then return previous value from memory address to SDATA, |
| 599 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 600 | Operation:<br /> |
| 601 | <code>UINT32* VM = (UINT32*)((SMEM + (OFFSET & ~3)) |
| 602 | UINT32 P = *VM; *VM = *VM & SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 603 | <h4>S_ATOMIC_AND_X2</h4> |
| 604 | <p>Opcode: 168 (0xa8) only for GCN 1.4<br /> |
| 605 | Syntax: S_ATOMIC_AND_X2 SDATA(2), SBASE(2), OFFSET<br /> |
| 606 | Description: Do bitwise AND on 64-bit SDATA and 64-bit value from memory address, |
| 607 | and store result to memory address. |
| 608 | If GLC flag is set then return previous value from memory address to SDATA, |
| 609 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 610 | Operation:<br /> |
| 611 | <code>UINT64* VM = (UINT64*)((SMEM + (OFFSET & ~3)) |
| 612 | UINT64 P = *VM; *VM = *VM & SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 613 | <h4>S_ATOMIC_CMPSWAP</h4> |
| 614 | <p>Opcode: 129 (0x81) only for GCN 1.4<br /> |
| 615 | Syntax: S_ATOMIC_CMPSWAP SDATA(2), SBASE(2), OFFSET<br /> |
| 616 | Description: Store lower SDATA dword into memory address if previous value |
| 617 | from memory address is equal SDATA>>32, otherwise keep old value from memory address. |
| 618 | If GLC flag is set then return previous value from memory address to SDATA, |
| 619 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 620 | Operation:<br /> |
| 621 | <code>UINT32* VM = (UINT32*)((SMEM + (OFFSET & ~3)) |
| 622 | UINT32 P = *VM; *VM = *VM = *VM==(SDATA>>32) ? SDATA&0xffffffff : *VM // atomic |
| 623 | SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 624 | <h4>S_ATOMIC_CMPSWAP_X2</h4> |
| 625 | <p>Opcode: 161 (0xa1) only for GCN 1.4<br /> |
| 626 | Syntax: S_ATOMIC_CMPSWAP_X2 SDATA(4), SBASE(2), OFFSET<br /> |
| 627 | Description: Store lower SDATA quadword into memory address if previous value |
| 628 | from memory address is equal last SDATA quadword, |
| 629 | otherwise keep old value from memory address. |
| 630 | If GLC flag is set then return previous value from memory address to SDATA, |
| 631 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 632 | Operation:<br /> |
| 633 | <code>UINT64* VM = (UINT64*)((SMEM + (OFFSET & ~3)) |
| 634 | UINT64 P = *VM; *VM = *VM = *VM==(SDATA[2:3]) ? SDATA[0:1] : *VM // atomic |
| 635 | SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 636 | <h4>S_ATOMIC_DEC</h4> |
| 637 | <p>Opcode: 140 (0x8c) only for GCN 1.4<br /> |
| 638 | Syntax: S_ATOMIC_DEC SDATA, SBASE(2), OFFSET<br /> |
| 639 | Description: Compare value from memory address and if less or equal than SDATA |
| 640 | and this value is not zero, then decrement value from memory address, |
| 641 | otherwise store SDATA to memory address. |
| 642 | If GLC flag is set then return previous value from memory address to SDATA, |
| 643 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 644 | Operation:<br /> |
| 645 | <code>UINT32* VM = (UINT32*)((SMEM + (OFFSET & ~3)) |
| 646 | UINT32 P = *VM; *VM = (*VM <= VDATA && *VM!=0) ? *VM-1 : VDATA; // atomic |
| 647 | SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 648 | <h4>S_ATOMIC_DEC_X2</h4> |
| 649 | <p>Opcode: 172 (0xac) only for GCN 1.4<br /> |
| 650 | Syntax: S_ATOMIC_DEC_X2 SDATA, SBASE(2), OFFSET<br /> |
| 651 | Description: Compare 64-bit value from memory address and if less or equal than |
| 652 | 64-bit SDATA and this value is not zero, then decrement value from memory address, |
| 653 | otherwise store SDATA to memory address. |
| 654 | If GLC flag is set then return previous value from memory address to SDATA, |
| 655 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 656 | Operation:<br /> |
| 657 | <code>UINT64* VM = (UINT64*)((SMEM + (OFFSET & ~3)) |
| 658 | UINT64 P = *VM; *VM = (*VM <= VDATA && *VM!=0) ? *VM-1 : VDATA; // atomic |
| 659 | SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 660 | <h4>S_ATOMIC_INC</h4> |
| 661 | <p>Opcode: 139 (0x8b) only for GCN 1.4<br /> |
| 662 | Syntax: S_ATOMIC_INC SDATA, SBASE(2), OFFSET<br /> |
| 663 | Description: Compare value from memory address and if less than SDATA, |
| 664 | then increment value from memory address, otherwise store zero to memory address. |
| 665 | If GLC flag is set then return previous value from memory address to SDATA, |
| 666 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 667 | Operation:<br /> |
| 668 | <code>UINT32* VM = (UINT32*)((SMEM + (OFFSET & ~3)) |
| 669 | UINT32 P = *VM; *VM = (*VM < SDATA) ? *VM+1 : 0; SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 670 | <h4>S_ATOMIC_INC_X2</h4> |
| 671 | <p>Opcode: 171 (0xab) only for GCN 1.4<br /> |
| 672 | Syntax: S_ATOMIC_INC_X2 SDATA(2), SBASE(2), OFFSET<br /> |
| 673 | Description: Compare 64-bit value from memory address and if less than 64-bit SDATA, |
| 674 | then increment value from memory address, otherwise store zero to memory address. |
| 675 | If GLC flag is set then return previous value from memory address to SDATA, |
| 676 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 677 | Operation:<br /> |
| 678 | <code>UINT64* VM = (UINT64*)((SMEM + (OFFSET & ~3)) |
| 679 | UINT64 P = *VM; *VM = (*VM < SDATA) ? *VM+1 : 0; SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 680 | <h4>S_ATOMIC_OR</h4> |
| 681 | <p>Opcode: 137 (0x89) only for GCN 1.4<br /> |
| 682 | Syntax: S_ATOMIC_OR SDATA, SBASE(2), OFFSET<br /> |
| 683 | Description: Do bitwise OR on SDATA and value from memory address, |
| 684 | and store result to memory address. |
| 685 | If GLC flag is set then return previous value from memory address to SDATA, |
| 686 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 687 | Operation:<br /> |
| 688 | <code>UINT32* VM = (UINT32*)((SMEM + (OFFSET & ~3)) |
| 689 | UINT32 P = *VM; *VM = *VM | SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 690 | <h4>S_ATOMIC_OR_X2</h4> |
| 691 | <p>Opcode: 169 (0xa9) only for GCN 1.4<br /> |
| 692 | Syntax: S_ATOMIC_OR_X2 SDATA(2), SBASE(2), OFFSET<br /> |
| 693 | Description: Do bitwise OR on 64-bit SDATA and 64-bit value from memory address, |
| 694 | and store result to memory address. |
| 695 | If GLC flag is set then return previous value from memory address to SDATA, |
| 696 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 697 | Operation:<br /> |
| 698 | <code>UINT64* VM = (UINT64*)((SMEM + (OFFSET & ~3)) |
| 699 | UINT64 P = *VM; *VM = *VM | SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 700 | <h4>S_ATOMIC_SMAX</h4> |
| 701 | <p>Opcode: 134 (0x86) only for GCN 1.4<br /> |
| 702 | Syntax: S_ATOMIC_SMAX SDATA, SBASE(2), OFFSET<br /> |
| 703 | Description: Choose largest signed 32-bit value from SDATA and from memory address, |
| 704 | and store result to this memory address. |
| 705 | If GLC flag is set then return previous value from memory address to SDATA, |
| 706 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 707 | Operation:<br /> |
| 708 | <code>INT32* VM = (INT32*)((SMEM + (OFFSET & ~3)) |
| 709 | INT32 P = *VM; *VM = MAX(*VM, (INT32)SDATA); SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 710 | <h4>S_ATOMIC_SMAX_X2</h4> |
| 711 | <p>Opcode: 166 (0x86) only for GCN 1.4<br /> |
| 712 | Syntax: S_ATOMIC_SMAX_X2 SDATA(2), SBASE(2), OFFSET<br /> |
| 713 | Description: Choose largest signed 64-bit value from SDATA and from memory address, |
| 714 | and store result to this memory address. |
| 715 | If GLC flag is set then return previous value from memory address to SDATA, |
| 716 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 717 | Operation:<br /> |
| 718 | <code>INT64* VM = (INT64*)((SMEM + (OFFSET & ~3)) |
| 719 | INT64 P = *VM; *VM = MAX(*VM, (INT64)SDATA); SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 720 | <h4>S_ATOMIC_SMIN</h4> |
| 721 | <p>Opcode: 132 (0x84) only for GCN 1.4<br /> |
| 722 | Syntax: S_ATOMIC_SMIN SDATA, SBASE(2), OFFSET<br /> |
| 723 | Description: Choose smallest signed 32-bit value from SDATA and from memory address, |
| 724 | and store result to this memory address. |
| 725 | If GLC flag is set then return previous value from memory address to SDATA, |
| 726 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 727 | Operation:<br /> |
| 728 | <code>INT32* VM = (INT32*)((SMEM + (OFFSET & ~3)) |
| 729 | INT32 P = *VM; *VM = MIN(*VM, (INT32)SDATA); SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 730 | <h4>S_ATOMIC_SMIN_X2</h4> |
| 731 | <p>Opcode: 164 (0xa4) only for GCN 1.4<br /> |
| 732 | Syntax: S_ATOMIC_SMIN_X2 SDATA(2), SBASE(2), OFFSET<br /> |
| 733 | Description: Choose smallest signed 64-bit value from SDATA and from memory address, |
| 734 | and store result to this memory address. |
| 735 | If GLC flag is set then return previous value from memory address to SDATA, |
| 736 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 737 | Operation:<br /> |
| 738 | <code>INT64* VM = (INT64*)((SMEM + (OFFSET & ~3)) |
| 739 | INT64 P = *VM; *VM = MIN(*VM, (INT64)SDATA); SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 740 | <h4>S_ATOMIC_SUB</h4> |
| 741 | <p>Opcode: 131 (0x83) only for GCN 1.4<br /> |
| 742 | Syntax: S_ATOMIC_SUB SDATA, SBASE(2), OFFSET<br /> |
| 743 | Description: Subtract SDATA from value from memory address, |
| 744 | and store result to memory address. |
| 745 | If GLC flag is set then return previous value from memory address to SDATA, |
| 746 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 747 | Operation:<br /> |
| 748 | <code>UINT32* VM = (UINT32*)((SMEM + (OFFSET & ~3)) |
| 749 | UINT32 P = *VM; *VM = *VM - SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 750 | <h4>S_ATOMIC_SUB_X2</h4> |
| 751 | <p>Opcode: 163 (0xa3) only for GCN 1.4<br /> |
| 752 | Syntax: S_ATOMIC_SUB_X2 SDATA(2), SBASE(2), OFFSET<br /> |
| 753 | Description: Subtract 64-bit SDATA from 64-bit value from memory address, |
| 754 | and store result to memory address. |
| 755 | If GLC flag is set then return previous value from memory address to SDATA, |
| 756 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 757 | Operation:<br /> |
| 758 | <code>UINT64* VM = (UINT64*)((SMEM + (OFFSET & ~3)) |
| 759 | UINT64 P = *VM; *VM = *VM - SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 760 | <h4>S_ATOMIC_SWAP</h4> |
| 761 | <p>Opcode: 128 (0x80) only for GCN 1.4<br /> |
| 762 | Syntax: S_ATOMIC_SWAP SDATA, SBASE(2), OFFSET<br /> |
| 763 | Description: Store SDATA into memory address. |
| 764 | If GLC flag is set then return previous value from memory address to SDATA, |
| 765 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 766 | Operation:<br /> |
| 767 | <code>UINT32* VM = (UINT32*)((SMEM + (OFFSET & ~3)) |
| 768 | UINT32 P = *VM; *VM = SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 769 | <h4>S_ATOMIC_SWAP_X2</h4> |
| 770 | <p>Opcode: 160 (0xa0) only for GCN 1.4<br /> |
| 771 | Syntax: S_ATOMIC_SWAP_X2 SDATA(2), SBASE(2), OFFSET<br /> |
| 772 | Description: Store 64-bit SDATA into memory address. |
| 773 | If GLC flag is set then return previous value from memory address to SDATA, |
| 774 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 775 | Operation:<br /> |
| 776 | <code>UINT64* VM = (UINT64*)((SMEM + (OFFSET & ~3)) |
| 777 | UINT64 P = *VM; *VM = SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 778 | <h4>S_ATOMIC_UMAX</h4> |
| 779 | <p>Opcode: 135 (0x87) only for GCN 1.4<br /> |
| 780 | Syntax: S_ATOMIC_UMAX SDATA, SBASE(2), OFFSET<br /> |
| 781 | Description: Choose largest unsigned 32-bit value from SDATA and from memory address, |
| 782 | and store result to this memory address. |
| 783 | If GLC flag is set then return previous value from memory address to SDATA, |
| 784 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 785 | Operation:<br /> |
| 786 | <code>UINT32* VM = (UINT32*)((SMEM + (OFFSET & ~3)) |
| 787 | UINT32 P = *VM; *VM = MAX(*VM, SDATA); SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 788 | <h4>S_ATOMIC_UMAX_X2</h4> |
| 789 | <p>Opcode: 167 (0xa7) only for GCN 1.4<br /> |
| 790 | Syntax: S_ATOMIC_UMAX_X2 SDATA(2), SBASE(2), OFFSET<br /> |
| 791 | Description: Choose largest unsigned 64-bit value from SDATA and from memory address, |
| 792 | and store result to this memory address. |
| 793 | If GLC flag is set then return previous value from memory address to SDATA, |
| 794 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 795 | Operation:<br /> |
| 796 | <code>UINT64* VM = (UINT64*)((SMEM + (OFFSET & ~3)) |
| 797 | UINT64 P = *VM; *VM = MAX(*VM, SDATA); SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 798 | <h4>S_ATOMIC_UMIN</h4> |
| 799 | <p>Opcode: 133 (0x85) only for GCN 1.4<br /> |
| 800 | Syntax: S_ATOMIC_UMIN SDATA, SBASE(2), OFFSET<br /> |
| 801 | Description: Choose smallest unsigned 32-bit value from SDATA and from memory address, |
| 802 | and store result to this memory address. |
| 803 | If GLC flag is set then return previous value from memory address to SDATA, |
| 804 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 805 | Operation:<br /> |
| 806 | <code>UINT32* VM = (UINT32*)((SMEM + (OFFSET & ~3)) |
| 807 | UINT32 P = *VM; *VM = MIN(*VM, SDATA); SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 808 | <h4>S_ATOMIC_UMIN_X2</h4> |
| 809 | <p>Opcode: 165 (0xa5) only for GCN 1.4<br /> |
| 810 | Syntax: S_ATOMIC_UMIN_X2 SDATA(2), SBASE(2), OFFSET<br /> |
| 811 | Description: Choose smallest unsigned 64-bit value from SDATA and from memory address, |
| 812 | and store result to this memory address. |
| 813 | If GLC flag is set then return previous value from memory address to SDATA, |
| 814 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 815 | Operation:<br /> |
| 816 | <code>UINT64* VM = (UINT64*)((SMEM + (OFFSET & ~3)) |
| 817 | UINT64 P = *VM; *VM = MIN(*VM, SDATA); SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 818 | <h4>S_ATOMIC_XOR</h4> |
| 819 | <p>Opcode: 138 (0x8a) only for GCN 1.4<br /> |
| 820 | Syntax: S_ATOMIC_XOR SDATA, SBASE(2), OFFSET<br /> |
| 821 | Description: Do bitwise XOR on SDATA and value from memory address, |
| 822 | and store result to memory address. |
| 823 | If GLC flag is set then return previous value from memory address to SDATA, |
| 824 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 825 | Operation:<br /> |
| 826 | <code>UINT32* VM = (UINT32*)((SMEM + (OFFSET & ~3)) |
| 827 | UINT32 P = *VM; *VM = *VM ^ SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p> |
| 828 | <h4>S_ATOMIC_XOR_X2</h4> |
| 829 | <p>Opcode: 170 (0xaa) only for GCN 1.4<br /> |
| 830 | Syntax: S_ATOMIC_XOR_X2 SDATA(2), SBASE(2), OFFSET<br /> |
| 831 | Description: Do bitwise XOR on 64-bit SDATA and 64-bit value from memory address, |
| 832 | and store result to memory address. |
| 833 | If GLC flag is set then return previous value from memory address to SDATA, |
| 834 | otherwise keep SDATA value. Operation is atomic.<br /> |
| 835 | Operation:<br /> |
| 836 | <code>UINT64* VM = (UINT64*)((SMEM + (OFFSET & ~3)) |
| 837 | UINT64 P = *VM; *VM = *VM ^ SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p> |