From bbce1c538dc0cb8bf3769510283d11847dc07540 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 9 Jun 2016 09:39:48 +1000 Subject: glsl/ast/ir: Add 64-bit integer constant support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds support for 64-bit integer constants to the parser, ast and ir. v2: fix a few issues found in testing. v3: Add missing ir_constant copy contructor support. v4: Use PRIu64 and PRId64 in printfs in glsl_parser_extras.cpp. Suggested by Nicolai. Rebase on Marek's linalloc changes. Signed-off-by: Dave Airlie Reviewed-by: Ian Romanick [v2] Reviewed-by: Matt Turner [v3] Reviewed-by: Nicolai Hähnle --- src/compiler/glsl/glsl_parser.yy | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/compiler/glsl/glsl_parser.yy') diff --git a/src/compiler/glsl/glsl_parser.yy b/src/compiler/glsl/glsl_parser.yy index 734dc499cca..852607455a2 100644 --- a/src/compiler/glsl/glsl_parser.yy +++ b/src/compiler/glsl/glsl_parser.yy @@ -97,6 +97,7 @@ static bool match_layout_qualifier(const char *s1, const char *s2, %union { int n; + int64_t n64; float real; double dreal; const char *identifier; @@ -174,6 +175,7 @@ static bool match_layout_qualifier(const char *s1, const char *s2, %token FLOATCONSTANT %token DOUBLECONSTANT %token INTCONSTANT UINTCONSTANT BOOLCONSTANT +%token INT64CONSTANT UINT64CONSTANT %token FIELD_SELECTION %token LEFT_OP RIGHT_OP %token INC_OP DEC_OP LE_OP GE_OP EQ_OP NE_OP @@ -452,6 +454,20 @@ primary_expression: $$->set_location(@1); $$->primary_expression.uint_constant = $1; } + | INT64CONSTANT + { + void *ctx = state->linalloc; + $$ = new(ctx) ast_expression(ast_int64_constant, NULL, NULL, NULL); + $$->set_location(@1); + $$->primary_expression.int64_constant = $1; + } + | UINT64CONSTANT + { + void *ctx = state->linalloc; + $$ = new(ctx) ast_expression(ast_uint64_constant, NULL, NULL, NULL); + $$->set_location(@1); + $$->primary_expression.uint64_constant = $1; + } | FLOATCONSTANT { void *ctx = state->linalloc; -- cgit v1.2.3