diff options
author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-06-29 14:49:30 +0300 |
---|---|---|
committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-06-29 14:49:30 +0300 |
commit | d4c1d32e0aa21677e72c54ed220fdc70cea732c8 (patch) | |
tree | 651a3c29e3e56387e8a5d87c4d0e03251e649e89 /include | |
parent | eb09800cff9eec8ecbe756b193cab738d43897d2 (diff) | |
download | ejit-d4c1d32e0aa21677e72c54ed220fdc70cea732c8.tar.gz ejit-d4c1d32e0aa21677e72c54ed220fdc70cea732c8.zip |
add flag for using 64 bit values on 32 machines
+ JIT backends needs to still trigger an assertion if we detect that the
user lied
Diffstat (limited to 'include')
-rw-r--r-- | include/ejit/ejit.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/ejit/ejit.h b/include/ejit/ejit.h index e15550d..5152d8d 100644 --- a/include/ejit/ejit.h +++ b/include/ejit/ejit.h @@ -166,9 +166,9 @@ struct ejit_func; struct ejit_func *ejit_create_func(enum ejit_type rtype, size_t argc, const struct ejit_operand args[argc]); -void ejit_compile_func(struct ejit_func *f, size_t gpr, size_t fpr); +void ejit_compile_func(struct ejit_func *f, size_t gpr, size_t fpr, bool use_64); void ejit_select_compile_func(struct ejit_func *f, size_t gpr, size_t fpr, - bool try_jit); + bool use_64, bool try_jit); int64_t ejit_run_func(struct ejit_func *f, size_t argc, struct ejit_arg args[argc]); @@ -270,6 +270,17 @@ static inline struct ejit_arg ejit_double(double a) #define EJIT_AUTO(x) \ EJIT_ARG(x, typeof(x)) +static inline ejit_use64(struct ejit_arg a) +{ + if (a.type == EJIT_INT64 || a.type == EJIT_UINT64) + return true; + + return false; +} + +#define EJIT_USE64(t) \ + ejit_use64(EJIT_ARG(0, t)) + typedef long (*ejit_escape_t)(size_t argc, const struct ejit_arg args[argc]); typedef double (*ejit_escape_f_t)(size_t argc, const struct ejit_arg args[argc]); |