annotate gcc/config/epiphany/constraints.md @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ;; Constraint definitions for Adaptiva epiphany
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2 ;; Copyright (C) 2007-2018 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3 ;; Contributed by Embecosm on behalf of Adapteva, Inc.
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 ;; This file is part of GCC.
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 ;; GCC is free software; you can redistribute it and/or modify
kono
parents:
diff changeset
8 ;; it under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
9 ;; the Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
10 ;; any later version.
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 ;; GCC is distributed in the hope that it will be useful,
kono
parents:
diff changeset
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
kono
parents:
diff changeset
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
kono
parents:
diff changeset
15 ;; GNU General Public License for more details.
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 ;; You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
18 ;; along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
19 ;; <http://www.gnu.org/licenses/>.
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 ;; Integer constraints
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 (define_constraint "U16"
kono
parents:
diff changeset
24 "An unsigned 16-bit constant."
kono
parents:
diff changeset
25 (ior (and (match_code "const_int")
kono
parents:
diff changeset
26 (match_test "IMM16 (ival)"))
kono
parents:
diff changeset
27 (and (match_code "symbol_ref,label_ref,const")
kono
parents:
diff changeset
28 (match_test "epiphany_small16 (op)"))))
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 (define_constraint "K"
kono
parents:
diff changeset
31 "An unsigned 5-bit constant."
kono
parents:
diff changeset
32 (and (match_code "const_int")
kono
parents:
diff changeset
33 (match_test "IMM5 (ival)")))
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 ;; This could also accept symbol_ref, label_ref or const if we introduce
kono
parents:
diff changeset
36 ;; a small area and/or attribute that satisfies the 11-bit signed range.
kono
parents:
diff changeset
37 (define_constraint "L"
kono
parents:
diff changeset
38 "A signed 11-bit constant."
kono
parents:
diff changeset
39 (and (match_code "const_int")
kono
parents:
diff changeset
40 (match_test "SIMM11 (ival)")))
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 (define_constraint "CnL"
kono
parents:
diff changeset
43 "A negated signed 11-bit constant."
kono
parents:
diff changeset
44 (and (match_code "const_int")
kono
parents:
diff changeset
45 (match_test "SIMM11 (-ival)")))
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 (define_constraint "Cm1"
kono
parents:
diff changeset
48 "A signed 11-bit constant added to -1"
kono
parents:
diff changeset
49 (and (match_code "const_int")
kono
parents:
diff changeset
50 (match_test "SIMM11 (ival+1)")
kono
parents:
diff changeset
51 (match_test "epiphany_m1reg >= 0")))
kono
parents:
diff changeset
52
kono
parents:
diff changeset
53 (define_constraint "Cl1"
kono
parents:
diff changeset
54 "Left-shift of -1"
kono
parents:
diff changeset
55 (and (match_code "const_int")
kono
parents:
diff changeset
56 (match_test "ival == (ival | ~(ival-1))")
kono
parents:
diff changeset
57 (match_test "epiphany_m1reg >= 0")))
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 (define_constraint "Cr1"
kono
parents:
diff changeset
60 "Right-shift of -1"
kono
parents:
diff changeset
61 (and (match_code "const_int")
kono
parents:
diff changeset
62 (match_test "ival == (ival & ~(ival+1))")
kono
parents:
diff changeset
63 (match_test "epiphany_m1reg >= 0")))
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 (define_constraint "Cal"
kono
parents:
diff changeset
66 "Constant for arithmetic/logical operations"
kono
parents:
diff changeset
67 (match_test "(flag_pic
kono
parents:
diff changeset
68 ? nonsymbolic_immediate_operand (op, VOIDmode)
kono
parents:
diff changeset
69 : immediate_operand (op, VOIDmode))"))
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 (define_constraint "Csy"
kono
parents:
diff changeset
72 "Symbolic constant for call/jump instruction"
kono
parents:
diff changeset
73 (match_test "symbolic_operand (op, VOIDmode)"))
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 ;; Register constraints
kono
parents:
diff changeset
76 ;; proper register constraints define a register class and can thus
kono
parents:
diff changeset
77 ;; drive register allocation and reload. OTOH sometimes we want to
kono
parents:
diff changeset
78 ;; avoid just that.
kono
parents:
diff changeset
79
kono
parents:
diff changeset
80 ;; The register class usable in short insns.
kono
parents:
diff changeset
81 ;; Subject to TARGET_PREFER_SHORT_INSN_REGS.
kono
parents:
diff changeset
82 (define_register_constraint "Rcs" "SHORT_INSN_REGS"
kono
parents:
diff changeset
83 "short insn register class.")
kono
parents:
diff changeset
84
kono
parents:
diff changeset
85 ; The registers that can be used to hold a sibcall call address.
kono
parents:
diff changeset
86 ; This must not conflict with any callee-saved registers.
kono
parents:
diff changeset
87 (define_register_constraint "Rsc" "SIBCALL_REGS"
kono
parents:
diff changeset
88 "sibcall register class")
kono
parents:
diff changeset
89
kono
parents:
diff changeset
90 ; The registers that can be used to hold a status value
kono
parents:
diff changeset
91 (define_register_constraint "Rct" "CORE_CONTROL_REGS"
kono
parents:
diff changeset
92 "Core control register class")
kono
parents:
diff changeset
93
kono
parents:
diff changeset
94 ;; The register group usable in short insns.
kono
parents:
diff changeset
95 (define_constraint "Rgs"
kono
parents:
diff changeset
96 "short insn register group."
kono
parents:
diff changeset
97 (and (match_code "reg")
kono
parents:
diff changeset
98 (match_test "REGNO (op) >= FIRST_PSEUDO_REGISTER || REGNO (op) <= 7")))
kono
parents:
diff changeset
99
kono
parents:
diff changeset
100 ;; Constant suitable for the addsi3_r pattern.
kono
parents:
diff changeset
101 (define_constraint "Car"
kono
parents:
diff changeset
102 "addsi3_r constant."
kono
parents:
diff changeset
103 (and (match_code "const_int")
kono
parents:
diff changeset
104 (ior (match_test "RTX_OK_FOR_OFFSET_P (SImode, op)")
kono
parents:
diff changeset
105 (match_test "RTX_OK_FOR_OFFSET_P (HImode, op)")
kono
parents:
diff changeset
106 (match_test "RTX_OK_FOR_OFFSET_P (QImode, op)"))))
kono
parents:
diff changeset
107
kono
parents:
diff changeset
108 ;; The return address if it can be replaced with GPR_LR.
kono
parents:
diff changeset
109 (define_constraint "Rra"
kono
parents:
diff changeset
110 "return address constraint - register variant"
kono
parents:
diff changeset
111 (and (match_code "unspec")
kono
parents:
diff changeset
112 (match_test "XINT (op, 1) == UNSPEC_RETURN_ADDR")
kono
parents:
diff changeset
113 (match_test "!MACHINE_FUNCTION (cfun)->lr_clobbered")))
kono
parents:
diff changeset
114
kono
parents:
diff changeset
115 (define_constraint "Rcc"
kono
parents:
diff changeset
116 "integer condition code"
kono
parents:
diff changeset
117 (and (match_code "reg")
kono
parents:
diff changeset
118 (match_test "REGNO (op) == CC_REGNUM")))
kono
parents:
diff changeset
119
kono
parents:
diff changeset
120 ;; The return address, which might be a stack slot. */
kono
parents:
diff changeset
121 (define_constraint "Sra"
kono
parents:
diff changeset
122 "return address constraint - memory variant"
kono
parents:
diff changeset
123 (and (match_code "unspec")
kono
parents:
diff changeset
124 (match_test "XINT (op, 1) == UNSPEC_RETURN_ADDR")))
kono
parents:
diff changeset
125
kono
parents:
diff changeset
126 (define_constraint "Cfm"
kono
parents:
diff changeset
127 "control register values to switch fp mode"
kono
parents:
diff changeset
128 (and (match_code "const")
kono
parents:
diff changeset
129 (match_test "GET_CODE (XEXP (op, 0)) == UNSPEC")
kono
parents:
diff changeset
130 (match_test "XINT (XEXP (op, 0), 1) == UNSPEC_FP_MODE")))