Branch data Line data Source code
1 : : ;; Common GCC machine description file, shared by all targets.
2 : : ;; Copyright (C) 2014-2025 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 : 403031993 : (match_test "memory_address_addr_space_p (GET_MODE (op), XEXP (op, 0),
55 : 403031993 : MEM_ADDR_SPACE (op))")))
56 : :
57 : : (define_memory_constraint "o"
58 : 44927376 : "Matches an offsettable memory reference."
59 : 0 : (and (match_code "mem")
60 : 44927376 : (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 : 125224374 : "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 : 59741027 : ;; into a base register would cause it not to match.
75 : : (define_constraint "<"
76 : 59741027 : "Matches a pre-dec or post-dec operand."
77 : : (and (match_code "mem")
78 : 59741027 : (ior (match_test "GET_CODE (XEXP (op, 0)) == PRE_DEC")
79 : 59741027 : (match_test "GET_CODE (XEXP (op, 0)) == POST_DEC"))))
80 : :
81 : : ;; See the comment for "<".
82 : 6696735 : (define_constraint ">"
83 : : "Matches a pre-inc or post-inc operand."
84 : 6696735 : (and (match_code "mem")
85 : 6696735 : (ior (match_test "GET_CODE (XEXP (op, 0)) == PRE_INC")
86 : 6696735 : (match_test "GET_CODE (XEXP (op, 0)) == POST_INC"))))
87 : :
88 : : (define_address_constraint "p"
89 : 4873 : "Matches a general address."
90 : 9746 : (match_test "address_operand (op, VOIDmode)"))
91 : 4873 :
92 : : (define_constraint "i"
93 : 206186825 : "Matches a general integer constant."
94 : 268926090 : (and (match_test "CONSTANT_P (op)")
95 : 206186825 : (match_test "!flag_pic || raw_constraint_p || LEGITIMATE_PIC_OPERAND_P (op)")))
96 : :
97 : : (define_constraint "s"
98 : 556 : "Matches a symbolic integer constant."
99 : 1112 : (and (match_test "CONSTANT_P (op)")
100 : 556 : (match_test "!CONST_SCALAR_INT_P (op)")
101 : 556 : (match_test "!flag_pic || raw_constraint_p || LEGITIMATE_PIC_OPERAND_P (op)")))
102 : :
103 : : (define_constraint ":"
104 : 48 : "Defines a symbol."
105 : 96 : (and (match_test "CONSTANT_P (op)")
106 : 48 : (match_test "!CONST_SCALAR_INT_P (op)")))
107 : :
108 : : (define_constraint "n"
109 : 89137174 : "Matches a non-symbolic integer constant."
110 : 132779639 : (and (match_test "CONST_SCALAR_INT_P (op)")
111 : 89137174 : (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 : 97822414 : (define_constraint "F"
121 : : "Matches a floating-point constant."
122 : 97822414 : (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 : 2474222 : "Matches anything."
128 : 2474222 : (match_test "true"))
129 : 2474222 : /* /home/worker/buildworker/tiber-lcov/build/gcc/common.md not long enough */
130 : : /* (content generated from line coverage data) */
131 : 518 : /* ... */
132 : : /* ... */
133 : 518 : /* ... */
134 : 518 : /* ... */
135 : : /* ... */
136 : : /* ... */
137 : 0 : /* ... */
138 : : /* ... */
139 : 0 : /* ... */
140 : 0 : /* ... */
141 : : /* ... */
142 : : /* ... */
143 : 4890581 : /* ... */
144 : : /* ... */
145 : 4890581 : /* ... */
146 : 4890581 : /* ... */
147 : : /* ... */
148 : : /* ... */
149 : 39405177 : /* /home/worker/buildworker/tiber-lcov/build/gcc/common.md not long enough */
150 : : /* (content generated from line coverage data) */
151 : 39405177 : /* ... */
152 : 54676112 : /* ... */
|