From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: Niall Dalton <ndalton@ics.uci.edu>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Inline assembly?
Date: Thu, 22 Mar 2001 14:28:26 +0100 [thread overview]
Message-ID: <20010322142826.B18008@pauillac.inria.fr> (raw)
In-Reply-To: <p05001903b6de0e15ff60@[128.195.169.111]>; from ndalton@ics.uci.edu on Wed, Mar 21, 2001 at 12:00:47AM -0800
> Is it possible to use inline assembly in ocaml?
Currently, no. A gcc-style inline asm facility could be useful to
express some canned instruction sequences that are currently hardcoded
into each native-code generator, but that's also quite a lot of work
to implement properly.
> If not, what is the lowest overhead way to approximate
> it? Using a C function which includes the asm?
Yes. Since the C function will not heap-allocate nor raise
exceptions, you can tell the compiler about it using the "noalloc"
annotation:
external myfunction : ... = "myfunction" "noalloc"
and this will select a faster calling convention from Caml to C for
this function. If the function operates over floats, there are other
performance tricks one can play; write me if this is the case.
Regards,
- Xavier Leroy
-------------------
To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr
next prev parent reply other threads:[~2001-03-22 13:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-21 8:00 Niall Dalton
2001-03-22 13:28 ` Xavier Leroy [this message]
2001-03-23 15:59 ` Markus Mottl
2001-03-29 13:29 ` 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=20010322142826.B18008@pauillac.inria.fr \
--to=xavier.leroy@inria.fr \
--cc=caml-list@inria.fr \
--cc=ndalton@ics.uci.edu \
/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