Changes between Version 6 and Version 7 of GcnInstrsMimg
- Timestamp:
- 01/15/16 00:00:24 (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GcnInstrsMimg
v6 v7 1044 1044 Syntax: IMAGE_ATOMIC_ADD VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br /> 1045 1045 Description: 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 1046 to values of image SRSRC at address VADDR, and store result into image. 1047 If GLC is set then return old values 1047 1048 from image, otherwise keep VDATA value. Only 32-bit, 64-bit and 128-bit data formats 1048 1049 are supported. Operation is atomic.<br /> … … 1055 1056 for (BYTE i = 0; i < (sizeof(VDATA)>>3); i++) 1056 1057 ((UINT64*)VM)[i] = VDATA[i]+((UINT64*)VM)[i] 1058 VDATA = (GLC) ? P : VDATA // atomic</code></p> 1059 <h4>IMAGE_ATOMIC_AND</h4> 1060 <p>Opcode: 24 (0x18)<br /> 1061 Syntax: IMAGE_ATOMIC_AND VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br /> 1062 Description: Do bitwise AND on VDATA dwords and values of image SRSRC at address VADDR, 1063 and store result into image. If GLC is set then return old values from image, 1064 otherwise keep VDATA value. Only 32-bit, 64-bit and 128-bit data formats are supported. 1065 Operation is atomic.<br /> 1066 Operation:<br /> 1067 <code>PIXELTYPE* VM = VMIMG(SRSRC, VADDR) 1068 PIXELTYPE P = *VM; 1069 for (BYTE i = 0; i < (sizeof(VDATA)>>2); i++) 1070 ((UINT*)VM)[i] = VDATA[i] & ((UINT*)VM)[i] 1057 1071 VDATA = (GLC) ? P : VDATA // atomic</code></p> 1058 1072 <h4>IMAGE_ATOMIC_CMPSWAP</h4> … … 1071 1085 PIXELTYPE P = *VM; *VM = *VM==(VDH) ? VDL : *VM // part of atomic 1072 1086 VDATA[0:(VDATA_SIZE>>1)-1] = (GLC) ? P : VDL // last part of atomic</code></p> 1087 <h4>IMAGE_ATOMIC_DEC</h4> 1088 <p>Opcode: 28 (0x1c)<br /> 1089 Syntax: IMAGE_ATOMIC_DEC VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br /> 1090 Description: Compare dwords or 64-bit words (if VDATA size is greater than 32-bit) 1091 of image SRSRC and if less or equal than VDATA words and this value is not zero, 1092 then decrement value from image, otherwise store VDATA into image. 1093 If GLC is set then return old values from image, otherwise keep VDATA value. 1094 Only 32-bit, 64-bit and 128-bit data formats are supported. Operation is atomic.<br /> 1095 Operation:<br /> 1096 <code>PIXELTYPE* VM = VMIMG(SRSRC, VADDR) 1097 PIXELTYPE P = *VM; 1098 if (sizeof(PIXELTYPE)==4) 1099 ((UINT*)VM)[0] = (*(UINT*)VM <= VDATA[0] && *(UINT*)VM!=0) ? \ 1100 *(UINT*)VM-1 : VDATA 1101 else // add 64-bit dwords 1102 for (BYTE i = 0; i < (sizeof(VDATA)>>3); i++) 1103 ((UINT64*)VM)[i] = (((UINT64*)VM)[i] <= VDATA[i] && ((UINT64*)VM)[i]!=0) ? \ 1104 ((UINT64*)VM)[i]-1 : VDATA[i] 1105 VDATA = (GLC) ? P : VDATA // atomic</code></p> 1106 <h4>IMAGE_ATOMIC_INC</h4> 1107 <p>Opcode: 27 (0x1b)<br /> 1108 Syntax: IMAGE_ATOMIC_INC VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br /> 1109 Description: Compare dwords or 64-bit words (if VDATA size is greater than 32-bit) of 1110 image SRSRC and if less than VDATA words, then increment value from image, 1111 otherwise store zero into image. If GLC is set then return old values from image, 1112 otherwise keep VDATA value. Only 32-bit, 64-bit and 128-bit data formats are supported. 1113 Operation is atomic.<br /> 1114 Operation:<br /> 1115 <code>PIXELTYPE* VM = VMIMG(SRSRC, VADDR) 1116 PIXELTYPE P = *VM; 1117 if (sizeof(PIXELTYPE)==4) 1118 ((UINT*)VM)[0] = (*(UINT*)VM < VDATA[0]) ? *(UINT*)VM-1 : 0 1119 else // add 64-bit dwords 1120 for (BYTE i = 0; i < (sizeof(VDATA)>>3); i++) 1121 ((UINT64*)VM)[i] = (((UINT64*)VM)[i] < VDATA[i]) ? ((UINT64*)VM)[i]+1 : 0 1122 VDATA = (GLC) ? P : VDATA // atomic</code></p> 1123 <h4>IMAGE_ATOMIC_OR</h4> 1124 <p>Opcode: 25 (0x19)<br /> 1125 Syntax: IMAGE_ATOMIC_OR VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br /> 1126 Description: Do bitwise OR on VDATA dwords and values of image SRSRC at address VADDR, 1127 and store result into image. If GLC is set then return old values from image, 1128 otherwise keep VDATA value. Only 32-bit, 64-bit and 128-bit data formats are supported. 1129 Operation is atomic.<br /> 1130 Operation:<br /> 1131 <code>PIXELTYPE* VM = VMIMG(SRSRC, VADDR) 1132 PIXELTYPE P = *VM; 1133 for (BYTE i = 0; i < (sizeof(VDATA)>>2); i++) 1134 ((UINT*)VM)[i] = VDATA[i] | ((UINT*)VM)[i] 1135 VDATA = (GLC) ? P : VDATA // atomic</code></p> 1073 1136 <h4>IMAGE_ATOMIC_RSUB</h4> 1074 1137 <p>Opcode: 19 (0x13) for GCN 1.0/1.1<br /> 1075 1138 Syntax: IMAGE_ATOMIC_RSUB VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br /> 1076 1139 Description: 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 values1078 from image, otherwise keep VDATA value. Only 32-bit, 64-bit and 128-bit data formats 1079 are supported. Operation is atomic.<br />1140 words (if VDATA size is greater than 32-bit), and store result into image. 1141 If GLC is set then return old values from image, otherwise keep VDATA value. 1142 Only 32-bit, 64-bit and 128-bit data formats are supported. Operation is atomic.<br /> 1080 1143 Operation:<br /> 1081 1144 <code>PIXELTYPE* VM = VMIMG(SRSRC, VADDR) … … 1092 1155 Description: Choose greatest signed dwords or 64-bit words 1093 1156 (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 values1095 from image, otherwise keep VDATA value. Only 32-bit, 64-bit and 128-bit data formats 1096 are supported. Operation is atomic.<br />1157 values of image SRSRC at address VADDR, and store result into image. 1158 If GLC is set then return old values from image, otherwise keep VDATA value. 1159 Only 32-bit, 64-bit and 128-bit data formats are supported. Operation is atomic.<br /> 1097 1160 Operation:<br /> 1098 1161 <code>PIXELTYPE* VM = VMIMG(SRSRC, VADDR) … … 1109 1172 Description: Choose smallest signed dwords or 64-bit words 1110 1173 (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 values1112 from image, otherwise keep VDATA value. Only 32-bit, 64-bit and 128-bit data formats 1113 are supported. Operation is atomic.<br />1174 values of image SRSRC at address VADDR, and store result into image. 1175 If GLC is set then return old values from image, otherwise keep VDATA value. 1176 Only 32-bit, 64-bit and 128-bit data formats are supported. Operation is atomic.<br /> 1114 1177 Operation:<br /> 1115 1178 <code>PIXELTYPE* VM = VMIMG(SRSRC, VADDR) … … 1125 1188 Syntax: IMAGE_ATOMIC_SUB VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br /> 1126 1189 Description: 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 1190 from values of image SRSRC at address VADDR, and store result into image. 1191 If GLC is set then return old values from image, otherwise keep VDATA value. 1192 Only 32-bit, 64-bit and 128-bit data formats 1129 1193 are supported. Operation is atomic.<br /> 1130 1194 Operation:<br /> … … 1150 1214 Description: Choose greatest unsigned dwords or 64-bit words 1151 1215 (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 values1153 from image, otherwise keep VDATA value. Only 32-bit, 64-bit and 128-bit data formats 1154 are supported. Operation is atomic.<br />1216 values of image SRSRC at address VADDR, and store result into image. 1217 If GLC is set then return old values from image, otherwise keep VDATA value. 1218 Only 32-bit, 64-bit and 128-bit data formats are supported. Operation is atomic.<br /> 1155 1219 Operation:<br /> 1156 1220 <code>PIXELTYPE* VM = VMIMG(SRSRC, VADDR) … … 1167 1231 Description: Choose smallest unsigned dwords or 64-bit words 1168 1232 (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 values1170 from image, otherwise keep VDATA value. Only 32-bit, 64-bit and 128-bit data formats 1171 are supported. Operation is atomic.<br />1233 values of image SRSRC at address VADDR, and store result into image. 1234 If GLC is set then return old values from image, otherwise keep VDATA value. 1235 Only 32-bit, 64-bit and 128-bit data formats are supported. Operation is atomic.<br /> 1172 1236 Operation:<br /> 1173 1237 <code>PIXELTYPE* VM = VMIMG(SRSRC, VADDR) … … 1178 1242 for (BYTE i = 0; i < (sizeof(VDATA)>>3); i++) 1179 1243 ((UINT64*)VM)[i] = MIN(VDATA[i],((UINT64*)VM)[i]) 1244 VDATA = (GLC) ? P : VDATA // atomic</code></p> 1245 <h4>IMAGE_ATOMIC_XOR</h4> 1246 <p>Opcode: 26 (0x1a)<br /> 1247 Syntax: IMAGE_ATOMIC_XOR VDATA(1:4), VADDR(1:4), SRSRC(4,8)<br /> 1248 Description: Do bitwise XOR on VDATA dwords and values of image SRSRC at address VADDR, 1249 and store result into image. If GLC is set then return old values from image, 1250 otherwise keep VDATA value. Only 32-bit, 64-bit and 128-bit data formats are supported. 1251 Operation is atomic.<br /> 1252 Operation:<br /> 1253 <code>PIXELTYPE* VM = VMIMG(SRSRC, VADDR) 1254 PIXELTYPE P = *VM; 1255 for (BYTE i = 0; i < (sizeof(VDATA)>>2); i++) 1256 ((UINT*)VM)[i] = VDATA[i] ^ ((UINT*)VM)[i] 1180 1257 VDATA = (GLC) ? P : VDATA // atomic</code></p> 1181 1258 <h4>IMAGE_LOAD</h4>