IntrinsicsXCore.td 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. //==- IntrinsicsXCore.td - XCore intrinsics -*- tablegen -*-==//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This file defines all of the XCore-specific intrinsics.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. let TargetPrefix = "xcore" in { // All intrinsics start with "llvm.xcore.".
  13. // Miscellaneous instructions.
  14. def int_xcore_bitrev : Intrinsic<[llvm_i32_ty],[llvm_i32_ty],[IntrNoMem]>,
  15. ClangBuiltin<"__builtin_bitrev">;
  16. def int_xcore_crc8 : Intrinsic<[llvm_i32_ty, llvm_i32_ty],
  17. [llvm_i32_ty,llvm_i32_ty,llvm_i32_ty],
  18. [IntrNoMem]>;
  19. def int_xcore_crc32 : Intrinsic<[llvm_i32_ty],
  20. [llvm_i32_ty,llvm_i32_ty,llvm_i32_ty],
  21. [IntrNoMem]>;
  22. def int_xcore_sext : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
  23. [IntrNoMem]>;
  24. def int_xcore_zext : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
  25. [IntrNoMem]>;
  26. def int_xcore_getid : Intrinsic<[llvm_i32_ty],[],[IntrNoMem]>,
  27. ClangBuiltin<"__builtin_getid">;
  28. def int_xcore_getps : Intrinsic<[llvm_i32_ty],[llvm_i32_ty]>,
  29. ClangBuiltin<"__builtin_getps">;
  30. def int_xcore_setps : Intrinsic<[],[llvm_i32_ty, llvm_i32_ty]>,
  31. ClangBuiltin<"__builtin_setps">;
  32. def int_xcore_geted : Intrinsic<[llvm_i32_ty],[]>;
  33. def int_xcore_getet : Intrinsic<[llvm_i32_ty],[]>;
  34. def int_xcore_setsr : Intrinsic<[],[llvm_i32_ty]>;
  35. def int_xcore_clrsr : Intrinsic<[],[llvm_i32_ty]>;
  36. // Resource instructions.
  37. def int_xcore_getr : Intrinsic<[llvm_anyptr_ty],[llvm_i32_ty]>;
  38. def int_xcore_freer : Intrinsic<[],[llvm_anyptr_ty],
  39. [NoCapture<ArgIndex<0>>]>;
  40. def int_xcore_in : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],[NoCapture<ArgIndex<0>>]>;
  41. def int_xcore_int : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
  42. [NoCapture<ArgIndex<0>>]>;
  43. def int_xcore_inct : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
  44. [NoCapture<ArgIndex<0>>]>;
  45. def int_xcore_out : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
  46. [NoCapture<ArgIndex<0>>]>;
  47. def int_xcore_outt : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
  48. [NoCapture<ArgIndex<0>>]>;
  49. def int_xcore_outct : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
  50. [NoCapture<ArgIndex<0>>]>;
  51. def int_xcore_chkct : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
  52. [NoCapture<ArgIndex<0>>]>;
  53. def int_xcore_testct : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
  54. [NoCapture<ArgIndex<0>>]>;
  55. def int_xcore_testwct : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
  56. [NoCapture<ArgIndex<0>>]>;
  57. def int_xcore_setd : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
  58. [NoCapture<ArgIndex<0>>]>;
  59. def int_xcore_setc : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
  60. [NoCapture<ArgIndex<0>>]>;
  61. def int_xcore_inshr : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty, llvm_i32_ty],
  62. [NoCapture<ArgIndex<0>>]>;
  63. def int_xcore_outshr : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty, llvm_i32_ty],
  64. [NoCapture<ArgIndex<0>>]>;
  65. def int_xcore_setpt : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
  66. [NoCapture<ArgIndex<0>>]>;
  67. def int_xcore_clrpt : Intrinsic<[],[llvm_anyptr_ty],
  68. [NoCapture<ArgIndex<0>>]>;
  69. def int_xcore_getts : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
  70. [NoCapture<ArgIndex<0>>]>;
  71. def int_xcore_syncr : Intrinsic<[],[llvm_anyptr_ty],
  72. [NoCapture<ArgIndex<0>>]>;
  73. def int_xcore_settw : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
  74. [NoCapture<ArgIndex<0>>]>;
  75. def int_xcore_setv : Intrinsic<[],[llvm_anyptr_ty, llvm_ptr_ty],
  76. [NoCapture<ArgIndex<0>>]>;
  77. def int_xcore_setev : Intrinsic<[],[llvm_anyptr_ty, llvm_ptr_ty],
  78. [NoCapture<ArgIndex<0>>]>;
  79. def int_xcore_eeu : Intrinsic<[],[llvm_anyptr_ty], [NoCapture<ArgIndex<0>>]>;
  80. def int_xcore_edu : Intrinsic<[],[llvm_anyptr_ty], [NoCapture<ArgIndex<0>>]>;
  81. def int_xcore_setclk : Intrinsic<[],[llvm_anyptr_ty, llvm_anyptr_ty],
  82. [NoCapture<ArgIndex<0>>, NoCapture<ArgIndex<1>>]>;
  83. def int_xcore_setrdy : Intrinsic<[],[llvm_anyptr_ty, llvm_anyptr_ty],
  84. [NoCapture<ArgIndex<0>>, NoCapture<ArgIndex<1>>]>;
  85. def int_xcore_setpsc : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
  86. [NoCapture<ArgIndex<0>>]>;
  87. def int_xcore_peek : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
  88. [NoCapture<ArgIndex<0>>]>;
  89. def int_xcore_endin : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty],
  90. [NoCapture<ArgIndex<0>>]>;
  91. // Intrinsics for events.
  92. def int_xcore_waitevent : Intrinsic<[llvm_ptr_ty],[], [IntrReadMem]>;
  93. // If any of the resources owned by the thread are ready this returns the
  94. // vector of one of the ready resources. If no resources owned by the thread
  95. // are ready then the operand passed to the intrinsic is returned.
  96. def int_xcore_checkevent : Intrinsic<[llvm_ptr_ty],[llvm_ptr_ty]>;
  97. def int_xcore_clre : Intrinsic<[],[],[]>;
  98. // Intrinsics for threads.
  99. def int_xcore_getst : Intrinsic <[llvm_anyptr_ty],[llvm_anyptr_ty],
  100. [NoCapture<ArgIndex<0>>]>;
  101. def int_xcore_msync : Intrinsic <[],[llvm_anyptr_ty], [NoCapture<ArgIndex<0>>]>;
  102. def int_xcore_ssync : Intrinsic <[],[]>;
  103. def int_xcore_mjoin : Intrinsic <[],[llvm_anyptr_ty], [NoCapture<ArgIndex<0>>]>;
  104. def int_xcore_initsp : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
  105. [NoCapture<ArgIndex<0>>]>;
  106. def int_xcore_initpc : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
  107. [NoCapture<ArgIndex<0>>]>;
  108. def int_xcore_initlr : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
  109. [NoCapture<ArgIndex<0>>]>;
  110. def int_xcore_initcp : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
  111. [NoCapture<ArgIndex<0>>]>;
  112. def int_xcore_initdp : Intrinsic <[],[llvm_anyptr_ty, llvm_ptr_ty],
  113. [NoCapture<ArgIndex<0>>]>;
  114. }