diff options
author | Ian Romanick <[email protected]> | 2016-10-17 17:54:40 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2017-01-20 15:41:23 -0800 |
commit | 012f2995c307a83212a88ff18e13bf7be006cd77 (patch) | |
tree | c593bbbb7d840cf6c87d410ec9886c54902f6ecf /src/compiler/glsl/builtin_functions.cpp | |
parent | 50d52df278c547ffd53505a3ebf98f13cba5bd56 (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/builtin_functions.cpp')
-rw-r--r-- | src/compiler/glsl/builtin_functions.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp index f64ab6a5f33..6d9ff4b504c 100644 --- a/src/compiler/glsl/builtin_functions.cpp +++ b/src/compiler/glsl/builtin_functions.cpp @@ -3099,10 +3099,18 @@ builtin_builder::create_builtins() add_function("allInvocationsARB", _vote(ir_unop_vote_all), NULL); add_function("allInvocationsEqualARB", _vote(ir_unop_vote_eq), NULL); + add_function("__builtin_idiv64", + generate_ir::idiv64(mem_ctx, integer_functions_supported), + NULL); + add_function("__builtin_sign64", generate_ir::sign64(mem_ctx, integer_functions_supported), NULL); + add_function("__builtin_udiv64", + generate_ir::udiv64(mem_ctx, integer_functions_supported), + NULL); + add_function("__builtin_umul64", generate_ir::umul64(mem_ctx, integer_functions_supported), NULL); |