1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // DO NOT EDIT: autogenerated by etc/platform-intrinsics/generator.py
12 // ignore-tidy-linelength
14 #![allow(unused_imports)]
16 use {Intrinsic, Type};
17 use IntrinsicDef::Named;
19 pub fn find(name: &str) -> Option<Intrinsic> {
20 if !name.starts_with("nvptx") { return None }
21 Some(match &name["nvptx".len()..] {
22 "_syncthreads" => Intrinsic {
23 inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS },
25 definition: Named("llvm.cuda.syncthreads")
27 "_block_dim_x" => Intrinsic {
28 inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS },
30 definition: Named("llvm.nvvm.read.ptx.sreg.ntid.x")
32 "_block_dim_y" => Intrinsic {
33 inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS },
35 definition: Named("llvm.nvvm.read.ptx.sreg.ntid.y")
37 "_block_dim_z" => Intrinsic {
38 inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS },
40 definition: Named("llvm.nvvm.read.ptx.sreg.ntid.z")
42 "_block_idx_x" => Intrinsic {
43 inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS },
45 definition: Named("llvm.nvvm.read.ptx.sreg.ctaid.x")
47 "_block_idx_y" => Intrinsic {
48 inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS },
50 definition: Named("llvm.nvvm.read.ptx.sreg.ctaid.y")
52 "_block_idx_z" => Intrinsic {
53 inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS },
55 definition: Named("llvm.nvvm.read.ptx.sreg.ctaid.z")
57 "_grid_dim_x" => Intrinsic {
58 inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS },
60 definition: Named("llvm.nvvm.read.ptx.sreg.nctaid.x")
62 "_grid_dim_y" => Intrinsic {
63 inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS },
65 definition: Named("llvm.nvvm.read.ptx.sreg.nctaid.y")
67 "_grid_dim_z" => Intrinsic {
68 inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS },
70 definition: Named("llvm.nvvm.read.ptx.sreg.nctaid.z")
72 "_thread_idx_x" => Intrinsic {
73 inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS },
75 definition: Named("llvm.nvvm.read.ptx.sreg.tid.x")
77 "_thread_idx_y" => Intrinsic {
78 inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS },
80 definition: Named("llvm.nvvm.read.ptx.sreg.tid.y")
82 "_thread_idx_z" => Intrinsic {
83 inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS },
85 definition: Named("llvm.nvvm.read.ptx.sreg.tid.z")