summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Krol <michal@vmware.com>2010-01-19 14:02:29 +0100
committerMichal Krol <michal@vmware.com>2010-01-19 14:02:29 +0100
commit80f8fb85a89b1ed89d5f7da3eab497d25a4fddf8 (patch)
treeb355ebc975bacaf9dff154aded84791fdccdea1b
parent54e90ada70cb284d54cc6ea31fdc399385efc3e0 (diff)
tgsi: Implement DABS and DNEG, remove DMOV.
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.c38
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_info.c3
2 files changed, 28 insertions, 13 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index 2438ce64367..f8a44689bdd 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -140,6 +140,16 @@ micro_d2f(union tgsi_exec_channel *dst,
}
static void
+micro_dabs(union tgsi_double_channel *dst,
+ const union tgsi_double_channel *src)
+{
+ dst->d[0] = src->d[0] >= 0.0 ? src->d[0] : -src->d[0];
+ dst->d[1] = src->d[1] >= 0.0 ? src->d[1] : -src->d[1];
+ dst->d[2] = src->d[2] >= 0.0 ? src->d[2] : -src->d[2];
+ dst->d[3] = src->d[3] >= 0.0 ? src->d[3] : -src->d[3];
+}
+
+static void
micro_dadd(union tgsi_double_channel *dst,
const union tgsi_double_channel *src)
{
@@ -170,16 +180,6 @@ micro_ddy(union tgsi_exec_channel *dst,
}
static void
-micro_dmov(union tgsi_double_channel *dst,
- const union tgsi_double_channel *src)
-{
- dst->d[0] = src->d[0];
- dst->d[1] = src->d[1];
- dst->d[2] = src->d[2];
- dst->d[3] = src->d[3];
-}
-
-static void
micro_ddiv(union tgsi_double_channel *dst,
const union tgsi_double_channel *src)
{
@@ -220,6 +220,16 @@ micro_dmin(union tgsi_double_channel *dst,
}
static void
+micro_dneg(union tgsi_double_channel *dst,
+ const union tgsi_double_channel *src)
+{
+ dst->d[0] = -src->d[0];
+ dst->d[1] = -src->d[1];
+ dst->d[2] = -src->d[2];
+ dst->d[3] = -src->d[3];
+}
+
+static void
micro_dslt(union tgsi_double_channel *dst,
const union tgsi_double_channel *src)
{
@@ -3845,8 +3855,12 @@ exec_instruction(
exec_d2f(mach, inst);
break;
- case TGSI_OPCODE_DMOV:
- exec_double_unary(mach, inst, micro_dmov);
+ case TGSI_OPCODE_DABS:
+ exec_double_unary(mach, inst, micro_dabs);
+ break;
+
+ case TGSI_OPCODE_DNEG:
+ exec_double_unary(mach, inst, micro_dneg);
break;
case TGSI_OPCODE_DADD:
diff --git a/src/gallium/auxiliary/tgsi/tgsi_info.c b/src/gallium/auxiliary/tgsi/tgsi_info.c
index 6403e6158bc..b2339e7f8e8 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_info.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_info.c
@@ -178,7 +178,8 @@ static const struct tgsi_opcode_info opcode_info[TGSI_OPCODE_LAST] =
{ 0, 0, 0, 0, 0, 0, "ENDSWITCH", TGSI_OPCODE_ENDSWITCH },
{ 1, 1, 0, 0, 0, 0, "F2D", TGSI_OPCODE_F2D },
{ 1, 1, 0, 0, 0, 0, "D2F", TGSI_OPCODE_D2F },
- { 1, 1, 0, 0, 0, 0, "DMOV", TGSI_OPCODE_DMOV },
+ { 1, 1, 0, 0, 0, 0, "DABS", TGSI_OPCODE_DABS },
+ { 1, 1, 0, 0, 0, 0, "DNEG", TGSI_OPCODE_DNEG },
{ 1, 2, 0, 0, 0, 0, "DADD", TGSI_OPCODE_DADD },
{ 1, 2, 0, 0, 0, 0, "DDIV", TGSI_OPCODE_DDIV },
{ 1, 2, 0, 0, 0, 0, "DMUL", TGSI_OPCODE_DMUL },