Changes between Version 1 and Version 2 of GcnInstrsDs


Ignore:
Timestamp:
12/20/15 18:00:20 (8 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GcnInstrsDs

    v1 v2  
    6969Syntax: INSTRUCTION ADDR, VDATA0, VDATA1 [offset0:OFFSET0] [offset1:OFFSET1] [GDS]<br />
    7070Write syntax: INSTRUCTION VDST, ADDR [offset:OFFSET] [GDS]</p>
     71<p>NOTE: Any operation LDS requires correctly set M0 register, prior to execution.
     72The M0 register holds maximum size of a LDS memory, that can be accessed by wavefront.
     73To set no limits, just set a M0 register to 0xffffffff.</p>
    7174<p>List of the instructions by opcode:</p>
    7275<table>
     
    932935<td></td>
    933936<td></td>
     937<td>--</td>
    934938<td>DS_ADD_SRC2_F32</td>
    935 <td>DS_ADD_SRC2_F32</td>
    936939</tr>
    937940<tr>
     
    939942<td></td>
    940943<td></td>
     944<td>--</td>
    941945<td>DS_GWS_SEMA_RELEASE_ALL</td>
    942 <td>DS_GWS_SEMA_RELEASE_ALL</td>
    943946</tr>
    944947<tr>
     
    946949<td></td>
    947950<td></td>
     951<td>--</td>
    948952<td>DS_GWS_INIT</td>
    949 <td>DS_GWS_INIT</td>
    950953</tr>
    951954<tr>
     
    953956<td></td>
    954957<td></td>
     958<td>--</td>
    955959<td>DS_GWS_SEMA_V</td>
    956 <td>DS_GWS_SEMA_V</td>
    957960</tr>
    958961<tr>
     
    960963<td></td>
    961964<td></td>
     965<td>--</td>
    962966<td>DS_GWS_SEMA_BR</td>
    963 <td>DS_GWS_SEMA_BR</td>
    964967</tr>
    965968<tr>
     
    967970<td></td>
    968971<td></td>
     972<td>--</td>
    969973<td>DS_GWS_SEMA_P</td>
    970 <td>DS_GWS_SEMA_P</td>
    971974</tr>
    972975<tr>
     
    974977<td></td>
    975978<td></td>
     979<td>--</td>
    976980<td>DS_GWS_BARRIER</td>
    977 <td>DS_GWS_BARRIER</td>
    978981</tr>
    979982<tr>
     
    981984<td></td>
    982985<td></td>
     986<td>--</td>
    983987<td>DS_CONSUME</td>
    984 <td>DS_CONSUME</td>
    985988</tr>
    986989<tr>
     
    988991<td></td>
    989992<td></td>
     993<td>--</td>
    990994<td>DS_APPEND</td>
    991 <td>DS_APPEND</td>
    992995</tr>
    993996<tr>
     
    995998<td></td>
    996999<td></td>
    997 <td>DS_ORDERED_COUNT</td>
     1000<td>--</td>
    9981001<td>DS_ORDERED_COUNT</td>
    9991002</tr>
     
    11491152<h3>Instruction set</h3>
    11501153<p>Alphabetically sorted instruction list:</p>
     1154<h4>DS_ADD_U32</h4>
     1155<p>Opcode: 0 (0x0)<br />
     1156Syntax: DS_ADD_U32 ADDR, VDATA0 [OFFSET:OFFSET]<br />
     1157Description: Adds unsigned integer value from LDS/GDS under address (ADDR+OFFSET) &amp; ~3 and
     1158VDATA0, and store result back to LDS/GDS under this address. Operation is atomic.<br />
     1159Operation:<br />
     1160<code>UINT32* V = (UINT32*)(DS + (ADDR+OFFSET)&amp;~3)
     1161*V = *V + VDATA0  // atomic operation</code></p>
     1162<h4>DS_AND_B32</h4>
     1163<p>Opcode: 9 (0x9)<br />
     1164Syntax: DS_AND_B32 ADDR, VDATA0 [OFFSET:OFFSET]<br />
     1165Operation: Do bitwise AND operatin on 32-bit value from LDS/GDS under address
     1166(ADDR+OFFSET) &amp; ~3, and value from VDATA0; and store result to LDS/GDS under this same
     1167address. Operation is atomic.<br />
     1168Operation:<br />
     1169<code>UINT32* V = (UINT32*)(DS + (ADDR+OFFSET)&amp;~3)
     1170*V = *V &amp; VDATA0  // atomic operation</code></p>
     1171<h4>DS_DEC_U32</h4>
     1172<p>Opcode: 4 (0x4)<br />
     1173Syntax: DS_DEC_U32 ADDR, VDATA0 [OFFSET:OFFSET]<br />
     1174Description:
     1175Operation: Load unsigned value from LDS/GDS under  address (ADDR+OFFSET) &amp; ~3, and
     1176compare with unsigned value from VDATA0. If VDATA0 greater or equal and loaded
     1177unsigned value is zero, then increment value from LDS/GDS, otherwise store
     1178VDATA0 to LDS/GDS. Operation is atomic.<br />
     1179Operation:<br />
     1180<code>UINT32* V = (UINT32*)(DS + (ADDR+OFFSET)&amp;~3)
     1181*V = (VDATA0 &gt;= *V &amp;&amp; *V!=0) ? *V-1 : VDATA0  // atomic operation</code></p>
     1182<h4>DS_INC_U32</h4>
     1183<p>Opcode: 3 (0x3)<br />
     1184Syntax: DS_INC_U32 ADDR, VDATA0 [OFFSET:OFFSET]<br />
     1185Description: Load unsigned value from LDS/GDS under address (ADDR+OFFSET) &amp; ~3, and
     1186compare with unsigned value from VDATA0. If VDATA0 greater, then increment value
     1187from LDS/GDS, otherwise store 0 to LDS/GDS. Operation is atomic.<br />
     1188Operation:<br />
     1189<code>UINT32* V = (UINT32*)(DS + (ADDR+OFFSET)&amp;~3)
     1190*V = (VDATA0 &gt; *V) ? *V+1 : 0  // atomic operation</code></p>
     1191<h4>DS_MAX_I32</h4>
     1192<p>Opcode: 6 (0x6)<br />
     1193Syntax: DS_MAX_I32 ADDR, VDATA0 [OFFSET:OFFSET]<br />
     1194Description: Choose greatest signed integer value from LDS/GDS under address
     1195(ADDR+OFFSET) &amp; ~3 and VDATA0, and store result to LDS/GDS under this same address.
     1196Operation is atomic.<br />
     1197Operation:<br />
     1198<code>INT32* V = (INT32*)(DS + (ADDR+OFFSET)&amp;~3)
     1199*V = MAX(*V, (INT32)VDATA0) // atomic operation</code></p>
     1200<h4>DS_MAX_U32</h4>
     1201<p>Opcode: 8 (0x8)<br />
     1202Syntax: DS_MAX_U32 ADDR, VDATA0 [OFFSET:OFFSET]<br />
     1203Description: Choose greatest unsigned integer value from LDS/GDS under address
     1204(ADDR+OFFSET) &amp; ~3 and VDATA0, and store result to LDS/GDS under this same address.
     1205Operation is atomic.<br />
     1206Operation:<br />
     1207<code>UINT32* V = (UINT32*)(DS + (ADDR+OFFSET)&amp;~3)
     1208*V = MAX(*V, VDATA0) // atomic operation</code></p>
     1209<h4>DS_MIN_I32</h4>
     1210<p>Opcode: 5 (0x5)<br />
     1211Syntax: DS_MIN_I32 ADDR, VDATA0 [OFFSET:OFFSET]<br />
     1212Description: Choose smallest signed integer value from LDS/GDS under address
     1213(ADDR+OFFSET) &amp; ~3 and VDATA0, and store result to LDS/GDS under this same address.
     1214Operation is atomic.<br />
     1215Operation:<br />
     1216<code>INT32* V = (INT32*)(DS + (ADDR+OFFSET)&amp;~3)
     1217*V = MIN(*V, (INT32)VDATA0) // atomic operation</code></p>
     1218<h4>DS_MIN_U32</h4>
     1219<p>Opcode: 7 (0x7)<br />
     1220Syntax: DS_MIN_U32 ADDR, VDATA0 [OFFSET:OFFSET]<br />
     1221Description: Choose smallest unsigned integer value from LDS/GDS under address
     1222(ADDR+OFFSET) &amp; ~3 and VDATA0, and store result to LDS/GDS under this same address.
     1223Operation is atomic.<br />
     1224Operation:<br />
     1225<code>UINT32* V = (UINT32*)(DS + (ADDR+OFFSET)&amp;~3)
     1226*V = MIN(*V, VDATA0) // atomic operation</code></p>
     1227<h4>DS_OR_B32</h4>
     1228<p>Opcode: 10 (0xa)<br />
     1229Syntax: DS_OR_B32 ADDR, VDATA0 [OFFSET:OFFSET]<br />
     1230Operation: Do bitwise OR operatin on 32-bit value from LDS/GDS under address
     1231(ADDR+OFFSET) &amp; ~3, and value from VDATA0; and store result to LDS/GDS under this same
     1232address. Operation is atomic.<br />
     1233Operation:<br />
     1234<code>UINT32* V = (UINT32*)(DS + (ADDR+OFFSET)&amp;~3)
     1235*V = *V | VDATA0  // atomic operation</code></p>
     1236<h4>DS_RSUB_U32</h4>
     1237<p>Opcode: 2 (0x2)<br />
     1238Syntax: DS_RSUB_U32 ADDR, VDATA0 [OFFSET:OFFSET]<br />
     1239Description: Subtract unsigned integer value from LDS/GDS under address (ADDR+OFFSET) &amp; ~3
     1240from value in VDATA0, and store result back to LDS/GDS under this same address.
     1241Operation is atomic.<br />
     1242Operation:<br />
     1243<code>UINT32* V = (UINT32*)(DS + (ADDR+OFFSET)&amp;~3)
     1244*V = VDATA0 - *V  // atomic operation</code></p>
     1245<h4>DS_SUB_U32</h4>
     1246<p>Opcode: 1 (0x1)<br />
     1247Syntax: DS_SUB_U32 ADDR, VDATA0 [OFFSET:OFFSET]<br />
     1248Description: Subtract VDATA0 from unsigned integer value from LDS/GDS under address
     1249(ADDR+OFFSET) &amp; ~3, and store result back to LDS/GDS under this same address.
     1250Operation is atomic.<br />
     1251Operation:<br />
     1252<code>UINT32* V = (UINT32*)(DS + (ADDR+OFFSET)&amp;~3)
     1253*V = *V - VDATA0  // atomic operation</code></p>
    11511254}}}