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

Unified Diff: runtime/lib/simd128.cc

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
« no previous file with comments | « no previous file | runtime/lib/typed_data.dart » ('j') | runtime/vm/intermediate_language.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/simd128.cc
diff --git a/runtime/lib/simd128.cc b/runtime/lib/simd128.cc
index 9b7941269876e1c20485377cdce769d4e84da09e..86c226a2b035831a155643bf24a1289fc0cc67cb 100644
--- a/runtime/lib/simd128.cc
+++ b/runtime/lib/simd128.cc
@@ -229,6 +229,28 @@ DEFINE_NATIVE_ENTRY(Float32x4_getW, 1) {
}
+DEFINE_NATIVE_ENTRY(Float32x4_getSignMask, 1) {
+ GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, self, arguments->NativeArgAt(0));
+ uint32_t mx = (bit_cast<uint32_t>(self.x()) & 0x80000000) >> 31;
+ uint32_t my = (bit_cast<uint32_t>(self.y()) & 0x80000000) >> 31;
+ uint32_t mz = (bit_cast<uint32_t>(self.z()) & 0x80000000) >> 31;
+ uint32_t mw = (bit_cast<uint32_t>(self.w()) & 0x80000000) >> 31;
+ uint32_t value = mx | (my << 1) | (mz << 2) | (mw << 3);
+ return Integer::New(value);
+}
+
+
+DEFINE_NATIVE_ENTRY(Uint32x4_getSignMask, 1) {
+ GET_NON_NULL_NATIVE_ARGUMENT(Uint32x4, self, arguments->NativeArgAt(0));
+ uint32_t mx = (self.x() & 0x80000000) >> 31;
+ uint32_t my = (self.y() & 0x80000000) >> 31;
+ uint32_t mz = (self.z() & 0x80000000) >> 31;
+ uint32_t mw = (self.w() & 0x80000000) >> 31;
+ uint32_t value = mx | (my << 1) | (mz << 2) | (mw << 3);
+ return Integer::New(value);
+}
+
+
DEFINE_NATIVE_ENTRY(Float32x4_shuffle, 2) {
GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, self, arguments->NativeArgAt(0));
GET_NON_NULL_NATIVE_ARGUMENT(Integer, mask, arguments->NativeArgAt(1));
« no previous file with comments | « no previous file | runtime/lib/typed_data.dart » ('j') | runtime/vm/intermediate_language.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698