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

Side by Side Diff: runtime/lib/simd128.cc

Issue 19646005: Add two argument shuffle operations to Float32x4 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/lib/typed_data.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/bootstrap_natives.h" 5 #include "vm/bootstrap_natives.h"
6 6
7 #include "vm/exceptions.h" 7 #include "vm/exceptions.h"
8 #include "vm/native_entry.h" 8 #include "vm/native_entry.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/symbols.h" 10 #include "vm/symbols.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 int64_t m = mask.AsInt64Value(); 235 int64_t m = mask.AsInt64Value();
236 float data[4] = { self.x(), self.y(), self.z(), self.w() }; 236 float data[4] = { self.x(), self.y(), self.z(), self.w() };
237 float _x = data[m & 0x3]; 237 float _x = data[m & 0x3];
238 float _y = data[(m >> 2) & 0x3]; 238 float _y = data[(m >> 2) & 0x3];
239 float _z = data[(m >> 4) & 0x3]; 239 float _z = data[(m >> 4) & 0x3];
240 float _w = data[(m >> 6) & 0x3]; 240 float _w = data[(m >> 6) & 0x3];
241 return Float32x4::New(_x, _y, _z, _w); 241 return Float32x4::New(_x, _y, _z, _w);
242 } 242 }
243 243
244 244
245 DEFINE_NATIVE_ENTRY(Float32x4_withZWInXY, 2) {
246 GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, self, arguments->NativeArgAt(0));
247 GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, other, arguments->NativeArgAt(1));
248 float _x = other.z();
249 float _y = other.w();
250 float _z = self.z();
251 float _w = self.w();
252 return Float32x4::New(_x, _y, _z, _w);
253 }
254
255
256 DEFINE_NATIVE_ENTRY(Float32x4_interleaveXY, 2) {
257 GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, self, arguments->NativeArgAt(0));
258 GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, other, arguments->NativeArgAt(1));
259 float _x = self.x();
260 float _y = other.x();
261 float _z = self.y();
262 float _w = other.y();
263 return Float32x4::New(_x, _y, _z, _w);
264 }
265
266
267 DEFINE_NATIVE_ENTRY(Float32x4_interleaveZW, 2) {
268 GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, self, arguments->NativeArgAt(0));
269 GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, other, arguments->NativeArgAt(1));
270 float _x = self.z();
271 float _y = other.z();
272 float _z = self.w();
273 float _w = other.w();
274 return Float32x4::New(_x, _y, _z, _w);
275 }
276
277
278 DEFINE_NATIVE_ENTRY(Float32x4_interleaveXYPairs, 2) {
279 GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, self, arguments->NativeArgAt(0));
280 GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, other, arguments->NativeArgAt(1));
281 float _x = self.x();
282 float _y = self.y();
283 float _z = other.x();
284 float _w = other.y();
285 return Float32x4::New(_x, _y, _z, _w);
286 }
287
288
289 DEFINE_NATIVE_ENTRY(Float32x4_interleaveZWPairs, 2) {
290 GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, self, arguments->NativeArgAt(0));
291 GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, other, arguments->NativeArgAt(1));
292 float _x = self.z();
293 float _y = self.w();
294 float _z = other.z();
295 float _w = other.w();
296 return Float32x4::New(_x, _y, _z, _w);
297 }
298
299
245 DEFINE_NATIVE_ENTRY(Float32x4_setX, 2) { 300 DEFINE_NATIVE_ENTRY(Float32x4_setX, 2) {
246 GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, self, arguments->NativeArgAt(0)); 301 GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, self, arguments->NativeArgAt(0));
247 GET_NON_NULL_NATIVE_ARGUMENT(Double, x, arguments->NativeArgAt(1)); 302 GET_NON_NULL_NATIVE_ARGUMENT(Double, x, arguments->NativeArgAt(1));
248 float _x = static_cast<float>(x.value()); 303 float _x = static_cast<float>(x.value());
249 float _y = self.y(); 304 float _y = self.y();
250 float _z = self.z(); 305 float _z = self.z();
251 float _w = self.w(); 306 float _w = self.w();
252 return Float32x4::New(_x, _y, _z, _w); 307 return Float32x4::New(_x, _y, _z, _w);
253 } 308 }
254 309
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 } 652 }
598 653
599 654
600 DEFINE_NATIVE_ENTRY(Uint32x4_toFloat32x4, 1) { 655 DEFINE_NATIVE_ENTRY(Uint32x4_toFloat32x4, 1) {
601 GET_NON_NULL_NATIVE_ARGUMENT(Uint32x4, v, arguments->NativeArgAt(0)); 656 GET_NON_NULL_NATIVE_ARGUMENT(Uint32x4, v, arguments->NativeArgAt(0));
602 return Float32x4::New(v.value()); 657 return Float32x4::New(v.value());
603 } 658 }
604 659
605 660
606 } // namespace dart 661 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/typed_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698