<p dir="ltr">IIRC this should come out as b2i + i2d. You should be able to test this with llvmpipe/softpipe, which support fp64.</p>
<div class="gmail_quote">On Jan 12, 2016 9:49 AM, "Iago Toral Quiroga" <<a href="mailto:itoral@igalia.com">itoral@igalia.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">For boolean to double conversions<br>
---<br>
<br>
Looks like d2b is present but this one was missing for some reason. I found<br>
this while testing fp64 support on Intel.<br>
<br>
I have the NIR and i965 implementation of this too but that is be part of<br>
the fp64 enablement in NIR/i965 that is not ready for review yet.<br>
<br>
I guess drivers that already implement fp64 should implement this operation<br>
too.<br>
<br>
src/glsl/ir.cpp | 1 +<br>
src/glsl/ir.h | 1 +<br>
src/glsl/ir_validate.cpp | 4 ++++<br>
src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp | 1 +<br>
src/mesa/program/ir_to_mesa.cpp | 1 +<br>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 1 +<br>
6 files changed, 9 insertions(+)<br>
<br>
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp<br>
index d82bccd..f4a6f85 100644<br>
--- a/src/glsl/ir.cpp<br>
+++ b/src/glsl/ir.cpp<br>
@@ -518,6 +518,7 @@ static const char *const operator_strs[] = {<br>
"i2f",<br>
"f2b",<br>
"b2f",<br>
+ "b2d",<br>
"i2b",<br>
"b2i",<br>
"u2f",<br>
diff --git a/src/glsl/ir.h b/src/glsl/ir.h<br>
index 93e0734..f64fbec 100644<br>
--- a/src/glsl/ir.h<br>
+++ b/src/glsl/ir.h<br>
@@ -1337,6 +1337,7 @@ enum ir_expression_operation {<br>
ir_unop_i2f, /**< Integer-to-float conversion. */<br>
ir_unop_f2b, /**< Float-to-boolean conversion */<br>
ir_unop_b2f, /**< Boolean-to-float conversion */<br>
+ ir_unop_b2d, /**< Boolean-to-double conversion */<br>
ir_unop_i2b, /**< int-to-boolean conversion */<br>
ir_unop_b2i, /**< Boolean-to-int conversion */<br>
ir_unop_u2f, /**< Unsigned-to-float conversion. */<br>
diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp<br>
index dcc079c..7ae01a9 100644<br>
--- a/src/glsl/ir_validate.cpp<br>
+++ b/src/glsl/ir_validate.cpp<br>
@@ -283,6 +283,10 @@ ir_validate::visit_leave(ir_expression *ir)<br>
assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);<br>
assert(ir->type->base_type == GLSL_TYPE_FLOAT);<br>
break;<br>
+ case ir_unop_b2d:<br>
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);<br>
+ assert(ir->type->base_type == GLSL_TYPE_DOUBLE);<br>
+ break;<br>
case ir_unop_i2b:<br>
assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT);<br>
assert(ir->type->base_type == GLSL_TYPE_BOOL);<br>
diff --git a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp<br>
index 78a8240..9e1b8aa 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp<br>
@@ -434,6 +434,7 @@ ir_channel_expressions_visitor::visit_leave(ir_assignment *ir)<br>
case ir_unop_d2u:<br>
case ir_unop_u2d:<br>
case ir_unop_d2b:<br>
+ case ir_unop_b2d:<br>
unreachable("no fp64 support yet");<br>
}<br>
<br>
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp<br>
index 852655d..9d85cbc 100644<br>
--- a/src/mesa/program/ir_to_mesa.cpp<br>
+++ b/src/mesa/program/ir_to_mesa.cpp<br>
@@ -1259,6 +1259,7 @@ ir_to_mesa_visitor::visit(ir_expression *ir)<br>
case ir_unop_d2u:<br>
case ir_unop_u2d:<br>
case ir_unop_d2b:<br>
+ case ir_unop_b2d:<br>
case ir_unop_frexp_sig:<br>
case ir_unop_frexp_exp:<br>
assert(!"not supported");<br>
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp<br>
index 27a0a4f..676e378 100644<br>
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp<br>
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp<br>
@@ -2197,6 +2197,7 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)<br>
break;<br>
<br>
case ir_unop_get_buffer_size:<br>
+ case ir_unop_b2d:<br>
assert(!"Not implemented yet");<br>
break;<br>
}<br>
--<br>
1.9.1<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="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>