From f19a057cfcfd77c5567ff8d536db84a40037f10d Mon Sep 17 00:00:00 2001 From: Shinya Sato Date: Thu, 3 Mar 2022 21:12:55 +0900 Subject: v0.8.1 --- src/config.h | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/config.h (limited to 'src/config.h') diff --git a/src/config.h b/src/config.h new file mode 100644 index 0000000..5d56177 --- /dev/null +++ b/src/config.h @@ -0,0 +1,58 @@ +// 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) + + + +/* 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. -- cgit v1.2.3 From 350f8ee62029d4441ba08da9d96d0e15d5517b34 Mon Sep 17 00:00:00 2001 From: Shinya Sato Date: Thu, 3 Mar 2022 21:17:36 +0900 Subject: v0.8.1 --- src/config.h | 7 +++++++ src/inpla.y | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/config.h') diff --git a/src/config.h b/src/config.h index 5d56177..0a46711 100644 --- a/src/config.h +++ b/src/config.h @@ -8,6 +8,13 @@ //#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. diff --git a/src/inpla.y b/src/inpla.y index 72d6e1f..ea533f0 100644 --- a/src/inpla.y +++ b/src/inpla.y @@ -586,7 +586,7 @@ int yyerror(char *s) { // HOOP_SIZE must be power of two //#define INIT_HOOP_SIZE (1 << 10) -#define HOOP_SIZE (1 << 18) +//#define HOOP_SIZE (1 << 18) #define HOOP_SIZE_MASK ((HOOP_SIZE) -1) typedef struct HoopList_tag { -- cgit v1.2.3