glsl: fix the type of ir_constant_data::u16
[mesa.git] / src / compiler / glsl / ir_builder.cpp
index c9cf1240dfebca5baefb02ac72b90f4e2b065ae1..416d8c71ed1cad3aed19054469d2fe42c1792ffe 100644 (file)
@@ -51,7 +51,7 @@ assign(deref lhs, operand rhs, operand condition, int writemask)
    void *mem_ctx = ralloc_parent(lhs.val);
 
    ir_assignment *assign = new(mem_ctx) ir_assignment(lhs.val,
-                                                     rhs.val,
+                                                      rhs.val,
                                                       condition.val,
                                                       writemask);
 
@@ -89,11 +89,11 @@ swizzle(operand a, int swizzle, int components)
    void *mem_ctx = ralloc_parent(a.val);
 
    return new(mem_ctx) ir_swizzle(a.val,
-                                 GET_SWZ(swizzle, 0),
-                                 GET_SWZ(swizzle, 1),
-                                 GET_SWZ(swizzle, 2),
-                                 GET_SWZ(swizzle, 3),
-                                 components);
+                                  GET_SWZ(swizzle, 0),
+                                  GET_SWZ(swizzle, 1),
+                                  GET_SWZ(swizzle, 2),
+                                  GET_SWZ(swizzle, 3),
+                                  components);
 }
 
 ir_swizzle *
@@ -314,6 +314,12 @@ exp(operand a)
    return expr(ir_unop_exp, a);
 }
 
+ir_expression *
+rcp(operand a)
+{
+   return expr(ir_unop_rcp, a);
+}
+
 ir_expression *
 rsq(operand a)
 {
@@ -365,13 +371,13 @@ less(operand a, operand b)
 ir_expression*
 greater(operand a, operand b)
 {
-   return expr(ir_binop_greater, a, b);
+   return expr(ir_binop_less, b, a);
 }
 
 ir_expression*
 lequal(operand a, operand b)
 {
-   return expr(ir_binop_lequal, a, b);
+   return expr(ir_binop_gequal, b, a);
 }
 
 ir_expression*
@@ -416,6 +422,12 @@ bit_or(operand a, operand b)
    return expr(ir_binop_bit_or, a, b);
 }
 
+ir_expression*
+bit_xor(operand a, operand b)
+{
+   return expr(ir_binop_bit_xor, a, b);
+}
+
 ir_expression*
 lshift(operand a, operand b)
 {
@@ -512,6 +524,30 @@ b2f(operand a)
    return expr(ir_unop_b2f, a);
 }
 
+ir_expression*
+bitcast_d2i64(operand a)
+{
+   return expr(ir_unop_bitcast_d2i64, a);
+}
+
+ir_expression*
+bitcast_d2u64(operand a)
+{
+   return expr(ir_unop_bitcast_d2u64, a);
+}
+
+ir_expression*
+bitcast_i642d(operand a)
+{
+   return expr(ir_unop_bitcast_i642d, a);
+}
+
+ir_expression*
+bitcast_u642d(operand a)
+{
+   return expr(ir_unop_bitcast_u642d, a);
+}
+
 ir_expression *
 interpolate_at_centroid(operand a)
 {