this->result = NULL;
switch (ir->operation) {
+ case ir_unop_exp:
+ this->result = this->create_tree(MB_TERM_exp_vec4, ir, op[0], NULL);
+ break;
+ case ir_unop_exp2:
+ this->result = this->create_tree(MB_TERM_exp2_vec4, ir, op[0], NULL);
+ break;
+ case ir_unop_log:
+ this->result = this->create_tree(MB_TERM_log_vec4, ir, op[0], NULL);
+ break;
+ case ir_unop_log2:
+ this->result = this->create_tree(MB_TERM_log2_vec4, ir, op[0], NULL);
+ break;
case ir_binop_add:
this->result = this->create_tree(MB_TERM_add_vec4_vec4, ir, op[0], op[1]);
break;
# generate in its trees.
%term assign
%term reference_vec4
+%term exp_vec4
+%term exp2_vec4
+%term log_vec4
+%term log2_vec4
%term add_vec4_vec4
%term sub_vec4_vec4
%term mul_vec4_vec4
tree->src_reg);
}
+vec4: exp_vec4(vec4) 1
+{
+ ir_to_mesa_emit_scalar_op1(tree, OPCODE_EXP,
+ tree->dst_reg,
+ tree->left->src_reg);
+}
+
+vec4: exp2_vec4(vec4) 1
+{
+ ir_to_mesa_emit_scalar_op1(tree, OPCODE_EX2,
+ tree->dst_reg,
+ tree->left->src_reg);
+}
+
+vec4: log_vec4(vec4) 1
+{
+ ir_to_mesa_emit_scalar_op1(tree, OPCODE_LOG,
+ tree->dst_reg,
+ tree->left->src_reg);
+}
+
+vec4: log2_vec4(vec4) 1
+{
+ ir_to_mesa_emit_scalar_op1(tree, OPCODE_LG2,
+ tree->dst_reg,
+ tree->left->src_reg);
+}
+
%%