<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 31, 2016 at 2:59 AM, Samuel Iglesias Gonsálvez <span dir="ltr"><<a href="mailto:siglesias@igalia.com" target="_blank">siglesias@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Connor Abbott <<a href="mailto:connor.w.abbott@intel.com">connor.w.abbott@intel.com</a>><br>
<br>
v2:<br>
- Squash the printing doubles related patches into one patch (Sam).<br>
---<br>
src/compiler/nir/nir_print.c | 17 ++++++++++++++---<br>
1 file changed, 14 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c<br>
index c295c19..df7ef91 100644<br>
--- a/src/compiler/nir/nir_print.c<br>
+++ b/src/compiler/nir/nir_print.c<br>
@@ -68,7 +68,7 @@ static void<br>
print_register_decl(nir_register *reg, print_state *state)<br>
{<br>
FILE *fp = state->fp;<br>
- fprintf(fp, "decl_reg %s ", sizes[reg->num_components]);<br>
+ fprintf(fp, "decl_reg %s %u ", sizes[reg->num_components], reg->bit_size);<br>
if (reg->is_packed)<br>
fprintf(fp, "(packed) ");<br>
print_register(reg, state);<br>
@@ -83,7 +83,8 @@ print_ssa_def(nir_ssa_def *def, print_state *state)<br>
FILE *fp = state->fp;<br>
if (def->name != NULL)<br>
fprintf(fp, "/* %s */ ", def->name);<br>
- fprintf(fp, "%s ssa_%u", sizes[def->num_components], def->index);<br>
+ fprintf(fp, "%s %u ssa_%u", sizes[def->num_components], def->bit_size,<br>
+ def->index);<br>
}<br>
<br>
static void<br>
@@ -279,6 +280,13 @@ print_constant(nir_constant *c, const struct glsl_type *type, print_state *state<br>
}<br>
break;<br>
<br>
+ case GLSL_TYPE_DOUBLE:<br>
+ for (i = 0; i < total_elems; i++) {<br>
+ if (i > 0) fprintf(fp, ", ");<br>
+ fprintf(fp, "%f", c->value.d[i]);<br>
+ }<br>
+ break;<br>
+<br>
case GLSL_TYPE_STRUCT:<br>
for (i = 0; i < c->num_elements; i++) {<br>
if (i > 0) fprintf(fp, ", ");<br>
@@ -713,7 +721,10 @@ print_load_const_instr(nir_load_const_instr *instr, print_state *state)<br>
* and then print the float in a comment for readability.<br>
*/<br>
<br>
- fprintf(fp, "0x%08x /* %f */", instr->value.u32[i], instr->value.f32[i]);<br>
+ if (instr->def.bit_size == 64)<br>
+ fprintf(fp, "0x%16lx /* %f */", instr->value.u64[i], instr->value.f64[i]);<br></blockquote><div><br></div><div>I think you want llx. Long is 32-bit on some 32-bit platforms but long long is basically always 64-bit.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ else<br>
+ fprintf(fp, "0x%08x /* %f */", instr->value.u32[i], instr->value.f32[i]);<br>
}<br>
<br>
fprintf(fp, ")");<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.5.0<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>