From 4eb0b643ad978d94837e2d587a5d4358f974a25c Mon Sep 17 00:00:00 2001 From: marha Date: Thu, 24 Oct 2013 08:10:01 +0200 Subject: fontconfig mesa xserver git update 24 oct 2013 xserver commit 7ecfab47eb221dbb996ea6c033348b8eceaeb893 fontconfig commit 76ea9af816a50c6bb0b3dc2960460a90fadd9cdb mesa commit a6e45b6a17462f4d261a2d176791469847356923 --- mesalib/src/glsl/opt_algebraic.cpp | 40 ++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) (limited to 'mesalib/src/glsl/opt_algebraic.cpp') diff --git a/mesalib/src/glsl/opt_algebraic.cpp b/mesalib/src/glsl/opt_algebraic.cpp index 3e5802e18..37b2f02c6 100644 --- a/mesalib/src/glsl/opt_algebraic.cpp +++ b/mesalib/src/glsl/opt_algebraic.cpp @@ -210,6 +210,34 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) this->mem_ctx = ralloc_parent(ir); switch (ir->operation) { + case ir_unop_abs: + if (op_expr[0] == NULL) + break; + + switch (op_expr[0]->operation) { + case ir_unop_abs: + case ir_unop_neg: + this->progress = true; + temp = new(mem_ctx) ir_expression(ir_unop_abs, + ir->type, + op_expr[0]->operands[0], + NULL); + return swizzle_if_required(ir, temp); + default: + break; + } + break; + + case ir_unop_neg: + if (op_expr[0] == NULL) + break; + + if (op_expr[0]->operation == ir_unop_neg) { + this->progress = true; + return swizzle_if_required(ir, op_expr[0]->operands[0]); + } + break; + case ir_unop_logic_not: { enum ir_expression_operation new_op = ir_unop_logic_not; @@ -257,11 +285,9 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) * folding. */ if (op_const[0] && !op_const[1]) - reassociate_constant(ir, 0, op_const[0], - ir->operands[1]->as_expression()); + reassociate_constant(ir, 0, op_const[0], op_expr[1]); if (op_const[1] && !op_const[0]) - reassociate_constant(ir, 1, op_const[1], - ir->operands[0]->as_expression()); + reassociate_constant(ir, 1, op_const[1], op_expr[0]); break; case ir_binop_sub: @@ -315,11 +341,9 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) * constant folding. */ if (op_const[0] && !op_const[1]) - reassociate_constant(ir, 0, op_const[0], - ir->operands[1]->as_expression()); + reassociate_constant(ir, 0, op_const[0], op_expr[1]); if (op_const[1] && !op_const[0]) - reassociate_constant(ir, 1, op_const[1], - ir->operands[0]->as_expression()); + reassociate_constant(ir, 1, op_const[1], op_expr[0]); break; -- cgit v1.2.3