diff options
author | Francisco Jerez <[email protected]> | 2012-05-18 16:17:44 +0200 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2013-03-12 12:55:34 +0100 |
commit | c82714c593ac38ea87e061b92d10b34853784723 (patch) | |
tree | 14cd9afd68272af0b08eb6551fbe311732604a6c /src/gallium/drivers/nv50 | |
parent | cc30ce8160a9ed4d2ed1a024c659d5cd1ec27ee2 (diff) |
nv50/ir: Rename "mkLoad" to "mkLoadv" for consistency.
Diffstat (limited to 'src/gallium/drivers/nv50')
-rw-r--r-- | src/gallium/drivers/nv50/codegen/nv50_ir_build_util.cpp | 11 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/codegen/nv50_ir_build_util.h | 12 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp | 6 |
3 files changed, 19 insertions, 10 deletions
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_build_util.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_build_util.cpp index 322d6b9d34b..4448e8299d2 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir_build_util.cpp +++ b/src/gallium/drivers/nv50/codegen/nv50_ir_build_util.cpp @@ -103,19 +103,18 @@ BuildUtil::mkOp3(operation op, DataType ty, Value *dst, return insn; } -LValue * -BuildUtil::mkLoad(DataType ty, Symbol *mem, Value *ptr) +Instruction * +BuildUtil::mkLoad(DataType ty, Value *dst, Symbol *mem, Value *ptr) { Instruction *insn = new_Instruction(func, OP_LOAD, ty); - LValue *def = getScratch(); - insn->setDef(0, def); + insn->setDef(0, dst); insn->setSrc(0, mem); if (ptr) insn->setIndirect(0, 0, ptr); insert(insn); - return def; + return insn; } Instruction * @@ -502,7 +501,7 @@ BuildUtil::DataArray::load(ValueMap &m, int i, int c, Value *ptr) if (!sym) sym = insert(m, i, c, mkSymbol(i, c)); - return up->mkLoad(typeOfSize(eltSize), static_cast<Symbol *>(sym), ptr); + return up->mkLoadv(typeOfSize(eltSize), static_cast<Symbol *>(sym), ptr); } } diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_build_util.h b/src/gallium/drivers/nv50/codegen/nv50_ir_build_util.h index dd7e491cb5c..963c3505083 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir_build_util.h +++ b/src/gallium/drivers/nv50/codegen/nv50_ir_build_util.h @@ -58,9 +58,11 @@ public: LValue *mkOp2v(operation, DataType, Value *, Value *, Value *); LValue *mkOp3v(operation, DataType, Value *, Value *, Value *, Value *); - LValue *mkLoad(DataType, Symbol *, Value *ptr); + Instruction *mkLoad(DataType, Value *dst, Symbol *, Value *ptr); Instruction *mkStore(operation, DataType, Symbol *, Value *ptr, Value *val); + LValue *mkLoadv(DataType, Symbol *, Value *ptr); + Instruction *mkMov(Value *, Value *, DataType = TYPE_U32); Instruction *mkMovToReg(int id, Value *); Instruction *mkMovFromReg(Value *, int id); @@ -282,6 +284,14 @@ BuildUtil::mkOp3v(operation op, DataType ty, Value *dst, return dst->asLValue(); } +inline LValue * +BuildUtil::mkLoadv(DataType ty, Symbol *mem, Value *ptr) +{ + LValue *dst = getScratch(); + mkLoad(ty, dst, mem, ptr); + return dst; +} + bool BuildUtil::DataArray::exists(ValueMap &m, unsigned int i, unsigned int c) { diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp index 954dfd47adb..32915174e01 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp +++ b/src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp @@ -1346,7 +1346,7 @@ Converter::fetchSrc(tgsi::Instruction::SrcRegister src, int c, Value *ptr) assert(!ptr); return loadImm(NULL, info->immd.data[idx * 4 + swz]); case TGSI_FILE_CONSTANT: - return mkLoad(TYPE_U32, srcToSym(src, c), ptr); + return mkLoadv(TYPE_U32, srcToSym(src, c), ptr); case TGSI_FILE_INPUT: if (prog->getType() == Program::TYPE_FRAGMENT) { // don't load masked inputs, won't be assigned a slot @@ -1356,7 +1356,7 @@ Converter::fetchSrc(tgsi::Instruction::SrcRegister src, int c, Value *ptr) return mkOp1v(OP_RDSV, TYPE_F32, getSSA(), mkSysVal(SV_FACE, 0)); return interpolate(src, c, ptr); } - return mkLoad(TYPE_U32, srcToSym(src, c), ptr); + return mkLoadv(TYPE_U32, srcToSym(src, c), ptr); case TGSI_FILE_OUTPUT: assert(!"load from output file"); return NULL; @@ -2287,7 +2287,7 @@ Converter::handleUserClipPlanes() for (i = 0; i < info->io.genUserClip; ++i) { Symbol *sym = mkSymbol(FILE_MEMORY_CONST, info->io.ucpBinding, TYPE_F32, info->io.ucpBase + i * 16 + c * 4); - Value *ucp = mkLoad(TYPE_F32, sym, NULL); + Value *ucp = mkLoadv(TYPE_F32, sym, NULL); if (c == 0) res[i] = mkOp2v(OP_MUL, TYPE_F32, getScratch(), clipVtx[c], ucp); else |