aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/main.c b/src/main.c
index 6f18e9e..fd586c9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -30,13 +30,6 @@ enum op {
OP_SQRT
};
-static float escape_sqrt(size_t argc, const struct ejit_arg args[argc])
-{
- assert(argc == 1);
- assert(args[0].type == EJIT_FLOAT);
- return sqrtf(args[0].f);
-}
-
static const char *skip_whitespace(const char *line)
{
while (*line && isspace(*line))
@@ -241,11 +234,7 @@ static size_t compile_line(struct ejit_func *kernel, const char *line)
case OP_SQRT: {
size_t arg = 0;
line = parse_var(line, &arg);
- /* unfortunately no built-in operation for sqrt so we have to do
- * an expensive call */
- struct ejit_operand op = EJIT_OPERAND_FPR(arg, EJIT_FLOAT);
- ejit_escapei_f(kernel, escape_sqrt, 1, &op);
- ejit_retval_f(kernel, EJIT_FPR(out));
+ ejit_sqrtr_f(kernel, EJIT_FPR(out), EJIT_FPR(arg));
break;
}