[Beignet] [PATCH] output float immediate value with %f instead of %g
Guo, Yejun
yejun.guo at intel.com
Thu Jul 30 00:34:23 PDT 2015
Ping for review, thanks.
-----Original Message-----
From: Guo, Yejun
Sent: Thursday, July 23, 2015 8:48 AM
To: beignet at lists.freedesktop.org
Cc: Guo, Yejun
Subject: [PATCH] output float immediate value with %f instead of %g
In disassemble, a float immediate value is printf with %g, it outputs a wrong value with 8 bytes, change it to be %f with the correct 4 bytes. At some cases, the real data type is not float, so also print the value in hex format.
Signed-off-by: Guo Yejun <yejun.guo at intel.com>
---
backend/src/backend/gen/gen_mesa_disasm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backend/src/backend/gen/gen_mesa_disasm.c b/backend/src/backend/gen/gen_mesa_disasm.c
index df6156c..090143e 100644
--- a/backend/src/backend/gen/gen_mesa_disasm.c
+++ b/backend/src/backend/gen/gen_mesa_disasm.c
@@ -986,7 +986,7 @@ static int imm(FILE *file, uint32_t type, const void* inst)
format(file, "0x%xV", GEN_BITS_FIELD(inst, bits3.ud));
break;
case GEN_TYPE_F:
- format(file, "%-gF", GEN_BITS_FIELD(inst, bits3.f));
+ format(file, "%.*fF (0x%x)", GEN_BITS_FIELD(inst, bits3.f),
+ GEN_BITS_FIELD(inst, bits3.ud));
break;
case GEN_TYPE_UL:
assert(!(gen_version < 80));
--
1.9.1
More information about the Beignet
mailing list