Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Side by Side Diff: src/compiler/machine-operator.cc

Issue 2776753004: [wasm] Make Opcode names consistent across architectures, implementations (Closed)
Patch Set: Scalar fix Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/machine-operator.h" 5 #include "src/compiler/machine-operator.h"
6 6
7 #include "src/base/lazy-instance.h" 7 #include "src/base/lazy-instance.h"
8 #include "src/compiler/opcodes.h" 8 #include "src/compiler/opcodes.h"
9 #include "src/compiler/operator.h" 9 #include "src/compiler/operator.h"
10 10
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 V(Int64Mul, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ 127 V(Int64Mul, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
128 V(Int64Div, Operator::kNoProperties, 2, 1, 1) \ 128 V(Int64Div, Operator::kNoProperties, 2, 1, 1) \
129 V(Int64Mod, Operator::kNoProperties, 2, 1, 1) \ 129 V(Int64Mod, Operator::kNoProperties, 2, 1, 1) \
130 V(Int64LessThan, Operator::kNoProperties, 2, 0, 1) \ 130 V(Int64LessThan, Operator::kNoProperties, 2, 0, 1) \
131 V(Int64LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ 131 V(Int64LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \
132 V(Uint64Div, Operator::kNoProperties, 2, 1, 1) \ 132 V(Uint64Div, Operator::kNoProperties, 2, 1, 1) \
133 V(Uint64Mod, Operator::kNoProperties, 2, 1, 1) \ 133 V(Uint64Mod, Operator::kNoProperties, 2, 1, 1) \
134 V(Uint64LessThan, Operator::kNoProperties, 2, 0, 1) \ 134 V(Uint64LessThan, Operator::kNoProperties, 2, 0, 1) \
135 V(Uint64LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) 135 V(Uint64LessThanOrEqual, Operator::kNoProperties, 2, 0, 1)
136 136
137 #define PURE_OP_LIST(V) \ 137 #define PURE_OP_LIST(V) \
138 PURE_BINARY_OP_LIST_32(V) \ 138 PURE_BINARY_OP_LIST_32(V) \
139 PURE_BINARY_OP_LIST_64(V) \ 139 PURE_BINARY_OP_LIST_64(V) \
140 V(Word32Clz, Operator::kNoProperties, 1, 0, 1) \ 140 V(Word32Clz, Operator::kNoProperties, 1, 0, 1) \
141 V(Word64Clz, Operator::kNoProperties, 1, 0, 1) \ 141 V(Word64Clz, Operator::kNoProperties, 1, 0, 1) \
142 V(BitcastTaggedToWord, Operator::kNoProperties, 1, 0, 1) \ 142 V(BitcastTaggedToWord, Operator::kNoProperties, 1, 0, 1) \
143 V(BitcastWordToTaggedSigned, Operator::kNoProperties, 1, 0, 1) \ 143 V(BitcastWordToTaggedSigned, Operator::kNoProperties, 1, 0, 1) \
144 V(TruncateFloat64ToWord32, Operator::kNoProperties, 1, 0, 1) \ 144 V(TruncateFloat64ToWord32, Operator::kNoProperties, 1, 0, 1) \
145 V(ChangeFloat32ToFloat64, Operator::kNoProperties, 1, 0, 1) \ 145 V(ChangeFloat32ToFloat64, Operator::kNoProperties, 1, 0, 1) \
146 V(ChangeFloat64ToInt32, Operator::kNoProperties, 1, 0, 1) \ 146 V(ChangeFloat64ToInt32, Operator::kNoProperties, 1, 0, 1) \
147 V(ChangeFloat64ToUint32, Operator::kNoProperties, 1, 0, 1) \ 147 V(ChangeFloat64ToUint32, Operator::kNoProperties, 1, 0, 1) \
148 V(ChangeFloat64ToUint64, Operator::kNoProperties, 1, 0, 1) \ 148 V(ChangeFloat64ToUint64, Operator::kNoProperties, 1, 0, 1) \
149 V(TruncateFloat64ToUint32, Operator::kNoProperties, 1, 0, 1) \ 149 V(TruncateFloat64ToUint32, Operator::kNoProperties, 1, 0, 1) \
150 V(TruncateFloat32ToInt32, Operator::kNoProperties, 1, 0, 1) \ 150 V(TruncateFloat32ToInt32, Operator::kNoProperties, 1, 0, 1) \
151 V(TruncateFloat32ToUint32, Operator::kNoProperties, 1, 0, 1) \ 151 V(TruncateFloat32ToUint32, Operator::kNoProperties, 1, 0, 1) \
152 V(TryTruncateFloat32ToInt64, Operator::kNoProperties, 1, 0, 2) \ 152 V(TryTruncateFloat32ToInt64, Operator::kNoProperties, 1, 0, 2) \
153 V(TryTruncateFloat64ToInt64, Operator::kNoProperties, 1, 0, 2) \ 153 V(TryTruncateFloat64ToInt64, Operator::kNoProperties, 1, 0, 2) \
154 V(TryTruncateFloat32ToUint64, Operator::kNoProperties, 1, 0, 2) \ 154 V(TryTruncateFloat32ToUint64, Operator::kNoProperties, 1, 0, 2) \
155 V(TryTruncateFloat64ToUint64, Operator::kNoProperties, 1, 0, 2) \ 155 V(TryTruncateFloat64ToUint64, Operator::kNoProperties, 1, 0, 2) \
156 V(ChangeInt32ToFloat64, Operator::kNoProperties, 1, 0, 1) \ 156 V(ChangeInt32ToFloat64, Operator::kNoProperties, 1, 0, 1) \
157 V(Float64SilenceNaN, Operator::kNoProperties, 1, 0, 1) \ 157 V(Float64SilenceNaN, Operator::kNoProperties, 1, 0, 1) \
158 V(RoundFloat64ToInt32, Operator::kNoProperties, 1, 0, 1) \ 158 V(RoundFloat64ToInt32, Operator::kNoProperties, 1, 0, 1) \
159 V(RoundInt32ToFloat32, Operator::kNoProperties, 1, 0, 1) \ 159 V(RoundInt32ToFloat32, Operator::kNoProperties, 1, 0, 1) \
160 V(RoundInt64ToFloat32, Operator::kNoProperties, 1, 0, 1) \ 160 V(RoundInt64ToFloat32, Operator::kNoProperties, 1, 0, 1) \
161 V(RoundInt64ToFloat64, Operator::kNoProperties, 1, 0, 1) \ 161 V(RoundInt64ToFloat64, Operator::kNoProperties, 1, 0, 1) \
162 V(RoundUint32ToFloat32, Operator::kNoProperties, 1, 0, 1) \ 162 V(RoundUint32ToFloat32, Operator::kNoProperties, 1, 0, 1) \
163 V(RoundUint64ToFloat32, Operator::kNoProperties, 1, 0, 1) \ 163 V(RoundUint64ToFloat32, Operator::kNoProperties, 1, 0, 1) \
164 V(RoundUint64ToFloat64, Operator::kNoProperties, 1, 0, 1) \ 164 V(RoundUint64ToFloat64, Operator::kNoProperties, 1, 0, 1) \
165 V(ChangeInt32ToInt64, Operator::kNoProperties, 1, 0, 1) \ 165 V(ChangeInt32ToInt64, Operator::kNoProperties, 1, 0, 1) \
166 V(ChangeUint32ToFloat64, Operator::kNoProperties, 1, 0, 1) \ 166 V(ChangeUint32ToFloat64, Operator::kNoProperties, 1, 0, 1) \
167 V(ChangeUint32ToUint64, Operator::kNoProperties, 1, 0, 1) \ 167 V(ChangeUint32ToUint64, Operator::kNoProperties, 1, 0, 1) \
168 V(TruncateFloat64ToFloat32, Operator::kNoProperties, 1, 0, 1) \ 168 V(TruncateFloat64ToFloat32, Operator::kNoProperties, 1, 0, 1) \
169 V(TruncateInt64ToInt32, Operator::kNoProperties, 1, 0, 1) \ 169 V(TruncateInt64ToInt32, Operator::kNoProperties, 1, 0, 1) \
170 V(BitcastFloat32ToInt32, Operator::kNoProperties, 1, 0, 1) \ 170 V(BitcastFloat32ToInt32, Operator::kNoProperties, 1, 0, 1) \
171 V(BitcastFloat64ToInt64, Operator::kNoProperties, 1, 0, 1) \ 171 V(BitcastFloat64ToInt64, Operator::kNoProperties, 1, 0, 1) \
172 V(BitcastInt32ToFloat32, Operator::kNoProperties, 1, 0, 1) \ 172 V(BitcastInt32ToFloat32, Operator::kNoProperties, 1, 0, 1) \
173 V(BitcastInt64ToFloat64, Operator::kNoProperties, 1, 0, 1) \ 173 V(BitcastInt64ToFloat64, Operator::kNoProperties, 1, 0, 1) \
174 V(Float32Abs, Operator::kNoProperties, 1, 0, 1) \ 174 V(Float32Abs, Operator::kNoProperties, 1, 0, 1) \
175 V(Float32Add, Operator::kCommutative, 2, 0, 1) \ 175 V(Float32Add, Operator::kCommutative, 2, 0, 1) \
176 V(Float32Sub, Operator::kNoProperties, 2, 0, 1) \ 176 V(Float32Sub, Operator::kNoProperties, 2, 0, 1) \
177 V(Float32Mul, Operator::kCommutative, 2, 0, 1) \ 177 V(Float32Mul, Operator::kCommutative, 2, 0, 1) \
178 V(Float32Div, Operator::kNoProperties, 2, 0, 1) \ 178 V(Float32Div, Operator::kNoProperties, 2, 0, 1) \
179 V(Float32Neg, Operator::kNoProperties, 1, 0, 1) \ 179 V(Float32Neg, Operator::kNoProperties, 1, 0, 1) \
180 V(Float32Sqrt, Operator::kNoProperties, 1, 0, 1) \ 180 V(Float32Sqrt, Operator::kNoProperties, 1, 0, 1) \
181 V(Float32Max, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ 181 V(Float32Max, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
182 V(Float32Min, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ 182 V(Float32Min, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
183 V(Float64Abs, Operator::kNoProperties, 1, 0, 1) \ 183 V(Float64Abs, Operator::kNoProperties, 1, 0, 1) \
184 V(Float64Acos, Operator::kNoProperties, 1, 0, 1) \ 184 V(Float64Acos, Operator::kNoProperties, 1, 0, 1) \
185 V(Float64Acosh, Operator::kNoProperties, 1, 0, 1) \ 185 V(Float64Acosh, Operator::kNoProperties, 1, 0, 1) \
186 V(Float64Asin, Operator::kNoProperties, 1, 0, 1) \ 186 V(Float64Asin, Operator::kNoProperties, 1, 0, 1) \
187 V(Float64Asinh, Operator::kNoProperties, 1, 0, 1) \ 187 V(Float64Asinh, Operator::kNoProperties, 1, 0, 1) \
188 V(Float64Atan, Operator::kNoProperties, 1, 0, 1) \ 188 V(Float64Atan, Operator::kNoProperties, 1, 0, 1) \
189 V(Float64Atan2, Operator::kNoProperties, 2, 0, 1) \ 189 V(Float64Atan2, Operator::kNoProperties, 2, 0, 1) \
190 V(Float64Atanh, Operator::kNoProperties, 1, 0, 1) \ 190 V(Float64Atanh, Operator::kNoProperties, 1, 0, 1) \
191 V(Float64Cbrt, Operator::kNoProperties, 1, 0, 1) \ 191 V(Float64Cbrt, Operator::kNoProperties, 1, 0, 1) \
192 V(Float64Cos, Operator::kNoProperties, 1, 0, 1) \ 192 V(Float64Cos, Operator::kNoProperties, 1, 0, 1) \
193 V(Float64Cosh, Operator::kNoProperties, 1, 0, 1) \ 193 V(Float64Cosh, Operator::kNoProperties, 1, 0, 1) \
194 V(Float64Exp, Operator::kNoProperties, 1, 0, 1) \ 194 V(Float64Exp, Operator::kNoProperties, 1, 0, 1) \
195 V(Float64Expm1, Operator::kNoProperties, 1, 0, 1) \ 195 V(Float64Expm1, Operator::kNoProperties, 1, 0, 1) \
196 V(Float64Log, Operator::kNoProperties, 1, 0, 1) \ 196 V(Float64Log, Operator::kNoProperties, 1, 0, 1) \
197 V(Float64Log1p, Operator::kNoProperties, 1, 0, 1) \ 197 V(Float64Log1p, Operator::kNoProperties, 1, 0, 1) \
198 V(Float64Log2, Operator::kNoProperties, 1, 0, 1) \ 198 V(Float64Log2, Operator::kNoProperties, 1, 0, 1) \
199 V(Float64Log10, Operator::kNoProperties, 1, 0, 1) \ 199 V(Float64Log10, Operator::kNoProperties, 1, 0, 1) \
200 V(Float64Max, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ 200 V(Float64Max, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
201 V(Float64Min, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ 201 V(Float64Min, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
202 V(Float64Neg, Operator::kNoProperties, 1, 0, 1) \ 202 V(Float64Neg, Operator::kNoProperties, 1, 0, 1) \
203 V(Float64Add, Operator::kCommutative, 2, 0, 1) \ 203 V(Float64Add, Operator::kCommutative, 2, 0, 1) \
204 V(Float64Sub, Operator::kNoProperties, 2, 0, 1) \ 204 V(Float64Sub, Operator::kNoProperties, 2, 0, 1) \
205 V(Float64Mul, Operator::kCommutative, 2, 0, 1) \ 205 V(Float64Mul, Operator::kCommutative, 2, 0, 1) \
206 V(Float64Div, Operator::kNoProperties, 2, 0, 1) \ 206 V(Float64Div, Operator::kNoProperties, 2, 0, 1) \
207 V(Float64Mod, Operator::kNoProperties, 2, 0, 1) \ 207 V(Float64Mod, Operator::kNoProperties, 2, 0, 1) \
208 V(Float64Pow, Operator::kNoProperties, 2, 0, 1) \ 208 V(Float64Pow, Operator::kNoProperties, 2, 0, 1) \
209 V(Float64Sin, Operator::kNoProperties, 1, 0, 1) \ 209 V(Float64Sin, Operator::kNoProperties, 1, 0, 1) \
210 V(Float64Sinh, Operator::kNoProperties, 1, 0, 1) \ 210 V(Float64Sinh, Operator::kNoProperties, 1, 0, 1) \
211 V(Float64Sqrt, Operator::kNoProperties, 1, 0, 1) \ 211 V(Float64Sqrt, Operator::kNoProperties, 1, 0, 1) \
212 V(Float64Tan, Operator::kNoProperties, 1, 0, 1) \ 212 V(Float64Tan, Operator::kNoProperties, 1, 0, 1) \
213 V(Float64Tanh, Operator::kNoProperties, 1, 0, 1) \ 213 V(Float64Tanh, Operator::kNoProperties, 1, 0, 1) \
214 V(Float32Equal, Operator::kCommutative, 2, 0, 1) \ 214 V(Float32Equal, Operator::kCommutative, 2, 0, 1) \
215 V(Float32LessThan, Operator::kNoProperties, 2, 0, 1) \ 215 V(Float32LessThan, Operator::kNoProperties, 2, 0, 1) \
216 V(Float32LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ 216 V(Float32LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \
217 V(Float64Equal, Operator::kCommutative, 2, 0, 1) \ 217 V(Float64Equal, Operator::kCommutative, 2, 0, 1) \
218 V(Float64LessThan, Operator::kNoProperties, 2, 0, 1) \ 218 V(Float64LessThan, Operator::kNoProperties, 2, 0, 1) \
219 V(Float64LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ 219 V(Float64LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \
220 V(Float64ExtractLowWord32, Operator::kNoProperties, 1, 0, 1) \ 220 V(Float64ExtractLowWord32, Operator::kNoProperties, 1, 0, 1) \
221 V(Float64ExtractHighWord32, Operator::kNoProperties, 1, 0, 1) \ 221 V(Float64ExtractHighWord32, Operator::kNoProperties, 1, 0, 1) \
222 V(Float64InsertLowWord32, Operator::kNoProperties, 2, 0, 1) \ 222 V(Float64InsertLowWord32, Operator::kNoProperties, 2, 0, 1) \
223 V(Float64InsertHighWord32, Operator::kNoProperties, 2, 0, 1) \ 223 V(Float64InsertHighWord32, Operator::kNoProperties, 2, 0, 1) \
224 V(LoadStackPointer, Operator::kNoProperties, 0, 0, 1) \ 224 V(LoadStackPointer, Operator::kNoProperties, 0, 0, 1) \
225 V(LoadFramePointer, Operator::kNoProperties, 0, 0, 1) \ 225 V(LoadFramePointer, Operator::kNoProperties, 0, 0, 1) \
226 V(LoadParentFramePointer, Operator::kNoProperties, 0, 0, 1) \ 226 V(LoadParentFramePointer, Operator::kNoProperties, 0, 0, 1) \
227 V(Int32PairAdd, Operator::kNoProperties, 4, 0, 2) \ 227 V(Int32PairAdd, Operator::kNoProperties, 4, 0, 2) \
228 V(Int32PairSub, Operator::kNoProperties, 4, 0, 2) \ 228 V(Int32PairSub, Operator::kNoProperties, 4, 0, 2) \
229 V(Int32PairMul, Operator::kNoProperties, 4, 0, 2) \ 229 V(Int32PairMul, Operator::kNoProperties, 4, 0, 2) \
230 V(Word32PairShl, Operator::kNoProperties, 3, 0, 2) \ 230 V(Word32PairShl, Operator::kNoProperties, 3, 0, 2) \
231 V(Word32PairShr, Operator::kNoProperties, 3, 0, 2) \ 231 V(Word32PairShr, Operator::kNoProperties, 3, 0, 2) \
232 V(Word32PairSar, Operator::kNoProperties, 3, 0, 2) \ 232 V(Word32PairSar, Operator::kNoProperties, 3, 0, 2) \
233 V(Float32x4Splat, Operator::kNoProperties, 1, 0, 1) \ 233 V(F32x4Splat, Operator::kNoProperties, 1, 0, 1) \
234 V(Float32x4Abs, Operator::kNoProperties, 1, 0, 1) \ 234 V(F32x4Abs, Operator::kNoProperties, 1, 0, 1) \
235 V(Float32x4Neg, Operator::kNoProperties, 1, 0, 1) \ 235 V(F32x4Neg, Operator::kNoProperties, 1, 0, 1) \
236 V(Float32x4Sqrt, Operator::kNoProperties, 1, 0, 1) \ 236 V(F32x4Sqrt, Operator::kNoProperties, 1, 0, 1) \
237 V(Float32x4RecipApprox, Operator::kNoProperties, 1, 0, 1) \ 237 V(F32x4RecipApprox, Operator::kNoProperties, 1, 0, 1) \
238 V(Float32x4RecipSqrtApprox, Operator::kNoProperties, 1, 0, 1) \ 238 V(F32x4RecipSqrtApprox, Operator::kNoProperties, 1, 0, 1) \
239 V(Float32x4Add, Operator::kCommutative, 2, 0, 1) \ 239 V(F32x4Add, Operator::kCommutative, 2, 0, 1) \
240 V(Float32x4Sub, Operator::kNoProperties, 2, 0, 1) \ 240 V(F32x4Sub, Operator::kNoProperties, 2, 0, 1) \
241 V(Float32x4Mul, Operator::kCommutative, 2, 0, 1) \ 241 V(F32x4Mul, Operator::kCommutative, 2, 0, 1) \
242 V(Float32x4Div, Operator::kNoProperties, 2, 0, 1) \ 242 V(F32x4Div, Operator::kNoProperties, 2, 0, 1) \
243 V(Float32x4Min, Operator::kCommutative, 2, 0, 1) \ 243 V(F32x4Min, Operator::kCommutative, 2, 0, 1) \
244 V(Float32x4Max, Operator::kCommutative, 2, 0, 1) \ 244 V(F32x4Max, Operator::kCommutative, 2, 0, 1) \
245 V(Float32x4MinNum, Operator::kCommutative, 2, 0, 1) \ 245 V(F32x4MinNum, Operator::kCommutative, 2, 0, 1) \
246 V(Float32x4MaxNum, Operator::kCommutative, 2, 0, 1) \ 246 V(F32x4MaxNum, Operator::kCommutative, 2, 0, 1) \
247 V(Float32x4RecipRefine, Operator::kNoProperties, 2, 0, 1) \ 247 V(F32x4RecipRefine, Operator::kNoProperties, 2, 0, 1) \
248 V(Float32x4RecipSqrtRefine, Operator::kNoProperties, 2, 0, 1) \ 248 V(F32x4RecipSqrtRefine, Operator::kNoProperties, 2, 0, 1) \
249 V(Float32x4Equal, Operator::kCommutative, 2, 0, 1) \ 249 V(F32x4Eq, Operator::kCommutative, 2, 0, 1) \
250 V(Float32x4NotEqual, Operator::kCommutative, 2, 0, 1) \ 250 V(F32x4Ne, Operator::kCommutative, 2, 0, 1) \
251 V(Float32x4LessThan, Operator::kNoProperties, 2, 0, 1) \ 251 V(F32x4Lt, Operator::kNoProperties, 2, 0, 1) \
252 V(Float32x4LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ 252 V(F32x4Le, Operator::kNoProperties, 2, 0, 1) \
253 V(Float32x4FromInt32x4, Operator::kNoProperties, 1, 0, 1) \ 253 V(F32x4SConvertI32x4, Operator::kNoProperties, 1, 0, 1) \
254 V(Float32x4FromUint32x4, Operator::kNoProperties, 1, 0, 1) \ 254 V(F32x4UConvertI32x4, Operator::kNoProperties, 1, 0, 1) \
255 V(Int32x4Splat, Operator::kNoProperties, 1, 0, 1) \ 255 V(I32x4Splat, Operator::kNoProperties, 1, 0, 1) \
256 V(Int32x4Neg, Operator::kNoProperties, 1, 0, 1) \ 256 V(I32x4Neg, Operator::kNoProperties, 1, 0, 1) \
257 V(Int32x4Add, Operator::kCommutative, 2, 0, 1) \ 257 V(I32x4Add, Operator::kCommutative, 2, 0, 1) \
258 V(Int32x4Sub, Operator::kNoProperties, 2, 0, 1) \ 258 V(I32x4Sub, Operator::kNoProperties, 2, 0, 1) \
259 V(Int32x4Mul, Operator::kCommutative, 2, 0, 1) \ 259 V(I32x4Mul, Operator::kCommutative, 2, 0, 1) \
260 V(Int32x4Min, Operator::kCommutative, 2, 0, 1) \ 260 V(I32x4MinS, Operator::kCommutative, 2, 0, 1) \
261 V(Int32x4Max, Operator::kCommutative, 2, 0, 1) \ 261 V(I32x4MaxS, Operator::kCommutative, 2, 0, 1) \
262 V(Int32x4Equal, Operator::kCommutative, 2, 0, 1) \ 262 V(I32x4Eq, Operator::kCommutative, 2, 0, 1) \
263 V(Int32x4NotEqual, Operator::kCommutative, 2, 0, 1) \ 263 V(I32x4Ne, Operator::kCommutative, 2, 0, 1) \
264 V(Int32x4LessThan, Operator::kNoProperties, 2, 0, 1) \ 264 V(I32x4LtS, Operator::kNoProperties, 2, 0, 1) \
265 V(Int32x4LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ 265 V(I32x4LeS, Operator::kNoProperties, 2, 0, 1) \
266 V(Int32x4FromFloat32x4, Operator::kNoProperties, 1, 0, 1) \ 266 V(I32x4SConvertF32x4, Operator::kNoProperties, 1, 0, 1) \
267 V(Uint32x4Min, Operator::kCommutative, 2, 0, 1) \ 267 V(I32x4MinU, Operator::kCommutative, 2, 0, 1) \
268 V(Uint32x4Max, Operator::kCommutative, 2, 0, 1) \ 268 V(I32x4MaxU, Operator::kCommutative, 2, 0, 1) \
269 V(Uint32x4LessThan, Operator::kNoProperties, 2, 0, 1) \ 269 V(I32x4LtU, Operator::kNoProperties, 2, 0, 1) \
270 V(Uint32x4LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ 270 V(I32x4LeU, Operator::kNoProperties, 2, 0, 1) \
271 V(Uint32x4FromFloat32x4, Operator::kNoProperties, 1, 0, 1) \ 271 V(I32x4UConvertF32x4, Operator::kNoProperties, 1, 0, 1) \
272 V(Int16x8Splat, Operator::kNoProperties, 1, 0, 1) \ 272 V(I16x8Splat, Operator::kNoProperties, 1, 0, 1) \
273 V(Int16x8Neg, Operator::kNoProperties, 1, 0, 1) \ 273 V(I16x8Neg, Operator::kNoProperties, 1, 0, 1) \
274 V(Int16x8Add, Operator::kCommutative, 2, 0, 1) \ 274 V(I16x8Add, Operator::kCommutative, 2, 0, 1) \
275 V(Int16x8AddSaturate, Operator::kCommutative, 2, 0, 1) \ 275 V(I16x8AddSaturate, Operator::kCommutative, 2, 0, 1) \
276 V(Int16x8Sub, Operator::kNoProperties, 2, 0, 1) \ 276 V(I16x8Sub, Operator::kNoProperties, 2, 0, 1) \
277 V(Int16x8SubSaturate, Operator::kNoProperties, 2, 0, 1) \ 277 V(I16x8SubSaturate, Operator::kNoProperties, 2, 0, 1) \
278 V(Int16x8Mul, Operator::kCommutative, 2, 0, 1) \ 278 V(I16x8Mul, Operator::kCommutative, 2, 0, 1) \
279 V(Int16x8Min, Operator::kCommutative, 2, 0, 1) \ 279 V(I16x8MinS, Operator::kCommutative, 2, 0, 1) \
280 V(Int16x8Max, Operator::kCommutative, 2, 0, 1) \ 280 V(I16x8MaxS, Operator::kCommutative, 2, 0, 1) \
281 V(Int16x8Equal, Operator::kCommutative, 2, 0, 1) \ 281 V(I16x8Eq, Operator::kCommutative, 2, 0, 1) \
282 V(Int16x8NotEqual, Operator::kCommutative, 2, 0, 1) \ 282 V(I16x8Ne, Operator::kCommutative, 2, 0, 1) \
283 V(Int16x8LessThan, Operator::kNoProperties, 2, 0, 1) \ 283 V(I16x8LtS, Operator::kNoProperties, 2, 0, 1) \
284 V(Int16x8LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ 284 V(I16x8LeS, Operator::kNoProperties, 2, 0, 1) \
285 V(Uint16x8AddSaturate, Operator::kCommutative, 2, 0, 1) \ 285 V(I16x8AddSaturateU, Operator::kCommutative, 2, 0, 1) \
286 V(Uint16x8SubSaturate, Operator::kNoProperties, 2, 0, 1) \ 286 V(I16x8SubSaturateU, Operator::kNoProperties, 2, 0, 1) \
287 V(Uint16x8Min, Operator::kCommutative, 2, 0, 1) \ 287 V(I16x8MinU, Operator::kCommutative, 2, 0, 1) \
288 V(Uint16x8Max, Operator::kCommutative, 2, 0, 1) \ 288 V(I16x8MaxU, Operator::kCommutative, 2, 0, 1) \
289 V(Uint16x8LessThan, Operator::kNoProperties, 2, 0, 1) \ 289 V(I16x8LtU, Operator::kNoProperties, 2, 0, 1) \
290 V(Uint16x8LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ 290 V(I16x8LeU, Operator::kNoProperties, 2, 0, 1) \
291 V(Int8x16Splat, Operator::kNoProperties, 1, 0, 1) \ 291 V(I8x16Splat, Operator::kNoProperties, 1, 0, 1) \
292 V(Int8x16Neg, Operator::kNoProperties, 1, 0, 1) \ 292 V(I8x16Neg, Operator::kNoProperties, 1, 0, 1) \
293 V(Int8x16Add, Operator::kCommutative, 2, 0, 1) \ 293 V(I8x16Add, Operator::kCommutative, 2, 0, 1) \
294 V(Int8x16AddSaturate, Operator::kCommutative, 2, 0, 1) \ 294 V(I8x16AddSaturate, Operator::kCommutative, 2, 0, 1) \
295 V(Int8x16Sub, Operator::kNoProperties, 2, 0, 1) \ 295 V(I8x16Sub, Operator::kNoProperties, 2, 0, 1) \
296 V(Int8x16SubSaturate, Operator::kNoProperties, 2, 0, 1) \ 296 V(I8x16SubSaturate, Operator::kNoProperties, 2, 0, 1) \
297 V(Int8x16Mul, Operator::kCommutative, 2, 0, 1) \ 297 V(I8x16Mul, Operator::kCommutative, 2, 0, 1) \
298 V(Int8x16Min, Operator::kCommutative, 2, 0, 1) \ 298 V(I8x16MinS, Operator::kCommutative, 2, 0, 1) \
299 V(Int8x16Max, Operator::kCommutative, 2, 0, 1) \ 299 V(I8x16MaxS, Operator::kCommutative, 2, 0, 1) \
300 V(Int8x16Equal, Operator::kCommutative, 2, 0, 1) \ 300 V(I8x16Eq, Operator::kCommutative, 2, 0, 1) \
301 V(Int8x16NotEqual, Operator::kCommutative, 2, 0, 1) \ 301 V(I8x16Ne, Operator::kCommutative, 2, 0, 1) \
302 V(Int8x16LessThan, Operator::kNoProperties, 2, 0, 1) \ 302 V(I8x16LtS, Operator::kNoProperties, 2, 0, 1) \
303 V(Int8x16LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ 303 V(I8x16LeS, Operator::kNoProperties, 2, 0, 1) \
304 V(Uint8x16AddSaturate, Operator::kCommutative, 2, 0, 1) \ 304 V(I8x16AddSaturateU, Operator::kCommutative, 2, 0, 1) \
305 V(Uint8x16SubSaturate, Operator::kNoProperties, 2, 0, 1) \ 305 V(I8x16SubSaturateU, Operator::kNoProperties, 2, 0, 1) \
306 V(Uint8x16Min, Operator::kCommutative, 2, 0, 1) \ 306 V(I8x16MinU, Operator::kCommutative, 2, 0, 1) \
307 V(Uint8x16Max, Operator::kCommutative, 2, 0, 1) \ 307 V(I8x16MaxU, Operator::kCommutative, 2, 0, 1) \
308 V(Uint8x16LessThan, Operator::kNoProperties, 2, 0, 1) \ 308 V(I8x16LtU, Operator::kNoProperties, 2, 0, 1) \
309 V(Uint8x16LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ 309 V(I8x16LeU, Operator::kNoProperties, 2, 0, 1) \
310 V(Simd128Load, Operator::kNoProperties, 2, 0, 1) \ 310 V(Simd128Load, Operator::kNoProperties, 2, 0, 1) \
311 V(Simd128Load1, Operator::kNoProperties, 2, 0, 1) \ 311 V(Simd128Load1, Operator::kNoProperties, 2, 0, 1) \
312 V(Simd128Load2, Operator::kNoProperties, 2, 0, 1) \ 312 V(Simd128Load2, Operator::kNoProperties, 2, 0, 1) \
313 V(Simd128Load3, Operator::kNoProperties, 2, 0, 1) \ 313 V(Simd128Load3, Operator::kNoProperties, 2, 0, 1) \
314 V(Simd128Store, Operator::kNoProperties, 3, 0, 1) \ 314 V(Simd128Store, Operator::kNoProperties, 3, 0, 1) \
315 V(Simd128Store1, Operator::kNoProperties, 3, 0, 1) \ 315 V(Simd128Store1, Operator::kNoProperties, 3, 0, 1) \
316 V(Simd128Store2, Operator::kNoProperties, 3, 0, 1) \ 316 V(Simd128Store2, Operator::kNoProperties, 3, 0, 1) \
317 V(Simd128Store3, Operator::kNoProperties, 3, 0, 1) \ 317 V(Simd128Store3, Operator::kNoProperties, 3, 0, 1) \
318 V(Simd128Zero, Operator::kNoProperties, 0, 0, 1) \ 318 V(S128Zero, Operator::kNoProperties, 0, 0, 1) \
319 V(Simd128And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ 319 V(S128And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
320 V(Simd128Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ 320 V(S128Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
321 V(Simd128Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ 321 V(S128Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
322 V(Simd128Not, Operator::kNoProperties, 1, 0, 1) \ 322 V(S128Not, Operator::kNoProperties, 1, 0, 1) \
323 V(Simd32x4Select, Operator::kNoProperties, 3, 0, 1) \ 323 V(S32x4Select, Operator::kNoProperties, 3, 0, 1) \
324 V(Simd16x8Select, Operator::kNoProperties, 3, 0, 1) \ 324 V(S16x8Select, Operator::kNoProperties, 3, 0, 1) \
325 V(Simd8x16Select, Operator::kNoProperties, 3, 0, 1) \ 325 V(S8x16Select, Operator::kNoProperties, 3, 0, 1) \
326 V(Simd1x4Zero, Operator::kNoProperties, 0, 0, 1) \ 326 V(S1x4Zero, Operator::kNoProperties, 0, 0, 1) \
327 V(Simd1x4And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ 327 V(S1x4And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
328 V(Simd1x4Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ 328 V(S1x4Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
329 V(Simd1x4Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ 329 V(S1x4Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
330 V(Simd1x4Not, Operator::kNoProperties, 1, 0, 1) \ 330 V(S1x4Not, Operator::kNoProperties, 1, 0, 1) \
331 V(Simd1x4AnyTrue, Operator::kNoProperties, 1, 0, 1) \ 331 V(S1x4AnyTrue, Operator::kNoProperties, 1, 0, 1) \
332 V(Simd1x4AllTrue, Operator::kNoProperties, 1, 0, 1) \ 332 V(S1x4AllTrue, Operator::kNoProperties, 1, 0, 1) \
333 V(Simd1x8Zero, Operator::kNoProperties, 0, 0, 1) \ 333 V(S1x8Zero, Operator::kNoProperties, 0, 0, 1) \
334 V(Simd1x8And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ 334 V(S1x8And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
335 V(Simd1x8Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ 335 V(S1x8Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
336 V(Simd1x8Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ 336 V(S1x8Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
337 V(Simd1x8Not, Operator::kNoProperties, 1, 0, 1) \ 337 V(S1x8Not, Operator::kNoProperties, 1, 0, 1) \
338 V(Simd1x8AnyTrue, Operator::kNoProperties, 1, 0, 1) \ 338 V(S1x8AnyTrue, Operator::kNoProperties, 1, 0, 1) \
339 V(Simd1x8AllTrue, Operator::kNoProperties, 1, 0, 1) \ 339 V(S1x8AllTrue, Operator::kNoProperties, 1, 0, 1) \
340 V(Simd1x16Zero, Operator::kNoProperties, 0, 0, 1) \ 340 V(S1x16Zero, Operator::kNoProperties, 0, 0, 1) \
341 V(Simd1x16And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ 341 V(S1x16And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
342 V(Simd1x16Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ 342 V(S1x16Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
343 V(Simd1x16Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ 343 V(S1x16Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
344 V(Simd1x16Not, Operator::kNoProperties, 1, 0, 1) \ 344 V(S1x16Not, Operator::kNoProperties, 1, 0, 1) \
345 V(Simd1x16AnyTrue, Operator::kNoProperties, 1, 0, 1) \ 345 V(S1x16AnyTrue, Operator::kNoProperties, 1, 0, 1) \
346 V(Simd1x16AllTrue, Operator::kNoProperties, 1, 0, 1) 346 V(S1x16AllTrue, Operator::kNoProperties, 1, 0, 1)
347 347
348 #define PURE_OPTIONAL_OP_LIST(V) \ 348 #define PURE_OPTIONAL_OP_LIST(V) \
349 V(Word32Ctz, Operator::kNoProperties, 1, 0, 1) \ 349 V(Word32Ctz, Operator::kNoProperties, 1, 0, 1) \
350 V(Word64Ctz, Operator::kNoProperties, 1, 0, 1) \ 350 V(Word64Ctz, Operator::kNoProperties, 1, 0, 1) \
351 V(Word32ReverseBits, Operator::kNoProperties, 1, 0, 1) \ 351 V(Word32ReverseBits, Operator::kNoProperties, 1, 0, 1) \
352 V(Word64ReverseBits, Operator::kNoProperties, 1, 0, 1) \ 352 V(Word64ReverseBits, Operator::kNoProperties, 1, 0, 1) \
353 V(Word32ReverseBytes, Operator::kNoProperties, 1, 0, 1) \ 353 V(Word32ReverseBytes, Operator::kNoProperties, 1, 0, 1) \
354 V(Word64ReverseBytes, Operator::kNoProperties, 1, 0, 1) \ 354 V(Word64ReverseBytes, Operator::kNoProperties, 1, 0, 1) \
355 V(Word32Popcnt, Operator::kNoProperties, 1, 0, 1) \ 355 V(Word32Popcnt, Operator::kNoProperties, 1, 0, 1) \
356 V(Word64Popcnt, Operator::kNoProperties, 1, 0, 1) \ 356 V(Word64Popcnt, Operator::kNoProperties, 1, 0, 1) \
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 V(Uint16) \ 407 V(Uint16) \
408 V(Int32) \ 408 V(Int32) \
409 V(Uint32) 409 V(Uint32)
410 410
411 #define ATOMIC_REPRESENTATION_LIST(V) \ 411 #define ATOMIC_REPRESENTATION_LIST(V) \
412 V(kWord8) \ 412 V(kWord8) \
413 V(kWord16) \ 413 V(kWord16) \
414 V(kWord32) 414 V(kWord32)
415 415
416 #define SIMD_LANE_OP_LIST(V) \ 416 #define SIMD_LANE_OP_LIST(V) \
417 V(Float32x4, 4) \ 417 V(F32x4, 4) \
418 V(Int32x4, 4) \ 418 V(I32x4, 4) \
419 V(Int16x8, 8) \ 419 V(I16x8, 8) \
420 V(Int8x16, 16) 420 V(I8x16, 16)
421 421
422 #define SIMD_FORMAT_LIST(V) \ 422 #define SIMD_FORMAT_LIST(V) \
423 V(32x4, 32) \ 423 V(32x4, 32) \
424 V(16x8, 16) \ 424 V(16x8, 16) \
425 V(8x16, 8) 425 V(8x16, 8)
426 426
427 #define STACK_SLOT_CACHED_SIZES_LIST(V) V(4) V(8) V(16) 427 #define STACK_SLOT_CACHED_SIZES_LIST(V) V(4) V(8) V(16)
428 428
429 struct StackSlotOperator : public Operator1<int> { 429 struct StackSlotOperator : public Operator1<int> {
430 explicit StackSlotOperator(int size) 430 explicit StackSlotOperator(int size)
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 const Operator* MachineOperatorBuilder::Type##ReplaceLane( \ 914 const Operator* MachineOperatorBuilder::Type##ReplaceLane( \
915 int32_t lane_index) { \ 915 int32_t lane_index) { \
916 DCHECK(0 <= lane_index && lane_index < lane_count); \ 916 DCHECK(0 <= lane_index && lane_index < lane_count); \
917 return new (zone_) \ 917 return new (zone_) \
918 Operator1<int32_t>(IrOpcode::k##Type##ReplaceLane, Operator::kPure, \ 918 Operator1<int32_t>(IrOpcode::k##Type##ReplaceLane, Operator::kPure, \
919 "Replace lane", 2, 0, 0, 1, 0, 0, lane_index); \ 919 "Replace lane", 2, 0, 0, 1, 0, 0, lane_index); \
920 } 920 }
921 SIMD_LANE_OP_LIST(SIMD_LANE_OPS) 921 SIMD_LANE_OP_LIST(SIMD_LANE_OPS)
922 #undef SIMD_LANE_OPS 922 #undef SIMD_LANE_OPS
923 923
924 #define SIMD_SHIFT_OPS(format, bits) \ 924 #define SIMD_SHIFT_OPS(format, bits) \
925 const Operator* MachineOperatorBuilder::Int##format##ShiftLeftByScalar( \ 925 const Operator* MachineOperatorBuilder::I##format##Shl(int32_t shift) { \
926 int32_t shift) { \ 926 DCHECK(0 <= shift && shift < bits); \
927 DCHECK(0 <= shift && shift < bits); \ 927 return new (zone_) \
928 return new (zone_) Operator1<int32_t>( \ 928 Operator1<int32_t>(IrOpcode::kI##format##Shl, Operator::kPure, \
929 IrOpcode::kInt##format##ShiftLeftByScalar, Operator::kPure, \ 929 "Shift left", 1, 0, 0, 1, 0, 0, shift); \
930 "Shift left", 1, 0, 0, 1, 0, 0, shift); \ 930 } \
931 } \ 931 const Operator* MachineOperatorBuilder::I##format##ShrS(int32_t shift) { \
932 const Operator* MachineOperatorBuilder::Int##format##ShiftRightByScalar( \ 932 DCHECK(0 < shift && shift <= bits); \
933 int32_t shift) { \ 933 return new (zone_) \
934 DCHECK(0 < shift && shift <= bits); \ 934 Operator1<int32_t>(IrOpcode::kI##format##ShrS, Operator::kPure, \
935 return new (zone_) Operator1<int32_t>( \ 935 "Arithmetic shift right", 1, 0, 0, 1, 0, 0, shift); \
936 IrOpcode::kInt##format##ShiftRightByScalar, Operator::kPure, \ 936 } \
937 "Arithmetic shift right", 1, 0, 0, 1, 0, 0, shift); \ 937 const Operator* MachineOperatorBuilder::I##format##ShrU(int32_t shift) { \
938 } \ 938 DCHECK(0 <= shift && shift < bits); \
939 const Operator* MachineOperatorBuilder::Uint##format##ShiftRightByScalar( \ 939 return new (zone_) \
940 int32_t shift) { \ 940 Operator1<int32_t>(IrOpcode::kI##format##ShrU, Operator::kPure, \
941 DCHECK(0 <= shift && shift < bits); \ 941 "Shift right", 1, 0, 0, 1, 0, 0, shift); \
942 return new (zone_) Operator1<int32_t>( \
943 IrOpcode::kUint##format##ShiftRightByScalar, Operator::kPure, \
944 "Shift right", 1, 0, 0, 1, 0, 0, shift); \
945 } 942 }
946 SIMD_FORMAT_LIST(SIMD_SHIFT_OPS) 943 SIMD_FORMAT_LIST(SIMD_SHIFT_OPS)
947 #undef SIMD_SHIFT_OPS 944 #undef SIMD_SHIFT_OPS
948 945
949 // TODO(bbudge) Add Shuffle, DCHECKs based on format. 946 // TODO(bbudge) Add Shuffle, DCHECKs based on format.
950 #define SIMD_PERMUTE_OPS(format, bits) \ 947 #define SIMD_PERMUTE_OPS(format, bits) \
951 const Operator* MachineOperatorBuilder::Simd##format##Swizzle( \ 948 const Operator* MachineOperatorBuilder::S##format##Swizzle( \
952 uint32_t swizzle) { \ 949 uint32_t swizzle) { \
953 return new (zone_) \ 950 return new (zone_) \
954 Operator1<uint32_t>(IrOpcode::kSimd##format##Swizzle, Operator::kPure, \ 951 Operator1<uint32_t>(IrOpcode::kS##format##Swizzle, Operator::kPure, \
955 "Swizzle", 2, 0, 0, 1, 0, 0, swizzle); \ 952 "Swizzle", 2, 0, 0, 1, 0, 0, swizzle); \
956 } 953 }
957 SIMD_FORMAT_LIST(SIMD_PERMUTE_OPS) 954 SIMD_FORMAT_LIST(SIMD_PERMUTE_OPS)
958 #undef SIMD_PERMUTE_OPS 955 #undef SIMD_PERMUTE_OPS
959 956
960 } // namespace compiler 957 } // namespace compiler
961 } // namespace internal 958 } // namespace internal
962 } // namespace v8 959 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698