From: Jonathan White Date: Tue, 16 Sep 2008 15:36:38 +0000 (-0600) Subject: cell: Fixed MIN/MAX algorithm X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2c54a6ee798ae22f92ef1fc4a1658ec5e701388a;p=mesa.git cell: Fixed MIN/MAX algorithm --- diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c index 98ee5af2790..612749507be 100644 --- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c +++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c @@ -657,9 +657,7 @@ emit_MAX(struct codegen *gen, const struct tgsi_full_instruction *inst) /* d = (s1 > s2) ? s1 : s2 */ spe_fcgt(gen->f, d_reg, s1_reg, s2_reg); - spe_and(gen->f, d_reg, d_reg, s1_reg); - spe_nor(gen->f, d_reg, d_reg, d_reg); - spe_and(gen->f, d_reg, d_reg, s2_reg); + spe_selb(gen->f, d_reg, s2_reg, s1_reg, d_reg); store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]); free_itemps(gen); @@ -685,11 +683,9 @@ emit_MIN(struct codegen *gen, const struct tgsi_full_instruction *inst) 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) ? s1 : s2 */ + /* d = (s2 > s1) ? s1 : s2 */ spe_fcgt(gen->f, d_reg, s2_reg, s1_reg); - spe_and(gen->f, d_reg, d_reg, s1_reg); - spe_nor(gen->f, d_reg, d_reg, d_reg); - spe_and(gen->f, d_reg, d_reg, s2_reg); + spe_selb(gen->f, d_reg, s2_reg, s1_reg, d_reg); store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]); free_itemps(gen);