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-15 13:59:09 +0200
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2010-09-15 15:35:14 +0200
commitc46e7a05e501e02b10dbc06772c0ef01308f60d5 (patch)
treef3ca808eb0dd1e6376ccd850671a68186b781791 /src/gallium/drivers/nv50/nv50_pc_emit.c
parent16d8f5fee51a4a86f5f0c15228b48d5668ab2be2 (diff)
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.
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_pc_emit.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_pc_emit.c5
1 files changed, 5 insertions, 0 deletions
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);