this->result = this->create_tree(MB_TERM_sne_vec4_vec4, ir,
op[0], this->result);
break;
+ case ir_unop_trunc:
+ this->result = this->create_tree(MB_TERM_trunc_vec4, ir, op[0], NULL);
+ break;
+ case ir_unop_ceil:
+ this->result = this->create_tree(MB_TERM_ceil_vec4, ir, op[0], NULL);
+ break;
+ case ir_unop_floor:
+ this->result = this->create_tree(MB_TERM_floor_vec4, ir, op[0], NULL);
+ break;
default:
break;
}
%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
%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
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,
tree->left->src_reg);
}
-vec4: trunc_vec4(vec4) 1 { ir_to_mesa_emit_op1(tree, OPCODE_TRUNC); }
-
%%