summaryrefslogtreecommitdiff
path: root/log.md
diff options
context:
space:
mode:
authorCamil Staps2016-11-07 13:20:20 +0100
committerCamil Staps2016-11-07 23:40:50 +0100
commit18c9d30146cf5966574d0c98179c34a860f38150 (patch)
tree7ac3076d0601bb38fc967c942d5ddb9defa001eb /log.md
parentlog (diff)
Log: problem with division / modulo
Diffstat (limited to 'log.md')
-rw-r--r--log.md36
1 files changed, 36 insertions, 0 deletions
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.