Changes between Version 3 and Version 4 of GcnInstrsDs


Ignore:
Timestamp:
12/21/15 09:00:19 (8 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GcnInstrsDs

    v3 v4  
    11521152<h3>Instruction set</h3>
    11531153<p>Alphabetically sorted instruction list:</p>
     1154<h4>DS_ADD_RTN_U32</h4>
     1155<p>Opcode: 32 (0x20)<br />
     1156Syntax: DS_ADD_RTN_U32 VDST, ADDR, VDATA0 [OFFSET:OFFSET]<br />
     1157Description: Adds unsigned integer value from LDS/GDS at address (ADDR+OFFSET) &amp; ~3 and
     1158VDATA0, and store result back to LDS/GDS at this address. Previous value from
     1159LDS/GDS are stored in VDST. Operation is atomic.<br />
     1160Operation:<br />
     1161<code>UINT32* V = (UINT32*)(DS + (ADDR+OFFSET)&amp;~3)
     1162VDST = *V; *V = *V + VDATA0  // atomic operation</code></p>
    11541163<h4>DS_ADD_U32</h4>
    11551164<p>Opcode: 0 (0x0)<br />
     
    11691178<code>UINT32* V = (UINT32*)(DS + (ADDR+OFFSET)&amp;~3)
    11701179*V = *V &amp; VDATA0  // atomic operation</code></p>
     1180<h4>DS_DEC_RTN_U32</h4>
     1181<p>Opcode: 36 (0x24)<br />
     1182Syntax: DS_DEC_RTN_U32 VDST, ADDR, VDATA0 [OFFSET:OFFSET]<br />
     1183Description: Load unsigned value from LDS/GDS at  address (ADDR+OFFSET) &amp; ~3, and
     1184compare with unsigned value from VDATA0. If VDATA0 greater or equal and loaded
     1185unsigned value is zero, then increment value from LDS/GDS, otherwise store
     1186VDATA0 to LDS/GDS. Previous value from LDS/GDS are stored in VDST. Operation is atomic.<br />
     1187Operation:<br />
     1188<code>UINT32* V = (UINT32*)(DS + (ADDR+OFFSET)&amp;~3)
     1189VDST = *V; *V = (VDATA0 &gt;= *V &amp;&amp; *V!=0) ? *V-1 : VDATA0  // atomic operation</code></p>
    11711190<h4>DS_DEC_U32</h4>
    11721191<p>Opcode: 4 (0x4)<br />
     
    11791198<code>UINT32* V = (UINT32*)(DS + (ADDR+OFFSET)&amp;~3)
    11801199*V = (VDATA0 &gt;= *V &amp;&amp; *V!=0) ? *V-1 : VDATA0  // atomic operation</code></p>
     1200<h4>DS_INC_RTN_U32</h4>
     1201<p>Opcode: 35 (0x23)<br />
     1202Syntax: DS_INC_RTN_U32 VDST, ADDR, VDATA0 [OFFSET:OFFSET]<br />
     1203Description: Load unsigned value from LDS/GDS at address (ADDR+OFFSET) &amp; ~3, and
     1204compare with unsigned value from VDATA0. If VDATA0 greater, then increment value
     1205from LDS/GDS, otherwise store 0 to LDS/GDS.
     1206Previous value from LDS/GDS are stored in VDST. Operation is atomic.<br />
     1207Operation:<br />
     1208<code>UINT32* V = (UINT32*)(DS + (ADDR+OFFSET)&amp;~3)
     1209VDST = *V; *V = (VDATA0 &gt; *V) ? *V+1 : 0  // atomic operation</code></p>
    11811210<h4>DS_INC_U32</h4>
    11821211<p>Opcode: 3 (0x3)<br />
     
    12431272<code>UINT32* V = (UINT32*)(DS + (ADDR+OFFSET)&amp;~3)
    12441273*V = *V | VDATA0  // atomic operation</code></p>
     1274<h4>DS_RSUB_RTN_U32</h4>
     1275<p>Opcode: 34 (0x22)<br />
     1276Syntax: DS_RSUB_RTN_U32 VDST, ADDR, VDATA0 [OFFSET:OFFSET]<br />
     1277Description: Subtract unsigned integer value from LDS/GDS at address (ADDR+OFFSET) &amp; ~3
     1278from value in VDATA0, and store result back to LDS/GDS at this same address.
     1279Previous value from LDS/GDS are stored in VDST. Operation is atomic.<br />
     1280Operation:<br />
     1281<code>UINT32* V = (UINT32*)(DS + (ADDR+OFFSET)&amp;~3)
     1282VDST= *V; *V = VDATA0 - *V  // atomic operation</code></p>
    12451283<h4>DS_RSUB_U32</h4>
    12461284<p>Opcode: 2 (0x2)<br />
     
    12521290<code>UINT32* V = (UINT32*)(DS + (ADDR+OFFSET)&amp;~3)
    12531291*V = VDATA0 - *V  // atomic operation</code></p>
     1292<h4>DS_SUB_RTN_U32</h4>
     1293<p>Opcode: 33 (0x21)<br />
     1294Syntax: DS_SUB_RTN_U32 VDST, ADDR, VDATA0 [OFFSET:OFFSET]<br />
     1295Description: Subtract VDATA0 from unsigned integer value from LDS/GDS at address
     1296(ADDR+OFFSET) &amp; ~3, and store result back to LDS/GDS at this same address.
     1297Previous value from LDS/GDS are stored in VDST. Operation is atomic.<br />
     1298Operation:<br />
     1299<code>UINT32* V = (UINT32*)(DS + (ADDR+OFFSET)&amp;~3)
     1300VDST = *V; *V = *V - VDATA0  // atomic operation</code></p>
    12541301<h4>DS_SUB_U32</h4>
    12551302<p>Opcode: 1 (0x1)<br />
     
    12701317<h4>DS_WRITE2_B32</h4>
    12711318<p>Opcode: 14 (0xe)<br />
    1272 Syntax: DS_WRITE2_B32 ADDR, VDATA0, VDATA1 [OFFSET0:OFFSET1] [OFFSET1:OFFSET1]<br />
     1319Syntax: DS_WRITE2_B32 ADDR, VDATA0, VDATA1 [OFFSET0:OFFSET0] [OFFSET1:OFFSET1]<br />
    12731320Description: Store one dword from VDATA0 into LDS/GDS at address (ADDR+OFFSET0<em>4) &amp; ~3,
    1274 and second into LDS/GDS at address (ADDR+OFFSET0</em>4) &amp; ~3.<br />
     1321and second into LDS/GDS at address (ADDR+OFFSET1</em>4) &amp; ~3.<br />
    12751322Operation:<br />
    12761323<code>UINT32* V0 = (UINT32*)(DS + (ADDR + OFFSET0*4)&amp;~3)
    12771324UINT32* V1 = (UINT32*)(DS + (ADDR + OFFSET1*4)&amp;~3)
     1325*V0 = VDATA0
     1326*V1 = VDATA1</code></p>
     1327<h4>DS_WRITE2ST64_B32</h4>
     1328<p>Opcode: 15 (0xf)<br />
     1329Syntax: DS_WRITE2ST64_B32 ADDR, VDATA0, VDATA1 [OFFSET0:OFFSET0] [OFFSET1:OFFSET1]<br />
     1330Description: Store one dword from VDATA0 into LDS/GDS at address (ADDR+OFFSET0<em>256) &amp; ~3,
     1331and second into LDS/GDS at address (ADDR+OFFSET1</em>256) &amp; ~3.<br />
     1332Operation:<br />
     1333<code>UINT32* V0 = (UINT32*)(DS + (ADDR + OFFSET0*256)&amp;~3)
     1334UINT32* V1 = (UINT32*)(DS + (ADDR + OFFSET1*256)&amp;~3)
    12781335*V0 = VDATA0
    12791336*V1 = VDATA1</code></p>