Subversion Repositories QNX 8.QNX8 LLVM/Clang compiler suite

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
14 pmbaty 1
//==- IntrinsicsXCore.td - XCore intrinsics                 -*- tablegen -*-==//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This file defines all of the XCore-specific intrinsics.
10
//
11
//===----------------------------------------------------------------------===//
12
 
13
let TargetPrefix = "xcore" in {  // All intrinsics start with "llvm.xcore.".
14
  // Miscellaneous instructions.
15
  def int_xcore_bitrev : Intrinsic<[llvm_i32_ty],[llvm_i32_ty],[IntrNoMem]>,
16
                         ClangBuiltin<"__builtin_bitrev">;
17
  def int_xcore_crc8 : Intrinsic<[llvm_i32_ty, llvm_i32_ty],
18
                                 [llvm_i32_ty,llvm_i32_ty,llvm_i32_ty],
19
                                 [IntrNoMem]>;
20
  def int_xcore_crc32 : Intrinsic<[llvm_i32_ty],
21
                                  [llvm_i32_ty,llvm_i32_ty,llvm_i32_ty],
22
                                  [IntrNoMem]>;
23
  def int_xcore_sext : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
24
                                 [IntrNoMem]>;
25
  def int_xcore_zext : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
26
                                 [IntrNoMem]>;
27
  def int_xcore_getid : Intrinsic<[llvm_i32_ty],[],[IntrNoMem]>,
28
                        ClangBuiltin<"__builtin_getid">;
29
  def int_xcore_getps : Intrinsic<[llvm_i32_ty],[llvm_i32_ty]>,
30
                        ClangBuiltin<"__builtin_getps">;
31
  def int_xcore_setps : Intrinsic<[],[llvm_i32_ty, llvm_i32_ty]>,
32
                        ClangBuiltin<"__builtin_setps">;
33
  def int_xcore_geted : Intrinsic<[llvm_i32_ty],[]>;
34
  def int_xcore_getet : Intrinsic<[llvm_i32_ty],[]>;
35
  def int_xcore_setsr : Intrinsic<[],[llvm_i32_ty]>;
36
  def int_xcore_clrsr : Intrinsic<[],[llvm_i32_ty]>;
37
 
38
  // Resource instructions.
39
  def int_xcore_getr : Intrinsic<[llvm_anyptr_ty],[llvm_i32_ty]>;
40
  def int_xcore_freer : Intrinsic<[],[llvm_anyptr_ty],
41
                                   [NoCapture<ArgIndex<0>>]>;
42
  def int_xcore_in : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],[NoCapture<ArgIndex<0>>]>;
43
  def int_xcore_int : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
44
                                [NoCapture<ArgIndex<0>>]>;
45
  def int_xcore_inct : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
46
                                 [NoCapture<ArgIndex<0>>]>;
47
  def int_xcore_out : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
48
                                [NoCapture<ArgIndex<0>>]>;
49
  def int_xcore_outt : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
50
                                 [NoCapture<ArgIndex<0>>]>;
51
  def int_xcore_outct : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
52
                                  [NoCapture<ArgIndex<0>>]>;
53
  def int_xcore_chkct : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
54
                                  [NoCapture<ArgIndex<0>>]>;
55
  def int_xcore_testct : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
56
                                   [NoCapture<ArgIndex<0>>]>;
57
  def int_xcore_testwct : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
58
                                    [NoCapture<ArgIndex<0>>]>;
59
  def int_xcore_setd : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
60
                                  [NoCapture<ArgIndex<0>>]>;
61
  def int_xcore_setc : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
62
                                  [NoCapture<ArgIndex<0>>]>;
63
  def int_xcore_inshr : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty, llvm_i32_ty],
64
                                  [NoCapture<ArgIndex<0>>]>;
65
  def int_xcore_outshr : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty, llvm_i32_ty],
66
                                  [NoCapture<ArgIndex<0>>]>;
67
  def int_xcore_setpt : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
68
                                  [NoCapture<ArgIndex<0>>]>;
69
  def int_xcore_clrpt : Intrinsic<[],[llvm_anyptr_ty],
70
                                  [NoCapture<ArgIndex<0>>]>;
71
  def int_xcore_getts : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
72
                                  [NoCapture<ArgIndex<0>>]>;
73
  def int_xcore_syncr : Intrinsic<[],[llvm_anyptr_ty],
74
                                  [NoCapture<ArgIndex<0>>]>;
75
  def int_xcore_settw : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
76
                                  [NoCapture<ArgIndex<0>>]>;
77
  def int_xcore_setv : Intrinsic<[],[llvm_anyptr_ty, llvm_ptr_ty],
78
                                 [NoCapture<ArgIndex<0>>]>;
79
  def int_xcore_setev : Intrinsic<[],[llvm_anyptr_ty, llvm_ptr_ty],
80
                                  [NoCapture<ArgIndex<0>>]>;
81
  def int_xcore_eeu : Intrinsic<[],[llvm_anyptr_ty], [NoCapture<ArgIndex<0>>]>;
82
  def int_xcore_edu : Intrinsic<[],[llvm_anyptr_ty], [NoCapture<ArgIndex<0>>]>;
83
  def int_xcore_setclk : Intrinsic<[],[llvm_anyptr_ty, llvm_anyptr_ty],
84
                                   [NoCapture<ArgIndex<0>>, NoCapture<ArgIndex<1>>]>;
85
  def int_xcore_setrdy : Intrinsic<[],[llvm_anyptr_ty, llvm_anyptr_ty],
86
                                   [NoCapture<ArgIndex<0>>, NoCapture<ArgIndex<1>>]>;
87
  def int_xcore_setpsc : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
88
                                   [NoCapture<ArgIndex<0>>]>;
89
  def int_xcore_peek : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
90
                                 [NoCapture<ArgIndex<0>>]>;
91
  def int_xcore_endin : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
92
                                 [NoCapture<ArgIndex<0>>]>;
93
 
94
  // Intrinsics for events.
95
  def int_xcore_waitevent : Intrinsic<[llvm_ptr_ty],[], [IntrReadMem]>;
96
 
97
  // If any of the resources owned by the thread are ready this returns the
98
  // vector of one of the ready resources. If no resources owned by the thread
99
  // are ready then the operand passed to the intrinsic is returned.
100
  def int_xcore_checkevent : Intrinsic<[llvm_ptr_ty],[llvm_ptr_ty]>;
101
 
102
  def int_xcore_clre : Intrinsic<[],[],[]>;
103
 
104
  // Intrinsics for threads.
105
  def int_xcore_getst : Intrinsic <[llvm_anyptr_ty],[llvm_anyptr_ty],
106
                                   [NoCapture<ArgIndex<0>>]>;
107
  def int_xcore_msync : Intrinsic <[],[llvm_anyptr_ty], [NoCapture<ArgIndex<0>>]>;
108
  def int_xcore_ssync : Intrinsic <[],[]>;
109
  def int_xcore_mjoin : Intrinsic <[],[llvm_anyptr_ty], [NoCapture<ArgIndex<0>>]>;
110
  def int_xcore_initsp : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
111
                                    [NoCapture<ArgIndex<0>>]>;
112
  def int_xcore_initpc : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
113
                                    [NoCapture<ArgIndex<0>>]>;
114
  def int_xcore_initlr : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
115
                                    [NoCapture<ArgIndex<0>>]>;
116
  def int_xcore_initcp : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
117
                                    [NoCapture<ArgIndex<0>>]>;
118
  def int_xcore_initdp : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
119
                                    [NoCapture<ArgIndex<0>>]>;
120
}