diff options
author | Michal Krol <michal@vmware.com> | 2010-01-19 14:02:29 +0100 |
---|---|---|
committer | Igor Oliveira <igor.oliveira@openbossa.org> | 2010-09-29 23:07:26 -0400 |
commit | 150a1f6bafb39566be51539223ba0cd80f849cf5 (patch) | |
tree | 2fd36e0039187d2a76c0c5a59e4f5edb8bfe81be | |
parent | f9938db47a97cb9079049dc4a7d825cb23fb000b (diff) |
tgsi: Implement DABS and DNEG, remove DMOV.
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_exec.c | 38 | ||||
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_info.c | 3 |
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 84f32b123d..88967d5a30 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -176,6 +176,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) { @@ -206,16 +216,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) { @@ -256,6 +256,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) { @@ -3950,8 +3960,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 e4a7ea323f..794eb7f5e5 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 }, |