Path: 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> Reply-To: cet1@cl.cam.ac.uk (C.E. Thompson) Distribution: comp Organization: U of Cambridge Comp Lab, UK Lines: 15 In article 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