Mesa (master): nv50/ir: Add sat modifier for mul
Ilia Mirkin
imirkin at kemper.freedesktop.org
Mon Jan 5 05:42:01 UTC 2015
Module: Mesa
Branch: master
Commit: 44673512a84c0897c8eddabf4a56e79b7d5b3395
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=44673512a84c0897c8eddabf4a56e79b7d5b3395
Author: Roy Spliet <rspliet at eclipso.eu>
Date: Mon Jan 5 00:22:17 2015 +0100
nv50/ir: Add sat modifier for mul
Signed-off-by: Roy Spliet <rspliet at eclipso.eu>
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp | 6 ++++++
src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
index 3048f3d..2077388 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
@@ -1059,16 +1059,22 @@ CodeEmitterNV50::emitFMUL(const Instruction *i)
emitForm_IMM(i);
if (neg)
code[0] |= 0x8000;
+ if (i->saturate)
+ code[0] |= 1 << 8;
} else
if (i->encSize == 8) {
code[1] = i->rnd == ROUND_Z ? 0x0000c000 : 0;
if (neg)
code[1] |= 0x08000000;
+ if (i->saturate)
+ code[1] |= 1 << 20;
emitForm_MAD(i);
} else {
emitForm_MUL(i);
if (neg)
code[0] |= 0x8000;
+ if (i->saturate)
+ code[0] |= 1 << 8;
}
}
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
index 3694209..c13c565 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
@@ -84,7 +84,7 @@ static const struct opProperties _initProps[] =
// neg abs not sat c[] s[], a[], imm
{ OP_ADD, 0x3, 0x0, 0x0, 0x8, 0x2, 0x1, 0x1, 0x2 },
{ OP_SUB, 0x3, 0x0, 0x0, 0x0, 0x2, 0x1, 0x1, 0x2 },
- { OP_MUL, 0x3, 0x0, 0x0, 0x0, 0x2, 0x1, 0x1, 0x2 },
+ { OP_MUL, 0x3, 0x0, 0x0, 0x8, 0x2, 0x1, 0x1, 0x2 },
{ OP_MAX, 0x3, 0x3, 0x0, 0x0, 0x2, 0x1, 0x1, 0x0 },
{ OP_MIN, 0x3, 0x3, 0x0, 0x0, 0x2, 0x1, 0x1, 0x0 },
{ OP_MAD, 0x7, 0x0, 0x0, 0x8, 0x6, 0x1, 0x1, 0x0 }, // special constraint
More information about the mesa-commit
mailing list