Initial commit
[jitcs.git] / include / jitcs_ids.h
blob773972ddb5f5c35015f9a661a427824fb8811425
1 //===-- jitcs_ids.h - ID types for instructions et al. ----------*- C++ -*-===//
2 //
3 //
4 //
5 //===----------------------------------------------------------------------===//
7 #ifndef _JITCS_IDS_H_
8 #define _JITCS_IDS_H_
10 #include "jitcs_base.h"
12 namespace jitcs {
14 enum CompilerMode {
15 CM_Construct, // add instructions to basic blocks
16 CM_Analyze, // use/def analysis, cross bb cluster construction, ...
17 CM_Allocate, // local and cross bb register allocation
18 CM_Generate, // layout and generate machine code
21 enum MemEnum {
22 M_None = 0,
23 MMODE_Bits = 4,
24 MMODE_Mask = (1 << MMODE_Bits) - 1,
25 MMODE_FPCount = 8,
26 MMODE_None = 0, // address undefined
27 MMODE_Base = 1, // base + scale * index + offset
28 MMODE_Sym = 2, // symbol + offset - the symbol may be global or local(SPREL/FPREL)
29 MMODE_Global= 3, // global pointer + offset (in X64 encoded as RIP-relative)
30 MMODE_VRegSpillSlot= 4, // memory address of a VReg spill slot
31 MMODE_SPRel= 8, // stack (aka FP0) pointer + offset
32 MMODE_FP1Rel= MMODE_SPRel+1, // frame pointer 1 + offset
33 MMODE_FP2Rel= MMODE_SPRel+2, // frame pointer 2 + offset
34 MMODE_FP3Rel= MMODE_SPRel+3, // frame pointer 3 + offset
35 MMODE_FP4Rel= MMODE_SPRel+4, // frame pointer 4 + offset
36 MMODE_FP5Rel= MMODE_SPRel+5, // frame pointer 5 + offset
37 MMODE_FP6Rel= MMODE_SPRel+6, // frame pointer 6 + offset
38 MMODE_FP7Rel= MMODE_SPRel+7, // frame pointer 7 + offset
40 enum SymEnum {
41 S_None = ~0,
44 enum RegId {
45 R_None = ~0,
46 R_HardwareLimit = 0x100,
48 enum ResId {
49 RES_None = ~0,
51 enum RegClassId {
52 RC_None = 0xff,
54 enum ResClassId {
55 RESCL_None = 0xff,
58 enum InsId {
59 I_None = 0,
60 I_Count,
61 I_Max = ~0,
64 enum BBId {
65 BB_None = ~0,
68 } // end of namespace jitcs
70 #endif
71 // _JITCS_IDS_H_