comparison gcc/config/score/score-conv.h @ 0:a06113de4d67

first commit
author kent <kent@cr.ie.u-ryukyu.ac.jp>
date Fri, 17 Jul 2009 14:47:48 +0900
parents
children 77e2b8dfacca
comparison
equal deleted inserted replaced
-1:000000000000 0:a06113de4d67
1 /* score-conv.h for Sunplus S+CORE processor
2 Copyright (C) 2005, 2007 Free Software Foundation, Inc.
3
4 This file is part of GCC.
5
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.
10
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.
15
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/>. */
19
20 #ifndef GCC_SCORE_CONV_H
21 #define GCC_SCORE_CONV_H
22
23 extern int target_flags;
24
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;
29
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
34
35 #define CE_REG_FIRST 48U
36 #define CE_REG_LAST 49U
37 #define CE_REG_NUM (CE_REG_LAST - CE_REG_FIRST + 1U)
38
39 #define ARG_REG_FIRST 4U
40 #define ARG_REG_LAST 7U
41 #define ARG_REG_NUM (ARG_REG_LAST - ARG_REG_FIRST + 1U)
42
43 #define REG_CONTAIN(REGNO, FIRST, NUM) \
44 ((unsigned int)((int) (REGNO) - (FIRST)) < (NUM))
45
46 #define GP_REG_P(REGNO) REG_CONTAIN (REGNO, GP_REG_FIRST, GP_REG_NUM)
47
48 #define G8_REG_P(REGNO) REG_CONTAIN (REGNO, GP_REG_FIRST, 8)
49
50 #define G16_REG_P(REGNO) REG_CONTAIN (REGNO, GP_REG_FIRST, 16)
51
52 #define CE_REG_P(REGNO) REG_CONTAIN (REGNO, CE_REG_FIRST, CE_REG_NUM)
53
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)
61
62 #define UIMM_IN_RANGE(V, W) ((V) >= 0 && (V) < ((HOST_WIDE_INT) 1 << (W)))
63
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))))
67
68 #define IMM_IN_RANGE(V, W, S) \
69 ((S) ? SIMM_IN_RANGE (V, W) : UIMM_IN_RANGE (V, W))
70
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)
75
76 enum score_symbol_type
77 {
78 SYMBOL_GENERAL,
79 SYMBOL_SMALL_DATA /* The symbol refers to something in a small data section */
80 };
81
82 #endif