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

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

Issue 22947006: Add signMask getter 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 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 0c761ff5fada6cf08d77cb9545de22cb4d3bf27c..2b5280de35f0958e85dddf5545779c361ee6c5bf 100644
--- a/sdk/lib/typed_data/dart2js/typed_data_dart2js.dart
+++ b/sdk/lib/typed_data/dart2js/typed_data_dart2js.dart
@@ -931,6 +931,15 @@ class Float32x4 {
/// Extracted w value.
double get w => _storage[3];
+ /// Extract the sign bits from each lane return them in the first 4 bits.
+ int get signMask {
+ int mx = (_storage[0] & 0x80000000) >> 31;
+ int my = (_storage[1] & 0x80000000) >> 31;
+ int mz = (_storage[2] & 0x80000000) >> 31;
+ int mw = (_storage[3] & 0x80000000) >> 31;
+ return mx | my << 1 | mz << 2 | mw << 3;
+ }
+
Float32x4 get xxxx => _shuffle(0x0);
Float32x4 get xxxy => _shuffle(0x40);
Float32x4 get xxxz => _shuffle(0x80);

Powered by Google App Engine
This is Rietveld 408576698