<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 21, 2016 at 5:06 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: Iago Toral Quiroga <<a href="mailto:itoral@igalia.com">itoral@igalia.com</a>><br>
<br>
---<br>
src/compiler/nir/glsl_to_nir.cpp | 6 ++++++<br>
src/compiler/nir/nir_opcodes.py | 2 ++<br>
2 files changed, 8 insertions(+)<br>
<br>
diff --git a/src/compiler/nir/glsl_to_nir.cpp b/src/compiler/nir/glsl_to_nir.cpp<br>
index 952d787..d087a77 100644<br>
--- a/src/compiler/nir/glsl_to_nir.cpp<br>
+++ b/src/compiler/nir/glsl_to_nir.cpp<br>
@@ -1357,6 +1357,12 @@ nir_visitor::visit(ir_expression *ir)<br>
case ir_unop_d2i: result = nir_d2i(&b, srcs[0]); break;<br>
case ir_unop_d2u: result = nir_d2u(&b, srcs[0]); break;<br>
case ir_unop_d2b: result = nir_d2b(&b, srcs[0]); break;<br>
+ case ir_unop_i2d:<br>
+ result = supports_ints ? nir_i2d(&b, srcs[0]) : nir_fmov(&b, srcs[0]);<br>
+ break;<br>
+ case ir_unop_u2d:<br>
+ result = supports_ints ? nir_u2d(&b, srcs[0]) : nir_fmov(&b, srcs[0]);<br></blockquote><div><br></div><div>If you're going to be using the u2d opcode, you'd better support integers.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ break;<br>
case ir_unop_i2u:<br>
case ir_unop_u2i:<br>
case ir_unop_bitcast_i2f:<br>
diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py<br>
index a161ac1..cf6ce83 100644<br>
--- a/src/compiler/nir/nir_opcodes.py<br>
+++ b/src/compiler/nir/nir_opcodes.py<br>
@@ -164,6 +164,7 @@ unop_convert("f2u", tuint32, tfloat32, "src0") # Float-to-unsigned conversion<br>
unop_convert("d2i", tint32, tfloat64, "src0") # Double-to-integer conversion.<br>
unop_convert("d2u", tuint32, tfloat64, "src0") # Double-to-unsigned conversion.<br>
unop_convert("i2f", tfloat32, tint32, "src0") # Integer-to-float conversion.<br>
+unop_convert("i2d", tfloat64, tint32, "src0") # Integer-to-double conversion.<br>
# Float-to-boolean conversion<br>
unop_convert("f2b", tbool, tfloat32, "src0 != 0.0f")<br>
unop_convert("d2b", tbool, tfloat64, "src0 != 0.0")<br>
@@ -173,6 +174,7 @@ unop_convert("b2f", tfloat32, tbool, "src0 ? 1.0f : 0.0f")<br>
unop_convert("i2b", tbool, tint32, "src0 != 0")<br>
unop_convert("b2i", tint32, tbool, "src0 ? 1 : 0") # Boolean-to-int conversion<br>
unop_convert("u2f", tfloat32, tuint32, "src0") # Unsigned-to-float conversion.<br>
+unop_convert("u2d", tfloat64, tuint32, "src0") # Unsigned-to-double conversion.<br>
# double-to-float conversion<br>
unop_convert("d2f", tfloat32, tfloat64, "src0") # Single to double precision<br>
unop_convert("f2d", tfloat64, tfloat32, "src0") # Double to single precision<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>