From: John Carr <jfc@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 [thread overview]
Message-ID: <200206031645.MAA08466@psi-phi.mit.edu> (raw)
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
next reply other threads:[~2002-06-03 16:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-03 16:45 John Carr [this message]
2002-06-04 9:58 ` Xavier Leroy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200206031645.MAA08466@psi-phi.mit.edu \
--to=jfc@mit.edu \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox