1249259Sdim//==- IntrinsicsXCore.td - XCore intrinsics -*- tablegen -*-==// 2249259Sdim// 3249259Sdim// The LLVM Compiler Infrastructure 4249259Sdim// 5249259Sdim// This file is distributed under the University of Illinois Open Source 6249259Sdim// License. See LICENSE.TXT for details. 7249259Sdim// 8249259Sdim//===----------------------------------------------------------------------===// 9249259Sdim// 10249259Sdim// This file defines all of the XCore-specific intrinsics. 11249259Sdim// 12249259Sdim//===----------------------------------------------------------------------===// 13249259Sdim 14249259Sdimlet TargetPrefix = "xcore" in { // All intrinsics start with "llvm.xcore.". 15249259Sdim // Miscellaneous instructions. 16261991Sdim def int_xcore_bitrev : Intrinsic<[llvm_i32_ty],[llvm_i32_ty],[IntrNoMem]>, 17261991Sdim GCCBuiltin<"__builtin_bitrev">; 18249259Sdim def int_xcore_crc8 : Intrinsic<[llvm_i32_ty, llvm_i32_ty], 19249259Sdim [llvm_i32_ty,llvm_i32_ty,llvm_i32_ty], 20249259Sdim [IntrNoMem]>; 21249259Sdim def int_xcore_crc32 : Intrinsic<[llvm_i32_ty], 22249259Sdim [llvm_i32_ty,llvm_i32_ty,llvm_i32_ty], 23249259Sdim [IntrNoMem]>; 24249259Sdim def int_xcore_sext : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], 25249259Sdim [IntrNoMem]>; 26249259Sdim def int_xcore_zext : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], 27249259Sdim [IntrNoMem]>; 28261991Sdim def int_xcore_getid : Intrinsic<[llvm_i32_ty],[],[IntrNoMem]>, 29261991Sdim GCCBuiltin<"__builtin_getid">; 30261991Sdim def int_xcore_getps : Intrinsic<[llvm_i32_ty],[llvm_i32_ty]>, 31261991Sdim GCCBuiltin<"__builtin_getps">; 32261991Sdim def int_xcore_setps : Intrinsic<[],[llvm_i32_ty, llvm_i32_ty]>, 33261991Sdim GCCBuiltin<"__builtin_setps">; 34249259Sdim def int_xcore_geted : Intrinsic<[llvm_i32_ty],[]>; 35249259Sdim def int_xcore_getet : Intrinsic<[llvm_i32_ty],[]>; 36249259Sdim def int_xcore_setsr : Intrinsic<[],[llvm_i32_ty]>; 37249259Sdim def int_xcore_clrsr : Intrinsic<[],[llvm_i32_ty]>; 38249259Sdim 39249259Sdim // Resource instructions. 40249259Sdim def int_xcore_getr : Intrinsic<[llvm_anyptr_ty],[llvm_i32_ty]>; 41249259Sdim def int_xcore_freer : Intrinsic<[],[llvm_anyptr_ty], 42249259Sdim [NoCapture<0>]>; 43249259Sdim def int_xcore_in : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],[NoCapture<0>]>; 44249259Sdim def int_xcore_int : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty], 45249259Sdim [NoCapture<0>]>; 46249259Sdim def int_xcore_inct : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty], 47249259Sdim [NoCapture<0>]>; 48249259Sdim def int_xcore_out : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], 49249259Sdim [NoCapture<0>]>; 50249259Sdim def int_xcore_outt : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], 51249259Sdim [NoCapture<0>]>; 52249259Sdim def int_xcore_outct : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], 53249259Sdim [NoCapture<0>]>; 54249259Sdim def int_xcore_chkct : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], 55249259Sdim [NoCapture<0>]>; 56249259Sdim def int_xcore_testct : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty], 57249259Sdim [NoCapture<0>]>; 58249259Sdim def int_xcore_testwct : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty], 59249259Sdim [NoCapture<0>]>; 60249259Sdim def int_xcore_setd : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], 61249259Sdim [NoCapture<0>]>; 62249259Sdim def int_xcore_setc : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], 63249259Sdim [NoCapture<0>]>; 64249259Sdim def int_xcore_inshr : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty, llvm_i32_ty], 65249259Sdim [NoCapture<0>]>; 66249259Sdim def int_xcore_outshr : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty, llvm_i32_ty], 67249259Sdim [NoCapture<0>]>; 68249259Sdim def int_xcore_setpt : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], 69249259Sdim [NoCapture<0>]>; 70276479Sdim def int_xcore_clrpt : Intrinsic<[],[llvm_anyptr_ty], 71276479Sdim [NoCapture<0>]>; 72249259Sdim def int_xcore_getts : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty], 73249259Sdim [NoCapture<0>]>; 74249259Sdim def int_xcore_syncr : Intrinsic<[],[llvm_anyptr_ty], 75249259Sdim [NoCapture<0>]>; 76249259Sdim def int_xcore_settw : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], 77249259Sdim [NoCapture<0>]>; 78249259Sdim def int_xcore_setv : Intrinsic<[],[llvm_anyptr_ty, llvm_ptr_ty], 79249259Sdim [NoCapture<0>]>; 80249259Sdim def int_xcore_setev : Intrinsic<[],[llvm_anyptr_ty, llvm_ptr_ty], 81249259Sdim [NoCapture<0>]>; 82249259Sdim def int_xcore_eeu : Intrinsic<[],[llvm_anyptr_ty], [NoCapture<0>]>; 83276479Sdim def int_xcore_edu : Intrinsic<[],[llvm_anyptr_ty], [NoCapture<0>]>; 84249259Sdim def int_xcore_setclk : Intrinsic<[],[llvm_anyptr_ty, llvm_anyptr_ty], 85249259Sdim [NoCapture<0>, NoCapture<1>]>; 86249259Sdim def int_xcore_setrdy : Intrinsic<[],[llvm_anyptr_ty, llvm_anyptr_ty], 87249259Sdim [NoCapture<0>, NoCapture<1>]>; 88249259Sdim def int_xcore_setpsc : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], 89249259Sdim [NoCapture<0>]>; 90249259Sdim def int_xcore_peek : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty], 91249259Sdim [NoCapture<0>]>; 92249259Sdim def int_xcore_endin : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty], 93249259Sdim [NoCapture<0>]>; 94249259Sdim 95249259Sdim // Intrinsics for events. 96249259Sdim def int_xcore_waitevent : Intrinsic<[llvm_ptr_ty],[], [IntrReadMem]>; 97249259Sdim 98249259Sdim // If any of the resources owned by the thread are ready this returns the 99249259Sdim // vector of one of the ready resources. If no resources owned by the thread 100249259Sdim // are ready then the operand passed to the intrinsic is returned. 101249259Sdim def int_xcore_checkevent : Intrinsic<[llvm_ptr_ty],[llvm_ptr_ty]>; 102249259Sdim 103249259Sdim def int_xcore_clre : Intrinsic<[],[],[]>; 104249259Sdim 105249259Sdim // Intrinsics for threads. 106249259Sdim def int_xcore_getst : Intrinsic <[llvm_anyptr_ty],[llvm_anyptr_ty], 107249259Sdim [NoCapture<0>]>; 108249259Sdim def int_xcore_msync : Intrinsic <[],[llvm_anyptr_ty], [NoCapture<0>]>; 109249259Sdim def int_xcore_ssync : Intrinsic <[],[]>; 110249259Sdim def int_xcore_mjoin : Intrinsic <[],[llvm_anyptr_ty], [NoCapture<0>]>; 111249259Sdim def int_xcore_initsp : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty], 112249259Sdim [NoCapture<0>]>; 113249259Sdim def int_xcore_initpc : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty], 114249259Sdim [NoCapture<0>]>; 115249259Sdim def int_xcore_initlr : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty], 116249259Sdim [NoCapture<0>]>; 117249259Sdim def int_xcore_initcp : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty], 118249259Sdim [NoCapture<0>]>; 119249259Sdim def int_xcore_initdp : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty], 120249259Sdim [NoCapture<0>]>; 121249259Sdim} 122