diff options
author | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-04-01 22:18:02 +0300 |
---|---|---|
committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-04-01 22:18:02 +0300 |
commit | d28f63818d8c7537881ff148f285b2d6c5dca1c9 (patch) | |
tree | 116fd27ae84faafc70c691cedba683f7b98b53fa | |
parent | 04529d023ea3597433f54e914d3d51f86cc54e1c (diff) | |
download | ejit-prospero-d28f63818d8c7537881ff148f285b2d6c5dca1c9.tar.gz ejit-prospero-d28f63818d8c7537881ff148f285b2d6c5dca1c9.zip |
use newly exposed ejit_sqrtr_f
m--------- | deps/ejit | 0 | ||||
-rw-r--r-- | src/main.c | 13 |
2 files changed, 1 insertions, 12 deletions
diff --git a/deps/ejit b/deps/ejit -Subproject 449c23ebc32eb45f8a6360c472bfbf5db6cd132 +Subproject 478c92b425eca53a0d884fb8f5dea8d76901685 @@ -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; } |