mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 23:18:20 +02:00
cell: Fix bug with complement logic for SGE and SLE
This commit is contained in:
parent
3d2449247a
commit
15fceac040
1 changed files with 38 additions and 4 deletions
|
|
@ -716,8 +716,8 @@ emit_SGE(struct codegen *gen, const struct tgsi_full_instruction *inst)
|
|||
spe_fcgt(gen->f, d_reg, s2_reg, s1_reg);
|
||||
|
||||
/* convert d from 0x0/0xffffffff to 0.0/1.0 */
|
||||
/* d = d & ~one_reg */
|
||||
spe_andc(gen->f, d_reg, d_reg, get_const_one_reg(gen));
|
||||
/* d = ~d & one_reg */
|
||||
spe_andc(gen->f, d_reg, get_const_one_reg(gen), d_reg);
|
||||
|
||||
store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
|
||||
free_itemps(gen);
|
||||
|
|
@ -747,8 +747,8 @@ emit_SLE(struct codegen *gen, const struct tgsi_full_instruction *inst)
|
|||
spe_fcgt(gen->f, d_reg, s1_reg, s2_reg);
|
||||
|
||||
/* convert d from 0x0/0xffffffff to 0.0/1.0 */
|
||||
/* d = d & ~one_reg */
|
||||
spe_andc(gen->f, d_reg, d_reg, get_const_one_reg(gen));
|
||||
/* d = ~d & one_reg */
|
||||
spe_andc(gen->f, d_reg, get_const_one_reg(gen), d_reg);
|
||||
|
||||
store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
|
||||
free_itemps(gen);
|
||||
|
|
@ -821,6 +821,38 @@ emit_SNE(struct codegen *gen, const struct tgsi_full_instruction *inst)
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Emit compare. See emit_SGT for comments.
|
||||
*/
|
||||
static boolean
|
||||
emit_CMP(struct codegen *gen, const struct tgsi_full_instruction *inst)
|
||||
{
|
||||
int ch;
|
||||
|
||||
spe_comment(gen->f, -4, "CMP:");
|
||||
|
||||
for (ch = 0; ch < 4; ch++) {
|
||||
if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
|
||||
int s1_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
|
||||
int s2_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[1]);
|
||||
int d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
|
||||
|
||||
/* d = (s1 != s2) */
|
||||
spe_fceq(gen->f, d_reg, s1_reg, s2_reg);
|
||||
spe_nor(gen->f, d_reg, d_reg, d_reg);
|
||||
|
||||
/* convert d from 0x0/0xffffffff to 0.0/1.0 */
|
||||
/* d = d & one_reg */
|
||||
spe_and(gen->f, d_reg, d_reg, get_const_one_reg(gen));
|
||||
|
||||
store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
|
||||
free_itemps(gen);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Emit max. See emit_SGT for comments.
|
||||
*/
|
||||
|
|
@ -1028,6 +1060,8 @@ emit_instruction(struct codegen *gen,
|
|||
return emit_SEQ(gen, inst);
|
||||
case TGSI_OPCODE_SNE:
|
||||
return emit_SNE(gen, inst);
|
||||
case TGSI_OPCODE_CMP:
|
||||
return emit_CMP(gen, inst);
|
||||
case TGSI_OPCODE_MAX:
|
||||
return emit_MAX(gen, inst);
|
||||
case TGSI_OPCODE_MIN:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue