summaryrefslogtreecommitdiff
path: root/includes/compiler/PCode.h
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2022-11-20 00:07:22 -0500
committerAsh Wolf <ninji@wuffs.org>2022-11-20 00:07:22 -0500
commit9d2728a5605f651934fe67a6fe6986b3e4a2c011 (patch)
treee81e0a3588a0c8d1855bf28316efe27d86b04d66 /includes/compiler/PCode.h
parent9a46dd0e2e80790d9848c0bbd718932a27c23269 (diff)
downloadMWCC-9d2728a5605f651934fe67a6fe6986b3e4a2c011.tar.gz
MWCC-9d2728a5605f651934fe67a6fe6986b3e4a2c011.zip
add a bunch of code and a ton of stub files for later
Diffstat (limited to 'includes/compiler/PCode.h')
-rw-r--r--includes/compiler/PCode.h28
1 files changed, 17 insertions, 11 deletions
diff --git a/includes/compiler/PCode.h b/includes/compiler/PCode.h
index 55aac38..b56ed2f 100644
--- a/includes/compiler/PCode.h
+++ b/includes/compiler/PCode.h
@@ -2,11 +2,15 @@
#define COMPILER_PCODE_H
#include "compiler/common.h"
+#include "compiler/PCodeInfo.h"
#ifdef __MWERKS__
#pragma options align=mac68k
#endif
+#define FLAG_SET_T(flags) (((flags) & (fPCodeFlag1 | fPCodeFlag8)) ? (flags) : 0)
+#define FLAG_SET_F(flags) (((flags) & (fPCodeFlag1 | fPCodeFlag8)) ? 0 : (flags))
+
#define PCODE_FLAG_SET_T(pcode) (((pcode)->flags & (fPCodeFlag1 | fPCodeFlag8)) ? (pcode)->flags : 0)
#define PCODE_FLAG_SET_F(pcode) (((pcode)->flags & (fPCodeFlag1 | fPCodeFlag8)) ? 0 : (pcode)->flags)
@@ -15,7 +19,7 @@ enum {
EffectWrite = 2
};
-typedef enum {
+/*typedef enum {
PCOp_REGISTER,
PCOp_SYSREG,
PCOp_IMMEDIATE,
@@ -23,7 +27,7 @@ typedef enum {
PCOp_LABEL,
PCOp_LABELDIFF,
PCOp_PLACEHOLDEROPERAND
-} PCOpKind;
+} PCOpKind;*/
typedef enum {
RefType_0,
@@ -142,6 +146,8 @@ enum {
fOverflow = 0x800000,
fSetsCarry = 0x10000000,
// ??
+ fPCodeFlag2000000 = 0x2000000,
+ fPCodeFlag4000000 = 0x4000000,
fPCodeFlag8000000 = 0x8000000,
fPCodeFlag10000000 = 0x10000000,
fPCodeFlag20000000 = 0x20000000,
@@ -167,25 +173,25 @@ extern PCodeBlock **depthfirstordering;
extern int pcblockcount;
extern int pcloopweight;
-extern void initpcode();
-extern PCode *makepcode(short op, ...);
-extern void emitpcode(short op, ...);
+extern void initpcode(void);
+extern PCode *makepcode(Opcode op, ...);
+extern void emitpcode(Opcode op, ...);
extern PCode *copypcode(PCode *pcode);
-extern PCodeLabel *makepclabel();
-extern PCodeBlock *makepcblock();
+extern PCodeLabel *makepclabel(void);
+extern PCodeBlock *makepcblock(void);
extern void pclabel(PCodeBlock *block, PCodeLabel *label);
extern void pcbranch(PCodeBlock *block, PCodeLabel *label);
-extern void pccomputepredecessors();
+extern void pccomputepredecessors(void);
extern void deleteblock(PCodeBlock *block);
-extern void deleteunreachableblocks();
+extern void deleteunreachableblocks(void);
extern void appendpcode(PCodeBlock *block, PCode *pcode);
extern void deletepcode(PCode *pcode);
extern void insertpcodebefore(PCode *anchor, PCode *newpcode);
extern void insertpcodeafter(PCode *anchor, PCode *newpcode);
extern void setpcodeflags(int flags);
extern void clearpcodeflags(int flags);
-extern int pccomputeoffsets();
-extern void computedepthfirstordering();
+extern int pccomputeoffsets(void);
+extern void computedepthfirstordering(void);
#ifdef __MWERKS__
#pragma options align=reset