From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA15233; Wed, 6 Jun 2001 20:31:58 +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 UAA15225 for ; Wed, 6 Jun 2001 20:31:57 +0200 (MET DST) Received: from smtp8.xs4all.nl (smtp8.xs4all.nl [194.109.127.134]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f56IVuL24127 for ; Wed, 6 Jun 2001 20:31:56 +0200 (MET DST) Received: from beertje.william.bogus (williamc.xs4all.nl [213.84.56.92]) by smtp8.xs4all.nl (8.9.3/8.9.3) with ESMTP id UAA14721; Wed, 6 Jun 2001 20:31:54 +0200 (CEST) Received: (from williamc@localhost) by beertje.william.bogus (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) id f56IZtc21244; Wed, 6 Jun 2001 20:35:56 +0200 X-Authentication-Warning: beertje.william.bogus: williamc set sender to williamc@paneris.org using -f From: William Chesters MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15134.30731.137189.386800@beertje.william.bogus> Date: Wed, 6 Jun 2001 20:35:55 +0200 (CEST) To: caml-list@inria.fr Subject: Re: [Caml-list] OCaml Speed for Block Convolutions In-Reply-To: <200106060203.EAA22757@pauillac.inria.fr> References: <20010605104804.83767.qmail@web11902.mail.yahoo.com> <200106060203.EAA22757@pauillac.inria.fr> X-Mailer: VM 6.75 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hugo Herbelin writes: > Assume more generally that you can modify any local variable as in the > (standard) following example: > > let fact (mutable n) = > let mutable r = 1 in > while n > 0 do > r <- r * n; > n <- n - 1 > done; > r This doesn't actually make life much easier for the compiler. On 32-bit machines [see other thread!], `r' must be a reference (in the C++ sense) to a heap object---64-bit float, plus header. In general it is not safe to overwrite the float value in the heap, if it's possible that other variables have been assigned to it (unless floats are assigned by value not by reference, but in that case you get heap allocation at the time of assignment ...). The analysis necessary for determining that no such aliasing references can exist, and indeed that the value can simply be kept in a float register/on the FPU stack, is already there in the compiler and applies perfectly well to mutable references. ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr