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

Unified Diff: runtime/lib/byte_array.cc

Issue 12303013: Simd128Float32, Simd128Mask, and Simd128Float32List additions for dart:scalarlist (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix strict aliasing warning Created 7 years, 10 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/byte_array.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/byte_array.cc
diff --git a/runtime/lib/byte_array.cc b/runtime/lib/byte_array.cc
index a96d2117c62eacd527c59b32886fe65f3db212cd..08e0bc86138a5dbd4667f5f6154ea34b03b25d9d 100644
--- a/runtime/lib/byte_array.cc
+++ b/runtime/lib/byte_array.cc
@@ -251,6 +251,16 @@ DEFINE_NATIVE_ENTRY(ByteArray_setUint64, 3) {
}
+DEFINE_NATIVE_ENTRY(ByteArray_getFloat32x4, 2) {
+ UNALIGNED_GETTER(ByteArray, Float32x4, simd_value_t);
+}
+
+
+DEFINE_NATIVE_ENTRY(ByteArray_setFloat32x4, 3) {
+ UNALIGNED_SETTER(ByteArray, Float32x4, value, simd_value_t);
+}
+
+
DEFINE_NATIVE_ENTRY(ByteArray_getFloat32, 2) {
UNALIGNED_GETTER(ByteArray, Double, float);
}
@@ -596,6 +606,38 @@ DEFINE_NATIVE_ENTRY(Uint64Array_setIndexed, 3) {
SETTER_UINT64(Uint64Array);
}
+// Float32x4Array
+
+DEFINE_NATIVE_ENTRY(Float32x4Array_new, 1) {
+ GET_NON_NULL_NATIVE_ARGUMENT(Smi, length, arguments->NativeArgAt(0));
+ intptr_t len = length.Value();
+ LengthCheck(len, Float32x4Array::kMaxElements);
+ return Float32x4Array::New(len);
+}
+
+
+DEFINE_NATIVE_ENTRY(Float32x4List_newTransferable, 1) {
+ const int kAlignment = 16;
+ GET_NON_NULL_NATIVE_ARGUMENT(Smi, length, arguments->NativeArgAt(0));
+ intptr_t len = length.Value();
+ LengthCheck(len, Float32x4Array::kMaxElements);
+ simd_value_t* bytes = OS::AllocateAlignedArray<simd_value_t>(len, kAlignment);
+ const ExternalFloat32x4Array& obj =
+ ExternalFloat32x4Array::Handle(ExternalFloat32x4Array::New(bytes, len));
+ obj.AddFinalizer(bytes, PeerFinalizer);
+ return obj.raw();
+}
+
+
+DEFINE_NATIVE_ENTRY(Float32x4Array_getIndexed, 2) {
+ GETTER(Float32x4Array, Float32x4, simd_value_t);
+}
+
+
+DEFINE_NATIVE_ENTRY(Float32x4Array_setIndexed, 3) {
+ SETTER(Float32x4Array, Float32x4, value, simd_value_t);
+}
+
// Float32Array
@@ -771,6 +813,18 @@ DEFINE_NATIVE_ENTRY(ExternalUint64Array_setIndexed, 3) {
}
+// ExternalFloat32x4Array
+
+DEFINE_NATIVE_ENTRY(ExternalFloat32x4Array_getIndexed, 2) {
+ GETTER(ExternalFloat32x4Array, Float32x4, simd_value_t);
+}
+
+
+DEFINE_NATIVE_ENTRY(ExternalFloat32x4Array_setIndexed, 3) {
+ SETTER(ExternalFloat32x4Array, Float32x4, value, simd_value_t);
+}
+
+
// ExternalFloat32Array
DEFINE_NATIVE_ENTRY(ExternalFloat32Array_getIndexed, 2) {
« no previous file with comments | « no previous file | runtime/lib/byte_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698