1 //==- IntrinsicsXCore.td - XCore intrinsics -*- tablegen -*-==//
3 // Copyright (C) 2008 XMOS
5 //===----------------------------------------------------------------------===//
7 // This file defines all of the XCore-specific intrinsics.
9 //===----------------------------------------------------------------------===//
11 let TargetPrefix = "xcore" in { // All intrinsics start with "llvm.xcore.".
12 // Miscellaneous instructions.
13 def int_xcore_bitrev : Intrinsic<[llvm_i32_ty],[llvm_i32_ty],[IntrNoMem]>;
14 def int_xcore_crc8 : Intrinsic<[llvm_i32_ty, llvm_i32_ty],
15 [llvm_i32_ty,llvm_i32_ty,llvm_i32_ty],
17 def int_xcore_crc32 : Intrinsic<[llvm_i32_ty],
18 [llvm_i32_ty,llvm_i32_ty,llvm_i32_ty],
20 def int_xcore_getid : Intrinsic<[llvm_i32_ty],[],[IntrNoMem]>;
21 def int_xcore_getps : Intrinsic<[llvm_i32_ty],[llvm_i32_ty]>;
22 def int_xcore_setps : Intrinsic<[],[llvm_i32_ty, llvm_i32_ty]>;
23 def int_xcore_setsr : Intrinsic<[],[llvm_i32_ty]>;
24 def int_xcore_clrsr : Intrinsic<[],[llvm_i32_ty]>;
26 // Resource instructions.
27 def int_xcore_getr : Intrinsic<[llvm_anyptr_ty],[llvm_i32_ty]>;
28 def int_xcore_freer : Intrinsic<[],[llvm_anyptr_ty],
30 def int_xcore_in : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],[NoCapture<0>]>;
31 def int_xcore_int : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
33 def int_xcore_inct : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
35 def int_xcore_out : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
37 def int_xcore_outt : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
39 def int_xcore_outct : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
41 def int_xcore_chkct : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
43 def int_xcore_setd : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
45 def int_xcore_setc : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
47 def int_xcore_inshr : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty, llvm_i32_ty],
49 def int_xcore_outshr : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty, llvm_i32_ty],
51 def int_xcore_setpt : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
53 def int_xcore_getts : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
55 def int_xcore_syncr : Intrinsic<[],[llvm_anyptr_ty],
57 def int_xcore_settw : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
59 def int_xcore_setv : Intrinsic<[],[llvm_anyptr_ty, llvm_ptr_ty],
61 def int_xcore_eeu : Intrinsic<[],[llvm_anyptr_ty], [NoCapture<0>]>;
62 def int_xcore_setclk : Intrinsic<[],[llvm_anyptr_ty, llvm_anyptr_ty],
63 [NoCapture<0>, NoCapture<1>]>;
64 def int_xcore_setrdy : Intrinsic<[],[llvm_anyptr_ty, llvm_anyptr_ty],
65 [NoCapture<0>, NoCapture<1>]>;
66 def int_xcore_setpsc : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
69 // Intrinsics for events.
70 def int_xcore_waitevent : Intrinsic<[llvm_ptr_ty],[], [IntrReadMem]>;
72 // If any of the resources owned by the thread are ready this returns the
73 // vector of one of the ready resources. If no resources owned by the thread
74 // are ready then the operand passed to the intrinsic is returned.
75 def int_xcore_checkevent : Intrinsic<[llvm_ptr_ty],[llvm_ptr_ty]>;
77 def int_xcore_clre : Intrinsic<[],[],[]>;
79 // Intrinsics for threads.
80 def int_xcore_getst : Intrinsic <[llvm_anyptr_ty],[llvm_anyptr_ty],
82 def int_xcore_msync : Intrinsic <[],[llvm_anyptr_ty], [NoCapture<0>]>;
83 def int_xcore_ssync : Intrinsic <[],[]>;
84 def int_xcore_mjoin : Intrinsic <[],[llvm_anyptr_ty], [NoCapture<0>]>;
85 def int_xcore_initsp : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
87 def int_xcore_initpc : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
89 def int_xcore_initlr : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
91 def int_xcore_initcp : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
93 def int_xcore_initdp : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],