aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ir_builder.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-01-28 07:58:44 +0100
committermarha <marha@users.sourceforge.net>2013-01-28 07:58:44 +0100
commit39b49babc915183f4d712053b46f0e010427c191 (patch)
treeb512cf3f17a0defe9e2cd6ababdc9f5337f93d0e /mesalib/src/glsl/ir_builder.cpp
parent3e3af07f7697e9d23dd62fcf8f3a055602ae3341 (diff)
parent69c8cec54b01ed522bf10baf20da70304bac701a (diff)
downloadvcxsrv-39b49babc915183f4d712053b46f0e010427c191.tar.gz
vcxsrv-39b49babc915183f4d712053b46f0e010427c191.tar.bz2
vcxsrv-39b49babc915183f4d712053b46f0e010427c191.zip
Merge remote-tracking branch 'origin/released'
* origin/released: mesa mkfontscale pixman git update 28 jan 2013
Diffstat (limited to 'mesalib/src/glsl/ir_builder.cpp')
-rw-r--r--mesalib/src/glsl/ir_builder.cpp159
1 files changed, 159 insertions, 0 deletions
diff --git a/mesalib/src/glsl/ir_builder.cpp b/mesalib/src/glsl/ir_builder.cpp
index c62f0b115..8fb30a02a 100644
--- a/mesalib/src/glsl/ir_builder.cpp
+++ b/mesalib/src/glsl/ir_builder.cpp
@@ -188,11 +188,27 @@ ir_expression *mul(operand a, operand b)
return expr(ir_binop_mul, a, b);
}
+ir_expression *div(operand a, operand b)
+{
+ return expr(ir_binop_div, a, b);
+}
+
+ir_expression *round_even(operand a)
+{
+ return expr(ir_unop_round_even, a);
+}
+
ir_expression *dot(operand a, operand b)
{
return expr(ir_binop_dot, a, b);
}
+ir_expression*
+clamp(operand a, operand b, operand c)
+{
+ return expr(ir_binop_min, expr(ir_binop_max, a, b), c);
+}
+
ir_expression *
saturate(operand a)
{
@@ -203,4 +219,147 @@ saturate(operand a)
new(mem_ctx) ir_constant(0.0f));
}
+ir_expression*
+equal(operand a, operand b)
+{
+ return expr(ir_binop_equal, a, b);
+}
+
+ir_expression*
+less(operand a, operand b)
+{
+ return expr(ir_binop_less, a, b);
+}
+
+ir_expression*
+greater(operand a, operand b)
+{
+ return expr(ir_binop_greater, a, b);
+}
+
+ir_expression*
+lequal(operand a, operand b)
+{
+ return expr(ir_binop_lequal, a, b);
+}
+
+ir_expression*
+gequal(operand a, operand b)
+{
+ return expr(ir_binop_gequal, a, b);
+}
+
+ir_expression*
+logic_not(operand a)
+{
+ return expr(ir_unop_logic_not, a);
+}
+
+ir_expression*
+logic_and(operand a, operand b)
+{
+ return expr(ir_binop_logic_and, a, b);
+}
+
+ir_expression*
+logic_or(operand a, operand b)
+{
+ return expr(ir_binop_logic_or, a, b);
+}
+
+ir_expression*
+bit_not(operand a)
+{
+ return expr(ir_unop_bit_not, a);
+}
+
+ir_expression*
+bit_and(operand a, operand b)
+{
+ return expr(ir_binop_bit_and, a, b);
+}
+
+ir_expression*
+bit_or(operand a, operand b)
+{
+ return expr(ir_binop_bit_or, a, b);
+}
+
+ir_expression*
+lshift(operand a, operand b)
+{
+ return expr(ir_binop_lshift, a, b);
+}
+
+ir_expression*
+rshift(operand a, operand b)
+{
+ return expr(ir_binop_rshift, a, b);
+}
+
+ir_expression*
+f2i(operand a)
+{
+ return expr(ir_unop_f2i, a);
+}
+
+ir_expression*
+i2f(operand a)
+{
+ return expr(ir_unop_i2f, a);
+}
+
+ir_expression*
+i2u(operand a)
+{
+ return expr(ir_unop_i2u, a);
+}
+
+ir_expression*
+u2i(operand a)
+{
+ return expr(ir_unop_u2i, a);
+}
+
+ir_expression*
+f2u(operand a)
+{
+ return expr(ir_unop_f2u, a);
+}
+
+ir_expression*
+u2f(operand a)
+{
+ return expr(ir_unop_u2f, a);
+}
+
+ir_if*
+if_tree(operand condition,
+ ir_instruction *then_branch)
+{
+ assert(then_branch != NULL);
+
+ void *mem_ctx = ralloc_parent(condition.val);
+
+ ir_if *result = new(mem_ctx) ir_if(condition.val);
+ result->then_instructions.push_tail(then_branch);
+ return result;
+}
+
+ir_if*
+if_tree(operand condition,
+ ir_instruction *then_branch,
+ ir_instruction *else_branch)
+{
+ assert(then_branch != NULL);
+ assert(else_branch != NULL);
+
+ void *mem_ctx = ralloc_parent(condition.val);
+
+ ir_if *result = new(mem_ctx) ir_if(condition.val);
+ result->then_instructions.push_tail(then_branch);
+ result->else_instructions.push_tail(else_branch);
+ return result;
+}
+
} /* namespace ir_builder */