[Mesa-dev] [PATCH] intel/compiler: Print floating point values upto precision 8

Sagar Ghuge sagar.ghuge at intel.com
Fri Oct 5 18:15:18 UTC 2018


avoid misinterpretation of encoded immediate values in instruction and
disassembled output.

Signed-off-by: Sagar Ghuge <sagar.ghuge at intel.com>
---
While encoding the immediate floating point values in instruction we use
values upto precision 8, but while disassembling, we print precision to
6 places, which round up the value and gives wrong interpretation for
encoded immediate constant. Printing it upto precision 8 will help in
reassembling it again.
 src/intel/compiler/brw_disasm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/compiler/brw_disasm.c b/src/intel/compiler/brw_disasm.c
index 322f4544df..7cbbc080b3 100644
--- a/src/intel/compiler/brw_disasm.c
+++ b/src/intel/compiler/brw_disasm.c
@@ -1293,7 +1293,7 @@ imm(FILE *file, const struct gen_device_info *devinfo, enum brw_reg_type type,
       format(file, "0x%08xV", brw_inst_imm_ud(devinfo, inst));
       break;
    case BRW_REGISTER_TYPE_F:
-      format(file, "%-gF", brw_inst_imm_f(devinfo, inst));
+      format(file, "%.8fF", brw_inst_imm_f(devinfo, inst));
       break;
    case BRW_REGISTER_TYPE_DF:
       format(file, "%-gDF", brw_inst_imm_df(devinfo, inst));
-- 
2.17.1



More information about the mesa-dev mailing list