[Nouveau] [PATCH] nouveau/codegen: dump tgsi floats as hex values

Pierre Moreau pierre.morrow at free.fr
Wed Nov 15 21:44:57 UTC 2017


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>


More information about the Nouveau mailing list