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 SAA08027; Mon, 3 Jun 2002 18:45:38 +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 SAA08023 for ; Mon, 3 Jun 2002 18:45:37 +0200 (MET DST) Received: from pacific-carrier-annex.mit.edu (PACIFIC-CARRIER-ANNEX.MIT.EDU [18.7.21.83]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g53Gjan29295 for ; Mon, 3 Jun 2002 18:45:36 +0200 (MET DST) Received: from grand-central-station.mit.edu (GRAND-CENTRAL-STATION.MIT.EDU [18.7.21.82]) by pacific-carrier-annex.mit.edu (8.9.2/8.9.2) with ESMTP id MAA10175 for ; Mon, 3 Jun 2002 12:45:34 -0400 (EDT) Received: from manawatu-mail-centre.mit.edu (MANAWATU-MAIL-CENTRE.MIT.EDU [18.7.7.71]) by grand-central-station.mit.edu (8.9.2/8.9.2) with ESMTP id MAA25826 for ; Mon, 3 Jun 2002 12:45:34 -0400 (EDT) Received: from psi-phi.mit.edu (PSI-PHI.MIT.EDU [18.187.1.35]) by manawatu-mail-centre.mit.edu (8.9.2/8.9.2) with ESMTP id MAA24371 for ; Mon, 3 Jun 2002 12:45:34 -0400 (EDT) Received: (from jfc@localhost) by psi-phi.mit.edu (8.9.3) id MAA08466; Mon, 3 Jun 2002 12:45:33 -0400 Message-Id: <200206031645.MAA08466@psi-phi.mit.edu> To: caml-list@inria.fr Subject: [Caml-list] OCaml SPARC asm compiler implementation question Date: Mon, 03 Jun 2002 12:45:33 -0400 From: John Carr Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk ocaml 3.04 uses registers %l6 and %l7 for allocation in compiled SPARC code. %l6 is the address of the last object allocated. %l7 is a pointer to a word holding the lower limit of the youngest generation, young_limit in minor_gc.c. The alloc instruction sequence looks like: ld [%l7],%g1 ! load young_limit sub %l6,N,%l6 ! decrement alloc pointer cmp %l6,%g1 ! bounds check bgeu label ! branch if out of memory ... I have three questions: Why does %l7 hold the address of young_limit instead of its value? The alloc instruction sequence would be reduced by one instruction and 1-3 cycles (depending on chip) if the load could be omitted. The MIPS implementation does not have this indirection. Looking at this code made me wonder, what fraction of operations in a typical ocaml program are allocations? _Garbage Collection_ quotes statistics for several functional languages, including a version of ML, but I don't think it mentions ocaml. Are many people using ocaml on UltraSPARC processors? The code is optimized for older SPARCs and substantial improvement is possible for UltraSPARC. (For example, the integer load-double and store-double instructions are faster than a pair of load or store instructions on older SPARCs, are substantially slower on UltraSPARC, and trap to emulation on the Hal SPARC-64.) More on this in a future message. --John Carr (jfc@mit.edu) ------------------- 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