From 18c9d30146cf5966574d0c98179c34a860f38150 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 7 Nov 2016 13:20:20 +0100 Subject: Log: problem with division / modulo --- log.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/log.md b/log.md index 956814f..598b79e 100644 --- a/log.md +++ b/log.md @@ -324,3 +324,39 @@ Start = map toReal (fromto 1 100) ### 2016-11-07 **Flashtalk**. + +**Problem** in `thumb2divmod.s`, which was edited quickly without looking what +it actually did: there's something going on with dynamically calculating an +offset and jumping to it, e.g. (from `divide`): + +```armasm +clz r1,r4 +clz r2,r3 +rsb r1,r1,#31-5-11 +add r1,r1,r2 +mov r2,#0 + +cmp r1,#32-5-11 +bhs divide_large_result + +add r1,r1,r1,lsl #1 +.align +add r14,pc,#8 @ Here +add r14,r14,r1,lsl #2 +mov pc,r14 +nop +``` + +This offset is incorrect, since some of the following instructions are narrow. +Should check with John if this can be done intelligently, or that we should +simply force all instructions to be wide. + +The offsets are fixed now. Then there was an issue with the modulo function, +which returns different results than on x64 (see mail to John from this day). +This affects ARM as well. I presume it has been fixed (see follow-up mail and +rts `08f4cf8`). + +**Current status**: the only known problem is with higher order functions and +AP. I still need to look at records, unboxed lists, uniqueness, and possibly +other things. Apart from that, all small examples in the Clean distribution +seem to work. -- cgit v1.2.3