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

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

Issue 23018009: Add add and subtract operations to Uint32x4 (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') | runtime/lib/typed_data.dart » ('J')
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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 GET_NON_NULL_NATIVE_ARGUMENT(Uint32x4, self, arguments->NativeArgAt(0)); 464 GET_NON_NULL_NATIVE_ARGUMENT(Uint32x4, self, arguments->NativeArgAt(0));
465 GET_NON_NULL_NATIVE_ARGUMENT(Uint32x4, other, arguments->NativeArgAt(1)); 465 GET_NON_NULL_NATIVE_ARGUMENT(Uint32x4, other, arguments->NativeArgAt(1));
466 uint32_t _x = self.x() ^ other.x(); 466 uint32_t _x = self.x() ^ other.x();
467 uint32_t _y = self.y() ^ other.y(); 467 uint32_t _y = self.y() ^ other.y();
468 uint32_t _z = self.z() ^ other.z(); 468 uint32_t _z = self.z() ^ other.z();
469 uint32_t _w = self.w() ^ other.w(); 469 uint32_t _w = self.w() ^ other.w();
470 return Uint32x4::New(_x, _y, _z, _w); 470 return Uint32x4::New(_x, _y, _z, _w);
471 } 471 }
472 472
473 473
474 DEFINE_NATIVE_ENTRY(Uint32x4_add, 2) {
475 GET_NON_NULL_NATIVE_ARGUMENT(Uint32x4, self, arguments->NativeArgAt(0));
476 GET_NON_NULL_NATIVE_ARGUMENT(Uint32x4, other, arguments->NativeArgAt(1));
477 uint32_t _x = self.x() + other.x();
478 uint32_t _y = self.y() + other.y();
479 uint32_t _z = self.z() + other.z();
480 uint32_t _w = self.w() + other.w();
481 return Uint32x4::New(_x, _y, _z, _w);
482 }
483
484
485 DEFINE_NATIVE_ENTRY(Uint32x4_sub, 2) {
486 GET_NON_NULL_NATIVE_ARGUMENT(Uint32x4, self, arguments->NativeArgAt(0));
487 GET_NON_NULL_NATIVE_ARGUMENT(Uint32x4, other, arguments->NativeArgAt(1));
488 uint32_t _x = self.x() - other.x();
489 uint32_t _y = self.y() - other.y();
490 uint32_t _z = self.z() - other.z();
491 uint32_t _w = self.w() - other.w();
492 return Uint32x4::New(_x, _y, _z, _w);
493 }
494
495
474 DEFINE_NATIVE_ENTRY(Uint32x4_getX, 1) { 496 DEFINE_NATIVE_ENTRY(Uint32x4_getX, 1) {
475 GET_NON_NULL_NATIVE_ARGUMENT(Uint32x4, self, arguments->NativeArgAt(0)); 497 GET_NON_NULL_NATIVE_ARGUMENT(Uint32x4, self, arguments->NativeArgAt(0));
476 uint32_t value = self.x(); 498 uint32_t value = self.x();
477 return Integer::New(value); 499 return Integer::New(value);
478 } 500 }
479 501
480 502
481 DEFINE_NATIVE_ENTRY(Uint32x4_getY, 1) { 503 DEFINE_NATIVE_ENTRY(Uint32x4_getY, 1) {
482 GET_NON_NULL_NATIVE_ARGUMENT(Uint32x4, self, arguments->NativeArgAt(0)); 504 GET_NON_NULL_NATIVE_ARGUMENT(Uint32x4, self, arguments->NativeArgAt(0));
483 uint32_t value = self.y(); 505 uint32_t value = self.y();
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 } 681 }
660 682
661 683
662 DEFINE_NATIVE_ENTRY(Uint32x4_toFloat32x4, 1) { 684 DEFINE_NATIVE_ENTRY(Uint32x4_toFloat32x4, 1) {
663 GET_NON_NULL_NATIVE_ARGUMENT(Uint32x4, v, arguments->NativeArgAt(0)); 685 GET_NON_NULL_NATIVE_ARGUMENT(Uint32x4, v, arguments->NativeArgAt(0));
664 return Float32x4::New(v.value()); 686 return Float32x4::New(v.value());
665 } 687 }
666 688
667 689
668 } // namespace dart 690 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/typed_data.dart » ('j') | runtime/lib/typed_data.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698