Line data Source code
1 : ;; Common GCC machine description file, shared by all targets.
2 : ;; Copyright (C) 2014-2026 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 : ;; This predicate is intended to be paired with register constraints that use
21 : ;; register filters to impose an alignment. Operands that are aligned via
22 : ;; TARGET_HARD_REGNO_MODE_OK should use normal register_operands instead.
23 : (define_predicate "aligned_register_operand"
24 : (match_code "reg,subreg")
25 : {
26 : /* Require the offset in a non-paradoxical subreg to be naturally aligned.
27 : For example, if we have a subreg of something that is double the size of
28 : this operand, the offset must select the first or second half of it. */
29 0 : if (SUBREG_P (op)
30 0 : && multiple_p (SUBREG_BYTE (op), GET_MODE_SIZE (GET_MODE (op))))
31 0 : op = SUBREG_REG (op);
32 0 : if (!REG_P (op))
33 : return false;
34 :
35 0 : if (HARD_REGISTER_P (op))
36 : {
37 0 : if (!in_hard_reg_set_p (operand_reg_set, GET_MODE (op), REGNO (op)))
38 : return false;
39 :
40 : /* Reject hard registers that would need reloading, so that the reload
41 : is visible to IRA and to pre-RA optimizers. */
42 0 : if (REGNO (op) % REG_NREGS (op) != 0)
43 0 : return false;
44 : }
45 : return true;
46 : })
47 :
48 : (define_register_constraint "r" "GENERAL_REGS"
49 0 : "Matches any general register.")
50 :
51 0 : (define_memory_constraint "TARGET_MEM_CONSTRAINT"
52 : "Matches any valid memory."
53 0 : (and (match_code "mem")
54 446434415 : (match_test "memory_address_addr_space_p (GET_MODE (op), XEXP (op, 0),
55 446434415 : MEM_ADDR_SPACE (op))")))
56 :
57 : (define_memory_constraint "o"
58 44818269 : "Matches an offsettable memory reference."
59 0 : (and (match_code "mem")
60 44818269 : (match_test "offsettable_nonstrict_memref_p (op)")))
61 0 :
62 : ;; "V" matches TARGET_MEM_CONSTRAINTs that are rejected by "o".
63 0 : ;; This means that it is not a memory constraint in the usual sense,
64 : ;; since reloading the address into a base register would make the
65 0 : ;; address offsettable.
66 : (define_constraint "V"
67 130238933 : "Matches a non-offsettable memory reference."
68 : (and (match_code "mem")
69 0 : (match_test "memory_address_addr_space_p (GET_MODE (op), XEXP (op, 0),
70 0 : MEM_ADDR_SPACE (op))")
71 0 : (not (match_test "offsettable_nonstrict_memref_p (op)"))))
72 :
73 : ;; Like "V", this is not a memory constraint, since reloading the address
74 58451149 : ;; into a base register would cause it not to match.
75 : (define_constraint "<"
76 58451149 : "Matches a pre-dec or post-dec operand."
77 : (and (match_code "mem")
78 58451149 : (ior (match_test "GET_CODE (XEXP (op, 0)) == PRE_DEC")
79 58451149 : (match_test "GET_CODE (XEXP (op, 0)) == POST_DEC"))))
80 :
81 : ;; See the comment for "<".
82 5772692 : (define_constraint ">"
83 : "Matches a pre-inc or post-inc operand."
84 5772692 : (and (match_code "mem")
85 5772692 : (ior (match_test "GET_CODE (XEXP (op, 0)) == PRE_INC")
86 5772692 : (match_test "GET_CODE (XEXP (op, 0)) == POST_INC"))))
87 :
88 : (define_address_constraint "p"
89 5032 : "Matches a general address."
90 10064 : (match_test "address_operand (op, VOIDmode)"))
91 5032 :
92 : (define_constraint "i"
93 223899692 : "Matches a general integer constant."
94 291314417 : (and (match_test "CONSTANT_P (op)")
95 223899692 : (match_test "!flag_pic || raw_constraint_p || LEGITIMATE_PIC_OPERAND_P (op)")))
96 :
97 : (define_constraint "s"
98 574 : "Matches a symbolic integer constant."
99 1148 : (and (match_test "CONSTANT_P (op)")
100 574 : (match_test "!CONST_SCALAR_INT_P (op)")
101 574 : (match_test "!flag_pic || raw_constraint_p || LEGITIMATE_PIC_OPERAND_P (op)")))
102 :
103 : (define_constraint ":"
104 118 : "Defines a symbol."
105 236 : (and (match_test "CONSTANT_P (op)")
106 118 : (match_test "!CONST_SCALAR_INT_P (op)")))
107 :
108 : (define_constraint "n"
109 96178436 : "Matches a non-symbolic integer constant."
110 143337244 : (and (match_test "CONST_SCALAR_INT_P (op)")
111 96178436 : (match_test "!flag_pic || raw_constraint_p || LEGITIMATE_PIC_OPERAND_P (op)")))
112 :
113 : (define_constraint "E"
114 0 : "Matches a floating-point constant."
115 0 : (ior (match_test "CONST_DOUBLE_AS_FLOAT_P (op)")
116 0 : (match_test "GET_CODE (op) == CONST_VECTOR
117 0 : && GET_MODE_CLASS (GET_MODE (op)) == MODE_VECTOR_FLOAT")))
118 :
119 : ;; There is no longer a distinction between "E" and "F".
120 98118132 : (define_constraint "F"
121 : "Matches a floating-point constant."
122 98118132 : (ior (match_test "CONST_DOUBLE_AS_FLOAT_P (op)")
123 : (match_test "GET_CODE (op) == CONST_VECTOR
124 0 : && GET_MODE_CLASS (GET_MODE (op)) == MODE_VECTOR_FLOAT")))
125 :
126 : (define_constraint "X"
127 2396739 : "Matches anything."
128 2396739 : (match_test "true"))
129 2396739 : /* /home/worker/buildworker/tiber-lcov/build/gcc/common.md not long enough */
130 : /* (content generated from coverage data) */
131 533 : /* BEGIN: function "_ZL23satisfies_constraint_BfP7rtx_def" */
132 : /* ... */
133 533 : /* ... */
134 533 : /* ... */
135 : /* END: function "_ZL23satisfies_constraint_BfP7rtx_def" */
136 : /* ... */
137 0 : /* BEGIN: function "_ZL23satisfies_constraint_BgP7rtx_def" */
138 : /* ... */
139 0 : /* ... */
140 0 : /* ... */
141 : /* END: function "_ZL23satisfies_constraint_BgP7rtx_def" */
142 : /* ... */
143 5336007 : /* BEGIN: function "_ZL23satisfies_constraint_BmP7rtx_def" */
144 : /* ... */
145 5336007 : /* ... */
146 5336007 : /* ... */
147 : /* END: function "_ZL23satisfies_constraint_BmP7rtx_def" */
148 : /* ... */
149 37932157 : /* END: function "_ZL23satisfies_constraint_BkP7rtx_def" */
150 : /* (content generated from coverage data) */
151 37932157 : /* ... */
152 53143703 : /* ... */
|