<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Your revised naming scheme would be
      fine by me.  <br>
      <br>
      We actually have several different calling conventions in use. 
      Our compiled-code-to-assembly-stub conventions is quite close to
      your proposed CPreservesMost, except that we occasionally use a
      dual-register return variant for some calls.  Our
      compiled-to-compiled convention is a slightly rotated form of the
      C calling convention.  When we make calls from compiled code into
      C code (via a hand written assembly stub), we want to be able to
      easily insert a leading argument without having to shift all other
      arguments. (i.e. for JNI)<br>
      <br>
      Things to consider for your documentation:<br>
      - Is this defined to match the objc runtime?  If so, which?  Or is
      defined in terms of a variant of the C calling convention which
      ObjC happens to use?  Or is it defined in terms of purpose and
      only valid against code compiled by the same version of LLVM with
      the same convention name?  (i.e. compatibility guarantees)<br>
      - What is the difference between these and existing calling
      conventions?  In particular, "cold"?  When should each be used?<br>
      - How should target neutral front ends use the conventions?  <br>
      <br>
      You don't need to answer any of those directly to me.  Just
      provide some documentation which addresses them to some degree. 
      (The most important is the first.)<br>
      <br>
      Philip<br>
      <br>
      On 1/16/14 11:23 AM, Juergen Ributzka wrote:<br>
    </div>
    <blockquote
      cite="mid:B271076D-269C-4CA4-91CF-FE5C35543DB6@apple.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      Hi Philip,
      <div><br>
      </div>
      <div>thanks for looking at this. I am definitely open for better
        names for the calling conventions. Although I would prefer not
        to use GPR or XMM in them, because they are not only meant for
        X86. Also on a different architecture with different standard
        calling conventions a different mix of registers might make more
        sense. ObjC is currently the initial use for this, but we don’t
        want to limit it to just this one particular runtime. The more
        people can use this the better.</div>
      <div><br>
      </div>
      <div>What about CPreservesMost and CPreservesAll?</div>
      <div><br>
      </div>
      <div>How different is your special calling convention?</div>
      <div><br>
      </div>
      <div>Thanks</div>
      <div><br>
      </div>
      <div>Cheers,</div>
      <div>Juergen</div>
      <div><br>
      </div>
      <div> <br>
        <div>
          <div>On Jan 16, 2014, at 10:45 AM, Philip Reames <<a
              moz-do-not-send="true"
              href="mailto:listmail@philipreames.com">listmail@philipreames.com</a>>
            wrote:</div>
          <br class="Apple-interchange-newline">
          <blockquote type="cite">
            <div style="font-size: 12px; font-style: normal;
              font-variant: normal; font-weight: normal; letter-spacing:
              normal; line-height: normal; orphans: auto; text-align:
              start; text-indent: 0px; text-transform: none;
              white-space: normal; widows: auto; word-spacing: 0px;
              -webkit-text-stroke-width: 0px;">On 1/16/14 10:39 AM,
              Philip Reames wrote:<br>
              <blockquote type="cite">My only objection to this patch is
                the naming.  We also have runtime calls with special
                calling conventions, but ours aren't the same as the
                ones specified here. Could we rename these?<br>
                <br>
                A few random ideas for names:<br>
                CPreserveGPR<br>
                CPreserveGPRXMM<br>
                WebKitRuntimeCC<br>
              </blockquote>
              Correction: ObjCRuntime.  It helps if I read the original
              email more closely.<br>
              <blockquote type="cite"><br>
                Also, should these be prefixed with X86_?<br>
                <br>
                Philip<br>
                <br>
                On 1/15/14 10:41 AM, Lang Hames wrote:<br>
                <blockquote type="cite">Hi Juergen,<br>
                  <br>
                  If these calling conventions are intended to be
                  generic, should a<br>
                  description be added to the LangRef?<br>
                  <br>
                  Otherwise LGTM.<br>
                  <br>
                  - Lang.<br>
                  <br>
                  On Tue, Jan 14, 2014 at 3:11 PM, Juergen Ributzka <<a
                    moz-do-not-send="true"
                    href="mailto:juergen@apple.com">juergen@apple.com</a>>
                  wrote:<br>
                  <blockquote type="cite">ping<br>
                    <br>
                    On Jan 10, 2014, at 7:45 PM, Juergen Ributzka <<a
                      moz-do-not-send="true"
                      href="mailto:juergen@apple.com">juergen@apple.com</a>>
                    wrote:<br>
                    <br>
                    <blockquote type="cite">New rebased patch and a
                      small fix to the label check in the unit test.<br>
                      <br>
                      Cheers,<br>
                      Juergen<br>
                      <br>
<0002-Add-two-new-calling-conventions-for-runtime-calls.patch><br>
                      On Jan 10, 2014, at 3:47 PM, Juergen Ributzka <<a
                        moz-do-not-send="true"
                        href="mailto:juergen@apple.com">juergen@apple.com</a>>
                      wrote:<br>
                      <br>
                      <blockquote type="cite">Hi @ll,<br>
                        <br>
                        this patch adds two new target-independent
                        calling conventions for runtime calls - Runtime
                        and FastRuntime.<br>
                        <br>
                        The target-specific implementation for X86-64 is
                        defined as following:<br>
                             - Arguments are passed as for the default C
                        calling convention<br>
                             - The same applies for the return value(s)<br>
                             - for runtimecc the callee preserves all
                        GPRs - except R11<br>
                             - for fastruntimecc the callee preserves
                        all GPRs and all XMMs - except R11<br>
                        <br>
                        The idea is to provide calling conventions for
                        calls to very hot runtime functions that are
                        normally just a few lines of assembly code and
                        don’t require a lot of registers. This could be
                        used by the ObjectiveC runtime, or any other
                        runtime that provides performance critical
                        functions.<br>
                        <br>
                        The FastRuntime CC is intended to be used for
                        small codes that don’t call any other functions
                        at all.<br>
                        The Runtime CC is also intended for small codes
                        that usually don’t call other functions on the
                        fast path, but might have to on the slow path.<br>
                        <br>
                        Cheers,<br>
                        Juergen<br>
                        <br>
<0001-Add-two-new-calling-conventions-for-runtime-calls.patch><br>
                        <br>
                        _______________________________________________<br>
                        llvm-commits mailing list<br>
                        <a moz-do-not-send="true"
                          href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
                      </blockquote>
                    </blockquote>
                    <br>
                    _______________________________________________<br>
                    llvm-commits mailing list<br>
                    <a moz-do-not-send="true"
                      href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
                  </blockquote>
                  _______________________________________________<br>
                  llvm-commits mailing list<br>
                  <a moz-do-not-send="true"
                    href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
                  <a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
                </blockquote>
                <br>
                _______________________________________________<br>
                llvm-commits mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
                <a moz-do-not-send="true"
                  href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a></blockquote>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>