diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-07-04 22:17:01 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-07-04 22:17:01 +0300 |
| commit | 55df6ea5d5754cd0501d7df5e206f1e35d580f59 (patch) | |
| tree | 9684e9b4d40122ff717e74315476e8507b0a8540 /bcode.h | |
| download | bcgen-55df6ea5d5754cd0501d7df5e206f1e35d580f59.tar.gz bcgen-55df6ea5d5754cd0501d7df5e206f1e35d580f59.zip | |
init
Diffstat (limited to 'bcode.h')
| -rw-r--r-- | bcode.h | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -0,0 +1,32 @@ +#ifndef BCGEN_BCODE_H +#define BCGEN_BCODE_H + +#include <stddef.h> + +typedef unsigned long gbreg_t; +typedef double fbreg_t; +typedef size_t breloc_t; + +typedef union { + gbreg_t g; + fbreg_t f; +} breg_t; + +struct run_state { + void* (*op); + breg_t *imm; +}; + +struct compile_state { + struct run_state s; + void* (*labels); + size_t pc; +}; + +#include "gen/select.h" + +void run(struct compile_state *cs); +void init(struct compile_state *cs); +void destroy(struct compile_state *cs); + +#endif /* BCGEN_BCODE_H */ |
