draw: Reuse xmm registers.

This commit is contained in:
Keith Whitwell 2009-02-17 21:45:54 +00:00 committed by José Fonseca
parent a719d70474
commit 8ef377d76b
1 changed files with 13 additions and 0 deletions

View File

@ -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;
}