/3rd_party/llvm/include/llvm/IntrinsicsCellSPU.td

https://code.google.com/p/softart/ · Unknown · 242 lines · 210 code · 32 blank · 0 comment · 0 complexity · 479f214accd89808d5f541c52da2c28a MD5 · raw file

  1. //==- IntrinsicsCellSPU.td - Cell SDK intrinsics -*- tablegen -*-==//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // Department at The Aerospace Corporation and is distributed under the
  7. // License. See LICENSE.TXT for details.
  8. //
  9. //===----------------------------------------------------------------------===//
  10. // Cell SPU Instructions:
  11. //===----------------------------------------------------------------------===//
  12. // TODO Items (not urgent today, but would be nice, low priority)
  13. //
  14. // ANDBI, ORBI: SPU constructs a 4-byte constant for these instructions by
  15. // concatenating the byte argument b as "bbbb". Could recognize this bit pattern
  16. // in 16-bit and 32-bit constants and reduce instruction count.
  17. //===----------------------------------------------------------------------===//
  18. // 7-bit integer type, used as an immediate:
  19. def cell_i7_ty: LLVMType<i8>;
  20. def cell_i8_ty: LLVMType<i8>;
  21. // Keep this here until it's actually supported:
  22. def llvm_i128_ty : LLVMType<i128>;
  23. class v16i8_u7imm<string builtin_suffix> :
  24. GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
  25. Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, cell_i7_ty],
  26. [IntrNoMem]>;
  27. class v16i8_u8imm<string builtin_suffix> :
  28. GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
  29. Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i8_ty],
  30. [IntrNoMem]>;
  31. class v16i8_s10imm<string builtin_suffix> :
  32. GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
  33. Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i16_ty],
  34. [IntrNoMem]>;
  35. class v16i8_u16imm<string builtin_suffix> :
  36. GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
  37. Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i16_ty],
  38. [IntrNoMem]>;
  39. class v16i8_rr<string builtin_suffix> :
  40. GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
  41. Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
  42. [IntrNoMem]>;
  43. class v8i16_s10imm<string builtin_suffix> :
  44. GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
  45. Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i16_ty],
  46. [IntrNoMem]>;
  47. class v8i16_u16imm<string builtin_suffix> :
  48. GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
  49. Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i16_ty],
  50. [IntrNoMem]>;
  51. class v8i16_rr<string builtin_suffix> :
  52. GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
  53. Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
  54. [IntrNoMem]>;
  55. class v4i32_rr<string builtin_suffix> :
  56. GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
  57. Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
  58. [IntrNoMem]>;
  59. class v4i32_u7imm<string builtin_suffix> :
  60. GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
  61. Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, cell_i7_ty],
  62. [IntrNoMem]>;
  63. class v4i32_s10imm<string builtin_suffix> :
  64. GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
  65. Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i16_ty],
  66. [IntrNoMem]>;
  67. class v4i32_u16imm<string builtin_suffix> :
  68. GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
  69. Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i16_ty],
  70. [IntrNoMem]>;
  71. class v4f32_rr<string builtin_suffix> :
  72. GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
  73. Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty],
  74. [IntrNoMem]>;
  75. class v4f32_rrr<string builtin_suffix> :
  76. GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
  77. Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
  78. [IntrNoMem]>;
  79. class v2f64_rr<string builtin_suffix> :
  80. GCCBuiltin<!strconcat("__builtin_si_", builtin_suffix)>,
  81. Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty],
  82. [IntrNoMem]>;
  83. // All Cell SPU intrinsics start with "llvm.spu.".
  84. let TargetPrefix = "spu" in {
  85. def int_spu_si_fsmbi : v8i16_u16imm<"fsmbi">;
  86. def int_spu_si_ah : v8i16_rr<"ah">;
  87. def int_spu_si_ahi : v8i16_s10imm<"ahi">;
  88. def int_spu_si_a : v4i32_rr<"a">;
  89. def int_spu_si_ai : v4i32_s10imm<"ai">;
  90. def int_spu_si_sfh : v8i16_rr<"sfh">;
  91. def int_spu_si_sfhi : v8i16_s10imm<"sfhi">;
  92. def int_spu_si_sf : v4i32_rr<"sf">;
  93. def int_spu_si_sfi : v4i32_s10imm<"sfi">;
  94. def int_spu_si_addx : v4i32_rr<"addx">;
  95. def int_spu_si_cg : v4i32_rr<"cg">;
  96. def int_spu_si_cgx : v4i32_rr<"cgx">;
  97. def int_spu_si_sfx : v4i32_rr<"sfx">;
  98. def int_spu_si_bg : v4i32_rr<"bg">;
  99. def int_spu_si_bgx : v4i32_rr<"bgx">;
  100. def int_spu_si_mpy : // This is special:
  101. GCCBuiltin<"__builtin_si_mpy">,
  102. Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
  103. [IntrNoMem]>;
  104. def int_spu_si_mpyu : // This is special:
  105. GCCBuiltin<"__builtin_si_mpyu">,
  106. Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
  107. [IntrNoMem]>;
  108. def int_spu_si_mpyi : // This is special:
  109. GCCBuiltin<"__builtin_si_mpyi">,
  110. Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_i16_ty],
  111. [IntrNoMem]>;
  112. def int_spu_si_mpyui : // This is special:
  113. GCCBuiltin<"__builtin_si_mpyui">,
  114. Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_i16_ty],
  115. [IntrNoMem]>;
  116. def int_spu_si_mpya : // This is special:
  117. GCCBuiltin<"__builtin_si_mpya">,
  118. Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
  119. [IntrNoMem]>;
  120. def int_spu_si_mpyh : // This is special:
  121. GCCBuiltin<"__builtin_si_mpyh">,
  122. Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v8i16_ty],
  123. [IntrNoMem]>;
  124. def int_spu_si_mpys : // This is special:
  125. GCCBuiltin<"__builtin_si_mpys">,
  126. Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
  127. [IntrNoMem]>;
  128. def int_spu_si_mpyhh : // This is special:
  129. GCCBuiltin<"__builtin_si_mpyhh">,
  130. Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
  131. [IntrNoMem]>;
  132. def int_spu_si_mpyhha : // This is special:
  133. GCCBuiltin<"__builtin_si_mpyhha">,
  134. Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
  135. [IntrNoMem]>;
  136. def int_spu_si_mpyhhu : // This is special:
  137. GCCBuiltin<"__builtin_si_mpyhhu">,
  138. Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
  139. [IntrNoMem]>;
  140. def int_spu_si_mpyhhau : // This is special:
  141. GCCBuiltin<"__builtin_si_mpyhhau">,
  142. Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
  143. [IntrNoMem]>;
  144. def int_spu_si_shli: v4i32_u7imm<"shli">;
  145. def int_spu_si_shlqbi:
  146. GCCBuiltin<!strconcat("__builtin_si_", "shlqbi")>,
  147. Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty],
  148. [IntrNoMem]>;
  149. def int_spu_si_shlqbii: v16i8_u7imm<"shlqbii">;
  150. def int_spu_si_shlqby:
  151. GCCBuiltin<!strconcat("__builtin_si_", "shlqby")>,
  152. Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty],
  153. [IntrNoMem]>;
  154. def int_spu_si_shlqbyi: v16i8_u7imm<"shlqbyi">;
  155. def int_spu_si_ceq: v4i32_rr<"ceq">;
  156. def int_spu_si_ceqi: v4i32_s10imm<"ceqi">;
  157. def int_spu_si_ceqb: v16i8_rr<"ceqb">;
  158. def int_spu_si_ceqbi: v16i8_u8imm<"ceqbi">;
  159. def int_spu_si_ceqh: v8i16_rr<"ceqh">;
  160. def int_spu_si_ceqhi: v8i16_s10imm<"ceqhi">;
  161. def int_spu_si_cgt: v4i32_rr<"cgt">;
  162. def int_spu_si_cgti: v4i32_s10imm<"cgti">;
  163. def int_spu_si_cgtb: v16i8_rr<"cgtb">;
  164. def int_spu_si_cgtbi: v16i8_u8imm<"cgtbi">;
  165. def int_spu_si_cgth: v8i16_rr<"cgth">;
  166. def int_spu_si_cgthi: v8i16_s10imm<"cgthi">;
  167. def int_spu_si_clgtb: v16i8_rr<"clgtb">;
  168. def int_spu_si_clgtbi: v16i8_u8imm<"clgtbi">;
  169. def int_spu_si_clgth: v8i16_rr<"clgth">;
  170. def int_spu_si_clgthi: v8i16_s10imm<"clgthi">;
  171. def int_spu_si_clgt: v4i32_rr<"clgt">;
  172. def int_spu_si_clgti: v4i32_s10imm<"clgti">;
  173. def int_spu_si_and: v4i32_rr<"and">;
  174. def int_spu_si_andbi: v16i8_u8imm<"andbi">;
  175. def int_spu_si_andc: v4i32_rr<"andc">;
  176. def int_spu_si_andhi: v8i16_s10imm<"andhi">;
  177. def int_spu_si_andi: v4i32_s10imm<"andi">;
  178. def int_spu_si_or: v4i32_rr<"or">;
  179. def int_spu_si_orbi: v16i8_u8imm<"orbi">;
  180. def int_spu_si_orc: v4i32_rr<"orc">;
  181. def int_spu_si_orhi: v8i16_s10imm<"orhi">;
  182. def int_spu_si_ori: v4i32_s10imm<"ori">;
  183. def int_spu_si_xor: v4i32_rr<"xor">;
  184. def int_spu_si_xorbi: v16i8_u8imm<"xorbi">;
  185. def int_spu_si_xorhi: v8i16_s10imm<"xorhi">;
  186. def int_spu_si_xori: v4i32_s10imm<"xori">;
  187. def int_spu_si_nor: v4i32_rr<"nor">;
  188. def int_spu_si_nand: v4i32_rr<"nand">;
  189. def int_spu_si_fa: v4f32_rr<"fa">;
  190. def int_spu_si_fs: v4f32_rr<"fs">;
  191. def int_spu_si_fm: v4f32_rr<"fm">;
  192. def int_spu_si_fceq: v4f32_rr<"fceq">;
  193. def int_spu_si_fcmeq: v4f32_rr<"fcmeq">;
  194. def int_spu_si_fcgt: v4f32_rr<"fcgt">;
  195. def int_spu_si_fcmgt: v4f32_rr<"fcmgt">;
  196. def int_spu_si_fma: v4f32_rrr<"fma">;
  197. def int_spu_si_fnms: v4f32_rrr<"fnms">;
  198. def int_spu_si_fms: v4f32_rrr<"fms">;
  199. def int_spu_si_dfa: v2f64_rr<"dfa">;
  200. def int_spu_si_dfs: v2f64_rr<"dfs">;
  201. def int_spu_si_dfm: v2f64_rr<"dfm">;
  202. //def int_spu_si_dfceq: v2f64_rr<"dfceq">;
  203. //def int_spu_si_dfcmeq: v2f64_rr<"dfcmeq">;
  204. //def int_spu_si_dfcgt: v2f64_rr<"dfcgt">;
  205. //def int_spu_si_dfcmgt: v2f64_rr<"dfcmgt">;
  206. def int_spu_si_dfnma: v2f64_rr<"dfnma">;
  207. def int_spu_si_dfma: v2f64_rr<"dfma">;
  208. def int_spu_si_dfnms: v2f64_rr<"dfnms">;
  209. def int_spu_si_dfms: v2f64_rr<"dfms">;
  210. }