Rebase.
[official-gcc.git] / gcc / config / m32c / constraints.md
blob7ac0bf948e3c7d4c095629f5acbfdc06c0c60d2e
1 ;; m32c constraints
2 ;; Copyright (C) 2012-2014 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 by
8 ;; the Free Software Foundation; either version 3, or (at your option)
9 ;; 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 (define_register_constraint "Rsp" "SP_REGS"
21   "@internal")
23 (define_register_constraint "Rfb" "FB_REGS"
24   "@internal")
26 (define_register_constraint "Rsb" "SB_REGS"
27   "@internal")
29 (define_register_constraint "Rcr" "TARGET_A16 ? CR_REGS : NO_REGS"
30   "@internal")
32 (define_register_constraint "Rcl" "TARGET_A24 ? CR_REGS : NO_REGS"
33   "@internal")
35 (define_register_constraint "R0w" "R0_REGS"
36   "@internal")
38 (define_register_constraint "R1w" "R1_REGS"
39   "@internal")
41 (define_register_constraint "R2w" "R2_REGS"
42   "@internal")
44 (define_register_constraint "R3w" "R3_REGS"
45   "@internal")
47 (define_register_constraint "R02" "R02_REGS"
48   "@internal")
50 (define_register_constraint "R13" "R13_REGS"
51   "@internal")
53 (define_register_constraint "R03" "R03_REGS"
54   "@internal")
56 (define_register_constraint "Rdi" "DI_REGS"
57   "@internal")
59 (define_register_constraint "Rhl" "HL_REGS"
60   "@internal")
62 (define_register_constraint "R23" "R23_REGS"
63   "@internal")
65 (define_register_constraint "Ra0" "A0_REGS"
66   "@internal")
68 (define_register_constraint "Ra1" "A1_REGS"
69   "@internal")
71 (define_register_constraint "Raa" "A_REGS"
72   "@internal")
74 (define_register_constraint "Raw" "TARGET_A16 ? A_REGS : NO_REGS"
75   "@internal")
77 (define_register_constraint "Ral" "TARGET_A24 ? A_REGS : NO_REGS"
78   "@internal")
80 (define_register_constraint "Rqi" "QI_REGS"
81   "@internal")
83 (define_register_constraint "Rad" "AD_REGS"
84   "@internal")
86 (define_register_constraint "Rsi" "SI_REGS"
87   "@internal")
89 (define_register_constraint "Rhi" "HI_REGS"
90   "@internal")
92 (define_register_constraint "Rhc" "HC_REGS"
93   "@internal")
95 (define_register_constraint "Rra" "RA_REGS"
96   "@internal")
98 (define_register_constraint "Rfl" "FLG_REGS"
99   "@internal")
101 (define_register_constraint "Rmm" "fixed_regs[MEM0_REGNO] ? NO_REGS : MEM_REGS"
102   "@internal")
104 (define_register_constraint "Rpi" "TARGET_A16 ? HI_REGS : RA_REGS"
105   "@internal")
107 ;;; For integer constant constraints:
108 ;;; s=signed u=unsigned n=nonzero m=minus l=log2able,
109 ;;; [sun] bits [SUN] bytes, p=pointer size
110 ;;; I[-0-9][0-9] matches that number
112 (define_constraint "Is3"
113   "@internal"
114   (and (match_code "const_int")
115        (match_test "IN_RANGE (ival, -8, 7)")))
117 (define_constraint "IS1"
118   "@internal"
119   (and (match_code "const_int")
120        (match_test "IN_RANGE (ival, -128, 127)")))
122 (define_constraint "IS2"
123   "@internal"
124   (and (match_code "const_int")
125        (match_test "IN_RANGE (ival, -32768, 32767)")))
127 (define_constraint "IU2"
128   "@internal"
129   (and (match_code "const_int")
130        (match_test "IN_RANGE (ival, 0, 65535)")))
132 (define_constraint "IU3"
133   "@internal"
134   (and (match_code "const_int")
135        (match_test "IN_RANGE (ival, 0, 0x00ffffff)")))
137 (define_constraint "In4"
138   "@internal"
139   (and (match_code "const_int")
140        (match_test "IN_RANGE (ival, -8, 8) && ival")))
142 (define_constraint "In5"
143   "@internal"
144   (and (match_code "const_int")
145        (match_test "IN_RANGE (ival, -16, 16) && ival")))
147 (define_constraint "In6"
148   "@internal"
149   (and (match_code "const_int")
150        (match_test "IN_RANGE (ival, -32, 32) && ival")))
152 (define_constraint "IM2"
153   "@internal"
154   (and (match_code "const_int")
155        (match_test "IN_RANGE (ival, -65536, -1)")))
157 (define_constraint "Ilb"
158   "@internal"
159   (and (match_code "const_int")
160        (match_test "IN_RANGE (exact_log2 (ival), 0, 7)")))
162 (define_constraint "Imb"
163   "@internal"
164   (and (match_code "const_int")
165        (match_test "IN_RANGE (exact_log2 ((ival ^ 0xff) & 0xff), 0, 7)")))
167 (define_constraint "ImB"
168   "@internal"
169   (and (match_code "const_int")
170        (match_test "IN_RANGE (exact_log2 ((ival ^ 0xffff) & 0xffff), 0, 7)")))
172 (define_constraint "Ilw"
173   "@internal"
174   (and (match_code "const_int")
175        (match_test "IN_RANGE (exact_log2 (ival), 0, 15)")))
177 (define_constraint "Imw"
178   "@internal"
179   (and (match_code "const_int")
180        (match_test "IN_RANGE (exact_log2 ((ival ^ 0xffff) & 0xffff), 0, 15)")))
182 (define_constraint "I00"
183   "@internal"
184   (and (match_code "const_int")
185        (match_test "ival == 0")))
187 (define_memory_constraint "SF"
188   "@internal"
189   (match_test "m32c_matches_constraint_p (op, CONSTRAINT_SF)"))
191 (define_memory_constraint "Sd"
192   "@internal"
193   (match_test "m32c_matches_constraint_p (op, CONSTRAINT_Sd)"))
195 (define_memory_constraint "Sa"
196   "@internal"
197   (match_test "m32c_matches_constraint_p (op, CONSTRAINT_Sa)"))
199 (define_memory_constraint "Si"
200   "@internal"
201   (match_test "m32c_matches_constraint_p (op, CONSTRAINT_Si)"))
203 (define_memory_constraint "Ss"
204   "@internal"
205   (match_test "m32c_matches_constraint_p (op, CONSTRAINT_Ss)"))
207 (define_memory_constraint "Sf"
208   "@internal"
209   (match_test "m32c_matches_constraint_p (op, CONSTRAINT_Sf)"))
211 (define_memory_constraint "Sb"
212   "@internal"
213   (match_test "m32c_matches_constraint_p (op, CONSTRAINT_Sb)"))
215 (define_memory_constraint "Sp"
216   "@internal"
217   (match_test "m32c_matches_constraint_p (op, CONSTRAINT_Sp)"))
219 (define_memory_constraint "S1"
220   "@internal"
221   (match_test "m32c_matches_constraint_p (op, CONSTRAINT_S1)"))
223 (define_constraint "Rpa"
224   "@internal"
225   (match_test "m32c_matches_constraint_p (op, CONSTRAINT_Rpa)"))