annotate gcc/config/i386/constraints.md @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents 58ad6c70ea60
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 ;; Constraint definitions for IA-32 and x86-64.
111
kono
parents: 19
diff changeset
2 ;; Copyright (C) 2006-2017 Free Software Foundation, Inc.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 ;; This file is part of GCC.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 ;; GCC is free software; you can redistribute it and/or modify
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 ;; it under the terms of the GNU General Public License as published by
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 ;; the Free Software Foundation; either version 3, or (at your option)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 ;; any later version.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 ;; GCC is distributed in the hope that it will be useful,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 ;; GNU General Public License for more details.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 ;; You should have received a copy of the GNU General Public License
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 ;; along with GCC; see the file COPYING3. If not see
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 ;; <http://www.gnu.org/licenses/>.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 ;;; Unused letters:
111
kono
parents: 19
diff changeset
21 ;;; H
kono
parents: 19
diff changeset
22 ;;; h j z
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 ;; Integer register constraints.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 ;; It is not necessary to define 'r' here.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 (define_register_constraint "R" "LEGACY_REGS"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 "Legacy register---the eight integer registers available on all
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 i386 processors (@code{a}, @code{b}, @code{c}, @code{d},
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 @code{si}, @code{di}, @code{bp}, @code{sp}).")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 (define_register_constraint "q" "TARGET_64BIT ? GENERAL_REGS : Q_REGS"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 "Any register accessible as @code{@var{r}l}. In 32-bit mode, @code{a},
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 @code{b}, @code{c}, and @code{d}; in 64-bit mode, any integer register.")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 (define_register_constraint "Q" "Q_REGS"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 "Any register accessible as @code{@var{r}h}: @code{a}, @code{b},
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 @code{c}, and @code{d}.")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 (define_register_constraint "l" "INDEX_REGS"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 "@internal Any register that can be used as the index in a base+index
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 memory access: that is, any general register except the stack pointer.")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 (define_register_constraint "a" "AREG"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 "The @code{a} register.")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 (define_register_constraint "b" "BREG"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 "The @code{b} register.")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 (define_register_constraint "c" "CREG"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 "The @code{c} register.")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 (define_register_constraint "d" "DREG"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 "The @code{d} register.")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 (define_register_constraint "S" "SIREG"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 "The @code{si} register.")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 (define_register_constraint "D" "DIREG"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 "The @code{di} register.")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 (define_register_constraint "A" "AD_REGS"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 "The @code{a} and @code{d} registers, as a pair (for instructions
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 that return half the result in one and half in the other).")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64
19
58ad6c70ea60 update gcc from 4.4.0 to 4.4.1.
kent@firefly.cr.ie.u-ryukyu.ac.jp
parents: 0
diff changeset
65 (define_register_constraint "U" "CLOBBERED_REGS"
58ad6c70ea60 update gcc from 4.4.0 to 4.4.1.
kent@firefly.cr.ie.u-ryukyu.ac.jp
parents: 0
diff changeset
66 "The call-clobbered integer registers.")
58ad6c70ea60 update gcc from 4.4.0 to 4.4.1.
kent@firefly.cr.ie.u-ryukyu.ac.jp
parents: 0
diff changeset
67
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 ;; Floating-point register constraints.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 (define_register_constraint "f"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 "TARGET_80387 || TARGET_FLOAT_RETURNS_IN_80387 ? FLOAT_REGS : NO_REGS"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 "Any 80387 floating-point (stack) register.")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 (define_register_constraint "t"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 "TARGET_80387 || TARGET_FLOAT_RETURNS_IN_80387 ? FP_TOP_REG : NO_REGS"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 "Top of 80387 floating-point stack (@code{%st(0)}).")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
76
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 (define_register_constraint "u"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 "TARGET_80387 || TARGET_FLOAT_RETURNS_IN_80387 ? FP_SECOND_REG : NO_REGS"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 "Second from top of 80387 floating-point stack (@code{%st(1)}).")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
80
111
kono
parents: 19
diff changeset
81 (define_register_constraint "Yk" "TARGET_AVX512F ? MASK_EVEX_REGS : NO_REGS"
kono
parents: 19
diff changeset
82 "@internal Any mask register that can be used as predicate, i.e. k1-k7.")
kono
parents: 19
diff changeset
83
kono
parents: 19
diff changeset
84 (define_register_constraint "k" "TARGET_AVX512F ? MASK_REGS : NO_REGS"
kono
parents: 19
diff changeset
85 "@internal Any mask register.")
kono
parents: 19
diff changeset
86
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 ;; Vector registers (also used for plain floating point nowadays).
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 (define_register_constraint "y" "TARGET_MMX ? MMX_REGS : NO_REGS"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 "Any MMX register.")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
90
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 (define_register_constraint "x" "TARGET_SSE ? SSE_REGS : NO_REGS"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 "Any SSE register.")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93
111
kono
parents: 19
diff changeset
94 (define_register_constraint "v" "TARGET_SSE ? ALL_SSE_REGS : NO_REGS"
kono
parents: 19
diff changeset
95 "Any EVEX encodable SSE register (@code{%xmm0-%xmm31}).")
kono
parents: 19
diff changeset
96
kono
parents: 19
diff changeset
97 (define_register_constraint "w" "TARGET_MPX ? BND_REGS : NO_REGS"
kono
parents: 19
diff changeset
98 "@internal Any bound register.")
kono
parents: 19
diff changeset
99
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 ;; We use the Y prefix to denote any number of conditional register sets:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 ;; z First SSE register.
111
kono
parents: 19
diff changeset
102 ;; c SSE inter-unit conversions enabled
kono
parents: 19
diff changeset
103 ;; i SSE2 inter-unit moves to SSE register enabled
kono
parents: 19
diff changeset
104 ;; j SSE2 inter-unit moves from SSE register enabled
kono
parents: 19
diff changeset
105 ;; d any EVEX encodable SSE register for AVX512BW target or any SSE register
kono
parents: 19
diff changeset
106 ;; for SSE4_1 target, when inter-unit moves to SSE register are enabled
kono
parents: 19
diff changeset
107 ;; e any EVEX encodable SSE register for AVX512BW target or any SSE register
kono
parents: 19
diff changeset
108 ;; for SSE4_1 target, when inter-unit moves from SSE register are enabled
kono
parents: 19
diff changeset
109 ;; m MMX inter-unit moves to MMX register enabled
kono
parents: 19
diff changeset
110 ;; n MMX inter-unit moves from MMX register enabled
kono
parents: 19
diff changeset
111 ;; p Integer register when TARGET_PARTIAL_REG_STALL is disabled
kono
parents: 19
diff changeset
112 ;; a Integer register when zero extensions with AND are disabled
kono
parents: 19
diff changeset
113 ;; b Any register that can be used as the GOT base when calling
kono
parents: 19
diff changeset
114 ;; ___tls_get_addr: that is, any general register except EAX
kono
parents: 19
diff changeset
115 ;; and ESP, for -fno-plt if linker supports it. Otherwise,
kono
parents: 19
diff changeset
116 ;; EBX.
kono
parents: 19
diff changeset
117 ;; f x87 register when 80387 floating point arithmetic is enabled
kono
parents: 19
diff changeset
118 ;; r SSE regs not requiring REX prefix when prefixes avoidance is enabled
kono
parents: 19
diff changeset
119 ;; and all SSE regs otherwise
kono
parents: 19
diff changeset
120 ;; v any EVEX encodable SSE register for AVX512VL target,
kono
parents: 19
diff changeset
121 ;; otherwise any SSE register
kono
parents: 19
diff changeset
122 ;; h EVEX encodable SSE register with number factor of four
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
123
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
124 (define_register_constraint "Yz" "TARGET_SSE ? SSE_FIRST_REG : NO_REGS"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 "First SSE register (@code{%xmm0}).")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
126
111
kono
parents: 19
diff changeset
127 (define_register_constraint "Yc"
kono
parents: 19
diff changeset
128 "TARGET_SSE && TARGET_INTER_UNIT_CONVERSIONS ? ALL_SSE_REGS : NO_REGS"
kono
parents: 19
diff changeset
129 "@internal Any SSE register, when SSE and inter-unit conversions are enabled.")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
130
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
131 (define_register_constraint "Yi"
111
kono
parents: 19
diff changeset
132 "TARGET_SSE2 && TARGET_INTER_UNIT_MOVES_TO_VEC ? ALL_SSE_REGS : NO_REGS"
kono
parents: 19
diff changeset
133 "@internal Any SSE register, when SSE2 and inter-unit moves to vector registers are enabled.")
kono
parents: 19
diff changeset
134
kono
parents: 19
diff changeset
135 (define_register_constraint "Yj"
kono
parents: 19
diff changeset
136 "TARGET_SSE2 && TARGET_INTER_UNIT_MOVES_FROM_VEC ? ALL_SSE_REGS : NO_REGS"
kono
parents: 19
diff changeset
137 "@internal Any SSE register, when SSE2 and inter-unit moves from vector registers are enabled.")
kono
parents: 19
diff changeset
138
kono
parents: 19
diff changeset
139 (define_register_constraint "Yd"
kono
parents: 19
diff changeset
140 "TARGET_INTER_UNIT_MOVES_TO_VEC
kono
parents: 19
diff changeset
141 ? (TARGET_AVX512DQ
kono
parents: 19
diff changeset
142 ? ALL_SSE_REGS
kono
parents: 19
diff changeset
143 : (TARGET_SSE4_1 ? SSE_REGS : NO_REGS))
kono
parents: 19
diff changeset
144 : NO_REGS"
kono
parents: 19
diff changeset
145 "@internal Any EVEX encodable SSE register (@code{%xmm0-%xmm31}) for AVX512DQ target or any SSE register for SSE4_1 target, when inter-unit moves to vector registers are enabled.")
kono
parents: 19
diff changeset
146
kono
parents: 19
diff changeset
147 (define_register_constraint "Ye"
kono
parents: 19
diff changeset
148 "TARGET_INTER_UNIT_MOVES_FROM_VEC
kono
parents: 19
diff changeset
149 ? (TARGET_AVX512DQ
kono
parents: 19
diff changeset
150 ? ALL_SSE_REGS
kono
parents: 19
diff changeset
151 : (TARGET_SSE4_1 ? SSE_REGS : NO_REGS))
kono
parents: 19
diff changeset
152 : NO_REGS"
kono
parents: 19
diff changeset
153 "@internal Any EVEX encodable SSE register (@code{%xmm0-%xmm31}) for AVX512DQ target or any SSE register for SSE4_1 target, when inter-unit moves from vector registers are enabled.")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
154
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
155 (define_register_constraint "Ym"
111
kono
parents: 19
diff changeset
156 "TARGET_MMX && TARGET_INTER_UNIT_MOVES_TO_VEC ? MMX_REGS : NO_REGS"
kono
parents: 19
diff changeset
157 "@internal Any MMX register, when inter-unit moves to vector registers are enabled.")
kono
parents: 19
diff changeset
158
kono
parents: 19
diff changeset
159 (define_register_constraint "Yn"
kono
parents: 19
diff changeset
160 "TARGET_MMX && TARGET_INTER_UNIT_MOVES_FROM_VEC ? MMX_REGS : NO_REGS"
kono
parents: 19
diff changeset
161 "@internal Any MMX register, when inter-unit moves from vector registers are enabled.")
kono
parents: 19
diff changeset
162
kono
parents: 19
diff changeset
163 (define_register_constraint "Yp"
kono
parents: 19
diff changeset
164 "TARGET_PARTIAL_REG_STALL ? NO_REGS : GENERAL_REGS"
kono
parents: 19
diff changeset
165 "@internal Any integer register when TARGET_PARTIAL_REG_STALL is disabled.")
kono
parents: 19
diff changeset
166
kono
parents: 19
diff changeset
167 (define_register_constraint "Ya"
kono
parents: 19
diff changeset
168 "TARGET_ZERO_EXTEND_WITH_AND && optimize_function_for_speed_p (cfun)
kono
parents: 19
diff changeset
169 ? NO_REGS : GENERAL_REGS"
kono
parents: 19
diff changeset
170 "@internal Any integer register when zero extensions with AND are disabled.")
kono
parents: 19
diff changeset
171
kono
parents: 19
diff changeset
172 (define_register_constraint "Yb"
kono
parents: 19
diff changeset
173 "(!flag_plt && HAVE_AS_IX86_TLS_GET_ADDR_GOT) ? TLS_GOTBASE_REGS : BREG"
kono
parents: 19
diff changeset
174 "@internal Any register that can be used as the GOT base when calling
kono
parents: 19
diff changeset
175 ___tls_get_addr: that is, any general register except @code{a} and
kono
parents: 19
diff changeset
176 @code{sp} registers, for -fno-plt if linker supports it. Otherwise,
kono
parents: 19
diff changeset
177 @code{b} register.")
kono
parents: 19
diff changeset
178
kono
parents: 19
diff changeset
179 (define_register_constraint "Yf"
kono
parents: 19
diff changeset
180 "(ix86_fpmath & FPMATH_387) ? FLOAT_REGS : NO_REGS"
kono
parents: 19
diff changeset
181 "@internal Any x87 register when 80387 FP arithmetic is enabled.")
kono
parents: 19
diff changeset
182
kono
parents: 19
diff changeset
183 (define_register_constraint "Yr"
kono
parents: 19
diff changeset
184 "TARGET_SSE ? (TARGET_AVOID_4BYTE_PREFIXES ? NO_REX_SSE_REGS : ALL_SSE_REGS) : NO_REGS"
kono
parents: 19
diff changeset
185 "@internal Lower SSE register when avoiding REX prefix and all SSE registers otherwise.")
kono
parents: 19
diff changeset
186
kono
parents: 19
diff changeset
187 (define_register_constraint "Yv"
kono
parents: 19
diff changeset
188 "TARGET_AVX512VL ? ALL_SSE_REGS : TARGET_SSE ? SSE_REGS : NO_REGS"
kono
parents: 19
diff changeset
189 "@internal For AVX512VL, any EVEX encodable SSE register (@code{%xmm0-%xmm31}), otherwise any SSE register.")
kono
parents: 19
diff changeset
190
kono
parents: 19
diff changeset
191 (define_register_constraint "Yh" "TARGET_AVX512F ? MOD4_SSE_REGS : NO_REGS"
kono
parents: 19
diff changeset
192 "@internal Any EVEX encodable SSE register, which has number factor of four.")
kono
parents: 19
diff changeset
193
kono
parents: 19
diff changeset
194 ;; We use the B prefix to denote any number of internal operands:
kono
parents: 19
diff changeset
195 ;; f FLAGS_REG
kono
parents: 19
diff changeset
196 ;; g GOT memory operand.
kono
parents: 19
diff changeset
197 ;; m Vector memory operand
kono
parents: 19
diff changeset
198 ;; c Constant memory operand
kono
parents: 19
diff changeset
199 ;; n Memory operand without REX prefix
kono
parents: 19
diff changeset
200 ;; s Sibcall memory operand, not valid for TARGET_X32
kono
parents: 19
diff changeset
201 ;; w Call memory operand, not valid for TARGET_X32
kono
parents: 19
diff changeset
202 ;; z Constant call address operand.
kono
parents: 19
diff changeset
203 ;; C SSE constant operand.
kono
parents: 19
diff changeset
204
kono
parents: 19
diff changeset
205 (define_constraint "Bf"
kono
parents: 19
diff changeset
206 "@internal Flags register operand."
kono
parents: 19
diff changeset
207 (match_operand 0 "flags_reg_operand"))
kono
parents: 19
diff changeset
208
kono
parents: 19
diff changeset
209 (define_constraint "Bg"
kono
parents: 19
diff changeset
210 "@internal GOT memory operand."
kono
parents: 19
diff changeset
211 (match_operand 0 "GOT_memory_operand"))
kono
parents: 19
diff changeset
212
kono
parents: 19
diff changeset
213 (define_special_memory_constraint "Bm"
kono
parents: 19
diff changeset
214 "@internal Vector memory operand."
kono
parents: 19
diff changeset
215 (match_operand 0 "vector_memory_operand"))
kono
parents: 19
diff changeset
216
kono
parents: 19
diff changeset
217 (define_special_memory_constraint "Bc"
kono
parents: 19
diff changeset
218 "@internal Constant memory operand."
kono
parents: 19
diff changeset
219 (and (match_operand 0 "memory_operand")
kono
parents: 19
diff changeset
220 (match_test "constant_address_p (XEXP (op, 0))")))
kono
parents: 19
diff changeset
221
kono
parents: 19
diff changeset
222 (define_special_memory_constraint "Bn"
kono
parents: 19
diff changeset
223 "@internal Memory operand without REX prefix."
kono
parents: 19
diff changeset
224 (match_operand 0 "norex_memory_operand"))
kono
parents: 19
diff changeset
225
kono
parents: 19
diff changeset
226 (define_constraint "Bs"
kono
parents: 19
diff changeset
227 "@internal Sibcall memory operand."
kono
parents: 19
diff changeset
228 (ior (and (not (match_test "TARGET_X32"))
kono
parents: 19
diff changeset
229 (match_operand 0 "sibcall_memory_operand"))
kono
parents: 19
diff changeset
230 (and (match_test "TARGET_X32 && Pmode == DImode")
kono
parents: 19
diff changeset
231 (match_operand 0 "GOT_memory_operand"))))
kono
parents: 19
diff changeset
232
kono
parents: 19
diff changeset
233 (define_constraint "Bw"
kono
parents: 19
diff changeset
234 "@internal Call memory operand."
kono
parents: 19
diff changeset
235 (ior (and (not (match_test "TARGET_X32"))
kono
parents: 19
diff changeset
236 (match_operand 0 "memory_operand"))
kono
parents: 19
diff changeset
237 (and (match_test "TARGET_X32 && Pmode == DImode")
kono
parents: 19
diff changeset
238 (match_operand 0 "GOT_memory_operand"))))
kono
parents: 19
diff changeset
239
kono
parents: 19
diff changeset
240 (define_constraint "Bz"
kono
parents: 19
diff changeset
241 "@internal Constant call address operand."
kono
parents: 19
diff changeset
242 (match_operand 0 "constant_call_address_operand"))
kono
parents: 19
diff changeset
243
kono
parents: 19
diff changeset
244 (define_constraint "BC"
kono
parents: 19
diff changeset
245 "@internal SSE constant -1 operand."
kono
parents: 19
diff changeset
246 (and (match_test "TARGET_SSE")
kono
parents: 19
diff changeset
247 (ior (match_test "op == constm1_rtx")
kono
parents: 19
diff changeset
248 (match_operand 0 "vector_all_ones_operand"))))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
249
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
250 ;; Integer constant constraints.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
251 (define_constraint "I"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
252 "Integer constant in the range 0 @dots{} 31, for 32-bit shifts."
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
253 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
254 (match_test "IN_RANGE (ival, 0, 31)")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
255
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
256 (define_constraint "J"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
257 "Integer constant in the range 0 @dots{} 63, for 64-bit shifts."
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
258 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
259 (match_test "IN_RANGE (ival, 0, 63)")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
260
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
261 (define_constraint "K"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
262 "Signed 8-bit integer constant."
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
263 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
264 (match_test "IN_RANGE (ival, -128, 127)")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
265
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
266 (define_constraint "L"
111
kono
parents: 19
diff changeset
267 "@code{0xFF}, @code{0xFFFF} or @code{0xFFFFFFFF}
kono
parents: 19
diff changeset
268 for AND as a zero-extending move."
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
269 (and (match_code "const_int")
111
kono
parents: 19
diff changeset
270 (match_test "ival == 0xff || ival == 0xffff
kono
parents: 19
diff changeset
271 || ival == (HOST_WIDE_INT) 0xffffffff")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
272
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
273 (define_constraint "M"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
274 "0, 1, 2, or 3 (shifts for the @code{lea} instruction)."
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
275 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
276 (match_test "IN_RANGE (ival, 0, 3)")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
277
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
278 (define_constraint "N"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
279 "Unsigned 8-bit integer constant (for @code{in} and @code{out}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
280 instructions)."
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
281 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
282 (match_test "IN_RANGE (ival, 0, 255)")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
283
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
284 (define_constraint "O"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
285 "@internal Integer constant in the range 0 @dots{} 127, for 128-bit shifts."
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
286 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
287 (match_test "IN_RANGE (ival, 0, 127)")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
288
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
289 ;; Floating-point constant constraints.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
290 ;; We allow constants even if TARGET_80387 isn't set, because the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
291 ;; stack register converter may need to load 0.0 into the function
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
292 ;; value register (top of stack).
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
293 (define_constraint "G"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
294 "Standard 80387 floating point constant."
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
295 (and (match_code "const_double")
111
kono
parents: 19
diff changeset
296 (match_test "standard_80387_constant_p (op) > 0")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
297
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
298 ;; This can theoretically be any mode's CONST0_RTX.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
299 (define_constraint "C"
111
kono
parents: 19
diff changeset
300 "SSE constant zero operand."
kono
parents: 19
diff changeset
301 (and (match_test "TARGET_SSE")
kono
parents: 19
diff changeset
302 (ior (match_test "op == const0_rtx")
kono
parents: 19
diff changeset
303 (match_operand 0 "const0_operand"))))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
304
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
305 ;; Constant-or-symbol-reference constraints.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
306
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
307 (define_constraint "e"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
308 "32-bit signed integer constant, or a symbolic reference known
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
309 to fit that range (for immediate operands in sign-extending x86-64
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
310 instructions)."
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
311 (match_operand 0 "x86_64_immediate_operand"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
312
111
kono
parents: 19
diff changeset
313 ;; We use W prefix to denote any number of
kono
parents: 19
diff changeset
314 ;; constant-or-symbol-reference constraints
kono
parents: 19
diff changeset
315
kono
parents: 19
diff changeset
316 (define_constraint "We"
kono
parents: 19
diff changeset
317 "32-bit signed integer constant, or a symbolic reference known
kono
parents: 19
diff changeset
318 to fit that range (for sign-extending conversion operations that
kono
parents: 19
diff changeset
319 require non-VOIDmode immediate operands)."
kono
parents: 19
diff changeset
320 (and (match_operand 0 "x86_64_immediate_operand")
kono
parents: 19
diff changeset
321 (match_test "GET_MODE (op) != VOIDmode")))
kono
parents: 19
diff changeset
322
kono
parents: 19
diff changeset
323 (define_constraint "Wz"
kono
parents: 19
diff changeset
324 "32-bit unsigned integer constant, or a symbolic reference known
kono
parents: 19
diff changeset
325 to fit that range (for zero-extending conversion operations that
kono
parents: 19
diff changeset
326 require non-VOIDmode immediate operands)."
kono
parents: 19
diff changeset
327 (and (match_operand 0 "x86_64_zext_immediate_operand")
kono
parents: 19
diff changeset
328 (match_test "GET_MODE (op) != VOIDmode")))
kono
parents: 19
diff changeset
329
kono
parents: 19
diff changeset
330 (define_constraint "Wd"
kono
parents: 19
diff changeset
331 "128-bit integer constant where both the high and low 64-bit word
kono
parents: 19
diff changeset
332 of it satisfies the e constraint."
kono
parents: 19
diff changeset
333 (match_operand 0 "x86_64_hilo_int_operand"))
kono
parents: 19
diff changeset
334
kono
parents: 19
diff changeset
335 (define_constraint "Wf"
kono
parents: 19
diff changeset
336 "32-bit signed integer constant zero extended from word size
kono
parents: 19
diff changeset
337 to double word size."
kono
parents: 19
diff changeset
338 (match_operand 0 "x86_64_dwzext_immediate_operand"))
kono
parents: 19
diff changeset
339
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
340 (define_constraint "Z"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
341 "32-bit unsigned integer constant, or a symbolic reference known
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
342 to fit that range (for immediate operands in zero-extending x86-64
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
343 instructions)."
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
344 (match_operand 0 "x86_64_zext_immediate_operand"))
111
kono
parents: 19
diff changeset
345
kono
parents: 19
diff changeset
346 ;; T prefix is used for different address constraints
kono
parents: 19
diff changeset
347 ;; v - VSIB address
kono
parents: 19
diff changeset
348 ;; s - address with no segment register
kono
parents: 19
diff changeset
349 ;; i - address with no index and no rip
kono
parents: 19
diff changeset
350 ;; b - address with no base and no rip
kono
parents: 19
diff changeset
351
kono
parents: 19
diff changeset
352 (define_address_constraint "Tv"
kono
parents: 19
diff changeset
353 "VSIB address operand"
kono
parents: 19
diff changeset
354 (match_operand 0 "vsib_address_operand"))
kono
parents: 19
diff changeset
355
kono
parents: 19
diff changeset
356 (define_address_constraint "Ts"
kono
parents: 19
diff changeset
357 "Address operand without segment register"
kono
parents: 19
diff changeset
358 (match_operand 0 "address_no_seg_operand"))
kono
parents: 19
diff changeset
359
kono
parents: 19
diff changeset
360 (define_address_constraint "Ti"
kono
parents: 19
diff changeset
361 "MPX address operand without index"
kono
parents: 19
diff changeset
362 (match_operand 0 "address_mpx_no_index_operand"))
kono
parents: 19
diff changeset
363
kono
parents: 19
diff changeset
364 (define_address_constraint "Tb"
kono
parents: 19
diff changeset
365 "MPX address operand without base"
kono
parents: 19
diff changeset
366 (match_operand 0 "address_mpx_no_base_operand"))