From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 821BB800A3 for ; Wed, 21 Dec 2016 17:39:52 +0100 (CET) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=yotambarnoy@gmail.com; spf=Pass smtp.mailfrom=yotambarnoy@gmail.com; spf=None smtp.helo=postmaster@mail-yb0-f196.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of yotambarnoy@gmail.com) identity=pra; client-ip=209.85.213.196; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="yotambarnoy@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of yotambarnoy@gmail.com designates 209.85.213.196 as permitted sender) identity=mailfrom; client-ip=209.85.213.196; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="yotambarnoy@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-yb0-f196.google.com) identity=helo; client-ip=209.85.213.196; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="postmaster@mail-yb0-f196.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AmpA6nhMkV0sz53mCpXMl6mtUPXoX/o7sNwtQ0KIM?= =?us-ascii?q?zox0Ivn/rarrMEGX3/hxlliBBdydsKMfzbqM+P++EUU7or+5+EgYd5JNUxJXwe?= =?us-ascii?q?43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRp?= =?us-ascii?q?OOv1BpTSj8Oq3Oyu5pHf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VPYHKqWq?= =?us-ascii?q?s64Hc3BdT1I53EQ9Wch6CI2W+RF4dQYXEOXkGLDX7tfYyeXfAdQC2XK85l1DcD?= =?us-ascii?q?UO7yGMcayRiyuVqimPJcJe3O93hd7Mq72Q=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BwAAC9r1pYhsTVVdFdGgEBAQECAQEBA?= =?us-ascii?q?QgBAQEBFQEBAQECAQEBAQgBAQEBgwoBAQEBAXmBBweBNqJliGaMLYIKJoV8AoF?= =?us-ascii?q?XB0ESAQEBAQEBAQEBAQESAQEBCAsLCR0wgjMaAYIaAQEBAwEjHQEUBxANAQMMB?= =?us-ascii?q?gULAwoCAiYCAiIBEQEFARwGEwmIRwEDDwgOnAE/jAKCBAUBHoMNBYNmChknDVS?= =?us-ascii?q?CYwEBAQEBAQQBAQEBAQEBGQIGEnmFK4RZhDAcgniCXQWIZYccinaNRYN0kFGOJ?= =?us-ascii?q?IJJFB6BFCYKgS1REoNEIIIGIDQBiFcBAQE?= X-IPAS-Result: =?us-ascii?q?A0BwAAC9r1pYhsTVVdFdGgEBAQECAQEBAQgBAQEBFQEBAQE?= =?us-ascii?q?CAQEBAQgBAQEBgwoBAQEBAXmBBweBNqJliGaMLYIKJoV8AoFXB0ESAQEBAQEBA?= =?us-ascii?q?QEBAQESAQEBCAsLCR0wgjMaAYIaAQEBAwEjHQEUBxANAQMMBgULAwoCAiYCAiI?= =?us-ascii?q?BEQEFARwGEwmIRwEDDwgOnAE/jAKCBAUBHoMNBYNmChknDVSCYwEBAQEBAQQBA?= =?us-ascii?q?QEBAQEBGQIGEnmFK4RZhDAcgniCXQWIZYccinaNRYN0kFGOJIJJFB6BFCYKgS1?= =?us-ascii?q?REoNEIIIGIDQBiFcBAQE?= X-IronPort-AV: E=Sophos;i="5.33,384,1477954800"; d="scan'208";a="205401907" Received: from mail-yb0-f196.google.com ([209.85.213.196]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 21 Dec 2016 17:39:51 +0100 Received: by mail-yb0-f196.google.com with SMTP id d59so2313793ybi.2 for ; Wed, 21 Dec 2016 08:39:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=uG7FhiH72yGlB03rkhBRHJbwWBV+nS6ZY0z3StfARbM=; b=ZXPUpnI5p/6jjWmGXKSUvzvyWxnQcB361xqB23tFvTsplTJCqeTH1KUvIuu+Q0qODD 1cm8KI37eRRFd29Hn6yJFoAiAiEIABD6V+xhDF7NvJrfhk/QasLbEtR0vD31sxLbJ2dY lpjsOAGn01unUDEe3OSJchCTfEuszTqspC04CjiEV2ueKWffCue9Q8KyTQKMcKPfmmXS XyrcCuSF1Q4vCmuS2jJgoAFj7j9bmI43Vy2D/qguz1sdBk2LhkrvtkwukC8siU5LFsAz brnYSQyMGaTPqEp9jEFdDTr2fEHmsi3nz7/59DhOR7PJPw5XwaUgD0QTnx98cKJzpQoB HcnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=uG7FhiH72yGlB03rkhBRHJbwWBV+nS6ZY0z3StfARbM=; b=CWQVZbJVciDyxmegOJhMlwyw35SUxmNHvFSMENz/vJrjcbASy5WMcAZLSR4Hw9ucwk A3JF04PJlpwzXajBgx60DvhRdyxx7gc8/KfaC2T0a+ii/Q3wl6g1T+o/ohRnNHGigZhT tf7QqS1Cq3fMBkVLt4NYB8d9/uMY+g69op21w2dyf2EiSDBTfyWuWpUJBxFPvbiN4Biz ctgQIuCB61ccUg0ZpEDdF8OssGAIVVnXnr4qiVEdOzFVxDgY7qrrA33vh4uEyy7WyvxS lxloAWRjl2KnSdSmmDOSyjfszkgCJeLDq6Va83IjyVQkQbPNgGWr3DhUx3lJ2avbZ554 892A== X-Gm-Message-State: AIkVDXJ+lOTU54MKh+kYnqijPjBUyIVB55uCgT1lDA1w4wGM6ndpTgcdXTmUtNvvlYsFtQoIjsluiS/9wkFKZg== X-Received: by 10.37.3.207 with SMTP id 198mr3238926ybd.15.1482338389957; Wed, 21 Dec 2016 08:39:49 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.18.86 with HTTP; Wed, 21 Dec 2016 08:39:29 -0800 (PST) In-Reply-To: <1482337872.4629.108.camel@gerd-stolpmann.de> References: <7bc766a2-d460-524b-35ca-89609a34b719@tu-berlin.de> <1482148297.4629.19.camel@gerd-stolpmann.de> <0F7D3B1B3C4B894D824F5B822E3E5A172CFB9581@IRSMSX102.ger.corp.intel.com> <1482165686.4629.28.camel@gerd-stolpmann.de> <1506c421-618a-28d4-9a7b-7ba49baf47fa@lexifi.com> <45f9251b-c362-ac9f-fa71-07ab42087c90@lexifi.com> <1482337872.4629.108.camel@gerd-stolpmann.de> From: Yotam Barnoy Date: Wed, 21 Dec 2016 11:39:29 -0500 Message-ID: To: Gerd Stolpmann Cc: Alain Frisch , =?UTF-8?B?RnLDqWTDqXJpYyBCb3Vy?= , "Soegtrop, Michael" , =?UTF-8?Q?Christoph_H=C3=B6ger?= , "caml-list@inria.fr" Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] Closing the performance gap to C On Wed, Dec 21, 2016 at 11:31 AM, Gerd Stolpmann wrote: > Dumb question because you are effectively suggesting an alternate > calling convention in addition to the existing one: wouldn't it make > more sense to switch to a completely different convention? Like: we > pass fp values always in fp registers so far available? > > > Gerd As far as I understand, the current calling convention has to do with generic functions. Having to be polymorphic over all types, including primitive ones, such as floating point and ints of different widths, is really difficult. This is why OOP languages don't do it -- only classes are polymorphic. And Alain, even if we create these alternate calling conventions, the tricky part is still detecting when it's ok to call using direct calling conventions. That's the hard part, and it's best done by Flambda with its inlining. -Yotam > > Am Mittwoch, den 21.12.2016, 17:06 +0100 schrieb Alain Frisch: >> On 21/12/2016 15:45, Yotam Barnoy wrote: >> > >> > I think it's not worth the effort. You need to examine all the code >> > dealing with a parameter (ie. its flow) to see if any generic >> > function >> > is called on that parameter. >> This would be treated a bit like the stubs for optional arguments >> with a >> default value. Any function taking float arguments or returning a >> float >> would be compiled to a specialized version with an unboxed calling >> convention plus a stub which implements the generic calling >> convention >> and delegate the call to the specialized version (or copy its body if >> it >> is small enough). On call site, when the called function is known, >> one >> calls the specialized version instead. This is a systematic, local >> compilation scheme, similar to other optimizations made in >> closure/cmmgen; it does not require a more global analysis nor a >> radically different representation of the code. >> >> About the "it's not worth the effort": the effort has largely been >> done, >> since the ticket came with a working patch (some more effort would >> be >> needed to bring it up to date, though). In my opinion, this seems >> like >> a rather low-hanging fruit with very immediate and significant >> gains. >> I'd rather have this soon than wait for flambda to become stable and >> usable on large projects. >> >> >> >> -- Alain >> > -- > ------------------------------------------------------------ > Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de > My OCaml site: http://www.camlcity.org > Contact details: http://www.camlcity.org/contact.html > Company homepage: http://www.gerd-stolpmann.de > ------------------------------------------------------------ > >