[Mesa-dev] glsl: add ir_unop_b2d

Submitted by Iago Toral Quiroga on Jan. 12, 2016, 2:48 p.m.

Details

Message ID 1452610103-13781-1-git-send-email-itoral@igalia.com
State New
Headers show
Series "glsl: add ir_unop_b2d" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Iago Toral Quiroga Jan. 12, 2016, 2:48 p.m.
For boolean to double conversions
---

Looks like d2b is present but this one was missing for some reason. I found
this while testing fp64 support on Intel.

I have the NIR and i965 implementation of this too but that is be part of
the fp64 enablement in NIR/i965 that is not ready for review yet.

I guess drivers that already implement fp64 should implement this operation
too.

 src/glsl/ir.cpp                                          | 1 +
 src/glsl/ir.h                                            | 1 +
 src/glsl/ir_validate.cpp                                 | 4 ++++
 src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp | 1 +
 src/mesa/program/ir_to_mesa.cpp                          | 1 +
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp               | 1 +
 6 files changed, 9 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index d82bccd..f4a6f85 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -518,6 +518,7 @@  static const char *const operator_strs[] = {
    "i2f",
    "f2b",
    "b2f",
+   "b2d",
    "i2b",
    "b2i",
    "u2f",
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 93e0734..f64fbec 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -1337,6 +1337,7 @@  enum ir_expression_operation {
    ir_unop_i2f,         /**< Integer-to-float conversion. */
    ir_unop_f2b,         /**< Float-to-boolean conversion */
    ir_unop_b2f,         /**< Boolean-to-float conversion */
+   ir_unop_b2d,         /**< Boolean-to-double conversion */
    ir_unop_i2b,         /**< int-to-boolean conversion */
    ir_unop_b2i,         /**< Boolean-to-int conversion */
    ir_unop_u2f,         /**< Unsigned-to-float conversion. */
diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp
index dcc079c..7ae01a9 100644
--- a/src/glsl/ir_validate.cpp
+++ b/src/glsl/ir_validate.cpp
@@ -283,6 +283,10 @@  ir_validate::visit_leave(ir_expression *ir)
       assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
       assert(ir->type->base_type == GLSL_TYPE_FLOAT);
       break;
+   case ir_unop_b2d:
+      assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
+      assert(ir->type->base_type == GLSL_TYPE_DOUBLE);
+      break;
    case ir_unop_i2b:
       assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT);
       assert(ir->type->base_type == GLSL_TYPE_BOOL);
diff --git a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
index 78a8240..9e1b8aa 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
@@ -434,6 +434,7 @@  ir_channel_expressions_visitor::visit_leave(ir_assignment *ir)
    case ir_unop_d2u:
    case ir_unop_u2d:
    case ir_unop_d2b:
+   case ir_unop_b2d:
       unreachable("no fp64 support yet");
    }
 
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 852655d..9d85cbc 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -1259,6 +1259,7 @@  ir_to_mesa_visitor::visit(ir_expression *ir)
    case ir_unop_d2u:
    case ir_unop_u2d:
    case ir_unop_d2b:
+   case ir_unop_b2d:
    case ir_unop_frexp_sig:
    case ir_unop_frexp_exp:
       assert(!"not supported");
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 27a0a4f..676e378 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -2197,6 +2197,7 @@  glsl_to_tgsi_visitor::visit(ir_expression *ir)
       break;
 
    case ir_unop_get_buffer_size:
+   case ir_unop_b2d:
       assert(!"Not implemented yet");
       break;
    }

Comments

IIRC this should come out as b2i + i2d. You should be able to test this
with llvmpipe/softpipe, which support fp64.
On Jan 12, 2016 9:49 AM, "Iago Toral Quiroga" <itoral@igalia.com> wrote:

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

Either that or b2f + f2d.  I remember there being discussion about this
topic when Dave first sent out the fp64 patches.  I thought we decided
against a b2d opcode.

