gallium/tgsi: Assert that we don't see integer abs modifiers.
authorEric Anholt <eric@anholt.net>
Thu, 7 Jan 2021 18:20:57 +0000 (10:20 -0800)
committerMarge Bot <eric+marge@anholt.net>
Wed, 13 Jan 2021 22:52:10 +0000 (22:52 +0000)
tgsi.rst says it's not supported, and llvmpipe, r600, and virgl don't
support it.  Make sure nobody else introduces them like I did while
testing only on softpipe.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8369>

src/gallium/auxiliary/nir/tgsi_to_nir.c
src/gallium/auxiliary/tgsi/tgsi_exec.c

index c8a6e0b..f0d5e28 100644 (file)
@@ -897,10 +897,8 @@ ttn_get_src(struct ttn_compile *c, struct tgsi_full_src_register *tgsi_fsrc,
       def = nir_bitcast_vector(b, def, 64);
 
    if (tgsi_src->Absolute) {
-      if (src_is_float)
-         def = nir_fabs(b, def);
-      else
-         def = nir_iabs(b, def);
+      assert(src_is_float);
+      def = nir_fabs(b, def);
    }
 
    if (tgsi_src->Negate) {
index 8eaae4e..d1203cb 100644 (file)
@@ -1713,11 +1713,8 @@ fetch_source(const struct tgsi_exec_machine *mach,
    fetch_source_d(mach, chan, reg, chan_index);
 
    if (reg->Register.Absolute) {
-      if (src_datatype == TGSI_EXEC_DATA_FLOAT) {
-         micro_abs(chan, chan);
-      } else {
-         micro_iabs(chan, chan);
-      }
+      assert(src_datatype == TGSI_EXEC_DATA_FLOAT);
+      micro_abs(chan, chan);
    }
 
    if (reg->Register.Negate) {