1 /* Prototypes of target machine for SPARC.
2    Copyright (C) 1999-2019 Free Software Foundation, Inc.
3    Contributed by Michael Tiemann (tiemann@cygnus.com).
4    64-bit SPARC-V9 support by Michael Tiemann, Jim Wilson, and Doug Evans,
5    at Cygnus Support.
6 
7 This file is part of GCC.
8 
9 GCC is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
12 any later version.
13 
14 GCC is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING3.  If not see
21 <http://www.gnu.org/licenses/>.  */
22 
23 #ifndef __SPARC_PROTOS_H__
24 #define __SPARC_PROTOS_H__
25 
26 #ifdef TREE_CODE
27 #ifdef RTX_CODE
28 extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree);
29 #endif
30 extern unsigned long sparc_type_code (tree);
31 #endif /* TREE_CODE */
32 
33 extern void order_regs_for_local_alloc (void);
34 extern int sparc_initial_elimination_offset (int);
35 extern void sparc_expand_prologue (void);
36 extern void sparc_flat_expand_prologue (void);
37 extern void sparc_expand_epilogue (bool);
38 extern void sparc_flat_expand_epilogue (bool);
39 extern bool sparc_can_use_return_insn_p (void);
40 extern int check_pic (int);
41 extern void sparc_profile_hook (int);
42 extern void sparc_override_options (void);
43 extern void sparc_output_scratch_registers (FILE *);
44 extern void sparc_target_macros (void);
45 extern void sparc_emit_membar_for_model (enum memmodel, int, int);
46 extern int sparc_branch_cost (bool, bool);
47 
48 #ifdef RTX_CODE
49 extern machine_mode select_cc_mode (enum rtx_code, rtx, rtx);
50 /* Define the function that build the compare insn for scc and bcc.  */
51 extern rtx gen_compare_reg (rtx cmp);
52 extern rtx sparc_emit_float_lib_cmp (rtx, rtx, enum rtx_code);
53 extern void sparc_emit_floatunsdi (rtx [2], machine_mode);
54 extern void sparc_emit_fixunsdi (rtx [2], machine_mode);
55 extern void emit_tfmode_binop (enum rtx_code, rtx *);
56 extern void emit_tfmode_unop (enum rtx_code, rtx *);
57 extern void emit_tfmode_cvt (enum rtx_code, rtx *);
58 extern bool constant_address_p (rtx);
59 extern bool legitimate_pic_operand_p (rtx);
60 extern rtx sparc_legitimize_reload_address (rtx, machine_mode, int, int,
61 					    int, int *win);
62 extern void load_got_register (void);
63 extern void sparc_emit_call_insn (rtx, rtx);
64 extern void sparc_defer_case_vector (rtx, rtx, int);
65 extern bool sparc_expand_move (machine_mode, rtx *);
66 extern void sparc_emit_set_symbolic_const64 (rtx, rtx, rtx);
67 extern int sparc_split_reg_mem_legitimate (rtx, rtx);
68 extern void sparc_split_reg_mem (rtx, rtx, machine_mode);
69 extern void sparc_split_mem_reg (rtx, rtx, machine_mode);
70 extern int sparc_split_reg_reg_legitimate (rtx, rtx);
71 extern void sparc_split_reg_reg (rtx, rtx, machine_mode);
72 extern const char *output_load_pcrel_sym (rtx *);
73 extern const char *output_ubranch (rtx, rtx_insn *);
74 extern const char *output_cbranch (rtx, rtx, int, int, int, rtx_insn *);
75 extern const char *output_return (rtx_insn *);
76 extern const char *output_sibcall (rtx_insn *, rtx);
77 extern const char *output_v8plus_shift (rtx_insn *, rtx *, const char *);
78 extern const char *output_v8plus_mult (rtx_insn *, rtx *, const char *);
79 extern const char *output_v9branch (rtx, rtx, int, int, int, int, rtx_insn *);
80 extern const char *output_probe_stack_range (rtx, rtx);
81 extern const char *output_cbcond (rtx, rtx, rtx_insn *);
82 extern bool emit_scc_insn (rtx []);
83 extern void emit_conditional_branch_insn (rtx []);
84 extern int registers_ok_for_ldd_peep (rtx, rtx);
85 extern int mems_ok_for_ldd_peep (rtx, rtx, rtx);
86 extern rtx widen_mem_for_ldd_peep (rtx, rtx, machine_mode);
87 extern int empty_delay_slot (rtx_insn *);
88 extern int emit_cbcond_nop (rtx_insn *);
89 extern int eligible_for_return_delay (rtx_insn *);
90 extern int eligible_for_sibcall_delay (rtx_insn *);
91 extern int emit_move_sequence (rtx, machine_mode);
92 extern int fp_sethi_p (rtx);
93 extern int fp_mov_p (rtx);
94 extern int fp_high_losum_p (rtx);
95 extern int mem_min_alignment (rtx, int);
96 extern int pic_address_needs_scratch (rtx);
97 extern int register_ok_for_ldd (rtx);
98 extern int memory_ok_for_ldd (rtx);
99 extern int v9_regcmp_p (enum rtx_code);
100 /* Function used for V8+ code generation.  Returns 1 if the high
101    32 bits of REG are 0 before INSN.  */
102 extern int sparc_check_64 (rtx, rtx_insn *);
103 extern rtx gen_df_reg (rtx, int);
104 extern void sparc_expand_compare_and_swap (rtx op[]);
105 extern void sparc_expand_vector_init (rtx, rtx);
106 extern void sparc_expand_vec_perm_bmask(machine_mode, rtx);
107 extern bool sparc_expand_conditional_move (machine_mode, rtx *);
108 extern void sparc_expand_vcond (machine_mode, rtx *, int, int);
109 unsigned int sparc_regmode_natural_size (machine_mode);
110 #endif /* RTX_CODE */
111 
112 extern rtl_opt_pass *make_pass_work_around_errata (gcc::context *);
113 
114 /* Routines implemented in sparc-d.c  */
115 extern void sparc_d_target_versions (void);
116 
117 #endif /* __SPARC_PROTOS_H__ */
118