summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/glcpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2016-10-17 17:54:40 -0700
committerIan Romanick <[email protected]>2017-01-20 15:41:23 -0800
commit012f2995c307a83212a88ff18e13bf7be006cd77 (patch)
treec593bbbb7d840cf6c87d410ec9886c54902f6ecf /src/compiler/glsl/glcpp
parent50d52df278c547ffd53505a3ebf98f13cba5bd56 (diff)
glsl: Add "built-in" functions to do 64/64 => 64 division
These functions are directly available in shaders. A #define is added to detect the presence. This allows these functions to be tested using piglit regardless of whether the driver uses them for lowering. The GLSL spec says that functions and macros beginning with __ are reserved for use by the implementation... hey, that's us! v2: Use function inlining. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/compiler/glsl/glcpp')
-rw-r--r--src/compiler/glsl/glcpp/glcpp-parse.y2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compiler/glsl/glcpp/glcpp-parse.y b/src/compiler/glsl/glcpp/glcpp-parse.y
index 39a7a89258f..d801cf8a9d7 100644
--- a/src/compiler/glsl/glcpp/glcpp-parse.y
+++ b/src/compiler/glsl/glcpp/glcpp-parse.y
@@ -2345,6 +2345,8 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
if (parser->extension_list->MESA_shader_integer_functions) {
add_builtin_define(parser, "__have_builtin_builtin_sign64", 1);
add_builtin_define(parser, "__have_builtin_builtin_umul64", 1);
+ add_builtin_define(parser, "__have_builtin_builtin_udiv64", 1);
+ add_builtin_define(parser, "__have_builtin_builtin_idiv64", 1);
}
}