Skip to content

Commit 843f1a2

Browse files
committed
optimize some common muldiv cases on P1
1 parent b9a0f8b commit 843f1a2

3 files changed

Lines changed: 335 additions & 325 deletions

File tree

Changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Version 7.6.2
22
- Added check for `NO_COLOR` environment variable (thanks to Ada)
33
- Added a warning for P1 code with _clkfreq but no _clkmode
4+
- Improved performance of _muldiv64 on P1 (and hence of waitus)
45
- Removed spurious FIT command in P1 org/end inlines
56

67
Version 7.6.1

sys/p1_code.spin

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,10 @@ pri _div64(n, nlo, dlo) : qlo, rlo | q, r, d
402402
qlo := -1
403403
rlo := -1
404404
return
405-
405+
if n == 0
406+
qlo := nlo +/ dlo
407+
rlo := nlo +// dlo
408+
return
406409
d := rlo := r := 0
407410
qlo := q := 0
408411
repeat 64

0 commit comments

Comments
 (0)