diff options
author | Christoph Bumiller <[email protected]> | 2013-03-02 14:59:06 +0100 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2013-03-12 12:55:36 +0100 |
commit | 99e4eba669f13a0dc80880f4f91e2338377c1667 (patch) | |
tree | 43e1feb96d009a1b17b21a6d5aa51b62d0153447 /src/gallium/drivers/nvc0 | |
parent | ac9f19e485a15b2c58680d5c884597f60d6f1b1b (diff) |
nv50/ir: implement splitting of 64 bit ops after RA
Diffstat (limited to 'src/gallium/drivers/nvc0')
-rw-r--r-- | src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp index 94d3cea0112..414a503c87d 100644 --- a/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp +++ b/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp @@ -128,7 +128,6 @@ private: virtual bool visit(BasicBlock *); void replaceZero(Instruction *); - void split64BitOp(Instruction *); bool tryReplaceContWithBra(BasicBlock *); void propagateJoin(BasicBlock *); @@ -158,6 +157,7 @@ private: private: LValue *rZero; + LValue *carry; const bool needTexBar; }; @@ -468,8 +468,10 @@ NVC0LegalizePostRA::visit(Function *fn) insertTextureBarriers(fn); rZero = new_LValue(fn, FILE_GPR); + carry = new_LValue(fn, FILE_FLAGS); rZero->reg.data.id = prog->getTarget()->getFileSize(FILE_GPR); + carry->reg.data.id = 0; return true; } @@ -486,22 +488,6 @@ NVC0LegalizePostRA::replaceZero(Instruction *i) } } -void -NVC0LegalizePostRA::split64BitOp(Instruction *i) -{ - if (i->dType == TYPE_F64) { - if (i->op == OP_MAD) - i->op = OP_FMA; - if (i->op == OP_ADD || i->op == OP_MUL || i->op == OP_FMA || - i->op == OP_CVT || i->op == OP_MIN || i->op == OP_MAX || - i->op == OP_SET) - return; - i->dType = i->sType = TYPE_U32; - - i->bb->insertAfter(i, cloneForward(func, i)); - } -} - // replace CONT with BRA for single unconditional continue bool NVC0LegalizePostRA::tryReplaceContWithBra(BasicBlock *bb) @@ -565,10 +551,17 @@ NVC0LegalizePostRA::visit(BasicBlock *bb) if (i->isNop()) { bb->remove(i); } else { + // TODO: Move this to before register allocation for operations that + // need the $c register ! + if (typeSizeof(i->dType) == 8) { + Instruction *hi; + hi = BuildUtil::split64BitOpPostRA(func, i, rZero, carry); + if (hi) + next = hi; + } + if (i->op != OP_MOV && i->op != OP_PFETCH) replaceZero(i); - if (typeSizeof(i->dType) == 8) - split64BitOp(i); } } if (!bb->getEntry()) |