1 ;; Toshiba Media Processor Machine constraints
2 ;; Copyright (C) 2009 Free Software Foundation, Inc.
3 ;; Contributed by Red Hat Inc.
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 by
9 ;; the Free Software Foundation; either version 3, or (at your option)
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/>. */
23 (define_register_constraint "a" "SP_REGS"
26 (define_register_constraint "b" "TP_REGS"
29 (define_register_constraint "c" "CONTROL_REGS"
30 "Any control register.")
32 (define_register_constraint "d" "HILO_REGS"
33 "Either the $hi or the $lo register.")
35 (define_register_constraint "em" "LOADABLE_CR_REGS"
36 "Coprocessor registers that can be directly loaded ($c0-$c15).")
38 (define_register_constraint "ex" "mep_have_copro_copro_moves_p ? CR_REGS : NO_REGS"
39 "Coprocessor registers that can be moved to each other.")
41 (define_register_constraint "er" "mep_have_core_copro_moves_p ? CR_REGS : NO_REGS"
42 "Coprocessor registers that can be moved to core registers.")
44 (define_register_constraint "h" "HI_REGS"
47 (define_register_constraint "j" "RPC_REGS"
50 (define_register_constraint "l" "LO_REGS"
53 (define_register_constraint "t" "TPREL_REGS"
54 "Registers which can be used in $tp-relative addressing.")
56 (define_register_constraint "v" "GP_REGS"
59 (define_register_constraint "x" "CR_REGS"
60 "The coprocessor registers.")
62 (define_register_constraint "y" "CCR_REGS"
63 "The coprocessor control registers.")
65 (define_register_constraint "z" "R0_REGS"
68 (define_register_constraint "A" "USER0_REGS"
69 "User-defined register set A.")
71 (define_register_constraint "B" "USER1_REGS"
72 "User-defined register set B.")
74 (define_register_constraint "C" "USER2_REGS"
75 "User-defined register set C.")
77 (define_register_constraint "D" "USER3_REGS"
78 "User-defined register set D.")
82 (define_constraint "I"
83 "Offsets for $gp-rel addressing."
84 (and (match_code "const_int")
85 (match_test "ival >= -32768 && ival < 32768")))
87 (define_constraint "J"
88 "Constants that can be used directly with boolean insns."
89 (and (match_code "const_int")
90 (match_test "ival >= 0 && ival < 65536")))
92 (define_constraint "K"
93 "Constants that can be moved directly to registers."
94 (and (match_code "const_int")
95 (match_test "ival >= 0 && ival < 0x01000000")))
97 (define_constraint "L"
98 "Small constants that can be added to registers."
99 (and (match_code "const_int")
100 (match_test "ival >= -32 && ival < 32")))
102 (define_constraint "M"
104 (and (match_code "const_int")
105 (match_test "ival >= 0 && ival < 32")))
107 (define_constraint "N"
108 "Small constants that can be compared to registers."
109 (and (match_code "const_int")
110 (match_test "ival >= 0 && ival < 16")))
112 (define_constraint "O"
113 "Constants that can be loaded into the top half of registers."
114 (and (match_code "const_int")
115 (match_test "!(ival & 0xffff) && ival >= -2147483647-1 && ival <= 2147483647")))
117 (define_constraint "S"
118 "Signed 8-bit immediates."
119 (and (match_code "const_int")
120 (match_test "ival >= -128 && ival < 127")))
124 ;; This must only be used with mep_call_address_operand() as the predicate.
125 (define_constraint "R"
127 Near symbols that can be used as addresses for CALL."
128 (not (match_code "reg")))
130 (define_constraint "T"
131 "Symbols encoded for $tp-rel or $gp-rel addressing."
133 (and (match_code "unspec")
134 (match_code "symbol_ref" "a"))
135 (and (match_code "const")
136 (and (match_code "unspec" "0")
137 (match_code "symbol_ref" "0a"))))
138 (and (match_code "const")
139 (and (match_code "plus" "0")
140 (and (match_code "unspec" "00")
141 (match_code "symbol_ref" "00a"))))))
143 (define_constraint "U"
144 "Non-constant addresses for loading/saving coprocessor registers."
145 (and (match_code "mem")
146 (match_test "! CONSTANT_P (XEXP (op, 0))")))
148 (define_constraint "W"
149 "The top half of a symbol's value."
150 (and (match_code "high")
151 (match_code "symbol_ref" "0")))
153 (define_constraint "Y"
154 "A register indirect address without offset."
155 (and (match_code "mem")
156 (match_code "reg" "0")))
158 (define_constraint "Z"
159 "Symbolic references to the control bus."
160 (and (and (match_code "mem")
161 (match_code "symbol_ref" "0"))
162 (match_test "mep_section_tag (op) == 'c'")))