[Nouveau] [PATCH] nouveau/codegen: dump tgsi floats as hex values
Karol Herbst
kherbst at redhat.com
Thu Nov 16 12:30:14 UTC 2017
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
<tobias.johannes.klausmann at mni.thm.de> 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.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
>
> _______________________________________________
> Nouveau mailing list
> Nouveau at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/nouveau
More information about the Nouveau
mailing list