2013-07-10 Jan-Benedict Glaw <jbglaw@lug-owl.de>
[official-gcc.git] / gcc / config / cr16 / cr16-protos.h
blobf6663c928698f217210c6df8817b85c71d073727
1 /* Prototypes for exported functions defined in cr16.c
2 Copyright (C) 2012-2013 Free Software Foundation, Inc.
3 Contributed by KPIT Cummins Infosystems Limited.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published
9 by the Free Software Foundation; either version 3, or (at your
10 option) any later version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
21 #ifndef GCC_CR16_PROTOS_H
22 #define GCC_CR16_PROTOS_H
24 /* Register usage. */
25 extern enum reg_class cr16_regno_reg_class (int);
26 extern int cr16_hard_regno_mode_ok (int regno, enum machine_mode);
28 /* Passing function arguments. */
29 extern int cr16_function_arg_regno_p (int);
31 #ifdef TREE_CODE
32 #ifdef RTX_CODE
34 extern void cr16_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx);
36 #endif /* RTX_CODE. */
37 #endif /* TREE_CODE. */
39 /* Enumeration giving the various data models we support. */
40 enum data_model_type
42 DM_DEFAULT, /* Default data model (in CR16C/C+ - up to 16M). */
43 DM_NEAR, /* Near data model (in CR16C/C+ - up to 1M). */
44 DM_FAR, /* Far data model (in CR16C+ - up to 4G)
45 (in CR16C - up to 16M). */
46 ILLEGAL_DM /* Illegal data model. */
49 #ifdef RTX_CODE
51 /* Addressing Modes. */
52 struct cr16_address
54 rtx base; /* Base register: Any register or register pair. */
55 rtx index; /* Index register: If one is present. */
56 rtx disp; /* Displacement or Absolute address. */
57 enum data_model_type data; /* data ref type. */
58 int code; /* Whether the address is code address.
59 0 - data, 1 - code label, 2 - function label. */
62 enum cr16_addrtype
64 CR16_INVALID,
65 CR16_REG_REL,
66 CR16_REGP_REL,
67 CR16_INDEX_REGP_REL,
68 CR16_ABSOLUTE
71 extern void notice_update_cc PARAMS ((rtx));
72 extern int cr16_operand_bit_pos (int val, int bitval);
73 extern void cr16_decompose_const (rtx x, int *code,
74 enum data_model_type *data,
75 bool treat_as_const);
76 extern enum cr16_addrtype cr16_decompose_address (rtx addr,
77 struct cr16_address *out,
78 bool debug_print,
79 bool treat_as_const);
80 extern int cr16_const_double_ok (rtx op);
81 extern int legitimate_pic_operand_p (rtx);
82 extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx);
85 /* Prologue/Epilogue functions. */
86 extern int cr16_initial_elimination_offset (int, int);
87 extern char *cr16_prepare_push_pop_string (int);
88 extern void cr16_expand_prologue (void);
89 extern void cr16_expand_epilogue (void);
90 extern const char *cr16_emit_add_sub_di (rtx *, enum rtx_code);
91 extern const char *cr16_emit_logical_di (rtx *, enum rtx_code);
93 #endif /* RTX_CODE. */
95 /* Handling the "interrupt" attribute. */
96 extern int cr16_interrupt_function_p (void);
97 extern bool cr16_is_data_model (enum data_model_type);
99 #endif /* Not GCC_CR16_PROTOS_H. */