summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2008-06-09 16:35:07 +1000
committerBen Skeggs <[email protected]>2008-06-29 15:46:16 +1000
commit31f6a24b59b0ac18e04336d2e3cbaa643358c88a (patch)
tree013ca31386cb09d4c1e616276e87b76e6cb55476 /src/gallium
parent6d0f7ea95475009ee17862786469f7b9a34a797f (diff)
nv50: support the other TGSI_UTIL_SIGN modes
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/nv50/nv50_program.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c
index 0274545131e..44914f41b66 100644
--- a/src/gallium/drivers/nv50/nv50_program.c
+++ b/src/gallium/drivers/nv50/nv50_program.c
@@ -727,6 +727,22 @@ emit_lit(struct nv50_pc *pc, struct nv50_reg **dst, struct nv50_reg **src)
set_pred(pc, 3, 0, &pc->p->insns[pc->p->insns_nr - 2]);
}
+static void
+emit_neg(struct nv50_pc *pc, struct nv50_reg *dst, struct nv50_reg *src)
+{
+ unsigned inst[2] = { 0, 0 };
+
+ set_long(pc, inst);
+ inst[0] |= 0xa0000000; /* delta */
+ inst[1] |= (7 << 29); /* delta */
+ inst[1] |= 0x04000000; /* negate arg0? probably not */
+ inst[1] |= (1 << 14); /* src .f32 */
+ set_dst(pc, dst, inst);
+ set_src_0(pc, src, inst);
+
+ emit(pc, inst);
+}
+
static struct nv50_reg *
tgsi_dst(struct nv50_pc *pc, int c, const struct tgsi_full_dst_register *dst)
{
@@ -794,6 +810,17 @@ tgsi_src(struct nv50_pc *pc, int chan, const struct tgsi_full_src_register *src)
emit_abs(pc, temp, r);
r = temp;
break;
+ case TGSI_UTIL_SIGN_TOGGLE:
+ temp = temp_temp(pc);
+ emit_neg(pc, temp, r);
+ r = temp;
+ break;
+ case TGSI_UTIL_SIGN_SET:
+ temp = temp_temp(pc);
+ emit_abs(pc, temp, r);
+ emit_neg(pc, temp, r);
+ r = temp;
+ break;
default:
assert(0);
break;