From 9d2728a5605f651934fe67a6fe6986b3e4a2c011 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Sun, 20 Nov 2022 00:07:22 -0500 Subject: add a bunch of code and a ton of stub files for later --- includes/compiler/PCode.h | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'includes/compiler/PCode.h') 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 -- cgit v1.2.3