1 |
709 |
jeremybenn |
/* Prototypes for exported functions defined in cr16.c
|
2 |
|
|
Copyright (C) 2012 Free Software Foundation, Inc.
|
3 |
|
|
Contributed by KPIT Cummins Infosystems Limited.
|
4 |
|
|
|
5 |
|
|
This file is part of GCC.
|
6 |
|
|
|
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.
|
11 |
|
|
|
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.
|
16 |
|
|
|
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/>. */
|
20 |
|
|
|
21 |
|
|
#ifndef GCC_CR16_PROTOS_H
|
22 |
|
|
#define GCC_CR16_PROTOS_H
|
23 |
|
|
|
24 |
|
|
#include "target.h"
|
25 |
|
|
|
26 |
|
|
/* Register usage. */
|
27 |
|
|
extern enum reg_class cr16_regno_reg_class (int);
|
28 |
|
|
extern int cr16_hard_regno_mode_ok (int regno, enum machine_mode);
|
29 |
|
|
|
30 |
|
|
/* Passing function arguments. */
|
31 |
|
|
extern int cr16_function_arg_regno_p (int);
|
32 |
|
|
|
33 |
|
|
#ifdef TREE_CODE
|
34 |
|
|
#ifdef RTX_CODE
|
35 |
|
|
|
36 |
|
|
extern void cr16_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx);
|
37 |
|
|
|
38 |
|
|
#endif /* RTX_CODE. */
|
39 |
|
|
#endif /* TREE_CODE. */
|
40 |
|
|
|
41 |
|
|
/* Enumeration giving the various data models we support. */
|
42 |
|
|
enum data_model_type
|
43 |
|
|
{
|
44 |
|
|
DM_DEFAULT, /* Default data model (in CR16C/C+ - up to 16M). */
|
45 |
|
|
DM_NEAR, /* Near data model (in CR16C/C+ - up to 1M). */
|
46 |
|
|
DM_FAR, /* Far data model (in CR16C+ - up to 4G)
|
47 |
|
|
(in CR16C - up to 16M). */
|
48 |
|
|
ILLEGAL_DM /* Illegal data model. */
|
49 |
|
|
};
|
50 |
|
|
|
51 |
|
|
#ifdef RTX_CODE
|
52 |
|
|
|
53 |
|
|
/* Addressing Modes. */
|
54 |
|
|
struct cr16_address
|
55 |
|
|
{
|
56 |
|
|
rtx base; /* Base register: Any register or register pair. */
|
57 |
|
|
rtx index; /* Index register: If one is present. */
|
58 |
|
|
rtx disp; /* Displacement or Absolute address. */
|
59 |
|
|
enum data_model_type data; /* data ref type. */
|
60 |
|
|
int code; /* Whether the address is code address.
|
61 |
|
|
|
62 |
|
|
};
|
63 |
|
|
|
64 |
|
|
enum cr16_addrtype
|
65 |
|
|
{
|
66 |
|
|
CR16_INVALID,
|
67 |
|
|
CR16_REG_REL,
|
68 |
|
|
CR16_REGP_REL,
|
69 |
|
|
CR16_INDEX_REGP_REL,
|
70 |
|
|
CR16_ABSOLUTE
|
71 |
|
|
};
|
72 |
|
|
|
73 |
|
|
extern void notice_update_cc PARAMS ((rtx));
|
74 |
|
|
extern int cr16_operand_bit_pos (int val, int bitval);
|
75 |
|
|
extern void cr16_decompose_const (rtx x, int *code,
|
76 |
|
|
enum data_model_type *data,
|
77 |
|
|
bool treat_as_const);
|
78 |
|
|
extern enum cr16_addrtype cr16_decompose_address (rtx addr,
|
79 |
|
|
struct cr16_address *out,
|
80 |
|
|
bool debug_print,
|
81 |
|
|
bool treat_as_const);
|
82 |
|
|
extern int cr16_const_double_ok (rtx op);
|
83 |
|
|
extern int legitimate_pic_operand_p (rtx);
|
84 |
|
|
extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx);
|
85 |
|
|
|
86 |
|
|
#endif /* RTX_CODE. */
|
87 |
|
|
|
88 |
|
|
|
89 |
|
|
/* Prologue/Epilogue functions. */
|
90 |
|
|
extern int cr16_initial_elimination_offset (int, int);
|
91 |
|
|
extern char *cr16_prepare_push_pop_string (int);
|
92 |
|
|
extern void cr16_expand_prologue (void);
|
93 |
|
|
extern void cr16_expand_epilogue (void);
|
94 |
|
|
extern const char *cr16_emit_add_sub_di (rtx *, enum rtx_code);
|
95 |
|
|
extern const char *cr16_emit_logical_di (rtx *, enum rtx_code);
|
96 |
|
|
|
97 |
|
|
/* Handling the "interrupt" attribute. */
|
98 |
|
|
extern int cr16_interrupt_function_p (void);
|
99 |
|
|
extern bool cr16_is_data_model (enum data_model_type);
|
100 |
|
|
|
101 |
|
|
#endif /* Not GCC_CR16_PROTOS_H. */
|