Tobias Klausmann
2017-Nov-14 14:11 UTC
[Nouveau] [PATCH] nouveau/codegen: dump tgsi floats as hex values
Printing without this could lead to the following output, while the values are
not exactly zero:
IMM[5] FLT32 { 0.0000, 0.0000, 0.0000, 0.0000}
IMM[6] FLT32 { 0.0000, 0.0000, 0.0000, 0.0000}
IMM[7] FLT32 { 0.0000, 0.0000, 0.0000, 0.0000}
when printing the values as hex, we can now see the differences:
IMM[5] FLT32 {0x00000019, 0x0000000f, 0x00000005, 0x0000001e}
IMM[6] FLT32 {0x0000001e, 0x00000005, 0x0000000a, 0x00000014}
IMM[7] FLT32 {0x00000014, 0x0000000a, 0x0000000f, 0x00000019}
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann at mni.thm.de>
---
src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
index 34351dab51..898031811d 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
@@ -1095,7 +1095,7 @@ Source::Source(struct nv50_ir_prog_info *prog) :
info(prog)
tokens = (const struct tgsi_token *)info->bin.source;
if (prog->dbgFlags & NV50_IR_DEBUG_BASIC)
- tgsi_dump(tokens, 0);
+ tgsi_dump(tokens, TGSI_DUMP_FLOAT_AS_HEX);
}
Source::~Source()
--
2.15.0
Tobias Klausmann
2017-Nov-15 19:03 UTC
[Nouveau] [PATCH] nouveau/codegen: dump tgsi floats as hex values
ping! On 11/14/17 3:11 PM, Tobias Klausmann wrote:> Printing without this could lead to the following output, while the values are > not exactly zero: > IMM[5] FLT32 { 0.0000, 0.0000, 0.0000, 0.0000} > IMM[6] FLT32 { 0.0000, 0.0000, 0.0000, 0.0000} > IMM[7] FLT32 { 0.0000, 0.0000, 0.0000, 0.0000} > > when printing the values as hex, we can now see the differences: > IMM[5] FLT32 {0x00000019, 0x0000000f, 0x00000005, 0x0000001e} > IMM[6] FLT32 {0x0000001e, 0x00000005, 0x0000000a, 0x00000014} > IMM[7] FLT32 {0x00000014, 0x0000000a, 0x0000000f, 0x00000019} > > Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann at mni.thm.de> > --- > src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp > index 34351dab51..898031811d 100644 > --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp > +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp > @@ -1095,7 +1095,7 @@ Source::Source(struct nv50_ir_prog_info *prog) : info(prog) > tokens = (const struct tgsi_token *)info->bin.source; > > if (prog->dbgFlags & NV50_IR_DEBUG_BASIC) > - tgsi_dump(tokens, 0); > + tgsi_dump(tokens, TGSI_DUMP_FLOAT_AS_HEX); > } > > Source::~Source()
Pierre Moreau
2017-Nov-15 21:44 UTC
[Nouveau] [PATCH] nouveau/codegen: dump tgsi floats as hex values
This looks like the saner approach, compared to changing tgsi_dump.c to display more fractional digits. Maybe there could be a second option to display as both float and hex? Reviewed-by: Pierre Moreau <pierre.morrow at free.fr> On 2017-11-14 — 15:11, Tobias Klausmann wrote:> Printing without this could lead to the following output, while the values are > not exactly zero: > IMM[5] FLT32 { 0.0000, 0.0000, 0.0000, 0.0000} > IMM[6] FLT32 { 0.0000, 0.0000, 0.0000, 0.0000} > IMM[7] FLT32 { 0.0000, 0.0000, 0.0000, 0.0000} > > when printing the values as hex, we can now see the differences: > IMM[5] FLT32 {0x00000019, 0x0000000f, 0x00000005, 0x0000001e} > IMM[6] FLT32 {0x0000001e, 0x00000005, 0x0000000a, 0x00000014} > IMM[7] FLT32 {0x00000014, 0x0000000a, 0x0000000f, 0x00000019} > > Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann at mni.thm.de> > --- > src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp > index 34351dab51..898031811d 100644 > --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp > +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp > @@ -1095,7 +1095,7 @@ Source::Source(struct nv50_ir_prog_info *prog) : info(prog) > tokens = (const struct tgsi_token *)info->bin.source; > > if (prog->dbgFlags & NV50_IR_DEBUG_BASIC) > - tgsi_dump(tokens, 0); > + tgsi_dump(tokens, TGSI_DUMP_FLOAT_AS_HEX); > } > > Source::~Source() > -- > 2.15.0 > > _______________________________________________ > Nouveau mailing list > Nouveau at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/nouveau-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <https://lists.freedesktop.org/archives/nouveau/attachments/20171115/a32034be/attachment.sig>
Tobias Klausmann
2017-Nov-15 21:52 UTC
[Nouveau] [PATCH] nouveau/codegen: dump tgsi floats as hex values
Hi,
yeah in the long run showing both in an ordered manner would be a nice
thing to have! That would include patching the output and the tgsi
parser (who wants to delete half the output to parse it again e.g. with
nouveau_compiler).
I can image an output similar to the one below:
IMM[5] FLT32 { 0.0000, 0.0000, 0.0000, 0.0000} ^ IMM[5] FLT32
{0x00000019, 0x0000000f, 0x00000005, 0x0000001e}
IMM[6] FLT32 { 0.0000, 0.0000, 0.0000, 0.0000} = IMM[6] FLT32
{0x0000001e, 0x00000005, 0x0000000a, 0x00000014}
IMM[7] FLT32 { 0.0000, 0.0000, 0.0000, 0.0000} IMM[7] FLT32
{0x00000014, 0x0000000a, 0x0000000f, 0x00000019}
Greetings,
Tobias
PS: I have no push rights to commit this!
On 11/15/17 10:44 PM, Pierre Moreau wrote:> This looks like the saner approach, compared to changing tgsi_dump.c to
display
> more fractional digits. Maybe there could be a second option to display as
both
> float and hex?
>
> Reviewed-by: Pierre Moreau <pierre.morrow at free.fr>
>
> On 2017-11-14 — 15:11, Tobias Klausmann wrote:
>> Printing without this could lead to the following output, while the
values are
>> not exactly zero:
>> IMM[5] FLT32 { 0.0000, 0.0000, 0.0000, 0.0000}
>> IMM[6] FLT32 { 0.0000, 0.0000, 0.0000, 0.0000}
>> IMM[7] FLT32 { 0.0000, 0.0000, 0.0000, 0.0000}
>>
>> when printing the values as hex, we can now see the differences:
>> IMM[5] FLT32 {0x00000019, 0x0000000f, 0x00000005, 0x0000001e}
>> IMM[6] FLT32 {0x0000001e, 0x00000005, 0x0000000a, 0x00000014}
>> IMM[7] FLT32 {0x00000014, 0x0000000a, 0x0000000f, 0x00000019}
>>
>> Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann at
mni.thm.de>
>> ---
>> src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
>> index 34351dab51..898031811d 100644
>> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
>> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
>> @@ -1095,7 +1095,7 @@ Source::Source(struct nv50_ir_prog_info *prog) :
info(prog)
>> tokens = (const struct tgsi_token *)info->bin.source;
>>
>> if (prog->dbgFlags & NV50_IR_DEBUG_BASIC)
>> - tgsi_dump(tokens, 0);
>> + tgsi_dump(tokens, TGSI_DUMP_FLOAT_AS_HEX);
>> }
>>
>> Source::~Source()
>> --
>> 2.15.0
>>
>> _______________________________________________
>> Nouveau mailing list
>> Nouveau at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/nouveau
Reasonably Related Threads
- [PATCH] nouveau/codegen: dump tgsi floats as hex values
- [PATCH] nouveau/codegen: dump tgsi floats as hex values
- [PATCH] nouveau/codegen: dump tgsi floats as hex values
- [RFC PATCH] nouveau/compiler: Allow to omit line numbers when printing instructions
- [PATCH v2] nouveau/compiler: Allow to omit line numbers when printing instructions