> On Jan 12, 2016 9:49 AM, "Iago Toral Quiroga" <itoral@igalia.com
> <mailto:itoral@igalia.com>> wrote:
> 
>     For boolean to double conversions
>     ---
> 
>     Looks like d2b is present but this one was missing for some reason.
>     I found
>     this while testing fp64 support on Intel.
> 
>     I have the NIR and i965 implementation of this too but that is be
>     part of
>     the fp64 enablement in NIR/i965 that is not ready for review yet.
> 
>     I guess drivers that already implement fp64 should implement this
>     operation
>     too.
> 
>      src/glsl/ir.cpp                                          | 1 +
>      src/glsl/ir.h                                            | 1 +
>      src/glsl/ir_validate.cpp                                 | 4 ++++
>      src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp | 1 +
>      src/mesa/program/ir_to_mesa.cpp                          | 1 +
>      src/mesa/state_tracker/st_glsl_to_tgsi.cpp               | 1 +
>      6 files changed, 9 insertions(+)
> 
>     diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
>     index d82bccd..f4a6f85 100644
>     --- a/src/glsl/ir.cpp
>     +++ b/src/glsl/ir.cpp
>     @@ -518,6 +518,7 @@ static const char *const operator_strs[] = {
>         "i2f",
>         "f2b",
>         "b2f",
>     +   "b2d",
>         "i2b",
>         "b2i",
>         "u2f",
>     diff --git a/src/glsl/ir.h b/src/glsl/ir.h
>     index 93e0734..f64fbec 100644
>     --- a/src/glsl/ir.h
>     +++ b/src/glsl/ir.h
>     @@ -1337,6 +1337,7 @@ enum ir_expression_operation {
>         ir_unop_i2f,         /**< Integer-to-float conversion. */
>         ir_unop_f2b,         /**< Float-to-boolean conversion */
>         ir_unop_b2f,         /**< Boolean-to-float conversion */
>     +   ir_unop_b2d,         /**< Boolean-to-double conversion */
>         ir_unop_i2b,         /**< int-to-boolean conversion */
>         ir_unop_b2i,         /**< Boolean-to-int conversion */
>         ir_unop_u2f,         /**< Unsigned-to-float conversion. */
>     diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp
>     index dcc079c..7ae01a9 100644
>     --- a/src/glsl/ir_validate.cpp
>     +++ b/src/glsl/ir_validate.cpp
>     @@ -283,6 +283,10 @@ ir_validate::visit_leave(ir_expression *ir)
>            assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
>            assert(ir->type->base_type == GLSL_TYPE_FLOAT);
>            break;
>     +   case ir_unop_b2d:
>     +      assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
>     +      assert(ir->type->base_type == GLSL_TYPE_DOUBLE);
>     +      break;
>         case ir_unop_i2b:
>            assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT);
>            assert(ir->type->base_type == GLSL_TYPE_BOOL);
>     diff --git
>     a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
>     b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
>     index 78a8240..9e1b8aa 100644
>     --- a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
>     +++ b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
>     @@ -434,6 +434,7 @@
>     ir_channel_expressions_visitor::visit_leave(ir_assignment *ir)
>         case ir_unop_d2u:
>         case ir_unop_u2d:
>         case ir_unop_d2b:
>     +   case ir_unop_b2d:
>            unreachable("no fp64 support yet");
>         }
> 
>     diff --git a/src/mesa/program/ir_to_mesa.cpp
>     b/src/mesa/program/ir_to_mesa.cpp
>     index 852655d..9d85cbc 100644
>     --- a/src/mesa/program/ir_to_mesa.cpp
>     +++ b/src/mesa/program/ir_to_mesa.cpp
>     @@ -1259,6 +1259,7 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
>         case ir_unop_d2u:
>         case ir_unop_u2d:
>         case ir_unop_d2b:
>     +   case ir_unop_b2d:
>         case ir_unop_frexp_sig:
>         case ir_unop_frexp_exp:
>            assert(!"not supported");
>     diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>     b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>     index 27a0a4f..676e378 100644
>     --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>     +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>     @@ -2197,6 +2197,7 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
>            break;
> 
>         case ir_unop_get_buffer_size:
>     +   case ir_unop_b2d:
>            assert(!"Not implemented yet");
>            break;
>         }
>     --
>     1.9.1
> 
>     _______________________________________________
>     mesa-dev mailing list
>     mesa-dev@lists.freedesktop.org <mailto:mesa-dev@lists.freedesktop.org>
>     http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 
> 
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
On Tue, Jan 12, 2016 at 12:33 PM, Ian Romanick <idr@freedesktop.org> wrote:
> On 01/12/2016 07:29 AM, Ilia Mirkin wrote:
>> IIRC this should come out as b2i + i2d. You should be able to test this
>> with llvmpipe/softpipe, which support fp64.
>
> Either that or b2f + f2d.  I remember there being discussion about this
> topic when Dave first sent out the fp64 patches.  I thought we decided
> against a b2d opcode.

