summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Oliveira <igor.oliveira@openbossa.org>2010-01-19 17:02:34 -0400
committerMichal Krol <michal@vmware.com>2010-01-20 13:05:26 +0100
commit991b1d0ce000908cef3403c954a0a4c34adced09 (patch)
tree82e035ba63637a5b117122c0b0200d037a16fdc4
parent1ce170eef554cf99a355523cf3665a5079e1dec6 (diff)
tgsi: implement DFRAC and DLDEXP opcodes
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.c28
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_info.c4
2 files changed, 31 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index f8a44689bdd..efb9ea19cdf 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -290,6 +290,26 @@ micro_dmad(union tgsi_double_channel *dst,
}
static void
+micro_dfrac(union tgsi_double_channel *dst,
+ const union tgsi_double_channel *src)
+{
+ dst->d[0] = src->d[0] - floor(src->d[0]);
+ dst->d[1] = src->d[1] - floor(src->d[1]);
+ dst->d[2] = src->d[2] - floor(src->d[2]);
+ dst->d[3] = src->d[3] - floor(src->d[3]);
+}
+
+static void
+micro_dldexp(union tgsi_double_channel *dst,
+ const union tgsi_double_channel *src)
+{
+ dst->d[0] = ldexp(src[0].d[0], src[1].d[0]);
+ dst->d[1] = ldexp(src[0].d[1], src[1].d[1]);
+ dst->d[2] = ldexp(src[0].d[2], src[1].d[2]);
+ dst->d[3] = ldexp(src[0].d[3], src[1].d[3]);
+}
+
+static void
micro_exp2(union tgsi_exec_channel *dst,
const union tgsi_exec_channel *src)
{
@@ -3907,6 +3927,14 @@ exec_instruction(
exec_double_trinary(mach, inst, micro_dmad);
break;
+ case TGSI_OPCODE_DFRAC:
+ exec_double_unary(mach, inst, micro_dfrac);
+ break;
+
+ case TGSI_OPCODE_DLDEXP:
+ exec_double_binary(mach, inst, micro_dldexp);
+ break;
+
default:
printf("%d", inst->Instruction.Opcode);
assert( 0 );
diff --git a/src/gallium/auxiliary/tgsi/tgsi_info.c b/src/gallium/auxiliary/tgsi/tgsi_info.c
index 269ef73f467..8340b072d8e 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_info.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_info.c
@@ -190,7 +190,9 @@ static const struct tgsi_opcode_info opcode_info[TGSI_OPCODE_LAST] =
{ 1, 2, 0, 0, 0, 0, "DSEQ", TGSI_OPCODE_DSEQ },
{ 1, 1, 0, 0, 0, 0, "DRCP", TGSI_OPCODE_DRCP },
{ 1, 1, 0, 0 ,0, 0, "DSQRT", TGSI_OPCODE_DSQRT },
- { 1, 3, 0, 0 ,0, 0, "DMAD", TGSI_OPCODE_DMAD }
+ { 1, 3, 0, 0 ,0, 0, "DMAD", TGSI_OPCODE_DMAD },
+ { 1, 1, 0, 0, 0, 0, "DFRAC", TGSI_OPCODE_DFRAC},
+ { 1, 2, 0, 0, 0, 0, "DLDEXP", TGSI_OPCODE_DLDEXP}
};
const struct tgsi_opcode_info *