Post AOmAWsC3mufGQisk88 by ldbeth@mastodon.sdf.org
(DIR) More posts by ldbeth@mastodon.sdf.org
(DIR) Post #AOmAWsC3mufGQisk88 by ldbeth@mastodon.sdf.org
2022-10-20T23:58:36Z
0 likes, 0 repeats
Was writing ARM assembly homework today and saw “calculate x/3”, thought I could do this with division by multiplication technique from hackers delight book because ARM instruction set manual does not mention division at all.And turns out we are supposed to use SDIV instruction provided by Cortex series.And that’s the same how disappointed I am who learned string processing instructions from PDP-10 manual and discovered the actual KA-10 model does not have it.
(DIR) Post #AOmAWssbEkgyYemiR6 by publius@mastodon.sdf.org
2022-10-21T00:57:18Z
0 likes, 0 repeats
@ldbeth Wait, tell me more about this technique. It might solve a problem I've had for a while.
(DIR) Post #AOmBqlyUid4Wt9abzM by ldbeth@mastodon.sdf.org
2022-10-21T01:12:07Z
0 likes, 0 repeats
@publius for n/p where p is a known constant, precompute M=(2^32+2)/p, and the quotient is just (M*n)>>32 + (if isNeg(n) then 1 else 0)