Changes between Version 8 and Version 9 of GcnInstrsDs


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

--

Legend:

Unmodified
Added
Removed
Modified
  • GcnInstrsDs

    v8 v9  
    11721172<code>UINT64* V = (UINT64*)(DS + (ADDR+OFFSET)&amp;~7)
    11731173VDST = *V; *V = *V + VDATA0  // atomic operation</code></p>
     1174<h4>DS_ADD_SRC2_U32</h4>
     1175<p>Opcode: 128 (0x80)<br />
     1176Syntax: DS_ADD_SRC2_U32 ADDR [OFFSET:OFFSET]<br />
     1177Description: Add unsigned integer value from LDS/GDS at address A and B, and
     1178store result back to LDS/GDS at address A. Refer to listing to learn about addressing.
     1179Operation is atomic.<br />
     1180Operation:<br />
     1181<code>UINT16 A = (OFFSET&amp;0x8000) ? ADDR&amp;0x1fffc : ADDR&amp;~3
     1182UINT16 B = A + ((OFFSET&amp;0x8000) ? \
     1183            ((ADDR&gt;&gt;17) | ((ADDR&gt;&gt;16)&amp;0x8000)) : \
     1184            ((OFFSET&amp;07fff) | (OFFSET&lt;&lt;1)&amp;0x8000)) * 4
     1185UINT32* V = (UINT32*)(DS + A)
     1186*V = *V + *(UINT32*)(DS + B) // atomic operation</code></p>
     1187<h4>DS_ADD_SRC2_U64</h4>
     1188<p>Opcode: 192 (0xc0)<br />
     1189Syntax: DS_ADD_SRC2_U64 ADDR [OFFSET:OFFSET]<br />
     1190Description: Add unsigned 64-bit integer value from LDS/GDS at address A and B, and
     1191store result back to LDS/GDS at address A. Refer to listing to learn about addressing.
     1192Operation is atomic.<br />
     1193Operation:<br />
     1194<code>UINT16 A = (OFFSET&amp;0x8000) ? ADDR&amp;0x1fff8 : ADDR&amp;~7
     1195UINT16 B = (A + ((OFFSET&amp;0x8000) ? \
     1196            ((ADDR&gt;&gt;17) | ((ADDR&gt;&gt;16)&amp;0x8000)) : \
     1197            ((OFFSET&amp;07fff) | (OFFSET&lt;&lt;1)&amp;0x8000)) * 4)&amp;~7
     1198UINT64* V = (UINT64*)(DS + A)
     1199*V = *V + *(UINT64*)(DS + B) // atomic operation</code></p>
    11741200<h4>DS_ADD_U32</h4>
    11751201<p>Opcode: 0 (0x0)<br />
     
    12241250<code>UINT64* V = (UINT64*)(DS + (ADDR+OFFSET)&amp;~7)
    12251251VDST = *V; *V = *V &amp; VDATA0  // atomic operation</code></p>
     1252<h4>DS_AND_SRC2_B32</h4>
     1253<p>Opcode: 137 (0x89)<br />
     1254Syntax: DS_AND_SRC2_B32 ADDR [OFFSET:OFFSET]<br />
     1255Description: Do bitwise AND operatin on 32-bit value from LDS/GDS at address
     1256A, and at address B; and store result to LDS/GDS at address A. Operation is atomic.<br />
     1257Operation:<br />
     1258<code>UINT16 A = (OFFSET&amp;0x8000) ? ADDR&amp;0x1fffc : ADDR&amp;~3
     1259UINT16 B = A + ((OFFSET&amp;0x8000) ? \
     1260            ((ADDR&gt;&gt;17) | ((ADDR&gt;&gt;16)&amp;0x8000)) : \
     1261            ((OFFSET&amp;07fff) | (OFFSET&lt;&lt;1)&amp;0x8000)) * 4
     1262UINT32* V = (UINT32*)(DS + A)
     1263*V = *V &amp; *(UINT32*)(DS + B) // atomic operation</code></p>
    12261264<h4>DS_CMPST_B32</h4>
    12271265<p>Opcode: 16 (0x10)<br />
     
    12511289<code>FLOAT* V = (FLOAT*)(DS + (ADDR+OFFSET)&amp;~3)
    12521290*V = (*V==ASFLOATR(VDATA0)) ? ASFLOAT(VDATA1) : *V  // atomic operation</code></p>
     1291<h4>DS_CMPST_F64</h4>
     1292<p>Opcode: 81 (0x51)<br />
     1293Syntax: DS_CMPST_F64 ADDR, VDATA0(2), VDATA1(2) [OFFSET:OFFSET]<br />
     1294Description: Compare double floating point values from VDATA0 and from LDS/GDS at address
     1295(ADDR+OFFSET) &amp; ~7. If values are equal, store VDATA1 to LDS/GDS at this same address,
     1296otherwise do nothing. Operation is atomic.<br />
     1297Operation:<br />
     1298<code>DOUBLE* V = (DOUBLE*)(DS + (ADDR+OFFSET)&amp;~7)
     1299*V = (*V==ASDOUBLE(VDATA0)) ? ASDOUBLE(VDATA1) : *V  // atomic operation</code></p>
    12531300<h4>DS_CMPST_RTN_B32</h4>
    12541301<p>Opcode: 48 (0x30)<br />
     
    12771324Operation:<br />
    12781325<code>FLOAT* V = (FLOAT*)(DS + (ADDR+OFFSET)&amp;~3)
    1279 VDST = *V; *V = (*V==ASFLOATR(VDATA0)) ? ASFLOAT(VDATA1) : *V  // atomic operation</code></p>
     1326VDST = *V; *V = (*V==ASFLOAT(VDATA0)) ? ASFLOAT(VDATA1) : *V  // atomic operation</code></p>
     1327<h4>DS_CMPST_RTN_F32</h4>
     1328<p>Opcode: 113 (0x71)<br />
     1329Syntax: DS_CMPST_RTN_F64 VDST(2), ADDR, VDATA0(2), VDATA1(2) [OFFSET:OFFSET]<br />
     1330Description: Compare double floating point values from VDATA0 and from LDS/GDS at address
     1331(ADDR+OFFSET) &amp; ~7. If values are equal, store VDATA1 to LDS/GDS at this same address,
     1332otherwise do nothing. Previous value from LDS/GDS are stored in VDST. Operation is atomic.<br />
     1333Operation:<br />
     1334<code>DOUBLE* V = (DOUBLE*)(DS + (ADDR+OFFSET)&amp;~7)
     1335VDST = *V; *V = (*V==ASDOUBLE(VDATA0)) ? ASDOUBLE(VDATA1) : *V  // atomic operation</code></p>
    12801336<h4>DS_DEC_RTN_U32</h4>
    12811337<p>Opcode: 36 (0x24)<br />
    12821338Syntax: DS_DEC_RTN_U32 VDST, ADDR, VDATA0 [OFFSET:OFFSET]<br />
    12831339Description: Load unsigned value from LDS/GDS at  address (ADDR+OFFSET) &amp; ~3, and
    1284 compare with unsigned value from VDATA0. If VDATA0 greater or equal and loaded
     1340compare with unsigned value from VDATA0. If VDATA0 is greater or equal and loaded
    12851341unsigned value is zero, then increment value from LDS/GDS, otherwise store
    12861342VDATA0 to LDS/GDS. Previous value from LDS/GDS are stored in VDST. Operation is atomic.<br />
     
    12921348Syntax: DS_DEC_RTN_U64 VDST(2), ADDR, VDATA0(2) [OFFSET:OFFSET]<br />
    12931349Description: Load unsigned 64-bit value from LDS/GDS at  address (ADDR+OFFSET) &amp; ~7, and
    1294 compare with unsigned value from VDATA0. If VDATA0 greater or equal and loaded
    1295 unsigned value is zero, then increment value from LDS/GDS, otherwise store
     1350compare with unsigned value from VDATA0. If VDATA0 is greater or equal and loaded
     1351unsigned value is not zero, then decrement value from LDS/GDS, otherwise store
    12961352VDATA0 to LDS/GDS. Previous value from LDS/GDS are stored in VDST. Operation is atomic.<br />
    12971353Operation:<br />
    12981354<code>UINT64* V = (UINT64*)(DS + (ADDR+OFFSET)&amp;~7)
    12991355VDST = *V; *V = (VDATA0 &gt;= *V &amp;&amp; *V!=0) ? *V-1 : VDATA0  // atomic operation</code></p>
     1356<h4>DS_DEC_SRC2_U32</h4>
     1357<p>Opcode: 132 (0x84)<br />
     1358Syntax: DS_DEC_SRC2_U32 ADDR [OFFSET:OFFSET]<br />
     1359Description: Load unsigned value from LDS/GDS at address A, and compare with unsigned
     1360value at address B. If value at address B is greater or equal and loaded unsigned value
     1361is not zero, then decrement value from LDS/GDS, otherwise store value at address B to
     1362LDS/GDS at address A. Refer to listing to learn about addressing. Operation is atomic.<br />
     1363Operation:<br />
     1364<code>UINT16 A = (OFFSET&amp;0x8000) ? ADDR&amp;0x1fffc : ADDR&amp;~3
     1365UINT16 B = A + ((OFFSET&amp;0x8000) ? \
     1366            ((ADDR&gt;&gt;17) | ((ADDR&gt;&gt;16)&amp;0x8000)) : \
     1367            ((OFFSET&amp;07fff) | (OFFSET&lt;&lt;1)&amp;0x8000)) * 4
     1368UINT32* V = (UINT32*)(DS + A)
     1369UINT32* VB = (UINT32*)(DS + B)
     1370*V = (*VB &gt;= *V &amp;&amp; *V!=0) ? *V-1 : *VB // atomic operation</code></p>
    13001371<h4>DS_DEC_U32</h4>
    13011372<p>Opcode: 4 (0x4)<br />
    13021373Syntax: DS_DEC_U32 ADDR, VDATA0 [OFFSET:OFFSET]<br />
    13031374Description: Load unsigned value from LDS/GDS at  address (ADDR+OFFSET) &amp; ~3, and
    1304 compare with unsigned value from VDATA0. If VDATA0 greater or equal and loaded
    1305 unsigned value is zero, then increment value from LDS/GDS, otherwise store
     1375compare with unsigned value from VDATA0. If VDATA0 is greater or equal and loaded
     1376unsigned value is not zero, then decrement value from LDS/GDS, otherwise store
    13061377VDATA0 to LDS/GDS. Operation is atomic.<br />
    13071378Operation:<br />
     
    13121383Syntax: DS_DEC_U64 ADDR, VDATA0(2) [OFFSET:OFFSET]<br />
    13131384Description: Load unsigned 64-bit value from LDS/GDS at  address (ADDR+OFFSET) &amp; ~7, and
    1314 compare with unsigned value from VDATA0. If VDATA0 greater or equal and loaded
    1315 unsigned value is zero, then increment value from LDS/GDS, otherwise store
     1385compare with unsigned value from VDATA0. If VDATA0 is greater or equal and loaded
     1386unsigned value is not zero, then decrement value from LDS/GDS, otherwise store
    13161387VDATA0 to LDS/GDS. Operation is atomic.<br />
    13171388Operation:<br />
     
    13321403Syntax: DS_INC_RTN_U64 VDST(2), ADDR, VDATA0(2) [OFFSET:OFFSET]<br />
    13331404Description: Load unsigned 64-bit value from LDS/GDS at address (ADDR+OFFSET) &amp; ~7, and
    1334 compare with unsigned value from VDATA0. If VDATA0 greater, then increment value
     1405compare with unsigned value from VDATA0. If VDATA0 is greater, then increment value
    13351406from LDS/GDS, otherwise store 0 to LDS/GDS.
    13361407Previous value from LDS/GDS are stored in VDST. Operation is atomic.<br />
     
    13381409<code>UINT64* V = (UINT64*)(DS + (ADDR+OFFSET)&amp;~7)
    13391410VDST = *V; *V = (VDATA0 &gt; *V) ? *V+1 : 0  // atomic operation</code></p>
     1411<h4>DS_INC_SRC2_U32</h4>
     1412<p>Opcode: 131 (0x83)<br />
     1413Syntax: DS_INC_SRC2_U32 ADDR [OFFSET:OFFSET]<br />
     1414Description: Load unsigned value from LDS/GDS at address A, and
     1415compare with unsigned value at address B. If value at address B is greater,
     1416then increment value from LDS/GDS, otherwise store 0 to LDS/GDS at address A.
     1417Refer to listing to learn about addressing. Operation is atomic.<br />
     1418Operation:<br />
     1419<code>UINT16 A = (OFFSET&amp;0x8000) ? ADDR&amp;0x1fffc : ADDR&amp;~3
     1420UINT16 B = A + ((OFFSET&amp;0x8000) ? \
     1421            ((ADDR&gt;&gt;17) | ((ADDR&gt;&gt;16)&amp;0x8000)) : \
     1422            ((OFFSET&amp;07fff) | (OFFSET&lt;&lt;1)&amp;0x8000)) * 4
     1423UINT32* V = (UINT32*)(DS + A)
     1424*V = (*(UINT32*)(DS + B) &gt; *V) ? *V+1 : 0  // atomic operation</code></p>
    13401425<h4>DS_INC_U32</h4>
    13411426<p>Opcode: 3 (0x3)<br />
    13421427Syntax: DS_INC_U32 ADDR, VDATA0 [OFFSET:OFFSET]<br />
    13431428Description: Load unsigned value from LDS/GDS at address (ADDR+OFFSET) &amp; ~3, and
    1344 compare with unsigned value from VDATA0. If VDATA0 greater, then increment value
     1429compare with unsigned value from VDATA0. If VDATA0 is greater, then increment value
    13451430from LDS/GDS, otherwise store 0 to LDS/GDS. Operation is atomic.<br />
    13461431Operation:<br />
     
    13511436Syntax: DS_INC_U64 ADDR, VDATA0(2) [OFFSET:OFFSET]<br />
    13521437Description: Load unsigned 64-bit value from LDS/GDS at address (ADDR+OFFSET) &amp; ~7, and
    1353 compare with unsigned value from VDATA0. If VDATA0 greater, then increment value
     1438compare with unsigned value from VDATA0. If VDATA0 is greater, then increment value
    13541439from LDS/GDS, otherwise store 0 to LDS/GDS. Operation is atomic.<br />
    13551440Operation:<br />
     
    13651450<code>FLOAT* V = (FLOAT*)(DS + (ADDR+OFFSET)&amp;~3)
    13661451*V = MAX(*V, ASFLOAT(VDATA0)) // atomic operation</code></p>
     1452<h4>DS_MAX_F64</h4>
     1453<p>Opcode: 83 (0x53)<br />
     1454Syntax: DS_MAX_F64 ADDR, VDATA0(2) [OFFSET:OFFSET]<br />
     1455Description: Choose greatest double floating point value from LDS/GDS at address
     1456(ADDR+OFFSET) &amp; ~7 and VDATA0, and store result to LDS/GDS at this same address.
     1457Operation is atomic.<br />
     1458Operation:<br />
     1459<code>DOUBLE* V = (DOUBLE*)(DS + (ADDR+OFFSET)&amp;~7)
     1460*V = MAX(*V, ASDOUBLE(VDATA0)) // atomic operation</code></p>
    13671461<h4>DS_MAX_I32</h4>
    13681462<p>Opcode: 6 (0x6)<br />
     
    13921486<code>FLOAT* V = (FLOAT*)(DS + (ADDR+OFFSET)&amp;~3)
    13931487VDST = *V; *V = MAX(*V, ASFLOAT(VDATA0)) // atomic operation</code></p>
     1488<h4>DS_MAX_RTN_F64</h4>
     1489<p>Opcode: 115 (0x73)<br />
     1490Syntax: DS_MAX_F64 VDST(2), ADDR, VDATA0(2) [OFFSET:OFFSET]<br />
     1491Description: Choose smallest double floating point value from LDS/GDS at address
     1492(ADDR+OFFSET) &amp; ~7 and VDATA0, and store result to LDS/GDS at this same address.
     1493Previous value from LDS/GDS are stored in VDST. Operation is atomic.<br />
     1494Operation:<br />
     1495<code>DOUBLE* V = (DOUBLE*)(DS + (ADDR+OFFSET)&amp;~7)
     1496VDST = *V; *V = MAX(*V, ASDOUBLE(VDATA0)) // atomic operation</code></p>
    13941497<h4>DS_MAX_RTN_I32</h4>
    13951498<p>Opcode: 38 (0x26)<br />
     
    14281531<code>UINT64* V = (UINT64*)(DS + (ADDR+OFFSET)&amp;~7)
    14291532VDST = *V; *V = MAX(*V, VDATA0) // atomic operation</code></p>
     1533<h4>DS_MAX_SRC2_F32</h4>
     1534<p>Opcode: 147 (0x93)<br />
     1535Syntax: DS_MAX_SRC2_F32 ADDR [OFFSET:OFFSET]<br />
     1536Description: Choose greatest single floating point value from LDS/GDS at address
     1537A and at address B, and store result to LDS/GDS at address A.
     1538Refer to listing to learn about addressing. Operation is atomic.<br />
     1539Operation:<br />
     1540<code>UINT16 A = (OFFSET&amp;0x8000) ? ADDR&amp;0x1fffc : ADDR&amp;~3
     1541UINT16 B = A + ((OFFSET&amp;0x8000) ? \
     1542            ((ADDR&gt;&gt;17) | ((ADDR&gt;&gt;16)&amp;0x8000)) : \
     1543            ((OFFSET&amp;07fff) | (OFFSET&lt;&lt;1)&amp;0x8000)) * 4
     1544FLOAT* V = (FLOAT*)(DS + A)
     1545*V = MAX(*V, *(FLOAT*)(DS + B)) // atomic operation</code></p>
     1546<h4>DS_MAX_SRC2_I32</h4>
     1547<p>Opcode: 134 (0x86)<br />
     1548Syntax: DS_MAX_SRC2_I32 ADDR [OFFSET:OFFSET]<br />
     1549Description: Choose greatest signed integer value from LDS/GDS at address
     1550A and at address B, and store result to LDS/GDS at address A.
     1551Refer to listing to learn about addressing. Operation is atomic.<br />
     1552Operation:<br />
     1553<code>UINT16 A = (OFFSET&amp;0x8000) ? ADDR&amp;0x1fffc : ADDR&amp;~3
     1554UINT16 B = A + ((OFFSET&amp;0x8000) ? \
     1555            ((ADDR&gt;&gt;17) | ((ADDR&gt;&gt;16)&amp;0x8000)) : \
     1556            ((OFFSET&amp;07fff) | (OFFSET&lt;&lt;1)&amp;0x8000)) * 4
     1557INT32* V = (INT32*)(DS + A)
     1558*V = MAX(*V, *(INT32*)(DS + B)) // atomic operation</code></p>
     1559<h4>DS_MAX_SRC2_U32</h4>
     1560<p>Opcode: 136 (0x88)<br />
     1561Syntax: DS_MAX_SRC2_U32 ADDR [OFFSET:OFFSET]<br />
     1562Description: Choose greatest unsigned integer value from LDS/GDS at address
     1563A and at address B, and store result to LDS/GDS at address A.
     1564Refer to listing to learn about addressing. Operation is atomic.<br />
     1565Operation:<br />
     1566<code>UINT16 A = (OFFSET&amp;0x8000) ? ADDR&amp;0x1fffc : ADDR&amp;~3
     1567UINT16 B = A + ((OFFSET&amp;0x8000) ? \
     1568            ((ADDR&gt;&gt;17) | ((ADDR&gt;&gt;16)&amp;0x8000)) : \
     1569            ((OFFSET&amp;07fff) | (OFFSET&lt;&lt;1)&amp;0x8000)) * 4
     1570UINT32* V = (UINT32*)(DS + A)
     1571*V = MAX(*V, *(UINT32*)(DS + B)) // atomic operation</code></p>
    14301572<h4>DS_MAX_U32</h4>
    14311573<p>Opcode: 8 (0x8)<br />
     
    14551597<code>FLOAT* V = (FLOAT*)(DS + (ADDR+OFFSET)&amp;~3)
    14561598*V = MIN(*V, ASFLOAT(VDATA0)) // atomic operation</code></p>
     1599<h4>DS_MIN_F64</h4>
     1600<p>Opcode: 82 (0x52)<br />
     1601Syntax: DS_MIN_F64 ADDR, VDATA0(2) [OFFSET:OFFSET]<br />
     1602Description: Choose smallest double floating point value from LDS/GDS at address
     1603(ADDR+OFFSET) &amp; ~7 and VDATA0, and store result to LDS/GDS at this same address.
     1604Operation is atomic.<br />
     1605Operation:<br />
     1606<code>DOUBLE* V = (DOUBLE*)(DS + (ADDR+OFFSET)&amp;~7)
     1607*V = MIN(*V, ASDOUBLE(VDATA0)) // atomic operation</code></p>
    14571608<h4>DS_MIN_I32</h4>
    14581609<p>Opcode: 5 (0x5)<br />
     
    14821633<code>FLOAT* V = (FLOAT*)(DS + (ADDR+OFFSET)&amp;~3)
    14831634VDST = *V; *V = MIN(*V, ASFLOAT(VDATA0)) // atomic operation</code></p>
     1635<h4>DS_MIN_RTN_F64</h4>
     1636<p>Opcode: 114 (0x72)<br />
     1637Syntax: DS_MIN_F64 VDST(2), ADDR, VDATA0(2) [OFFSET:OFFSET]<br />
     1638Description: Choose smallest double floating point value from LDS/GDS at address
     1639(ADDR+OFFSET) &amp; ~7 and VDATA0, and store result to LDS/GDS at this same address.
     1640Previous value from LDS/GDS are stored in VDST. Operation is atomic.<br />
     1641Operation:<br />
     1642<code>DOUBLE* V = (FLOAT*)(DS + (ADDR+OFFSET)&amp;~7)
     1643VDST = *V; *V = MIN(*V, ASDOUBLE(VDATA0)) // atomic operation</code></p>
    14841644<h4>DS_MIN_RTN_I32</h4>
    14851645<p>Opcode: 37 (0x25)<br />
     
    15181678<code>UINT64* V = (UINT64*)(DS + (ADDR+OFFSET)&amp;~7)
    15191679VDST = *V; *V = MIN(*V, VDATA0) // atomic operation</code></p>
     1680<h4>DS_MIN_SRC2_F32</h4>
     1681<p>Opcode: 146 (0x92)<br />
     1682Syntax: DS_MIN_SRC2_F32 ADDR [OFFSET:OFFSET]<br />
     1683Description: Choose smallest single floating point value from LDS/GDS at address
     1684A and at address B, and store result to LDS/GDS at address A.
     1685Refer to listing to learn about addressing. Operation is atomic.<br />
     1686Operation:<br />
     1687<code>UINT16 A = (OFFSET&amp;0x8000) ? ADDR&amp;0x1fffc : ADDR&amp;~3
     1688UINT16 B = A + ((OFFSET&amp;0x8000) ? \
     1689            ((ADDR&gt;&gt;17) | ((ADDR&gt;&gt;16)&amp;0x8000)) : \
     1690            ((OFFSET&amp;07fff) | (OFFSET&lt;&lt;1)&amp;0x8000)) * 4
     1691FLOAT* V = (FLOAT*)(DS + A)
     1692*V = MIN(*V, *(FLOAT*)(DS + B)) // atomic operation</code></p>
     1693<h4>DS_MIN_SRC2_I32</h4>
     1694<p>Opcode: 133 (0x85)<br />
     1695Syntax: DS_MIN_SRC2_I32 ADDR [OFFSET:OFFSET]<br />
     1696Description: Choose smallest signed integer value from LDS/GDS at address
     1697A and at address B, and store result to LDS/GDS at address A.
     1698Refer to listing to learn about addressing. Operation is atomic.<br />
     1699Operation:<br />
     1700<code>UINT16 A = (OFFSET&amp;0x8000) ? ADDR&amp;0x1fffc : ADDR&amp;~3
     1701UINT16 B = A + ((OFFSET&amp;0x8000) ? \
     1702            ((ADDR&gt;&gt;17) | ((ADDR&gt;&gt;16)&amp;0x8000)) : \
     1703            ((OFFSET&amp;07fff) | (OFFSET&lt;&lt;1)&amp;0x8000)) * 4
     1704INT32* V = (INT32*)(DS + A)
     1705*V = MIN(*V, *(INT32*)(DS + B)) // atomic operation</code></p>
     1706<h4>DS_MIN_SRC2_U32</h4>
     1707<p>Opcode: 135 (0x87)<br />
     1708Syntax: DS_MIN_SRC2_U32 ADDR [OFFSET:OFFSET]<br />
     1709Description: Choose smallest unsigned integer value from LDS/GDS at address
     1710A and at address B, and store result to LDS/GDS at address A.
     1711Refer to listing to learn about addressing. Operation is atomic.<br />
     1712Operation:<br />
     1713<code>UINT16 A = (OFFSET&amp;0x8000) ? ADDR&amp;0x1fffc : ADDR&amp;~3
     1714UINT16 B = A + ((OFFSET&amp;0x8000) ? \
     1715            ((ADDR&gt;&gt;17) | ((ADDR&gt;&gt;16)&amp;0x8000)) : \
     1716            ((OFFSET&amp;07fff) | (OFFSET&lt;&lt;1)&amp;0x8000)) * 4
     1717UINT32* V = (UINT32*)(DS + A)
     1718*V = MIN(*V, *(UINT32*)(DS + B)) // atomic operation</code></p>
    15201719<h4>DS_MIN_U32</h4>
    15211720<p>Opcode: 7 (0x7)<br />
     
    16051804<code>UINT32* V = (UINT32*)(DS + (ADDR+OFFSET)&amp;~3)
    16061805VDST = *V; *V = *V | VDATA0  // atomic operation</code></p>
    1607 <h4>DS_OR_RTN_B32</h4>
     1806<h4>DS_OR_RTN_B64</h4>
    16081807<p>Opcode: 106 (0x6a)<br />
    16091808Syntax: DS_OR_RTN_B64 VDST(2), ADDR, VDATA0(2) [OFFSET:OFFSET]<br />
     
    16141813<code>UINT64* V = (UINT64*)(DS + (ADDR+OFFSET)&amp;~7)
    16151814VDST = *V; *V = *V | VDATA0  // atomic operation</code></p>
     1815<h4>DS_OR_SRC2_B32</h4>
     1816<p>Opcode: 138 (0x8a)<br />
     1817Syntax: DS_OR_SRC2_B32 ADDR [OFFSET:OFFSET]<br />
     1818Description: Do bitwise OR operatin on 32-bit value from LDS/GDS at address
     1819A, and at address B; and store result to LDS/GDS at address A. Operation is atomic.<br />
     1820Operation:<br />
     1821<code>UINT16 A = (OFFSET&amp;0x8000) ? ADDR&amp;0x1fffc : ADDR&amp;~3
     1822UINT16 B = A + ((OFFSET&amp;0x8000) ? \
     1823            ((ADDR&gt;&gt;17) | ((ADDR&gt;&gt;16)&amp;0x8000)) : \
     1824            ((OFFSET&amp;07fff) | (OFFSET&lt;&lt;1)&amp;0x8000)) * 4
     1825UINT32* V = (UINT32*)(DS + A)
     1826*V = *V | *(UINT32*)(DS + B) // atomic operation</code></p>
    16161827<h4>DS_READ_B32</h4>
    16171828<p>Opcode: 54 (0x36)<br />
     
    17011912<code>UINT64* V = (UINT64*)(DS + (ADDR+OFFSET)&amp;~7)
    17021913VDST= *V; *V = VDATA0 - *V  // atomic operation</code></p>
     1914<h4>DS_RSUB_SRC2_U32</h4>
     1915<p>Opcode: 130 (0x82)<br />
     1916Syntax: DS_RSUB_SRC2_U32 ADDR [OFFSET:OFFSET]<br />
     1917Description: Subtract unsigned integer value from LDS/GDS at address A from
     1918value at address B, and store result back to LDS/GDS at address A.
     1919Refer to listing to learn about addressing. Operation is atomic.<br />
     1920Operation:<br />
     1921<code>UINT16 A = (OFFSET&amp;0x8000) ? ADDR&amp;0x1fffc : ADDR&amp;~3
     1922UINT16 B = A + ((OFFSET&amp;0x8000) ? \
     1923            ((ADDR&gt;&gt;17) | ((ADDR&gt;&gt;16)&amp;0x8000)) : \
     1924            ((OFFSET&amp;07fff) | (OFFSET&lt;&lt;1)&amp;0x8000)) * 4
     1925UINT32* V = (UINT32*)(DS + A)
     1926*V = *(UINT32*)(DS + B) - *V // atomic operation</code></p>
    17031927<h4>DS_RSUB_U32</h4>
    17041928<p>Opcode: 2 (0x2)<br />
     
    17371961<code>UINT64* V = (UINT64*)(DS + (ADDR+OFFSET)&amp;~7)
    17381962VDST = *V; *V = *V - VDATA0  // atomic operation</code></p>
     1963<h4>DS_SUB_SRC2_U32</h4>
     1964<p>Opcode: 129 (0x81)<br />
     1965Syntax: DS_SUB_SRC2_U32 ADDR [OFFSET:OFFSET]<br />
     1966Description: Subtract unsigned integer value from LDS/GDS at address B from
     1967value at address A, and store result back to LDS/GDS at address A.
     1968Refer to listing to learn about addressing. Operation is atomic.<br />
     1969Operation:<br />
     1970<code>UINT16 A = (OFFSET&amp;0x8000) ? ADDR&amp;0x1fffc : ADDR&amp;~3
     1971UINT16 B = A + ((OFFSET&amp;0x8000) ? \
     1972            ((ADDR&gt;&gt;17) | ((ADDR&gt;&gt;16)&amp;0x8000)) : \
     1973            ((OFFSET&amp;07fff) | (OFFSET&lt;&lt;1)&amp;0x8000)) * 4
     1974UINT32* V = (UINT32*)(DS + A)
     1975*V = *V - *(UINT32*)(DS + B) // atomic operation</code></p>
     1976<h4>DS_ADD_SRC2_U64</h4>
     1977<p>Opcode: 193 (0xc1)<br />
     1978Syntax: DS_SUB_SRC2_U64 ADDR [OFFSET:OFFSET]<br />
     1979Description: Subtract unsigned 64-bit integer value from LDS/GDS at address B from
     1980value at address A, and store result back to LDS/GDS at address A.
     1981Refer to listing to learn about addressing. Operation is atomic.<br />
     1982Operation:<br />
     1983<code>UINT16 A = (OFFSET&amp;0x8000) ? ADDR&amp;0x1fff8 : ADDR&amp;~7
     1984UINT16 B = (A + ((OFFSET&amp;0x8000) ? \
     1985            ((ADDR&gt;&gt;17) | ((ADDR&gt;&gt;16)&amp;0x8000)) : \
     1986            ((OFFSET&amp;07fff) | (OFFSET&lt;&lt;1)&amp;0x8000)) * 4)&amp;~7
     1987UINT64* V = (UINT64*)(DS + A)
     1988*V = *V - *(UINT64*)(DS + B) // atomic operation</code></p>
    17391989<h4>DS_SUB_U32</h4>
    17401990<p>Opcode: 1 (0x1)<br />
     
    18022052<code>UINT8* V = (UINT8*)(DS + (ADDR+OFFSET))
    18032053*V = VDATA0&amp;0xff</code></p>
     2054<h4>DS_WRITE_SRC2_B32</h4>
     2055<p>Opcode: 141 (0x8d)<br />
     2056Syntax: DS_WRITE_SRC2_B32 ADDR [OFFSET:OFFSET]<br />
     2057Description: Store value from LDS/GDS at address B into LDS/GDS at address A.<br />
     2058Operation:<br />
     2059<code>UINT16 A = (OFFSET&amp;0x8000) ? ADDR&amp;0x1fffc : ADDR&amp;~3
     2060UINT16 B = A + ((OFFSET&amp;0x8000) ? \
     2061            ((ADDR&gt;&gt;17) | ((ADDR&gt;&gt;16)&amp;0x8000)) : \
     2062            ((OFFSET&amp;07fff) | (OFFSET&lt;&lt;1)&amp;0x8000)) * 4
     2063*(UINT32*)(DS + A) = *(UINT32*)(DS + B)</code></p>
    18042064<h4>DS_WRITE2_B32</h4>
    18052065<p>Opcode: 14 (0xe)<br />
     
    19462206<code>UINT64* V = (UINT64*)(DS + (ADDR+OFFSET)&amp;~7)
    19472207VDST = *V; *V = *V ^ VDATA0  // atomic operation</code></p>
     2208<h4>DS_XOR_SRC2_B32</h4>
     2209<p>Opcode: 139 (0x8b)<br />
     2210Syntax: DS_XOR_SRC2_B32 ADDR [OFFSET:OFFSET]<br />
     2211Description: Do bitwise XOR operatin on 32-bit value from LDS/GDS at address
     2212A, and at address B; and store result to LDS/GDS at address A. Operation is atomic.<br />
     2213Operation:<br />
     2214<code>UINT16 A = (OFFSET&amp;0x8000) ? ADDR&amp;0x1fffc : ADDR&amp;~3
     2215UINT16 B = A + ((OFFSET&amp;0x8000) ? \
     2216            ((ADDR&gt;&gt;17) | ((ADDR&gt;&gt;16)&amp;0x8000)) : \
     2217            ((OFFSET&amp;07fff) | (OFFSET&lt;&lt;1)&amp;0x8000)) * 4
     2218UINT32* V = (UINT32*)(DS + A)
     2219*V = *V | *(UINT32*)(DS + B) // atomic operation</code></p>
    19482220}}}