diff options
author | Dave Airlie <[email protected]> | 2016-06-09 10:01:00 +1000 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2017-01-20 15:41:23 -0800 |
commit | 78cc44280e3faeded8eea7face614e13d28481f0 (patch) | |
tree | 184345721e2f88812069fcf94801250b6a214b05 /src/compiler/glsl/ast_to_hir.cpp | |
parent | 85faf5082f06ed5828c6d97bb11dd2292ad0f86a (diff) |
glsl/ast: Add 64-bit integer support to conversion functions
This adds support to call the new operations on conversions.
v2 (idr): Delete an unnecessary break-statement. Noticed by Matt. Add
a missing blank line. Noticed by Ian.
v3 (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]>
Reviewed-by: Ian Romanick <[email protected]> [v1]
Reviewed-by: Matt Turner <[email protected]> [v2]
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ast_to_hir.cpp')
-rw-r--r-- | src/compiler/glsl/ast_to_hir.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp index b52a3975703..ffb57403f7a 100644 --- a/src/compiler/glsl/ast_to_hir.cpp +++ b/src/compiler/glsl/ast_to_hir.cpp @@ -259,6 +259,26 @@ get_implicit_conversion_operation(const glsl_type *to, const glsl_type *from, case GLSL_TYPE_INT: return ir_unop_i2d; case GLSL_TYPE_UINT: return ir_unop_u2d; case GLSL_TYPE_FLOAT: return ir_unop_f2d; + case GLSL_TYPE_INT64: return ir_unop_i642d; + case GLSL_TYPE_UINT64: return ir_unop_u642d; + default: return (ir_expression_operation)0; + } + + case GLSL_TYPE_UINT64: + if (!state->has_int64()) + return (ir_expression_operation)0; + switch (from->base_type) { + case GLSL_TYPE_INT: return ir_unop_i2u64; + case GLSL_TYPE_UINT: return ir_unop_u2u64; + case GLSL_TYPE_INT64: return ir_unop_i642u64; + default: return (ir_expression_operation)0; + } + + case GLSL_TYPE_INT64: + if (!state->has_int64()) + return (ir_expression_operation)0; + switch (from->base_type) { + case GLSL_TYPE_INT: return ir_unop_i2i64; default: return (ir_expression_operation)0; } |