summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2013-02-22 20:08:57 +0100
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2013-03-12 12:55:34 +0100
commitc893b9406060d3735b2c9e307ae89f6d83a4be40 (patch)
tree0c344d15703274584863ece29a68e36d221df63f /src/gallium/drivers/nvc0
parentefe55075b505e9d96ccde12f789ec8991273aef4 (diff)
nv50/ir: add support for indirect BRA,CALL
Diffstat (limited to 'src/gallium/drivers/nvc0')
-rw-r--r--src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp b/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp
index dc1fe99bde6..763d07f759a 100644
--- a/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp
+++ b/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp
@@ -1192,8 +1192,8 @@ CodeEmitterNVC0::emitFlow(const Instruction *i)
break;
case OP_CALL:
code[1] = f->absolute ? 0x10000000 : 0x50000000;
- if (i->srcExists(0) && i->src(0).getFile() == FILE_MEMORY_CONST)
- code[0] |= 0x4000;
+ if (f->indirect)
+ code[0] |= 0x4000; // indirect calls always use c[] source
mask = 2;
break;
@@ -1230,7 +1230,22 @@ CodeEmitterNVC0::emitFlow(const Instruction *i)
if (f->limit)
code[0] |= 1 << 16;
+ if (f->indirect) {
+ if (code[0] & 0x4000) {
+ assert(i->srcExists(0) && i->src(0).getFile() == FILE_MEMORY_CONST);
+ setAddress16(i->src(0));
+ code[1] |= i->getSrc(0)->reg.fileIndex << 10;
+ if (f->op == OP_BRA)
+ srcId(f->src(0).getIndirect(0), 20);
+ } else {
+ srcId(f, 0, 20);
+ }
+ }
+
if (f->op == OP_CALL) {
+ if (f->indirect) {
+ // nothing
+ } else
if (f->builtin) {
assert(f->absolute);
uint32_t pcAbs = targNVC0->getBuiltinOffset(f->target.builtin);