🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #12042

Re: Is double->int slow?

#12042
From: C.E. Thompson
Date: Wed, 12 Jun 1991 01:40
15 lines
1213 bytes
In article <COGSWELL.91Jun11112827@MEAT.cs.cmu.edu> cogswell@MEAT.cs.cmu.edu (Bryce Cogswell) writes:
>Double to int conversion on the RS/6000 is done in software, and
>requires 17-39 instructions.
>
That's mind-bogglingly many. If it doesn't violate any legal nicety, could
you post the details?

The tedious aspect of double->int conversion in software is usually the
range check. After that, with an IEEE754 implemnetation, adding a suitable
constant to move the integer part to the low-order bits of the mantissa and
simulataneously bias by 2**31 does the trick.

Chris Thompson
JANET:    cet1@uk.ac.cam.phx
Internet: cet1%phx.cam.ac.uk@nsfnet-relay.ac.uk
Technical Details
Message-ID: <1991Jun12.014037.26495@cl.cam.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!ukc!cam-cl!news
References: <1991Jun6.172905.5304@vax5.cit.cornell.edu> <1991Jun10.220533.19560@jetsun.weitek.COM> <COGSWELL.91Jun11112827@MEAT.cs.cmu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!ukc!cam-cl!news
From: cet1@cl.cam.ac.uk (C.E. Thompson)
Newsgroups: comp.arch
Subject: Re: Is double->int slow?
Message-ID: <1991Jun12.014037.26495@cl.cam.ac.uk>
Date: 12 Jun 91 01:40:37 GMT
References: <1991Jun6.172905.5304@vax5.cit.cornell.edu> <1991Jun10.220533.19560@jetsun.weitek.COM> <COGSWELL.91Jun11112827@MEAT.cs.cmu.edu>
Reply-To: cet1@cl.cam.ac.uk (C.E. Thompson)
Distribution: comp
Organization: U of Cambridge Comp Lab, UK
Lines: 15