jit_blocks 0.1.0
Loading...
Searching...
No Matches
Functions

expr engine has special support for these operations by inlining, leading to much faster execution. More...

Collaboration diagram for Predefined arithmetic operations:

Functions

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_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_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_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_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_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, 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 array.
 

Detailed Description

expr engine has special support for these operations by inlining, leading to much faster execution.

Function Documentation

◆ jit_blocks_expr_op_abs()

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_expr_op_divide()

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.

If the divisor is zero, the function will push std::nan()

◆ jit_blocks_expr_op_minus()

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_expr_op_multiply()

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_expr_op_negate()

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_expr_op_plus()

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_expr_ops_parse()

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 array.

Parameters
opsArithmetic expression to parse:
ops_cntNumber of operations in ops array.
out_funcsArray to store parsed operations.

◆ jit_blocks_expr_pow()

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, and pushes the result back.

If the first number is zero, and the second number is negative, the function will push nan()