diff options
author | Michal Krol <michal@tungstengraphics.com> | 2008-11-26 13:54:28 +0100 |
---|---|---|
committer | Michal Krol <michal@tungstengraphics.com> | 2008-11-26 17:11:03 +0100 |
commit | 1347439a87a26f261ab07c914ea4e69965703ee2 (patch) | |
tree | a251c8d0031895866334815e2d4de75a800ff8c7 /src/gallium/auxiliary/tgsi/tgsi_exec.c | |
parent | 1250526e3012f6958679c5dcdcb990387b53479b (diff) |
tgsi: Implement OPCODE_SSG/SGN.
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_exec.c')
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_exec.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index 7114119fe2..65a0f39fdb 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -840,6 +840,17 @@ micro_rnd( } static void +micro_sgn( + union tgsi_exec_channel *dst, + const union tgsi_exec_channel *src ) +{ + dst->f[0] = src->f[0] < 0.0f ? -1.0f : src->f[0] > 0.0f ? 1.0f : 0.0f; + dst->f[1] = src->f[1] < 0.0f ? -1.0f : src->f[1] > 0.0f ? 1.0f : 0.0f; + dst->f[2] = src->f[2] < 0.0f ? -1.0f : src->f[2] > 0.0f ? 1.0f : 0.0f; + dst->f[3] = src->f[3] < 0.0f ? -1.0f : src->f[3] > 0.0f ? 1.0f : 0.0f; +} + +static void micro_shl( union tgsi_exec_channel *dst, const union tgsi_exec_channel *src0, @@ -2423,7 +2434,12 @@ exec_instruction( break; case TGSI_OPCODE_SSG: - assert (0); + /* TGSI_OPCODE_SGN */ + FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) { + FETCH( &r[0], 0, chan_index ); + micro_sgn( &r[0], &r[0] ); + STORE( &r[0], 0, chan_index ); + } break; case TGSI_OPCODE_CMP: |