annotate gcc/config/alpha/sync.md @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents 855418dad1a3
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 ;; GCC machine description for Alpha synchronization instructions.
111
kono
parents: 36
diff changeset
2 ;; Copyright (C) 2005-2017 Free Software Foundation, Inc.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 ;; This file is part of GCC.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 ;; GCC is free software; you can redistribute it and/or modify
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 ;; it under the terms of the GNU General Public License as published by
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 ;; the Free Software Foundation; either version 3, or (at your option)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 ;; any later version.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 ;; GCC is distributed in the hope that it will be useful,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 ;; GNU General Public License for more details.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 ;; You should have received a copy of the GNU General Public License
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 ;; along with GCC; see the file COPYING3. If not see
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 ;; <http://www.gnu.org/licenses/>.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 (define_code_iterator FETCHOP [plus minus ior xor and])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 (define_code_attr fetchop_name
111
kono
parents: 36
diff changeset
22 [(plus "add") (minus "sub") (ior "or") (xor "xor") (and "and")])
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 (define_code_attr fetchop_pred
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 [(plus "add_operand") (minus "reg_or_8bit_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 (ior "or_operand") (xor "or_operand") (and "and_operand")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 (define_code_attr fetchop_constr
111
kono
parents: 36
diff changeset
27 [(plus "rKL") (minus "rI") (ior "rIN") (xor "rIN") (and "riNM")])
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 (define_expand "memory_barrier"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 [(set (match_dup 0)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 (unspec:BLK [(match_dup 0)] UNSPEC_MB))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 ""
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 MEM_VOLATILE_P (operands[0]) = 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 (define_insn "*memory_barrier"
111
kono
parents: 36
diff changeset
40 [(set (match_operand:BLK 0)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 (unspec:BLK [(match_dup 0)] UNSPEC_MB))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 ""
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 "mb"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 [(set_attr "type" "mb")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 (define_insn "load_locked_<mode>"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 [(set (match_operand:I48MODE 0 "register_operand" "=r")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 (unspec_volatile:I48MODE
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 [(match_operand:I48MODE 1 "memory_operand" "m")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 UNSPECV_LL))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 ""
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 "ld<modesuffix>_l %0,%1"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 [(set_attr "type" "ld_l")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 (define_insn "store_conditional_<mode>"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 [(set (match_operand:DI 0 "register_operand" "=r")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 (unspec_volatile:DI [(const_int 0)] UNSPECV_SC))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 (set (match_operand:I48MODE 1 "memory_operand" "=m")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 (match_operand:I48MODE 2 "reg_or_0_operand" "0"))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 ""
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 "st<modesuffix>_c %0,%1"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 [(set_attr "type" "st_c")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 ;; The Alpha Architecture Handbook says that it is UNPREDICTABLE whether
111
kono
parents: 36
diff changeset
65 ;; the lock is cleared by a normal load or store. This means we cannot
kono
parents: 36
diff changeset
66 ;; expand a ll/sc sequence before reload, lest a register spill is
kono
parents: 36
diff changeset
67 ;; inserted inside the sequence. It is also UNPREDICTABLE whether the
kono
parents: 36
diff changeset
68 ;; lock is cleared by a TAKEN branch. This means that we can not expand
kono
parents: 36
diff changeset
69 ;; a ll/sc sequence containing a branch (i.e. compare-and-swap) until after
kono
parents: 36
diff changeset
70 ;; the final basic-block reordering pass.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71
111
kono
parents: 36
diff changeset
72 (define_expand "atomic_compare_and_swap<mode>"
kono
parents: 36
diff changeset
73 [(parallel
kono
parents: 36
diff changeset
74 [(set (match_operand:DI 0 "register_operand") ;; bool out
kono
parents: 36
diff changeset
75 (unspec_volatile:DI [(const_int 0)] UNSPECV_CMPXCHG))
kono
parents: 36
diff changeset
76 (set (match_operand:I48MODE 1 "register_operand") ;; val out
kono
parents: 36
diff changeset
77 (unspec_volatile:I48MODE [(const_int 0)] UNSPECV_CMPXCHG))
kono
parents: 36
diff changeset
78 (set (match_operand:I48MODE 2 "memory_operand") ;; memory
kono
parents: 36
diff changeset
79 (unspec_volatile:I48MODE
kono
parents: 36
diff changeset
80 [(match_dup 2)
kono
parents: 36
diff changeset
81 (match_operand:I48MODE 3 "reg_or_8bit_operand") ;; expected
kono
parents: 36
diff changeset
82 (match_operand:I48MODE 4 "add_operand") ;; desired
kono
parents: 36
diff changeset
83 (match_operand:SI 5 "const_int_operand") ;; is_weak
kono
parents: 36
diff changeset
84 (match_operand:SI 6 "const_int_operand") ;; succ model
kono
parents: 36
diff changeset
85 (match_operand:SI 7 "const_int_operand")] ;; fail model
kono
parents: 36
diff changeset
86 UNSPECV_CMPXCHG))])]
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 ""
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 {
111
kono
parents: 36
diff changeset
89 if (<MODE>mode == SImode)
kono
parents: 36
diff changeset
90 {
kono
parents: 36
diff changeset
91 operands[3] = convert_modes (DImode, SImode, operands[3], 0);
kono
parents: 36
diff changeset
92 operands[4] = convert_modes (DImode, SImode, operands[4], 0);
kono
parents: 36
diff changeset
93 }
kono
parents: 36
diff changeset
94 })
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
95
111
kono
parents: 36
diff changeset
96 (define_insn_and_split "*atomic_compare_and_swap<mode>"
kono
parents: 36
diff changeset
97 [(set (match_operand:DI 0 "register_operand" "=&r") ;; bool out
kono
parents: 36
diff changeset
98 (unspec_volatile:DI [(const_int 0)] UNSPECV_CMPXCHG))
kono
parents: 36
diff changeset
99 (set (match_operand:I48MODE 1 "register_operand" "=&r") ;; val out
kono
parents: 36
diff changeset
100 (unspec_volatile:I48MODE [(const_int 0)] UNSPECV_CMPXCHG))
kono
parents: 36
diff changeset
101 (set (match_operand:I48MODE 2 "memory_operand" "+m") ;; memory
kono
parents: 36
diff changeset
102 (unspec_volatile:I48MODE
kono
parents: 36
diff changeset
103 [(match_dup 2)
kono
parents: 36
diff changeset
104 (match_operand:DI 3 "reg_or_8bit_operand" "rI") ;; expected
kono
parents: 36
diff changeset
105 (match_operand:DI 4 "add_operand" "rKL") ;; desired
kono
parents: 36
diff changeset
106 (match_operand:SI 5 "const_int_operand") ;; is_weak
kono
parents: 36
diff changeset
107 (match_operand:SI 6 "const_int_operand") ;; succ model
kono
parents: 36
diff changeset
108 (match_operand:SI 7 "const_int_operand")] ;; fail model
kono
parents: 36
diff changeset
109 UNSPECV_CMPXCHG))]
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 ""
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 "#"
36
855418dad1a3 gcc-4.4-20091020
e075725
parents: 0
diff changeset
112 "epilogue_completed"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 [(const_int 0)]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 {
111
kono
parents: 36
diff changeset
115 alpha_split_compare_and_swap (operands);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
116 DONE;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
117 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 [(set_attr "type" "multi")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
119
111
kono
parents: 36
diff changeset
120 (define_expand "atomic_compare_and_swap<mode>"
kono
parents: 36
diff changeset
121 [(match_operand:DI 0 "register_operand") ;; bool out
kono
parents: 36
diff changeset
122 (match_operand:I12MODE 1 "register_operand") ;; val out
kono
parents: 36
diff changeset
123 (match_operand:I12MODE 2 "mem_noofs_operand") ;; memory
kono
parents: 36
diff changeset
124 (match_operand:I12MODE 3 "register_operand") ;; expected
kono
parents: 36
diff changeset
125 (match_operand:I12MODE 4 "add_operand") ;; desired
kono
parents: 36
diff changeset
126 (match_operand:SI 5 "const_int_operand") ;; is_weak
kono
parents: 36
diff changeset
127 (match_operand:SI 6 "const_int_operand") ;; succ model
kono
parents: 36
diff changeset
128 (match_operand:SI 7 "const_int_operand")] ;; fail model
kono
parents: 36
diff changeset
129 ""
kono
parents: 36
diff changeset
130 {
kono
parents: 36
diff changeset
131 alpha_expand_compare_and_swap_12 (operands);
kono
parents: 36
diff changeset
132 DONE;
kono
parents: 36
diff changeset
133 })
kono
parents: 36
diff changeset
134
kono
parents: 36
diff changeset
135 (define_insn_and_split "atomic_compare_and_swap<mode>_1"
kono
parents: 36
diff changeset
136 [(set (match_operand:DI 0 "register_operand" "=&r") ;; bool out
kono
parents: 36
diff changeset
137 (unspec_volatile:DI [(const_int 0)] UNSPECV_CMPXCHG))
kono
parents: 36
diff changeset
138 (set (match_operand:DI 1 "register_operand" "=&r") ;; val out
kono
parents: 36
diff changeset
139 (zero_extend:DI
kono
parents: 36
diff changeset
140 (unspec_volatile:I12MODE [(const_int 0)] UNSPECV_CMPXCHG)))
kono
parents: 36
diff changeset
141 (set (match_operand:I12MODE 2 "mem_noofs_operand" "+w") ;; memory
kono
parents: 36
diff changeset
142 (unspec_volatile:I12MODE
kono
parents: 36
diff changeset
143 [(match_dup 2)
kono
parents: 36
diff changeset
144 (match_operand:DI 3 "reg_or_8bit_operand" "rI") ;; expected
kono
parents: 36
diff changeset
145 (match_operand:DI 4 "reg_or_0_operand" "rJ") ;; desired
kono
parents: 36
diff changeset
146 (match_operand:DI 5 "register_operand" "r") ;; align
kono
parents: 36
diff changeset
147 (match_operand:SI 6 "const_int_operand") ;; is_weak
kono
parents: 36
diff changeset
148 (match_operand:SI 7 "const_int_operand") ;; succ model
kono
parents: 36
diff changeset
149 (match_operand:SI 8 "const_int_operand")] ;; fail model
kono
parents: 36
diff changeset
150 UNSPECV_CMPXCHG))
kono
parents: 36
diff changeset
151 (clobber (match_scratch:DI 9 "=&r"))]
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
152 ""
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
153 "#"
36
855418dad1a3 gcc-4.4-20091020
e075725
parents: 0
diff changeset
154 "epilogue_completed"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
155 [(const_int 0)]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
156 {
111
kono
parents: 36
diff changeset
157 alpha_split_compare_and_swap_12 (operands);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
158 DONE;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
159 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
160 [(set_attr "type" "multi")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
161
111
kono
parents: 36
diff changeset
162 (define_insn_and_split "atomic_exchange<mode>"
kono
parents: 36
diff changeset
163 [(set (match_operand:I48MODE 0 "register_operand" "=&r") ;; output
kono
parents: 36
diff changeset
164 (match_operand:I48MODE 1 "memory_operand" "+m")) ;; memory
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
165 (set (match_dup 1)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
166 (unspec:I48MODE
111
kono
parents: 36
diff changeset
167 [(match_operand:I48MODE 2 "add_operand" "rKL") ;; input
kono
parents: 36
diff changeset
168 (match_operand:SI 3 "const_int_operand")] ;; model
kono
parents: 36
diff changeset
169 UNSPEC_XCHG))
kono
parents: 36
diff changeset
170 (clobber (match_scratch:I48MODE 4 "=&r"))]
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
171 ""
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
172 "#"
36
855418dad1a3 gcc-4.4-20091020
e075725
parents: 0
diff changeset
173 "epilogue_completed"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
174 [(const_int 0)]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
175 {
111
kono
parents: 36
diff changeset
176 alpha_split_atomic_exchange (operands);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
177 DONE;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
178 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
179 [(set_attr "type" "multi")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
180
111
kono
parents: 36
diff changeset
181 (define_expand "atomic_exchange<mode>"
kono
parents: 36
diff changeset
182 [(match_operand:I12MODE 0 "register_operand") ;; output
kono
parents: 36
diff changeset
183 (match_operand:I12MODE 1 "mem_noofs_operand") ;; memory
kono
parents: 36
diff changeset
184 (match_operand:I12MODE 2 "reg_or_0_operand") ;; input
kono
parents: 36
diff changeset
185 (match_operand:SI 3 "const_int_operand")] ;; model
kono
parents: 36
diff changeset
186 ""
kono
parents: 36
diff changeset
187 {
kono
parents: 36
diff changeset
188 alpha_expand_atomic_exchange_12 (operands);
kono
parents: 36
diff changeset
189 DONE;
kono
parents: 36
diff changeset
190 })
kono
parents: 36
diff changeset
191
kono
parents: 36
diff changeset
192 (define_insn_and_split "atomic_exchange<mode>_1"
kono
parents: 36
diff changeset
193 [(set (match_operand:DI 0 "register_operand" "=&r") ;; output
kono
parents: 36
diff changeset
194 (zero_extend:DI
kono
parents: 36
diff changeset
195 (match_operand:I12MODE 1 "mem_noofs_operand" "+w"))) ;; memory
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
196 (set (match_dup 1)
111
kono
parents: 36
diff changeset
197 (unspec:I12MODE
kono
parents: 36
diff changeset
198 [(match_operand:DI 2 "reg_or_8bit_operand" "rI") ;; input
kono
parents: 36
diff changeset
199 (match_operand:DI 3 "register_operand" "r") ;; align
kono
parents: 36
diff changeset
200 (match_operand:SI 4 "const_int_operand")] ;; model
kono
parents: 36
diff changeset
201 UNSPEC_XCHG))
kono
parents: 36
diff changeset
202 (clobber (match_scratch:DI 5 "=&r"))]
kono
parents: 36
diff changeset
203 ""
kono
parents: 36
diff changeset
204 "#"
kono
parents: 36
diff changeset
205 "epilogue_completed"
kono
parents: 36
diff changeset
206 [(const_int 0)]
kono
parents: 36
diff changeset
207 {
kono
parents: 36
diff changeset
208 alpha_split_atomic_exchange_12 (operands);
kono
parents: 36
diff changeset
209 DONE;
kono
parents: 36
diff changeset
210 }
kono
parents: 36
diff changeset
211 [(set_attr "type" "multi")])
kono
parents: 36
diff changeset
212
kono
parents: 36
diff changeset
213 (define_insn_and_split "atomic_<fetchop_name><mode>"
kono
parents: 36
diff changeset
214 [(set (match_operand:I48MODE 0 "memory_operand" "+m")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
215 (unspec:I48MODE
111
kono
parents: 36
diff changeset
216 [(FETCHOP:I48MODE (match_dup 0)
kono
parents: 36
diff changeset
217 (match_operand:I48MODE 1 "<fetchop_pred>" "<fetchop_constr>"))
kono
parents: 36
diff changeset
218 (match_operand:SI 2 "const_int_operand")]
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
219 UNSPEC_ATOMIC))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
220 (clobber (match_scratch:I48MODE 3 "=&r"))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
221 ""
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
222 "#"
36
855418dad1a3 gcc-4.4-20091020
e075725
parents: 0
diff changeset
223 "epilogue_completed"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
224 [(const_int 0)]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
225 {
111
kono
parents: 36
diff changeset
226 alpha_split_atomic_op (<CODE>, operands[0], operands[1],
kono
parents: 36
diff changeset
227 NULL, NULL, operands[3],
kono
parents: 36
diff changeset
228 (enum memmodel) INTVAL (operands[2]));
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
229 DONE;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
230 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
231 [(set_attr "type" "multi")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
232
111
kono
parents: 36
diff changeset
233 (define_insn_and_split "atomic_nand<mode>"
kono
parents: 36
diff changeset
234 [(set (match_operand:I48MODE 0 "memory_operand" "+m")
kono
parents: 36
diff changeset
235 (unspec:I48MODE
kono
parents: 36
diff changeset
236 [(not:I48MODE
kono
parents: 36
diff changeset
237 (and:I48MODE (match_dup 0)
kono
parents: 36
diff changeset
238 (match_operand:I48MODE 1 "register_operand" "r")))
kono
parents: 36
diff changeset
239 (match_operand:SI 2 "const_int_operand")]
kono
parents: 36
diff changeset
240 UNSPEC_ATOMIC))
kono
parents: 36
diff changeset
241 (clobber (match_scratch:I48MODE 3 "=&r"))]
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
242 ""
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
243 "#"
36
855418dad1a3 gcc-4.4-20091020
e075725
parents: 0
diff changeset
244 "epilogue_completed"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
245 [(const_int 0)]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
246 {
111
kono
parents: 36
diff changeset
247 alpha_split_atomic_op (NOT, operands[0], operands[1],
kono
parents: 36
diff changeset
248 NULL, NULL, operands[3],
kono
parents: 36
diff changeset
249 (enum memmodel) INTVAL (operands[2]));
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
250 DONE;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
251 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
252 [(set_attr "type" "multi")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
253
111
kono
parents: 36
diff changeset
254 (define_insn_and_split "atomic_fetch_<fetchop_name><mode>"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
255 [(set (match_operand:I48MODE 0 "register_operand" "=&r")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
256 (match_operand:I48MODE 1 "memory_operand" "+m"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
257 (set (match_dup 1)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
258 (unspec:I48MODE
111
kono
parents: 36
diff changeset
259 [(FETCHOP:I48MODE (match_dup 1)
kono
parents: 36
diff changeset
260 (match_operand:I48MODE 2 "<fetchop_pred>" "<fetchop_constr>"))
kono
parents: 36
diff changeset
261 (match_operand:SI 3 "const_int_operand")]
kono
parents: 36
diff changeset
262 UNSPEC_ATOMIC))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
263 (clobber (match_scratch:I48MODE 4 "=&r"))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
264 ""
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
265 "#"
36
855418dad1a3 gcc-4.4-20091020
e075725
parents: 0
diff changeset
266 "epilogue_completed"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
267 [(const_int 0)]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
268 {
111
kono
parents: 36
diff changeset
269 alpha_split_atomic_op (<CODE>, operands[1], operands[2],
kono
parents: 36
diff changeset
270 operands[0], NULL, operands[4],
kono
parents: 36
diff changeset
271 (enum memmodel) INTVAL (operands[3]));
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
272 DONE;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
273 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
274 [(set_attr "type" "multi")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
275
111
kono
parents: 36
diff changeset
276 (define_insn_and_split "atomic_fetch_nand<mode>"
kono
parents: 36
diff changeset
277 [(set (match_operand:I48MODE 0 "register_operand" "=&r")
kono
parents: 36
diff changeset
278 (match_operand:I48MODE 1 "memory_operand" "+m"))
kono
parents: 36
diff changeset
279 (set (match_dup 1)
kono
parents: 36
diff changeset
280 (unspec:I48MODE
kono
parents: 36
diff changeset
281 [(not:I48MODE
kono
parents: 36
diff changeset
282 (and:I48MODE (match_dup 1)
kono
parents: 36
diff changeset
283 (match_operand:I48MODE 2 "register_operand" "r")))
kono
parents: 36
diff changeset
284 (match_operand:SI 3 "const_int_operand")]
kono
parents: 36
diff changeset
285 UNSPEC_ATOMIC))
kono
parents: 36
diff changeset
286 (clobber (match_scratch:I48MODE 4 "=&r"))]
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
287 ""
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
288 "#"
36
855418dad1a3 gcc-4.4-20091020
e075725
parents: 0
diff changeset
289 "epilogue_completed"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
290 [(const_int 0)]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
291 {
111
kono
parents: 36
diff changeset
292 alpha_split_atomic_op (NOT, operands[1], operands[2],
kono
parents: 36
diff changeset
293 operands[0], NULL, operands[4],
kono
parents: 36
diff changeset
294 (enum memmodel) INTVAL (operands[3]));
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
295 DONE;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
296 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
297 [(set_attr "type" "multi")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
298
111
kono
parents: 36
diff changeset
299 (define_insn_and_split "atomic_<fetchop_name>_fetch<mode>"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
300 [(set (match_operand:I48MODE 0 "register_operand" "=&r")
111
kono
parents: 36
diff changeset
301 (FETCHOP:I48MODE
kono
parents: 36
diff changeset
302 (match_operand:I48MODE 1 "memory_operand" "+m")
kono
parents: 36
diff changeset
303 (match_operand:I48MODE 2 "<fetchop_pred>" "<fetchop_constr>")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
304 (set (match_dup 1)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
305 (unspec:I48MODE
111
kono
parents: 36
diff changeset
306 [(FETCHOP:I48MODE (match_dup 1) (match_dup 2))
kono
parents: 36
diff changeset
307 (match_operand:SI 3 "const_int_operand")]
kono
parents: 36
diff changeset
308 UNSPEC_ATOMIC))
kono
parents: 36
diff changeset
309 (clobber (match_scratch:I48MODE 4 "=&r"))]
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
310 ""
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
311 "#"
36
855418dad1a3 gcc-4.4-20091020
e075725
parents: 0
diff changeset
312 "epilogue_completed"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
313 [(const_int 0)]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
314 {
111
kono
parents: 36
diff changeset
315 alpha_split_atomic_op (<CODE>, operands[1], operands[2],
kono
parents: 36
diff changeset
316 NULL, operands[0], operands[4],
kono
parents: 36
diff changeset
317 (enum memmodel) INTVAL (operands[3]));
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
318 DONE;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
319 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
320 [(set_attr "type" "multi")])
111
kono
parents: 36
diff changeset
321
kono
parents: 36
diff changeset
322 (define_insn_and_split "atomic_nand_fetch<mode>"
kono
parents: 36
diff changeset
323 [(set (match_operand:I48MODE 0 "register_operand" "=&r")
kono
parents: 36
diff changeset
324 (not:I48MODE
kono
parents: 36
diff changeset
325 (and:I48MODE (match_operand:I48MODE 1 "memory_operand" "+m")
kono
parents: 36
diff changeset
326 (match_operand:I48MODE 2 "register_operand" "r"))))
kono
parents: 36
diff changeset
327 (set (match_dup 1)
kono
parents: 36
diff changeset
328 (unspec:I48MODE
kono
parents: 36
diff changeset
329 [(not:I48MODE (and:I48MODE (match_dup 1) (match_dup 2)))
kono
parents: 36
diff changeset
330 (match_operand:SI 3 "const_int_operand")]
kono
parents: 36
diff changeset
331 UNSPEC_ATOMIC))
kono
parents: 36
diff changeset
332 (clobber (match_scratch:I48MODE 4 "=&r"))]
kono
parents: 36
diff changeset
333 ""
kono
parents: 36
diff changeset
334 "#"
kono
parents: 36
diff changeset
335 "epilogue_completed"
kono
parents: 36
diff changeset
336 [(const_int 0)]
kono
parents: 36
diff changeset
337 {
kono
parents: 36
diff changeset
338 alpha_split_atomic_op (NOT, operands[1], operands[2],
kono
parents: 36
diff changeset
339 NULL, operands[0], operands[4],
kono
parents: 36
diff changeset
340 (enum memmodel) INTVAL (operands[3]));
kono
parents: 36
diff changeset
341 DONE;
kono
parents: 36
diff changeset
342 }
kono
parents: 36
diff changeset
343 [(set_attr "type" "multi")])