Changes between Version 3 and Version 4 of GcnInstrsFlat
- Timestamp:
- 05/03/16 00:00:24 (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GcnInstrsFlat
v3 v4 471 471 <p>Alphabetically sorted instruction list:</p> 472 472 <h4>FLAT_ATOMIC_ADD</h4> 473 <p>Opcode: 50 (0x32) for GCN 1. 0/1.1; 66 (0x42) for GCN 1.2<br />473 <p>Opcode: 50 (0x32) for GCN 1.1; 66 (0x42) for GCN 1.2<br /> 474 474 Syntax: FLAT_ATOMIC_ADD VDST, VADDR(2), VDATA<br /> 475 475 Description: Add VDATA to value of VADDR address, and store result to this address. … … 480 480 UINT32 P = *VM; *VM = *VM + VDATA; VDST = (GLC) ? P : VDST // atomic</code></p> 481 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 />482 <p>Opcode: 82 (0x52) for GCN 1.1; 98 (0x62) for GCN 1.2<br /> 483 483 Syntax: FLAT_ATOMIC_ADD_X2 VDST(2), VADDR(2), VDATA(2)<br /> 484 484 Description: Add 64-bit VDATA to 64-bit value of VADDR address, and store result … … 489 489 UINT64 P = *VM; *VM = *VM + VDATA; VDST = (GLC) ? P : VDST // atomic</code></p> 490 490 <h4>FLAT_ATOMIC_AND</h4> 491 <p>Opcode: 57 (0x39) for GCN 1. 0/1.1; 72 (0x48) for GCN 1.2<br />491 <p>Opcode: 57 (0x39) for GCN 1.1; 72 (0x48) for GCN 1.2<br /> 492 492 Syntax: FLAT_ATOMIC_AND VDST, VADDR(2), VDATA<br /> 493 493 Description: Do bitwise AND on VDATA and value of VADDR address, … … 498 498 UINT32 P = *VM; *VM = *VM & VDATA; VDST = (GLC) ? P : VDST // atomic</code></p> 499 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 />500 <p>Opcode: 89 (0x59) for GCN 1.1; 104 (0x68) for GCN 1.2<br /> 501 501 Syntax: FLAT_ATOMIC_AND_X2 VDST(2), VADDR(2), VDATA(2)<br /> 502 502 Description: Do 64-bit bitwise AND on VDATA and value of VADDR address, … … 507 507 UINT64 P = *VM; *VM = *VM & VDATA; VDST = (GLC) ? P : VDST // atomic</code></p> 508 508 <h4>FLAT_ATOMIC_CMPSWAP</h4> 509 <p>Opcode: 49 (0x31) for GCN 1. 0/1.1; 65 (0x41) for GCN 1.2<br />509 <p>Opcode: 49 (0x31) for GCN 1.1; 65 (0x41) for GCN 1.2<br /> 510 510 Syntax: FLAT_ATOMIC_CMPSWAP VDST, VADDR(2), VDATA(2)<br /> 511 511 Description: Store lower VDATA dword into VADDR address if previous value … … 518 518 VDST = (GLC) ? P : VDST // last part of atomic</code></p> 519 519 <h4>FLAT_ATOMIC_CMPSWAP_X2</h4> 520 <p>Opcode: 81 (0x51) for GCN 1. 0/1.1; 97 (0x61) for GCN 1.2<br />520 <p>Opcode: 81 (0x51) for GCN 1.1; 97 (0x61) for GCN 1.2<br /> 521 521 Syntax: FLAT_ATOMIC_CMPSWAP_X2 VDST(2), VADDR(2), VDATA(4)<br /> 522 522 Description: Store lower VDATA 64-bit word into VADDR address if previous value … … 528 528 UINT64 P = *VM; *VM = *VM==(VDATA[2:3]) ? VDATA[0:1] : *VM // part of atomic 529 529 VDST = (GLC) ? P : VDST // last part of atomic</code></p> 530 <h4>FLAT_ATOMIC_DEC</h4> 531 <p>Opcode: 61 (0x3d) for GCN 1.1; 76 (0x4c) for GCN 1.2<br /> 532 Syntax: FLAT_ATOMIC_DEC VDST, VADDR(2), VDATA<br /> 533 Description: Compare value from VADDR address and if less or equal than VDATA 534 and this value is not zero, then decrement value from VADDR address, 535 otherwise store VDATA to this address. If GLC flag is set then return previous value 536 from this address to VDST, otherwise keep VDST value. Operation is atomic.<br /> 537 Operation:<br /> 538 <code>UINT32* VM = (UINT32*)VADDR 539 UINT32 P = *VM; *VM = (*VM <= VDATA && *VM!=0) ? *VM-1 : VDATA // atomic 540 VDST = (GLC) ? P : VDST // atomic</code></p> 541 <h4>FLAT_ATOMIC_DEC_X2</h4> 542 <p>Opcode: 93 (0x5d) for GCN 1.1; 108 (0x6c) for GCN 1.2<br /> 543 Syntax: FLAT_ATOMIC_DEC_X2 VDST(2), VADDR(2), VDATA(2)<br /> 544 Description: Compare 64-bit value from VADDR address and if less or equal than VDATA 545 and this value is not zero, then decrement value from VADDR address, 546 otherwise store VDATA to this address. If GLC flag is set then return previous value 547 from this address to VDST, otherwise keep VDST value. Operation is atomic.<br /> 548 Operation:<br /> 549 <code>UINT64* VM = (UINT64*)VADDR 550 UINT64 P = *VM; *VM = (*VM <= VDATA && *VM!=0) ? *VM-1 : VDATA // atomic 551 VDST = (GLC) ? P : VDST // atomic</code></p> 552 <h4>BUFFER_ATOMIC_FCMPSWAP</h4> 553 <p>Opcode: 62 (0x3e) for GCN 1.1<br /> 554 Syntax: FLAT_ATOMIC_FCMPSWAP VDST, VADDR(1:2), VDATA(2)<br /> 555 Description: Store lower VDATA dword into VADDR address if previous single floating point 556 value from address is equal singe floating point value VDATA>>32, 557 otherwise keep old value from VADDR address. 558 If GLC flag is set then return previous value from this address to VDST, 559 otherwise keep VDST value. Operation is atomic.<br /> 560 Operation:<br /> 561 <code>FLOAT* VM = (FLOAT*)VADDR 562 FLOAT P = *VM; *VM = *VM==ASFLOAT(VDATA>>32) ? VDATA&0xffffffff : *VM // part of atomic 563 VDST[0] = (GLC) ? P : VDST // last part of atomic</code></p> 564 <h4>FLAT_ATOMIC_FCMPSWAP_X2</h4> 565 <p>Opcode: 94 (0x5e) for GCN 1.1<br /> 566 Syntax: FLAT_ATOMIC_FCMPSWAP_X2 VDATA(2), VADDR(2), SRSRC(4), SOFFSET<br /> 567 Description: Store lower VDATA 64-bit word into VADDR address if previous double 568 floating point value from address is equal singe floating point value VDATA>>32, 569 otherwise keep old value from VADDR address. 570 If GLC flag is set then return previous value from address to VDST, otherwise keep 571 VDST value. Operation is atomic.<br /> 572 Operation:<br /> 573 <code>DOUBLE* VM = (DOUBLE*)VMADDR 574 DOUBLE P = *VM; *VM = *VM==ASDOUBLE(VDATA[2:3]) ? VDATA[0:1] : *VM // part of atomic 575 VDST = (GLC) ? P : VDST // last part of atomic</code></p> 576 <h4>FLAT_ATOMIC_FMAX</h4> 577 <p>Opcode: 64 (0x40) for GCN 1.1<br /> 578 Syntax: FLAT_ATOMIC_FMAX VDST, VADDR(2), VDATA<br /> 579 Description: Choose greatest single floating point value from VDATA and from 580 VADDR address, and store result to this address. 581 If GLC flag is set then return previous value from address to VDST, otherwise keep 582 VDST value. Operation is atomic.<br /> 583 Operation:<br /> 584 <code>FLOAT* VM = (FLOAT*)VADDR 585 UINT32 P = *VM; *VM = MAX(*VM, ASFLOAT(VDATA)); VDST = (GLC) ? P : VDST // atomic</code></p> 586 <h4>BUFFER_ATOMIC_FMAX_X2</h4> 587 <p>Opcode: 96 (0x60) for GCN 1.1<br /> 588 Syntax: FLAT_ATOMIC_FMAX_X2 VDST(2), VADDR(2), VDATA(2)<br /> 589 Description: Choose greatest double floating point value from VDATA and from 590 VADDR address, and store result to this address. 591 If GLC flag is set then return previous value from address to VDST, 592 otherwise keep VDST value. Operation is atomic.<br /> 593 Operation:<br /> 594 <code>DOUBLE* VM = (DOUBLE*)VADDR 595 UINT64 P = *VM; *VM = MAX(*VM, ASDOUBLE(VDATA)); VDST = (GLC) ? P : VDST // atomic</code></p> 596 <h4>FLAT_ATOMIC_FMIN</h4> 597 <p>Opcode: 63 (0x3f) for GCN 1.1<br /> 598 Syntax: FLAT_ATOMIC_FMIN VDST, VADDR(2), VDATA<br /> 599 Description: Choose smallest single floating point value from VDATA and from 600 VADDR address, and store result to this address. 601 If GLC flag is set then return previous value from address to VDST, otherwise keep 602 VDST value. Operation is atomic.<br /> 603 Operation:<br /> 604 <code>FLOAT* VM = (FLOAT*)VADDR 605 UINT32 P = *VM; *VM = MIN(*VM, ASFLOAT(VDATA)); VDST = (GLC) ? P : VDST // atomic</code></p> 606 <h4>BUFFER_ATOMIC_FMIN_X2</h4> 607 <p>Opcode: 95 (0x5f) for GCN 1.1<br /> 608 Syntax: FLAT_ATOMIC_FMIN_X2 VDST(2), VADDR(2), VDATA(2)<br /> 609 Description: Choose smallest double floating point value from VDATA and from 610 VADDR address, and store result to this address. 611 If GLC flag is set then return previous value from address to VDST, 612 otherwise keep VDST value. Operation is atomic.<br /> 613 Operation:<br /> 614 <code>DOUBLE* VM = (DOUBLE*)VADDR 615 UINT64 P = *VM; *VM = MIN(*VM, ASDOUBLE(VDATA)); VDST = (GLC) ? P : VDST // atomic</code></p> 616 <h4>FLAT_ATOMIC_INC</h4> 617 <p>Opcode: 60 (0x3c) for GCN 1.1; 75 (0x4b) for GCN 1.2<br /> 618 Syntax: FLT_ATOMIC_INC VDST, VADDR(2), VDATA<br /> 619 Description: Compare value from VADDR address and if less than VDATA, 620 then increment value from address, otherwise store zero to address. 621 If GLC flag is set then return previous value from this address to VDST, 622 otherwise keep VDST value. Operation is atomic.<br /> 623 Operation:<br /> 624 <code>UINT32* VM = (UINT32*)VADDR 625 UINT32 P = *VM; *VM = (*VM < VDATA) ? *VM+1 : 0; VDST = (GLC) ? P : VDST // atomic</code></p> 626 <h4>FLAT_ATOMIC_INC_X2</h4> 627 <p>Opcode: 92 (0x5c) for GCN 1.1; 107 (0x9b) for GCN 1.2<br /> 628 Syntax: FLAT_ATOMIC_INC_X2 VDST(2), VADDR(2), VADDR(2)<br /> 629 Description: Compare 64-bit value from VADDR address and if less than VDATA, 630 then increment value from address, otherwise store zero to address. 631 If GLC flag is set then return previous value from this address to VDST, 632 otherwise keep VDST value. Operation is atomic.<br /> 633 Operation:<br /> 634 <code>UINT64* VM = (UINT64*)VADDR 635 UINT64 P = *VM; *VM = (*VM < VDATA) ? *VM+1 : 0; VDST = (GLC) ? P : VDST // atomic</code></p> 530 636 <h4>FLAT_ATOMIC_OR</h4> 531 <p>Opcode: 58 (0x3a) for GCN 1. 0/1.1; 73 (0x49) for GCN 1.2<br />637 <p>Opcode: 58 (0x3a) for GCN 1.1; 73 (0x49) for GCN 1.2<br /> 532 638 Syntax: FLAT_ATOMIC_OR VDST, VADDR(2), VDATA<br /> 533 639 Description: Do bitwise OR on VDATA and value of VADDR address, … … 538 644 UINT32 P = *VM; *VM = *VM | VDATA; VDST = (GLC) ? P : VDST // atomic</code></p> 539 645 <h4>FLAT_ATOMIC_OR_X2</h4> 540 <p>Opcode: 90 (0x5a) for GCN 1. 0/1.1; 105 (0x69) for GCN 1.2<br />646 <p>Opcode: 90 (0x5a) for GCN 1.1; 105 (0x69) for GCN 1.2<br /> 541 647 Syntax: FLAT_ATOMIC_OR_X2 VDST(2), VADDR(2), VDATA(2)<br /> 542 648 Description: Do 64-bit bitwise OR on VDATA and value of VADDR address, … … 547 653 UINT64 P = *VM; *VM = *VM | VDATA; VDST = (GLC) ? P : VDST // atomic</code></p> 548 654 <h4>FLAT_ATOMIC_SMAX</h4> 549 <p>Opcode: 55 (0x37) for GCN 1. 0/1.1; 70 (0x46) for GCN 1.2<br />655 <p>Opcode: 55 (0x37) for GCN 1.1; 70 (0x46) for GCN 1.2<br /> 550 656 Syntax: FLAT_ATOMIC_SMAX VDST, VADDR(2), VDATA<br /> 551 657 Description: Choose greatest signed 32-bit value from VDATA and from VADDR address, … … 557 663 UINT32 P = *VM; *VM = MAX(*VM, (INT32)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p> 558 664 <h4>FLAT_ATOMIC_SMAX_X2</h4> 559 <p>Opcode: 87 (0x57) for GCN 1. 0/1.1; 102 (0x66) for GCN 1.2<br />665 <p>Opcode: 87 (0x57) for GCN 1.1; 102 (0x66) for GCN 1.2<br /> 560 666 Syntax: FLAT_ATOMIC_SMAX_X2 VDST(2), VADDR(2), VDATA(2)<br /> 561 667 Description: Choose greatest signed 64-bit value from VDATA and from VADDR address, … … 567 673 UINT64 P = *VM; *VM = MAX(*VM, (INT64)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p> 568 674 <h4>FLAT_ATOMIC_SMIN</h4> 569 <p>Opcode: 53 (0x35) for GCN 1. 0/1.1; 68 (0x44) for GCN 1.2<br />675 <p>Opcode: 53 (0x35) for GCN 1.1; 68 (0x44) for GCN 1.2<br /> 570 676 Syntax: FLAT_ATOMIC_SMIN VDST, VADDR(2), VDATA<br /> 571 677 Description: Choose smallest signed 32-bit value from VDATA and from VADDR address, … … 577 683 UINT32 P = *VM; *VM = MIN(*VM, (INT32)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p> 578 684 <h4>FLAT_ATOMIC_SMIN_X2</h4> 579 <p>Opcode: 85 (0x55) for GCN 1. 0/1.1; 100 (0x64) for GCN 1.2<br />685 <p>Opcode: 85 (0x55) for GCN 1.1; 100 (0x64) for GCN 1.2<br /> 580 686 Syntax: FLAT_ATOMIC_SMIN_X2 VDST(2), VADDR(2), VDATA(2)<br /> 581 687 Description: Choose smallest signed 64-bit value from VDATA and from VADDR address, … … 587 693 UINT64 P = *VM; *VM = MIN(*VM, (INT64)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p> 588 694 <h4>FLAT_ATOMIC_SUB</h4> 589 <p>Opcode: 51 (0x33) for GCN 1. 0/1.1; 67 (0x43) for GCN 1.2<br />695 <p>Opcode: 51 (0x33) for GCN 1.1; 67 (0x43) for GCN 1.2<br /> 590 696 Syntax: FLAT_ATOMIC_SUB VDST, VADDR(2), VDATA<br /> 591 697 Description: Subtract VDATA from value of VADDR address, and store result to this address. … … 596 702 UINT32 P = *VM; *VM = *VM - VDATA; VDST = (GLC) ? P : VDST // atomic</code></p> 597 703 <h4>FLAT_ATOMIC_SUB_X2</h4> 598 <p>Opcode: 83 (0x53) for GCN 1. 0/1.1; 99 (0x63) for GCN 1.2<br />704 <p>Opcode: 83 (0x53) for GCN 1.1; 99 (0x63) for GCN 1.2<br /> 599 705 Syntax: FLAT_ATOMIC_SUB_X2 VDST(2), VADDR(2), VDATA(2)<br /> 600 706 Description: Subtract 64-bit VDATA from 64-bit value of VADDR address, and store result … … 605 711 UINT64 P = *VM; *VM = *VM - VDATA; VDST = (GLC) ? P : VDST // atomic</code></p> 606 712 <h4>FLAT_ATOMIC_SWAP</h4> 607 <p>Opcode: 48 (0x30) for GCN 1. 0/1.1; 64 (0x40) for GCN 1.2<br />713 <p>Opcode: 48 (0x30) for GCN 1.1; 64 (0x40) for GCN 1.2<br /> 608 714 Syntax: FLAT_ATOMIC_SWAP VDST, VADDR(2), VDATA 609 715 Description: Store VDATA dword into VADDR address. If GLC flag is set then … … 614 720 UINT32 P = *VM; *VM = VDATA; VDST = (GLC) ? P : VDST // atomic</code></p> 615 721 <h4>FLAT_ATOMIC_SWAP_X2</h4> 616 <p>Opcode: 80 (0x50) for GCN 1. 0/1.1; 96 (0x60) for GCN 1.2<br />722 <p>Opcode: 80 (0x50) for GCN 1.1; 96 (0x60) for GCN 1.2<br /> 617 723 Syntax: FLAT_ATOMIC_SWAP_X2 VDST(2), VADDR(2), VDATA(2) 618 724 Description: Store VDATA 64-bit word into VADDR address. If GLC flag is set then … … 623 729 UINT64 P = *VM; *VM = VDATA; VDST = (GLC) ? P : VDST // atomic</code></p> 624 730 <h4>FLAT_ATOMIC_UMAX</h4> 625 <p>Opcode: 56 (0x38) for GCN 1. 0/1.1; 71 (0x47) for GCN 1.2<br />731 <p>Opcode: 56 (0x38) for GCN 1.1; 71 (0x47) for GCN 1.2<br /> 626 732 Syntax: FLAT_ATOMIC_UMAX VDST, VADDR(2), VDATA<br /> 627 733 Description: Choose greatest unsigned 32-bit value from VDATA and from VADDR address, … … 633 739 UINT32 P = *VM; *VM = MAX(*VM, (UINT32)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p> 634 740 <h4>FLAT_ATOMIC_UMAX_X2</h4> 635 <p>Opcode: 88 (0x58) for GCN 1. 0/1.1; 103 (0x67) for GCN 1.2<br />741 <p>Opcode: 88 (0x58) for GCN 1.1; 103 (0x67) for GCN 1.2<br /> 636 742 Syntax: FLAT_ATOMIC_UMAX_X2 VDST(2), VADDR(2), VDATA(2)<br /> 637 743 Description: Choose greatest unsigned 64-bit value from VDATA and from VADDR address, … … 643 749 UINT64 P = *VM; *VM = MAX(*VM, (UINT64)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p> 644 750 <h4>FLAT_ATOMIC_UMIN</h4> 645 <p>Opcode: 54 (0x36) for GCN 1. 0/1.1; 69 (0x45) for GCN 1.2<br />751 <p>Opcode: 54 (0x36) for GCN 1.1; 69 (0x45) for GCN 1.2<br /> 646 752 Syntax: FLAT_ATOMIC_UMIN VDST, VADDR(2), VDATA<br /> 647 753 Description: Choose smallest unsigned 32-bit value from VDATA and from VADDR address, … … 653 759 UINT32 P = *VM; *VM = MIN(*VM, (UINT32)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p> 654 760 <h4>FLAT_ATOMIC_UMIN_X2</h4> 655 <p>Opcode: 86 (0x56) for GCN 1. 0/1.1; 101 (0x65) for GCN 1.2<br />761 <p>Opcode: 86 (0x56) for GCN 1.1; 101 (0x65) for GCN 1.2<br /> 656 762 Syntax: FLAT_ATOMIC_UMIN_X2 VDST(2), VADDR(2), VDATA(2)<br /> 657 763 Description: Choose smallest unsigned 64-bit value from VDATA and from VADDR address, … … 663 769 UINT64 P = *VM; *VM = MIN(*VM, (UINT64)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p> 664 770 <h4>FLAT_ATOMIC_XOR</h4> 665 <p>Opcode: 59 (0x3b) for GCN 1. 0/1.1; 73 (0x4a) for GCN 1.2<br />771 <p>Opcode: 59 (0x3b) for GCN 1.1; 73 (0x4a) for GCN 1.2<br /> 666 772 Syntax: FLAT_ATOMIC_XOR VDST, VADDR(2), VDATA<br /> 667 773 Description: Do bitwise XOR on VDATA and value of VADDR address, … … 672 778 UINT32 P = *VM; *VM = *VM ^ VDATA; VDST = (GLC) ? P : VDST // atomic</code></p> 673 779 <h4>FLAT_ATOMIC_XOR_X2</h4> 674 <p>Opcode: 91 (0x5b) for GCN 1. 0/1.1; 106 (0x6a) for GCN 1.2<br />780 <p>Opcode: 91 (0x5b) for GCN 1.1; 106 (0x6a) for GCN 1.2<br /> 675 781 Syntax: FLAT_ATOMIC_XOR_X2 VDST(2), VADDR(2), VDATA(2)<br /> 676 782 Description: Do 64-bit bitwise XOR on VDATA and value of VADDR address, … … 762 868 <p>Opcode: 30 (0x1e) for GCN 1.1; 31 (0x1d) for GCN 1.2<br /> 763 869 Syntax: FLAT_STORE_DWORDX4 VADDR(2), VDATA(4)<br /> 764 Description: Store threedwords from VDATA to VADDR address.<br />870 Description: Store four dwords from VDATA to VADDR address.<br /> 765 871 Operation:<br /> 766 872 <code>*(UINT32*)(VADDR) = VDATA[0]