1 //==- IntrinsicsXCore.td - XCore intrinsics -*- tablegen -*-==//
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
7 //===----------------------------------------------------------------------===//
9 // This file defines all of the XCore-specific intrinsics.
11 //===----------------------------------------------------------------------===//
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 GCCBuiltin<"__builtin_bitrev">;
17 def int_xcore_crc8 : Intrinsic<[llvm_i32_ty, llvm_i32_ty],
18 [llvm_i32_ty,llvm_i32_ty,llvm_i32_ty],
20 def int_xcore_crc32 : Intrinsic<[llvm_i32_ty],
21 [llvm_i32_ty,llvm_i32_ty,llvm_i32_ty],
23 def int_xcore_sext : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
25 def int_xcore_zext : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
27 def int_xcore_getid : Intrinsic<[llvm_i32_ty],[],[IntrNoMem]>,
28 GCCBuiltin<"__builtin_getid">;
29 def int_xcore_getps : Intrinsic<[llvm_i32_ty],[llvm_i32_ty]>,
30 GCCBuiltin<"__builtin_getps">;
31 def int_xcore_setps : Intrinsic<[],[llvm_i32_ty, llvm_i32_ty]>,
32 GCCBuiltin<"__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]>;
38 // Resource instructions.
39 def int_xcore_getr : Intrinsic<[llvm_anyptr_ty],[llvm_i32_ty]>;
40 def int_xcore_freer : Intrinsic<[],[llvm_anyptr_ty],
42 def int_xcore_in : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],[NoCapture<0>]>;
43 def int_xcore_int : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
45 def int_xcore_inct : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
47 def int_xcore_out : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
49 def int_xcore_outt : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
51 def int_xcore_outct : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
53 def int_xcore_chkct : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
55 def int_xcore_testct : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
57 def int_xcore_testwct : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
59 def int_xcore_setd : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
61 def int_xcore_setc : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
63 def int_xcore_inshr : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty, llvm_i32_ty],
65 def int_xcore_outshr : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty, llvm_i32_ty],
67 def int_xcore_setpt : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
69 def int_xcore_clrpt : Intrinsic<[],[llvm_anyptr_ty],
71 def int_xcore_getts : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
73 def int_xcore_syncr : Intrinsic<[],[llvm_anyptr_ty],
75 def int_xcore_settw : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
77 def int_xcore_setv : Intrinsic<[],[llvm_anyptr_ty, llvm_ptr_ty],
79 def int_xcore_setev : Intrinsic<[],[llvm_anyptr_ty, llvm_ptr_ty],
81 def int_xcore_eeu : Intrinsic<[],[llvm_anyptr_ty], [NoCapture<0>]>;
82 def int_xcore_edu : Intrinsic<[],[llvm_anyptr_ty], [NoCapture<0>]>;
83 def int_xcore_setclk : Intrinsic<[],[llvm_anyptr_ty, llvm_anyptr_ty],
84 [NoCapture<0>, NoCapture<1>]>;
85 def int_xcore_setrdy : Intrinsic<[],[llvm_anyptr_ty, llvm_anyptr_ty],
86 [NoCapture<0>, NoCapture<1>]>;
87 def int_xcore_setpsc : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
89 def int_xcore_peek : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
91 def int_xcore_endin : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
94 // Intrinsics for events.
95 def int_xcore_waitevent : Intrinsic<[llvm_ptr_ty],[], [IntrReadMem]>;
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]>;
102 def int_xcore_clre : Intrinsic<[],[],[]>;
104 // Intrinsics for threads.
105 def int_xcore_getst : Intrinsic <[llvm_anyptr_ty],[llvm_anyptr_ty],
107 def int_xcore_msync : Intrinsic <[],[llvm_anyptr_ty], [NoCapture<0>]>;
108 def int_xcore_ssync : Intrinsic <[],[]>;
109 def int_xcore_mjoin : Intrinsic <[],[llvm_anyptr_ty], [NoCapture<0>]>;
110 def int_xcore_initsp : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
112 def int_xcore_initpc : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
114 def int_xcore_initlr : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
116 def int_xcore_initcp : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
118 def int_xcore_initdp : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],