[PATCH] Add explicit Win64 and System V calling conventions to the x86_64 backend

Reid Kleckner rnk at google.com
Sun Jul 7 13:02:48 PDT 2013


Phab is acting funny, so email comments it is.

+++ include/llvm/IR/CallingConv.h
> @@ -119,8 +119,17 @@
>      SPIR_KERNEL = 76,
>
>      /// Intel_OCL_BI - Calling conventions for Intel OpenCL built-ins
> -    Intel_OCL_BI = 77
> +    Intel_OCL_BI = 77,
>
> +    /// \brief The C convention as implemented under x86-64 on most non-
> +    /// Windows systems.
> +    X86_64_C = 78,


Something like "X86_64_SysV" is probably more appropriate, since that's
what everyone is trying to conform to.

+++ lib/AsmParser/LLLexer.cpp
> @@ -556,6 +556,8 @@
>    KEYWORD(spir_kernel);
>    KEYWORD(spir_func);
>    KEYWORD(intel_ocl_bicc);
> +  KEYWORD(x86_64_ccc);


Probably "x86_64_sysv_cc".

+++ lib/Target/X86/X86FastISel.cpp
> @@ -717,10 +717,11 @@
>    CallingConv::ID CC = F.getCallingConv();
>    if (CC != CallingConv::C &&
>        CC != CallingConv::Fast &&
> -      CC != CallingConv::X86_FastCall)
> +      CC != CallingConv::X86_FastCall &&
> +      CC != CallingConv::X86_64_C)
>      return false;
>
> -  if (Subtarget->isTargetWin64())
> +  if (Subtarget->isTargetWin64() && CC != CallingConv::X86_64_C)


I would rewrite these and all subsequent checks as a call to a helper named
something like X86Subtarget::isCCWin64(CallingConv::ID).


On Wed, Jul 3, 2013 at 9:40 PM, Charles Davis <cdavis5x at gmail.com> wrote:

>
>   Adding Reid at Chandler's request.
>
> http://llvm-reviews.chandlerc.com/D729
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130707/f95368eb/attachment.html>


More information about the llvm-commits mailing list