1//==- IntrinsicsXCore.td - XCore 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 XCore-specific intrinsics. 11// 12//===----------------------------------------------------------------------===// 13 14let TargetPrefix = "xcore" in { // All intrinsics start with "llvm.xcore.". 15 // Miscellaneous instructions. 16 def int_xcore_bitrev : Intrinsic<[llvm_i32_ty],[llvm_i32_ty],[IntrNoMem]>; 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 def int_xcore_getps : Intrinsic<[llvm_i32_ty],[llvm_i32_ty]>; 29 def int_xcore_setps : Intrinsic<[],[llvm_i32_ty, llvm_i32_ty]>; 30 def int_xcore_geted : Intrinsic<[llvm_i32_ty],[]>; 31 def int_xcore_getet : Intrinsic<[llvm_i32_ty],[]>; 32 def int_xcore_setsr : Intrinsic<[],[llvm_i32_ty]>; 33 def int_xcore_clrsr : Intrinsic<[],[llvm_i32_ty]>; 34 35 // Resource instructions. 36 def int_xcore_getr : Intrinsic<[llvm_anyptr_ty],[llvm_i32_ty]>; 37 def int_xcore_freer : Intrinsic<[],[llvm_anyptr_ty], 38 [NoCapture<0>]>; 39 def int_xcore_in : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],[NoCapture<0>]>; 40 def int_xcore_int : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty], 41 [NoCapture<0>]>; 42 def int_xcore_inct : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty], 43 [NoCapture<0>]>; 44 def int_xcore_out : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], 45 [NoCapture<0>]>; 46 def int_xcore_outt : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], 47 [NoCapture<0>]>; 48 def int_xcore_outct : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], 49 [NoCapture<0>]>; 50 def int_xcore_chkct : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], 51 [NoCapture<0>]>; 52 def int_xcore_testct : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty], 53 [NoCapture<0>]>; 54 def int_xcore_testwct : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty], 55 [NoCapture<0>]>; 56 def int_xcore_setd : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], 57 [NoCapture<0>]>; 58 def int_xcore_setc : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], 59 [NoCapture<0>]>; 60 def int_xcore_inshr : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty, llvm_i32_ty], 61 [NoCapture<0>]>; 62 def int_xcore_outshr : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty, llvm_i32_ty], 63 [NoCapture<0>]>; 64 def int_xcore_setpt : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], 65 [NoCapture<0>]>; 66 def int_xcore_getts : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty], 67 [NoCapture<0>]>; 68 def int_xcore_syncr : Intrinsic<[],[llvm_anyptr_ty], 69 [NoCapture<0>]>; 70 def int_xcore_settw : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], 71 [NoCapture<0>]>; 72 def int_xcore_setv : Intrinsic<[],[llvm_anyptr_ty, llvm_ptr_ty], 73 [NoCapture<0>]>; 74 def int_xcore_setev : Intrinsic<[],[llvm_anyptr_ty, llvm_ptr_ty], 75 [NoCapture<0>]>; 76 def int_xcore_eeu : Intrinsic<[],[llvm_anyptr_ty], [NoCapture<0>]>; 77 def int_xcore_setclk : Intrinsic<[],[llvm_anyptr_ty, llvm_anyptr_ty], 78 [NoCapture<0>, NoCapture<1>]>; 79 def int_xcore_setrdy : Intrinsic<[],[llvm_anyptr_ty, llvm_anyptr_ty], 80 [NoCapture<0>, NoCapture<1>]>; 81 def int_xcore_setpsc : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], 82 [NoCapture<0>]>; 83 def int_xcore_peek : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty], 84 [NoCapture<0>]>; 85 def int_xcore_endin : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty], 86 [NoCapture<0>]>; 87 88 // Intrinsics for events. 89 def int_xcore_waitevent : Intrinsic<[llvm_ptr_ty],[], [IntrReadMem]>; 90 91 // If any of the resources owned by the thread are ready this returns the 92 // vector of one of the ready resources. If no resources owned by the thread 93 // are ready then the operand passed to the intrinsic is returned. 94 def int_xcore_checkevent : Intrinsic<[llvm_ptr_ty],[llvm_ptr_ty]>; 95 96 def int_xcore_clre : Intrinsic<[],[],[]>; 97 98 // Intrinsics for threads. 99 def int_xcore_getst : Intrinsic <[llvm_anyptr_ty],[llvm_anyptr_ty], 100 [NoCapture<0>]>; 101 def int_xcore_msync : Intrinsic <[],[llvm_anyptr_ty], [NoCapture<0>]>; 102 def int_xcore_ssync : Intrinsic <[],[]>; 103 def int_xcore_mjoin : Intrinsic <[],[llvm_anyptr_ty], [NoCapture<0>]>; 104 def int_xcore_initsp : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty], 105 [NoCapture<0>]>; 106 def int_xcore_initpc : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty], 107 [NoCapture<0>]>; 108 def int_xcore_initlr : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty], 109 [NoCapture<0>]>; 110 def int_xcore_initcp : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty], 111 [NoCapture<0>]>; 112 def int_xcore_initdp : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty], 113 [NoCapture<0>]>; 114} 115