IntrinsicsSystemZ.td 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. //===- IntrinsicsSystemZ.td - Defines SystemZ 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 SystemZ-specific intrinsics.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. class SystemZUnaryConv<string name, LLVMType result, LLVMType arg>
  13. : ClangBuiltin<"__builtin_s390_" # name>,
  14. Intrinsic<[result], [arg], [IntrNoMem]>;
  15. class SystemZUnary<string name, LLVMType type>
  16. : SystemZUnaryConv<name, type, type>;
  17. class SystemZUnaryConvCC<LLVMType result, LLVMType arg>
  18. : Intrinsic<[result, llvm_i32_ty], [arg], [IntrNoMem]>;
  19. class SystemZUnaryCC<LLVMType type>
  20. : SystemZUnaryConvCC<type, type>;
  21. class SystemZBinaryConv<string name, LLVMType result, LLVMType arg>
  22. : ClangBuiltin<"__builtin_s390_" # name>,
  23. Intrinsic<[result], [arg, arg], [IntrNoMem]>;
  24. class SystemZBinary<string name, LLVMType type>
  25. : SystemZBinaryConv<name, type, type>;
  26. class SystemZBinaryInt<string name, LLVMType type>
  27. : ClangBuiltin<"__builtin_s390_" # name>,
  28. Intrinsic<[type], [type, llvm_i32_ty], [IntrNoMem]>;
  29. class SystemZBinaryConvCC<LLVMType result, LLVMType arg>
  30. : Intrinsic<[result, llvm_i32_ty], [arg, arg], [IntrNoMem]>;
  31. class SystemZBinaryConvIntCC<LLVMType result, LLVMType arg>
  32. : Intrinsic<[result, llvm_i32_ty], [arg, llvm_i32_ty],
  33. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  34. class SystemZBinaryCC<LLVMType type>
  35. : SystemZBinaryConvCC<type, type>;
  36. class SystemZTernaryConv<string name, LLVMType result, LLVMType arg>
  37. : ClangBuiltin<"__builtin_s390_" # name>,
  38. Intrinsic<[result], [arg, arg, result], [IntrNoMem]>;
  39. class SystemZTernaryConvCC<LLVMType result, LLVMType arg>
  40. : Intrinsic<[result, llvm_i32_ty], [arg, arg, result], [IntrNoMem]>;
  41. class SystemZTernary<string name, LLVMType type>
  42. : SystemZTernaryConv<name, type, type>;
  43. class SystemZTernaryInt<string name, LLVMType type>
  44. : ClangBuiltin<"__builtin_s390_" # name>,
  45. Intrinsic<[type], [type, type, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  46. class SystemZTernaryIntCC<LLVMType type>
  47. : Intrinsic<[type, llvm_i32_ty], [type, type, llvm_i32_ty],
  48. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  49. class SystemZQuaternaryInt<string name, LLVMType type>
  50. : ClangBuiltin<"__builtin_s390_" # name>,
  51. Intrinsic<[type], [type, type, type, llvm_i32_ty],
  52. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  53. class SystemZQuaternaryIntCC<LLVMType type>
  54. : Intrinsic<[type, llvm_i32_ty], [type, type, type, llvm_i32_ty],
  55. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  56. multiclass SystemZUnaryExtBHF<string name> {
  57. def b : SystemZUnaryConv<name#"b", llvm_v8i16_ty, llvm_v16i8_ty>;
  58. def h : SystemZUnaryConv<name#"h", llvm_v4i32_ty, llvm_v8i16_ty>;
  59. def f : SystemZUnaryConv<name#"f", llvm_v2i64_ty, llvm_v4i32_ty>;
  60. }
  61. multiclass SystemZUnaryExtBHWF<string name> {
  62. def b : SystemZUnaryConv<name#"b", llvm_v8i16_ty, llvm_v16i8_ty>;
  63. def hw : SystemZUnaryConv<name#"hw", llvm_v4i32_ty, llvm_v8i16_ty>;
  64. def f : SystemZUnaryConv<name#"f", llvm_v2i64_ty, llvm_v4i32_ty>;
  65. }
  66. multiclass SystemZUnaryBHF<string name> {
  67. def b : SystemZUnary<name#"b", llvm_v16i8_ty>;
  68. def h : SystemZUnary<name#"h", llvm_v8i16_ty>;
  69. def f : SystemZUnary<name#"f", llvm_v4i32_ty>;
  70. }
  71. multiclass SystemZUnaryBHFG<string name> : SystemZUnaryBHF<name> {
  72. def g : SystemZUnary<name#"g", llvm_v2i64_ty>;
  73. }
  74. multiclass SystemZUnaryCCBHF {
  75. def bs : SystemZUnaryCC<llvm_v16i8_ty>;
  76. def hs : SystemZUnaryCC<llvm_v8i16_ty>;
  77. def fs : SystemZUnaryCC<llvm_v4i32_ty>;
  78. }
  79. multiclass SystemZBinaryTruncHFG<string name> {
  80. def h : SystemZBinaryConv<name#"h", llvm_v16i8_ty, llvm_v8i16_ty>;
  81. def f : SystemZBinaryConv<name#"f", llvm_v8i16_ty, llvm_v4i32_ty>;
  82. def g : SystemZBinaryConv<name#"g", llvm_v4i32_ty, llvm_v2i64_ty>;
  83. }
  84. multiclass SystemZBinaryTruncCCHFG {
  85. def hs : SystemZBinaryConvCC<llvm_v16i8_ty, llvm_v8i16_ty>;
  86. def fs : SystemZBinaryConvCC<llvm_v8i16_ty, llvm_v4i32_ty>;
  87. def gs : SystemZBinaryConvCC<llvm_v4i32_ty, llvm_v2i64_ty>;
  88. }
  89. multiclass SystemZBinaryExtBHF<string name> {
  90. def b : SystemZBinaryConv<name#"b", llvm_v8i16_ty, llvm_v16i8_ty>;
  91. def h : SystemZBinaryConv<name#"h", llvm_v4i32_ty, llvm_v8i16_ty>;
  92. def f : SystemZBinaryConv<name#"f", llvm_v2i64_ty, llvm_v4i32_ty>;
  93. }
  94. multiclass SystemZBinaryExtBHFG<string name> : SystemZBinaryExtBHF<name> {
  95. def g : SystemZBinaryConv<name#"g", llvm_v16i8_ty, llvm_v2i64_ty>;
  96. }
  97. multiclass SystemZBinaryBHF<string name> {
  98. def b : SystemZBinary<name#"b", llvm_v16i8_ty>;
  99. def h : SystemZBinary<name#"h", llvm_v8i16_ty>;
  100. def f : SystemZBinary<name#"f", llvm_v4i32_ty>;
  101. }
  102. multiclass SystemZBinaryBHFG<string name> : SystemZBinaryBHF<name> {
  103. def g : SystemZBinary<name#"g", llvm_v2i64_ty>;
  104. }
  105. multiclass SystemZBinaryIntBHFG<string name> {
  106. def b : SystemZBinaryInt<name#"b", llvm_v16i8_ty>;
  107. def h : SystemZBinaryInt<name#"h", llvm_v8i16_ty>;
  108. def f : SystemZBinaryInt<name#"f", llvm_v4i32_ty>;
  109. def g : SystemZBinaryInt<name#"g", llvm_v2i64_ty>;
  110. }
  111. multiclass SystemZBinaryCCBHF {
  112. def bs : SystemZBinaryCC<llvm_v16i8_ty>;
  113. def hs : SystemZBinaryCC<llvm_v8i16_ty>;
  114. def fs : SystemZBinaryCC<llvm_v4i32_ty>;
  115. }
  116. multiclass SystemZCompareBHFG {
  117. def bs : SystemZBinaryCC<llvm_v16i8_ty>;
  118. def hs : SystemZBinaryCC<llvm_v8i16_ty>;
  119. def fs : SystemZBinaryCC<llvm_v4i32_ty>;
  120. def gs : SystemZBinaryCC<llvm_v2i64_ty>;
  121. }
  122. multiclass SystemZTernaryExtBHF<string name> {
  123. def b : SystemZTernaryConv<name#"b", llvm_v8i16_ty, llvm_v16i8_ty>;
  124. def h : SystemZTernaryConv<name#"h", llvm_v4i32_ty, llvm_v8i16_ty>;
  125. def f : SystemZTernaryConv<name#"f", llvm_v2i64_ty, llvm_v4i32_ty>;
  126. }
  127. multiclass SystemZTernaryExtBHFG<string name> : SystemZTernaryExtBHF<name> {
  128. def g : SystemZTernaryConv<name#"g", llvm_v16i8_ty, llvm_v2i64_ty>;
  129. }
  130. multiclass SystemZTernaryBHF<string name> {
  131. def b : SystemZTernary<name#"b", llvm_v16i8_ty>;
  132. def h : SystemZTernary<name#"h", llvm_v8i16_ty>;
  133. def f : SystemZTernary<name#"f", llvm_v4i32_ty>;
  134. }
  135. multiclass SystemZTernaryIntBHF<string name> {
  136. def b : SystemZTernaryInt<name#"b", llvm_v16i8_ty>;
  137. def h : SystemZTernaryInt<name#"h", llvm_v8i16_ty>;
  138. def f : SystemZTernaryInt<name#"f", llvm_v4i32_ty>;
  139. }
  140. multiclass SystemZTernaryIntCCBHF {
  141. def bs : SystemZTernaryIntCC<llvm_v16i8_ty>;
  142. def hs : SystemZTernaryIntCC<llvm_v8i16_ty>;
  143. def fs : SystemZTernaryIntCC<llvm_v4i32_ty>;
  144. }
  145. multiclass SystemZQuaternaryIntBHF<string name> {
  146. def b : SystemZQuaternaryInt<name#"b", llvm_v16i8_ty>;
  147. def h : SystemZQuaternaryInt<name#"h", llvm_v8i16_ty>;
  148. def f : SystemZQuaternaryInt<name#"f", llvm_v4i32_ty>;
  149. }
  150. multiclass SystemZQuaternaryIntBHFG<string name> :
  151. SystemZQuaternaryIntBHF<name> {
  152. def g : SystemZQuaternaryInt<name#"g", llvm_v2i64_ty>;
  153. }
  154. multiclass SystemZQuaternaryIntCCBHF {
  155. def bs : SystemZQuaternaryIntCC<llvm_v16i8_ty>;
  156. def hs : SystemZQuaternaryIntCC<llvm_v8i16_ty>;
  157. def fs : SystemZQuaternaryIntCC<llvm_v4i32_ty>;
  158. }
  159. //===----------------------------------------------------------------------===//
  160. //
  161. // Transactional-execution intrinsics
  162. //
  163. //===----------------------------------------------------------------------===//
  164. let TargetPrefix = "s390" in {
  165. def int_s390_tbegin : Intrinsic<[llvm_i32_ty], [llvm_ptr_ty, llvm_i32_ty],
  166. [IntrNoDuplicate, IntrWriteMem]>;
  167. def int_s390_tbegin_nofloat : Intrinsic<[llvm_i32_ty],
  168. [llvm_ptr_ty, llvm_i32_ty],
  169. [IntrNoDuplicate, IntrWriteMem]>;
  170. def int_s390_tbeginc : Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty],
  171. [IntrNoDuplicate, IntrWriteMem]>;
  172. def int_s390_tabort : Intrinsic<[], [llvm_i64_ty],
  173. [IntrNoReturn, Throws, IntrWriteMem]>;
  174. def int_s390_tend : ClangBuiltin<"__builtin_tend">,
  175. Intrinsic<[llvm_i32_ty], []>;
  176. def int_s390_etnd : ClangBuiltin<"__builtin_tx_nesting_depth">,
  177. Intrinsic<[llvm_i32_ty], [], [IntrNoMem]>;
  178. def int_s390_ntstg : Intrinsic<[], [llvm_i64_ty, llvm_ptr64_ty],
  179. [IntrArgMemOnly, IntrWriteMem]>;
  180. def int_s390_ppa_txassist : ClangBuiltin<"__builtin_tx_assist">,
  181. Intrinsic<[], [llvm_i32_ty]>;
  182. }
  183. //===----------------------------------------------------------------------===//
  184. //
  185. // Vector intrinsics
  186. //
  187. //===----------------------------------------------------------------------===//
  188. let TargetPrefix = "s390" in {
  189. def int_s390_lcbb : ClangBuiltin<"__builtin_s390_lcbb">,
  190. Intrinsic<[llvm_i32_ty], [llvm_ptr_ty, llvm_i32_ty],
  191. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  192. def int_s390_vlbb : ClangBuiltin<"__builtin_s390_vlbb">,
  193. Intrinsic<[llvm_v16i8_ty], [llvm_ptr_ty, llvm_i32_ty],
  194. [IntrReadMem, IntrArgMemOnly, ImmArg<ArgIndex<1>>]>;
  195. def int_s390_vll : ClangBuiltin<"__builtin_s390_vll">,
  196. Intrinsic<[llvm_v16i8_ty], [llvm_i32_ty, llvm_ptr_ty],
  197. [IntrReadMem, IntrArgMemOnly]>;
  198. def int_s390_vpdi : ClangBuiltin<"__builtin_s390_vpdi">,
  199. Intrinsic<[llvm_v2i64_ty],
  200. [llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty],
  201. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  202. def int_s390_vperm : ClangBuiltin<"__builtin_s390_vperm">,
  203. Intrinsic<[llvm_v16i8_ty],
  204. [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
  205. [IntrNoMem]>;
  206. defm int_s390_vpks : SystemZBinaryTruncHFG<"vpks">;
  207. defm int_s390_vpks : SystemZBinaryTruncCCHFG;
  208. defm int_s390_vpkls : SystemZBinaryTruncHFG<"vpkls">;
  209. defm int_s390_vpkls : SystemZBinaryTruncCCHFG;
  210. def int_s390_vstl : ClangBuiltin<"__builtin_s390_vstl">,
  211. Intrinsic<[], [llvm_v16i8_ty, llvm_i32_ty, llvm_ptr_ty],
  212. [IntrArgMemOnly, IntrWriteMem]>;
  213. defm int_s390_vupl : SystemZUnaryExtBHWF<"vupl">;
  214. defm int_s390_vupll : SystemZUnaryExtBHF<"vupll">;
  215. defm int_s390_vuph : SystemZUnaryExtBHF<"vuph">;
  216. defm int_s390_vuplh : SystemZUnaryExtBHF<"vuplh">;
  217. defm int_s390_vacc : SystemZBinaryBHFG<"vacc">;
  218. def int_s390_vaq : SystemZBinary<"vaq", llvm_v16i8_ty>;
  219. def int_s390_vacq : SystemZTernary<"vacq", llvm_v16i8_ty>;
  220. def int_s390_vaccq : SystemZBinary<"vaccq", llvm_v16i8_ty>;
  221. def int_s390_vacccq : SystemZTernary<"vacccq", llvm_v16i8_ty>;
  222. defm int_s390_vavg : SystemZBinaryBHFG<"vavg">;
  223. defm int_s390_vavgl : SystemZBinaryBHFG<"vavgl">;
  224. def int_s390_vcksm : SystemZBinary<"vcksm", llvm_v4i32_ty>;
  225. defm int_s390_vgfm : SystemZBinaryExtBHFG<"vgfm">;
  226. defm int_s390_vgfma : SystemZTernaryExtBHFG<"vgfma">;
  227. defm int_s390_vmah : SystemZTernaryBHF<"vmah">;
  228. defm int_s390_vmalh : SystemZTernaryBHF<"vmalh">;
  229. defm int_s390_vmae : SystemZTernaryExtBHF<"vmae">;
  230. defm int_s390_vmale : SystemZTernaryExtBHF<"vmale">;
  231. defm int_s390_vmao : SystemZTernaryExtBHF<"vmao">;
  232. defm int_s390_vmalo : SystemZTernaryExtBHF<"vmalo">;
  233. defm int_s390_vmh : SystemZBinaryBHF<"vmh">;
  234. defm int_s390_vmlh : SystemZBinaryBHF<"vmlh">;
  235. defm int_s390_vme : SystemZBinaryExtBHF<"vme">;
  236. defm int_s390_vmle : SystemZBinaryExtBHF<"vmle">;
  237. defm int_s390_vmo : SystemZBinaryExtBHF<"vmo">;
  238. defm int_s390_vmlo : SystemZBinaryExtBHF<"vmlo">;
  239. defm int_s390_verllv : SystemZBinaryBHFG<"verllv">;
  240. defm int_s390_verll : SystemZBinaryIntBHFG<"verll">;
  241. defm int_s390_verim : SystemZQuaternaryIntBHFG<"verim">;
  242. def int_s390_vsl : SystemZBinary<"vsl", llvm_v16i8_ty>;
  243. def int_s390_vslb : SystemZBinary<"vslb", llvm_v16i8_ty>;
  244. def int_s390_vsra : SystemZBinary<"vsra", llvm_v16i8_ty>;
  245. def int_s390_vsrab : SystemZBinary<"vsrab", llvm_v16i8_ty>;
  246. def int_s390_vsrl : SystemZBinary<"vsrl", llvm_v16i8_ty>;
  247. def int_s390_vsrlb : SystemZBinary<"vsrlb", llvm_v16i8_ty>;
  248. def int_s390_vsldb : ClangBuiltin<"__builtin_s390_vsldb">,
  249. Intrinsic<[llvm_v16i8_ty],
  250. [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty],
  251. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  252. defm int_s390_vscbi : SystemZBinaryBHFG<"vscbi">;
  253. def int_s390_vsq : SystemZBinary<"vsq", llvm_v16i8_ty>;
  254. def int_s390_vsbiq : SystemZTernary<"vsbiq", llvm_v16i8_ty>;
  255. def int_s390_vscbiq : SystemZBinary<"vscbiq", llvm_v16i8_ty>;
  256. def int_s390_vsbcbiq : SystemZTernary<"vsbcbiq", llvm_v16i8_ty>;
  257. def int_s390_vsumb : SystemZBinaryConv<"vsumb", llvm_v4i32_ty, llvm_v16i8_ty>;
  258. def int_s390_vsumh : SystemZBinaryConv<"vsumh", llvm_v4i32_ty, llvm_v8i16_ty>;
  259. def int_s390_vsumgh : SystemZBinaryConv<"vsumgh", llvm_v2i64_ty,
  260. llvm_v8i16_ty>;
  261. def int_s390_vsumgf : SystemZBinaryConv<"vsumgf", llvm_v2i64_ty,
  262. llvm_v4i32_ty>;
  263. def int_s390_vsumqf : SystemZBinaryConv<"vsumqf", llvm_v16i8_ty,
  264. llvm_v4i32_ty>;
  265. def int_s390_vsumqg : SystemZBinaryConv<"vsumqg", llvm_v16i8_ty,
  266. llvm_v2i64_ty>;
  267. def int_s390_vtm : SystemZBinaryConv<"vtm", llvm_i32_ty, llvm_v16i8_ty>;
  268. defm int_s390_vceq : SystemZCompareBHFG;
  269. defm int_s390_vch : SystemZCompareBHFG;
  270. defm int_s390_vchl : SystemZCompareBHFG;
  271. defm int_s390_vfae : SystemZTernaryIntBHF<"vfae">;
  272. defm int_s390_vfae : SystemZTernaryIntCCBHF;
  273. defm int_s390_vfaez : SystemZTernaryIntBHF<"vfaez">;
  274. defm int_s390_vfaez : SystemZTernaryIntCCBHF;
  275. defm int_s390_vfee : SystemZBinaryBHF<"vfee">;
  276. defm int_s390_vfee : SystemZBinaryCCBHF;
  277. defm int_s390_vfeez : SystemZBinaryBHF<"vfeez">;
  278. defm int_s390_vfeez : SystemZBinaryCCBHF;
  279. defm int_s390_vfene : SystemZBinaryBHF<"vfene">;
  280. defm int_s390_vfene : SystemZBinaryCCBHF;
  281. defm int_s390_vfenez : SystemZBinaryBHF<"vfenez">;
  282. defm int_s390_vfenez : SystemZBinaryCCBHF;
  283. defm int_s390_vistr : SystemZUnaryBHF<"vistr">;
  284. defm int_s390_vistr : SystemZUnaryCCBHF;
  285. defm int_s390_vstrc : SystemZQuaternaryIntBHF<"vstrc">;
  286. defm int_s390_vstrc : SystemZQuaternaryIntCCBHF;
  287. defm int_s390_vstrcz : SystemZQuaternaryIntBHF<"vstrcz">;
  288. defm int_s390_vstrcz : SystemZQuaternaryIntCCBHF;
  289. def int_s390_vfcedbs : SystemZBinaryConvCC<llvm_v2i64_ty, llvm_v2f64_ty>;
  290. def int_s390_vfchdbs : SystemZBinaryConvCC<llvm_v2i64_ty, llvm_v2f64_ty>;
  291. def int_s390_vfchedbs : SystemZBinaryConvCC<llvm_v2i64_ty, llvm_v2f64_ty>;
  292. def int_s390_vftcidb : SystemZBinaryConvIntCC<llvm_v2i64_ty, llvm_v2f64_ty>;
  293. def int_s390_vfidb : Intrinsic<[llvm_v2f64_ty],
  294. [llvm_v2f64_ty, llvm_i32_ty, llvm_i32_ty],
  295. [IntrNoMem, ImmArg<ArgIndex<1>>, ImmArg<ArgIndex<2>>]>;
  296. // Instructions from the Vector Enhancements Facility 1
  297. def int_s390_vbperm : SystemZBinaryConv<"vbperm", llvm_v2i64_ty,
  298. llvm_v16i8_ty>;
  299. def int_s390_vmslg : ClangBuiltin<"__builtin_s390_vmslg">,
  300. Intrinsic<[llvm_v16i8_ty],
  301. [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v16i8_ty,
  302. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  303. def int_s390_vfmaxdb : Intrinsic<[llvm_v2f64_ty],
  304. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_i32_ty],
  305. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  306. def int_s390_vfmindb : Intrinsic<[llvm_v2f64_ty],
  307. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_i32_ty],
  308. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  309. def int_s390_vfmaxsb : Intrinsic<[llvm_v4f32_ty],
  310. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i32_ty],
  311. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  312. def int_s390_vfminsb : Intrinsic<[llvm_v4f32_ty],
  313. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i32_ty],
  314. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  315. def int_s390_vfcesbs : SystemZBinaryConvCC<llvm_v4i32_ty, llvm_v4f32_ty>;
  316. def int_s390_vfchsbs : SystemZBinaryConvCC<llvm_v4i32_ty, llvm_v4f32_ty>;
  317. def int_s390_vfchesbs : SystemZBinaryConvCC<llvm_v4i32_ty, llvm_v4f32_ty>;
  318. def int_s390_vftcisb : SystemZBinaryConvIntCC<llvm_v4i32_ty, llvm_v4f32_ty>;
  319. def int_s390_vfisb : Intrinsic<[llvm_v4f32_ty],
  320. [llvm_v4f32_ty, llvm_i32_ty, llvm_i32_ty],
  321. [IntrNoMem, ImmArg<ArgIndex<1>>, ImmArg<ArgIndex<2>>]>;
  322. // Instructions from the Vector Packed Decimal Facility
  323. def int_s390_vlrl : ClangBuiltin<"__builtin_s390_vlrl">,
  324. Intrinsic<[llvm_v16i8_ty], [llvm_i32_ty, llvm_ptr_ty],
  325. [IntrReadMem, IntrArgMemOnly]>;
  326. def int_s390_vstrl : ClangBuiltin<"__builtin_s390_vstrl">,
  327. Intrinsic<[], [llvm_v16i8_ty, llvm_i32_ty, llvm_ptr_ty],
  328. [IntrArgMemOnly, IntrWriteMem]>;
  329. // Instructions from the Vector Enhancements Facility 2
  330. def int_s390_vsld : ClangBuiltin<"__builtin_s390_vsld">,
  331. Intrinsic<[llvm_v16i8_ty],
  332. [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty],
  333. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  334. def int_s390_vsrd : ClangBuiltin<"__builtin_s390_vsrd">,
  335. Intrinsic<[llvm_v16i8_ty],
  336. [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty],
  337. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  338. def int_s390_vstrsb : SystemZTernaryConvCC<llvm_v16i8_ty, llvm_v16i8_ty>;
  339. def int_s390_vstrsh : SystemZTernaryConvCC<llvm_v16i8_ty, llvm_v8i16_ty>;
  340. def int_s390_vstrsf : SystemZTernaryConvCC<llvm_v16i8_ty, llvm_v4i32_ty>;
  341. def int_s390_vstrszb : SystemZTernaryConvCC<llvm_v16i8_ty, llvm_v16i8_ty>;
  342. def int_s390_vstrszh : SystemZTernaryConvCC<llvm_v16i8_ty, llvm_v8i16_ty>;
  343. def int_s390_vstrszf : SystemZTernaryConvCC<llvm_v16i8_ty, llvm_v4i32_ty>;
  344. // Instructions from the NNP-assist Facility
  345. def int_s390_vclfnhs : ClangBuiltin<"__builtin_s390_vclfnhs">,
  346. Intrinsic<[llvm_v4f32_ty],
  347. [llvm_v8i16_ty, llvm_i32_ty],
  348. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  349. def int_s390_vclfnls : ClangBuiltin<"__builtin_s390_vclfnls">,
  350. Intrinsic<[llvm_v4f32_ty],
  351. [llvm_v8i16_ty, llvm_i32_ty],
  352. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  353. def int_s390_vcrnfs : ClangBuiltin<"__builtin_s390_vcrnfs">,
  354. Intrinsic<[llvm_v8i16_ty],
  355. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i32_ty],
  356. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  357. def int_s390_vcfn : ClangBuiltin<"__builtin_s390_vcfn">,
  358. Intrinsic<[llvm_v8i16_ty],
  359. [llvm_v8i16_ty, llvm_i32_ty],
  360. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  361. def int_s390_vcnf : ClangBuiltin<"__builtin_s390_vcnf">,
  362. Intrinsic<[llvm_v8i16_ty],
  363. [llvm_v8i16_ty, llvm_i32_ty],
  364. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  365. }
  366. //===----------------------------------------------------------------------===//
  367. //
  368. // Misc intrinsics
  369. //
  370. //===----------------------------------------------------------------------===//
  371. let TargetPrefix = "s390" in {
  372. def int_s390_sfpc : ClangBuiltin<"__builtin_s390_sfpc">,
  373. Intrinsic<[], [llvm_i32_ty], []>;
  374. def int_s390_efpc : ClangBuiltin<"__builtin_s390_efpc">,
  375. Intrinsic<[llvm_i32_ty], [], []>;
  376. def int_s390_tdc : Intrinsic<[llvm_i32_ty], [llvm_anyfloat_ty, llvm_i64_ty],
  377. [IntrNoMem]>;
  378. }