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 RAA22776; Wed, 23 Jun 2004 17:05:22 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 RAA23081 for ; Wed, 23 Jun 2004 17:05:20 +0200 (MET DST) Received: from mail.davidb.org (adsl-64-172-240-129.dsl.sndg02.pacbell.net [64.172.240.129]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i5NF5JSH007903 for ; Wed, 23 Jun 2004 17:05:19 +0200 Received: from davidb by mail.davidb.org with local (Exim 3.36 #1 (Debian)) id 1Bd9JN-0001NJ-00; Wed, 23 Jun 2004 08:05:17 -0700 Date: Wed, 23 Jun 2004 08:05:17 -0700 From: David Brown To: David McClain Cc: caml-list@inria.fr Subject: Re: [Caml-list] OCaml on G4 Message-ID: <20040623150517.GA5180@davidb.org> References: <07F20234-C4DB-11D8-A270-000A95C19BAA@Avisere.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <07F20234-C4DB-11D8-A270-000A95C19BAA@Avisere.com> User-Agent: Mutt/1.5.4i X-Miltered: at concorde with ID 40D99C2F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 caml-list:01 2004:99 mcclain:01 0.0:01 unsafe:01 unsafe:01 ocaml:01 0700,:01 rec:01 dave:03 wrote:03 iter:03 iter:03 let:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, Jun 22, 2004 at 11:03:21PM -0700, David McClain wrote: > let vdot v1 v2 = > let rec iter sum n = > if n < 0 then sum > else > iter (sum +. Array.unsafe_get v1 n *. > Array.unsafe_get v2 n) > (n-1) > in > iter 0.0 (pred len1) > > generate results consistent with the use of the Fused MAC on the PPC G4 > on the Mac OS X Panther. > > Given the loose structure of this code, as written, I might have > expected the storage of intermediate sums to memory. But that does not It does store the intermediate sums to memory. However, the single computation of the MAC is compiled into a single fmadd instruction. But the value for 'sum' is stored and retrieved each iteration of the loop. Dave ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners