[Beignet] [PATCH 1/2] Refine the disasm for imm source.
junyan.he at inbox.com
junyan.he at inbox.com
Tue Apr 14 08:02:14 PDT 2015
From: Junyan He <junyan.he at linux.intel.com>
The immediate source has 4bits vector.
The previous print has some error, correct it.
Signed-off-by: Junyan He <junyan.he at linux.intel.com>
---
backend/src/backend/gen/gen_mesa_disasm.c | 20 ++++++++++----------
backend/src/backend/gen_defs.hpp | 1 +
2 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/backend/src/backend/gen/gen_mesa_disasm.c b/backend/src/backend/gen/gen_mesa_disasm.c
index 711b943..51aa628 100644
--- a/backend/src/backend/gen/gen_mesa_disasm.c
+++ b/backend/src/backend/gen/gen_mesa_disasm.c
@@ -949,32 +949,32 @@ static int imm(FILE *file, uint32_t type, const void* inst)
{
switch (type) {
case GEN_TYPE_UD:
- format(file, "0x%xUD", GEN_BITS_FIELD(inst, bits3.ud));
+ format(file, "0x%x:UD", GEN_BITS_FIELD(inst, bits3.ud));
break;
case GEN_TYPE_D:
- format(file, "%dD", GEN_BITS_FIELD(inst, bits3.d));
+ format(file, "%d:D", GEN_BITS_FIELD(inst, bits3.d));
break;
case GEN_TYPE_UW:
- format(file, "0x%xUW", (uint16_t) GEN_BITS_FIELD(inst, bits3.ud));
+ format(file, "0x%x:UW", (uint16_t) GEN_BITS_FIELD(inst, bits3.ud));
break;
case GEN_TYPE_W:
- format(file, "%dW", (int16_t) GEN_BITS_FIELD(inst, bits3.d));
+ format(file, "%d:W", (int16_t) GEN_BITS_FIELD(inst, bits3.d));
break;
- case GEN_TYPE_UB:
- format(file, "0x%xUB", (int8_t) GEN_BITS_FIELD(inst, bits3.ud));
+ case GEN_TYPE_UV:
+ format(file, "0x%x:UV", (int8_t) GEN_BITS_FIELD(inst, bits3.ud));
break;
case GEN_TYPE_VF:
format(file, "Vector Float");
break;
case GEN_TYPE_V:
- format(file, "0x%xV", GEN_BITS_FIELD(inst, bits3.ud));
+ format(file, "0x%x:V", GEN_BITS_FIELD(inst, bits3.ud));
break;
case GEN_TYPE_F:
- format(file, "%-gF", GEN_BITS_FIELD(inst, bits3.f));
+ format(file, "%-g:F", GEN_BITS_FIELD(inst, bits3.f));
break;
case GEN_TYPE_UL:
assert(!(gen_version < 80));
- format(file, "0x%.8x %.8xUQ", (((const union Gen8NativeInstruction *)inst)->bits3).ud,
+ format(file, "0x%.8x %.8x:UQ", (((const union Gen8NativeInstruction *)inst)->bits3).ud,
(((const union Gen8NativeInstruction *)inst)->bits2).ud);
break;
case GEN_TYPE_L:
@@ -982,7 +982,7 @@ static int imm(FILE *file, uint32_t type, const void* inst)
assert(!(gen_version < 80));
uint64_t val = (((const union Gen8NativeInstruction *)inst)->bits3).ud;
val = (val << 32) + ((((const union Gen8NativeInstruction *)inst)->bits2).ud);
- format(file, "0x%lldQ", val);
+ format(file, "0x%lld:Q", val);
}
}
return 0;
diff --git a/backend/src/backend/gen_defs.hpp b/backend/src/backend/gen_defs.hpp
index cd6b7c8..de476bb 100644
--- a/backend/src/backend/gen_defs.hpp
+++ b/backend/src/backend/gen_defs.hpp
@@ -244,6 +244,7 @@ enum GenMessageTarget {
#define GEN_TYPE_UW 2
#define GEN_TYPE_W 3
#define GEN_TYPE_UB 4
+#define GEN_TYPE_UV 4 /* packed uint vector, immediates only */
#define GEN_TYPE_B 5
#define GEN_TYPE_VF 5 /* packed float vector, immediates only? */
#define GEN_TYPE_V 6 /* packed int vector, immediates only, uword dest only */
--
1.7.9.5
More information about the Beignet
mailing list