summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/tgsi/tgsi_exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_exec.c')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index c933f5df45..e29dead8cb 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -346,6 +346,17 @@ micro_dldexp(union tgsi_double_channel *dst,
}
static void
+micro_dfracexp(union tgsi_double_channel *dst,
+ union tgsi_exec_channel *dst_exp,
+ const union tgsi_double_channel *src)
+{
+ dst->d[0] = frexp(src->d[0], &dst_exp->i[0]);
+ dst->d[1] = frexp(src->d[1], &dst_exp->i[1]);
+ dst->d[2] = frexp(src->d[2], &dst_exp->i[2]);
+ dst->d[3] = frexp(src->d[3], &dst_exp->i[3]);
+}
+
+static void
micro_exp2(union tgsi_exec_channel *dst,
const union tgsi_exec_channel *src)
{
@@ -2734,6 +2745,31 @@ exec_d2f(struct tgsi_exec_machine *mach,
}
static void
+exec_dfracexp(struct tgsi_exec_machine *mach,
+ const struct tgsi_full_instruction *inst)
+{
+ union tgsi_double_channel src;
+ union tgsi_double_channel dst;
+ union tgsi_exec_channel dst_exp;
+
+ if (((inst->Dst[0].Register.WriteMask & TGSI_WRITEMASK_XY) == TGSI_WRITEMASK_XY) &&
+ ((inst->Dst[1].Register.WriteMask & TGSI_WRITEMASK_X) == TGSI_WRITEMASK_X)) {
+ fetch_double_channel(mach, &src, &inst->Src[0], CHAN_X, CHAN_Y);
+ micro_dfracexp(&dst, &dst_exp, &src);
+ store_double_channel(mach, &dst, &inst->Dst[0], inst, CHAN_X, CHAN_Y);
+ store_dest(mach, &dst_exp, &inst->Dst[1], inst, CHAN_X, TGSI_EXEC_DATA_INT);
+ }
+ if (((inst->Dst[0].Register.WriteMask & TGSI_WRITEMASK_ZW) == TGSI_WRITEMASK_ZW) &&
+ ((inst->Dst[1].Register.WriteMask & TGSI_WRITEMASK_Y) == TGSI_WRITEMASK_Y)) {
+ fetch_double_channel(mach, &src, &inst->Src[0], CHAN_Z, CHAN_W);
+ micro_dfracexp(&dst, &dst_exp, &src);
+ store_double_channel(mach, &dst, &inst->Dst[0], inst, CHAN_Z, CHAN_W);
+ store_dest(mach, &dst_exp, &inst->Dst[1], inst, CHAN_Y, TGSI_EXEC_DATA_INT);
+ }
+}
+
+
+static void
micro_i2f(union tgsi_exec_channel *dst,
const union tgsi_exec_channel *src)
{
@@ -4040,6 +4076,10 @@ exec_instruction(
exec_double_binary(mach, inst, micro_dldexp);
break;
+ case TGSI_OPCODE_DFRACEXP:
+ exec_dfracexp(mach, inst);
+ break;
+
default:
printf("%d", inst->Instruction.Opcode);
assert( 0 );