Changes between Version 9 and Version 10 of GcnInstrsSmem


Ignore:
Timestamp:
11/24/17 19:00:31 (6 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GcnInstrsSmem

    v9 v10  
    7575<li>IMM=0 - OFFSET holds number of SGPR that holds byte offset to SBASE.</li>
    7676</ul>
    77 <p>For S_LOAD_DWORD* instructions, 2 SBASE SGPRs holds an base 48-bit address and a
    78 16-bit size. For S_BUFFER_LOAD_DWORD* instructions, 4 SBASE SGPRs holds a
     77<p>For S_LOAD_DWORD* instructions, 2 SBASE SGPRs holds an base 64-bit address.
     78For S_BUFFER_LOAD_DWORD* instructions, 4 SBASE SGPRs holds a
    7979buffer descriptor. In this case, SBASE must be a multipla of 2.
    8080S_STORE_* and S_BUFFER_STORE_* accepts only M0 as offset register for GCN 1.2.
     
    709709INT32 P = *VM; *VM = MAX(*VM, (INT32)SDATA); SDATA = (GLC) ? P : SDATA // atomic</code></p>
    710710<h4>S_ATOMIC_SMAX_X2</h4>
    711 <p>Opcode: 166 (0x86) only for GCN 1.4<br />
     711<p>Opcode: 166 (0xa6) only for GCN 1.4<br />
    712712Syntax: S_ATOMIC_SMAX_X2 SDATA(2), SBASE(2), OFFSET<br />
    713713Description: Choose largest signed 64-bit value from SDATA and from memory address,
     
    833833If GLC flag is set then return previous value from memory address to SDATA,
    834834otherwise keep SDATA value. Operation is atomic.<br />
     835Operation:<br />
     836<code>UINT64* VM = (UINT64*)((SMEM + (OFFSET &amp; ~3))
     837UINT64 P = *VM; *VM = *VM ^ SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p>
     838<h4>S_BUFFER_ATOMIC_ADD</h4>
     839<p>Opcode: 66 (0x42) only for GCN 1.4<br />
     840Syntax: S_BUFFER_ATOMIC_ADD SDATA, SBASE(4), OFFSET<br />
     841Description: Add SDATA to value from memory address, and store result to memory address.
     842If GLC flag is set then return previous value from memory address to SDATA,
     843otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     844Operation:<br />
     845<code>UINT32* VM = (UINT32*)((SMEM + (OFFSET &amp; ~3))
     846UINT32 P = *VM; *VM = *VM + SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p>
     847<h4>S_BUFFER_ATOMIC_ADD_X2</h4>
     848<p>Opcode: 98 (0x62) only for GCN 1.4<br />
     849Syntax: S_BUFFER_ATOMIC_ADD_X2 SDATA(2), SBASE(4), OFFSET<br />
     850Description: Add 64-bit SDATA to 64-bit value from memory address,
     851and store result to memory address.
     852If GLC flag is set then return previous value from memory address to SDATA,
     853otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     854Operation:<br />
     855<code>UINT64* VM = (UINT64*)((SMEM + (OFFSET &amp; ~3))
     856UINT64 P = *VM; *VM = *VM + SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p>
     857<h4>S_BUFFER_ATOMIC_AND</h4>
     858<p>Opcode: 72 (0x48) only for GCN 1.4<br />
     859Syntax: S_BUFFER_ATOMIC_AND SDATA, SBASE(4), OFFSET<br />
     860Description: Do bitwise AND on SDATA and value from memory address,
     861and store result to memory address.
     862If GLC flag is set then return previous value from memory address to SDATA,
     863otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     864Operation:<br />
     865<code>UINT32* VM = (UINT32*)((SMEM + (OFFSET &amp; ~3))
     866UINT32 P = *VM; *VM = *VM &amp; SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p>
     867<h4>S_BUFFER_ATOMIC_AND_X2</h4>
     868<p>Opcode: 104 (0x68) only for GCN 1.4<br />
     869Syntax: S_BUFFER_ATOMIC_AND_X2 SDATA(2), SBASE(4), OFFSET<br />
     870Description: Do bitwise AND on 64-bit SDATA and 64-bit value from memory address,
     871and store result to memory address.
     872If GLC flag is set then return previous value from memory address to SDATA,
     873otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     874Operation:<br />
     875<code>UINT64* VM = (UINT64*)((SMEM + (OFFSET &amp; ~3))
     876UINT64 P = *VM; *VM = *VM &amp; SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p>
     877<h4>S_BUFFER_ATOMIC_CMPSWAP</h4>
     878<p>Opcode: 65 (0x41) only for GCN 1.4<br />
     879Syntax: S_BUFFER_ATOMIC_CMPSWAP SDATA(2), SBASE(4), OFFSET<br />
     880Description: Store lower SDATA dword into memory address if previous value
     881from memory address is equal SDATA&gt;&gt;32, otherwise keep old value from memory address.
     882If GLC flag is set then return previous value from memory address to SDATA,
     883otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     884Operation:<br />
     885<code>UINT32* VM = (UINT32*)((SMEM + (OFFSET &amp; ~3))
     886UINT32 P = *VM; *VM = *VM = *VM==(SDATA&gt;&gt;32) ? SDATA&amp;0xffffffff : *VM // atomic
     887SDATA = (GLC) ? P : SDATA // atomic</code></p>
     888<h4>S_BUFFER_ATOMIC_CMPSWAP_X2</h4>
     889<p>Opcode: 97 (0x61) only for GCN 1.4<br />
     890Syntax: S_BUFFER_ATOMIC_CMPSWAP_X2 SDATA(4), SBASE(4), OFFSET<br />
     891Description: Store lower SDATA quadword into memory address if previous value
     892from memory address is equal last SDATA quadword,
     893otherwise keep old value from memory address.
     894If GLC flag is set then return previous value from memory address to SDATA,
     895otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     896Operation:<br />
     897<code>UINT64* VM = (UINT64*)((SMEM + (OFFSET &amp; ~3))
     898UINT64 P = *VM; *VM = *VM = *VM==(SDATA[2:3]) ? SDATA[0:1] : *VM // atomic
     899SDATA = (GLC) ? P : SDATA // atomic</code></p>
     900<h4>S_BUFFER_ATOMIC_DEC</h4>
     901<p>Opcode: 76 (0x4c) only for GCN 1.4<br />
     902Syntax: S_BUFFER_ATOMIC_DEC SDATA, SBASE(4), OFFSET<br />
     903Description: Compare value from memory address and if less or equal than SDATA
     904and this value is not zero, then decrement value from memory address,
     905otherwise store SDATA to memory address.
     906If GLC flag is set then return previous value from memory address to SDATA,
     907otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     908Operation:<br />
     909<code>UINT32* VM = (UINT32*)((SMEM + (OFFSET &amp; ~3))
     910UINT32 P = *VM; *VM = (*VM &lt;= VDATA &amp;&amp; *VM!=0) ? *VM-1 : VDATA; // atomic
     911SDATA = (GLC) ? P : SDATA // atomic</code></p>
     912<h4>S_BUFFER_ATOMIC_DEC_X2</h4>
     913<p>Opcode: 108 (0x6c) only for GCN 1.4<br />
     914Syntax: S_BUFFER_ATOMIC_DEC_X2 SDATA, SBASE(4), OFFSET<br />
     915Description: Compare 64-bit value from memory address and if less or equal than
     91664-bit SDATA and this value is not zero, then decrement value from memory address,
     917otherwise store SDATA to memory address.
     918If GLC flag is set then return previous value from memory address to SDATA,
     919otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     920Operation:<br />
     921<code>UINT64* VM = (UINT64*)((SMEM + (OFFSET &amp; ~3))
     922UINT64 P = *VM; *VM = (*VM &lt;= VDATA &amp;&amp; *VM!=0) ? *VM-1 : VDATA; // atomic
     923SDATA = (GLC) ? P : SDATA // atomic</code></p>
     924<h4>S_BUFFER_ATOMIC_INC</h4>
     925<p>Opcode: 75 (0x4b) only for GCN 1.4<br />
     926Syntax: S_BUFFER_ATOMIC_INC SDATA, SBASE(4), OFFSET<br />
     927Description: Compare value from memory address and if less than SDATA,
     928then increment value from memory address, otherwise store zero to memory address.
     929If GLC flag is set then return previous value from memory address to SDATA,
     930otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     931Operation:<br />
     932<code>UINT32* VM = (UINT32*)((SMEM + (OFFSET &amp; ~3))
     933UINT32 P = *VM; *VM = (*VM &lt; SDATA) ? *VM+1 : 0; SDATA = (GLC) ? P : SDATA // atomic</code></p>
     934<h4>S_BUFFER_ATOMIC_INC_X2</h4>
     935<p>Opcode: 107 (0x6b) only for GCN 1.4<br />
     936Syntax: S_BUFFER_ATOMIC_INC_X2 SDATA(2), SBASE(4), OFFSET<br />
     937Description: Compare 64-bit value from memory address and if less than 64-bit SDATA,
     938then increment value from memory address, otherwise store zero to memory address.
     939If GLC flag is set then return previous value from memory address to SDATA,
     940otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     941Operation:<br />
     942<code>UINT64* VM = (UINT64*)((SMEM + (OFFSET &amp; ~3))
     943UINT64 P = *VM; *VM = (*VM &lt; SDATA) ? *VM+1 : 0; SDATA = (GLC) ? P : SDATA // atomic</code></p>
     944<h4>S_BUFFER_ATOMIC_OR</h4>
     945<p>Opcode: 73 (0x49) only for GCN 1.4<br />
     946Syntax: S_BUFFER_ATOMIC_OR SDATA, SBASE(4), OFFSET<br />
     947Description: Do bitwise OR on SDATA and value from memory address,
     948and store result to memory address.
     949If GLC flag is set then return previous value from memory address to SDATA,
     950otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     951Operation:<br />
     952<code>UINT32* VM = (UINT32*)((SMEM + (OFFSET &amp; ~3))
     953UINT32 P = *VM; *VM = *VM | SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p>
     954<h4>S_BUFFER_ATOMIC_OR_X2</h4>
     955<p>Opcode: 105 (0x69) only for GCN 1.4<br />
     956Syntax: S_BUFFER_ATOMIC_OR_X2 SDATA(2), SBASE(4), OFFSET<br />
     957Description: Do bitwise OR on 64-bit SDATA and 64-bit value from memory address,
     958and store result to memory address.
     959If GLC flag is set then return previous value from memory address to SDATA,
     960otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     961Operation:<br />
     962<code>UINT64* VM = (UINT64*)((SMEM + (OFFSET &amp; ~3))
     963UINT64 P = *VM; *VM = *VM | SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p>
     964<h4>S_BUFFER_ATOMIC_SMAX</h4>
     965<p>Opcode: 72 (0x46) only for GCN 1.4<br />
     966Syntax: S_BUFFER_ATOMIC_SMAX SDATA, SBASE(4), OFFSET<br />
     967Description: Choose largest signed 32-bit value from SDATA and from memory address,
     968and store result to this memory address.
     969If GLC flag is set then return previous value from memory address to SDATA,
     970otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     971Operation:<br />
     972<code>INT32* VM = (INT32*)((SMEM + (OFFSET &amp; ~3))
     973INT32 P = *VM; *VM = MAX(*VM, (INT32)SDATA); SDATA = (GLC) ? P : SDATA // atomic</code></p>
     974<h4>S_BUFFER_ATOMIC_SMAX_X2</h4>
     975<p>Opcode: 102 (0x66) only for GCN 1.4<br />
     976Syntax: S_BUFFER_ATOMIC_SMAX_X2 SDATA(2), SBASE(4), OFFSET<br />
     977Description: Choose largest signed 64-bit value from SDATA and from memory address,
     978and store result to this memory address.
     979If GLC flag is set then return previous value from memory address to SDATA,
     980otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     981Operation:<br />
     982<code>INT64* VM = (INT64*)((SMEM + (OFFSET &amp; ~3))
     983INT64 P = *VM; *VM = MAX(*VM, (INT64)SDATA); SDATA = (GLC) ? P : SDATA // atomic</code></p>
     984<h4>S_BUFFER_ATOMIC_SMIN</h4>
     985<p>Opcode: 70 (0x44) only for GCN 1.4<br />
     986Syntax: S_BUFFER_ATOMIC_SMIN SDATA, SBASE(4), OFFSET<br />
     987Description: Choose smallest signed 32-bit value from SDATA and from memory address,
     988and store result to this memory address.
     989If GLC flag is set then return previous value from memory address to SDATA,
     990otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     991Operation:<br />
     992<code>INT32* VM = (INT32*)((SMEM + (OFFSET &amp; ~3))
     993INT32 P = *VM; *VM = MIN(*VM, (INT32)SDATA); SDATA = (GLC) ? P : SDATA // atomic</code></p>
     994<h4>S_BUFFER_ATOMIC_SMIN_X2</h4>
     995<p>Opcode: 100 (0x64) only for GCN 1.4<br />
     996Syntax: S_BUFFER_ATOMIC_SMIN_X2 SDATA(2), SBASE(4), OFFSET<br />
     997Description: Choose smallest signed 64-bit value from SDATA and from memory address,
     998and store result to this memory address.
     999If GLC flag is set then return previous value from memory address to SDATA,
     1000otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     1001Operation:<br />
     1002<code>INT64* VM = (INT64*)((SMEM + (OFFSET &amp; ~3))
     1003INT64 P = *VM; *VM = MIN(*VM, (INT64)SDATA); SDATA = (GLC) ? P : SDATA // atomic</code></p>
     1004<h4>S_BUFFER_ATOMIC_SUB</h4>
     1005<p>Opcode: 69 (0x43) only for GCN 1.4<br />
     1006Syntax: S_BUFFER_ATOMIC_SUB SDATA, SBASE(4), OFFSET<br />
     1007Description: Subtract SDATA from value from memory address,
     1008and store result to memory address.
     1009If GLC flag is set then return previous value from memory address to SDATA,
     1010otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     1011Operation:<br />
     1012<code>UINT32* VM = (UINT32*)((SMEM + (OFFSET &amp; ~3))
     1013UINT32 P = *VM; *VM = *VM - SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p>
     1014<h4>S_BUFFER_ATOMIC_SUB_X2</h4>
     1015<p>Opcode: 99 (0x63) only for GCN 1.4<br />
     1016Syntax: S_BUFFER_ATOMIC_SUB_X2 SDATA(2), SBASE(4), OFFSET<br />
     1017Description: Subtract 64-bit SDATA from 64-bit value from memory address,
     1018and store result to memory address.
     1019If GLC flag is set then return previous value from memory address to SDATA,
     1020otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     1021Operation:<br />
     1022<code>UINT64* VM = (UINT64*)((SMEM + (OFFSET &amp; ~3))
     1023UINT64 P = *VM; *VM = *VM - SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p>
     1024<h4>S_BUFFER_ATOMIC_SWAP</h4>
     1025<p>Opcode: 64 (0x40) only for GCN 1.4<br />
     1026Syntax: S_BUFFER_ATOMIC_SWAP SDATA, SBASE(4), OFFSET<br />
     1027Description: Store SDATA into memory address.
     1028If GLC flag is set then return previous value from memory address to SDATA,
     1029otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     1030Operation:<br />
     1031<code>UINT32* VM = (UINT32*)((SMEM + (OFFSET &amp; ~3))
     1032UINT32 P = *VM; *VM = SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p>
     1033<h4>S_BUFFER_ATOMIC_SWAP_X2</h4>
     1034<p>Opcode: 96 (0x60) only for GCN 1.4<br />
     1035Syntax: S_BUFFER_ATOMIC_SWAP_X2 SDATA(2), SBASE(4), OFFSET<br />
     1036Description: Store 64-bit SDATA into memory address.
     1037If GLC flag is set then return previous value from memory address to SDATA,
     1038otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     1039Operation:<br />
     1040<code>UINT64* VM = (UINT64*)((SMEM + (OFFSET &amp; ~3))
     1041UINT64 P = *VM; *VM = SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p>
     1042<h4>S_BUFFER_ATOMIC_UMAX</h4>
     1043<p>Opcode: 71 (0x47) only for GCN 1.4<br />
     1044Syntax: S_BUFFER_ATOMIC_UMAX SDATA, SBASE(4), OFFSET<br />
     1045Description: Choose largest unsigned 32-bit value from SDATA and from memory address,
     1046and store result to this memory address.
     1047If GLC flag is set then return previous value from memory address to SDATA,
     1048otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     1049Operation:<br />
     1050<code>UINT32* VM = (UINT32*)((SMEM + (OFFSET &amp; ~3))
     1051UINT32 P = *VM; *VM = MAX(*VM, SDATA); SDATA = (GLC) ? P : SDATA // atomic</code></p>
     1052<h4>S_BUFFER_ATOMIC_UMAX_X2</h4>
     1053<p>Opcode: 103 (0x67) only for GCN 1.4<br />
     1054Syntax: S_BUFFER_ATOMIC_UMAX_X2 SDATA(2), SBASE(4), OFFSET<br />
     1055Description: Choose largest unsigned 64-bit value from SDATA and from memory address,
     1056and store result to this memory address.
     1057If GLC flag is set then return previous value from memory address to SDATA,
     1058otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     1059Operation:<br />
     1060<code>UINT64* VM = (UINT64*)((SMEM + (OFFSET &amp; ~3))
     1061UINT64 P = *VM; *VM = MAX(*VM, SDATA); SDATA = (GLC) ? P : SDATA // atomic</code></p>
     1062<h4>S_BUFFER_ATOMIC_UMIN</h4>
     1063<p>Opcode: 69 (0x45) only for GCN 1.4<br />
     1064Syntax: S_BUFFER_ATOMIC_UMIN SDATA, SBASE(4), OFFSET<br />
     1065Description: Choose smallest unsigned 32-bit value from SDATA and from memory address,
     1066and store result to this memory address.
     1067If GLC flag is set then return previous value from memory address to SDATA,
     1068otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     1069Operation:<br />
     1070<code>UINT32* VM = (UINT32*)((SMEM + (OFFSET &amp; ~3))
     1071UINT32 P = *VM; *VM = MIN(*VM, SDATA); SDATA = (GLC) ? P : SDATA // atomic</code></p>
     1072<h4>S_BUFFER_ATOMIC_UMIN_X2</h4>
     1073<p>Opcode: 101 (0x65) only for GCN 1.4<br />
     1074Syntax: S_BUFFER_ATOMIC_UMIN_X2 SDATA(2), SBASE(4), OFFSET<br />
     1075Description: Choose smallest unsigned 64-bit value from SDATA and from memory address,
     1076and store result to this memory address.
     1077If GLC flag is set then return previous value from memory address to SDATA,
     1078otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     1079Operation:<br />
     1080<code>UINT64* VM = (UINT64*)((SMEM + (OFFSET &amp; ~3))
     1081UINT64 P = *VM; *VM = MIN(*VM, SDATA); SDATA = (GLC) ? P : SDATA // atomic</code></p>
     1082<h4>S_BUFFER_ATOMIC_XOR</h4>
     1083<p>Opcode: 74 (0x4a) only for GCN 1.4<br />
     1084Syntax: S_BUFFER_ATOMIC_XOR SDATA, SBASE(4), OFFSET<br />
     1085Description: Do bitwise XOR on SDATA and value from memory address,
     1086and store result to memory address.
     1087If GLC flag is set then return previous value from memory address to SDATA,
     1088otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
     1089Operation:<br />
     1090<code>UINT32* VM = (UINT32*)((SMEM + (OFFSET &amp; ~3))
     1091UINT32 P = *VM; *VM = *VM ^ SDATA; SDATA = (GLC) ? P : SDATA // atomic</code></p>
     1092<h4>S_BUFFER_ATOMIC_XOR_X2</h4>
     1093<p>Opcode: 106 (0x6a) only for GCN 1.4<br />
     1094Syntax: S_BUFFER_ATOMIC_XOR_X2 SDATA(2), SBASE(4), OFFSET<br />
     1095Description: Do bitwise XOR on 64-bit SDATA and 64-bit value from memory address,
     1096and store result to memory address.
     1097If GLC flag is set then return previous value from memory address to SDATA,
     1098otherwise keep SDATA value. Operation is atomic. SBASE is buffer descriptor.<br />
    8351099Operation:<br />
    8361100<code>UINT64* VM = (UINT64*)((SMEM + (OFFSET &amp; ~3))