[Ada] Minor fixes mostly in comments of runtime arithmetic unit
authorYannick Moy <moy@adacore.com>
Tue, 17 Sep 2019 08:02:35 +0000 (08:02 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 17 Sep 2019 08:02:35 +0000 (08:02 +0000)
commitfd339ba30825fa9de81db191beca5cf760347612
tree1942191014b9746d6b85bfd321e6b69809bea2fb
parentd4ba72cbad263d9b4fd211534c117343ed5333a1
[Ada] Minor fixes mostly in comments of runtime arithmetic unit

Multiple comments in functions Double_Divide and Scaled_Divide were
incorrect. Now fixed.

Also change the expression (if Zhi /= 0 then Ylo * Zhi else 0) to the
simpler equivalent (Ylo * Zhi) in Double_Divide.

Also add a comment explaining why the implementation of Algorithm D for
multiple-precision division from the 2nd Edition of The Art of Computer
Programming does not suffer from two bugs discovered on that version.

There is no impact on execution, hence no test.

2019-09-17  Yannick Moy  <moy@adacore.com>

gcc/ada/

* libgnat/s-arit64.adb (Double_Divide): Simplify needlessly
complex computation. Fix comments.
(Scaled_Divide): Fix comments. Explain why implementation does
not suffer from bugs in Algorithm D from 2nd Edition of TAOCP.

From-SVN: r275792
gcc/ada/ChangeLog
gcc/ada/libgnat/s-arit64.adb