const glsl_type *type,
enum ir_expression_operation op)
{
- ir_dereference *const retval = new ir_dereference(declarations[16]);
ir_dereference *const arg = new ir_dereference(declarations[0]);
ir_rvalue *result;
result = new ir_expression(op, type, arg, NULL);
- ir_instruction *inst = new ir_assignment(retval, result, NULL);
+ ir_instruction *inst = new ir_return(result);
instructions->push_tail(inst);
}
const glsl_type *type,
enum ir_expression_operation op)
{
- ir_dereference *const retval = new ir_dereference(declarations[16]);
ir_dereference *const arg1 = new ir_dereference(declarations[0]);
ir_dereference *const arg2 = new ir_dereference(declarations[1]);
ir_rvalue *result;
result = new ir_expression(op, type, arg1, arg2);
- ir_instruction *inst = new ir_assignment(retval, result, NULL);
+ ir_instruction *inst = new ir_return(result);
instructions->push_tail(inst);
}
ir_variable **declarations,
const glsl_type *type)
{
- ir_dereference *const retval = new ir_dereference(declarations[16]);
ir_dereference *const arg = new ir_dereference(declarations[0]);
ir_rvalue *result;
arg,
new ir_constant((float)(M_PI / 180.0)));
- ir_instruction *inst = new ir_assignment(retval, result, NULL);
+ ir_instruction *inst = new ir_return(result);
instructions->push_tail(inst);
}
ir_variable **declarations,
const glsl_type *type)
{
- ir_dereference *const retval = new ir_dereference(declarations[16]);
ir_dereference *const arg = new ir_dereference(declarations[0]);
ir_rvalue *result;
arg,
new ir_constant((float)(180.0 / M_PI)));
- ir_instruction *inst = new ir_assignment(retval, result, NULL);
+ ir_instruction *inst = new ir_return(result);
instructions->push_tail(inst);
}
const glsl_type *ret_type,
const glsl_type *type)
{
- ir_variable *declarations[17];
+ ir_variable *declarations[16];
- ir_function_signature *const sig = new ir_function_signature(type);
+ ir_function_signature *const sig = new ir_function_signature(ret_type);
f->add_signature(sig);
ir_label *const label = new ir_label(name, sig);
declarations[i] = var;
}
- ir_variable *retval = new ir_variable(ret_type, "__retval");
- sig->body.push_tail(retval);
-
- declarations[16] = retval;
-
generate(&sig->body, declarations, type);
}
ir_variable **declarations,
const glsl_type *type)
{
- ir_dereference *const retval = new ir_dereference(declarations[16]);
ir_dereference *const arg = new ir_dereference(declarations[0]);
ir_rvalue *result, *temp;
temp = new ir_expression(ir_binop_dot, glsl_type::float_type, arg, arg);
result = new ir_expression(ir_unop_sqrt, glsl_type::float_type, temp, NULL);
- ir_instruction *inst = new ir_assignment(retval, result, NULL);
+ ir_instruction *inst = new ir_return(result);
instructions->push_tail(inst);
}
ir_variable **declarations,
const glsl_type *type)
{
- ir_dereference *const retval = new ir_dereference(declarations[16]);
ir_dereference *const arg = new ir_dereference(declarations[0]);
ir_rvalue *result;
result = new ir_expression(ir_binop_dot, glsl_type::float_type, arg, arg);
- ir_instruction *inst = new ir_assignment(retval, result, NULL);
+ ir_instruction *inst = new ir_return(result);
instructions->push_tail(inst);
}