gallivm: Eliminate tgsi_util_get_full_src_register_sign_mode call.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Sun, 16 Oct 2011 12:48:33 +0000 (13:48 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Sun, 16 Oct 2011 13:18:42 +0000 (14:18 +0100)
It complicates more than it simplifies, now that there's only one negate
bit on TGSI registers.

src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c

index 602f96e4037da7fa613954c4b2acca1a920d9289..40744e3bc91d0947fec19c6a58c9994ed09e2da5 100644 (file)
@@ -783,20 +783,12 @@ emit_fetch(
       return bld->base.undef;
    }
 
-   switch( tgsi_util_get_full_src_register_sign_mode( reg, chan_index ) ) {
-   case TGSI_UTIL_SIGN_CLEAR:
+   if (reg->Register.Absolute) {
       res = lp_build_abs( &bld->base, res );
-      break;
+   }
 
-   case TGSI_UTIL_SIGN_SET:
-      res = lp_build_abs( &bld->base, res );
-      /* fall through */
-   case TGSI_UTIL_SIGN_TOGGLE:
+   if (reg->Register.Negate) {
       res = lp_build_negate( &bld->base, res );
-      break;
-
-   case TGSI_UTIL_SIGN_KEEP:
-      break;
    }
 
    return res;