3f2737e077fcf33fded46e442f2da3456b205e15
[oota-llvm.git] / lib / Target / PTX / PTXIntrinsicInstrInfo.td
1 //===- PTXIntrinsicInstrInfo.td - Defines PTX intrinsics ---*- tablegen -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines all of the PTX-specific intrinsic instructions.
11 //
12 //===----------------------------------------------------------------------===//
13
14 // PTX Special Purpose Register Accessor Intrinsics
15
16 class PTX_READ_SPECIAL_REGISTER<string regname, Intrinsic intop>
17   : InstPTX<(outs RRegu64:$d), (ins),
18             !strconcat("mov.u64\t$d, ", regname),
19             [(set RRegu64:$d, (intop))]>;
20
21 class PTX_READ_SPECIAL_SUB_REGISTER<string regname, Intrinsic intop>
22   : InstPTX<(outs RRegu16:$d), (ins),
23             !strconcat("mov.u16\t$d, ", regname),
24             [(set RRegu16:$d, (intop))]>;
25
26 def PTX_READ_TID_R64 : PTX_READ_SPECIAL_REGISTER<"tid", int_ptx_read_tid_r64>;
27 def PTX_READ_TID_X : PTX_READ_SPECIAL_SUB_REGISTER<"tid.x", int_ptx_read_tid_x>;
28 def PTX_READ_TID_Y : PTX_READ_SPECIAL_SUB_REGISTER<"tid.y", int_ptx_read_tid_y>;
29 def PTX_READ_TID_Z : PTX_READ_SPECIAL_SUB_REGISTER<"tid.z", int_ptx_read_tid_z>;
30 def PTX_READ_TID_W : PTX_READ_SPECIAL_SUB_REGISTER<"tid.w", int_ptx_read_tid_w>;
31
32 // PTX Parallel Synchronization and Communication Intrinsics
33
34 def PTX_BAR_SYNC : InstPTX<(outs), (ins i32imm:$i), "bar.sync\t$i",
35                            [(int_ptx_bar_sync imm:$i)]>;