diff options
author | Keith Whitwell <keithw@vmware.com> | 2009-02-18 10:08:19 +0000 |
---|---|---|
committer | Keith Whitwell <keithw@vmware.com> | 2009-02-18 10:08:19 +0000 |
commit | c706ea4f454b5885d9dc71a605853ee21e527285 (patch) | |
tree | 43e896102b6cfba2309289b9b862f0abb0d5541c | |
parent | c613e366a9c6ab9631f8101851163caec7437237 (diff) |
draw: Reuse xmm registers.
-rw-r--r-- | src/gallium/auxiliary/draw/draw_vs_aos.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vs_aos.c b/src/gallium/auxiliary/draw/draw_vs_aos.c index f4c6705bae..78d139fd7d 100644 --- a/src/gallium/auxiliary/draw/draw_vs_aos.c +++ b/src/gallium/auxiliary/draw/draw_vs_aos.c @@ -284,6 +284,14 @@ 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) { + 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 +592,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 +613,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; } |