summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-10-10 11:52:55 -0600
committerBrian Paul <[email protected]>2008-10-10 11:52:55 -0600
commitdc7d213c54b046ec03ddb1fcfb0d9d9e905ffedc (patch)
treed3fbb385d64d77638409d1bf84b72924825afbbc
parent086a56134f334505ca9cd6f57194280c1ebf44dc (diff)
cell: fix bug in emit_FRC() when src register == dst register.
With this fix, the glsl/brick demo runs.
-rw-r--r--src/gallium/drivers/cell/ppu/cell_gen_fp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
index c8125a8a052..dad74bbad86 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
@@ -1119,7 +1119,7 @@ emit_FRC(struct codegen *gen, const struct tgsi_full_instruction *inst)
{
int ch;
- spe_comment(gen->f, -4, "FLR:");
+ spe_comment(gen->f, -4, "FRC:");
int zero_reg = get_itemp(gen);
spe_xor(gen->f, zero_reg, zero_reg, zero_reg);
@@ -1131,18 +1131,18 @@ emit_FRC(struct codegen *gen, const struct tgsi_full_instruction *inst)
int tmp_reg = get_itemp(gen);
/* If negative, subtract 1.0 */
- spe_fcgt(gen->f, d_reg, zero_reg, s1_reg);
- spe_selb(gen->f, tmp_reg, zero_reg, get_const_one_reg(gen), d_reg);
- spe_fs(gen->f, d_reg, s1_reg, tmp_reg);
+ spe_fcgt(gen->f, tmp_reg, zero_reg, s1_reg);
+ spe_selb(gen->f, tmp_reg, zero_reg, get_const_one_reg(gen), tmp_reg);
+ spe_fs(gen->f, tmp_reg, s1_reg, tmp_reg);
/* Convert float to int */
- spe_cflts(gen->f, d_reg, d_reg, 0);
+ spe_cflts(gen->f, tmp_reg, tmp_reg, 0);
/* Convert int to float */
- spe_csflt(gen->f, d_reg, d_reg, 0);
+ spe_csflt(gen->f, tmp_reg, tmp_reg, 0);
/* d = s1 - FLR(s1) */
- spe_fs(gen->f, d_reg, s1_reg, d_reg);
+ spe_fs(gen->f, d_reg, s1_reg, tmp_reg);
store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
free_itemps(gen);