OSDN Git Service

2008-04-03 Jan Hubicka <jh@suse.cz>
[pf3gnuchains/gcc-fork.git] / gcc / config / m68k / constraints.md
1 ;; Constraint definitions for m68k
2 ;; Copyright (C) 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 (define_register_constraint "a" "ADDR_REGS"
21   "Address register.")
22
23 (define_register_constraint "d" "DATA_REGS"
24   "Data register.")
25
26 (define_register_constraint "f" "TARGET_HARD_FLOAT ? FP_REGS : NO_REGS"
27   "Floating point register.")
28
29 (define_constraint "I"
30   "Integer constant in the range 1 @dots 8, for immediate shift counts and addq."
31   (and (match_code "const_int")
32        (match_test "ival > 0 && ival <= 8")))
33
34 (define_constraint "J"
35   "Signed 16-bit integer constant."
36   (and (match_code "const_int")
37        (match_test "ival >= -0x8000 && ival <= 0x7fff")))
38
39 (define_constraint "K"
40   "Integer constant that moveq can't handle."
41   (and (match_code "const_int")
42        (match_test "ival < -0x80 || ival >= 0x80")))
43
44 (define_constraint "L"
45   "Integer constant in the range -8 @dots -1, for subq."
46   (and (match_code "const_int")
47        (match_test "ival < 0 && ival >= -8")))
48
49 (define_constraint "M"
50   "Integer constant that moveq+notb can't handle."
51   (and (match_code "const_int")
52        (match_test "ival < -0x100 || ival >= 0x100")))
53
54 (define_constraint "N"
55   "Integer constant in the range 24 @dots 31, for rotatert:SI 8 to 1 expressed as rotate."
56   (and (match_code "const_int")
57        (match_test "ival >= 24 && ival <= 31")))
58
59 (define_constraint "O"
60   "Integer constant 16, for rotate using swap."
61   (and (match_code "const_int")
62        (match_test "ival == 16")))
63
64 (define_constraint "P"
65   "Integer constant in the range 8 @dots 15, for rotatert:HI 8 to 1 expressed as rotate."
66   (and (match_code "const_int")
67        (match_test "ival >= 8 && ival <= 15")))
68
69 (define_constraint "R"
70   "Integer constant that mov3q can handle."
71   (and (match_code "const_int")
72        (match_test "valid_mov3q_const (ival)")))
73
74 (define_constraint "G"
75   "Defines all of the floating constants that are *NOT* 68881
76    constants.  This is so 68881 constants get reloaded and the fpmovecr
77    is used."
78   (and (match_code "const_double")
79        (match_test "!(TARGET_68881 && standard_68881_constant_p (op))")))
80
81 (define_constraint "S"
82   "Used for operands that satisfy 'm' when -mpcrel is in effect."
83   (and (match_code "mem")
84        (match_test "TARGET_PCREL
85                     && (GET_CODE (XEXP (op, 0)) == SYMBOL_REF
86                         || GET_CODE (XEXP (op, 0)) == LABEL_REF
87                         || GET_CODE (XEXP (op, 0)) == CONST)")))
88
89 (define_constraint "T"
90   "Used for operands that satisfy 's' when -mpcrel is not in effect."
91   (and (match_code "symbol_ref,label_ref,const")
92        (match_test "!flag_pic")))
93
94 (define_memory_constraint "Q"
95   "Means address register indirect addressing mode."
96   (and (match_code "mem")
97        (match_test "m68k_matches_q_p (op)")))
98
99 (define_constraint "U"
100   "Used for register offset addressing."
101   (and (match_code "mem")
102        (match_test "m68k_matches_u_p (op)")))
103
104 (define_constraint "W"
105   "Used for const_call_operands."
106   (match_operand 0 "const_call_operand"))
107
108 (define_constraint "Cs"
109   "symbol_ref or const."
110   (match_code "symbol_ref,const"))
111
112 (define_constraint "Ci"
113   "const_int."
114   (and (match_code "const_int")
115        (match_test "true")))
116
117 (define_constraint "C0"
118   "const_int 0."
119   (and (match_code "const_int")
120        (match_test "ival == 0")))
121
122 (define_constraint "Cj"
123   "Range of signed numbers that don't fit in 16 bits."
124   (and (match_code "const_int")
125        (match_test "ival < -0x8000 || ival > 0x7FFF")))
126
127 (define_constraint "CQ"
128   "Integers valid for mvq."
129   (and (match_code "const_int")
130        (match_test "m68k_const_method (ival) == MOVQ")))
131
132 (define_constraint "CW"
133   "Integers valid for a moveq followed by a swap."
134   (and (match_code "const_int")
135        (match_test "m68k_const_method (ival) == SWAP")))
136
137 (define_constraint "CZ"
138   "Integers valid for mvz."
139   (and (match_code "const_int")
140        (match_test "m68k_const_method (ival) == MVZ")))
141
142 (define_constraint "CS"
143   "Integers valid for mvs."
144   (and (match_code "const_int")
145        (match_test "m68k_const_method (ival) == MVS")))
146
147 (define_constraint "Ap"
148   "push_operand."
149   (match_operand 0 "push_operand"))
150
151 (define_constraint "Ac"
152   "Non-register operands allowed in clr."
153   (and (match_operand 0 "movsi_const0_operand")
154        (match_test "!REG_P (op)")))