]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/avr/avr-protos.h
Update copyright years.
[thirdparty/gcc.git] / gcc / config / avr / avr-protos.h
CommitLineData
90e7678c
DC
1/* Prototypes for exported functions defined in avr.c
2
99dee823 3 Copyright (C) 2000-2021 Free Software Foundation, Inc.
92bffc14 4 Contributed by Denis Chertykov (chertykov@gmail.com)
90e7678c 5
7ec022b2 6 This file is part of GCC.
90e7678c 7
7ec022b2 8 GCC is free software; you can redistribute it and/or modify
90e7678c 9 it under the terms of the GNU General Public License as published by
2f83c7d6 10 the Free Software Foundation; either version 3, or (at your option)
90e7678c
DC
11 any later version.
12
7ec022b2 13 GCC is distributed in the hope that it will be useful,
90e7678c
DC
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
2f83c7d6
NC
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
90e7678c
DC
21
22
00892272 23extern int avr_function_arg_regno_p (int r);
97c281da 24extern void avr_cpu_cpp_builtins (struct cpp_reader * pfile);
269e3795 25extern enum reg_class avr_regno_reg_class (int r);
269e3795 26extern void asm_globalize_label (FILE *file, const char *name);
00892272 27extern void avr_adjust_reg_alloc_order (void);
c21ca196 28extern int avr_initial_elimination_offset (int from, int to);
269e3795 29extern int avr_simple_epilogue (void);
91635d08 30extern int avr_hard_regno_rename_ok (unsigned int, unsigned int);
3f02a5f3 31extern rtx avr_return_addr_rtx (int count, rtx tem);
7c209481 32extern void avr_register_target_pragmas (void);
7bc6df2c 33extern void avr_init_expanders (void);
6bec29c9 34
269e3795 35#ifdef TREE_CODE
f9d29866
JR
36extern void avr_asm_output_aligned_decl_common (FILE*, tree, const char*, unsigned HOST_WIDE_INT, unsigned int, bool);
37extern void avr_asm_asm_output_aligned_bss (FILE *, tree, const char *, unsigned HOST_WIDE_INT, int, void (*) (FILE *, tree, const char *, unsigned HOST_WIDE_INT, int));
269e3795 38extern void asm_output_external (FILE *file, tree decl, char *name);
427ee360 39extern int avr_progmem_p (tree decl, tree attributes);
2d06ca74 40extern bool avr_addr_space_supported_p (addr_space_t, location_t loc = UNKNOWN_LOCATION);
6bec29c9 41
90e7678c 42#ifdef RTX_CODE /* inside TREE_CODE */
00892272 43extern void avr_init_cumulative_args (CUMULATIVE_ARGS*, tree, rtx, tree);
90e7678c
DC
44#endif /* RTX_CODE inside TREE_CODE */
45
90e7678c
DC
46#endif /* TREE_CODE */
47
48#ifdef RTX_CODE
98024b4e
DM
49extern const char *output_movqi (rtx_insn *insn, rtx operands[], int *l);
50extern const char *output_movhi (rtx_insn *insn, rtx operands[], int *l);
51extern const char *output_movsisf (rtx_insn *insn, rtx operands[], int *l);
52extern const char *avr_out_tstsi (rtx_insn *, rtx*, int*);
53extern const char *avr_out_tsthi (rtx_insn *, rtx*, int*);
54extern const char *avr_out_tstpsi (rtx_insn *, rtx*, int*);
55extern const char *avr_out_compare (rtx_insn *, rtx*, int*);
56extern const char *avr_out_compare64 (rtx_insn *, rtx*, int*);
269e3795 57extern const char *ret_cond_branch (rtx x, int len, int reverse);
98024b4e 58extern const char *avr_out_movpsi (rtx_insn *, rtx*, int*);
8e3d9e67 59extern const char *avr_out_sign_extend (rtx_insn *, rtx*, int*);
fa626987 60extern const char *avr_out_insert_notbit (rtx_insn *, rtx*, rtx, int*);
269e3795 61
98024b4e
DM
62extern const char *ashlqi3_out (rtx_insn *insn, rtx operands[], int *len);
63extern const char *ashlhi3_out (rtx_insn *insn, rtx operands[], int *len);
64extern const char *ashlsi3_out (rtx_insn *insn, rtx operands[], int *len);
269e3795 65
98024b4e
DM
66extern const char *ashrqi3_out (rtx_insn *insn, rtx operands[], int *len);
67extern const char *ashrhi3_out (rtx_insn *insn, rtx operands[], int *len);
68extern const char *ashrsi3_out (rtx_insn *insn, rtx operands[], int *len);
269e3795 69
98024b4e
DM
70extern const char *lshrqi3_out (rtx_insn *insn, rtx operands[], int *len);
71extern const char *lshrhi3_out (rtx_insn *insn, rtx operands[], int *len);
72extern const char *lshrsi3_out (rtx_insn *insn, rtx operands[], int *len);
e4fe948a 73
98024b4e
DM
74extern const char *avr_out_ashlpsi3 (rtx_insn *, rtx*, int*);
75extern const char *avr_out_ashrpsi3 (rtx_insn *, rtx*, int*);
76extern const char *avr_out_lshrpsi3 (rtx_insn *, rtx*, int*);
e4fe948a 77
58f0ea2f 78extern bool avr_rotate_bytes (rtx operands[]);
269e3795 79
98024b4e 80extern const char* avr_out_fract (rtx_insn *, rtx[], bool, int*);
e55e4056
GJL
81extern rtx avr_to_int_mode (rtx);
82
00892272
GJL
83extern void avr_expand_prologue (void);
84extern void avr_expand_epilogue (bool);
76715c32 85extern bool avr_emit_cpymemhi (rtx*);
4fc2b4ff
AH
86extern int avr_epilogue_uses (int regno);
87
92383fee 88extern void avr_output_addr_vec (rtx_insn*, rtx);
98024b4e 89extern const char *avr_out_sbxx_branch (rtx_insn *insn, rtx operands[]);
6ebe2d6c 90extern const char* avr_out_bitop (rtx, rtx*, int*);
02371798 91extern const char* avr_out_plus (rtx, rtx*, int* =NULL, int* =NULL, bool =true);
98024b4e 92extern const char* avr_out_round (rtx_insn *, rtx*, int* =NULL);
180ee6d1 93extern const char* avr_out_addto_sp (rtx*, int*);
98024b4e 94extern const char* avr_out_xload (rtx_insn *, rtx*, int*);
76715c32 95extern const char* avr_out_cpymem (rtx_insn *, rtx*, int*);
0c578db6 96extern const char* avr_out_insert_bits (rtx*, int*);
6ebe2d6c 97extern bool avr_popcount_each_byte (rtx, int, int);
0c578db6 98extern bool avr_has_nibble_0xf (rtx);
269e3795 99
2d67effa 100extern int extra_constraint_Q (rtx x);
98024b4e 101extern int avr_adjust_insn_length (rtx_insn *insn, int len);
20633efc 102extern const char* output_reload_inhi (rtx*, rtx, int*);
8a6a05ce 103extern const char* output_reload_insisf (rtx*, rtx, int*);
e4fe948a 104extern const char* avr_out_reload_inpsi (rtx*, rtx, int*);
98024b4e 105extern const char* avr_out_lpm (rtx_insn *, rtx*, int*);
647d790d 106extern void avr_notice_update_cc (rtx body, rtx_insn *insn);
98024b4e
DM
107extern int reg_unused_after (rtx_insn *insn, rtx reg);
108extern int _reg_unused_after (rtx_insn *insn, rtx reg);
109extern int avr_jump_mode (rtx x, rtx_insn *insn);
0a2aaacc 110extern int test_hard_reg_class (enum reg_class rclass, rtx x);
98024b4e 111extern int jump_over_one_insn_p (rtx_insn *insn, rtx dest);
269e3795 112
98024b4e
DM
113extern void avr_final_prescan_insn (rtx_insn *insn, rtx *operand,
114 int num_operands);
ef4bddc2 115extern int avr_simplify_comparison_p (machine_mode mode,
0a2aaacc 116 RTX_CODE op, rtx x);
269e3795 117extern RTX_CODE avr_normalize_condition (RTX_CODE condition);
98024b4e 118extern void out_shift_with_cnt (const char *templ, rtx_insn *insn,
269e3795 119 rtx operands[], int *len, int t_len);
ef4bddc2
RS
120extern enum reg_class avr_mode_code_base_reg_class (machine_mode, addr_space_t, RTX_CODE, RTX_CODE);
121extern bool avr_regno_mode_code_ok_for_base_p (int, machine_mode, addr_space_t, RTX_CODE, RTX_CODE);
bdfe906f 122extern rtx avr_incoming_return_addr_rtx (void);
ef4bddc2 123extern rtx avr_legitimize_reload_address (rtx*, machine_mode, int, int, int, int, rtx (*)(rtx,int));
3a840863
GJL
124extern bool avr_mem_flash_p (rtx);
125extern bool avr_mem_memx_p (rtx);
7c209481 126extern bool avr_load_libgcc_p (rtx);
ef4bddc2 127extern bool avr_xload_libgcc_p (machine_mode);
f9d29866 128extern rtx avr_eval_addr_attrib (rtx x);
078134e5 129extern bool avr_casei_sequence_check_operands (rtx *xop);
38ee0815 130
f30dd607
GJL
131extern bool avr_float_lib_compare_returns_bool (machine_mode, enum rtx_code);
132
00e641f1
GJL
133static inline unsigned
134regmask (machine_mode mode, unsigned regno)
135{
ef1d3b57 136 return ((1u << GET_MODE_SIZE (as_a <fixed_size_mode> (mode))) - 1) << regno;
00e641f1
GJL
137}
138
139extern void avr_fix_inputs (rtx*, unsigned, unsigned);
140extern bool avr_emit3_fix_outputs (rtx (*)(rtx,rtx,rtx), rtx*, unsigned, unsigned);
141
38ee0815
GJL
142extern rtx lpm_reg_rtx;
143extern rtx lpm_addr_reg_rtx;
144extern rtx tmp_reg_rtx;
145extern rtx zero_reg_rtx;
146extern rtx all_regs_rtx[32];
147extern rtx rampz_rtx;
148
90e7678c
DC
149#endif /* RTX_CODE */
150
90e7678c 151#ifdef REAL_VALUE_TYPE
269e3795 152extern void asm_output_float (FILE *file, REAL_VALUE_TYPE n);
6bec29c9 153#endif
6c7dfafe 154
8c57e547
GJL
155extern bool avr_have_dimode;
156
76beabf4
GJL
157namespace gcc { class context; }
158class rtl_opt_pass;
159
63866e04 160extern rtl_opt_pass *make_avr_pass_pre_proep (gcc::context *);
76beabf4 161extern rtl_opt_pass *make_avr_pass_recompute_notes (gcc::context *);
078134e5 162extern rtl_opt_pass *make_avr_pass_casesi (gcc::context *);
76beabf4 163
6c7dfafe
GJL
164/* From avr-log.c */
165
10fbfd1b
GJL
166#define avr_dump(...) avr_vdump (NULL, __FUNCTION__, __VA_ARGS__)
167#define avr_edump(...) avr_vdump (stderr, __FUNCTION__, __VA_ARGS__)
168#define avr_fdump(FIL, ...) avr_vdump (FIL, __FUNCTION__, __VA_ARGS__)
6c7dfafe 169
10fbfd1b 170extern int avr_vdump (FILE*, const char*, ...);
6c7dfafe
GJL
171extern void avr_log_set_avr_log (void);
172
173typedef struct
174{
7c209481 175 unsigned address_cost :1;
b5e35770 176 unsigned builtin :1;
7c209481 177 unsigned constraints :1;
92383fee 178 unsigned insn_addresses :1;
6c7dfafe
GJL
179 unsigned legitimate_address_p :1;
180 unsigned legitimize_address :1;
181 unsigned legitimize_reload_address :1;
7c209481
GJL
182 unsigned progmem :1;
183 unsigned rtx_costs :1;
6c7dfafe
GJL
184} avr_log_t;
185
186extern avr_log_t avr_log;