From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 1FBE1BBAF for ; Mon, 2 Nov 2009 17:33:27 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhkEAE+Y7krVBIoEcWdsb2JhbACbWQEMCgkJEQbAVoQ8BA X-IronPort-AV: E=Sophos;i="4.44,668,1249250400"; d="scan'208";a="39384708" Received: from impaqm4.telefonica.net ([213.4.138.4]) by mail1-smtp-roc.national.inria.fr with ESMTP; 02 Nov 2009 17:33:26 +0100 Received: from IMPmailhost3.adm.correo ([10.20.102.124]) by IMPaqm4.telefonica.net with bizsmtp id 0BA61d00g2h2L9m3QGZS8K; Mon, 02 Nov 2009 17:33:26 +0100 Received: from NANA.localdomain ([83.60.159.34]) by IMPmailhost3.adm.correo with BIZ IMP id 0GZR1d00B0kpAGr1jGZSDC; Mon, 02 Nov 2009 17:33:26 +0100 X-TE-authinfo: authemail="ferferse$telefonica.net" |auth_email="ferferse@telefonica.net" X-TE-AcuTerraCos: auth_cuTerraCos="cosuitnetc01" Received: from mfp by NANA.localdomain with local (Exim 4.69) (envelope-from ) id 1N4zqO-0001xG-FC for caml-list@inria.fr; Mon, 02 Nov 2009 17:33:24 +0100 Date: Mon, 2 Nov 2009 17:33:24 +0100 From: Mauricio Fernandez To: caml-list@inria.fr Subject: Re: [Caml-list] Re: How to read different ints from a Bigarray? Message-ID: <20091102163324.GH17061@NANA.localdomain> Mail-Followup-To: caml-list@inria.fr References: <87tyxj5rkv.fsf@frosties.localdomain> <527cf6bc0910281548s53a00ec9s99402f4249b2d411@mail.gmail.com> <873a52wmu0.fsf@frosties.localdomain> <20091029122043.GA18905@annexia.org> <87iqdyb028.fsf@frosties.localdomain> <20091030203011.GA30746@annexia.org> <87tyxeqnyf.fsf@frosties.localdomain> <20091101195749.GA15428@annexia.org> <87bpjkyki8.fsf@frosties.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87bpjkyki8.fsf@frosties.localdomain> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Spam: no; 0.00; bigarray:01 0100,:01 0100,:01 ocaml:01 bigarray:01 ocaml:01 compiler:01 c--:01 asmcomp:01 cmmgen:01 compiler:01 c--:01 2009:98 2009:98 polymorphic:01 On Mon, Nov 02, 2009 at 05:11:27PM +0100, Goswin von Brederlow wrote: > Richard Jones writes: > > > On Sun, Nov 01, 2009 at 04:11:52PM +0100, Goswin von Brederlow wrote: > >> But C calls are still 33% slower than direct access in ocaml (if one > >> doesn't use the polymorphic functions). > > > > Are you using noalloc calls? > > > > http://camltastic.blogspot.com/2008/08/tip-calling-c-functions-directly-with.html > > Yes. And I looked at the bigarray module and couldn't figure out how > they differ from my own external function. Only difference I see is > the leading "%" on the external name. What does that do? That means that it is using a hardcoded OCaml primitive, whose code can be generated by the compiler via C--. See asmcomp/cmmgen.ml. > > I would love to see inline assembler supported by the compiler. It might be possible to hack support for C-- expressions in external declarations. That'd be a sort of portable assembler. -- Mauricio Fernandez - http://eigenclass.org