translate_sse: don't overwrite source buffer pointer

We were putting the source pointer in a register used as a temporary,
breaking all paths that don't read the data in a single instruction.
This commit is contained in:
Luca Barbieri 2010-08-18 04:14:43 +02:00
parent ede67e3071
commit 547e88e70d

View file

@ -96,7 +96,7 @@ struct translate_sse {
*/ */
struct x86_reg tmp_EAX; struct x86_reg tmp_EAX;
struct x86_reg tmp2_EDX; struct x86_reg tmp2_EDX;
struct x86_reg tmp3_ECX; struct x86_reg src_ECX;
struct x86_reg idx_ESI; /* either start+i or &elt[i] */ struct x86_reg idx_ESI; /* either start+i or &elt[i] */
struct x86_reg machine_EDI; struct x86_reg machine_EDI;
struct x86_reg outbuf_EBX; struct x86_reg outbuf_EBX;
@ -1052,7 +1052,7 @@ static boolean init_inputs( struct translate_sse *p,
if (varient->instance_divisor != 1) { if (varient->instance_divisor != 1) {
struct x86_reg tmp_EDX = p->tmp2_EDX; struct x86_reg tmp_EDX = p->tmp2_EDX;
struct x86_reg tmp_ECX = p->tmp3_ECX; struct x86_reg tmp_ECX = p->src_ECX;
/* TODO: Add x86_shr() to rtasm and use it whenever /* TODO: Add x86_shr() to rtasm and use it whenever
* instance divisor is power of two. * instance divisor is power of two.
@ -1108,7 +1108,7 @@ static struct x86_reg get_buffer_ptr( struct translate_sse *p,
return p->idx_ESI; return p->idx_ESI;
} }
else if (!index_size || p->buffer_varient[var_idx].instance_divisor) { else if (!index_size || p->buffer_varient[var_idx].instance_divisor) {
struct x86_reg ptr = p->tmp_EAX; struct x86_reg ptr = p->src_ECX;
struct x86_reg buf_ptr = struct x86_reg buf_ptr =
x86_make_disp(p->machine_EDI, x86_make_disp(p->machine_EDI,
get_offset(p, &p->buffer_varient[var_idx].ptr)); get_offset(p, &p->buffer_varient[var_idx].ptr));
@ -1118,7 +1118,7 @@ static struct x86_reg get_buffer_ptr( struct translate_sse *p,
return ptr; return ptr;
} }
else { else {
struct x86_reg ptr = p->tmp_EAX; struct x86_reg ptr = p->src_ECX;
const struct translate_buffer_varient *varient = &p->buffer_varient[var_idx]; const struct translate_buffer_varient *varient = &p->buffer_varient[var_idx];
struct x86_reg buf_stride = struct x86_reg buf_stride =
@ -1226,7 +1226,7 @@ static boolean build_vertex_emit( struct translate_sse *p,
p->machine_EDI = x86_make_reg(file_REG32, reg_DI); p->machine_EDI = x86_make_reg(file_REG32, reg_DI);
p->count_EBP = x86_make_reg(file_REG32, reg_BP); p->count_EBP = x86_make_reg(file_REG32, reg_BP);
p->tmp2_EDX = x86_make_reg(file_REG32, reg_DX); p->tmp2_EDX = x86_make_reg(file_REG32, reg_DX);
p->tmp3_ECX = x86_make_reg(file_REG32, reg_CX); p->src_ECX = x86_make_reg(file_REG32, reg_CX);
p->func = func; p->func = func;
memset(&p->loaded_const, 0, sizeof(p->loaded_const)); memset(&p->loaded_const, 0, sizeof(p->loaded_const));