Changes between Version 3 and Version 4 of GcnInstrsMimg


Ignore:
Timestamp:
01/14/16 17:00:17 (8 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GcnInstrsMimg

    v3 v4  
    22{{{
    33#!html
    4 <h2>GCN ISA MTBUF instructions</h2>
     4<h2>GCN ISA MIMG instructions</h2>
    55<p>These instructions allow to access to images. MIMG instructions
    66operates on the image resources and on the sampler resources.</p>
     
    10401040<h3>Instruction set</h3>
    10411041<p>Alphabetically sorted instruction list:</p>
     1042<h4>IMAGE_LOAD</h4>
     1043<p>Opcode: 0 (0x0)<br />
     1044Syntax: IMAGE_LOAD VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br />
     1045Description: Load data from image SRSRC from pixel at address VADDR, and store their data
     1046to VDATA. Loaded data are converted to format given in image resource.<br />
     1047Operation:<br />
     1048<code>UINT* V = VMIMG(SRSRC, VADDR)
     1049VDATA = GET_SAMPLES(CONVERT_FROM_IMAGE(SRSRC, V), DMASK)</code></p>
     1050<h4>IMAGE_LOAD_MIP</h4>
     1051<p>Opcode: 1 (0x1)<br />
     1052Syntax: IMAGE_LOAD_MIP VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br />
     1053Description: Load data from image SRSRC from pixel at address VADDR including MIP index,
     1054and store their data to VDATA. Loaded data are converted to format given in
     1055image resource.<br />
     1056Operation:<br />
     1057<code>UINT* V = VMIMG_MIP(SRSRC, VADDR)
     1058VDATA = GET_SAMPLES(CONVERT_FROM_IMAGE(SRSRC, V), DMASK)</code></p>
     1059<h4>IMAGE_LOAD_MIP_PCK</h4>
     1060<p>Opcode: 4 (0x4)<br />
     1061Syntax: IMAGE_LOAD_MIP_PCK VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br />
     1062Description: Load data from image SRSRC from pixel at address VADDR including MIP index,
     1063and store their data to VDATA. Loaded data are raw without any conversion. DMASK controls
     1064what dwords will be stored to VDATA.<br />
     1065Operation:<br />
     1066<code>UINT* V = VMIMG_MIP(SRSRC, VADDR)
     1067VDATA = GET_SAMPLES(V, DMASK)</code></p>
     1068<h4>IMAGE_LOAD_MIP_PCK_SGN</h4>
     1069<p>Opcode: 5 (0x5)<br />
     1070Syntax: IMAGE_LOAD_MIP_PCK_SGN VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br />
     1071Description: Load data from image SRSRC from pixel at address VADDR including MIP index,
     1072and store their data to VDATA. Loaded data are raw without any conversion,
     1073but sign extended. DMASK controls what dwords will be stored to VDATA.<br />
     1074Operation:<br />
     1075<code>UINT* V = VMIMG_MIP(SRSRC, VADDR)
     1076VDATA = GET_SAMPLES(V, DMASK)
     1077BYTE COMPBITS = COMPBITS(SRSRC)
     1078for (BYTE i = 0; i &lt; BIT_CNT(DMASK); i++)
     1079    VDATA[i] = SEXT(VDATA[i], COMPBITS)</code></p>
     1080<h4>IMAGE_LOAD_PCK</h4>
     1081<p>Opcode: 2 (0x2)<br />
     1082Syntax: IMAGE_LOAD_PCK VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br />
     1083Description: Load data from image SRSRC from pixel at address VADDR, and store their data
     1084to VDATA. Loaded data are raw without any conversion. DMASK controls what dwords
     1085will be stored to VDATA.<br />
     1086Operation:<br />
     1087<code>UINT* V = VMIMG(SRSRC, VADDR)
     1088VDATA = GET_SAMPLES(V, DMASK)</code></p>
     1089<h4>IMAGE_LOAD_PCK_SGN</h4>
     1090<p>Opcode: 3 (0x3)<br />
     1091Syntax: IMAGE_LOAD_PCK_SGN VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br />
     1092Description: Load data from image SRSRC from pixel at address VADDR, and store their data
     1093to VDATA. Loaded data are raw without any conversion, but sign extended.
     1094DMASK controls what dwords will be stored to VDATA.<br />
     1095Operation:<br />
     1096<code>UINT* V = VMIMG(SRSRC, VADDR)
     1097VDATA = GET_SAMPLES(V, DMASK)
     1098BYTE COMPBITS = COMPBITS(SRSRC)
     1099for (BYTE i = 0; i &lt; BIT_CNT(DMASK); i++)
     1100    VDATA[i] = SEXT(VDATA[i], COMPBITS)</code></p>
     1101<h4>IMAGE_STORE</h4>
     1102<p>Opcode: 8 (0x8)<br />
     1103Syntax: IMAGE_STORE VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br />
     1104Description: Store data VDATA into image SRSRC to pixel at address VADDR. Data in VDATA
     1105is in format given image resource.<br />
     1106Operation:<br />
     1107<code>UINT* V = VMIMG(SRSRC, VADDR)
     1108STORE_IMAGE(V, CONVERT_TO_IMAGE(SRSRC, VDATA), DMASK)</code></p>
     1109<h4>IMAGE_STORE_MIP</h4>
     1110<p>Opcode: 9 (0x9)<br />
     1111Syntax: IMAGE_STORE_MIP VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br />
     1112Description: Store data VDATA into image SRSRC to pixel at address VADDR including
     1113MIP index. Data in VDATA is in format given image resource.<br />
     1114Operation:<br />
     1115<code>UINT* V = VMIMG_MIP (SRSRC, VADDR)
     1116STORE_IMAGE(V, CONVERT_TO_IMAGE(SRSRC, VDATA), DMASK)</code></p>
     1117<h4>IMAGE_STORE_PCK</h4>
     1118<p>Opcode: 10 (0xa)<br />
     1119Syntax: IMAGE_STORE_PCK VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br />
     1120Description: Store data VDATA into image SRSRC to pixel at address VADDR. Data in VDATA
     1121is in raw format.<br />
     1122Operation:<br />
     1123<code>UINT* V = VMIMG(SRSRC, VADDR)
     1124STORE_IMAGE(V, VDATA, DMASK)</code></p>
     1125<h4>IMAGE_STORE_MIP_PCK</h4>
     1126<p>Opcode: 11 (0xb)<br />
     1127Syntax: IMAGE_STORE_MIP_PCK VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br />
     1128Description: Store data VDATA into image SRSRC to pixel at address VADDR including
     1129MIP index. Data in VDATA is in raw format.<br />
     1130Operation:<br />
     1131<code>UINT* V = VMIMG_MIP(SRSRC, VADDR)
     1132STORE_IMAGE(V, VDATA, DMASK)</code></p>
    10421133}}}