From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!mnetor!uunet!husc6!tut.cis.ohio-state.edu!mailrus!nrl-cmf!ames!pasteur!ucbvax!software.ORG!stluka From: stluka@software.ORG (Fred Stluka) Newsgroups: comp.lang.ada Subject: 64 bit intermediate results on the VAX... Message-ID: <8803100235.AA03637@venera.isi.edu> Date: 9 Mar 88 20:24:31 GMT Sender: usenet@ucbvax.BERKELEY.EDU Organization: The Internet List-Id: In response to: actnyc!djs@uunet.uu.net (Dave Seward) >I agree that the multiply and divide have to be broken up into constituent >operations, but I would expect to use 64 bit intermediate results that EMUL >and EDIV provide. Am I missing something? The problem is not in generating 64-bit intermediate results; it is in manipulating those results to produce a final result. For example, the next thing I tried after generating a bunch of intermediate results was to shift them into position to add them together. To do this, I tried using ASHQ (Arithmetic Shift Quadword) since there is no logical shift instruction. Since ASHQ considers it an integer overflow if the sign bit ever changes, I had to do the shift in 2 parts: first shift by one bit less than desired with the overflow trap enabled in case there really was an overflow; next shift the final bit position with the trap disabled to avoid spurious overflows. Admittedly. many of my problems had to do with the combination of my 3 goals: 1) 64 bit manipulations 2) Unsigned manipulations 3) Automatic propagation of overflows back to the calling routine as Ada exceptions. It may be much simpler (perhaps as simple as the 11 instruction example I referred to earlier on Page 201 of the 1981 VAX Architecture Handbook) if you tackle the extended precision problem alone. --Fred Stluka P.S. As a new user of this bulletin board, I don't know whether it is appropriate to continue this discussion, which has come to have relatively little to do with Ada, under the auspices of INFO-ADA. Please feel free to send messages directly to me unless you think they are still relevant to the entire community.