Re: [Mesa-dev] [PATCH] intel/compiler: Print message descriptor as immediate source

2018-10-26 Thread Sagar Ghuge
Hi,

Thank you for sharing the following patch series. 

On 10/26/18 6:15 AM, Eero Tamminen wrote:
> Hi,
> 
> Toni had a working assembler in early 2017, but he had to stop working
> on it because nobody reviewed the patches needed for the disassembler.
> 
> Maybe his patch series for the disassembly output still has something
> useful for your assembler:
> 
Yes, it is. 

> * i965 shader disassembly label support:
> https://patchwork.freedesktop.org/series/19946/
> * i965 shader disassembly formatting changes:
> https://patchwork.freedesktop.org/series/19945/
> * Always print message descriptor and SFID for SEND instructions:
> https://patchwork.freedesktop.org/patch/223750/
> 
> ?
> 
> - Eero
> 
> On 10/25/18 2:25 AM, Sagar Ghuge wrote:
>> While disassembling send(c) instruction print message descriptor as
>> immediate source operand along with message descriptor. This allows
>> assembler to read immediate source operand and set bits accordingly.
>>
>> Signed-off-by: Sagar Ghuge 
>> ---
>>   src/intel/compiler/brw_disasm.c | 9 +++--
>>   1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/intel/compiler/brw_disasm.c 
>> b/src/intel/compiler/brw_disasm.c
>> index 6a7e988641..9c6df9e645 100644
>> --- a/src/intel/compiler/brw_disasm.c
>> +++ b/src/intel/compiler/brw_disasm.c
>> @@ -1606,7 +1606,12 @@ brw_disassemble_inst(FILE *file, const struct 
>> gen_device_info *devinfo,
>>    /* show the indirect descriptor source */
>>    pad(file, 48);
>>    err |= src1(file, devinfo, inst);
>> -  }
>> + pad(file, 64);
>> +  } else
>> + pad(file, 48);
>> +
>> +  /* Print message descriptor as immediate source */
>> +  fprintf(file, "0x%08"PRIx64, inst->data[1] >> 32);
>>       newline(file);
>>     pad(file, 16);
>> @@ -1615,7 +1620,7 @@ brw_disassemble_inst(FILE *file, const struct 
>> gen_device_info *devinfo,
>>     fprintf(file, "    ");
>>     err |= control(file, "SFID", devinfo->gen >= 6 ? gen6_sfid : 
>> gen4_sfid,
>>    sfid, );
>> -
>> +  string(file, " MsgDesc:");
>>       if (brw_inst_src1_reg_file(devinfo, inst) != BRW_IMMEDIATE_VALUE) {
>>    format(file, " indirect");
>>
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] intel/compiler: Print message descriptor as immediate source

2018-10-26 Thread Eero Tamminen

Hi,

Toni had a working assembler in early 2017, but he had to stop working
on it because nobody reviewed the patches needed for the disassembler.

Maybe his patch series for the disassembly output still has something
useful for your assembler:

* i965 shader disassembly label support:
https://patchwork.freedesktop.org/series/19946/
* i965 shader disassembly formatting changes:
https://patchwork.freedesktop.org/series/19945/
* Always print message descriptor and SFID for SEND instructions:
https://patchwork.freedesktop.org/patch/223750/

?

- Eero

On 10/25/18 2:25 AM, Sagar Ghuge wrote:

While disassembling send(c) instruction print message descriptor as
immediate source operand along with message descriptor. This allows
assembler to read immediate source operand and set bits accordingly.

Signed-off-by: Sagar Ghuge 
---
  src/intel/compiler/brw_disasm.c | 9 +++--
  1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/intel/compiler/brw_disasm.c b/src/intel/compiler/brw_disasm.c
index 6a7e988641..9c6df9e645 100644
--- a/src/intel/compiler/brw_disasm.c
+++ b/src/intel/compiler/brw_disasm.c
@@ -1606,7 +1606,12 @@ brw_disassemble_inst(FILE *file, const struct 
gen_device_info *devinfo,
   /* show the indirect descriptor source */
   pad(file, 48);
   err |= src1(file, devinfo, inst);
-  }
+ pad(file, 64);
+  } else
+ pad(file, 48);
+
+  /* Print message descriptor as immediate source */
+  fprintf(file, "0x%08"PRIx64, inst->data[1] >> 32);
  
newline(file);

pad(file, 16);
@@ -1615,7 +1620,7 @@ brw_disassemble_inst(FILE *file, const struct 
gen_device_info *devinfo,
fprintf(file, "");
err |= control(file, "SFID", devinfo->gen >= 6 ? gen6_sfid : gen4_sfid,
   sfid, );
-
+  string(file, " MsgDesc:");
  
if (brw_inst_src1_reg_file(devinfo, inst) != BRW_IMMEDIATE_VALUE) {

   format(file, " indirect");



___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] intel/compiler: Print message descriptor as immediate source

2018-10-25 Thread Sagar Ghuge


On 10/25/18 12:55 AM, Samuel Iglesias Gonsálvez wrote:
> On Thursday, 25 October 2018 1:25:53 (CEST) Sagar Ghuge wrote:
>> While disassembling send(c) instruction print message descriptor as
>> immediate source operand along with message descriptor. This allows
>> assembler to read immediate source operand and set bits accordingly.
>>
>> Signed-off-by: Sagar Ghuge 
>> ---
>>  src/intel/compiler/brw_disasm.c | 9 +++--
>>  1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/intel/compiler/brw_disasm.c
>> b/src/intel/compiler/brw_disasm.c index 6a7e988641..9c6df9e645 100644
>> --- a/src/intel/compiler/brw_disasm.c
>> +++ b/src/intel/compiler/brw_disasm.c
>> @@ -1606,7 +1606,12 @@ brw_disassemble_inst(FILE *file, const struct
>> gen_device_info *devinfo, /* show the indirect descriptor source */
>>   pad(file, 48);
>>   err |= src1(file, devinfo, inst);
>> -  }
>> + pad(file, 64);
>> +  } else
>> + pad(file, 48);
>> +
> 
> IIRC, we have a coding style rules that is: when the if's body has several 
> statements like here, then the else body should be between braces even when 
> it 
> is one line. That thing increases readability.
> 
Thanks for pointing out. 
> I have not found it written in the coding style guidelines [0], but I have 
> seen it in a lot of places of the code.
> 
> I can do this change for you before pushing it tomorrow. Sounds good?
> 
Yep, sounds great. Thank you. 

