insn-attr.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. /* Generated automatically by the program `genattr'
  2. from the machine description file `md'. */
  3. #ifndef GCC_INSN_ATTR_H
  4. #define GCC_INSN_ATTR_H
  5. #include "insn-attr-common.h"
  6. #define HAVE_ATTR_cpu 1
  7. extern enum attr_cpu get_attr_cpu (void);
  8. #define HAVE_ATTR_type 1
  9. extern enum attr_type get_attr_type (rtx_insn *);
  10. #define HAVE_ATTR_mode 1
  11. extern enum attr_mode get_attr_mode (rtx_insn *);
  12. #define HAVE_ATTR_unit 1
  13. extern enum attr_unit get_attr_unit (rtx_insn *);
  14. #define HAVE_ATTR_length_immediate 1
  15. extern int get_attr_length_immediate (rtx_insn *);
  16. #define HAVE_ATTR_length_address 1
  17. extern int get_attr_length_address (rtx_insn *);
  18. #define HAVE_ATTR_prefix_data16 1
  19. extern int get_attr_prefix_data16 (rtx_insn *);
  20. #define HAVE_ATTR_prefix_rep 1
  21. extern int get_attr_prefix_rep (rtx_insn *);
  22. #define HAVE_ATTR_prefix_0f 1
  23. extern int get_attr_prefix_0f (rtx_insn *);
  24. #define HAVE_ATTR_prefix_rex 1
  25. extern int get_attr_prefix_rex (rtx_insn *);
  26. #define HAVE_ATTR_prefix_extra 1
  27. extern int get_attr_prefix_extra (rtx_insn *);
  28. #define HAVE_ATTR_prefix 1
  29. extern enum attr_prefix get_attr_prefix (rtx_insn *);
  30. #define HAVE_ATTR_prefix_vex_w 1
  31. extern int get_attr_prefix_vex_w (rtx_insn *);
  32. #define HAVE_ATTR_length_vex 1
  33. extern int get_attr_length_vex (rtx_insn *);
  34. #define HAVE_ATTR_length_evex 1
  35. extern int get_attr_length_evex (rtx_insn *);
  36. #define HAVE_ATTR_modrm 1
  37. extern int get_attr_modrm (rtx_insn *);
  38. #define HAVE_ATTR_length 1
  39. extern int get_attr_length (rtx_insn *);
  40. extern void shorten_branches (rtx_insn *);
  41. extern int insn_default_length (rtx_insn *);
  42. extern int insn_min_length (rtx_insn *);
  43. extern int insn_variable_length_p (rtx_insn *);
  44. extern int insn_current_length (rtx_insn *);
  45. #include "insn-addr.h"
  46. #define HAVE_ATTR_memory 1
  47. extern enum attr_memory get_attr_memory (rtx_insn *);
  48. #define HAVE_ATTR_imm_disp 1
  49. extern enum attr_imm_disp get_attr_imm_disp (rtx_insn *);
  50. #define HAVE_ATTR_fp_int_src 1
  51. extern enum attr_fp_int_src get_attr_fp_int_src (rtx_insn *);
  52. #define HAVE_ATTR_i387_cw 1
  53. extern enum attr_i387_cw get_attr_i387_cw (rtx_insn *);
  54. #define HAVE_ATTR_avx_partial_xmm_update 1
  55. extern enum attr_avx_partial_xmm_update get_attr_avx_partial_xmm_update (rtx_insn *);
  56. #define HAVE_ATTR_use_carry 1
  57. extern enum attr_use_carry get_attr_use_carry (rtx_insn *);
  58. #define HAVE_ATTR_movu 1
  59. extern enum attr_movu get_attr_movu (rtx_insn *);
  60. #define HAVE_ATTR_isa 1
  61. extern enum attr_isa get_attr_isa (rtx_insn *);
  62. #define HAVE_ATTR_enabled 1
  63. extern int get_attr_enabled (rtx_insn *);
  64. #define HAVE_ATTR_preferred_for_size 1
  65. extern int get_attr_preferred_for_size (rtx_insn *);
  66. #define HAVE_ATTR_preferred_for_speed 1
  67. extern int get_attr_preferred_for_speed (rtx_insn *);
  68. #define HAVE_ATTR_pent_prefix 1
  69. extern enum attr_pent_prefix get_attr_pent_prefix (rtx_insn *);
  70. #define HAVE_ATTR_pent_pair 1
  71. extern enum attr_pent_pair get_attr_pent_pair (rtx_insn *);
  72. #define HAVE_ATTR_athlon_decode 1
  73. extern enum attr_athlon_decode get_attr_athlon_decode (rtx_insn *);
  74. #define HAVE_ATTR_amdfam10_decode 1
  75. extern enum attr_amdfam10_decode get_attr_amdfam10_decode (rtx_insn *);
  76. #define HAVE_ATTR_bdver1_decode 1
  77. extern enum attr_bdver1_decode get_attr_bdver1_decode (rtx_insn *);
  78. #define HAVE_ATTR_btver2_decode 1
  79. extern enum attr_btver2_decode get_attr_btver2_decode (rtx_insn *);
  80. #define HAVE_ATTR_btver2_sse_attr 1
  81. extern enum attr_btver2_sse_attr get_attr_btver2_sse_attr (rtx_insn *);
  82. #define HAVE_ATTR_znver1_decode 1
  83. extern enum attr_znver1_decode get_attr_znver1_decode (rtx_insn *);
  84. #define HAVE_ATTR_atom_unit 1
  85. extern enum attr_atom_unit get_attr_atom_unit (rtx_insn *);
  86. #define HAVE_ATTR_atom_sse_attr 1
  87. extern enum attr_atom_sse_attr get_attr_atom_sse_attr (rtx_insn *);
  88. #define HAVE_ATTR_i7_domain 1
  89. extern enum attr_i7_domain get_attr_i7_domain (rtx_insn *);
  90. #define HAVE_ATTR_hsw_domain 1
  91. extern enum attr_hsw_domain get_attr_hsw_domain (rtx_insn *);
  92. #define HAVE_ATTR_unord_subst 1
  93. extern enum attr_unord_subst get_attr_unord_subst (rtx_insn *);
  94. #define HAVE_ATTR_mask 1
  95. extern enum attr_mask get_attr_mask (rtx_insn *);
  96. #define HAVE_ATTR_mask_scalar_merge 1
  97. extern enum attr_mask_scalar_merge get_attr_mask_scalar_merge (rtx_insn *);
  98. #define HAVE_ATTR_sd 1
  99. extern enum attr_sd get_attr_sd (rtx_insn *);
  100. #define HAVE_ATTR_round 1
  101. extern enum attr_round get_attr_round (rtx_insn *);
  102. #define HAVE_ATTR_round_saeonly 1
  103. extern enum attr_round_saeonly get_attr_round_saeonly (rtx_insn *);
  104. #define HAVE_ATTR_round_expand 1
  105. extern enum attr_round_expand get_attr_round_expand (rtx_insn *);
  106. #define HAVE_ATTR_round_saeonly_expand 1
  107. extern enum attr_round_saeonly_expand get_attr_round_saeonly_expand (rtx_insn *);
  108. #define HAVE_ATTR_mask_expand4 1
  109. extern enum attr_mask_expand4 get_attr_mask_expand4 (rtx_insn *);
  110. #define HAVE_ATTR_mask_scalar 1
  111. extern enum attr_mask_scalar get_attr_mask_scalar (rtx_insn *);
  112. #define HAVE_ATTR_round_scalar 1
  113. extern enum attr_round_scalar get_attr_round_scalar (rtx_insn *);
  114. #define HAVE_ATTR_round_saeonly_scalar 1
  115. extern enum attr_round_saeonly_scalar get_attr_round_saeonly_scalar (rtx_insn *);
  116. extern int num_delay_slots (rtx_insn *);
  117. extern int eligible_for_delay (rtx_insn *, int, rtx_insn *, int);
  118. extern int const_num_delay_slots (rtx_insn *);
  119. #define ANNUL_IFTRUE_SLOTS 0
  120. extern int eligible_for_annul_true (rtx_insn *, int, rtx_insn *, int);
  121. #define ANNUL_IFFALSE_SLOTS 0
  122. extern int eligible_for_annul_false (rtx_insn *, int, rtx_insn *, int);
  123. /* DFA based pipeline interface. */
  124. #ifndef AUTOMATON_ALTS
  125. #define AUTOMATON_ALTS 0
  126. #endif
  127. #ifndef AUTOMATON_STATE_ALTS
  128. #define AUTOMATON_STATE_ALTS 0
  129. #endif
  130. #ifndef CPU_UNITS_QUERY
  131. #define CPU_UNITS_QUERY 0
  132. #endif
  133. /* Initialize fn pointers for internal_dfa_insn_code
  134. and insn_default_latency. */
  135. extern void init_sched_attrs (void);
  136. /* Internal insn code number used by automata. */
  137. extern int (*internal_dfa_insn_code) (rtx_insn *);
  138. /* Insn latency time defined in define_insn_reservation. */
  139. extern int (*insn_default_latency) (rtx_insn *);
  140. /* Return nonzero if there is a bypass for given insn
  141. which is a data producer. */
  142. extern int bypass_p (rtx_insn *);
  143. /* Insn latency time on data consumed by the 2nd insn.
  144. Use the function if bypass_p returns nonzero for
  145. the 1st insn. */
  146. extern int insn_latency (rtx_insn *, rtx_insn *);
  147. /* Maximal insn latency time possible of all bypasses for this insn.
  148. Use the function if bypass_p returns nonzero for
  149. the 1st insn. */
  150. extern int maximal_insn_latency (rtx_insn *);
  151. #if AUTOMATON_ALTS
  152. /* The following function returns number of alternative
  153. reservations of given insn. It may be used for better
  154. insns scheduling heuristics. */
  155. extern int insn_alts (rtx);
  156. #endif
  157. /* Maximal possible number of insns waiting results being
  158. produced by insns whose execution is not finished. */
  159. extern const int max_insn_queue_index;
  160. /* Pointer to data describing current state of DFA. */
  161. typedef void *state_t;
  162. /* Size of the data in bytes. */
  163. extern int state_size (void);
  164. /* Initiate given DFA state, i.e. Set up the state
  165. as all functional units were not reserved. */
  166. extern void state_reset (state_t);
  167. /* The following function returns negative value if given
  168. insn can be issued in processor state described by given
  169. DFA state. In this case, the DFA state is changed to
  170. reflect the current and future reservations by given
  171. insn. Otherwise the function returns minimal time
  172. delay to issue the insn. This delay may be zero
  173. for superscalar or VLIW processors. If the second
  174. parameter is NULL the function changes given DFA state
  175. as new processor cycle started. */
  176. extern int state_transition (state_t, rtx);
  177. #if AUTOMATON_STATE_ALTS
  178. /* The following function returns number of possible
  179. alternative reservations of given insn in given
  180. DFA state. It may be used for better insns scheduling
  181. heuristics. By default the function is defined if
  182. macro AUTOMATON_STATE_ALTS is defined because its
  183. implementation may require much memory. */
  184. extern int state_alts (state_t, rtx);
  185. #endif
  186. extern int min_issue_delay (state_t, rtx_insn *);
  187. /* The following function returns nonzero if no one insn
  188. can be issued in current DFA state. */
  189. extern int state_dead_lock_p (state_t);
  190. /* The function returns minimal delay of issue of the 2nd
  191. insn after issuing the 1st insn in given DFA state.
  192. The 1st insn should be issued in given state (i.e.
  193. state_transition should return negative value for
  194. the insn and the state). Data dependencies between
  195. the insns are ignored by the function. */
  196. extern int min_insn_conflict_delay (state_t, rtx_insn *, rtx_insn *);
  197. /* The following function outputs reservations for given
  198. insn as they are described in the corresponding
  199. define_insn_reservation. */
  200. extern void print_reservation (FILE *, rtx_insn *);
  201. #if CPU_UNITS_QUERY
  202. /* The following function returns code of functional unit
  203. with given name (see define_cpu_unit). */
  204. extern int get_cpu_unit_code (const char *);
  205. /* The following function returns nonzero if functional
  206. unit with given code is currently reserved in given
  207. DFA state. */
  208. extern int cpu_unit_reservation_p (state_t, int);
  209. #endif
  210. /* The following function returns true if insn
  211. has a dfa reservation. */
  212. extern bool insn_has_dfa_reservation_p (rtx_insn *);
  213. /* Clean insn code cache. It should be called if there
  214. is a chance that condition value in a
  215. define_insn_reservation will be changed after
  216. last call of dfa_start. */
  217. extern void dfa_clean_insn_cache (void);
  218. extern void dfa_clear_single_insn_cache (rtx_insn *);
  219. /* Initiate and finish work with DFA. They should be
  220. called as the first and the last interface
  221. functions. */
  222. extern void dfa_start (void);
  223. extern void dfa_finish (void);
  224. #ifndef HAVE_ATTR_length
  225. #define HAVE_ATTR_length 0
  226. #endif
  227. #ifndef HAVE_ATTR_enabled
  228. #define HAVE_ATTR_enabled 0
  229. #endif
  230. #ifndef HAVE_ATTR_preferred_for_size
  231. #define HAVE_ATTR_preferred_for_size 0
  232. #endif
  233. #ifndef HAVE_ATTR_preferred_for_speed
  234. #define HAVE_ATTR_preferred_for_speed 0
  235. #endif
  236. #if !HAVE_ATTR_length
  237. extern int hook_int_rtx_insn_unreachable (rtx_insn *);
  238. #define insn_default_length hook_int_rtx_insn_unreachable
  239. #define insn_min_length hook_int_rtx_insn_unreachable
  240. #define insn_variable_length_p hook_int_rtx_insn_unreachable
  241. #define insn_current_length hook_int_rtx_insn_unreachable
  242. #include "insn-addr.h"
  243. #endif
  244. extern int hook_int_rtx_1 (rtx);
  245. #if !HAVE_ATTR_enabled
  246. #define get_attr_enabled hook_int_rtx_1
  247. #endif
  248. #if !HAVE_ATTR_preferred_for_size
  249. #define get_attr_preferred_for_size hook_int_rtx_1
  250. #endif
  251. #if !HAVE_ATTR_preferred_for_speed
  252. #define get_attr_preferred_for_speed hook_int_rtx_1
  253. #endif
  254. #define ATTR_FLAG_forward 0x1
  255. #define ATTR_FLAG_backward 0x2
  256. #endif /* GCC_INSN_ATTR_H */