IntrinsicsXCore.td 6.4 KB

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