tm.texi (LEGITIMIZE_ADDRESS): Revise documentation.
[official-gcc.git] / gcc / config / score / score-conv.h
blob67855da895e1d1f70809ba87cdc730601e4a30b5
1 /* score-conv.h for Sunplus S+CORE processor
2 Copyright (C) 2005, 2007 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published
8 by the Free Software Foundation; either version 3, or (at your
9 option) any later version.
11 GCC is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 #ifndef GCC_SCORE_CONV_H
21 #define GCC_SCORE_CONV_H
23 extern int target_flags;
25 /* Define the information needed to generate branch insns. This is
26 stored from the compare operation. */
27 extern GTY(()) rtx cmp_op0;
28 extern GTY(()) rtx cmp_op1;
30 #define GP_REG_FIRST 0U
31 #define GP_REG_LAST 31U
32 #define GP_REG_NUM (GP_REG_LAST - GP_REG_FIRST + 1U)
33 #define GP_DBX_FIRST 0U
35 #define CE_REG_FIRST 48U
36 #define CE_REG_LAST 49U
37 #define CE_REG_NUM (CE_REG_LAST - CE_REG_FIRST + 1U)
39 #define ARG_REG_FIRST 4U
40 #define ARG_REG_LAST 7U
41 #define ARG_REG_NUM (ARG_REG_LAST - ARG_REG_FIRST + 1U)
43 #define REG_CONTAIN(REGNO, FIRST, NUM) \
44 ((unsigned int)((int) (REGNO) - (FIRST)) < (NUM))
46 #define GP_REG_P(REGNO) REG_CONTAIN (REGNO, GP_REG_FIRST, GP_REG_NUM)
48 #define G8_REG_P(REGNO) REG_CONTAIN (REGNO, GP_REG_FIRST, 8)
50 #define G16_REG_P(REGNO) REG_CONTAIN (REGNO, GP_REG_FIRST, 16)
52 #define CE_REG_P(REGNO) REG_CONTAIN (REGNO, CE_REG_FIRST, CE_REG_NUM)
54 #define GR_REG_CLASS_P(C) ((C) == G16_REGS || (C) == G32_REGS)
55 #define SP_REG_CLASS_P(C) \
56 ((C) == CN_REG || (C) == LC_REG || (C) == SC_REG || (C) == SP_REGS)
57 #define CP_REG_CLASS_P(C) \
58 ((C) == CP1_REGS || (C) == CP2_REGS || (C) == CP3_REGS || (C) == CPA_REGS)
59 #define CE_REG_CLASS_P(C) \
60 ((C) == HI_REG || (C) == LO_REG || (C) == CE_REGS)
62 #define UIMM_IN_RANGE(V, W) ((V) >= 0 && (V) < ((HOST_WIDE_INT) 1 << (W)))
64 #define SIMM_IN_RANGE(V, W) \
65 ((V) >= (-1 * ((HOST_WIDE_INT) 1 << ((W) - 1))) \
66 && (V) < (1 * ((HOST_WIDE_INT) 1 << ((W) - 1))))
68 #define IMM_IN_RANGE(V, W, S) \
69 ((S) ? SIMM_IN_RANGE (V, W) : UIMM_IN_RANGE (V, W))
71 #define IMM_IS_POW_OF_2(V, E1, E2) \
72 ((V) >= ((unsigned HOST_WIDE_INT) 1 << (E1)) \
73 && (V) <= ((unsigned HOST_WIDE_INT) 1 << (E2)) \
74 && ((V) & ((V) - 1)) == 0)
76 enum score_symbol_type
78 SYMBOL_GENERAL,
79 SYMBOL_SMALL_DATA /* The symbol refers to something in a small data section */
82 #endif