Yeah, I didn't actually check. I hope it's b2i + i2d though since that
could be done in one op on NVIDIA :) Oh, and to pre-empt the question,
the reason why there's a d2b is that doubles can represent numbers
smaller than float, so d2f might come out as 0 even though the double
!= 0. However no such problem exists in the reverse direction.

  -ilia
On 13 January 2016 at 03:41, Ilia Mirkin <imirkin@alum.mit.edu> wrote:
> On Tue, Jan 12, 2016 at 12:33 PM, Ian Romanick <idr@freedesktop.org> wrote:
>> On 01/12/2016 07:29 AM, Ilia Mirkin wrote:
>>> IIRC this should come out as b2i + i2d. You should be able to test this
>>> with llvmpipe/softpipe, which support fp64.
>>
>> Either that or b2f + f2d.  I remember there being discussion about this
>> topic when Dave first sent out the fp64 patches.  I thought we decided
>> against a b2d opcode.
>
> Yeah, I didn't actually check. I hope it's b2i + i2d though since that
> could be done in one op on NVIDIA :) Oh, and to pre-empt the question,
> the reason why there's a d2b is that doubles can represent numbers
> smaller than float, so d2f might come out as 0 even though the double
> != 0. However no such problem exists in the reverse direction.

It's b2f + f2d from looking at ast_function.cpp.

Dave.
On Tue, 2016-01-12 at 10:29 -0500, Ilia Mirkin wrote:
> IIRC this should come out as b2i + i2d. You should be able to test
> this with llvmpipe/softpipe, which support fp64.

I see, thanks for the quick reply, I'll check this on intel.

Iago

