Changes between Version 6 and Version 7 of GcnInstrsMimg


Ignore:
Timestamp:
01/15/16 00:00:24 (8 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GcnInstrsMimg

    v6 v7  
    10441044Syntax: IMAGE_ATOMIC_ADD VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br />
    10451045Description: Add VDATA dwords or 64-bit words (if VDATA size is greater than 32-bit)
    1046 to values of image SRSRC at address VADDR. If GLC is set then return old values
     1046to values of image SRSRC at address VADDR, and store result into image.
     1047If GLC is set then return old values
    10471048from image, otherwise keep VDATA value. Only 32-bit, 64-bit and 128-bit data formats
    10481049are supported. Operation is atomic.<br />
     
    10551056    for (BYTE i = 0; i &lt; (sizeof(VDATA)&gt;&gt;3); i++)
    10561057        ((UINT64*)VM)[i] = VDATA[i]+((UINT64*)VM)[i]
     1058VDATA = (GLC) ? P : VDATA // atomic</code></p>
     1059<h4>IMAGE_ATOMIC_AND</h4>
     1060<p>Opcode: 24 (0x18)<br />
     1061Syntax: IMAGE_ATOMIC_AND VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br />
     1062Description: Do bitwise AND on VDATA dwords and values of image SRSRC at address VADDR,
     1063and store result into image. If GLC is set then return old values from image,
     1064otherwise keep VDATA value. Only 32-bit, 64-bit and 128-bit data formats are supported.
     1065Operation is atomic.<br />
     1066Operation:<br />
     1067<code>PIXELTYPE* VM = VMIMG(SRSRC, VADDR)
     1068PIXELTYPE P = *VM;
     1069for (BYTE i = 0; i &lt; (sizeof(VDATA)&gt;&gt;2); i++)
     1070    ((UINT*)VM)[i] = VDATA[i] &amp; ((UINT*)VM)[i]
    10571071VDATA = (GLC) ? P : VDATA // atomic</code></p>
    10581072<h4>IMAGE_ATOMIC_CMPSWAP</h4>
     
    10711085PIXELTYPE P = *VM; *VM = *VM==(VDH) ? VDL : *VM // part of atomic
    10721086VDATA[0:(VDATA_SIZE&gt;&gt;1)-1] = (GLC) ? P : VDL // last part of atomic</code></p>
     1087<h4>IMAGE_ATOMIC_DEC</h4>
     1088<p>Opcode: 28 (0x1c)<br />
     1089Syntax: IMAGE_ATOMIC_DEC VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br />
     1090Description: Compare dwords or 64-bit words (if VDATA size is greater than 32-bit)
     1091of image SRSRC and if less or equal than VDATA words and this value is not zero,
     1092then decrement value from image, otherwise store VDATA into image.
     1093If GLC is set then return old values from image, otherwise keep VDATA value.
     1094Only 32-bit, 64-bit and 128-bit data formats are supported. Operation is atomic.<br />
     1095Operation:<br />
     1096<code>PIXELTYPE* VM = VMIMG(SRSRC, VADDR)
     1097PIXELTYPE P = *VM;
     1098if (sizeof(PIXELTYPE)==4)
     1099    ((UINT*)VM)[0] = (*(UINT*)VM &lt;= VDATA[0] &amp;&amp; *(UINT*)VM!=0) ? \
     1100        *(UINT*)VM-1 : VDATA
     1101else    // add 64-bit dwords
     1102    for (BYTE i = 0; i &lt; (sizeof(VDATA)&gt;&gt;3); i++)
     1103        ((UINT64*)VM)[i] = (((UINT64*)VM)[i] &lt;= VDATA[i] &amp;&amp; ((UINT64*)VM)[i]!=0) ? \
     1104                 ((UINT64*)VM)[i]-1 : VDATA[i]
     1105VDATA = (GLC) ? P : VDATA // atomic</code></p>
     1106<h4>IMAGE_ATOMIC_INC</h4>
     1107<p>Opcode: 27 (0x1b)<br />
     1108Syntax: IMAGE_ATOMIC_INC VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br />
     1109Description: Compare dwords or 64-bit words (if VDATA size is greater than 32-bit) of
     1110image SRSRC and if less than VDATA words, then increment value from image,
     1111otherwise store zero into image. If GLC is set then return old values from image,
     1112otherwise keep VDATA value. Only 32-bit, 64-bit and 128-bit data formats are supported.
     1113Operation is atomic.<br />
     1114Operation:<br />
     1115<code>PIXELTYPE* VM = VMIMG(SRSRC, VADDR)
     1116PIXELTYPE P = *VM;
     1117if (sizeof(PIXELTYPE)==4)
     1118    ((UINT*)VM)[0] = (*(UINT*)VM &lt; VDATA[0]) ? *(UINT*)VM-1 : 0
     1119else    // add 64-bit dwords
     1120    for (BYTE i = 0; i &lt; (sizeof(VDATA)&gt;&gt;3); i++)
     1121        ((UINT64*)VM)[i] = (((UINT64*)VM)[i] &lt; VDATA[i]) ? ((UINT64*)VM)[i]+1 : 0
     1122VDATA = (GLC) ? P : VDATA // atomic</code></p>
     1123<h4>IMAGE_ATOMIC_OR</h4>
     1124<p>Opcode: 25 (0x19)<br />
     1125Syntax: IMAGE_ATOMIC_OR VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br />
     1126Description: Do bitwise OR on VDATA dwords and values of image SRSRC at address VADDR,
     1127and store result into image. If GLC is set then return old values from image,
     1128otherwise keep VDATA value. Only 32-bit, 64-bit and 128-bit data formats are supported.
     1129Operation is atomic.<br />
     1130Operation:<br />
     1131<code>PIXELTYPE* VM = VMIMG(SRSRC, VADDR)
     1132PIXELTYPE P = *VM;
     1133for (BYTE i = 0; i &lt; (sizeof(VDATA)&gt;&gt;2); i++)
     1134    ((UINT*)VM)[i] = VDATA[i] | ((UINT*)VM)[i]
     1135VDATA = (GLC) ? P : VDATA // atomic</code></p>
    10731136<h4>IMAGE_ATOMIC_RSUB</h4>
    10741137<p>Opcode: 19 (0x13) for GCN 1.0/1.1<br />
    10751138Syntax: IMAGE_ATOMIC_RSUB VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br />
    10761139Description: Subtract values of image SRSRC at address VADDR from VDATA dwords or 64-bit
    1077 words (if VDATA size is greater than 32-bit). If GLC is set then return old values
    1078 from image, otherwise keep VDATA value. Only 32-bit, 64-bit and 128-bit data formats
    1079 are supported. Operation is atomic.<br />
     1140words (if VDATA size is greater than 32-bit), and store result into image.
     1141If GLC is set then return old values from image, otherwise keep VDATA value.
     1142Only 32-bit, 64-bit and 128-bit data formats are supported. Operation is atomic.<br />
    10801143Operation:<br />
    10811144<code>PIXELTYPE* VM = VMIMG(SRSRC, VADDR)
     
    10921155Description: Choose greatest signed dwords or 64-bit words
    10931156(if VDATA size is greater than 32-bit) between VDATA values and
    1094 values of image SRSRC at address VADDR. If GLC is set then return old values
    1095 from image, otherwise keep VDATA value. Only 32-bit, 64-bit and 128-bit data formats
    1096 are supported. Operation is atomic.<br />
     1157values of image SRSRC at address VADDR, and store result into image.
     1158If GLC is set then return old values from image, otherwise keep VDATA value.
     1159Only 32-bit, 64-bit and 128-bit data formats are supported. Operation is atomic.<br />
    10971160Operation:<br />
    10981161<code>PIXELTYPE* VM = VMIMG(SRSRC, VADDR)
     
    11091172Description: Choose smallest signed dwords or 64-bit words
    11101173(if VDATA size is greater than 32-bit) between VDATA values and
    1111 values of image SRSRC at address VADDR. If GLC is set then return old values
    1112 from image, otherwise keep VDATA value. Only 32-bit, 64-bit and 128-bit data formats
    1113 are supported. Operation is atomic.<br />
     1174values of image SRSRC at address VADDR, and store result into image.
     1175If GLC is set then return old values from image, otherwise keep VDATA value.
     1176Only 32-bit, 64-bit and 128-bit data formats are supported. Operation is atomic.<br />
    11141177Operation:<br />
    11151178<code>PIXELTYPE* VM = VMIMG(SRSRC, VADDR)
     
    11251188Syntax: IMAGE_ATOMIC_SUB VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br />
    11261189Description: Subtract VDATA dwords or 64-bit words (if VDATA size is greater than 32-bit)
    1127 from values of image SRSRC at address VADDR. If GLC is set then return old values
    1128 from image, otherwise keep VDATA value. Only 32-bit, 64-bit and 128-bit data formats
     1190from values of image SRSRC at address VADDR, and store result into image.
     1191If GLC is set then return old values from image, otherwise keep VDATA value.
     1192Only 32-bit, 64-bit and 128-bit data formats
    11291193are supported. Operation is atomic.<br />
    11301194Operation:<br />
     
    11501214Description: Choose greatest unsigned dwords or 64-bit words
    11511215(if VDATA size is greater than 32-bit) between VDATA values and
    1152 values of image SRSRC at address VADDR. If GLC is set then return old values
    1153 from image, otherwise keep VDATA value. Only 32-bit, 64-bit and 128-bit data formats
    1154 are supported. Operation is atomic.<br />
     1216values of image SRSRC at address VADDR, and store result into image.
     1217If GLC is set then return old values from image, otherwise keep VDATA value.
     1218Only 32-bit, 64-bit and 128-bit data formats are supported. Operation is atomic.<br />
    11551219Operation:<br />
    11561220<code>PIXELTYPE* VM = VMIMG(SRSRC, VADDR)
     
    11671231Description: Choose smallest unsigned dwords or 64-bit words
    11681232(if VDATA size is greater than 32-bit) between VDATA values and
    1169 values of image SRSRC at address VADDR. If GLC is set then return old values
    1170 from image, otherwise keep VDATA value. Only 32-bit, 64-bit and 128-bit data formats
    1171 are supported. Operation is atomic.<br />
     1233values of image SRSRC at address VADDR, and store result into image.
     1234If GLC is set then return old values from image, otherwise keep VDATA value.
     1235Only 32-bit, 64-bit and 128-bit data formats are supported. Operation is atomic.<br />
    11721236Operation:<br />
    11731237<code>PIXELTYPE* VM = VMIMG(SRSRC, VADDR)
     
    11781242    for (BYTE i = 0; i &lt; (sizeof(VDATA)&gt;&gt;3); i++)
    11791243        ((UINT64*)VM)[i] = MIN(VDATA[i],((UINT64*)VM)[i])
     1244VDATA = (GLC) ? P : VDATA // atomic</code></p>
     1245<h4>IMAGE_ATOMIC_XOR</h4>
     1246<p>Opcode: 26 (0x1a)<br />
     1247Syntax: IMAGE_ATOMIC_XOR VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br />
     1248Description: Do bitwise XOR on VDATA dwords and values of image SRSRC at address VADDR,
     1249and store result into image. If GLC is set then return old values from image,
     1250otherwise keep VDATA value. Only 32-bit, 64-bit and 128-bit data formats are supported.
     1251Operation is atomic.<br />
     1252Operation:<br />
     1253<code>PIXELTYPE* VM = VMIMG(SRSRC, VADDR)
     1254PIXELTYPE P = *VM;
     1255for (BYTE i = 0; i &lt; (sizeof(VDATA)&gt;&gt;2); i++)
     1256    ((UINT*)VM)[i] = VDATA[i] ^ ((UINT*)VM)[i]
    11801257VDATA = (GLC) ? P : VDATA // atomic</code></p>
    11811258<h4>IMAGE_LOAD</h4>