[Mesa-dev] [PATCH v2 09/28] glsl/ir: Add builtin function support for doubles

Ilia Mirkin imirkin at alum.mit.edu
Sat Feb 7 17:10:59 PST 2015


On Fri, Feb 6, 2015 at 2:47 AM, Ian Romanick <idr at freedesktop.org> wrote:
> There's a bunch of tabs that should be replaced with spaces.

Soooo... this whole mixed tab/space situation is quite annoying. A lot
of lines come from copying other stuff, and having to fix up tabs on
those can be quite a bother. I'd be happy to run "M-x untabify" on the
whole file afterwards. But doing this mixed blocks of tabs vs
non-tabs, sometimes in the same function, is incredibly confusing IMO.

>
> Other comments below...
>
> On 02/06/2015 06:56 AM, Ilia Mirkin wrote:
>> From: Dave Airlie <airlied at gmail.com>
>>
>> Signed-off-by: Dave Airlie <airlied at redhat.com>
>> ---
>>  src/glsl/ir.cpp                 | 104 ++++++++++++++++++++++++++++++++++++++--
>>  src/glsl/ir.h                   |  21 ++++++++
>>  src/glsl/ir_validate.cpp        |  68 +++++++++++++++++++++++---
>>  src/mesa/program/ir_to_mesa.cpp |  10 ++++
>>  4 files changed, 193 insertions(+), 10 deletions(-)
>>
>> diff --git a/src/glsl/ir.h b/src/glsl/ir.h
>> index a0f48b2..6e7c654 100644
>> --- a/src/glsl/ir.h
>> +++ b/src/glsl/ir.h
>> @@ -1275,6 +1275,13 @@ enum ir_expression_operation {
>>     ir_unop_bitcast_f2u, /**< Bit-identical float-to-uint "conversion" */
>>     ir_unop_any,
>>
>> +   ir_unop_d2f,         /**< Double-to-float conversion. */
>> +   ir_unop_f2d,         /**< Float-to-double conversion. */
>> +   ir_unop_d2i,         /**< Double-to-integer conversion. */
>> +   ir_unop_i2d,         /**< Integer-to-double conversion. */
>> +   ir_unop_d2u,         /**< Double-to-unsigned conversion. */
>> +   ir_unop_u2d,         /**< Unsigned-to-double conversion. */
>> +
>
> These should be properly ordered with the other cast operations.  Also,
> ir_unop_d2b is missing.

Blast! You're right. I thought we were OK with d2f + f2b but... I
guess not. I'll add it in :(

>
>>     /**
>>      * \name Unary floating-point rounding operations.
>>      */
>> @@ -1345,6 +1352,17 @@ enum ir_expression_operation {
>>     /*@}*/
>>
>>     ir_unop_saturate,
>
> Blank line here.

Done.

>
>> +   /**
>> +    * \name Double packing, part of ARB_gpu_shader_fp64.
>> +    */
>> +   /*@{*/
>> +   ir_unop_pack_double_2x32,
>> +   ir_unop_unpack_double_2x32,
>> +   /*@}*/
>> +
>> +   ir_unop_frexp_sig,
>> +   ir_unop_frexp_exp,
>
> I'm confused about these... what is it?

frexp returns 2 values (significand and exponent), and glsl ir can't
support that. These 2 functions together return the 2 values, one at a
time. You didn't run into this with the float version with ARB_gs5
because it's insta-lowered to other things in builtin_functions.cpp,
but apparently there's some HW which actually has those instructions,
so Dave wanted to pass them through.

  -ilia


More information about the mesa-dev mailing list