From 275c5810ca7e38560b2a77281e7a0498c50126f8 Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Thu, 20 Aug 2015 21:55:52 -0400 Subject: 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 Reviewed-by: Matt Turner --- src/glsl/ir_builder.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/glsl/ir_builder.cpp') 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 @@ -566,6 +566,12 @@ csel(operand a, operand b, operand c) return expr(ir_triop_csel, a, b, 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) { -- cgit v1.2.3