From 9a2cbe02ed5bec475ef90e3404132a7e948041ae Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 7 Jan 2021 10:20:57 -0800 Subject: [PATCH] gallium/tgsi: Assert that we don't see integer abs modifiers. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Gert Wollny Part-of: --- src/gallium/auxiliary/nir/tgsi_to_nir.c | 6 ++---- src/gallium/auxiliary/tgsi/tgsi_exec.c | 7 ++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c index c8a6e0b..f0d5e28 100644 --- a/src/gallium/auxiliary/nir/tgsi_to_nir.c +++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c @@ -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) { diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index 8eaae4e..d1203cb 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -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) { -- 2.7.4