diff options
Diffstat (limited to 'docs/lifecycle/jit.md')
| -rw-r--r-- | docs/lifecycle/jit.md | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/docs/lifecycle/jit.md b/docs/lifecycle/jit.md index 3ff7079..3ef73e0 100644 --- a/docs/lifecycle/jit.md +++ b/docs/lifecycle/jit.md @@ -53,3 +53,28 @@ kpl_x64_inst(INSTRUCTION, [TYPE, VALUE]..., END) kpl_x64_inst_pfx(PREFIX, INSTRUCTION, [TYPE, VALUE]..., END) ``` + +# Ir Matching + +Use tree with sub trees to match Ir operations to JIT functions + +1. Match Name +2. Match Args until None or End +3. Run JIT Fn + +## Object Definitions + +```c +typedef struct _kpl_ir_match { + int32_t tree_weight; + union { + kpl_ir_name ir_name; + kpl_type_header type_header; + } match; + union { + struct _kpl_ir_match *children; + void *jit_fn; // TODO + } next; + struct _kpl_ir_match *tree_left *tree_right; +} kpl_ir_match; +``` |