> With that fixed,
> 
> Reviewed-by: Samuel Iglesias Gonsálvez 
> 
> Sam
> 
> [0] https://www.mesa3d.org/codingstyle.html
> 
>> +  /* Print message descriptor as immediate source */
>> +  fprintf(file, "0x%08"PRIx64, inst->data[1] >> 32);
>>
>>newline(file);
>>pad(file, 16);
>> @@ -1615,7 +1620,7 @@ brw_disassemble_inst(FILE *file, const struct
>> gen_device_info *devinfo, fprintf(file, "");
>>err |= control(file, "SFID", devinfo->gen >= 6 ? gen6_sfid :
>> gen4_sfid, sfid, );
>> -
>> +  string(file, " MsgDesc:");
>>
>>if (brw_inst_src1_reg_file(devinfo, inst) != BRW_IMMEDIATE_VALUE) {
>>   format(file, " indirect");
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] intel/compiler: Print message descriptor as immediate source

2018-10-25 Thread Samuel Iglesias Gonsálvez
On Thursday, 25 October 2018 1:25:53 (CEST) Sagar Ghuge wrote:
> While disassembling send(c) instruction print message descriptor as
> immediate source operand along with message descriptor. This allows
> assembler to read immediate source operand and set bits accordingly.
> 
> Signed-off-by: Sagar Ghuge 
> ---
>  src/intel/compiler/brw_disasm.c | 9 +++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/src/intel/compiler/brw_disasm.c
> b/src/intel/compiler/brw_disasm.c index 6a7e988641..9c6df9e645 100644
> --- a/src/intel/compiler/brw_disasm.c
> +++ b/src/intel/compiler/brw_disasm.c
> @@ -1606,7 +1606,12 @@ brw_disassemble_inst(FILE *file, const struct
> gen_device_info *devinfo, /* show the indirect descriptor source */
>   pad(file, 48);
>   err |= src1(file, devinfo, inst);
> -  }
> + pad(file, 64);
> +  } else
> + pad(file, 48);
> +

IIRC, we have a coding style rules that is: when the if's body has several 
statements like here, then the else body should be between braces even when it 
is one line. That thing increases readability.

I have not found it written in the coding style guidelines [0], but I have 
seen it in a lot of places of the code.

I can do this change for you before pushing it tomorrow. Sounds good?

With that fixed,

Reviewed-by: Samuel Iglesias Gonsálvez 

Sam

[0] https://www.mesa3d.org/codingstyle.html

> +  /* Print message descriptor as immediate source */
> +  fprintf(file, "0x%08"PRIx64, inst->data[1] >> 32);
> 
>newline(file);
>pad(file, 16);
> @@ -1615,7 +1620,7 @@ brw_disassemble_inst(FILE *file, const struct
> gen_device_info *devinfo, fprintf(file, "");
>err |= control(file, "SFID", devinfo->gen >= 6 ? gen6_sfid :
> gen4_sfid, sfid, );
> -
> +  string(file, " MsgDesc:");
> 
>if (brw_inst_src1_reg_file(devinfo, inst) != BRW_IMMEDIATE_VALUE) {
>   format(file, " indirect");



signature.asc
Description: This is a digitally signed message part.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] intel/compiler: Print message descriptor as immediate source

2018-10-24 Thread Sagar Ghuge
While disassembling send(c) instruction print message descriptor as
immediate source operand along with message descriptor. This allows
assembler to read immediate source operand and set bits accordingly.

Signed-off-by: Sagar Ghuge 
---
 src/intel/compiler/brw_disasm.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/intel/compiler/brw_disasm.c b/src/intel/compiler/brw_disasm.c
index 6a7e988641..9c6df9e645 100644
--- a/src/intel/compiler/brw_disasm.c
+++ b/src/intel/compiler/brw_disasm.c
@@ -1606,7 +1606,12 @@ brw_disassemble_inst(FILE *file, const struct 
gen_device_info *devinfo,
  /* show the indirect descriptor source */
  pad(file, 48);
  err |= src1(file, devinfo, inst);
-  }
+ pad(file, 64);
+  } else
+ pad(file, 48);
+
+  /* Print message descriptor as immediate source */
+  fprintf(file, "0x%08"PRIx64, inst->data[1] >> 32);
 
   newline(file);
   pad(file, 16);
@@ -1615,7 +1620,7 @@ brw_disassemble_inst(FILE *file, const struct 
gen_device_info *devinfo,
   fprintf(file, "");
   err |= control(file, "SFID", devinfo->gen >= 6 ? gen6_sfid : gen4_sfid,
  sfid, );
-
+  string(file, " MsgDesc:");
 
   if (brw_inst_src1_reg_file(devinfo, inst) != BRW_IMMEDIATE_VALUE) {
  format(file, " indirect");
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev