i965: Use MESA_FORMAT_B8G8R8X8_SRGB for RGB visuals
[mesa.git] / src / glsl / ir_builder.cpp
index 98b43229508521efef0301ac0f6a77d6c7eeaa67..c9cf1240dfebca5baefb02ac72b90f4e2b065ae1 100644 (file)
@@ -211,28 +211,58 @@ ir_expression *sub(operand a, operand b)
    return expr(ir_binop_sub, a, b);
 }
 
+ir_expression *min2(operand a, operand b)
+{
+   return expr(ir_binop_min, a, b);
+}
+
+ir_expression *max2(operand a, operand b)
+{
+   return expr(ir_binop_max, a, b);
+}
+
 ir_expression *mul(operand a, operand b)
 {
    return expr(ir_binop_mul, a, b);
 }
 
+ir_expression *imul_high(operand a, operand b)
+{
+   return expr(ir_binop_imul_high, a, b);
+}
+
 ir_expression *div(operand a, operand b)
 {
    return expr(ir_binop_div, a, b);
 }
 
+ir_expression *carry(operand a, operand b)
+{
+   return expr(ir_binop_carry, a, b);
+}
+
+ir_expression *borrow(operand a, operand b)
+{
+   return expr(ir_binop_borrow, a, b);
+}
+
+ir_expression *trunc(operand a)
+{
+   return expr(ir_unop_trunc, a);
+}
+
 ir_expression *round_even(operand a)
 {
    return expr(ir_unop_round_even, a);
 }
 
-ir_expression *dot(operand a, operand b)
+ir_expression *fract(operand a)
 {
-   return expr(ir_binop_dot, a, b);
+   return expr(ir_unop_fract, a);
 }
 
 /* dot for vectors, mul for scalars */
-ir_expression *dotlike(operand a, operand b)
+ir_expression *dot(operand a, operand b)
 {
    assert(a.val->type == b.val->type);
 
@@ -251,11 +281,7 @@ clamp(operand a, operand b, operand c)
 ir_expression *
 saturate(operand a)
 {
-   void *mem_ctx = ralloc_parent(a.val);
-
-   return expr(ir_binop_max,
-              expr(ir_binop_min, a, new(mem_ctx) ir_constant(1.0f)),
-              new(mem_ctx) ir_constant(0.0f));
+   return expr(ir_unop_saturate, a);
 }
 
 ir_expression *
@@ -312,6 +338,12 @@ sign(operand a)
    return expr(ir_unop_sign, a);
 }
 
+ir_expression *
+subr_to_int(operand a)
+{
+   return expr(ir_unop_subroutine_to_int, a);
+}
+
 ir_expression*
 equal(operand a, operand b)
 {
@@ -480,6 +512,42 @@ b2f(operand a)
    return expr(ir_unop_b2f, a);
 }
 
+ir_expression *
+interpolate_at_centroid(operand a)
+{
+   return expr(ir_unop_interpolate_at_centroid, a);
+}
+
+ir_expression *
+interpolate_at_offset(operand a, operand b)
+{
+   return expr(ir_binop_interpolate_at_offset, a, b);
+}
+
+ir_expression *
+interpolate_at_sample(operand a, operand b)
+{
+   return expr(ir_binop_interpolate_at_sample, a, b);
+}
+
+ir_expression *
+f2d(operand a)
+{
+   return expr(ir_unop_f2d, a);
+}
+
+ir_expression *
+i2d(operand a)
+{
+   return expr(ir_unop_i2d, a);
+}
+
+ir_expression *
+u2d(operand a)
+{
+   return expr(ir_unop_u2d, a);
+}
+
 ir_expression *
 fma(operand a, operand b, operand c)
 {
@@ -498,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)
 {