Skip to content

Commit

Permalink
llvm: Add support for vectorcall (X86_VectorCall) convention
Browse files Browse the repository at this point in the history
  • Loading branch information
steffengy committed Dec 26, 2015
1 parent 3150ddd commit 9af75d2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/doc/book/ffi.md
Expand Up @@ -478,6 +478,7 @@ are:
* `aapcs`
* `cdecl`
* `fastcall`
* `vectorcall`
* `Rust`
* `rust-intrinsic`
* `system`
Expand Down
1 change: 1 addition & 0 deletions src/librustc_llvm/lib.rs
Expand Up @@ -85,6 +85,7 @@ pub enum CallConv {
X86StdcallCallConv = 64,
X86FastcallCallConv = 65,
X86_64_Win64 = 79,
X86_VectorCall = 80
}

#[derive(Copy, Clone)]
Expand Down
4 changes: 3 additions & 1 deletion src/librustc_trans/trans/foreign.rs
Expand Up @@ -35,7 +35,8 @@ use std::cmp;
use std::iter::once;
use libc::c_uint;
use syntax::abi::{Cdecl, Aapcs, C, Win64, Abi};
use syntax::abi::{PlatformIntrinsic, RustIntrinsic, Rust, RustCall, Stdcall, Fastcall, System};
use syntax::abi::{PlatformIntrinsic, RustIntrinsic, Rust, RustCall, Stdcall};
use syntax::abi::{Fastcall, Vectorcall, System};
use syntax::attr;
use syntax::codemap::Span;
use syntax::parse::token::{InternedString, special_idents};
Expand Down Expand Up @@ -104,6 +105,7 @@ pub fn llvm_calling_convention(ccx: &CrateContext,

Stdcall => llvm::X86StdcallCallConv,
Fastcall => llvm::X86FastcallCallConv,
Vectorcall => llvm::X86_VectorCall,
C => llvm::CCallConv,
Win64 => llvm::X86_64_Win64,

Expand Down
2 changes: 2 additions & 0 deletions src/libsyntax/abi.rs
Expand Up @@ -39,6 +39,7 @@ pub enum Abi {
Cdecl,
Stdcall,
Fastcall,
Vectorcall,
Aapcs,
Win64,

Expand Down Expand Up @@ -85,6 +86,7 @@ const AbiDatas: &'static [AbiData] = &[
AbiData {abi: Cdecl, name: "cdecl" },
AbiData {abi: Stdcall, name: "stdcall" },
AbiData {abi: Fastcall, name: "fastcall" },
AbiData {abi: Vectorcall, name: "vectorcall"},
AbiData {abi: Aapcs, name: "aapcs" },
AbiData {abi: Win64, name: "win64" },

Expand Down

0 comments on commit 9af75d2

Please sign in to comment.