aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Changelog.md15
-rw-r--r--README.md2
-rw-r--r--src/inpla.y11
3 files changed, 19 insertions, 9 deletions
diff --git a/Changelog.md b/Changelog.md
index e49617c..9668ad6 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -1,10 +1,19 @@
# Change log
+### v0.7.2-1 (released on 12 February 2022)
+
+#### Bug Fix:
+* **Bytecode generation**: A bytecode sequence for `EQI src fixint dest` was generated as `EQI src int dest`, so it was fixed.
+* **Bytecode optimisation**: Blocks for scopes of Copy Propagation optimisation were not specified for each guard expression. It was fixed and works well.
+
+
+
+
### v0.7.2 (released on 9 February 2022)
#### Polished:
-- **Bytecode format for global names**: The bytecode format to obtain a global name is changed from `MKGNAME destRegNum (char *)sym` into `MKGNAME (int)id destRegNum`. Every symbol for agents and global names is assigned the unique ID number which is decided during compilation processes. So, the ID number `id` should have been taken, instead of `(char *)sym`.
-- **Separation of NameTable codes**: The `NameTable` is used to lookup ID numbers for symbol chars in compilation processes and interpreter executions. By changing the bytecode format of `MKGNAME`, it becomes no need for virtual machine execution directly, so the source codes for the `NameTable` operation is separated from the main source `src/inpla.y`. This contributes a little speed-up at most 1%.
+* **Bytecodes for global names**: To obtain a global name whose name is `sym` on a `dest` register, the following bytecode is executed: `MKGNAME dest sym` where the type of `sym` is `char*`. Every symbol for agents and global names is assigned to the unique ID number managed by `IdTable`, so by introducing the ID number `id` for the `sym`, the bytecode is changed into `MKGNAME id dest`.
+* **Separation of source codes of NameTable**: The `NameTable` is used to lookup ID numbers for symbol chars in compilation and interpreter execution. By changing the bytecode of `MKGNAME`, there becomes no need to be used in virtual machine execution directly, so the source codes for the `NameTable` is separated from `src/inpla.y`. This contributes quite a little speed-up at most 1%.
@@ -18,7 +27,7 @@
- By introducing a bytecode `OP_INC src dest`, a code `OP_ADDI src $1 dest` and a code`OP_ADDI $1 src dest` are optimised into `OP_INC src dest`.
- By introducing a bytecode `OP_DEC src dest`, a code `OP_SUBI src $1 dest` is optimised into `OP_DEC src dest`.
-* **Intermediate code for blocks**: To show areas of blocks, an intermediate code `OP_BEGIN_BLOCK` is introduced. Copy Propagation for `OP_LOAD` and `OP_LOADI` is performed until the next `OP_BEGIN_BLOCK` occurs.
+* **Intermediate code for blocks**: To show scope of blocks, an intermediate code `OP_BEGIN_BLOCK` is introduced. Copy Propagation for `OP_LOAD` and `OP_LOADI` is performed until the next `OP_BEGIN_BLOCK` occurs.
diff --git a/README.md b/README.md
index e001542..d0a8a63 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
Inpla is a multi-threaded parallel interpreter of interaction nets. Once you write programs for sequential execution, it works also in multi-threaded parallel execution. Each thread is managed on each CPU-core with POSIX-thread library.
-* The current version is 0.7.2 released on **9 February 2022**. (See [Changelog.md](Changelog.md) for details.)
+* The current version is 0.7.2-1 (Bug fixes) released on **12 February 2022**. (See [Changelog.md](Changelog.md) for details.)
![speedup-ratio](pic/benchmark_reuse_v0.7.2.png)
diff --git a/src/inpla.y b/src/inpla.y
index 51e2692..42a041c 100644
--- a/src/inpla.y
+++ b/src/inpla.y
@@ -41,8 +41,8 @@
//#define COUNT_MKAGENT // count of execution fo mkagent
-#define VERSION "0.7.2"
-#define BUILT_DATE "9 Feb. 2022"
+#define VERSION "0.7.2-1"
+#define BUILT_DATE "12 Feb. 2022"
// ------------------------------------------------------------------
@@ -5720,6 +5720,7 @@ int CompileIfSentenceFromAST(Ast *if_sentence_top) {
// Compilation of then_branch
+ IMCode_genCode0(OP_BEGIN_BLOCK);
CmEnv_clear_localnamePtr(); // 局所変数の割り当て番号を初期化
if (!CompileIfSentenceFromAST(then_branch)) return 0;
@@ -6467,8 +6468,8 @@ void *ExecCode(int mode, VirtualMachine *restrict vm, void *restrict *code) {
E_LOAD:
// puts("load src dest");
pc++;
- i = reg[(unsigned long)code[pc++]];
- reg[(unsigned long)code[pc++]] = i;
+ a1 = reg[(unsigned long)code[pc++]];
+ reg[(unsigned long)code[pc++]] = a1;
goto *code[pc];
@@ -6610,7 +6611,7 @@ void *ExecCode(int mode, VirtualMachine *restrict vm, void *restrict *code) {
// puts("EQI src1 int dest");
pc++;
{
- int i = FIX2INT(reg[(unsigned long)code[pc++]]);
+ int i = reg[(unsigned long)code[pc++]];
int j = (unsigned long)code[pc++];
if (i==j) {