summaryrefslogtreecommitdiff
path: root/mesa_codegen.brg
diff options
context:
space:
mode:
Diffstat (limited to 'mesa_codegen.brg')
-rw-r--r--mesa_codegen.brg16
1 files changed, 13 insertions, 3 deletions
diff --git a/mesa_codegen.brg b/mesa_codegen.brg
index fc59a834f0..25c0c47c02 100644
--- a/mesa_codegen.brg
+++ b/mesa_codegen.brg
@@ -53,6 +53,9 @@
%term exp2_vec4
%term log_vec4
%term log2_vec4
+%term trunc_vec4
+%term ceil_vec4
+%term floor_vec4
%term sin_vec4
%term cos_vec4
%term add_vec4_vec4
@@ -71,7 +74,6 @@
%term sqrt_vec4
%term rsq_vec4
%term swizzle_vec4
-%term trunc_vec4
# Each tree will produce stmt. Currently, the only production for
# stmt is from an assign rule -- every statement tree from
@@ -159,6 +161,16 @@ vec4: swizzle_vec4(vec4) 1
reg);
}
+vec4: trunc_vec4(vec4) 1 { ir_to_mesa_emit_op1(tree, OPCODE_TRUNC); }
+
+vec4: ceil_vec4(vec4) 1 {
+ tree->left->src_reg.negate = ~tree->left->src_reg.negate;
+ ir_to_mesa_emit_op1(tree, OPCODE_FLR);
+ tree->src_reg.negate = ~tree->left->src_reg.negate;
+}
+
+vec4: floor_vec4(vec4) 1 { ir_to_mesa_emit_op1(tree, OPCODE_FLR); }
+
vec4: sin_vec4(vec4) 1
{
ir_to_mesa_emit_scalar_op1(tree, OPCODE_SIN,
@@ -261,6 +273,4 @@ vec4: log2_vec4(vec4) 1
tree->left->src_reg);
}
-vec4: trunc_vec4(vec4) 1 { ir_to_mesa_emit_op1(tree, OPCODE_TRUNC); }
-
%%