aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Sato <shinnya.sato@gmail.com>2022-04-16 21:42:37 +0900
committerShinya Sato <shinnya.sato@gmail.com>2022-04-16 21:42:37 +0900
commit886e2f63ee0c95530f4f0727b7ae0f9a0d909e9e (patch)
tree2b9cff1f077a4a05dbe90c6bc233e61b03897087
parentc8ff868327e19cd156573a723214d66119a71b41 (diff)
parent23b8283047bc2b866e5edc3c3852ff0bf461a587 (diff)
downloadinpla-886e2f63ee0c95530f4f0727b7ae0f9a0d909e9e.tar.gz
inpla-886e2f63ee0c95530f4f0727b7ae0f9a0d909e9e.zip
Merge branch 'develop'
-rw-r--r--Changelog.md6
-rw-r--r--README.md4
-rw-r--r--src/inpla.y16
-rw-r--r--src/mytype.h2
4 files changed, 16 insertions, 12 deletions
diff --git a/Changelog.md b/Changelog.md
index 3183485..63e8670 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -1,6 +1,10 @@
# Change log
-### Update on 16 April 2022
+### v0.8.1-2 minor update (released on 16 April 2022)
+
+#### Bug fix
+* Integer numbers had been put out with 32-bit format, though it is manages as 61bit FIXINT. Now it is put out as a long integer.
+
#### Polished
diff --git a/README.md b/README.md
index b049c28..d251348 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.8.1-1 (minor update) released on **10 March 2022**. (See [Changelog.md](Changelog.md) for details.)
+* The current version is 0.8.1-2 (minor update) released on **16 April 2022**. (See [Changelog.md](Changelog.md) for details.)
![speedup-ratio](pic/benchmark_reuse_v0.8.1.png)
@@ -29,7 +29,7 @@ Inpla is a multi-threaded parallel interpreter of interaction nets. Once you wri
- "fib 38" is computation to get the 38th Fibonacci number.
- - "bsort *n*", "isort *n*", "qsort *n*" and "msort *n*" are computation of bubble sort, insertion sort, quick sort and merge sort for random *n*-element lists, respectively. The blanks in OCaml are due to error: `Stack overflow during evaluation (looping recursion?).`
+ - "bsort *n*", "isort *n*", "qsort *n*" and "msort *n*" are computation of bubble sort, insertion sort, quick sort and merge sort for random *n*-element lists, respectively. The blanks in OCaml are due to the following error: `Stack overflow during evaluation (looping recursion?).`
diff --git a/src/inpla.y b/src/inpla.y
index cb06e67..24f855e 100644
--- a/src/inpla.y
+++ b/src/inpla.y
@@ -33,8 +33,8 @@
//#define COUNT_MKAGENT // count of execution fo mkagent
-#define VERSION "0.8.1-1"
-#define BUILT_DATE "10 Mar. 2022"
+#define VERSION "0.8.1-2"
+#define BUILT_DATE "16 Apr. 2022"
// ------------------------------------------------------------------
@@ -1483,7 +1483,7 @@ static int Puts_list_element=0;
static int PutIndirection = 1; // indirected term t for x is put as x->t
void puts_term(VALUE ptr) {
if (IS_FIXNUM(ptr)) {
- printf("%d", FIX2INT(ptr));
+ printf("%ld", FIX2INT(ptr));
return;
} else if (BASIC(ptr) == NULL) {
printf("<NULL>");
@@ -2847,7 +2847,7 @@ void VMCode_puts(void **code, int n) {
i+=2;
} else if (code[i] == CodeAddr[OP_PUSHI]) {
- printf("pushi reg%lu $%d\n",
+ printf("pushi reg%lu $%ld\n",
(unsigned long)code[i+1],
FIX2INT((unsigned long)code[i+2]));
i+=2;
@@ -2871,7 +2871,7 @@ void VMCode_puts(void **code, int n) {
puts("ret_free_lr");
} else if (code[i] == CodeAddr[OP_LOADI]) {
- printf("loadi $%d reg%lu\n",
+ printf("loadi $%ld reg%lu\n",
FIX2INT((unsigned long)code[i+1]),
(unsigned long)code[i+2]);
i+=2;
@@ -2981,7 +2981,7 @@ void VMCode_puts(void **code, int n) {
i+=3;
} else if (code[i] == CodeAddr[OP_EQI]) {
- printf("eqi reg%lu $%d reg%lu\n",
+ printf("eqi reg%lu $%ld reg%lu\n",
(unsigned long)code[i+1],
FIX2INT((unsigned long)code[i+2]),
(unsigned long)code[i+3]);
@@ -3013,7 +3013,7 @@ void VMCode_puts(void **code, int n) {
i+=2;
} else if (code[i] == CodeAddr[OP_EQI_R0]) {
- printf("eqi_r0 reg%lu $%d\n",
+ printf("eqi_r0 reg%lu $%ld\n",
(unsigned long)code[i+1],
FIX2INT((unsigned long)code[i+2]));
i+=2;
@@ -8621,7 +8621,7 @@ loop:
loop_a2IsFixnum:
if (IS_FIXNUM(a1)) {
printf("Runtime ERROR: "); puts_term(a1); printf("~"); puts_term(a2);
- printf("\nInteger %d >< %d can not be used as an active pair\n",
+ printf("\nInteger %ld >< %ld can not be used as an active pair\n",
FIX2INT(a1), FIX2INT(a2));
#ifndef THREAD
mark_and_sweep();
diff --git a/src/mytype.h b/src/mytype.h
index ab72df0..74f5d19 100644
--- a/src/mytype.h
+++ b/src/mytype.h
@@ -52,7 +52,7 @@ typedef struct EQList_tag {
#define FIXNUM_FLAG 0x01
#define INT2FIX(i) ((VALUE)(((long)(i) << 1) | FIXNUM_FLAG))
-#define FIX2INT(i) ((int)(i) >> 1)
+#define FIX2INT(i) ((long)(i) >> 1)
#define IS_FIXNUM(i) ((VALUE)(i) & FIXNUM_FLAG)