summaryrefslogtreecommitdiffstats
path: root/src/intel/compiler/brw_disasm.c
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2017-06-14 15:05:39 -0700
committerMatt Turner <[email protected]>2017-10-20 15:00:16 -0700
commitba50b538af81164476bb79fd686b48c2d43a0b22 (patch)
tree71cf62486d6dd20accbace37c48ca3aed95ec267 /src/intel/compiler/brw_disasm.c
parent3f14150e9ac9478bbbe4a93b9bb449d740971958 (diff)
i965: Print subreg in units of type-size on ternary instructions
The instruction word contains SubRegNum[4:2] so it's in units of dwords (hence the * 4 to get it in terms of bytes). Before this patch, the subreg would have been wrong for DF arguments. Reviewed-by: Scott D Phillips <[email protected]>
Diffstat (limited to 'src/intel/compiler/brw_disasm.c')
-rw-r--r--src/intel/compiler/brw_disasm.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/src/intel/compiler/brw_disasm.c b/src/intel/compiler/brw_disasm.c
index 2043d64b27a..8bcd3d35cd9 100644
--- a/src/intel/compiler/brw_disasm.c
+++ b/src/intel/compiler/brw_disasm.c
@@ -764,6 +764,12 @@ dest_3src(FILE *file, const struct gen_device_info *devinfo, const brw_inst *ins
{
int err = 0;
uint32_t reg_file;
+ enum brw_reg_type type =
+ brw_hw_3src_type_to_reg_type(devinfo,
+ brw_inst_3src_dst_type(devinfo, inst));
+ unsigned dst_subreg_nr =
+ brw_inst_3src_dst_subreg_nr(devinfo, inst) * 4 /
+ brw_reg_type_to_size(type);
if (devinfo->gen == 6 && brw_inst_3src_dst_reg_file(devinfo, inst))
reg_file = BRW_MESSAGE_REGISTER_FILE;
@@ -773,8 +779,8 @@ dest_3src(FILE *file, const struct gen_device_info *devinfo, const brw_inst *ins
err |= reg(file, reg_file, brw_inst_3src_dst_reg_nr(devinfo, inst));
if (err == -1)
return 0;
- if (brw_inst_3src_dst_subreg_nr(devinfo, inst))
- format(file, ".%"PRIu64, brw_inst_3src_dst_subreg_nr(devinfo, inst));
+ if (dst_subreg_nr)
+ format(file, ".%u", dst_subreg_nr);
string(file, "<1>");
err |= control(file, "writemask", writemask,
brw_inst_3src_dst_writemask(devinfo, inst), NULL);
@@ -928,7 +934,12 @@ static int
src0_3src(FILE *file, const struct gen_device_info *devinfo, const brw_inst *inst)
{
int err = 0;
- unsigned src0_subreg_nr = brw_inst_3src_src0_subreg_nr(devinfo, inst);
+ enum brw_reg_type type =
+ brw_hw_3src_type_to_reg_type(devinfo,
+ brw_inst_3src_src_type(devinfo, inst));
+ unsigned src0_subreg_nr =
+ brw_inst_3src_src0_subreg_nr(devinfo, inst) * 4 /
+ brw_reg_type_to_size(type);
err |= control(file, "negate", m_negate,
brw_inst_3src_src0_negate(devinfo, inst), NULL);
@@ -955,7 +966,12 @@ static int
src1_3src(FILE *file, const struct gen_device_info *devinfo, const brw_inst *inst)
{
int err = 0;
- unsigned src1_subreg_nr = brw_inst_3src_src1_subreg_nr(devinfo, inst);
+ enum brw_reg_type type =
+ brw_hw_3src_type_to_reg_type(devinfo,
+ brw_inst_3src_src_type(devinfo, inst));
+ unsigned src1_subreg_nr =
+ brw_inst_3src_src1_subreg_nr(devinfo, inst) * 4 /
+ brw_reg_type_to_size(type);
err |= control(file, "negate", m_negate,
brw_inst_3src_src1_negate(devinfo, inst), NULL);
@@ -983,7 +999,12 @@ static int
src2_3src(FILE *file, const struct gen_device_info *devinfo, const brw_inst *inst)
{
int err = 0;
- unsigned src2_subreg_nr = brw_inst_3src_src2_subreg_nr(devinfo, inst);
+ enum brw_reg_type type =
+ brw_hw_3src_type_to_reg_type(devinfo,
+ brw_inst_3src_src_type(devinfo, inst));
+ unsigned src2_subreg_nr =
+ brw_inst_3src_src2_subreg_nr(devinfo, inst) * 4 /
+ brw_reg_type_to_size(type);
err |= control(file, "negate", m_negate,
brw_inst_3src_src2_negate(devinfo, inst), NULL);