summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv50/nv50_pc_emit.c
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2010-09-09 19:12:54 +0200
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2010-09-09 19:21:34 +0200
commitf30810cb68a53c4fef360778a230126ed0ee0ee3 (patch)
tree6b4f2fe6919261a5e356f5d75078c78a941f6cb7 /src/gallium/drivers/nv50/nv50_pc_emit.c
parentd8dcff79702860eae92d3d35b461c9b71114c1c5 (diff)
nv50: use actual loads/stores if TEMPs are accessed indirectly
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_pc_emit.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_pc_emit.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/gallium/drivers/nv50/nv50_pc_emit.c b/src/gallium/drivers/nv50/nv50_pc_emit.c
index bb0a6f32d1..8c64b19875 100644
--- a/src/gallium/drivers/nv50/nv50_pc_emit.c
+++ b/src/gallium/drivers/nv50/nv50_pc_emit.c
@@ -412,25 +412,25 @@ emit_form_IMM(struct nv_pc *pc, struct nv_instruction *i, ubyte mod_mask)
}
static void
-set_ld_st_size(struct nv_pc *pc, ubyte type)
+set_ld_st_size(struct nv_pc *pc, int s, ubyte type)
{
switch (type) {
case NV_TYPE_F64:
- pc->emit[1] |= 0x8000;
+ pc->emit[1] |= 0x8000 << s;
break;
case NV_TYPE_F32:
case NV_TYPE_S32:
case NV_TYPE_U32:
- pc->emit[1] |= 0xc000;
+ pc->emit[1] |= 0xc000 << s;
break;
case NV_TYPE_S16:
- pc->emit[1] |= 0x6000;
+ pc->emit[1] |= 0x6000 << s;
break;
case NV_TYPE_U16:
- pc->emit[1] |= 0x4000;
+ pc->emit[1] |= 0x4000 << s;
break;
case NV_TYPE_S8:
- pc->emit[1] |= 0x2000;
+ pc->emit[1] |= 0x2000 << s;
break;
default:
break;
@@ -473,12 +473,14 @@ emit_ld(struct nv_pc *pc, struct nv_instruction *i)
if (sf == NV_FILE_MEM_L) {
pc->emit[0] = 0xd0000001;
pc->emit[1] = 0x40000000;
+
+ set_addr(pc, i);
} else {
NOUVEAU_ERR("invalid ld source file\n");
abort();
}
- set_ld_st_size(pc, STYPE(i, 0));
+ set_ld_st_size(pc, (sf == NV_FILE_MEM_L) ? 8 : 0, STYPE(i, 0));
set_dst(pc, i->def[0]);
set_pred_wr(pc, i);
@@ -495,7 +497,19 @@ emit_ld(struct nv_pc *pc, struct nv_instruction *i)
static void
emit_st(struct nv_pc *pc, struct nv_instruction *i)
{
+ assert(SFILE(i, 1) == NV_FILE_GPR);
+ assert(SFILE(i, 0) == NV_FILE_MEM_L);
+
+ pc->emit[0] = 0xd0000001;
+ pc->emit[1] = 0x60000000;
+ SID(pc, i->src[1], 2);
+ SID(pc, i->src[0], 9);
+
+ set_ld_st_size(pc, 8, STYPE(i, 1));
+
+ set_addr(pc, i);
+ set_pred(pc, i);
}
static int