summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Oliveira <igor.oliveira@openbossa.org>2010-01-19 17:02:34 -0400
committerIgor Oliveira <igor.oliveira@openbossa.org>2010-09-29 23:07:26 -0400
commita81e03b7c698498d6f16966d22aef32a0f81b52a (patch)
tree651ae7e3587e69ce6e838265c137658ca1b61ae5
parent479baefe7cf46099742b09f557ab7f95916e1e94 (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 88967d5a30..c933f5df45 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -326,6 +326,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)
{
@@ -4012,6 +4032,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 23a8ae2e37..86f4b8eb5a 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 *