[Mesa-dev] [PATCH] Gallium/tgsi: Correct signdness of return value of bit operations

Gert Wollny gert.wollny at collabora.com
Thu Aug 9 08:43:36 UTC 2018


The GLSL functions  findLSB, findMSB, and countBits always return
a signed integer type. Let the according TGSI operations reflect this.

Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
---
 src/gallium/auxiliary/tgsi/tgsi_info.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_info.c b/src/gallium/auxiliary/tgsi/tgsi_info.c
index bbe1a21e43..a8c2bbe663 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_info.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_info.c
@@ -150,9 +150,6 @@ tgsi_opcode_infer_type(enum tgsi_opcode opcode)
    case TGSI_OPCODE_UBFE:
    case TGSI_OPCODE_BFI:
    case TGSI_OPCODE_BREV:
-   case TGSI_OPCODE_POPC:
-   case TGSI_OPCODE_LSB:
-   case TGSI_OPCODE_UMSB:
    case TGSI_OPCODE_IMG2HND:
    case TGSI_OPCODE_SAMP2HND:
       return TGSI_TYPE_UNSIGNED;
@@ -188,6 +185,9 @@ tgsi_opcode_infer_type(enum tgsi_opcode opcode)
    case TGSI_OPCODE_U64SGE:
    case TGSI_OPCODE_I64SLT:
    case TGSI_OPCODE_I64SGE:
+   case TGSI_OPCODE_LSB:
+   case TGSI_OPCODE_POPC:
+   case TGSI_OPCODE_UMSB:
       return TGSI_TYPE_SIGNED;
    case TGSI_OPCODE_DADD:
    case TGSI_OPCODE_DABS:
-- 
2.16.4



More information about the mesa-dev mailing list