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 RAA29411; Thu, 8 Jul 2004 17:49:09 +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 RAA29173 for ; Thu, 8 Jul 2004 17:49:08 +0200 (MET DST) Received: from beaune.inria.fr (beaune.inria.fr [128.93.8.3]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i68Fn7SH011957 for ; Thu, 8 Jul 2004 17:49:07 +0200 Received: by beaune.inria.fr (8.8.8/1.1.22.3/14Sep99-0328PM) id RAA0000004401; Thu, 8 Jul 2004 17:49:06 +0200 (MET DST) Date: Thu, 8 Jul 2004 17:49:06 +0200 From: Luc Maranget To: Alex Baretta Cc: ocaml Subject: Re: [Caml-list] Does Caml have slow arithmetics ? Message-ID: <20040708174906.B3687@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> <20040708163653.A1260@beaune.inria.fr> <40ED6424.7090903@baretta.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <40ED6424.7090903@baretta.com>; from alex@baretta.com on Thu, Jul 08, 2004 at 05:11:32PM +0200 X-Miltered: at concorde with ID 40ED6CF3.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 ocamlc:01 ocamlopt:01 oups:01 callee:01 unoptimized:01 tail-call:01 ocamlopt:01 --luc:01 caml:01 byte:01 maranget:02 maranget:02 namely:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > > + 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) > > > Oups sorry... In fact you need 7 arguments or more in the callee to trigger the unoptimized behavior on a pentium (just checked this time). > > What?! Is this true? This effectively means that I cannot count on > tail-call elimination in general? Do not take it that bad. In practice, it does not matter much I guess. I guess that any ocamlopt back-end passes at least the first six argument in registers (and six is a lot). Besides stack grow is a less severe issue in native code than it is in byte code. At least in Unix, the process stack may grow to important sizes. --Luc ------------------- 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