Discussion:
[Mesa-dev] [PATCH] intel/compiler: Always print flag subregister number
Sagar Ghuge
2018-11-15 22:16:02 UTC
Permalink
While disassembling the predicate always print flag subregister number
to keep grammar same across the generation for assembler tool.

Signed-off-by: Sagar Ghuge <***@intel.com>
---
src/intel/compiler/brw_disasm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/intel/compiler/brw_disasm.c b/src/intel/compiler/brw_disasm.c
index 6c79fec0a1..a218e1451c 100644
--- a/src/intel/compiler/brw_disasm.c
+++ b/src/intel/compiler/brw_disasm.c
@@ -1486,8 +1486,7 @@ brw_disassemble_inst(FILE *file, const struct gen_device_info *devinfo,
err |= control(file, "predicate inverse", pred_inv,
brw_inst_pred_inv(devinfo, inst), NULL);
format(file, "f%"PRIu64, devinfo->gen >= 7 ? brw_inst_flag_reg_nr(devinfo, inst) : 0);
- if (brw_inst_flag_subreg_nr(devinfo, inst))
- format(file, ".%"PRIu64, brw_inst_flag_subreg_nr(devinfo, inst));
+ format(file, ".%"PRIu64, brw_inst_flag_subreg_nr(devinfo, inst));
if (brw_inst_access_mode(devinfo, inst) == BRW_ALIGN_1) {
err |= control(file, "predicate control align1", pred_ctrl_align1,
brw_inst_pred_control(devinfo, inst), NULL);
--
2.17.1
Matt Turner
2018-11-21 22:13:49 UTC
Permalink
Post by Sagar Ghuge
While disassembling the predicate always print flag subregister number
to keep grammar same across the generation for assembler tool.
That's reasonable.
Post by Sagar Ghuge
---
src/intel/compiler/brw_disasm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/intel/compiler/brw_disasm.c b/src/intel/compiler/brw_disasm.c
index 6c79fec0a1..a218e1451c 100644
--- a/src/intel/compiler/brw_disasm.c
+++ b/src/intel/compiler/brw_disasm.c
@@ -1486,8 +1486,7 @@ brw_disassemble_inst(FILE *file, const struct gen_device_info *devinfo,
err |= control(file, "predicate inverse", pred_inv,
brw_inst_pred_inv(devinfo, inst), NULL);
format(file, "f%"PRIu64, devinfo->gen >= 7 ? brw_inst_flag_reg_nr(devinfo, inst) : 0);
- if (brw_inst_flag_subreg_nr(devinfo, inst))
- format(file, ".%"PRIu64, brw_inst_flag_subreg_nr(devinfo, inst));
+ format(file, ".%"PRIu64, brw_inst_flag_subreg_nr(devinfo, inst));
I would combine the two format() calls here.
Post by Sagar Ghuge
if (brw_inst_access_mode(devinfo, inst) == BRW_ALIGN_1) {
err |= control(file, "predicate control align1", pred_ctrl_align1,
brw_inst_pred_control(devinfo, inst), NULL);
--
In the same function (brw_disassemble_inst) a little below here there
is an additional place where we conditionally print the flag
subregister number. I suspect you want to change it too.
Sagar Ghuge
2018-12-09 07:07:43 UTC
Permalink
While disassembling the predicate always print flag subregister number
to keep grammar same across the generation for assembler tool.

v2: Club consecutive format calls (Matt Turner)

Signed-off-by: Sagar Ghuge <***@intel.com>
---
src/intel/compiler/brw_disasm.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/intel/compiler/brw_disasm.c b/src/intel/compiler/brw_disasm.c
index 6c79fec0a1..3778d8d996 100644
--- a/src/intel/compiler/brw_disasm.c
+++ b/src/intel/compiler/brw_disasm.c
@@ -1485,9 +1485,9 @@ brw_disassemble_inst(FILE *file, const struct gen_device_info *devinfo,
string(file, "(");
err |= control(file, "predicate inverse", pred_inv,
brw_inst_pred_inv(devinfo, inst), NULL);
- format(file, "f%"PRIu64, devinfo->gen >= 7 ? brw_inst_flag_reg_nr(devinfo, inst) : 0);
- if (brw_inst_flag_subreg_nr(devinfo, inst))
- format(file, ".%"PRIu64, brw_inst_flag_subreg_nr(devinfo, inst));
+ format(file, "f%"PRIu64".%"PRIu64,
+ devinfo->gen >= 7 ? brw_inst_flag_reg_nr(devinfo, inst) : 0,
+ brw_inst_flag_subreg_nr(devinfo, inst));
if (brw_inst_access_mode(devinfo, inst) == BRW_ALIGN_1) {
err |= control(file, "predicate control align1", pred_ctrl_align1,
brw_inst_pred_control(devinfo, inst), NULL);
@@ -1522,10 +1522,9 @@ brw_disassemble_inst(FILE *file, const struct gen_device_info *devinfo,
opcode != BRW_OPCODE_CSEL &&
opcode != BRW_OPCODE_IF &&
opcode != BRW_OPCODE_WHILE))) {
- format(file, ".f%"PRIu64,
- devinfo->gen >= 7 ? brw_inst_flag_reg_nr(devinfo, inst) : 0);
- if (brw_inst_flag_subreg_nr(devinfo, inst))
- format(file, ".%"PRIu64, brw_inst_flag_subreg_nr(devinfo, inst));
+ format(file, ".f%"PRIu64".%"PRIu64,
+ devinfo->gen >= 7 ? brw_inst_flag_reg_nr(devinfo, inst) : 0,
+ brw_inst_flag_subreg_nr(devinfo, inst));
}
}
--
2.17.1
Matt Turner
2018-12-10 18:41:46 UTC
Permalink
Post by Sagar Ghuge
While disassembling the predicate always print flag subregister number
to keep grammar same across the generation for assembler tool.
v2: Club consecutive format calls (Matt Turner)
Reviewed-by: Matt Turner <***@gmail.com>

and committed.

Loading...