aboutsummaryrefslogtreecommitdiff
path: root/src/config.h
blob: 0a4671141a824f4d362cf1b9c7fd76c3f1a22e29 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Configurations  ---------------------------------------------------

/* Heaps ------------------------------------------ 
   Choose one among the following three definitions:
   -------------------------------------------------- */
#define FLEX_EXPANDABLE_HEAP     // Inserted heaps size can be flexible.
//#define EXPANDABLE_HEAP        // Expandable heaps for agents and names
//#define FIXED_HEAP             // The heap size is fixed. (Default)


#ifdef EXPANDABLE_HEAP
// HOOP_SIZE must be two to power
#define HOOP_SIZE (1 << 18)
#endif



  
/* Optimisation ------------------------------------
   Comment out definitions if not needed.
   ------------------------------------------------- */

// Optimisation inspired by Tail Recursion Optimisation  
#define OPTIMISE_IMCODE_TRO   

  
// Optimisation of the intermediate codes
/*  
   * Assign registers as little as possible with expecting cache works.
   * Copy propagation and Dead code elimination for LOAD are performed.
   * Reg0 is used as a special one that stores results of comparison.
   * Some combinations are rewritten.
     For instance, `SUBI src $1 dest' becomes `DEC src dest'.
*/
#define OPTIMISE_IMCODE    
  

#ifdef OPTIMISE_IMCODE
// Furthermore optimisations for codes:
// the following can work when the OPTIMISE_IMCODE is defined:


// Generate virtual machine codes with two-address notation
#define OPTIMISE_TWO_ADDRESS

#ifdef OPTIMISE_TWO_ADDRESS
#define OPTIMISE_TWO_ADDRESS_MKAGENT1 // For MKAGENT1
#define OPTIMISE_TWO_ADDRESS_MKAGENT2 // For MKAGENT2
#define OPTIMISE_TWO_ADDRESS_MKAGENT3 // For MKAGENT3
//#define OPTIMISE_TWO_ADDRESS_UNARY // For Unary operator like INC, DEC
#endif  


#endif
// END Optimisation configuration --------------


#define COUNT_INTERACTION  // Count interaction.


  
  
//#define VERBOSE_NODE_USE  // Put memory usage of agents and names.
//#define VERBOSE_HOOP_EXPANSION  // Put messages when hoops are expanded.
//#define VERBOSE_EQSTACK_EXPANSION  // Put messages when Eqstacks are expanded.