X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fnouveau%2Fcodegen%2Fnv50_ir_target_nv50.cpp;h=ec94590a3f8e60ef05e2452c2010a8876d4e6d93;hb=bab4f6c724d384cfee7e7f98ff3b52648850641d;hp=b37ea730d0eb8af87ce55629d4714ed062e84657;hpb=27a51ff9b420909334898785cf194b5998776e88;p=mesa.git diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp index b37ea730d0e..ec94590a3f8 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp @@ -111,15 +111,15 @@ void TargetNV50::initOpInfo() { unsigned int i, j; - static const uint32_t commutative[(OP_LAST + 31) / 32] = + static const operation commutativeList[] = { - // ADD,MAD,MUL,AND,OR,XOR,MAX,MIN - 0x0670ca00, 0x0000003f, 0x00000000, 0x00000000 + OP_ADD, OP_MUL, OP_MAD, OP_FMA, OP_AND, OP_OR, OP_XOR, OP_MAX, OP_MIN, + OP_SET_AND, OP_SET_OR, OP_SET_XOR, OP_SET, OP_SELP, OP_SLCT }; - static const uint32_t shortForm[(OP_LAST + 31) / 32] = + static const operation shortFormList[] = { - // MOV,ADD,SUB,MUL,MAD,SAD,L/PINTERP,RCP,TEX,TXF - 0x00014e40, 0x00000040, 0x00000930, 0x00000000 + OP_MOV, OP_ADD, OP_SUB, OP_MUL, OP_MAD, OP_SAD, OP_RCP, OP_LINTERP, + OP_PINTERP, OP_TEX, OP_TXF }; static const operation noDestList[] = { @@ -156,18 +156,22 @@ void TargetNV50::initOpInfo() opInfo[i].hasDest = 1; opInfo[i].vector = (i >= OP_TEX && i <= OP_TEXCSAA); - opInfo[i].commutative = (commutative[i / 32] >> (i % 32)) & 1; + opInfo[i].commutative = false; /* set below */ opInfo[i].pseudo = (i < OP_MOV); opInfo[i].predicate = !opInfo[i].pseudo; opInfo[i].flow = (i >= OP_BRA && i <= OP_JOIN); - opInfo[i].minEncSize = (shortForm[i / 32] & (1 << (i % 32))) ? 4 : 8; + opInfo[i].minEncSize = 8; /* set below */ } - for (i = 0; i < sizeof(noDestList) / sizeof(noDestList[0]); ++i) + for (i = 0; i < ARRAY_SIZE(commutativeList); ++i) + opInfo[commutativeList[i]].commutative = true; + for (i = 0; i < ARRAY_SIZE(shortFormList); ++i) + opInfo[shortFormList[i]].minEncSize = 4; + for (i = 0; i < ARRAY_SIZE(noDestList); ++i) opInfo[noDestList[i]].hasDest = 0; - for (i = 0; i < sizeof(noPredList) / sizeof(noPredList[0]); ++i) + for (i = 0; i < ARRAY_SIZE(noPredList); ++i) opInfo[noPredList[i]].predicate = 0; - for (i = 0; i < sizeof(_initProps) / sizeof(_initProps[0]); ++i) { + for (i = 0; i < ARRAY_SIZE(_initProps); ++i) { const struct opProperties *prop = &_initProps[i]; for (int s = 0; s < 3; ++s) { @@ -199,7 +203,7 @@ TargetNV50::getFileSize(DataFile file) const { switch (file) { case FILE_NULL: return 0; - case FILE_GPR: return 256; // in 16-bit units ** + case FILE_GPR: return 254; // in 16-bit units ** case FILE_PREDICATE: return 0; case FILE_FLAGS: return 4; case FILE_ADDRESS: return 4; @@ -253,6 +257,7 @@ TargetNV50::getSVAddress(DataFile shaderFile, const Symbol *sym) const case SV_NTID: return 0x2 + 2 * sym->reg.data.sv.index; case SV_TID: + case SV_COMBINED_TID: return 0; case SV_SAMPLE_POS: return 0; /* sample position is handled differently */ @@ -437,6 +442,8 @@ TargetNV50::isOpSupported(operation op, DataType ty) const case OP_EXTBF: case OP_EXIT: // want exit modifier instead (on NOP if required) case OP_MEMBAR: + case OP_SHLADD: + case OP_XMAD: return false; case OP_SAD: return ty == TYPE_S32;