Mesa (master): nv50: handle CEIL and TRUNC opcodes

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Tue Sep 15 03:13:59 PDT 2009


Module: Mesa
Branch: master
Commit: 849885c7a6f44d96d74d9c5cd178a7bd2dd164ce
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=849885c7a6f44d96d74d9c5cd178a7bd2dd164ce

Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date:   Thu Sep 10 22:42:57 2009 +0200

nv50: handle CEIL and TRUNC opcodes

---

 src/gallium/drivers/nv50/nv50_program.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c
index 14df45a..6f0261e 100644
--- a/src/gallium/drivers/nv50/nv50_program.c
+++ b/src/gallium/drivers/nv50/nv50_program.c
@@ -1499,6 +1499,14 @@ nv50_program_tx_insn(struct nv50_pc *pc,
 			emit_add(pc, dst[c], src[0][c], src[1][c]);
 		}
 		break;
+	case TGSI_OPCODE_CEIL:
+		for (c = 0; c < 4; c++) {
+			if (!(mask & (1 << c)))
+				continue;
+			emit_cvt(pc, dst[c], src[0][c], -1,
+				 CVTOP_CEIL, CVT_F32_F32);
+		}
+		break;
 	case TGSI_OPCODE_COS:
 		if (mask & 8) {
 			emit_precossin(pc, temp, src[0][3]);
@@ -1678,6 +1686,14 @@ nv50_program_tx_insn(struct nv50_pc *pc,
 		emit_tex(pc, dst, mask, src[0], unit,
 			 inst->InstructionExtTexture.Texture, TRUE);
 		break;
+	case TGSI_OPCODE_TRUNC:
+		for (c = 0; c < 4; c++) {
+			if (!(mask & (1 << c)))
+				continue;
+			emit_cvt(pc, dst[c], src[0][c], -1,
+				 CVTOP_TRUNC, CVT_F32_F32);
+		}
+		break;
 	case TGSI_OPCODE_XPD:
 		temp = temp_temp(pc);
 		if (mask & (1 << 0)) {



More information about the mesa-commit mailing list