OSDN Git Service

* config/m32c/m32c.c (m32c_hard_regno_nregs_1): Renamed from...
[pf3gnuchains/gcc-fork.git] / gcc / config / ia64 / constraints.md
1 ;; Constraint definitions for IA-64
2 ;; Copyright (C) 2006, 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
7 ;; it 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.
10 ;;
11 ;; GCC is distributed in the hope that it will be useful,
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 ;; GNU General Public 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 ;; Register constraints
21
22 (define_register_constraint "a" "ADDL_REGS"
23   "addl register")
24
25 (define_register_constraint "b" "BR_REGS"
26   "branch register")
27
28 (define_register_constraint "c" "PR_REGS"
29   "predicate register")
30
31 (define_register_constraint "d" "AR_M_REGS"
32   "memory pipeline application register")
33
34 (define_register_constraint "e" "AR_I_REGS"
35   "integer pipeline application register")
36
37 (define_register_constraint "f" "FR_REGS"
38   "floating-point register")
39
40 (define_register_constraint "x" "FP_REGS"
41   "floating-point register, excluding f31 and f127, used for fldp")
42
43 ;; Integer constraints
44
45 (define_constraint "I"
46   "14 bit signed immediate for arithmetic instructions"
47   (and (match_code "const_int")
48        (match_test "(unsigned HOST_WIDE_INT)ival + 0x2000 < 0x4000")))
49
50 (define_constraint "J"
51   "22 bit signed immediate for arith instructions with r0/r1/r2/r3 source"
52   (and (match_code "const_int")
53        (match_test "(unsigned HOST_WIDE_INT)ival + 0x200000 < 0x400000")))
54
55 (define_constraint "K"
56   "8 bit signed immediate for logical instructions"
57   (and (match_code "const_int")
58        (match_test "(unsigned HOST_WIDE_INT)ival + 0x80 < 0x100")))
59
60 (define_constraint "L"
61   "8 bit adjusted signed immediate for compare pseudo-ops"
62   (and (match_code "const_int")
63        (match_test "(unsigned HOST_WIDE_INT)ival + 0x7F < 0x100")))
64
65 (define_constraint "M"
66   "6 bit unsigned immediate for shift counts"
67   (and (match_code "const_int")
68        (match_test "(unsigned HOST_WIDE_INT)ival < 0x40")))
69
70 (define_constraint "N"
71   "9 bit signed immediate for load/store post-increments"
72   (and (match_code "const_int")
73        (match_test "(unsigned HOST_WIDE_INT)ival + 0x100 < 0x200")))
74
75 (define_constraint "O"
76   "constant zero"
77   (and (match_code "const_int")
78        (match_test "ival == 0")))
79
80 (define_constraint "P"
81   "0 or -1 for dep instruction"
82   (and (match_code "const_int")
83        (match_test "ival == 0 || ival == -1")))
84
85 ;; Floating-point constraints
86
87 (define_constraint "G"
88   "0.0 and 1.0 for fr0 and fr1"
89   (and (match_code "const_double")
90        (match_test "op == CONST0_RTX (mode) || op == CONST1_RTX (mode)")))
91
92 (define_constraint "H"
93   "0.0"
94   (and (match_code "const_double")
95        (match_test "op == CONST0_RTX (mode)")))
96
97 ;; Extra constraints
98
99 ;; Note that while this accepts mem, it only accepts non-volatile mem,
100 ;; and so cannot be "fixed" by adjusting the address.  Thus it cannot
101 ;; and does not use define_memory_constraint.
102 (define_constraint "Q"
103   "Non-volatile memory for FP_REG loads/stores"
104   (and (match_operand 0 "memory_operand")
105        (match_test "!MEM_VOLATILE_P (op)")))
106
107 (define_constraint "R"
108   "1..4 for shladd arguments"
109   (and (match_code "const_int")
110        (match_test "ival >= 1 && ival <= 4")))
111
112 (define_constraint "T"
113   "Symbol ref to small-address-area"
114   (match_operand 0 "small_addr_symbolic_operand"))
115
116 (define_constraint "U"
117   "vector zero constant"
118   (and (match_code "const_vector")
119        (match_test "op == CONST0_RTX (mode)")))
120
121 (define_constraint "W"
122   "An integer vector, such that conversion to an integer yields a
123    value appropriate for an integer 'J' constraint."
124   (and (match_code "const_vector")
125        (match_test "GET_MODE_CLASS (mode) == MODE_VECTOR_INT")
126        (match_test
127         "satisfies_constraint_J (simplify_subreg (DImode, op, mode, 0))")))
128
129 (define_constraint "Y"
130   "A V2SF vector containing elements that satisfy 'G'"
131   (and (match_code "const_vector")
132        (match_test "mode == V2SFmode")
133        (match_test "satisfies_constraint_G (XVECEXP (op, 0, 0))")
134        (match_test "satisfies_constraint_G (XVECEXP (op, 0, 1))")))
135
136 ;; Memory constraints
137
138 (define_memory_constraint "S"
139   "Non-post-inc memory for asms and other unsavory creatures"
140   (and (match_code "mem")
141        (match_test "GET_RTX_CLASS (GET_CODE (XEXP (op, 0))) != RTX_AUTOINC")))