> On Jan 12, 2016 9:49 AM, "Iago Toral Quiroga" <itoral@igalia.com>
> wrote:
>         For boolean to double conversions
>         ---
>         
>         Looks like d2b is present but this one was missing for some
>         reason. I found
>         this while testing fp64 support on Intel.
>         
>         I have the NIR and i965 implementation of this too but that is
>         be part of
>         the fp64 enablement in NIR/i965 that is not ready for review
>         yet.
>         
>         I guess drivers that already implement fp64 should implement
>         this operation
>         too.
>         
>          src/glsl/ir.cpp                                          | 1
>         +
>          src/glsl/ir.h                                            | 1
>         +
>          src/glsl/ir_validate.cpp                                 | 4
>         ++++
>          src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp | 1
>         +
>          src/mesa/program/ir_to_mesa.cpp                          | 1
>         +
>          src/mesa/state_tracker/st_glsl_to_tgsi.cpp               | 1
>         +
>          6 files changed, 9 insertions(+)
>         
>         diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
>         index d82bccd..f4a6f85 100644
>         --- a/src/glsl/ir.cpp
>         +++ b/src/glsl/ir.cpp
>         @@ -518,6 +518,7 @@ static const char *const operator_strs[] =
>         {
>             "i2f",
>             "f2b",
>             "b2f",
>         +   "b2d",
>             "i2b",
>             "b2i",
>             "u2f",
>         diff --git a/src/glsl/ir.h b/src/glsl/ir.h
>         index 93e0734..f64fbec 100644
>         --- a/src/glsl/ir.h
>         +++ b/src/glsl/ir.h
>         @@ -1337,6 +1337,7 @@ enum ir_expression_operation {
>             ir_unop_i2f,         /**< Integer-to-float conversion. */
>             ir_unop_f2b,         /**< Float-to-boolean conversion */
>             ir_unop_b2f,         /**< Boolean-to-float conversion */
>         +   ir_unop_b2d,         /**< Boolean-to-double conversion */
>             ir_unop_i2b,         /**< int-to-boolean conversion */
>             ir_unop_b2i,         /**< Boolean-to-int conversion */
>             ir_unop_u2f,         /**< Unsigned-to-float conversion. */
>         diff --git a/src/glsl/ir_validate.cpp
>         b/src/glsl/ir_validate.cpp
>         index dcc079c..7ae01a9 100644
>         --- a/src/glsl/ir_validate.cpp
>         +++ b/src/glsl/ir_validate.cpp
>         @@ -283,6 +283,10 @@ ir_validate::visit_leave(ir_expression
>         *ir)
>                assert(ir->operands[0]->type->base_type ==
>         GLSL_TYPE_BOOL);
>                assert(ir->type->base_type == GLSL_TYPE_FLOAT);
>                break;
>         +   case ir_unop_b2d:
>         +      assert(ir->operands[0]->type->base_type ==
>         GLSL_TYPE_BOOL);
>         +      assert(ir->type->base_type == GLSL_TYPE_DOUBLE);
>         +      break;
>             case ir_unop_i2b:
>                assert(ir->operands[0]->type->base_type ==
>         GLSL_TYPE_INT);
>                assert(ir->type->base_type == GLSL_TYPE_BOOL);
>         diff --git
>         a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
>         b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
>         index 78a8240..9e1b8aa 100644
>         --- a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
>         +++ b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
>         @@ -434,6 +434,7 @@
>         ir_channel_expressions_visitor::visit_leave(ir_assignment *ir)
>             case ir_unop_d2u:
>             case ir_unop_u2d:
>             case ir_unop_d2b:
>         +   case ir_unop_b2d:
>                unreachable("no fp64 support yet");
>             }
>         
>         diff --git a/src/mesa/program/ir_to_mesa.cpp
>         b/src/mesa/program/ir_to_mesa.cpp
>         index 852655d..9d85cbc 100644
>         --- a/src/mesa/program/ir_to_mesa.cpp
>         +++ b/src/mesa/program/ir_to_mesa.cpp
>         @@ -1259,6 +1259,7 @@ ir_to_mesa_visitor::visit(ir_expression
>         *ir)
>             case ir_unop_d2u:
>             case ir_unop_u2d:
>             case ir_unop_d2b:
>         +   case ir_unop_b2d:
>             case ir_unop_frexp_sig:
>             case ir_unop_frexp_exp:
>                assert(!"not supported");
>         diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>         b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>         index 27a0a4f..676e378 100644
>         --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>         +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>         @@ -2197,6 +2197,7 @@
>         glsl_to_tgsi_visitor::visit(ir_expression *ir)
>                break;
>         
>             case ir_unop_get_buffer_size:
>         +   case ir_unop_b2d:
>                assert(!"Not implemented yet");
>                break;
>             }
>         --
>         1.9.1
>         
>         _______________________________________________
>         mesa-dev mailing list
>         mesa-dev@lists.freedesktop.org
>         http://lists.freedesktop.org/mailman/listinfo/mesa-dev
On Tue, 2016-01-12 at 12:41 -0500, Ilia Mirkin wrote:
> On Tue, Jan 12, 2016 at 12:33 PM, Ian Romanick <idr@freedesktop.org> wrote:
> > On 01/12/2016 07:29 AM, Ilia Mirkin wrote:
> >> IIRC this should come out as b2i + i2d. You should be able to test this
> >> with llvmpipe/softpipe, which support fp64.
> >
> > Either that or b2f + f2d.  I remember there being discussion about this
> > topic when Dave first sent out the fp64 patches.  I thought we decided
> > against a b2d opcode.
> 
> Yeah, I didn't actually check. I hope it's b2i + i2d though since that
> could be done in one op on NVIDIA :)

Just tested this with i965 and it seems to be b2f + f2d

>  Oh, and to pre-empt the question,
> the reason why there's a d2b is that doubles can represent numbers
> smaller than float, so d2f might come out as 0 even though the double
> != 0. However no such problem exists in the reverse direction.

Makes sense, thanks for the explanation ilia!

Iago