summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/cell/ppu
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-10-10 12:24:39 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-10-10 12:24:39 -0600
commita13f61d34d40475a6f12fb8696b6e7d58aaa78b7 (patch)
tree75b08f159ce8e84894d42ce19431f9d345db2f77 /src/gallium/drivers/cell/ppu
parentb3a68b24bd601a4fcffb701bbd73864ed92a05e1 (diff)
cell: fix LERP when dst reg is a src reg
Also, bump up frame size and fix some assertions.
Diffstat (limited to 'src/gallium/drivers/cell/ppu')
-rw-r--r--src/gallium/drivers/cell/ppu/cell_gen_fp.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
index ab71336754..db54c7e57b 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
@@ -369,7 +369,7 @@ store_dest_reg(struct codegen *gen,
static void
emit_prologue(struct codegen *gen)
{
- gen->frame_size = 256+128; /* XXX temporary */
+ gen->frame_size = 1024; /* XXX temporary */
spe_comment(gen->f, -4, "Function prologue:");
@@ -517,6 +517,7 @@ static boolean
emit_LERP(struct codegen *gen, const struct tgsi_full_instruction *inst)
{
int ch;
+ int tmp_reg = get_itemp(gen);
spe_comment(gen->f, -4, "LERP:");
for (ch = 0; ch < 4; ch++) {
if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
@@ -524,9 +525,10 @@ emit_LERP(struct codegen *gen, const struct tgsi_full_instruction *inst)
int s2_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[1]);
int s3_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[2]);
int d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
+
/* d = s3 + s1(s2 - s3) */
- spe_fs(gen->f, d_reg, s2_reg, s3_reg);
- spe_fma(gen->f, d_reg, d_reg, s1_reg, s3_reg);
+ spe_fs(gen->f, tmp_reg, s2_reg, s3_reg);
+ spe_fma(gen->f, d_reg, tmp_reg, s1_reg, s3_reg);
store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
free_itemps(gen);
}
@@ -1211,7 +1213,7 @@ emit_function_call(struct codegen *gen,
d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
numUsed = spe_get_registers_used(gen->f, usedRegs);
- assert(numUsed < gen->frame_size / 16 - 32);
+ assert(numUsed < gen->frame_size / 16 - 2);
/* save registers to stack */
for (i = 0; i < numUsed; i++) {
@@ -1269,7 +1271,7 @@ emit_TXP(struct codegen *gen, const struct tgsi_full_instruction *inst)
uint i, numUsed;
numUsed = spe_get_registers_used(gen->f, usedRegs);
- assert(numUsed < gen->frame_size / 16 - 32);
+ assert(numUsed < gen->frame_size / 16 - 2);
/* save registers to stack */
for (i = 0; i < numUsed; i++) {