nv50/ir: initialize CodeEmitters' specialized target fields
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Mon, 25 Feb 2013 11:52:43 +0000 (12:52 +0100)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Tue, 12 Mar 2013 11:55:34 +0000 (12:55 +0100)
src/gallium/drivers/nv50/codegen/nv50_ir_emit_nv50.cpp
src/gallium/drivers/nvc0/codegen/nv50_ir_emit_gk110.cpp
src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp

index 2ba87f30971c3b25dba66e2902a680a0ca389165..90f861590e14fdaf621b0ad142d084d02b4f0426 100644 (file)
@@ -46,7 +46,7 @@ public:
 private:
    Program::Type progType;
 
-   const TargetNV50 *targ;
+   const TargetNV50 *targNV50;
 
 private:
    inline void defId(const ValueDef&, const int pos);
@@ -1512,7 +1512,7 @@ CodeEmitterNV50::emitFlow(const Instruction *i, uint8_t flowOp)
 
       if (f->op == OP_CALL) {
          if (f->builtin) {
-            pos = targ->getBuiltinOffset(f->target.builtin);
+            pos = targNV50->getBuiltinOffset(f->target.builtin);
          } else {
             pos = f->target.fn->binPos;
          }
@@ -1884,7 +1884,8 @@ CodeEmitterNV50::prepareEmission(Function *func)
    replaceExitWithModifier(func);
 }
 
-CodeEmitterNV50::CodeEmitterNV50(const TargetNV50 *target) : CodeEmitter(target)
+CodeEmitterNV50::CodeEmitterNV50(const TargetNV50 *target) :
+   CodeEmitter(target), targNV50(target)
 {
    targ = target; // specialized
    code = NULL;
index c771459d514725cffd44defd99ff377152cda49f..0f73254cac94b880bd46712ffb6dfd2c37466dba 100644 (file)
@@ -38,7 +38,7 @@ public:
    inline void setProgramType(Program::Type pType) { progType = pType; }
 
 private:
-   const TargetNVC0 *targ;
+   const TargetNVC0 *targNVC0;
 
    Program::Type progType;
 
@@ -1116,7 +1116,7 @@ CodeEmitterGK110::emitFlow(const Instruction *i)
    if (f->op == OP_CALL) {
       if (f->builtin) {
          assert(f->absolute);
-         uint32_t pcAbs = targ->getBuiltinOffset(f->target.builtin);
+         uint32_t pcAbs = targNVC0->getBuiltinOffset(f->target.builtin);
          addReloc(RelocEntry::TYPE_BUILTIN, 0, pcAbs, 0xff800000, 23);
          addReloc(RelocEntry::TYPE_BUILTIN, 1, pcAbs, 0x007fffff, -9);
       } else {
@@ -1609,6 +1609,7 @@ CodeEmitterGK110::prepareEmission(Function *func)
 
 CodeEmitterGK110::CodeEmitterGK110(const TargetNVC0 *target)
    : CodeEmitter(target),
+     targNVC0(target),
      writeIssueDelays(target->hasSWSched)
 {
    code = NULL;
index ab4fb9498d9c69e7b81d82aca3b169f49f86de23..3eef383608c3da4232a92c53ba7e8be7121f3a93 100644 (file)
@@ -38,7 +38,7 @@ public:
    inline void setProgramType(Program::Type pType) { progType = pType; }
 
 private:
-   const TargetNVC0 *targ;
+   const TargetNVC0 *targNVC0;
 
    Program::Type progType;
 
@@ -1174,7 +1174,7 @@ CodeEmitterNVC0::emitFlow(const Instruction *i)
    if (f->op == OP_CALL) {
       if (f->builtin) {
          assert(f->absolute);
-         uint32_t pcAbs = targ->getBuiltinOffset(f->target.builtin);
+         uint32_t pcAbs = targNVC0->getBuiltinOffset(f->target.builtin);
          addReloc(RelocEntry::TYPE_BUILTIN, 0, pcAbs, 0xfc000000, 26);
          addReloc(RelocEntry::TYPE_BUILTIN, 1, pcAbs, 0x03ffffff, -6);
       } else {
@@ -2307,8 +2307,6 @@ calculateSchedDataNVC0(const Target *targ, Function *func)
 void
 CodeEmitterNVC0::prepareEmission(Function *func)
 {
-   const Target *targ = func->getProgram()->getTarget();
-
    CodeEmitter::prepareEmission(func);
 
    if (targ->hasSWSched)
@@ -2317,6 +2315,7 @@ CodeEmitterNVC0::prepareEmission(Function *func)
 
 CodeEmitterNVC0::CodeEmitterNVC0(const TargetNVC0 *target)
    : CodeEmitter(target),
+     targNVC0(target),
      writeIssueDelays(target->hasSWSched)
 {
    code = NULL;