Mesa (gallium-0.1): draw: Implement TGSI_OPCODE_TRUNC.
MichaŠKról
michal at kemper.freedesktop.org
Wed Nov 5 10:59:47 UTC 2008
Module: Mesa
Branch: gallium-0.1
Commit: 5a0299875c7a4a9a0cb2cf55777c92c1b17d528b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5a0299875c7a4a9a0cb2cf55777c92c1b17d528b
Author: michal <michal at quad.(none)>
Date: Wed Nov 5 11:58:11 2008 +0100
draw: Implement TGSI_OPCODE_TRUNC.
---
src/gallium/auxiliary/draw/draw_vs_aos.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/src/gallium/auxiliary/draw/draw_vs_aos.c b/src/gallium/auxiliary/draw/draw_vs_aos.c
index 8723286..a688068 100644
--- a/src/gallium/auxiliary/draw/draw_vs_aos.c
+++ b/src/gallium/auxiliary/draw/draw_vs_aos.c
@@ -1632,6 +1632,17 @@ static boolean emit_SUB( struct aos_compilation *cp, const struct tgsi_full_inst
return TRUE;
}
+static boolean emit_TRUNC( struct aos_compilation *cp, const struct tgsi_full_instruction *op )
+{
+ struct x86_reg arg0 = fetch_src(cp, &op->FullSrcRegisters[0]);
+ struct x86_reg tmp0 = aos_get_xmm_reg(cp);
+
+ sse2_cvttps2dq(cp->func, tmp0, arg0);
+ sse2_cvtdq2ps(cp->func, tmp0, tmp0);
+
+ store_dest(cp, &op->FullDstRegisters[0], tmp0);
+ return TRUE;
+}
static boolean emit_XPD( struct aos_compilation *cp, const struct tgsi_full_instruction *op )
{
@@ -1770,6 +1781,9 @@ emit_instruction( struct aos_compilation *cp,
case TGSI_OPCODE_SIN:
return emit_SIN(cp, inst);
+ case TGSI_OPCODE_TRUNC:
+ return emit_TRUNC(cp, inst);
+
case TGSI_OPCODE_END:
return TRUE;
More information about the mesa-commit
mailing list