diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-04-07 01:29:12 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-04-07 01:29:12 +0300 |
| commit | 0f8532d4e7315b86e160abf4ced461e7678b5587 (patch) | |
| tree | 2cf1a728b1f4383926a5c39908754b6eb4a5a2dd /include | |
| parent | 68059b52c389143e766c5499c76c6c90c6b82846 (diff) | |
| download | qbt-0f8532d4e7315b86e160abf4ced461e7678b5587.tar.gz qbt-0f8532d4e7315b86e160abf4ced461e7678b5587.zip | |
add features that make machine generation easier
Diffstat (limited to 'include')
| -rw-r--r-- | include/qbt/nodes.h | 8 | ||||
| -rw-r--r-- | include/qbt/opt.h | 2 | ||||
| -rw-r--r-- | include/qbt/ssa.h | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/include/qbt/nodes.h b/include/qbt/nodes.h index 22de9ff..718a83a 100644 --- a/include/qbt/nodes.h +++ b/include/qbt/nodes.h @@ -35,6 +35,8 @@ enum insn_type { BGE, BLT, BGT, + BNZ, + BEZ, J, RET, ARG, @@ -45,6 +47,7 @@ enum insn_type { /* internal */ SAVE, RESTORE, + ADDR, }; enum insn_flags { @@ -81,6 +84,8 @@ enum insn_flags { M(BGE) \ M(BLT) \ M(BGT) \ + M(BNZ) \ + M(BEZ) \ M(J) \ M(ARG) \ M(RETARG) \ @@ -88,7 +93,8 @@ enum insn_flags { M(RET) \ M(RETVAL) \ M(SAVE) \ - M(RESTORE) + M(RESTORE) \ + M(ADDR) static inline const char *op_str(enum insn_type n) { #define CASE(I) case I: return #I; diff --git a/include/qbt/opt.h b/include/qbt/opt.h index b218b7e..60d29b3 100644 --- a/include/qbt/opt.h +++ b/include/qbt/opt.h @@ -3,5 +3,7 @@ #include <qbt/nodes.h> void optimize(struct fn *fn); +size_t ssa(struct fn *f); +void correct(struct fn *f, size_t ri); #endif /* OPT_H */ diff --git a/include/qbt/ssa.h b/include/qbt/ssa.h deleted file mode 100644 index 32a7534..0000000 --- a/include/qbt/ssa.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef SSA_H -#define SSA_H - -#include <qbt/nodes.h> - -void ssa(struct fn *f); - -#endif /* SSA_H */ |
