Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/spu/constraints.md @ 0:a06113de4d67
first commit
author | kent <kent@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 17 Jul 2009 14:47:48 +0900 |
parents | |
children | 3bfb6c00c1e0 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:a06113de4d67 |
---|---|
1 ;; Constraint definitions for SPU | |
2 ;; Copyright (C) 2006, 2007 Free Software Foundation, Inc. | |
3 ;; | |
4 ;; This file is free software; you can redistribute it and/or modify it under | |
5 ;; the terms of the GNU General Public License as published by the Free | |
6 ;; Software Foundation; either version 3 of the License, or (at your option) | |
7 ;; any later version. | |
8 | |
9 ;; This file is distributed in the hope that it will be useful, but WITHOUT | |
10 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 ;; for more details. | |
13 | |
14 ;; You should have received a copy of the GNU General Public License | |
15 ;; along with GCC; see the file COPYING3. If not see | |
16 ;; <http://www.gnu.org/licenses/>. | |
17 | |
18 | |
19 ;; GCC standard constraints: g, i, m, n, o, p, r, s, E-H, I-P, V, X | |
20 ;; unused for SPU: E-H, L, Q, d, e, h, q, t-z | |
21 | |
22 ;; For most immediate constraints we have 3 variations to deal with the | |
23 ;; fact const_int has no mode. One variation treats const_int as 32 bit, | |
24 ;; another treats it as 64 bit, and the third sign extends it to 128 bit. | |
25 | |
26 (define_constraint "A" | |
27 "An immediate which can be loaded with the il/ila/ilh/ilhu instructions. const_int is treated as a 32-bit value." | |
28 (ior (and (match_code "const_int,const_double,const_vector") | |
29 (match_test "immediate_load_p (op, SImode)")) | |
30 (match_code "symbol_ref,label_ref,high,const"))) | |
31 | |
32 (define_constraint "B" | |
33 "An immediate for arithmetic instructions (e.g., ai, ceqi). const_int is treated as a 32-bit value." | |
34 (and (match_code "const_int,const_double,const_vector") | |
35 (match_test "arith_immediate_p (op, SImode, -0x200, 0x1ff)"))) | |
36 | |
37 (define_constraint "C" | |
38 "An immediate for and/xor/or instructions. const_int is treated as a 32-bit value." | |
39 (and (match_code "const_int,const_double,const_vector") | |
40 (match_test "logical_immediate_p (op, SImode)"))) | |
41 | |
42 (define_constraint "D" | |
43 "An immediate for iohl instruction. const_int is treated as a 32-bit value." | |
44 (and (match_code "const_int,const_double,const_vector") | |
45 (match_test "iohl_immediate_p (op, SImode)"))) | |
46 | |
47 (define_constraint "U" | |
48 "An immediate which can be loaded with the il/ila/ilh/ilhu instructions. const_int is sign extended to 128 bit." | |
49 (and (match_code "const_int,const_double,const_vector") | |
50 (match_test "immediate_load_p (op, TImode)"))) | |
51 | |
52 (define_constraint "W" | |
53 "An immediate for shift and rotate instructions. const_int is treated as a 32-bit value." | |
54 (and (match_code "const_int,const_double,const_vector") | |
55 (match_test "arith_immediate_p (op, SImode, -0x80000000ll, 0x7fffffffll)"))) | |
56 | |
57 (define_constraint "Y" | |
58 "An immediate for and/xor/or instructions. const_int is sign extended as a 128 bit." | |
59 (and (match_code "const_int,const_double,const_vector") | |
60 (match_test "logical_immediate_p (op, TImode)"))) | |
61 | |
62 (define_constraint "Z" | |
63 "An immediate for iohl instruction. const_int is sign extended to 128 bit." | |
64 (and (match_code "const_int,const_double,const_vector") | |
65 (match_test "iohl_immediate_p (op, TImode)"))) | |
66 | |
67 (define_constraint "a" | |
68 "An immediate which can be loaded with the il/ila/ilh/ilhu instructions. const_int is treated as a 64-bit value." | |
69 (and (match_code "const_int") | |
70 (match_test "immediate_load_p (op, DImode)"))) | |
71 | |
72 (define_constraint "c" | |
73 "An immediate for and/xor/or instructions. const_int is treated as a 64-bit value." | |
74 (and (match_code "const_int") | |
75 (match_test "logical_immediate_p (op, DImode)"))) | |
76 | |
77 (define_constraint "d" | |
78 "An immediate for iohl instruction. const_int is treated as a 64-bit value." | |
79 (and (match_code "const_int") | |
80 (match_test "iohl_immediate_p (op, DImode)"))) | |
81 | |
82 (define_constraint "f" | |
83 "An immediate which can be loaded with fsmbi." | |
84 (and (match_code "const_int,const_double,const_vector") | |
85 (match_test "fsmbi_const_p (op)"))) | |
86 | |
87 (define_constraint "j" | |
88 "An immediate which can be loaded with one of the cbd/chd/cwd/cdd instructions. const_int is treated as a 32-bit value." | |
89 (and (match_code "const_int,const_double,const_vector") | |
90 (match_test "cpat_const_p (op, SImode)"))) | |
91 | |
92 (define_constraint "k" | |
93 "An immediate which can be loaded with one of the cbd/chd/cwd/cdd instructions. const_int is treated as a 64-bit value." | |
94 (and (match_code "const_int,const_double,const_vector") | |
95 (match_test "cpat_const_p (op, DImode)"))) | |
96 | |
97 (define_constraint "l" | |
98 "An immediate which can be loaded with one of the cbd/chd/cwd/cdd instructions." | |
99 (and (match_code "const_double,const_vector") | |
100 (match_test "cpat_const_p (op, TImode)"))) | |
101 | |
102 | |
103 ;; Integer constraints | |
104 | |
105 (define_constraint "I" | |
106 "A constant in the range [-64, 63] for shift/rotate instructions." | |
107 (and (match_code "const_int") | |
108 (match_test "ival >= -0x40 && ival <= 0x3f"))) | |
109 | |
110 (define_constraint "J" | |
111 "An unsigned 7-bit constant for conversion/nop/channel instructions." | |
112 (and (match_code "const_int") | |
113 (match_test "ival >= 0 && ival <= 0x7f"))) | |
114 | |
115 (define_constraint "K" | |
116 "A signed 10-bit constant for most arithmetic instructions." | |
117 (and (match_code "const_int") | |
118 (match_test "ival >= -0x200 && ival <= 0x1ff"))) | |
119 | |
120 (define_constraint "M" | |
121 "A signed 16-bit immediate for @code{stop}." | |
122 (and (match_code "const_int") | |
123 (match_test "ival >= -0x8000ll && ival <= 0x7fffll"))) | |
124 | |
125 (define_constraint "N" | |
126 "An unsigned 16-bit constant for @code{iohl} and @code{fsmbi}." | |
127 (and (match_code "const_int") | |
128 (match_test "ival >= 0 && ival <= 0xffff"))) | |
129 | |
130 (define_constraint "O" | |
131 "An unsigned 7-bit constant whose 3 least significant bits are 0." | |
132 (and (match_code "const_int") | |
133 (match_test "(ival & 7) == 0"))) | |
134 | |
135 (define_constraint "P" | |
136 "An unsigned 3-bit constant for 16-byte rotates and shifts" | |
137 (and (match_code "const_int") | |
138 (match_test "ival >= 0 && ival <= 7"))) | |
139 | |
140 | |
141 ;; Memory constraints | |
142 | |
143 (define_memory_constraint "R" | |
144 "Call operand, reg, for indirect calls" | |
145 (and (match_code "mem") | |
146 (match_test "GET_CODE(XEXP(op, 0)) == REG"))) | |
147 | |
148 (define_memory_constraint "S" | |
149 "Call operand, symbol, for relative calls." | |
150 (and (match_code "mem") | |
151 (match_test "!TARGET_LARGE_MEM | |
152 && ((GET_CODE (XEXP (op, 0)) == SYMBOL_REF | |
153 || GET_CODE (XEXP (op, 0)) == LABEL_REF))"))) | |
154 | |
155 (define_memory_constraint "T" | |
156 "Call operand, const_int, for absolute calls." | |
157 (and (match_code "mem") | |
158 (match_test "GET_CODE (XEXP (op, 0)) == CONST_INT | |
159 && INTVAL (XEXP (op, 0)) >= 0 | |
160 && INTVAL (XEXP (op, 0)) <= 0x3ffff"))) | |
161 | |
162 |