Re: [Nouveau] [PATCH] nouveau/codegen: dump tgsi floats as hex values
On 11/16/17 1:30 PM, Karol Herbst wrote: the problem is, that you also need to be able to save the TGSI into a file and run it rhough nouveau_compiler. Not really sure if it is worth the effort. Printing hex instead of numbers make more sense in this regard anyhow, because we are more precise and being able to debug some issues much better in the end. As long as the new version is still correctly parsed with nouveau_compiler, Yes, it is still parsed correctly! this change is acked-by me. On Wed, Nov 15, 2017 at 10:52 PM, Tobias Klausmann wrote: 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., 0., 0., 0.} ^ IMM[5] FLT32 {0x0019, 0x000f, 0x0005, 0x001e} IMM[6] FLT32 {0., 0., 0., 0.} = IMM[6] FLT32 {0x001e, 0x0005, 0x000a, 0x0014} IMM[7] FLT32 {0., 0., 0., 0.} IMM[7] FLT32 {0x0014, 0x000a, 0x000f, 0x0019} 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 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., 0., 0., 0.} IMM[6] FLT32 {0., 0., 0., 0.} IMM[7] FLT32 {0., 0., 0., 0.} when printing the values as hex, we can now see the differences: IMM[5] FLT32 {0x0019, 0x000f, 0x0005, 0x001e} IMM[6] FLT32 {0x001e, 0x0005, 0x000a, 0x0014} IMM[7] FLT32 {0x0014, 0x000a, 0x000f, 0x0019} Signed-off-by: Tobias Klausmann --- 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@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau ___ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau ___ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau
Re: [Nouveau] [PATCH] nouveau/codegen: dump tgsi floats as hex values
the problem is, that you also need to be able to save the TGSI into a file and run it rhough nouveau_compiler. Not really sure if it is worth the effort. Printing hex instead of numbers make more sense in this regard anyhow, because we are more precise and being able to debug some issues much better in the end. As long as the new version is still correctly parsed with nouveau_compiler, this change is acked-by me. On Wed, Nov 15, 2017 at 10:52 PM, Tobias Klausmann wrote: > 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., 0., 0., 0.} ^ IMM[5] FLT32 > {0x0019, 0x000f, 0x0005, 0x001e} > IMM[6] FLT32 {0., 0., 0., 0.} = IMM[6] FLT32 > {0x001e, 0x0005, 0x000a, 0x0014} > IMM[7] FLT32 {0., 0., 0., 0.} IMM[7] FLT32 > {0x0014, 0x000a, 0x000f, 0x0019} > > 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 >> >> 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., 0., 0., 0.} >>> IMM[6] FLT32 {0., 0., 0., 0.} >>> IMM[7] FLT32 {0., 0., 0., 0.} >>> >>> when printing the values as hex, we can now see the differences: >>> IMM[5] FLT32 {0x0019, 0x000f, 0x0005, 0x001e} >>> IMM[6] FLT32 {0x001e, 0x0005, 0x000a, 0x0014} >>> IMM[7] FLT32 {0x0014, 0x000a, 0x000f, 0x0019} >>> >>> Signed-off-by: Tobias Klausmann >>> --- >>> 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@lists.freedesktop.org >>> https://lists.freedesktop.org/mailman/listinfo/nouveau > > ___ > Nouveau mailing list > Nouveau@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/nouveau ___ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau
Re: [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., 0., 0., 0.} ^ IMM[5] FLT32 {0x0019, 0x000f, 0x0005, 0x001e} IMM[6] FLT32 {0., 0., 0., 0.} = IMM[6] FLT32 {0x001e, 0x0005, 0x000a, 0x0014} IMM[7] FLT32 {0., 0., 0., 0.} IMM[7] FLT32 {0x0014, 0x000a, 0x000f, 0x0019} 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 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., 0., 0., 0.} IMM[6] FLT32 {0., 0., 0., 0.} IMM[7] FLT32 {0., 0., 0., 0.} when printing the values as hex, we can now see the differences: IMM[5] FLT32 {0x0019, 0x000f, 0x0005, 0x001e} IMM[6] FLT32 {0x001e, 0x0005, 0x000a, 0x0014} IMM[7] FLT32 {0x0014, 0x000a, 0x000f, 0x0019} Signed-off-by: Tobias Klausmann --- 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@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau ___ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau
Re: [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 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., 0., 0., 0.} > IMM[6] FLT32 {0., 0., 0., 0.} > IMM[7] FLT32 {0., 0., 0., 0.} > > when printing the values as hex, we can now see the differences: > IMM[5] FLT32 {0x0019, 0x000f, 0x0005, 0x001e} > IMM[6] FLT32 {0x001e, 0x0005, 0x000a, 0x0014} > IMM[7] FLT32 {0x0014, 0x000a, 0x000f, 0x0019} > > Signed-off-by: Tobias Klausmann > --- > 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@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/nouveau signature.asc Description: PGP signature ___ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau
Re: [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., 0., 0., 0.} IMM[6] FLT32 {0., 0., 0., 0.} IMM[7] FLT32 {0., 0., 0., 0.} when printing the values as hex, we can now see the differences: IMM[5] FLT32 {0x0019, 0x000f, 0x0005, 0x001e} IMM[6] FLT32 {0x001e, 0x0005, 0x000a, 0x0014} IMM[7] FLT32 {0x0014, 0x000a, 0x000f, 0x0019} Signed-off-by: Tobias Klausmann --- 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() ___ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau
[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., 0., 0., 0.} IMM[6] FLT32 {0., 0., 0., 0.} IMM[7] FLT32 {0., 0., 0., 0.} when printing the values as hex, we can now see the differences: IMM[5] FLT32 {0x0019, 0x000f, 0x0005, 0x001e} IMM[6] FLT32 {0x001e, 0x0005, 0x000a, 0x0014} IMM[7] FLT32 {0x0014, 0x000a, 0x000f, 0x0019} Signed-off-by: Tobias Klausmann --- 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@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau