diff options
author | Roy Spliet <[email protected]> | 2015-02-06 22:46:54 +0100 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2015-02-10 08:01:46 -0500 |
commit | fb63df22151fcf6a2fdbc739bd9a84a77bff0270 (patch) | |
tree | bcbe056e11d55989caab9ece0e32b315bc8ce977 | |
parent | 354206f407fffd5f0b553dcbcc46b178d0b22c47 (diff) |
nv50/ir: Add support for MAD 4-byte opcode
Add emission rules for negative and saturate flags for MAD 4-byte opcodes,
and get rid of some of the constraints. Obviously tested with a wide variety
of shaders.
V2: Document MAD as supported short form
V3: Split up IMM from short-form modifiers
Signed-off-by: Roy Spliet <[email protected]>
Reviewed-by: Ilia Mirkin <[email protected]>
-rw-r--r-- | src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp | 10 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp | 4 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp index 20773884ad3..23e4babfed0 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp @@ -941,7 +941,10 @@ CodeEmitterNV50::emitFMAD(const Instruction *i) if (i->encSize == 4) { emitForm_MUL(i); - assert(!neg_mul && !neg_add); + code[0] |= neg_mul << 15; + code[0] |= neg_add << 22; + if (i->saturate) + code[0] |= 1 << 8; } else { code[1] = neg_mul << 26; code[1] |= neg_add << 27; @@ -1931,11 +1934,6 @@ CodeEmitterNV50::getMinEncodingSize(const Instruction *i) const // check constraints on short MAD if (info.srcNr >= 2 && i->srcExists(2)) { - if (i->saturate || i->src(2).mod) - return 8; - if ((i->src(0).mod ^ i->src(1).mod) || - (i->src(0).mod | i->src(1).mod).abs()) - return 8; if (!i->defExists(0) || i->def(0).rep()->reg.data.id != i->src(2).rep()->reg.data.id) return 8; 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 48f996b3d22..178a1671c3f 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp @@ -117,8 +117,8 @@ void TargetNV50::initOpInfo() }; static const uint32_t shortForm[(OP_LAST + 31) / 32] = { - // MOV,ADD,SUB,MUL,SAD,L/PINTERP,RCP,TEX,TXF - 0x00010e40, 0x00000040, 0x00000498, 0x00000000 + // MOV,ADD,SUB,MUL,MAD,SAD,L/PINTERP,RCP,TEX,TXF + 0x00014e40, 0x00000040, 0x00000498, 0x00000000 }; static const operation noDestList[] = { |