From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA08175 for caml-red; Sat, 21 Oct 2000 09:48:24 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA13283 for ; Fri, 20 Oct 2000 15:02:26 +0200 (MET DST) Received: from indigo.recherche.enac.fr (indigo.recherche.enac.fr [195.220.158.66]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id e9KD2Pn03142; Fri, 20 Oct 2000 15:02:25 +0200 (MET DST) Received: from rouge.recherche.enac.fr (root@rouge.recherche.enac.fr [195.220.158.70]) by indigo.recherche.enac.fr (8.8.6 (PHNE_14041)/8.6.11) with ESMTP id PAA09035; Fri, 20 Oct 2000 15:02:19 +0200 (METDST) Received: from recherche.enac.fr (alliot@localhost [127.0.0.1]) by rouge.recherche.enac.fr (8.9.3/8.6.11) with ESMTP id PAA29667; Fri, 20 Oct 2000 15:02:19 +0200 X-Authentication-Warning: rouge.recherche.enac.fr: Host alliot@localhost [127.0.0.1] claimed to be recherche.enac.fr Message-ID: <39F0425B.C91759FE@recherche.enac.fr> Date: Fri, 20 Oct 2000 15:02:19 +0200 From: jean-marc alliot Organization: Laboratoire d'Optimisation Globale X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.12 i686) X-Accept-Language: fr-FR, en MIME-Version: 1.0 To: David Gurr CC: caml-list@inria.fr, Xavier.Leroy@inria.fr Subject: Re: single-precision floats, etc. References: <200010192350.QAA14515@mrs.mrs.med.ge.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: weis@pauillac.inria.fr David Gurr wrote: > > I'm curious to why you need single floats. It's certainly not for > > speed, because most processors nowadays do not compute over single > > floats any faster than over double floats. > > Machines with multimedia instruction sets do compute over single floats > faster than double floats when the single floats are packed into a 64 bit > pair of singles or a 128 bit quad of singles. > Yes, but there are drawbacks: 1) you have to write anyway something in assembly language to easily get down to this level. I concede that one (small) problem of ocaml is the fact that external functions written in assembly or C can not be inlined. This is mainly what I would ask Xavier to think about, but it is clearly a major problem. 2) Performances get as high as 4 Gflops on a 1Ghz P-III, but it is only true when you can have vectorizable code. It is usually not that easy to vectorize an application, and one multiplication between 2 packed 4-float vectors on a P-III is not faster than a multiplication between 2 doubles (well, with the pipelining techniques on the P-III, many things depend on what is before and after the instruction, but I am probably right on the whole) 3) float are very often not enough in precision for many applications. A demonstration of vectorization and precision problems are here : http://www.recherche.enac.fr/~alliot/mand.html