summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/builtin_functions.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2016-10-18 16:46:35 -0700
committerIan Romanick <[email protected]>2017-01-20 15:41:23 -0800
commit695b04f7eb24bff108e8d85c476adb5cf9de6f2d (patch)
treecdb68980096ab9f21fba88aa3018ac9a1f26de45 /src/compiler/glsl/builtin_functions.cpp
parent82c31f3eb957a0089773db47a4aca8bf3eb4a29e (diff)
glsl: Add "built-in" functions to do 64%64 => 64 modulus
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/builtin_functions.cpp')
-rw-r--r--src/compiler/glsl/builtin_functions.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp
index 6d9ff4b504c..4a6c5afd65c 100644
--- a/src/compiler/glsl/builtin_functions.cpp
+++ b/src/compiler/glsl/builtin_functions.cpp
@@ -3103,6 +3103,10 @@ builtin_builder::create_builtins()
generate_ir::idiv64(mem_ctx, integer_functions_supported),
NULL);
+ add_function("__builtin_imod64",
+ generate_ir::imod64(mem_ctx, integer_functions_supported),
+ NULL);
+
add_function("__builtin_sign64",
generate_ir::sign64(mem_ctx, integer_functions_supported),
NULL);
@@ -3111,6 +3115,10 @@ builtin_builder::create_builtins()
generate_ir::udiv64(mem_ctx, integer_functions_supported),
NULL);
+ add_function("__builtin_umod64",
+ generate_ir::umod64(mem_ctx, integer_functions_supported),
+ NULL);
+
add_function("__builtin_umul64",
generate_ir::umul64(mem_ctx, integer_functions_supported),
NULL);