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

Unified Diff: sdk/lib/typed_data/dart2js/typed_data_dart2js.dart

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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/typed_data/dart2js/typed_data_dart2js.dart
diff --git a/sdk/lib/typed_data/dart2js/typed_data_dart2js.dart b/sdk/lib/typed_data/dart2js/typed_data_dart2js.dart
index a145ff2eac91a63c9a75cfcc68be798464d1f65b..a85651e63975244203030b8ceeb3297d37af7724 100644
--- a/sdk/lib/typed_data/dart2js/typed_data_dart2js.dart
+++ b/sdk/lib/typed_data/dart2js/typed_data_dart2js.dart
@@ -1396,6 +1396,24 @@ class Uint32x4 {
return new Uint32x4(_x, _y, _z, _w);
}
+ Uint32x4 operator+(Uint32x4 other) {
+ var r = new Uint32x4(0, 0, 0, 0);
+ r._storage[0] = (_storage[0] + other._storage[0])|0;
srdjan 2013/08/19 21:45:23 Why '| 0'? In JS this creates an uint32 but should
Cutch 2013/08/19 21:58:25 Done.
+ r._storage[1] = (_storage[1] + other._storage[1])|0;
+ r._storage[2] = (_storage[2] + other._storage[2])|0;
+ r._storage[3] = (_storage[3] + other._storage[3])|0;
+ return r;
+ }
+
+ Uint32x4 operator-(Uint32x4 other) {
+ var r = new Uint32x4(0, 0, 0, 0);
+ r._storage[0] = (_storage[0] - other._storage[0])|0;
+ r._storage[1] = (_storage[1] - other._storage[1])|0;
+ r._storage[2] = (_storage[2] - other._storage[2])|0;
+ r._storage[3] = (_storage[3] - other._storage[3])|0;
+ return r;
+ }
+
/// Extract 32-bit mask from x lane.
int get x => _storage[0];
/// Extract 32-bit mask from y lane.

Powered by Google App Engine
This is Rietveld 408576698