@@ -33,96 +33,98 @@ multiclass ATOMIC_NRI<dag oops, dag iops, list<dag> pattern, string asmstr = "",
33
33
//===----------------------------------------------------------------------===//
34
34
35
35
let hasSideEffects = 1 in {
36
- defm ATOMIC_NOTIFY_A32 :
36
+ defm MEMORY_ATOMIC_NOTIFY_A32 :
37
37
ATOMIC_I<(outs I32:$dst),
38
38
(ins P2Align:$p2align, offset32_op:$off, I32:$addr, I32:$count),
39
39
(outs), (ins P2Align:$p2align, offset32_op:$off), [],
40
- "atomic.notify \t$dst, ${off}(${addr})${p2align}, $count",
41
- "atomic.notify \t${off}${p2align}", 0x00, "false">;
42
- defm ATOMIC_NOTIFY_A64 :
40
+ "memory. atomic.notify \t$dst, ${off}(${addr})${p2align}, $count",
41
+ "memory. atomic.notify \t${off}${p2align}", 0x00, "false">;
42
+ defm MEMORY_ATOMIC_NOTIFY_A64 :
43
43
ATOMIC_I<(outs I32:$dst),
44
44
(ins P2Align:$p2align, offset64_op:$off, I64:$addr, I32:$count),
45
45
(outs), (ins P2Align:$p2align, offset64_op:$off), [],
46
- "atomic.notify \t$dst, ${off}(${addr})${p2align}, $count",
47
- "atomic.notify \t${off}${p2align}", 0x00, "true">;
46
+ "memory. atomic.notify \t$dst, ${off}(${addr})${p2align}, $count",
47
+ "memory. atomic.notify \t${off}${p2align}", 0x00, "true">;
48
48
let mayLoad = 1 in {
49
- defm ATOMIC_WAIT_I32_A32 :
49
+ defm MEMORY_ATOMIC_WAIT32_A32 :
50
50
ATOMIC_I<(outs I32:$dst),
51
51
(ins P2Align:$p2align, offset32_op:$off, I32:$addr, I32:$exp,
52
52
I64:$timeout),
53
53
(outs), (ins P2Align:$p2align, offset32_op:$off), [],
54
- "i32 .atomic.wait \t$dst, ${off}(${addr})${p2align}, $exp, $timeout",
55
- "i32 .atomic.wait \t${off}${p2align}", 0x01, "false">;
56
- defm ATOMIC_WAIT_I32_A64 :
54
+ "memory .atomic.wait32 \t$dst, ${off}(${addr})${p2align}, $exp, $timeout",
55
+ "memory .atomic.wait32 \t${off}${p2align}", 0x01, "false">;
56
+ defm MEMORY_ATOMIC_WAIT32_A64 :
57
57
ATOMIC_I<(outs I32:$dst),
58
58
(ins P2Align:$p2align, offset64_op:$off, I64:$addr, I32:$exp,
59
59
I64:$timeout),
60
60
(outs), (ins P2Align:$p2align, offset64_op:$off), [],
61
- "i32 .atomic.wait \t$dst, ${off}(${addr})${p2align}, $exp, $timeout",
62
- "i32 .atomic.wait \t${off}${p2align}", 0x01, "true">;
63
- defm ATOMIC_WAIT_I64_A32 :
61
+ "memory .atomic.wait32 \t$dst, ${off}(${addr})${p2align}, $exp, $timeout",
62
+ "memory .atomic.wait32 \t${off}${p2align}", 0x01, "true">;
63
+ defm MEMORY_ATOMIC_WAIT64_A32 :
64
64
ATOMIC_I<(outs I32:$dst),
65
65
(ins P2Align:$p2align, offset32_op:$off, I32:$addr, I64:$exp,
66
66
I64:$timeout),
67
67
(outs), (ins P2Align:$p2align, offset32_op:$off), [],
68
- "i64 .atomic.wait \t$dst, ${off}(${addr})${p2align}, $exp, $timeout",
69
- "i64 .atomic.wait \t${off}${p2align}", 0x02, "false">;
70
- defm ATOMIC_WAIT_I64_A64 :
68
+ "memory .atomic.wait64 \t$dst, ${off}(${addr})${p2align}, $exp, $timeout",
69
+ "memory .atomic.wait64 \t${off}${p2align}", 0x02, "false">;
70
+ defm MEMORY_ATOMIC_WAIT64_A64 :
71
71
ATOMIC_I<(outs I32:$dst),
72
72
(ins P2Align:$p2align, offset64_op:$off, I64:$addr, I64:$exp,
73
73
I64:$timeout),
74
74
(outs), (ins P2Align:$p2align, offset64_op:$off), [],
75
- "i64 .atomic.wait \t$dst, ${off}(${addr})${p2align}, $exp, $timeout",
76
- "i64 .atomic.wait \t${off}${p2align}", 0x02, "true">;
75
+ "memory .atomic.wait64 \t$dst, ${off}(${addr})${p2align}, $exp, $timeout",
76
+ "memory .atomic.wait64 \t${off}${p2align}", 0x02, "true">;
77
77
} // mayLoad = 1
78
78
} // hasSideEffects = 1
79
79
80
80
let Predicates = [HasAtomics] in {
81
81
// Select notifys with no constant offset.
82
82
def NotifyPatNoOffset_A32 :
83
- Pat<(i32 (int_wasm_atomic_notify I32:$addr, I32:$count)),
84
- (ATOMIC_NOTIFY_A32 0, 0, I32:$addr, I32:$count)>,
83
+ Pat<(i32 (int_wasm_memory_atomic_notify I32:$addr, I32:$count)),
84
+ (MEMORY_ATOMIC_NOTIFY_A32 0, 0, I32:$addr, I32:$count)>,
85
85
Requires<[HasAddr32]>;
86
86
def NotifyPatNoOffset_A64 :
87
- Pat<(i32 (int_wasm_atomic_notify I64:$addr, I32:$count)),
88
- (ATOMIC_NOTIFY_A64 0, 0, I64:$addr, I32:$count)>,
87
+ Pat<(i32 (int_wasm_memory_atomic_notify I64:$addr, I32:$count)),
88
+ (MEMORY_ATOMIC_NOTIFY_A64 0, 0, I64:$addr, I32:$count)>,
89
89
Requires<[HasAddr64]>;
90
90
91
91
// Select notifys with a constant offset.
92
92
93
93
// Pattern with address + immediate offset
94
94
multiclass NotifyPatImmOff<PatFrag operand, string inst> {
95
- def : Pat<(i32 (int_wasm_atomic_notify (operand I32:$addr, imm:$off),
95
+ def : Pat<(i32 (int_wasm_memory_atomic_notify (operand I32:$addr, imm:$off),
96
96
I32:$count)),
97
97
(!cast<NI>(inst#_A32) 0, imm:$off, I32:$addr, I32:$count)>,
98
98
Requires<[HasAddr32]>;
99
- def : Pat<(i32 (int_wasm_atomic_notify (operand I64:$addr, imm:$off),
99
+ def : Pat<(i32 (int_wasm_memory_atomic_notify (operand I64:$addr, imm:$off),
100
100
I32:$count)),
101
101
(!cast<NI>(inst#_A64) 0, imm:$off, I64:$addr, I32:$count)>,
102
102
Requires<[HasAddr64]>;
103
103
}
104
- defm : NotifyPatImmOff<regPlusImm, "ATOMIC_NOTIFY ">;
105
- defm : NotifyPatImmOff<or_is_add, "ATOMIC_NOTIFY ">;
104
+ defm : NotifyPatImmOff<regPlusImm, "MEMORY_ATOMIC_NOTIFY ">;
105
+ defm : NotifyPatImmOff<or_is_add, "MEMORY_ATOMIC_NOTIFY ">;
106
106
107
107
// Select notifys with just a constant offset.
108
108
def NotifyPatOffsetOnly_A32 :
109
- Pat<(i32 (int_wasm_atomic_notify imm:$off, I32:$count)),
110
- (ATOMIC_NOTIFY_A32 0, imm:$off, (CONST_I32 0), I32:$count)>,
109
+ Pat<(i32 (int_wasm_memory_atomic_notify imm:$off, I32:$count)),
110
+ (MEMORY_ATOMIC_NOTIFY_A32 0, imm:$off, (CONST_I32 0), I32:$count)>,
111
111
Requires<[HasAddr32]>;
112
112
def NotifyPatOffsetOnly_A64 :
113
- Pat<(i32 (int_wasm_atomic_notify imm:$off, I32:$count)),
114
- (ATOMIC_NOTIFY_A64 0, imm:$off, (CONST_I64 0), I32:$count)>,
113
+ Pat<(i32 (int_wasm_memory_atomic_notify imm:$off, I32:$count)),
114
+ (MEMORY_ATOMIC_NOTIFY_A64 0, imm:$off, (CONST_I64 0), I32:$count)>,
115
115
Requires<[HasAddr64]>;
116
116
117
117
def NotifyPatGlobalAddrOffOnly_A32 :
118
- Pat<(i32 (int_wasm_atomic_notify (WebAssemblywrapper tglobaladdr:$off),
119
- I32:$count)),
120
- (ATOMIC_NOTIFY_A32 0, tglobaladdr:$off, (CONST_I32 0), I32:$count)>,
118
+ Pat<(i32 (int_wasm_memory_atomic_notify (WebAssemblywrapper tglobaladdr:$off),
119
+ I32:$count)),
120
+ (MEMORY_ATOMIC_NOTIFY_A32 0, tglobaladdr:$off, (CONST_I32 0), I32:$count)
121
+ >,
121
122
Requires<[HasAddr32]>;
122
123
def NotifyPatGlobalAddrOffOnly_A64 :
123
- Pat<(i32 (int_wasm_atomic_notify (WebAssemblywrapper tglobaladdr:$off),
124
- I32:$count)),
125
- (ATOMIC_NOTIFY_A64 0, tglobaladdr:$off, (CONST_I64 0), I32:$count)>,
124
+ Pat<(i32 (int_wasm_memory_atomic_notify (WebAssemblywrapper tglobaladdr:$off),
125
+ I32:$count)),
126
+ (MEMORY_ATOMIC_NOTIFY_A64 0, tglobaladdr:$off, (CONST_I64 0), I32:$count)
127
+ >,
126
128
Requires<[HasAddr64]>;
127
129
128
130
// Select waits with no constant offset.
@@ -135,10 +137,14 @@ multiclass WaitPatNoOffset<ValueType ty, Intrinsic kind,
135
137
(!cast<NI>(inst#_A64) 0, 0, I64:$addr, ty:$exp, I64:$timeout)>,
136
138
Requires<[HasAddr64]>;
137
139
}
138
- defm : WaitPatNoOffset<i32, int_wasm_atomic_wait_i32, "ATOMIC_WAIT_I32">;
139
- defm : WaitPatNoOffset<i64, int_wasm_atomic_wait_i64, "ATOMIC_WAIT_I64">;
140
- defm : WaitPatNoOffset<i32, int_wasm_atomic_wait_i32, "ATOMIC_WAIT_I32">;
141
- defm : WaitPatNoOffset<i64, int_wasm_atomic_wait_i64, "ATOMIC_WAIT_I64">;
140
+ defm : WaitPatNoOffset<i32, int_wasm_memory_atomic_wait32,
141
+ "MEMORY_ATOMIC_WAIT32">;
142
+ defm : WaitPatNoOffset<i64, int_wasm_memory_atomic_wait64,
143
+ "MEMORY_ATOMIC_WAIT64">;
144
+ defm : WaitPatNoOffset<i32, int_wasm_memory_atomic_wait32,
145
+ "MEMORY_ATOMIC_WAIT32">;
146
+ defm : WaitPatNoOffset<i64, int_wasm_memory_atomic_wait64,
147
+ "MEMORY_ATOMIC_WAIT64">;
142
148
143
149
// Select waits with a constant offset.
144
150
@@ -154,16 +160,16 @@ multiclass WaitPatImmOff<ValueType ty, Intrinsic kind, PatFrag operand,
154
160
I64:$timeout)>,
155
161
Requires<[HasAddr64]>;
156
162
}
157
- defm : WaitPatImmOff<i32, int_wasm_atomic_wait_i32 , regPlusImm,
158
- "ATOMIC_WAIT_I32 ">;
159
- defm : WaitPatImmOff<i32, int_wasm_atomic_wait_i32 , or_is_add,
160
- "ATOMIC_WAIT_I32 ">;
161
- defm : WaitPatImmOff<i64, int_wasm_atomic_wait_i64 , regPlusImm,
162
- "ATOMIC_WAIT_I64 ">;
163
- defm : WaitPatImmOff<i64, int_wasm_atomic_wait_i64 , or_is_add,
164
- "ATOMIC_WAIT_I64 ">;
165
-
166
- // Select wait_i32, "ATOMIC_WAIT_I32s with just a constant offset.
163
+ defm : WaitPatImmOff<i32, int_wasm_memory_atomic_wait32 , regPlusImm,
164
+ "MEMORY_ATOMIC_WAIT32 ">;
165
+ defm : WaitPatImmOff<i32, int_wasm_memory_atomic_wait32 , or_is_add,
166
+ "MEMORY_ATOMIC_WAIT32 ">;
167
+ defm : WaitPatImmOff<i64, int_wasm_memory_atomic_wait64 , regPlusImm,
168
+ "MEMORY_ATOMIC_WAIT64 ">;
169
+ defm : WaitPatImmOff<i64, int_wasm_memory_atomic_wait64 , or_is_add,
170
+ "MEMORY_ATOMIC_WAIT64 ">;
171
+
172
+ // Select waits with just a constant offset.
167
173
multiclass WaitPatOffsetOnly<ValueType ty, Intrinsic kind, string inst> {
168
174
def : Pat<(i32 (kind imm:$off, ty:$exp, I64:$timeout)),
169
175
(!cast<NI>(inst#_A32) 0, imm:$off, (CONST_I32 0), ty:$exp,
@@ -174,8 +180,10 @@ multiclass WaitPatOffsetOnly<ValueType ty, Intrinsic kind, string inst> {
174
180
I64:$timeout)>,
175
181
Requires<[HasAddr64]>;
176
182
}
177
- defm : WaitPatOffsetOnly<i32, int_wasm_atomic_wait_i32, "ATOMIC_WAIT_I32">;
178
- defm : WaitPatOffsetOnly<i64, int_wasm_atomic_wait_i64, "ATOMIC_WAIT_I64">;
183
+ defm : WaitPatOffsetOnly<i32, int_wasm_memory_atomic_wait32,
184
+ "MEMORY_ATOMIC_WAIT32">;
185
+ defm : WaitPatOffsetOnly<i64, int_wasm_memory_atomic_wait64,
186
+ "MEMORY_ATOMIC_WAIT64">;
179
187
180
188
multiclass WaitPatGlobalAddrOffOnly<ValueType ty, Intrinsic kind, string inst> {
181
189
def : Pat<(i32 (kind (WebAssemblywrapper tglobaladdr:$off), ty:$exp,
@@ -189,10 +197,10 @@ multiclass WaitPatGlobalAddrOffOnly<ValueType ty, Intrinsic kind, string inst> {
189
197
I64:$timeout)>,
190
198
Requires<[HasAddr64]>;
191
199
}
192
- defm : WaitPatGlobalAddrOffOnly<i32, int_wasm_atomic_wait_i32 ,
193
- "ATOMIC_WAIT_I32 ">;
194
- defm : WaitPatGlobalAddrOffOnly<i64, int_wasm_atomic_wait_i64 ,
195
- "ATOMIC_WAIT_I64 ">;
200
+ defm : WaitPatGlobalAddrOffOnly<i32, int_wasm_memory_atomic_wait32 ,
201
+ "MEMORY_ATOMIC_WAIT32 ">;
202
+ defm : WaitPatGlobalAddrOffOnly<i64, int_wasm_memory_atomic_wait64 ,
203
+ "MEMORY_ATOMIC_WAIT64 ">;
196
204
} // Predicates = [HasAtomics]
197
205
198
206
//===----------------------------------------------------------------------===//
0 commit comments