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 QAA25484; Thu, 8 Jul 2004 16:36:56 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 QAA25463 for ; Thu, 8 Jul 2004 16:36:55 +0200 (MET DST) Received: from beaune.inria.fr (beaune.inria.fr [128.93.8.3]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i68EasEV030811 for ; Thu, 8 Jul 2004 16:36:54 +0200 Received: by beaune.inria.fr (8.8.8/1.1.22.3/14Sep99-0328PM) id QAA0000001799; Thu, 8 Jul 2004 16:36:53 +0200 (MET DST) Date: Thu, 8 Jul 2004 16:36:53 +0200 From: Luc Maranget To: David Brown Cc: Andreas Rossberg , caml-list Subject: Re: [Caml-list] Does Caml have slow arithmetics ? Message-ID: <20040708163653.A1260@beaune.inria.fr> References: <20040707091308.GA26172@bourg.inria.fr> <20040707145803.GB27498@yquem.inria.fr> <1089227778.29648.81.camel@pelican.wigram> <20040708034455.GB29942@davidb.org> <40ED190E.3080005@ps.uni-sb.de> <20040708140408.GA2386@davidb.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20040708140408.GA2386@davidb.org>; from caml-list@davidb.org on Thu, Jul 08, 2004 at 07:04:09AM -0700 X-Miltered: at nez-perce with ID 40ED5C06.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 arithmetics:01 2004:99 rossberg:01 tail-call:01 ocamlc:01 ocamlopt:01 callee:01 --luc:01 ocaml:01 caml:01 caml:01 0200,:01 maranget:02 maranget:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > On Thu, Jul 08, 2004 at 11:51:10AM +0200, Andreas Rossberg wrote: > > Many ocaml programs depend on tail-call elimination, although I don't > believe anything in the docs requires it to be done. > Well, when programming in caml, I use the following rules (which I hope to be accurate!) + ocamlc does perform tail call elimation + ocamlopt does it less often. Namely, calls in tail position become real tail calls when all their arguments are passed in registers. (This does not apply to self-tail calls which are always optimized) On pentiums/x86/IA32 this means that tail calls are performed when the callee has four arguments or less (if I remember well). --Luc > 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