for (unsigned c = 0; c < op[0]->type->components(); c++)
data.f[c] = asinf(op[0]->value.f[c]);
} else if (strcmp(callee, "atan") == 0) {
- return NULL; /* FINISHME: implement this */
+ assert(op[0]->type->is_float());
+ if (num_parameters == 2) {
+ assert(op[1]->type->is_float());
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.f[c] = atan2f(op[0]->value.f[c], op[1]->value.f[c]);
+ } else {
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.f[c] = atanf(op[0]->value.f[c]);
+ }
} else if (strcmp(callee, "dFdx") == 0 || strcmp(callee, "dFdy") == 0) {
return ir_constant::zero(mem_ctx, this->type);
} else if (strcmp(callee, "ceil") == 0) {