1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
;; Common GCC machine description file, shared by all targets.
;; Copyright (C) 2014-2024 Free Software Foundation, Inc.
;;
;; This file is part of GCC.
;;
;; GCC is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;;
;; GCC is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GCC; see the file COPYING3. If not see
;; <http://www.gnu.org/licenses/>. */
;; This predicate is intended to be paired with register constraints that use
;; register filters to impose an alignment. Operands that are aligned via
;; TARGET_HARD_REGNO_MODE_OK should use normal register_operands instead.
(define_predicate "aligned_register_operand"
(match_code "reg,subreg")
{
/* Require the offset in a non-paradoxical subreg to be naturally aligned.
For example, if we have a subreg of something that is double the size of
this operand, the offset must select the first or second half of it. */
if (SUBREG_P (op)
&& multiple_p (SUBREG_BYTE (op), GET_MODE_SIZE (GET_MODE (op))))
op = SUBREG_REG (op);
if (!REG_P (op))
return false;
if (HARD_REGISTER_P (op))
{
if (!in_hard_reg_set_p (operand_reg_set, GET_MODE (op), REGNO (op)))
return false;
/* Reject hard registers that would need reloading, so that the reload
is visible to IRA and to pre-RA optimizers. */
if (REGNO (op) % REG_NREGS (op) != 0)
return false;
}
return true;
})
(define_register_constraint "r" "GENERAL_REGS"
"Matches any general register.")
(define_memory_constraint "TARGET_MEM_CONSTRAINT"
"Matches any valid memory."
(and (match_code "mem")
(match_test "memory_address_addr_space_p (GET_MODE (op), XEXP (op, 0),
MEM_ADDR_SPACE (op))")))
(define_memory_constraint "o"
"Matches an offsettable memory reference."
(and (match_code "mem")
(match_test "offsettable_nonstrict_memref_p (op)")))
;; "V" matches TARGET_MEM_CONSTRAINTs that are rejected by "o".
;; This means that it is not a memory constraint in the usual sense,
;; since reloading the address into a base register would make the
;; address offsettable.
(define_constraint "V"
"Matches a non-offsettable memory reference."
(and (match_code "mem")
(match_test "memory_address_addr_space_p (GET_MODE (op), XEXP (op, 0),
MEM_ADDR_SPACE (op))")
(not (match_test "offsettable_nonstrict_memref_p (op)"))))
;; Like "V", this is not a memory constraint, since reloading the address
;; into a base register would cause it not to match.
(define_constraint "<"
"Matches a pre-dec or post-dec operand."
(and (match_code "mem")
(ior (match_test "GET_CODE (XEXP (op, 0)) == PRE_DEC")
(match_test "GET_CODE (XEXP (op, 0)) == POST_DEC"))))
;; See the comment for "<".
(define_constraint ">"
"Matches a pre-inc or post-inc operand."
(and (match_code "mem")
(ior (match_test "GET_CODE (XEXP (op, 0)) == PRE_INC")
(match_test "GET_CODE (XEXP (op, 0)) == POST_INC"))))
(define_address_constraint "p"
"Matches a general address."
(match_test "address_operand (op, VOIDmode)"))
(define_constraint "i"
"Matches a general integer constant."
(and (match_test "CONSTANT_P (op)")
(match_test "!flag_pic || LEGITIMATE_PIC_OPERAND_P (op)")))
(define_constraint "s"
"Matches a symbolic integer constant."
(and (match_test "CONSTANT_P (op)")
(match_test "!CONST_SCALAR_INT_P (op)")
(match_test "!flag_pic || LEGITIMATE_PIC_OPERAND_P (op)")))
(define_constraint "n"
"Matches a non-symbolic integer constant."
(and (match_test "CONST_SCALAR_INT_P (op)")
(match_test "!flag_pic || LEGITIMATE_PIC_OPERAND_P (op)")))
(define_constraint "E"
"Matches a floating-point constant."
(ior (match_test "CONST_DOUBLE_AS_FLOAT_P (op)")
(match_test "GET_CODE (op) == CONST_VECTOR
&& GET_MODE_CLASS (GET_MODE (op)) == MODE_VECTOR_FLOAT")))
;; There is no longer a distinction between "E" and "F".
(define_constraint "F"
"Matches a floating-point constant."
(ior (match_test "CONST_DOUBLE_AS_FLOAT_P (op)")
(match_test "GET_CODE (op) == CONST_VECTOR
&& GET_MODE_CLASS (GET_MODE (op)) == MODE_VECTOR_FLOAT")))
(define_constraint "X"
"Matches anything."
(match_test "true"))
|