🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.fortran
Article #6533

Re: Precision of floating point multiply

#6533
From: Glen Herrmannsfeldt
Date: Mon, 29 Sep 2003 14:36
36 lines
2682 bytes
"Nick Maclaren" <nmm1@cus.cam.ac.uk> wrote in message
news:bl8q1g$iv7$1@pegasus.csx.cam.ac.uk...
>
> In article <kmRdb.626671$YN5.452649@sccrnsc01>,
> "Glen Herrmannsfeldt" <gah@ugcs.caltech.edu> writes:
> |>
> |> Since my post on Fortran G and H, I have also run the same test on PL/I
(F).
> |> That might be the compiler you used.
> |>
> |> For   C=C+A*B; single precision A and B, and double precision C, it
does the
> |> same thing Fortran did.
> |>
> |> It would be interesting to see the results from newer Fortran and PL/I
> |> compilers.
>
> Yes, but you haven't posted WHAT it did!  Given that it doesn't need
> to do anything special, I am puzzled over what instructions it inserts.
> Can you post the generated code?

I thought it was somewhere in the thread, but maybe not.

For  C=C+A*B, single precision A, B, and double precision C:

   LE 0,A   load single precision A
   ME 0,B   Multiply by B generating double product in float register 0
   SDR 2,2   Clear double float register 2
   LER 2,0    copy single value from reg 0 to reg 2
   AD 2,C     add double C
   STD 2,C    store double into C

The SDR and LER are used to clear the low half of the product.

-- glen
Technical Details
Message-ID: <xrXdb.631209$Ho3.121609@sccrnsc03>
Path: arc1-ca.pugleaf.net!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!sccrnsc03.POSTED!not-for-mail
References: <dG4db.598668$uu5.97984@sccrnsc04> <iu6fnvch0g09q9f335tt89ogfcj5jm2ovh@4ax.com> <kmRdb.626671$YN5.452649@sccrnsc01> <bl8q1g$iv7$1@pegasus.csx.cam.ac.uk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fd4af,7830916812112af0
X-Google-Attributes: gidfd4af,public
X-Google-Thread: fd705,7830916812112af0
X-Google-Attributes: gidfd705,public
X-Google-Thread: 1094ba,7830916812112af0
X-Google-Attributes: gid1094ba,public
X-Google-Thread: 102b75,7830916812112af0
X-Google-Attributes: gid102b75,public
X-Google-ArrivalTime: 2003-09-29 07:36:14 PST
Path: arc1-ca.pugleaf.net!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!sccrnsc03.POSTED!not-for-mail
From: "Glen Herrmannsfeldt" <gah@ugcs.caltech.edu>
Newsgroups: comp.lang.fortran,comp.arch,bit.listserv.ibm-main,alt.folklore.computers
References: <dG4db.598668$uu5.97984@sccrnsc04> <iu6fnvch0g09q9f335tt89ogfcj5jm2ovh@4ax.com> <kmRdb.626671$YN5.452649@sccrnsc01> <bl8q1g$iv7$1@pegasus.csx.cam.ac.uk>
Subject: Re: Precision of floating point multiply
Lines: 40
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
Message-ID: <xrXdb.631209$Ho3.121609@sccrnsc03>
NNTP-Posting-Host: 12.207.204.17
X-Complaints-To: abuse@comcast.net
X-Trace: sccrnsc03 1064846173 12.207.204.17 (Mon, 29 Sep 2003 14:36:13 GMT)
NNTP-Posting-Date: Mon, 29 Sep 2003 14:36:13 GMT
Organization: Comcast Online
Date: Mon, 29 Sep 2003 14:36:13 GMT