nv50: interp cannot write flags reg

This commit is contained in:
Christoph Bumiller
2010-09-12 20:55:09 +02:00
parent cca3906a9b
commit 1f1411f2cc
3 changed files with 25 additions and 7 deletions
+21
View File
@@ -170,6 +170,27 @@ nv50_supported_src_mods(uint opcode, int s)
}
}
/* We may want an opcode table. */
boolean
nv50_op_can_write_flags(uint opcode)
{
if (nv_is_vector_op(opcode))
return FALSE;
switch (opcode) { /* obvious ones like KIL, CALL, etc. not included */
case NV_OP_PHI:
case NV_OP_MOV:
case NV_OP_LINTERP:
case NV_OP_PINTERP:
case NV_OP_LDA:
return FALSE;
default:
break;
}
if (opcode >= NV_OP_RCP && opcode <= NV_OP_PREEX2)
return FALSE;
return TRUE;
}
int
nv_nvi_refcount(struct nv_instruction *nvi)
{
+1
View File
@@ -486,6 +486,7 @@ int nv50_indirect_opnd(struct nv_instruction *);
boolean nv50_nvi_can_use_imm(struct nv_instruction *, int s);
boolean nv50_nvi_can_predicate(struct nv_instruction *);
boolean nv50_nvi_can_load(struct nv_instruction *, int s, struct nv_value *);
boolean nv50_op_can_write_flags(uint opcode);
ubyte nv50_supported_src_mods(uint opcode, int s);
int nv_nvi_refcount(struct nv_instruction *);
void nv_nvi_delete(struct nv_instruction *);
+3 -7
View File
@@ -700,19 +700,15 @@ bld_predicate(struct bld_context *bld, struct nv_value *src, boolean bool_only)
while (nvi->opcode == NV_OP_ABS || nvi->opcode == NV_OP_NEG ||
nvi->opcode == NV_OP_CVT) {
s0i = nvi->src[0]->value->insn;
if (!s0i ||
s0i->opcode == NV_OP_LDA ||
s0i->opcode == NV_OP_MOV ||
s0i->opcode == NV_OP_PHI)
if (!s0i || !nv50_op_can_write_flags(s0i->opcode))
break;
nvi = s0i;
assert(!nvi->flags_src);
}
}
if (nvi->opcode == NV_OP_LDA ||
nvi->opcode == NV_OP_MOV ||
nvi->opcode == NV_OP_PHI || nvi->bb != bld->pc->current_block) {
if (!nv50_op_can_write_flags(nvi->opcode) ||
nvi->bb != bld->pc->current_block) {
nvi = new_instruction(bld->pc, NV_OP_CVT);
nv_reference(bld->pc, &nvi->src[0], src);
}