summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_builder.cpp
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2015-08-20 21:55:52 -0400
committerIlia Mirkin <[email protected]>2015-08-28 18:28:04 -0400
commit275c5810ca7e38560b2a77281e7a0498c50126f8 (patch)
tree9096495089118805d0e4d042b7186b91f17f2842 /src/glsl/ir_builder.cpp
parent889a946a455c54a5a9bca144b2ea2fe66be39274 (diff)
glsl: provide the option of using BFE for unpack builting lowering
This greatly improves generated code, especially for the snorm variants, since it is able to get rid of the lshift/rshift for sext, as well as replacing each shift + mask with a single op. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/glsl/ir_builder.cpp')
-rw-r--r--src/glsl/ir_builder.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/glsl/ir_builder.cpp b/src/glsl/ir_builder.cpp
index cd03859cac0..c9cf1240dfe 100644
--- a/src/glsl/ir_builder.cpp
+++ b/src/glsl/ir_builder.cpp
@@ -567,6 +567,12 @@ csel(operand a, operand b, operand c)
}
ir_expression *
+bitfield_extract(operand a, operand b, operand c)
+{
+ return expr(ir_triop_bitfield_extract, a, b, c);
+}
+
+ir_expression *
bitfield_insert(operand a, operand b, operand c, operand d)
{
void *mem_ctx = ralloc_parent(a.val);