annotate gcc/common.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 ;; Common GCC machine description file, shared by all targets.
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2 ;; Copyright (C) 2014-2018 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3 ;;
kono
parents:
diff changeset
4 ;; This file is part of GCC.
kono
parents:
diff changeset
5 ;;
kono
parents:
diff changeset
6 ;; GCC is free software; you can redistribute it and/or modify
kono
parents:
diff changeset
7 ;; it under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
8 ;; the Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
9 ;; any later version.
kono
parents:
diff changeset
10 ;;
kono
parents:
diff changeset
11 ;; GCC is distributed in the hope that it will be useful,
kono
parents:
diff changeset
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
kono
parents:
diff changeset
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
kono
parents:
diff changeset
14 ;; GNU General Public License for more details.
kono
parents:
diff changeset
15 ;;
kono
parents:
diff changeset
16 ;; You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
17 ;; along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
18 ;; <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 (define_register_constraint "r" "GENERAL_REGS"
kono
parents:
diff changeset
21 "Matches any general register.")
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 (define_memory_constraint "TARGET_MEM_CONSTRAINT"
kono
parents:
diff changeset
24 "Matches any valid memory."
kono
parents:
diff changeset
25 (and (match_code "mem")
kono
parents:
diff changeset
26 (match_test "memory_address_addr_space_p (GET_MODE (op), XEXP (op, 0),
kono
parents:
diff changeset
27 MEM_ADDR_SPACE (op))")))
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 (define_memory_constraint "o"
kono
parents:
diff changeset
30 "Matches an offsettable memory reference."
kono
parents:
diff changeset
31 (and (match_code "mem")
kono
parents:
diff changeset
32 (match_test "offsettable_nonstrict_memref_p (op)")))
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 ;; "V" matches TARGET_MEM_CONSTRAINTs that are rejected by "o".
kono
parents:
diff changeset
35 ;; This means that it is not a memory constraint in the usual sense,
kono
parents:
diff changeset
36 ;; since reloading the address into a base register would make the
kono
parents:
diff changeset
37 ;; address offsettable.
kono
parents:
diff changeset
38 (define_constraint "V"
kono
parents:
diff changeset
39 "Matches a non-offsettable memory reference."
kono
parents:
diff changeset
40 (and (match_code "mem")
kono
parents:
diff changeset
41 (match_test "memory_address_addr_space_p (GET_MODE (op), XEXP (op, 0),
kono
parents:
diff changeset
42 MEM_ADDR_SPACE (op))")
kono
parents:
diff changeset
43 (not (match_test "offsettable_nonstrict_memref_p (op)"))))
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 ;; Like "V", this is not a memory constraint, since reloading the address
kono
parents:
diff changeset
46 ;; into a base register would cause it not to match.
kono
parents:
diff changeset
47 (define_constraint "<"
kono
parents:
diff changeset
48 "Matches a pre-dec or post-dec operand."
kono
parents:
diff changeset
49 (and (match_code "mem")
kono
parents:
diff changeset
50 (ior (match_test "GET_CODE (XEXP (op, 0)) == PRE_DEC")
kono
parents:
diff changeset
51 (match_test "GET_CODE (XEXP (op, 0)) == POST_DEC"))))
kono
parents:
diff changeset
52
kono
parents:
diff changeset
53 ;; See the comment for "<".
kono
parents:
diff changeset
54 (define_constraint ">"
kono
parents:
diff changeset
55 "Matches a pre-inc or post-inc operand."
kono
parents:
diff changeset
56 (and (match_code "mem")
kono
parents:
diff changeset
57 (ior (match_test "GET_CODE (XEXP (op, 0)) == PRE_INC")
kono
parents:
diff changeset
58 (match_test "GET_CODE (XEXP (op, 0)) == POST_INC"))))
kono
parents:
diff changeset
59
kono
parents:
diff changeset
60 (define_address_constraint "p"
kono
parents:
diff changeset
61 "Matches a general address."
kono
parents:
diff changeset
62 (match_test "address_operand (op, VOIDmode)"))
kono
parents:
diff changeset
63
kono
parents:
diff changeset
64 (define_constraint "i"
kono
parents:
diff changeset
65 "Matches a general integer constant."
kono
parents:
diff changeset
66 (and (match_test "CONSTANT_P (op)")
kono
parents:
diff changeset
67 (match_test "!flag_pic || LEGITIMATE_PIC_OPERAND_P (op)")))
kono
parents:
diff changeset
68
kono
parents:
diff changeset
69 (define_constraint "s"
kono
parents:
diff changeset
70 "Matches a symbolic integer constant."
kono
parents:
diff changeset
71 (and (match_test "CONSTANT_P (op)")
kono
parents:
diff changeset
72 (match_test "!CONST_SCALAR_INT_P (op)")
kono
parents:
diff changeset
73 (match_test "!flag_pic || LEGITIMATE_PIC_OPERAND_P (op)")))
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 (define_constraint "n"
kono
parents:
diff changeset
76 "Matches a non-symbolic integer constant."
kono
parents:
diff changeset
77 (and (match_test "CONST_SCALAR_INT_P (op)")
kono
parents:
diff changeset
78 (match_test "!flag_pic || LEGITIMATE_PIC_OPERAND_P (op)")))
kono
parents:
diff changeset
79
kono
parents:
diff changeset
80 (define_constraint "E"
kono
parents:
diff changeset
81 "Matches a floating-point constant."
kono
parents:
diff changeset
82 (ior (match_test "CONST_DOUBLE_AS_FLOAT_P (op)")
kono
parents:
diff changeset
83 (match_test "GET_CODE (op) == CONST_VECTOR
kono
parents:
diff changeset
84 && GET_MODE_CLASS (GET_MODE (op)) == MODE_VECTOR_FLOAT")))
kono
parents:
diff changeset
85
kono
parents:
diff changeset
86 ;; There is no longer a distinction between "E" and "F".
kono
parents:
diff changeset
87 (define_constraint "F"
kono
parents:
diff changeset
88 "Matches a floating-point constant."
kono
parents:
diff changeset
89 (ior (match_test "CONST_DOUBLE_AS_FLOAT_P (op)")
kono
parents:
diff changeset
90 (match_test "GET_CODE (op) == CONST_VECTOR
kono
parents:
diff changeset
91 && GET_MODE_CLASS (GET_MODE (op)) == MODE_VECTOR_FLOAT")))
kono
parents:
diff changeset
92
kono
parents:
diff changeset
93 (define_constraint "X"
kono
parents:
diff changeset
94 "Matches anything."
kono
parents:
diff changeset
95 (match_test "true"))