Add XCore intrinsic for crc32.
[oota-llvm.git] / include / llvm / IntrinsicsXCore.td
1 //==- IntrinsicsXCore.td - XCore intrinsics                 -*- tablegen -*-==//
2 // 
3 // Copyright (C) 2008 XMOS
4 //
5 //===----------------------------------------------------------------------===//
6 //
7 // This file defines all of the XCore-specific intrinsics.
8 //
9 //===----------------------------------------------------------------------===//
10
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_crc32 : Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_i32_ty,llvm_i32_ty],[IntrNoMem]>;
15   def int_xcore_getid : Intrinsic<[llvm_i32_ty],[],[IntrNoMem]>;
16   def int_xcore_getps : Intrinsic<[llvm_i32_ty],[llvm_i32_ty]>;
17   def int_xcore_setps : Intrinsic<[],[llvm_i32_ty, llvm_i32_ty]>;
18   def int_xcore_setsr : Intrinsic<[],[llvm_i32_ty]>;
19   def int_xcore_clrsr : Intrinsic<[],[llvm_i32_ty]>;
20
21   // Resource instructions.
22   def int_xcore_getr : Intrinsic<[llvm_anyptr_ty],[llvm_i32_ty]>;
23   def int_xcore_freer : Intrinsic<[],[llvm_anyptr_ty],
24                                    [NoCapture<0>]>;
25   def int_xcore_in : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],[NoCapture<0>]>;
26   def int_xcore_int : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
27                                 [NoCapture<0>]>;
28   def int_xcore_inct : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
29                                  [NoCapture<0>]>;
30   def int_xcore_out : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
31                                 [NoCapture<0>]>;
32   def int_xcore_outt : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
33                                  [NoCapture<0>]>;
34   def int_xcore_outct : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
35                                   [NoCapture<0>]>;
36   def int_xcore_chkct : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
37                                   [NoCapture<0>]>;
38   def int_xcore_setd : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
39                                   [NoCapture<0>]>;
40   def int_xcore_setc : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
41                                   [NoCapture<0>]>;
42   def int_xcore_inshr : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty, llvm_i32_ty],
43                                   [NoCapture<0>]>;
44   def int_xcore_outshr : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty, llvm_i32_ty],
45                                   [NoCapture<0>]>;
46   def int_xcore_setpt : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
47                                   [NoCapture<0>]>;
48   def int_xcore_getts : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
49                                   [NoCapture<0>]>;
50   def int_xcore_syncr : Intrinsic<[],[llvm_anyptr_ty],
51                                   [NoCapture<0>]>;
52   def int_xcore_settw : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
53                                   [NoCapture<0>]>;
54   def int_xcore_setv : Intrinsic<[],[llvm_anyptr_ty, llvm_ptr_ty],
55                                  [NoCapture<0>]>;
56   def int_xcore_eeu : Intrinsic<[],[llvm_anyptr_ty], [NoCapture<0>]>;
57   def int_xcore_setclk : Intrinsic<[],[llvm_anyptr_ty, llvm_anyptr_ty],
58                                    [NoCapture<0>, NoCapture<1>]>;
59   def int_xcore_setrdy : Intrinsic<[],[llvm_anyptr_ty, llvm_anyptr_ty],
60                                    [NoCapture<0>, NoCapture<1>]>;
61   def int_xcore_setpsc : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
62                                    [NoCapture<0>]>;
63
64   // Intrinsics for events.
65   def int_xcore_waitevent : Intrinsic<[llvm_ptr_ty],[], [IntrReadMem]>;
66
67   // If any of the resources owned by the thread are ready this returns the
68   // vector of one of the ready resources. If no resources owned by the thread
69   // are ready then the operand passed to the intrinsic is returned.
70   def int_xcore_checkevent : Intrinsic<[llvm_ptr_ty],[llvm_ptr_ty]>;
71
72   def int_xcore_clre : Intrinsic<[],[],[]>;
73
74   // Intrinsics for threads.
75   def int_xcore_getst : Intrinsic <[llvm_anyptr_ty],[llvm_anyptr_ty],
76                                    [NoCapture<0>]>;
77   def int_xcore_msync : Intrinsic <[],[llvm_anyptr_ty], [NoCapture<0>]>;
78   def int_xcore_ssync : Intrinsic <[],[]>;
79   def int_xcore_mjoin : Intrinsic <[],[llvm_anyptr_ty], [NoCapture<0>]>;
80   def int_xcore_initsp : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
81                                     [NoCapture<0>]>;
82   def int_xcore_initpc : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
83                                     [NoCapture<0>]>;
84   def int_xcore_initlr : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
85                                     [NoCapture<0>]>;
86   def int_xcore_initcp : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
87                                     [NoCapture<0>]>;
88   def int_xcore_initdp : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
89                                     [NoCapture<0>]>;
90 }