Mesa (master): gallium/tgsi: garbage collect unused TGSI_UTIL_SIGN_MODE.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jan 13 23:08:38 UTC 2021
Module: Mesa
Branch: master
Commit: 179e549995136b47e0adcda06cffb1db936124fb
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=179e549995136b47e0adcda06cffb1db936124fb
Author: Eric Anholt <eric at anholt.net>
Date: Thu Jan 7 10:56:54 2021 -0800
gallium/tgsi: garbage collect unused TGSI_UTIL_SIGN_MODE.
Noticed while git grepping for abs/neg stuff.
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Reviewed-by: Gert Wollny <gert.wollny at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8369>
---
src/gallium/auxiliary/tgsi/tgsi_util.c | 61 -------------------------------
src/gallium/auxiliary/tgsi/tgsi_util.h | 15 --------
src/gallium/drivers/svga/svga_tgsi_insn.c | 4 +-
3 files changed, 1 insertion(+), 79 deletions(-)
diff --git a/src/gallium/auxiliary/tgsi/tgsi_util.c b/src/gallium/auxiliary/tgsi/tgsi_util.c
index e1b604cff0e..d6ef81d281d 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_util.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_util.c
@@ -103,67 +103,6 @@ tgsi_util_set_src_register_swizzle(struct tgsi_src_register *reg,
}
-unsigned
-tgsi_util_get_full_src_register_sign_mode(
- const struct tgsi_full_src_register *reg,
- UNUSED unsigned component)
-{
- unsigned sign_mode;
-
- if (reg->Register.Absolute) {
- /* Consider only the post-abs negation. */
-
- if (reg->Register.Negate) {
- sign_mode = TGSI_UTIL_SIGN_SET;
- }
- else {
- sign_mode = TGSI_UTIL_SIGN_CLEAR;
- }
- }
- else {
- if (reg->Register.Negate) {
- sign_mode = TGSI_UTIL_SIGN_TOGGLE;
- }
- else {
- sign_mode = TGSI_UTIL_SIGN_KEEP;
- }
- }
-
- return sign_mode;
-}
-
-
-void
-tgsi_util_set_full_src_register_sign_mode(struct tgsi_full_src_register *reg,
- unsigned sign_mode)
-{
- switch (sign_mode) {
- case TGSI_UTIL_SIGN_CLEAR:
- reg->Register.Negate = 0;
- reg->Register.Absolute = 1;
- break;
-
- case TGSI_UTIL_SIGN_SET:
- reg->Register.Absolute = 1;
- reg->Register.Negate = 1;
- break;
-
- case TGSI_UTIL_SIGN_TOGGLE:
- reg->Register.Negate = 1;
- reg->Register.Absolute = 0;
- break;
-
- case TGSI_UTIL_SIGN_KEEP:
- reg->Register.Negate = 0;
- reg->Register.Absolute = 0;
- break;
-
- default:
- assert(0);
- }
-}
-
-
/**
* Determine which channels of the specificed src register are effectively
* used by this instruction.
diff --git a/src/gallium/auxiliary/tgsi/tgsi_util.h b/src/gallium/auxiliary/tgsi/tgsi_util.h
index 6dc576b1a00..e1f913d74b9 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_util.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_util.h
@@ -57,21 +57,6 @@ tgsi_util_set_src_register_swizzle(struct tgsi_src_register *reg,
unsigned swizzle,
unsigned component);
-
-#define TGSI_UTIL_SIGN_CLEAR 0 /* Force positive */
-#define TGSI_UTIL_SIGN_SET 1 /* Force negative */
-#define TGSI_UTIL_SIGN_TOGGLE 2 /* Negate */
-#define TGSI_UTIL_SIGN_KEEP 3 /* No change */
-
-unsigned
-tgsi_util_get_full_src_register_sign_mode(
- const struct tgsi_full_src_register *reg,
- unsigned component);
-
-void
-tgsi_util_set_full_src_register_sign_mode(struct tgsi_full_src_register *reg,
- unsigned sign_mode);
-
unsigned
tgsi_util_get_inst_usage_mask(const struct tgsi_full_instruction *inst,
unsigned src_idx);
diff --git a/src/gallium/drivers/svga/svga_tgsi_insn.c b/src/gallium/drivers/svga/svga_tgsi_insn.c
index 29c5dc3548e..e2d0865d944 100644
--- a/src/gallium/drivers/svga/svga_tgsi_insn.c
+++ b/src/gallium/drivers/svga/svga_tgsi_insn.c
@@ -257,9 +257,7 @@ translate_src_register( const struct svga_shader_emitter *emit,
reg->Register.SwizzleZ,
reg->Register.SwizzleW );
- /* src.mod isn't a bitfield, unfortunately:
- * See tgsi_util_get_full_src_register_sign_mode for implementation details.
- */
+ /* src.mod isn't a bitfield, unfortunately */
if (reg->Register.Absolute) {
if (reg->Register.Negate)
src.base.srcMod = SVGA3DSRCMOD_ABSNEG;
More information about the mesa-commit
mailing list