| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
from rocisa.code import Module |
| 26 |
from rocisa.container import ContinuousRegister, vgpr, sgpr |
| 27 |
from rocisa.instruction import SMulI32, VAddLShiftLeftU32, VAddU32, VMovB32, VMulLOU32 |
| 28 |
from rocisa.functions import vectorStaticRemainder, vectorStaticDivideAndRemainder, vectorStaticDivide, vectorStaticMultiply |
| 29 |
|
| 30 |
from ..Component import ComputeStoreVgprs |
| 31 |
from ..Common import DataDirection, log2 |
| 32 |
|
| 33 |
class ComputeStoreVgprsVALU(ComputeStoreVgprs): |
| 34 |
kernel = {"EnableMatrixInstruction": False, |
| 35 |
"SourceSwap": False} |
| 36 |
|
| 37 |
""" |
| 38 |
computeStoreVgprs |
| 39 |
Compute workitem/TT offsets in VGPRS |
| 40 |
and coord0/coord1 |
| 41 |
tid0Scale specifies the number of output elements in 0/coalesced dim |
| 42 |
that should be written by each work-item in each batch element. |
| 43 |
""" |
| 44 |
def __call__(self, writer, kernel, divisor, tid0Scale, tid1Scale): |
| 45 |
|
| 46 |
module = Module("ComputeStoreVgprsVALU") |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
wg0="WorkGroup0" |
| 57 |
wg1="WorkGroup1" |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
tid0 = writer.vgprPool.checkOut(1, "tid0") |
| 63 |
tid1 = writer.vgprPool.checkOut(1, "tid1") |
| 64 |
|
| 65 |
packedC1 = kernel["PackedC1IndicesX"] |
| 66 |
|
| 67 |
if kernel["BufferStore"]: |
| 68 |
writer.vgprs.cinRowPtr = writer.vgprPool.checkOut(1, "cinRowPtr") |
| 69 |
writer.vgprs.coutRowPtrD = writer.vgprPool.checkOut(1, "coutRowPtrD") |
| 70 |
|
| 71 |
with writer.allocTmpSgpr(3) as tmpSgprInfo: |
| 72 |
tmpS0 = tmpSgprInfo.idx |
| 73 |
tmpS1 = tmpS0+1 |
| 74 |
wgMT1 = tmpS0+2 |
| 75 |
tmpVgpr = writer.vgprPool.checkOutAligned(2,2,"tmpVgpr") |
| 76 |
tmpVgprRes = ContinuousRegister(tmpVgpr, 2) |
| 77 |
|
| 78 |
if kernel["NumWaveSplitK"] > 1: |
| 79 |
newSerial = writer.vgprPool.checkOut(1, "newSerial") |
| 80 |
module.add(vectorStaticDivide(newSerial, "Serial", kernel["NumWaveSplitK"], tmpVgprRes, comment="Divided by NumWaveSplitK")) |
| 81 |
module.add(vectorStaticDivideAndRemainder(tid1, tid0, newSerial, divisor, tmpVgprRes)) |
| 82 |
writer.vgprPool.checkIn(newSerial) |
| 83 |
else: |
| 84 |
module.add(vectorStaticDivideAndRemainder(tid1, tid0, "Serial", divisor, tmpVgprRes)) |
| 85 |
|
| 86 |
writer.vgprPool.checkIn(tmpVgpr) |
| 87 |
tmpS1Res = ContinuousRegister(tmpS1, 1) |
| 88 |
module.add(vectorStaticMultiply(vgpr(tid0), vgpr(tid0), tid0Scale, tmpS1Res)) |
| 89 |
if tid1Scale != 1: |
| 90 |
module.add(vectorStaticMultiply(vgpr(tid1), vgpr(tid1), tid1Scale, tmpS1Res)) |
| 91 |
|
| 92 |
if kernel["BufferStore"]: |
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
strideC1 = "StrideC%s" % (writer.states.indexChars[packedC1[0]]) |
| 103 |
module.add(VMulLOU32(dst=vgpr(writer.vgprs.cinRowPtr), src0=vgpr(tid1), src1=sgpr(strideC1), comment="rowStart vgpr")) |
| 104 |
strideD1 = "StrideD%s" % (writer.states.indexChars[packedC1[0]]) |
| 105 |
module.add(VMulLOU32(dst=vgpr(writer.vgprs.coutRowPtrD), src0=vgpr(tid1), src1=sgpr(strideD1), comment="rowStart vgpr")) |
| 106 |
module.addSpaceLine() |
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
module.add(SMulI32(dst=sgpr(tmpS0), src0=hex(kernel["MacroTile0"]), src1=sgpr(wg0), comment="%s = wg0*MT0"%sgpr(tmpS0))) |
| 114 |
|
| 115 |
|
| 116 |
module.add(VAddU32(dst=vgpr(tid0), src0=sgpr(tmpS0), src1=vgpr(tid0), comment="coord0 = tid0*VW + wg0*MT0")) |
| 117 |
module.add(SMulI32(dst=sgpr(wgMT1), src0=hex(kernel["MacroTile1"]), src1=sgpr(wg1), comment="<- wg1*MT1")) |
| 118 |
module.add(VAddU32(dst=vgpr(tid1), src0=sgpr(wgMT1), src1=vgpr(tid1), comment="coord1 = tid1*VW + wg1*MT1")) |
| 119 |
|
| 120 |
if len(packedC1) > 1: |
| 121 |
module.add(writer.extractPackedCoord1ToRowStart(kernel, packedC1, tid1, 'D')) |
| 122 |
|
| 123 |
writer.vgprs.coord0 = tid0 |
| 124 |
writer.vgprs.coord1 = tid1 |
| 125 |
|
| 126 |
return module |
| 127 |
|
| 128 |
class ComputeStoreVgprsMFMA(ComputeStoreVgprs): |
| 129 |
kernel = {"EnableMatrixInstruction": True, |
| 130 |
"SourceSwap": False} |
| 131 |
|
| 132 |
""" |
| 133 |
computeStoreVgprs |
| 134 |
Compute workitem/TT offsets in VGPRS |
| 135 |
and coord0/coord1 |
| 136 |
tid0Scale specifies the number of output elements in 0/coalesced dim |
| 137 |
that should be written by each work-item in each batch element. |
| 138 |
""" |
| 139 |
def __call__(self, writer, kernel): |
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
tid0 = writer.vgprPool.checkOut(1, "coord0") |
| 148 |
tid1 = writer.vgprPool.checkOut(1, "coord1") |
| 149 |
if kernel["BufferStore"]: |
| 150 |
writer.vgprs.cinRowPtr = writer.vgprPool.checkOut(1, "cinRowPtr") |
| 151 |
writer.vgprs.coutRowPtrD = writer.vgprPool.checkOut(1, "coutRowPtrD") |
| 152 |
if kernel["ProblemType"]["UseE"]: |
| 153 |
writer.vgprs.coutRowPtrE = writer.vgprPool.checkOut(1, "coutRowPtrE") |
| 154 |
if writer.states.useBias == DataDirection.WRITE and (not kernel["WorkGroupReduction"]) and kernel["ProblemType"]["BiasSrc"] == "D": |
| 155 |
writer.vgprs.coutRowPtrBias = writer.vgprPool.checkOut(1, "coutRowPtrBias") |
| 156 |
if kernel["LocalSplitU"] > 1: |
| 157 |
writer.vgprs.coord0InMT = writer.vgprPool.checkOut(1, "coord0InMT") |
| 158 |
writer.vgprs.coord1InMT = writer.vgprPool.checkOut(1, "coord1InMT") |
| 159 |
else: |
| 160 |
writer.vgprs.coord0InMT = tid0 |
| 161 |
writer.vgprs.coord1InMT = tid1 |
| 162 |
lsuTid0 = writer.vgprs.coord0InMT |
| 163 |
lsuTid1 = writer.vgprs.coord1InMT |
| 164 |
|
| 165 |
wave_id = writer.vgprPool.checkOut(1, "tmpWaveID") |
| 166 |
|
| 167 |
tmpVgpr0 = writer.vgprPool.checkOut(1,"tmpVgpr0") |
| 168 |
tmpVgpr1 = writer.vgprPool.checkOutAligned(2,2,"tmpVgpr1") |
| 169 |
tmpVgpr0Res = ContinuousRegister(tmpVgpr0, 1) |
| 170 |
tmpVgpr1Res = ContinuousRegister(tmpVgpr1, 2) |
| 171 |
dummy = writer.vgprPool.checkOut(1,"dummy") |
| 172 |
|
| 173 |
with writer.allocTmpSgpr(1) as tmpSgprInfo: |
| 174 |
tmpSgpr = tmpSgprInfo.idx |
| 175 |
|
| 176 |
|
| 177 |
MIBShape0 = kernel["MatrixInstM"] * kernel["MatrixInstBM"] |
| 178 |
MIBShape1 = kernel["MatrixInstN"] * kernel["MatrixInstBN"] |
| 179 |
|
| 180 |
matrixInstM = kernel["MatrixInstM"] * kernel["MatrixInstBM"] if (kernel["MatrixInstM"] == 4) else kernel["MatrixInstM"] |
| 181 |
matrixInstN = kernel["MatrixInstN"] * kernel["MatrixInstBN"] if (kernel["MatrixInstN"] == 4) else kernel["MatrixInstN"] |
| 182 |
|
| 183 |
module = Module("ComputeStoreVgprsMFMA") |
| 184 |
|
| 185 |
|
| 186 |
module.add(vectorStaticDivide(wave_id, "Serial", writer.states.kernel["WavefrontSize"], tmpVgpr1Res)) |
| 187 |
module.add(vectorStaticDivide(tmpVgpr0, wave_id, kernel["MIWaveGroup"][0], tmpVgpr1Res)) |
| 188 |
if kernel["LocalSplitU"] > 1: |
| 189 |
module.add(vectorStaticRemainder(dummy, tmpVgpr0, tmpVgpr0, kernel["MIWaveGroup"][1], tmpVgpr1Res, tmpSgprInfo)) |
| 190 |
module.add(VMulLOU32(dst=vgpr(tid1), src0=hex(MIBShape1), src1=vgpr(tmpVgpr0), comment="wave coordination offset 1")) |
| 191 |
|
| 192 |
|
| 193 |
module.add(vectorStaticRemainder(dummy, tmpVgpr0, "Serial", matrixInstN, tmpVgpr1Res, tmpSgprInfo)) |
| 194 |
module.add(VAddLShiftLeftU32(dst=vgpr(lsuTid1), src0=vgpr(tmpVgpr0), src1=vgpr(tid1), shiftHex=log2(kernel["VectorWidthB"]), comment="coordination 1 = vwB *(wave_id1 + tid1)")) |
| 195 |
|
| 196 |
|
| 197 |
packedC1 = kernel["PackedC1IndicesX"] |
| 198 |
strideC1 = "StrideC%s" % (writer.states.indexChars[packedC1[0]]) |
| 199 |
strideD1 = "StrideD%s" % (writer.states.indexChars[packedC1[0]]) |
| 200 |
module.add(VMulLOU32(dst=vgpr(writer.vgprs.cinRowPtr), src0=vgpr(lsuTid1), src1=sgpr(strideC1), comment=" offset 1")) |
| 201 |
module.add(VMulLOU32(dst=vgpr(writer.vgprs.coutRowPtrD), src0=vgpr(lsuTid1), src1=sgpr(strideD1), comment=" offset 1")) |
| 202 |
if kernel["ProblemType"]["UseE"] and (kernel["GlobalSplitU"] == 1 or kernel["GlobalSplitU"] == -1): |
| 203 |
module.add(VMovB32(dst=vgpr(writer.vgprs.coutRowPtrE), src=vgpr(lsuTid1), comment=" save offset 1 for E")) |
| 204 |
if writer.vgprs.coutRowPtrBias != -1: |
| 205 |
index = packedC1[0] - 1 |
| 206 |
strideW1 = "Size%s" % "I" if index == 0 else ("J" if index == 1 else (writer.states.indexChars[index])) |
| 207 |
module.add(VMulLOU32(dst=vgpr(writer.vgprs.coutRowPtrBias), src0=vgpr(lsuTid1), src1=sgpr(strideW1), comment=" offset 1")) |
| 208 |
|
| 209 |
|
| 210 |
module.add(vectorStaticRemainder(dummy, tmpVgpr0, wave_id, kernel["MIWaveGroup"][0], tmpVgpr1Res, tmpSgprInfo)) |
| 211 |
module.add(VMulLOU32(dst=vgpr(tmpVgpr0), src0=hex(MIBShape0), src1=vgpr(tmpVgpr0), comment="wave coordination offset 0")) |
| 212 |
|
| 213 |
|
| 214 |
module.add(vectorStaticRemainder(dummy, tid0, "Serial", writer.states.kernel["WavefrontSize"], tmpVgpr1Res, tmpSgprInfo)) |
| 215 |
module.add(vectorStaticDivide(tid0, tid0, matrixInstN, tmpVgpr1Res)) |
| 216 |
module.add(vectorStaticMultiply(vgpr(tid0), vgpr(tid0), kernel["MIOutputVectorWidth"], tmpSgprInfo, "thread0 * continuous_output")) |
| 217 |
module.add(VAddLShiftLeftU32(dst=vgpr(lsuTid0), src0=vgpr(tmpVgpr0), src1=vgpr(tid0), shiftHex=log2(kernel["VectorWidthA"]), comment="coordination 0 = vwA *(wave_id0 + tid0)")) |
| 218 |
|
| 219 |
wg0="WorkGroup0" |
| 220 |
wg1="WorkGroup1" |
| 221 |
|
| 222 |
|
| 223 |
module.add(SMulI32(dst=sgpr(tmpSgpr), src0=kernel["MacroTile0"], src1=sgpr(wg0), comment="wgp0 * MT0")) |
| 224 |
module.add(VAddU32(dst=vgpr(tid0), src0=sgpr(tmpSgpr), src1=vgpr(lsuTid0), comment="coord 0 = (tid0/MI_m)*4 + waveG0*MIB_m + MT0*SG0")) |
| 225 |
|
| 226 |
|
| 227 |
module.add(SMulI32(dst=sgpr(tmpSgpr), src0=kernel["MacroTile1"], src1=sgpr(wg1), comment="wgp1 * MT1")) |
| 228 |
module.add(VAddU32(dst=vgpr(tid1), src0=sgpr(tmpSgpr), src1=vgpr(lsuTid1), comment="coord 1 = (tid0%MI_m) + waveG1*MIB_n + MT1*SG1")) |
| 229 |
|
| 230 |
|
| 231 |
writer.vgprPool.checkIn(dummy) |
| 232 |
writer.vgprPool.checkIn(tmpVgpr1) |
| 233 |
writer.vgprPool.checkIn(tmpVgpr0) |
| 234 |
writer.vgprPool.checkIn(wave_id) |
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
|
| 239 |
|
| 240 |
if kernel["StoreRemapVectorWidth"]: |
| 241 |
module.add(writer.storeRemapComputeStoreVgprs(kernel)) |
| 242 |
|
| 243 |
writer.vgprs.coord0 = tid0 |
| 244 |
writer.vgprs.coord1 = tid1 |
| 245 |
|
| 246 |
return module |
| 247 |
|
| 248 |
class ComputeStoreVgprsMFMASwap(ComputeStoreVgprs): |
| 249 |
kernel = {"EnableMatrixInstruction": True, |
| 250 |
"SourceSwap": True} |
| 251 |
|
| 252 |
""" |
| 253 |
computeStoreVgprs |
| 254 |
Compute workitem/TT offsets in VGPRS |
| 255 |
and coord0/coord1 |
| 256 |
tid0Scale specifies the number of output elements in 0/coalesced dim |
| 257 |
that should be written by each work-item in each batch element. |
| 258 |
""" |
| 259 |
def __call__(self, writer, kernel): |
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
tid0 = writer.vgprPool.checkOut(1, "coord0") |
| 268 |
tid1 = writer.vgprPool.checkOut(1, "coord1") |
| 269 |
if kernel["BufferStore"]: |
| 270 |
writer.vgprs.cinRowPtr = writer.vgprPool.checkOut(1, "cinRowPtr") |
| 271 |
writer.vgprs.coutRowPtrD = writer.vgprPool.checkOut(1, "coutRowPtrD") |
| 272 |
if kernel["ProblemType"]["UseE"]: |
| 273 |
writer.vgprs.coutRowPtrE = writer.vgprPool.checkOut(1, "coutRowPtrE") |
| 274 |
if writer.states.useBias == DataDirection.WRITE and (not kernel["WorkGroupReduction"]) and kernel["ProblemType"]["BiasSrc"] == "D": |
| 275 |
writer.vgprs.coutRowPtrBias = writer.vgprPool.checkOut(1, "coutRowPtrBias") |
| 276 |
if kernel["LocalSplitU"] > 1: |
| 277 |
writer.vgprs.coord0InMT = writer.vgprPool.checkOut(1, "coord0InMT") |
| 278 |
writer.vgprs.coord1InMT = writer.vgprPool.checkOut(1, "coord1InMT") |
| 279 |
else: |
| 280 |
writer.vgprs.coord0InMT = tid0 |
| 281 |
writer.vgprs.coord1InMT = tid1 |
| 282 |
lsuTid0 = writer.vgprs.coord0InMT |
| 283 |
lsuTid1 = writer.vgprs.coord1InMT |
| 284 |
|
| 285 |
wave_id = writer.vgprPool.checkOut(1, "tmpWaveID") |
| 286 |
|
| 287 |
tmpVgpr0 = writer.vgprPool.checkOut(1,"tmpVgpr0") |
| 288 |
tmpVgpr1 = writer.vgprPool.checkOutAligned(2,2,"tmpVgpr1") |
| 289 |
|
| 290 |
tmpVgpr1Res = ContinuousRegister(tmpVgpr1, 2) |
| 291 |
dummy = writer.vgprPool.checkOut(1,"dummy") |
| 292 |
|
| 293 |
with writer.allocTmpSgpr(1) as tmpSgprInfo: |
| 294 |
tmpSgpr = tmpSgprInfo.idx |
| 295 |
|
| 296 |
|
| 297 |
MIBShape0 = kernel["MatrixInstM"] * kernel["MatrixInstBM"] |
| 298 |
MIBShape1 = kernel["MatrixInstN"] * kernel["MatrixInstBN"] |
| 299 |
|
| 300 |
matrixInstM = kernel["MatrixInstM"] * kernel["MatrixInstBM"] if (kernel["MatrixInstM"] == 4) else kernel["MatrixInstM"] |
| 301 |
matrixInstN = kernel["MatrixInstN"] * kernel["MatrixInstBN"] if (kernel["MatrixInstN"] == 4) else kernel["MatrixInstN"] |
| 302 |
|
| 303 |
module = Module("ComputeStoreVgprsMFMASwap") |
| 304 |
|
| 305 |
|
| 306 |
|
| 307 |
module.add(vectorStaticDivide(wave_id, "Serial", writer.states.kernel["WavefrontSize"], tmpVgpr1Res)) |
| 308 |
module.add(vectorStaticDivide(tmpVgpr0, wave_id, kernel["MIWaveGroup"][0], tmpVgpr1Res)) |
| 309 |
if kernel["LocalSplitU"] > 1: |
| 310 |
module.add(vectorStaticRemainder(dummy, tmpVgpr0, tmpVgpr0, kernel["MIWaveGroup"][1], tmpVgpr1Res, tmpSgprInfo)) |
| 311 |
module.add(VMulLOU32(dst=vgpr(tmpVgpr0), src0=hex(MIBShape1), src1=vgpr(tmpVgpr0), comment="wave coordination offset 1")) |
| 312 |
|
| 313 |
|
| 314 |
module.add(vectorStaticRemainder(dummy, tid1, "Serial", writer.states.kernel["WavefrontSize"], tmpVgpr1Res, tmpSgprInfo)) |
| 315 |
module.add(vectorStaticDivide(tid1, tid1, matrixInstM, tmpVgpr1Res)) |
| 316 |
module.add(vectorStaticMultiply(vgpr(tid1), vgpr(tid1), kernel["MIOutputVectorWidth"], tmpSgprInfo, "thread0 * continuous_output")) |
| 317 |
module.add(VAddLShiftLeftU32(dst=vgpr(lsuTid1), src0=vgpr(tmpVgpr0), src1=vgpr(tid1), shiftHex=log2(kernel["VectorWidthB"]), comment="coordination 1 = vwB *(wave_id1 + tid1)")) |
| 318 |
|
| 319 |
|
| 320 |
packedC1 = kernel["PackedC1IndicesX"] |
| 321 |
strideC1 = "StrideC%s" % (writer.states.indexChars[packedC1[0]]) |
| 322 |
strideD1 = "StrideD%s" % (writer.states.indexChars[packedC1[0]]) |
| 323 |
module.add(VMulLOU32(dst=vgpr(writer.vgprs.cinRowPtr), src0=vgpr(lsuTid1), src1=sgpr(strideC1), comment=" offset 1")) |
| 324 |
module.add(VMulLOU32(dst=vgpr(writer.vgprs.coutRowPtrD), src0=vgpr(lsuTid1), src1=sgpr(strideD1), comment=" offset 1")) |
| 325 |
if kernel["ProblemType"]["UseE"] and (kernel["GlobalSplitU"] == 1 or kernel["GlobalSplitU"] == -1): |
| 326 |
module.add(VMovB32(dst=vgpr(writer.vgprs.coutRowPtrE), src=vgpr(lsuTid1), comment=" save offset 1 for E")) |
| 327 |
if writer.vgprs.coutRowPtrBias != -1: |
| 328 |
index = packedC1[0] - 1 |
| 329 |
strideW1 = "Size%s" % "I" if index == 0 else ("J" if index == 1 else (writer.states.indexChars[index])) |
| 330 |
module.add(VMulLOU32(dst=vgpr(writer.vgprs.coutRowPtrBias), src0=vgpr(lsuTid1), src1=sgpr(strideW1), comment=" offset 1")) |
| 331 |
|
| 332 |
|
| 333 |
module.add(vectorStaticRemainder(dummy, tid0, wave_id, kernel["MIWaveGroup"][0], tmpVgpr1Res, tmpSgprInfo)) |
| 334 |
module.add(VMulLOU32(dst=vgpr(tid0), src0=hex(MIBShape0), src1=vgpr(tid0), comment="wave coordination offset 0")) |
| 335 |
|
| 336 |
|
| 337 |
module.add(vectorStaticRemainder(dummy, tmpVgpr0, "Serial", matrixInstM, tmpVgpr1Res, tmpSgprInfo)) |
| 338 |
module.add(VAddLShiftLeftU32(dst=vgpr(lsuTid0), src0=vgpr(tmpVgpr0), src1=vgpr(tid0), shiftHex=log2(kernel["VectorWidthA"]), comment="coordination 0 = vwA * (wave_id0 + tid0)")) |
| 339 |
|
| 340 |
wg0="WorkGroup0" |
| 341 |
wg1="WorkGroup1" |
| 342 |
|
| 343 |
|
| 344 |
module.add(SMulI32(dst=sgpr(tmpSgpr), src0=kernel["MacroTile0"], src1=sgpr(wg0), comment="wgp0 * MT0")) |
| 345 |
module.add(VAddU32(dst=vgpr(tid0), src0=sgpr(tmpSgpr), src1=vgpr(lsuTid0), comment="coord 0 = (tid0/MI_m)*4 + waveG0*MIB_m + MT0*SG0")) |
| 346 |
|
| 347 |
|
| 348 |
module.add(SMulI32(dst=sgpr(tmpSgpr), src0=kernel["MacroTile1"], src1=sgpr(wg1), comment="wgp1 * MT1")) |
| 349 |
module.add(VAddU32(dst=vgpr(tid1), src0=sgpr(tmpSgpr), src1=vgpr(lsuTid1), comment="coord 1 = (tid0%MI_m) + waveG1*MIB_n + MT1*SG1")) |
| 350 |
|
| 351 |
|
| 352 |
writer.vgprPool.checkIn(dummy) |
| 353 |
writer.vgprPool.checkIn(tmpVgpr1) |
| 354 |
writer.vgprPool.checkIn(tmpVgpr0) |
| 355 |
writer.vgprPool.checkIn(wave_id) |
| 356 |
|
| 357 |
|
| 358 |
|
| 359 |
|
| 360 |
|
| 361 |
if kernel["StoreRemapVectorWidth"]: |
| 362 |
module.add(writer.storeRemapComputeStoreVgprs(kernel)) |
| 363 |
|
| 364 |
writer.vgprs.coord0 = tid0 |
| 365 |
writer.vgprs.coord1 = tid1 |
| 366 |
|
| 367 |
return module |