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

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/flow_graph_optimizer.cc » ('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 0ff6da47c1f7d238c9c580e07e17804d29b9f1ac..9a9791ab7cdbdbb384e27db15381f55438f9437b 100644
--- a/runtime/lib/simd128.cc
+++ b/runtime/lib/simd128.cc
@@ -229,6 +229,17 @@ 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(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/flow_graph_optimizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698