[Mesa-dev] [PATCH 1/2] tgsi: fix printing of 64-bit integer immediates
Nicolai Hähnle
nhaehnle at gmail.com
Thu Mar 30 15:29:35 UTC 2017
From: Nicolai Hähnle <nicolai.haehnle at amd.com>
---
src/gallium/auxiliary/tgsi/tgsi_dump.c | 8 ++++++--
src/gallium/auxiliary/tgsi/tgsi_strings.c | 6 ++++--
src/gallium/auxiliary/tgsi/tgsi_strings.h | 2 +-
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump.c b/src/gallium/auxiliary/tgsi/tgsi_dump.c
index 14911c4..6c0fcf8 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_dump.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_dump.c
@@ -18,20 +18,22 @@
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
+#include <inttypes.h>
+
#include "util/u_debug.h"
#include "util/u_string.h"
#include "util/u_math.h"
#include "util/u_memory.h"
#include "util/u_math.h"
#include "tgsi_dump.h"
#include "tgsi_info.h"
#include "tgsi_iterate.h"
#include "tgsi_strings.h"
@@ -80,20 +82,22 @@ dump_enum(
ctx->dump_printf( ctx, "%u", e );
else
ctx->dump_printf( ctx, "%s", enums[e] );
}
#define EOL() ctx->dump_printf( ctx, "\n" )
#define TXT(S) ctx->dump_printf( ctx, "%s", S )
#define CHR(C) ctx->dump_printf( ctx, "%c", C )
#define UIX(I) ctx->dump_printf( ctx, "0x%x", I )
#define UID(I) ctx->dump_printf( ctx, "%u", I )
+#define SI64D(I) ctx->dump_printf( ctx, "%"PRId64, I )
+#define UI64D(I) ctx->dump_printf( ctx, "%"PRIu64, I )
#define INSTID(I) ctx->dump_printf( ctx, "% 3u", I )
#define SID(I) ctx->dump_printf( ctx, "%d", I )
#define FLT(F) ctx->dump_printf( ctx, "%10.4f", F )
#define DBL(D) ctx->dump_printf( ctx, "%10.8f", D )
#define HFLT(F) ctx->dump_printf( ctx, "0x%08x", fui((F)) )
#define ENM(E,ENUMS) dump_enum( ctx, E, ENUMS, sizeof( ENUMS ) / sizeof( *ENUMS ) )
const char *
tgsi_swizzle_names[4] =
{
@@ -250,28 +254,28 @@ dump_imm_data(struct tgsi_iterate_context *iter,
case TGSI_IMM_FLOAT64: {
union di d;
d.ui = data[i].Uint | (uint64_t)data[i+1].Uint << 32;
DBL( d.d );
i++;
break;
}
case TGSI_IMM_INT64: {
union di d;
d.i = data[i].Uint | (uint64_t)data[i+1].Uint << 32;
- UID( d.i );
+ SI64D( d.i );
i++;
break;
}
case TGSI_IMM_UINT64: {
union di d;
d.ui = data[i].Uint | (uint64_t)data[i+1].Uint << 32;
- UID( d.ui );
+ UI64D( d.ui );
i++;
break;
}
case TGSI_IMM_FLOAT32:
if (ctx->dump_float_as_hex)
HFLT( data[i].Float );
else
FLT( data[i].Float );
break;
case TGSI_IMM_UINT32:
diff --git a/src/gallium/auxiliary/tgsi/tgsi_strings.c b/src/gallium/auxiliary/tgsi/tgsi_strings.c
index cebc1b4..d7201fc 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_strings.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_strings.c
@@ -200,26 +200,28 @@ const char *tgsi_fs_coord_origin_names[2] =
"UPPER_LEFT",
"LOWER_LEFT"
};
const char *tgsi_fs_coord_pixel_center_names[2] =
{
"HALF_INTEGER",
"INTEGER"
};
-const char *tgsi_immediate_type_names[4] =
+const char *tgsi_immediate_type_names[6] =
{
"FLT32",
"UINT32",
"INT32",
- "FLT64"
+ "FLT64",
+ "UINT64",
+ "INT64",
};
const char *tgsi_memory_names[3] =
{
"COHERENT",
"RESTRICT",
"VOLATILE",
};
diff --git a/src/gallium/auxiliary/tgsi/tgsi_strings.h b/src/gallium/auxiliary/tgsi/tgsi_strings.h
index 9a9362e..bb2d345 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_strings.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_strings.h
@@ -51,21 +51,21 @@ extern const char *tgsi_return_type_names[TGSI_RETURN_TYPE_COUNT];
extern const char *tgsi_interpolate_names[TGSI_INTERPOLATE_COUNT];
extern const char *tgsi_interpolate_locations[TGSI_INTERPOLATE_LOC_COUNT];
extern const char *tgsi_primitive_names[PIPE_PRIM_MAX];
extern const char *tgsi_fs_coord_origin_names[2];
extern const char *tgsi_fs_coord_pixel_center_names[2];
-extern const char *tgsi_immediate_type_names[4];
+extern const char *tgsi_immediate_type_names[6];
extern const char *tgsi_memory_names[3];
const char *
tgsi_file_name(unsigned file);
#if defined __cplusplus
}
--
2.9.3
More information about the mesa-dev
mailing list