On 19 October 2011 12:58, Brian Paul <span dir="ltr"><<a href="mailto:brianp@vmware.com">brianp@vmware.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 10/19/2011 01:53 PM, Paul Berry wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
On 18 October 2011 18:07, Brian Paul <<a href="mailto:brian.e.paul@gmail.com" target="_blank">brian.e.paul@gmail.com</a><br></div>
<mailto:<a href="mailto:brian.e.paul@gmail.com" target="_blank">brian.e.paul@gmail.com</a><u></u>>> wrote:<br>
<br>
From: Brian Paul <<a href="mailto:brianp@vmware.com" target="_blank">brianp@vmware.com</a> <mailto:<a href="mailto:brianp@vmware.com" target="_blank">brianp@vmware.com</a>>><div><div></div><div class="h5">
<br>
<br>
---<br>
.../drivers/dri/i965/brw_vec4_<u></u>reg_allocate.cpp | 2 +-<br>
1 files changed, 1 insertions(+), 1 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<u></u>brw_vec4_reg_allocate.cpp<br>
b/src/mesa/drivers/dri/i965/<u></u>brw_vec4_reg_allocate.cpp<br>
index 1ace91f..6de7682 100644<br>
--- a/src/mesa/drivers/dri/i965/<u></u>brw_vec4_reg_allocate.cpp<br>
+++ b/src/mesa/drivers/dri/i965/<u></u>brw_vec4_reg_allocate.cpp<br>
@@ -217,7 +217,7 @@ vec4_visitor::reg_allocate()<br>
int reg = ra_get_node_reg(g, i);<br>
<br>
hw_reg_mapping[i] = first_assigned_grf +<br>
brw->vs.ra_reg_to_grf[reg];<br>
- prog_data->total_grf = MAX2(prog_data->total_grf,<br>
+ prog_data->total_grf = MAX2((int) prog_data->total_grf,<br>
hw_reg_mapping[i] +<br>
virtual_grf_sizes[i]);<br>
<br>
Since we're storing the result into an unsigned value, I'd prefer to<br>
fix the warning by converting the second argument of MAX2 to GLuint<br>
rather than converting the first argument of MAX2 to int.<br>
</div></div></blockquote>
<br>
I was wondering which way that should go. The types in that expression are:<br>
<br>
GLuint total_grf;<br>
int hw_reg_mapping[];<br>
<br>
can hw_reg_mapping[] values be negative?<br><font color="#888888">
<br>
-Brian<br>
<br>
</font></blockquote></div><br>No, every element of hw_reg_mapping is a register number, and those go from zero up. It's possible that a better fix would be to make hw_reg_mapping[] and and virtual_grf_sizes[] unsigned, but that might have more cascading effects than you want to deal with. Eric, do you have an opinion?<br>
<br>Aside: what compiler (and compiler options) are you using to see these warnings? I don't get them with GCC.<br>