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 MAA01602 for caml-red; Fri, 20 Oct 2000 12:40:09 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id BAA30246 for ; Fri, 20 Oct 2000 01:50:59 +0200 (MET DST) Received: from unknown-230-101.pilot.net (unknown-230-101.pilot.net [206.98.230.101]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id e9JNowL23960; Fri, 20 Oct 2000 01:50:58 +0200 (MET DST) Received: from unknown-239-164.pilot.net (unknown-239-164.pilot.net [206.189.239.164]) by unknown-230-101.pilot.net with ESMTP id TAA17888; Thu, 19 Oct 2000 19:50:53 -0400 (EDT) Received: from uswaumsxbhmedge.med.ge.com (localhost [127.0.0.1]) by unknown-239-164.pilot.net with ESMTP id TAA12189; Thu, 19 Oct 2000 19:50:53 -0400 (EDT) Received: from mrs.mrs.med.ge.com (3.57.196.1 [3.57.196.1]) by uswaumsxbhmedge.med.ge.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2651.58) id 49ZY96ZM; Thu, 19 Oct 2000 18:50:52 -0500 Received: (from gurr@localhost) by mrs.mrs.med.ge.com (8.9.3+Sun/8.9.3) id QAA14515; Thu, 19 Oct 2000 16:50:41 -0700 (PDT) Date: Thu, 19 Oct 2000 16:50:41 -0700 (PDT) From: David Gurr Message-Id: <200010192350.QAA14515@mrs.mrs.med.ge.com> To: caml-list@inria.fr, Xavier.Leroy@inria.fr Subject: Re: single-precision floats, etc. X-Sun-Charset: US-ASCII Sender: weis@pauillac.inria.fr Xavier Leroy: > > Double-precision floats are hard-coded in a number of places in the > OCaml implementation, such as the native-code generators, but also > parts of the run-time system (e.g. the serializer and deserializer). > Substituting single-precision floats everywhere is feasible, but a > major undertaking. Substituting single floats for double float would be a chore (I tried and gave up). But on machines where doubles are 64 bits and a packed pair of singles is 64 bits, how hard would it be to generalize float to allow any of the 64 bit arithmetric types (ie double floats, pairs of single floats, pairs of 32 bit longs, quads of 16 bit shorts, etc)? > 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. > Indeed, they convert > single floats to double or extended precision at load time, and do > all their arithmetic in double or extended precision. They dont do conversion for packed floats and twice as many singles fit into a cache as do doubles. -David Gurr