472 | | <h4>BUFFER_ATOMIC_CMPSWAP</h4> |
| 472 | <h4>FLAT_ATOMIC_ADD</h4> |
| 473 | <p>Opcode: 50 (0x32) for GCN 1.0/1.1; 66 (0x42) for GCN 1.2<br /> |
| 474 | Syntax: FLAT_ATOMIC_ADD VDST, VADDR(2), VDATA<br /> |
| 475 | Description: Add VDATA to value of VADDR address, and store result to this address. |
| 476 | If GLC flag is set then return previous value from this address to VDST, |
| 477 | otherwise keep VDST value. Operation is atomic.<br /> |
| 478 | Operation:<br /> |
| 479 | <code>UINT32* VM = (UINT32*)VADDR |
| 480 | UINT32 P = *VM; *VM = *VM + VDATA; VDST = (GLC) ? P : VDST // atomic</code></p> |
| 481 | <h4>FLAT_ATOMIC_ADD_X2</h4> |
| 482 | <p>Opcode: 82 (0x52) for GCN 1.0/1.1; 98 (0x62) for GCN 1.2<br /> |
| 483 | Syntax: FLAT_ATOMIC_ADD_X2 VDST(2), VADDR(2), VDATA(2)<br /> |
| 484 | Description: Add 64-bit VDATA to 64-bit value of VADDR address, and store result |
| 485 | to this address. If GLC flag is set then return previous value from resource to VDST, |
| 486 | otherwise keep VDST value. Operation is atomic.<br /> |
| 487 | Operation:<br /> |
| 488 | <code>UINT64* VM = (UINT64*)VADDR |
| 489 | UINT64 P = *VM; *VM = *VM + VDATA; VDST = (GLC) ? P : VDST // atomic</code></p> |
| 490 | <h4>FLAT_ATOMIC_AND</h4> |
| 491 | <p>Opcode: 57 (0x39) for GCN 1.0/1.1; 72 (0x48) for GCN 1.2<br /> |
| 492 | Syntax: FLAT_ATOMIC_AND VDST, VADDR(2), VDATA<br /> |
| 493 | Description: Do bitwise AND on VDATA and value of VADDR address, |
| 494 | and store result to this address. If GLC flag is set then return previous value |
| 495 | from this address to VDST, otherwise keep VDST value. Operation is atomic.<br /> |
| 496 | Operation:<br /> |
| 497 | <code>UINT32* VM = (UINT32*)VADDR |
| 498 | UINT32 P = *VM; *VM = *VM & VDATA; VDST = (GLC) ? P : VDST // atomic</code></p> |
| 499 | <h4>FLAT_ATOMIC_AND_X2</h4> |
| 500 | <p>Opcode: 89 (0x59) for GCN 1.0/1.1; 104 (0x68) for GCN 1.2<br /> |
| 501 | Syntax: FLAT_ATOMIC_AND_X2 VDST(2), VADDR(2), VDATA(2)<br /> |
| 502 | Description: Do 64-bit bitwise AND on VDATA and value of VADDR address, |
| 503 | and store result to this address. If GLC flag is set then return previous value |
| 504 | from this address to VDST, otherwise keep VDST value. Operation is atomic.<br /> |
| 505 | Operation:<br /> |
| 506 | <code>UINT64* VM = (UINT64*)VADDR |
| 507 | UINT64 P = *VM; *VM = *VM & VDATA; VDST = (GLC) ? P : VDST // atomic</code></p> |
| 508 | <h4>FLAT_ATOMIC_CMPSWAP</h4> |
| 530 | <h4>FLAT_ATOMIC_OR</h4> |
| 531 | <p>Opcode: 58 (0x3a) for GCN 1.0/1.1; 73 (0x49) for GCN 1.2<br /> |
| 532 | Syntax: FLAT_ATOMIC_OR VDST, VADDR(2), VDATA<br /> |
| 533 | Description: Do bitwise OR on VDATA and value of VADDR address, |
| 534 | and store result to this address. If GLC flag is set then return previous value |
| 535 | from this address to VDST, otherwise keep VDST value. Operation is atomic.<br /> |
| 536 | Operation:<br /> |
| 537 | <code>UINT32* VM = (UINT32*)VADDR |
| 538 | UINT32 P = *VM; *VM = *VM | VDATA; VDST = (GLC) ? P : VDST // atomic</code></p> |
| 539 | <h4>FLAT_ATOMIC_OR_X2</h4> |
| 540 | <p>Opcode: 90 (0x5a) for GCN 1.0/1.1; 105 (0x69) for GCN 1.2<br /> |
| 541 | Syntax: FLAT_ATOMIC_OR_X2 VDST(2), VADDR(2), VDATA(2)<br /> |
| 542 | Description: Do 64-bit bitwise OR on VDATA and value of VADDR address, |
| 543 | and store result to this address. If GLC flag is set then return previous value |
| 544 | from this address to VDST, otherwise keep VDST value. Operation is atomic.<br /> |
| 545 | Operation:<br /> |
| 546 | <code>UINT64* VM = (UINT64*)VADDR |
| 547 | UINT64 P = *VM; *VM = *VM | VDATA; VDST = (GLC) ? P : VDST // atomic</code></p> |
| 548 | <h4>FLAT_ATOMIC_SMAX</h4> |
| 549 | <p>Opcode: 55 (0x37) for GCN 1.0/1.1; 70 (0x46) for GCN 1.2<br /> |
| 550 | Syntax: FLAT_ATOMIC_SMAX VDST, VADDR(2), VDATA<br /> |
| 551 | Description: Choose greatest signed 32-bit value from VDATA and from VADDR address, |
| 552 | and store result to this address. |
| 553 | If GLC flag is set then return previous value from this address to VDST, otherwise keep |
| 554 | VDST value. Operation is atomic.<br /> |
| 555 | Operation:<br /> |
| 556 | <code>INT32* VM = (INT32*)VADDR |
| 557 | UINT32 P = *VM; *VM = MAX(*VM, (INT32)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p> |
| 558 | <h4>FLAT_ATOMIC_SMAX_X2</h4> |
| 559 | <p>Opcode: 87 (0x57) for GCN 1.0/1.1; 102 (0x66) for GCN 1.2<br /> |
| 560 | Syntax: FLAT_ATOMIC_SMAX_X2 VDST(2), VADDR(2), VDATA(2)<br /> |
| 561 | Description: Choose greatest signed 64-bit value from VDATA and from VADDR address, |
| 562 | and store result to this address. |
| 563 | If GLC flag is set then return previous value from this address to VDST, otherwise keep |
| 564 | VDST value. Operation is atomic.<br /> |
| 565 | Operation:<br /> |
| 566 | <code>INT64* VM = (INT64*)VADDR |
| 567 | UINT64 P = *VM; *VM = MAX(*VM, (INT64)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p> |
| 568 | <h4>FLAT_ATOMIC_SMIN</h4> |
| 569 | <p>Opcode: 53 (0x35) for GCN 1.0/1.1; 68 (0x44) for GCN 1.2<br /> |
| 570 | Syntax: FLAT_ATOMIC_SMIN VDST, VADDR(2), VDATA<br /> |
| 571 | Description: Choose smallest signed 32-bit value from VDATA and from VADDR address, |
| 572 | and store result to this address. |
| 573 | If GLC flag is set then return previous value from this address to VDST, otherwise keep |
| 574 | VDST value. Operation is atomic.<br /> |
| 575 | Operation:<br /> |
| 576 | <code>INT32* VM = (INT32*)VADDR |
| 577 | UINT32 P = *VM; *VM = MIN(*VM, (INT32)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p> |
| 578 | <h4>FLAT_ATOMIC_SMIN_X2</h4> |
| 579 | <p>Opcode: 85 (0x55) for GCN 1.0/1.1; 100 (0x64) for GCN 1.2<br /> |
| 580 | Syntax: FLAT_ATOMIC_SMIN_X2 VDST(2), VADDR(2), VDATA(2)<br /> |
| 581 | Description: Choose smallest signed 64-bit value from VDATA and from VADDR address, |
| 582 | and store result to this address. |
| 583 | If GLC flag is set then return previous value from this address to VDST, otherwise keep |
| 584 | VDST value. Operation is atomic.<br /> |
| 585 | Operation:<br /> |
| 586 | <code>INT64* VM = (INT64*)VADDR |
| 587 | UINT64 P = *VM; *VM = MIN(*VM, (INT64)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p> |
| 588 | <h4>FLAT_ATOMIC_SUB</h4> |
| 589 | <p>Opcode: 51 (0x33) for GCN 1.0/1.1; 67 (0x43) for GCN 1.2<br /> |
| 590 | Syntax: FLAT_ATOMIC_SUB VDST, VADDR(2), VDATA<br /> |
| 591 | Description: Subtract VDATA from value of VADDR address, and store result to this address. |
| 592 | If GLC flag is set then return previous value from this address to VDST, |
| 593 | otherwise keep VDST value. Operation is atomic.<br /> |
| 594 | Operation:<br /> |
| 595 | <code>UINT32* VM = (UINT32*)VADDR |
| 596 | UINT32 P = *VM; *VM = *VM - VDATA; VDST = (GLC) ? P : VDST // atomic</code></p> |
| 597 | <h4>FLAT_ATOMIC_SUB_X2</h4> |
| 598 | <p>Opcode: 83 (0x53) for GCN 1.0/1.1; 99 (0x63) for GCN 1.2<br /> |
| 599 | Syntax: FLAT_ATOMIC_SUB_X2 VDST(2), VADDR(2), VDATA(2)<br /> |
| 600 | Description: Subtract 64-bit VDATA from 64-bit value of VADDR address, and store result |
| 601 | to this address. If GLC flag is set then return previous value from resource to VDST, |
| 602 | otherwise keep VDST value. Operation is atomic.<br /> |
| 603 | Operation:<br /> |
| 604 | <code>UINT64* VM = (UINT64*)VADDR |
| 605 | UINT64 P = *VM; *VM = *VM - VDATA; VDST = (GLC) ? P : VDST // atomic</code></p> |
| 624 | <h4>FLAT_ATOMIC_UMAX</h4> |
| 625 | <p>Opcode: 56 (0x38) for GCN 1.0/1.1; 71 (0x47) for GCN 1.2<br /> |
| 626 | Syntax: FLAT_ATOMIC_UMAX VDST, VADDR(2), VDATA<br /> |
| 627 | Description: Choose greatest unsigned 32-bit value from VDATA and from VADDR address, |
| 628 | and store result to this address. |
| 629 | If GLC flag is set then return previous value from this address to VDST, otherwise keep |
| 630 | VDST value. Operation is atomic.<br /> |
| 631 | Operation:<br /> |
| 632 | <code>UINT32* VM = (UINT32*)VADDR |
| 633 | UINT32 P = *VM; *VM = MAX(*VM, (UINT32)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p> |
| 634 | <h4>FLAT_ATOMIC_UMAX_X2</h4> |
| 635 | <p>Opcode: 88 (0x58) for GCN 1.0/1.1; 103 (0x67) for GCN 1.2<br /> |
| 636 | Syntax: FLAT_ATOMIC_UMAX_X2 VDST(2), VADDR(2), VDATA(2)<br /> |
| 637 | Description: Choose greatest unsigned 64-bit value from VDATA and from VADDR address, |
| 638 | and store result to this address. |
| 639 | If GLC flag is set then return previous value from this address to VDST, otherwise keep |
| 640 | VDST value. Operation is atomic.<br /> |
| 641 | Operation:<br /> |
| 642 | <code>UINT64* VM = (UINT64*)VADDR |
| 643 | UINT64 P = *VM; *VM = MAX(*VM, (UINT64)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p> |
| 644 | <h4>FLAT_ATOMIC_UMIN</h4> |
| 645 | <p>Opcode: 54 (0x36) for GCN 1.0/1.1; 69 (0x45) for GCN 1.2<br /> |
| 646 | Syntax: FLAT_ATOMIC_UMIN VDST, VADDR(2), VDATA<br /> |
| 647 | Description: Choose smallest unsigned 32-bit value from VDATA and from VADDR address, |
| 648 | and store result to this address. |
| 649 | If GLC flag is set then return previous value from this address to VDST, otherwise keep |
| 650 | VDST value. Operation is atomic.<br /> |
| 651 | Operation:<br /> |
| 652 | <code>UINT32* VM = (UINT32*)VADDR |
| 653 | UINT32 P = *VM; *VM = MIN(*VM, (UINT32)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p> |
| 654 | <h4>FLAT_ATOMIC_UMIN_X2</h4> |
| 655 | <p>Opcode: 86 (0x56) for GCN 1.0/1.1; 101 (0x65) for GCN 1.2<br /> |
| 656 | Syntax: FLAT_ATOMIC_UMIN_X2 VDST(2), VADDR(2), VDATA(2)<br /> |
| 657 | Description: Choose smallest unsigned 64-bit value from VDATA and from VADDR address, |
| 658 | and store result to this address. |
| 659 | If GLC flag is set then return previous value from this address to VDST, otherwise keep |
| 660 | VDST value. Operation is atomic.<br /> |
| 661 | Operation:<br /> |
| 662 | <code>UINT64* VM = (UINT64*)VADDR |
| 663 | UINT64 P = *VM; *VM = MIN(*VM, (UINT64)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p> |
| 664 | <h4>FLAT_ATOMIC_XOR</h4> |
| 665 | <p>Opcode: 59 (0x3b) for GCN 1.0/1.1; 73 (0x4a) for GCN 1.2<br /> |
| 666 | Syntax: FLAT_ATOMIC_XOR VDST, VADDR(2), VDATA<br /> |
| 667 | Description: Do bitwise XOR on VDATA and value of VADDR address, |
| 668 | and store result to this address. If GLC flag is set then return previous value |
| 669 | from this address to VDST, otherwise keep VDST value. Operation is atomic.<br /> |
| 670 | Operation:<br /> |
| 671 | <code>UINT32* VM = (UINT32*)VADDR |
| 672 | UINT32 P = *VM; *VM = *VM ^ VDATA; VDST = (GLC) ? P : VDST // atomic</code></p> |
| 673 | <h4>FLAT_ATOMIC_XOR_X2</h4> |
| 674 | <p>Opcode: 91 (0x5b) for GCN 1.0/1.1; 106 (0x6a) for GCN 1.2<br /> |
| 675 | Syntax: FLAT_ATOMIC_XOR_X2 VDST(2), VADDR(2), VDATA(2)<br /> |
| 676 | Description: Do 64-bit bitwise XOR on VDATA and value of VADDR address, |
| 677 | and store result to this address. If GLC flag is set then return previous value |
| 678 | from this address to VDST, otherwise keep VDST value. Operation is atomic.<br /> |
| 679 | Operation:<br /> |
| 680 | <code>UINT64* VM = (UINT64*)VADDR |
| 681 | UINT64 P = *VM; *VM = *VM ^ VDATA; VDST = (GLC) ? P : VDST // atomic</code></p> |