home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.arch      Apparently more than just beeps & boops      131,241 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 130,765 of 131,241   
   Anton Ertl to MitchAlsup   
   Re: floating point history, word order a   
   05 Jan 26 08:16:15   
   
   From: anton@mips.complang.tuwien.ac.at   
      
   MitchAlsup  writes:   
   >So, would it not be easier and faster to simply make a densely-packed   
   >128-bit Fixed-Point decimal function unit ?!?   
      
   128-bit binary integers are mostly good enough, and support for that   
   is ok in current architectures; division support might be better,   
   though, but see below.  Rescaling with a power of 10 is something that   
   may merit additional hardware support if it occurs often enough; but I   
   am not convinced that it occurs often enough:   
      
   You usually don't need it for addition and subtraction, because the   
   operands have the same scale factor, and the same scale factor as the   
   result.   
      
   For multiplication, one common operation is to multiply a price with a   
   number of pieces resulting in a price, and no rescaling is necessary   
   there.  Another common operation is to compute a percentage; you do   
   have rescaling there.   
      
   For division, it seems to me that the most common case is division by   
   a percentage that is applied to many dividends (maybe not in the USA,   
   but certainly in Europe it is common to compute the price without VAT   
   (sales tax) from the price with VAT; but there are only few VAT rates   
   in each country); that can be turned into a two-stage operation that   
   might include any necessary rescaling: compute an inverse that can   
   then be used for a cheap multiplication-and-rounding operation (e.g.,   
   where a power-of-2 scale factor is involved for computing something   
   below the least significant digit, in order to implement rounding).   
      
   And yes, support for several rounding modes is needed when an inexact   
   result is involved.  Hardware may be helpful here.   
      
   I have not done much financial programming, so maybe somebody else can   
   complement my views.   
      
   - anton   
   --   
   'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'   
     Mitch Alsup,    
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca