Commit 85faf508 authored by Dave Airlie's avatar Dave Airlie Committed by Ian Romanick

glsl: Add 64-bit integer support for constant expressions

This just adds the new operations and add 64-bit integer support to all
the existing cases where it is needed.

v2: fix some issues found in testing.
v2.1: add unreachable (Ian), add missing int/uint pack/unpack (Dave).

v3 (idr): Rebase on top of idr's series to generate
ir_expression_operation_constant.h. In addition, this version:

    Adds missing support for ir_unop_bit_not, ir_binop_all_equal,
    ir_binop_any_nequal, ir_binop_vector_extract,
    ir_triop_vector_insert, and ir_quadop_vector.

    Removes support for uint64_t from ir_unop_abs and ir_unop_sign.

v4 (idr): "cut them down later" => Remove ir_unop_b2u64 and
ir_unop_u642b.  Handle these with extra i2u or u2i casts just like
uint(bool) and bool(uint) conversion is done.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: default avatarIan Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v2]
Reviewed-by: Matt Turner <mattst88@gmail.com> [v3]
Reviewed-by: default avatarNicolai Hähnle <nicolai.haehnle@amd.com>
parent a68b6ee0
......@@ -88,6 +88,42 @@ bitcast_f2u(float f)
return u;
}
static double
bitcast_u642d(uint64_t u)
{
assert(sizeof(double) == sizeof(uint64_t));
double d;
memcpy(&d, &u, sizeof(d));
return d;
}
static double
bitcast_i642d(int64_t i)
{
assert(sizeof(double) == sizeof(int64_t));
double d;
memcpy(&d, &i, sizeof(d));
return d;
}
static double
bitcast_d2u64(double d)
{
assert(sizeof(double) == sizeof(uint64_t));
uint64_t u;
memcpy(&u, &d, sizeof(d));
return u;
}
static double
bitcast_d2i64(double d)
{
assert(sizeof(double) == sizeof(int64_t));
int64_t i;
memcpy(&i, &d, sizeof(d));
return i;
}
/**
* Evaluate one component of a floating-point 4x8 unpacking function.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment