From 6a8b298861c9fb869fa7c0ce3cb3b1d636f90f6d Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 16 Feb 2019 01:18:21 +0100 Subject: [PATCH 1/2] Fix typo where I was confusing sbi and sui, with hilarious results. --- mach/i80/ncg/table | 4 ++-- tests/plat/core/cmu_e.e | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/mach/i80/ncg/table b/mach/i80/ncg/table index b9a2b49dc..bfc21334d 100644 --- a/mach/i80/ncg/table +++ b/mach/i80/ncg/table @@ -1687,7 +1687,7 @@ pat cmu zlt $1==2 uses areg gen mov a, %2.2 - sbi {const1, %1.num & 0xff} + sui {const1, %1.num & 0xff} mov a, %2.1 sbi {const1, %1.num >> 8} jc {label, $2} @@ -1719,7 +1719,7 @@ pat cmu zge $1==2 uses areg gen mov a, %2.2 - sbi {const1, %1.num & 0xff} + sui {const1, %1.num & 0xff} mov a, %2.1 sbi {const1, %1.num >> 8} jnc {label, $2} diff --git a/tests/plat/core/cmu_e.e b/tests/plat/core/cmu_e.e index 62b83d798..addb8e7e7 100644 --- a/tests/plat/core/cmu_e.e +++ b/tests/plat/core/cmu_e.e @@ -16,6 +16,8 @@ zero rom 0 one rom 1 +twofivesix + rom 256 big #if EM_WSIZE == 2 rom 32767 @@ -107,5 +109,18 @@ big asp EM_WSIZE 7 + /* Test case: twofixsix < 256 */ + + loe twofivesix + loc 256 + cmu EM_WSIZE + zlt *8 + bra *9 +8 + loc __LINE__ + cal $fail + asp EM_WSIZE +9 + cal $finished end From 61d623c4d6d34c83715a292131e2e1ce8b8b511f Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 16 Feb 2019 01:18:31 +0100 Subject: [PATCH 2/2] Add a few minor top optimisations. --- mach/i80/top/table | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mach/i80/top/table b/mach/i80/top/table index f03c92d9b..3e0c20d43 100644 --- a/mach/i80/top/table +++ b/mach/i80/top/table @@ -13,12 +13,17 @@ mvi X, Y : mov X, Z -> mov X, Z ; xchg : inx h : xchg -> inx d ; xchg : inx d : xchg -> inx h ; +adi 0 -> xra a ; +ori 0 -> ora a ; +xri 0 -> ora a ; +adi 0 -> ora a ; +sui 0 -> ora a ; cpi 0 -> ora a ; call X : ret -> jmp X ; push h : lxi h, X : pop d -> lxi d, X : xchg ; push d : lxi d, X : pop h -> lxi h, X : xchg ; -push h : lhld h, X : pop d -> xchg : lhld X ; +push h : lhld X : pop d -> xchg : lhld X ; %%;