7#include "jit_blocks/jit_blocks_export.h"
19typedef gcc_jit_context* (*jit_blocks_context_builder_t)(void);
45 gcc_jit_context* custom_context,
46 gcc_jit_result** out_res);
53 gcc_jit_context* custom_context,
54 gcc_jit_result** out_res);
91 gcc_jit_result** out_res);
96 gcc_jit_context* custom_context,
97 gcc_jit_result** out_res);
163 int initial_stack_capacity);
247 gcc_jit_context* ctx,
248 gcc_jit_result** out_res);
312 gcc_jit_result** out_res);
319 gcc_jit_context* ctx,
320 gcc_jit_result** out_res);
JIT_BLOCKS_EXPORT void jit_blocks_set_easy_context_builder(jit_blocks_context_builder_t builder)
Sets the global jit_blocks_context_builder_t used for all easy (aka non-aux) APIs.
gcc_jit_context *(* jit_blocks_context_builder_t)(void)
A jit_blocks_context_builder_t allocates a fresh gcc_jit_context, potentially sets some default optio...
Definition jit_blocks.h:19
JIT_BLOCKS_EXPORT jit_blocks_context_builder_t jit_blocks_get_easy_context_builder(void)
Returns the global jit_blocks_context_builder_t used for all easy (aka non-aux) APIs.
int(* jit_blocks_divide_by_k_int_t)(int dividend)
Definition jit_blocks.h:37
long(* jit_blocks_divide_by_k_long_t)(long dividend)
Definition jit_blocks.h:38
JIT_BLOCKS_EXPORT jit_blocks_divide_by_k_int_t jit_blocks_build_divide_by_k_int_aux(int divisor, gcc_jit_context *custom_context, gcc_jit_result **out_res)
JIT_BLOCKS_EXPORT jit_blocks_divide_by_k_long_t jit_blocks_build_divide_by_k_long_aux(long divisor, gcc_jit_context *custom_context, gcc_jit_result **out_res)
JIT_BLOCKS_EXPORT jit_blocks_divide_by_k_long_t jit_blocks_build_divide_by_k_long(long divisor, gcc_jit_result **out_res)
JIT_BLOCKS_EXPORT jit_blocks_divide_by_k_int_t jit_blocks_build_divide_by_k_int(int divisor, gcc_jit_result **out_res)
void(* jit_blocks_dynswitch_func_ptr_t)(void *ctx, long val)
The function pointer type called in each condition.
Definition jit_blocks.h:293
JIT_BLOCKS_EXPORT jit_blocks_dynswitch_result_t jit_blocks_dynswitch_build(const jit_blocks_dynswitch_cond_t *conds, int num_conds, jit_blocks_dynswitch_func_ptr_t default_func, gcc_jit_result **out_res)
Builds a function that performs a dynamic switch.
jit_blocks_dynswitch_func_ptr_t jit_blocks_dynswitch_result_t
The output function pointer type.
Definition jit_blocks.h:302
JIT_BLOCKS_EXPORT jit_blocks_dynswitch_result_t jit_blocks_dynswitch_build_aux(const jit_blocks_dynswitch_cond_t *conds, int num_conds, jit_blocks_dynswitch_func_ptr_t default_func, gcc_jit_context *ctx, gcc_jit_result **out_res)
JIT_BLOCKS_EXPORT void jit_blocks_expr_op_abs(jit_blocks_expr_context *ctx)
Pops 1 double from the stack, converts it to its absolute value, and pushes the result back.
JIT_BLOCKS_EXPORT void jit_blocks_expr_pow(jit_blocks_expr_context *ctx)
Pops 2 doubles from the stack, computes the power of the first number to the second number,...
JIT_BLOCKS_EXPORT void jit_blocks_expr_op_divide(jit_blocks_expr_context *ctx)
Pops two doubles from the stack, divides the first by the second, and pushes the result back.
JIT_BLOCKS_EXPORT void jit_blocks_expr_op_multiply(jit_blocks_expr_context *ctx)
Pops two doubles from the stack, multiplies them, and pushes the result back.
JIT_BLOCKS_EXPORT void jit_blocks_expr_op_plus(jit_blocks_expr_context *ctx)
Pops two doubles from the stack, adds them, and pushes the result back.
JIT_BLOCKS_EXPORT void jit_blocks_expr_op_negate(jit_blocks_expr_context *ctx)
Pops a double from the stack, negates it, and pushes the result back.
JIT_BLOCKS_EXPORT void jit_blocks_expr_op_minus(jit_blocks_expr_context *ctx)
Pops two doubles from the stack, subtracts the second from the first, and pushes the result back.
JIT_BLOCKS_EXPORT void jit_blocks_expr_ops_parse(const char *ops[], int ops_cnt, jit_blocks_expr_func_t *out_funcs)
Parses arithmetic operations from the given string, and stores the parsed operations into out_funcs a...
JIT_BLOCKS_EXPORT jit_blocks_expr_func_t jit_blocks_expr_build_aux(const jit_blocks_expr_func_t *ops, int num_ops, gcc_jit_context *ctx, gcc_jit_result **out_res)
void(* jit_blocks_expr_func_t)(jit_blocks_expr_context *ctx)
Users could pass arbitrary functions to process the expression.
Definition jit_blocks.h:180
JIT_BLOCKS_EXPORT jit_blocks_expr_context * jit_blocks_expr_context_new(int initial_stack_capacity)
Creates a new context with the given initial stack capacity.
JIT_BLOCKS_EXPORT bool jit_blocks_expr_context_pop(jit_blocks_expr_context *ctx, double *out_value)
Pops a double from the stack.
JIT_BLOCKS_EXPORT jit_blocks_expr_func_t jit_blocks_expr_build(const jit_blocks_expr_func_t *ops, int num_ops, gcc_jit_result **out_res)
Creates a function that performs the given arithmetic operations on the initial_ctx stack,...
JIT_BLOCKS_EXPORT void jit_blocks_expr_context_release(jit_blocks_expr_context *ctx)
Destroys the context and frees all associated resources.
JIT_BLOCKS_EXPORT bool jit_blocks_expr_context_push(jit_blocks_expr_context *ctx, double value)
Pushes a double onto the stack.
JIT_BLOCKS_EXPORT jit_blocks_funccalls_output_func_t jit_blocks_funccalls_build_aux(const jit_blocks_funccalls_func_ptr_t *records, int num_records, gcc_jit_context *custom_context, gcc_jit_result **out_res)
void(* jit_blocks_funccalls_func_ptr_t)(void *)
Definition jit_blocks.h:84
void(* jit_blocks_funccalls_output_func_t)(void *arg)
Definition jit_blocks.h:86
JIT_BLOCKS_EXPORT jit_blocks_funccalls_output_func_t jit_blocks_funccalls_build(const jit_blocks_funccalls_func_ptr_t *records, int num_records, gcc_jit_result **out_res)
A condition for the dynamic switch.
Definition jit_blocks.h:296
jit_blocks_dynswitch_func_ptr_t func
Definition jit_blocks.h:298
long val
Definition jit_blocks.h:297
Context of calculation.
Definition jit_blocks.h:155
int stack_size
Definition jit_blocks.h:157
int stack_capacity
Definition jit_blocks.h:158
double * stack
Definition jit_blocks.h:156