[Mesa-dev] [PATCH 1/3] llvmpipe: Handle IABS.
Olivier Galibert
galibert at pobox.com
Tue May 8 23:26:05 PDT 2012
Signed-off-by: Olivier Galibert <galibert at pobox.com>
---
src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c
index 7f01156..0a43445 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c
@@ -1007,6 +1007,18 @@ i2f_emit_cpu(
emit_data->args[0]);
}
+/* TGSI_OPCODE_IABS (CPU Only)*/
+
+static void
+iabs_emit_cpu(
+ const struct lp_build_tgsi_action * action,
+ struct lp_build_tgsi_context * bld_base,
+ struct lp_build_emit_data * emit_data)
+{
+ emit_data->output[emit_data->chan] = lp_build_abs(&bld_base->int_bld,
+ emit_data->args[0]);
+}
+
/* TGSI_OPCODE_IDIV (CPU Only) */
static void
idiv_emit_cpu(
@@ -1541,6 +1553,7 @@ lp_set_default_actions_cpu(
bld_base->op_actions[TGSI_OPCODE_FLR].emit = flr_emit_cpu;
bld_base->op_actions[TGSI_OPCODE_I2F].emit = i2f_emit_cpu;
+ bld_base->op_actions[TGSI_OPCODE_IABS].emit = iabs_emit_cpu;
bld_base->op_actions[TGSI_OPCODE_IDIV].emit = idiv_emit_cpu;
bld_base->op_actions[TGSI_OPCODE_INEG].emit = ineg_emit_cpu;
bld_base->op_actions[TGSI_OPCODE_IMAX].emit = imax_emit_cpu;
--
1.7.10.280.gaa39
More information about the mesa-dev
mailing list