summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_vs_aos.c
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-02-17 21:45:54 +0000
committerJosé Fonseca <jfonseca@vmware.com>2009-02-17 21:45:54 +0000
commit8ef377d76b721f2f62ca30a073fcfd312c155e95 (patch)
tree4f21ad6348ae30f78c4389e90df875bbfcb083a8 /src/gallium/auxiliary/draw/draw_vs_aos.c
parenta719d704741ae21d1b12138c863f22286b98a5af (diff)
draw: Reuse xmm registers.
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_vs_aos.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_vs_aos.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vs_aos.c b/src/gallium/auxiliary/draw/draw_vs_aos.c
index 6141ba9cbf..875ecb92db 100644
--- a/src/gallium/auxiliary/draw/draw_vs_aos.c
+++ b/src/gallium/auxiliary/draw/draw_vs_aos.c
@@ -284,6 +284,15 @@ void aos_release_xmm_reg( struct aos_compilation *cp,
}
+static void aos_soft_release_xmm( struct aos_compilation *cp,
+ struct x86_reg reg )
+{
+ if (reg.file == file_XMM) {
+ assert(cp->xmm[reg.idx].last_used == cp->insn_counter);
+ cp->xmm[reg.idx].last_used = cp->insn_counter - 1;
+ }
+}
+
/* Mark an xmm reg as holding the current copy of a shader reg.
@@ -584,10 +593,12 @@ static struct x86_reg fetch_src( struct aos_compilation *cp,
sse_mulps(cp->func, dst, tmp);
aos_release_xmm_reg(cp, tmp.idx);
+ aos_soft_release_xmm(cp, imm_swz);
}
else if (negs) {
struct x86_reg imm_negs = aos_get_internal_xmm(cp, IMM_NEGS);
sse_mulps(cp->func, dst, imm_negs);
+ aos_soft_release_xmm(cp, imm_negs);
}
@@ -603,8 +614,10 @@ static struct x86_reg fetch_src( struct aos_compilation *cp,
sse_maxps(cp->func, dst, tmp);
aos_release_xmm_reg(cp, tmp.idx);
+ aos_soft_release_xmm(cp, neg);
}
+ aos_soft_release_xmm(cp, arg0);
return dst;
}