commit 3a73afeb732c63d690422d9e6effd583ed7b5560
parent 1ea9da5ae5620c9cdc3dc0a433d8801bf4586ccd
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Tue, 4 Jul 2023 06:25:13 -0400
hal arm: fix bug with some arithmetics ops and 8b)
Diffstat:
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/fs/tests/hal.fs b/fs/tests/hal.fs
@@ -321,4 +321,10 @@ code test36 ( a -- [a-4] )
create foo 12 , 42 , 54 ,
foo 8 + test36 42 #eq
+
+\ |, and 8b) which caused problems on arm
+code test37 ( a b -- b|8b-a )
+ PSP) 8b) |, nip, exit,
+
+$1234 $80 test37 $b4 #eq
testend
diff --git a/fs/xcomp/arm/rpi/kernel.fs b/fs/xcomp/arm/rpi/kernel.fs
@@ -836,9 +836,13 @@ pc to L1 ( operand -- ) \ r0=instr
orr) rTOP rdn) r1 rm) 4 lsr) ,)
lblopwr abs>rel b) ,)
-\ Proxy lblopwr and add a special rule: if opcode is one of the "comparison"
-\ opcodes, forcefully set Rd to 0 before writing it off. Also check for "mul".
+\ Proxy lblopwr with this processing:
+\ 1. Remove OP8B which messes with arithmetic opcodes
+\ 2. If opcode is one of the "comparison" opcodes, forcefully set Rd to 0 before
+\ writing it off.
+\ 3. Also check for "mul".
pc to L4 ( operand -- ) \ r0=instr
+ bic) rTOP rdn) HAL8B imm) ,)
and) r1 rd) r0 rn) $01900000 imm) ,)
cmp) r1 rn) $01100000 imm) ,)
setrd0) z) rTOP rdn) ,)