annotate gcc/config/pdp11/constraints.md @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 ;;- Constraint definitions for the pdp11 for GNU C compiler
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2 ;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 ;; Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at).
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 ;; This file is part of GCC.
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 ;; GCC is free software; you can redistribute it and/or modify
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 ;; it under the terms of the GNU General Public License as published by
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 ;; the Free Software Foundation; either version 3, or (at your option)
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 ;; any later version.
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 ;; GCC is distributed in the hope that it will be useful,
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 ;; GNU General Public License for more details.
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 ;; You should have received a copy of the GNU General Public License
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 ;; along with GCC; see the file COPYING3. If not see
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 ;; <http://www.gnu.org/licenses/>.
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
21 (define_register_constraint "a" "LOAD_FPU_REGS"
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
22 "FPU register that can be directly loaded from memory")
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
23
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 (define_register_constraint "f" "FPU_REGS"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 "Any FPU register")
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
27 (define_register_constraint "h" "NO_LOAD_FPU_REGS"
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
28 "FPU register that cannot be directly loaded from memory")
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 (define_register_constraint "d" "MUL_REGS"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 "General register that can be used for 16-bit multiply (odd numbered)")
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 (define_constraint "I"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 "Integer constant that fits in 16 bits unsigned"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 (and (match_code "const_int")
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 (match_test "(ival & 0xffff0000) == 0")))
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 (define_constraint "J"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 "Integer constant whose low 16 bits are zero"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 (and (match_code "const_int")
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 (match_test "(ival & 0xffff) == 0")))
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 (define_constraint "K"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 "Integer constant whose lower and upper 16 bit half are both non-zero"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 (and (match_code "const_int")
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 (match_test "(ival & 0xffff) != 0 && (ival & 0xffff0000) != 0")))
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 (define_constraint "L"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 "Integer constant 1"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 (and (match_code "const_int")
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 (match_test "ival == 1")))
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 (define_constraint "M"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 "Integer constant -1"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 (and (match_code "const_int")
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 (match_test "ival == -1")))
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 (define_constraint "N"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 "Integer constant 0"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 (and (match_code "const_int")
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 (match_test "ival == 0")))
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 (define_constraint "O"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 "Integer constant for which several individual shifts are better than one big one"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 (and (match_code "const_int")
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
66 (match_test "pdp11_small_shift (ival)")))
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 (define_constraint "G"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 "Defines a real zero constant."
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 (and (match_code "const_double")
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 (match_test "op == CONST0_RTX (GET_MODE (op))")))
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
73 (define_memory_constraint "Q"
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 "Memory reference that requires an additional word after the opcode"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 (and (match_code "mem")
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 (match_test "memory_address_p (GET_MODE (op), XEXP (op, 0))
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 && !simple_memory_operand (op, GET_MODE (op))")))
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
78
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
79 (define_memory_constraint "R"
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 "Memory reference that is encoded within the opcode"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 (and (match_code "mem")
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 (match_test "memory_address_p (GET_MODE (op), XEXP (op, 0))
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 && simple_memory_operand (op, GET_MODE (op))")))
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
85 (define_memory_constraint "D"
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
86 "Memory reference that is encoded within the opcode, and not push or pop"
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
87 (and (match_code "mem")
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
88 (match_test "memory_address_p (GET_MODE (op), XEXP (op, 0))
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
89 && no_side_effect_operand (op, GET_MODE (op))")))
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
90
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
91 ;; What follows is a set of constraints used to prevent the generation
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
92 ;; of insns that have a register as source, and an auto-increment or
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
93 ;; auto-decrement memory reference as the destination where the register
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
94 ;; is the same as the source. On the PDP11, such instructions are not
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
95 ;; implemented consistently across the models and often do something
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
96 ;; different from what the RTL intends.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
97 (define_register_constraint "Z0" "NOTR0_REG" "Register other than 0")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
98 (define_register_constraint "Z1" "NOTR1_REG" "Register other than 1")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
99 (define_register_constraint "Z2" "NOTR2_REG" "Register other than 2")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
100 (define_register_constraint "Z3" "NOTR3_REG" "Register other than 3")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
101 (define_register_constraint "Z4" "NOTR4_REG" "Register other than 4")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
102 (define_register_constraint "Z5" "NOTR5_REG" "Register other than 5")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
103 (define_register_constraint "Z6" "NOTSP_REG"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
104 "Register other than stack pointer (register 6)")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
105 (define_memory_constraint "Za" "R0 push/pop"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
106 (match_test "pushpop_regeq (op, 0)"))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
107 (define_memory_constraint "Zb" "R1 push/pop"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
108 (match_test "pushpop_regeq (op, 1)"))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
109 (define_memory_constraint "Zc" "R2 push/pop"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
110 (match_test "pushpop_regeq (op, 2)"))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
111 (define_memory_constraint "Zd" "R3 push/pop"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
112 (match_test "pushpop_regeq (op, 3)"))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
113 (define_memory_constraint "Ze" "R4 push/pop"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
114 (match_test "pushpop_regeq (op, 4)"))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
115 (define_memory_constraint "Zf" "R5 push/pop"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
116 (match_test "pushpop_regeq (op, 5)"))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
117 (define_memory_constraint "Zg" "SP push/pop"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
118 (match_test "pushpop_regeq (op, 6)"))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
119