From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,94b6222e337d2ab8 X-Google-Attributes: gid111c93,public From: andi@complang.tuwien.ac.at (Andreas Krall) Subject: Re: Alpha's floating point performance Date: 1998/11/19 Message-ID: <7325lu$554$1@news.tuwien.ac.at>#1/1 X-Deja-AN: 413656197 References: <3643A2A1.DECD63A@cs.sunysb.edu> <3653768C.FD9D4815@west.net> <72vvv9$kac$1@tesla.EECS.Berkeley.EDU> <731iaq$lsc$1@tesla.EECS.Berkeley.EDU> Content-Type: text/plain; charset=us-ascii Organization: Vienna University of Technology, Austria Mime-Version: 1.0 Newsgroups: comp.os.linux.alpha In article , Robert Harley writes: > > peterm@tesla.EECS.Berkeley.EDU (Peter Mardahl) writes: >>Alpha has hardware instructions for dealing with single precision. >>I think you're right in that the same execution units are used for all >>precisions, but I suspect that the execution units are organized in >>such a way that either there is no conversion needed, or conversion is >>so fast that the ops are no slower. > > That's about it. Single-precision numbers are "expanded" into > numerically equivalent double-precision ones in the floating-point > registers. Each f.-p. operation specifies whether the result is to be > single or double precision, which affects rounding, exponent checking > etc. > > I'm not quite sure what happens if you ask for a single precision > result operating on double-precision quantities that are not equal to > expanded single-precision ones, though. > The Alpha manual tells: Single-precision operations applied to canonical single-precision values give single-precision results. Single-precision operations applied to non-canonical operands give UNPREDICTABLE results. No conversion from single to double is needed, since both use the same representation in a register. A double has to be converted to a single and this instruction (CVTTS) can throw exeptions. Single and double adds/muls have the same latency (4 cycles 164, 6 cycles on the 064). The latency for a div is different (064: single 30/34, double 59/63; 164: single 15-31, double 22-60). If you use singles instead of doubles you can reduce cache trashing. Andi P.S: I hate all the floating point stuff, especially if you have to implement JVM compatible IEEE arithmetic :-). -- andi@complang.tuwien.ac.at Andreas Krall http://www.complang.tuwien.ac.at/andi/ Inst. f. Computersprachen, TU Wien tel: (+431) 58801/18511 Argentinierstr. 8/4/1851 fax: (+431) 58801/18598 A-1040 Wien AUSTRIA EUROPE