<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Apr 28, 2016 at 8:49 AM, Jose Fonseca <span dir="ltr"><<a href="mailto:jfonseca@vmware.com" target="_blank">jfonseca@vmware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 28/04/16 15:37, Connor Abbott wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
For the series:<br>
<br>
Reviewed-by: Connor Abbott <<a href="mailto:cwabbott0@gmail.com" target="_blank">cwabbott0@gmail.com</a>><br>
<br>
For the zero-sized array thing... we could make it a statically-sized<br>
array, since we never have more than 4 arguments to an ALU<br>
instruction, but that would be wasteful of memory. Also, we always<br>
have at least 1 argument, so we could make the size 1 to shut up the<br>
warning, but that would be more confusing and introduce undefined<br>
behavior in C99 that the compiler is likely to actually take advantage<br>
of. I don't see any options better than just accepting the warning<br>
and/or shutting that specific warning off.<br>
</blockquote>
<br></span>
I feared so. Thanks for looking into it though.<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>Can you be a bit more specific about the issues that MSVC has with zero-length arrays? Can it "accept nir_src src[0]" instead of "src[]"?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
Jose</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On Thu, Apr 28, 2016 at 7:27 AM, Jose Fonseca <<a href="mailto:jfonseca@vmware.com" target="_blank">jfonseca@vmware.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
As they are not standard C++ and are not supported by MSVC C++ compiler.<br>
<br>
Just have nir_imm_double match nir_imm_float above.<br>
---<br>
src/compiler/nir/nir_builder.h | 9 ++++++---<br>
1 file changed, 6 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h<br>
index a14f9ef..4fa9779 100644<br>
--- a/src/compiler/nir/nir_builder.h<br>
+++ b/src/compiler/nir/nir_builder.h<br>
@@ -117,9 +117,12 @@ nir_imm_float(nir_builder *build, float x)<br>
static inline nir_ssa_def *<br>
nir_imm_double(nir_builder *build, double x)<br>
{<br>
- nir_const_value v = { { .f64 = {x, 0, 0, 0} } };<br>
- nir_ssa_def *def = nir_build_imm(build, 1, 64, v);<br>
- return def;<br>
+ nir_const_value v;<br>
+<br>
+ memset(&v, 0, sizeof(v));<br>
+ v.f64[0] = x;<br>
+<br>
+ return nir_build_imm(build, 1, 64, v);<br>
}<br>
<br>
static inline nir_ssa_def *<br>
--<br>
2.5.0<br>
<br>
</blockquote></blockquote>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">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>
</div></div></blockquote></div><br></div></div>