From c46e7a05e501e02b10dbc06772c0ef01308f60d5 Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Wed, 15 Sep 2010 13:59:09 +0200 Subject: nv50: improve and fix modifier folding optimization Execute before folding loads, because we don't check if it's legal in lower_mods. Ensure that a value's insn pointer is updated when transferring it to a different instruction. --- src/gallium/drivers/nv50/nv50_pc_emit.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/gallium/drivers/nv50/nv50_pc_emit.c') diff --git a/src/gallium/drivers/nv50/nv50_pc_emit.c b/src/gallium/drivers/nv50/nv50_pc_emit.c index 1eb44741f1..137a531dd6 100644 --- a/src/gallium/drivers/nv50/nv50_pc_emit.c +++ b/src/gallium/drivers/nv50/nv50_pc_emit.c @@ -654,6 +654,8 @@ emit_add_f32(struct nv_pc *pc, struct nv_instruction *i) { pc->emit[0] = 0xb0000000; + assert(!((i->src[0]->mod | i->src[1]->mod) & NV_MOD_ABS)); + if (SFILE(i, 1) == NV_FILE_IMM) { emit_form_IMM(pc, i, 0); @@ -665,6 +667,9 @@ emit_add_f32(struct nv_pc *pc, struct nv_instruction *i) if (i->src[0]->mod & NV_MOD_NEG) pc->emit[1] |= 1 << 26; if (i->src[1]->mod & NV_MOD_NEG) pc->emit[1] |= 1 << 27; + + if (i->saturate) + pc->emit[1] |= 0x20000000; } else { emit_form_MUL(pc, i); -- cgit v1.2.3