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 A0511BBAF for ; Thu, 3 Dec 2009 12:53:29 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArcEAPM0F0vB/Bd4ZWdsb2JhbACZMIJfDQoJBxMFuziEMgSBZw X-IronPort-AV: E=Sophos;i="4.47,334,1257116400"; d="scan'208";a="41289088" Received: from smtp-msa-out01.orange.fr ([193.252.23.120]) by mail1-smtp-roc.national.inria.fr with ESMTP; 03 Dec 2009 12:53:29 +0100 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf5a04.orange.fr (SMTP Server) with ESMTP id 0DF3A1C0008A; Thu, 3 Dec 2009 12:53:29 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf5a04.orange.fr (SMTP Server) with ESMTP id F373C1C000A3; Thu, 3 Dec 2009 12:53:28 +0100 (CET) Received: from [192.168.1.53] (APuteaux-154-1-33-111.w83-199.abo.wanadoo.fr [83.199.48.111]) by mwinf5a04.orange.fr (SMTP Server) with ESMTP id CA5FF1C0008A; Thu, 3 Dec 2009 12:53:28 +0100 (CET) X-ME-UUID: 20091203115328829.CA5FF1C0008A@mwinf5a04.orange.fr X-ME-User-Auth: lexifi Message-ID: <4B17A6B8.2040700@frisch.fr> Date: Thu, 03 Dec 2009 12:53:28 +0100 From: Alain Frisch User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Joost Yervante Damad Cc: caml-list@inria.fr Subject: Re: [Caml-list] Embedding the ocaml runtime in a shared library on amd64/x86_64 References: <200912021333.11599.joost@damad.be> <20091202165116.GA7786@annexia.org> <20091202223751.GA20553@usha.takhisis.invalid> <200912031157.00187.joost@damad.be> In-Reply-To: <200912031157.00187.joost@damad.be> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; frisch:01 frisch:01 ocaml:01 runtime:01 -fpic:01 gcc:01 ocamlopt:01 dynlink:01 wrote:01 caml-list:01 alain:01 alain:01 asm:02 native:03 embedding:03 Joost Yervante Damad wrote: > Reading up on this, I don't think using -fPIC on amd64 has a performance > penalty since it has the %rip register. Also it appears that gcc by default > uses indirect addressing via %rip in the generated asm. I did some benchmarks when switching the ocamlopt AMD64 code generator to generate PIC code by default (in order to support Dynlink on native code): the slowdown was indeed very small (in the order of a few percent for micro benchmarks). Modern processors seem very good for optimizing indirect calls. Alain