diff options
author | Dave Airlie <[email protected]> | 2016-06-09 09:52:52 +1000 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2017-01-20 15:41:23 -0800 |
commit | a68b6ee0630552c4bae685711940d5c0a5ab10fd (patch) | |
tree | cdb4d51a564456f2e645a6f23eb2eb6345bd5495 /src/compiler/glsl/ir_validate.cpp | |
parent | 7dd63c10c300cccb3810643fa73ca2c94733706a (diff) |
glsl/ir: Add support for 64-bit integer conversions.
This adds all the conversions in the world, I'm not 100% sure of all of
these are needed, but add all of them and we can cut them down later.
v2: fix issue with packing output types.
v3 (idr): Rebase on top of idr's series to generate
ir_expression_operation_constant.h. Fix transposed ir_validate
assertions for ir_unop_u642i64 and ir_unop_i642u64. Add missing
automatic type setup for ir_unop_u642i64 and ir_unop_i642u64.
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: Dave Airlie <[email protected]>
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Ian Romanick <[email protected]> [v2]
Reviewed-by: Matt Turner <[email protected]> [v3]
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ir_validate.cpp')
-rw-r--r-- | src/compiler/glsl/ir_validate.cpp | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/src/compiler/glsl/ir_validate.cpp b/src/compiler/glsl/ir_validate.cpp index 7e294f9f4db..97c695ceb94 100644 --- a/src/compiler/glsl/ir_validate.cpp +++ b/src/compiler/glsl/ir_validate.cpp @@ -331,6 +331,102 @@ ir_validate::visit_leave(ir_expression *ir) assert(ir->type->base_type == GLSL_TYPE_UINT); break; + case ir_unop_bitcast_u642d: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64); + assert(ir->type->base_type == GLSL_TYPE_DOUBLE); + break; + case ir_unop_bitcast_i642d: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64); + assert(ir->type->base_type == GLSL_TYPE_DOUBLE); + break; + case ir_unop_bitcast_d2u64: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE); + assert(ir->type->base_type == GLSL_TYPE_UINT64); + break; + case ir_unop_bitcast_d2i64: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE); + assert(ir->type->base_type == GLSL_TYPE_INT64); + break; + case ir_unop_i642i: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64); + assert(ir->type->base_type == GLSL_TYPE_INT); + break; + case ir_unop_u642i: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64); + assert(ir->type->base_type == GLSL_TYPE_INT); + break; + case ir_unop_i642u: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64); + assert(ir->type->base_type == GLSL_TYPE_UINT); + break; + case ir_unop_u642u: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64); + assert(ir->type->base_type == GLSL_TYPE_UINT); + break; + case ir_unop_i642b: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64); + assert(ir->type->base_type == GLSL_TYPE_BOOL); + break; + case ir_unop_i642f: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64); + assert(ir->type->base_type == GLSL_TYPE_FLOAT); + break; + case ir_unop_u642f: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64); + assert(ir->type->base_type == GLSL_TYPE_FLOAT); + break; + case ir_unop_i642d: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64); + assert(ir->type->base_type == GLSL_TYPE_DOUBLE); + break; + case ir_unop_u642d: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64); + assert(ir->type->base_type == GLSL_TYPE_DOUBLE); + break; + case ir_unop_i2i64: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT); + assert(ir->type->base_type == GLSL_TYPE_INT64); + break; + case ir_unop_u2i64: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT); + assert(ir->type->base_type == GLSL_TYPE_INT64); + break; + case ir_unop_b2i64: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL); + assert(ir->type->base_type == GLSL_TYPE_INT64); + break; + case ir_unop_f2i64: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT); + assert(ir->type->base_type == GLSL_TYPE_INT64); + break; + case ir_unop_d2i64: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE); + assert(ir->type->base_type == GLSL_TYPE_INT64); + break; + case ir_unop_i2u64: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT); + assert(ir->type->base_type == GLSL_TYPE_UINT64); + break; + case ir_unop_u2u64: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT); + assert(ir->type->base_type == GLSL_TYPE_UINT64); + break; + case ir_unop_f2u64: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT); + assert(ir->type->base_type == GLSL_TYPE_UINT64); + break; + case ir_unop_d2u64: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE); + assert(ir->type->base_type == GLSL_TYPE_UINT64); + break; + case ir_unop_u642i64: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64); + assert(ir->type->base_type == GLSL_TYPE_INT64); + break; + case ir_unop_i642u64: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64); + assert(ir->type->base_type == GLSL_TYPE_UINT64); + break; case ir_unop_trunc: case ir_unop_round_even: case ir_unop_ceil: @@ -370,6 +466,16 @@ ir_validate::visit_leave(ir_expression *ir) assert(ir->operands[0]->type == glsl_type::uvec2_type); break; + case ir_unop_pack_int_2x32: + assert(ir->type == glsl_type::int64_t_type); + assert(ir->operands[0]->type == glsl_type::ivec2_type); + break; + + case ir_unop_pack_uint_2x32: + assert(ir->type == glsl_type::uint64_t_type); + assert(ir->operands[0]->type == glsl_type::uvec2_type); + break; + case ir_unop_unpack_snorm_2x16: case ir_unop_unpack_unorm_2x16: case ir_unop_unpack_half_2x16: @@ -388,6 +494,16 @@ ir_validate::visit_leave(ir_expression *ir) assert(ir->operands[0]->type == glsl_type::double_type); break; + case ir_unop_unpack_int_2x32: + assert(ir->type == glsl_type::ivec2_type); + assert(ir->operands[0]->type == glsl_type::int64_t_type); + break; + + case ir_unop_unpack_uint_2x32: + assert(ir->type == glsl_type::uvec2_type); + assert(ir->operands[0]->type == glsl_type::uint64_t_type); + break; + case ir_unop_bitfield_reverse: assert(ir->operands[0]->type == ir->type); assert(ir->type->is_integer()); |