<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Something tells me I should purchase that book - I sense it could
reveal some interesting insights.</p>
<p>Note that while I understand the concept of turning integer
division into multiplication (indeed, I implemented the first
version into x86 before it was improved with the
"calc_divconst_magic_unsigned" routine, and then implemented it
for AArch64), the algorithm that is used in
"calc_divconst_magic_unsigned" I don't quite get if just for the
lack of comments and references, although I am studying it more
closely.</p>
<p>Still, I figure I'll put down Hacker's Delight as a future
purchase so I have a reputable source rather than just an online
one (I know there's one somewhere that isn't behind a paywall).<br>
</p>
<p>Gareth aka. Kit<br>
</p>
<div class="moz-cite-prefix">On 20/08/2021 18:46, Marģers . via
fpc-devel wrote:<br>
</div>
<blockquote type="cite"
cite="mid:1629481576.611fea6862541@mail.inbox.lv">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<blockquote> is there a reference to the algorithm that's used to
calculate the<br>
reciprocal constants used in the integer division optimisations
for x86 and AArch64?</blockquote>
<br>
Hacker’s Delight<br>
Second Edition<br>
Henry S. Warren, Jr.<br>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
fpc-devel maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel">https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a>
</pre>
</blockquote>
<div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br />
<table style="border-top: 1px solid #D3D4DE;">
<tr>
<td style="width: 55px; padding-top: 13px;"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;" /></a></td>
<td style="width: 470px; padding-top: 12px; color: #41424e; font-size: 13px; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank" style="color: #4453ea;">www.avast.com</a>
</td>
</tr>
</table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"> </a></div></body>
</html>