Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!snorkelwacker!husc6!encore!pinocchio.encore.com From: jkenton@pinocchio.encore.com (Jeff Kenton) Newsgroups: comp.sys.m88k Subject: Re: Fixed point multiply overflow detection Message-ID: <12425@encore.Encore.COM> Date: 9 Aug 90 01:02:18 GMT References: <1990Aug08.182206.22187@unx.sas.com> Sender: news@Encore.COM Lines: 21 From article <1990Aug08.182206.22187@unx.sas.com>, by sasrer@mozart.unx.sas.com (Rodney Radford): > Does anyone know how to check if an overflow occurs with the MULT instruction? > Since this check will possibly be done very often, it is desired that the > method be as fast as possible. The hardware doesn't provide any direct way (as you've noticed). Two choices come to mind: * use floating point (double precision for enough accuracy) and check the results. * use ff1 instructions to find the magnitude of both operands to see if overflow can occur. Both of these are clearly slower than "multiply and check a status bit", but those are your choices. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - jeff kenton --- temporarily at jkenton@pinocchio.encore.com --- always at (617) 894-4508 --- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -