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

Side by Side Diff: runtime/lib/byte_array.cc

Issue 12871015: SIMD plumbing (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: s/materialize/Materialize Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/platform/globals.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/bootstrap_natives.h" 5 #include "vm/bootstrap_natives.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 8
9 #include "vm/bigint_operations.h" 9 #include "vm/bigint_operations.h"
10 #include "vm/exceptions.h" 10 #include "vm/exceptions.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 UNALIGNED_GETTER_UINT64(ByteArray); 245 UNALIGNED_GETTER_UINT64(ByteArray);
246 } 246 }
247 247
248 248
249 DEFINE_NATIVE_ENTRY(ByteArray_setUint64, 3) { 249 DEFINE_NATIVE_ENTRY(ByteArray_setUint64, 3) {
250 UNALIGNED_SETTER_UINT64(ByteArray); 250 UNALIGNED_SETTER_UINT64(ByteArray);
251 } 251 }
252 252
253 253
254 DEFINE_NATIVE_ENTRY(ByteArray_getFloat32x4, 2) { 254 DEFINE_NATIVE_ENTRY(ByteArray_getFloat32x4, 2) {
255 UNALIGNED_GETTER(ByteArray, Float32x4, simd_value_t); 255 UNALIGNED_GETTER(ByteArray, Float32x4, simd128_value_t);
256 } 256 }
257 257
258 258
259 DEFINE_NATIVE_ENTRY(ByteArray_setFloat32x4, 3) { 259 DEFINE_NATIVE_ENTRY(ByteArray_setFloat32x4, 3) {
260 UNALIGNED_SETTER(ByteArray, Float32x4, value, simd_value_t); 260 UNALIGNED_SETTER(ByteArray, Float32x4, value, simd128_value_t);
261 } 261 }
262 262
263 263
264 DEFINE_NATIVE_ENTRY(ByteArray_getFloat32, 2) { 264 DEFINE_NATIVE_ENTRY(ByteArray_getFloat32, 2) {
265 UNALIGNED_GETTER(ByteArray, Double, float); 265 UNALIGNED_GETTER(ByteArray, Double, float);
266 } 266 }
267 267
268 268
269 DEFINE_NATIVE_ENTRY(ByteArray_setFloat32, 3) { 269 DEFINE_NATIVE_ENTRY(ByteArray_setFloat32, 3) {
270 UNALIGNED_SETTER(ByteArray, Double, value, float); 270 UNALIGNED_SETTER(ByteArray, Double, value, float);
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 LengthCheck(len, Float32x4Array::kMaxElements); 614 LengthCheck(len, Float32x4Array::kMaxElements);
615 return Float32x4Array::New(len); 615 return Float32x4Array::New(len);
616 } 616 }
617 617
618 618
619 DEFINE_NATIVE_ENTRY(Float32x4List_newTransferable, 1) { 619 DEFINE_NATIVE_ENTRY(Float32x4List_newTransferable, 1) {
620 const int kAlignment = 16; 620 const int kAlignment = 16;
621 GET_NON_NULL_NATIVE_ARGUMENT(Smi, length, arguments->NativeArgAt(0)); 621 GET_NON_NULL_NATIVE_ARGUMENT(Smi, length, arguments->NativeArgAt(0));
622 intptr_t len = length.Value(); 622 intptr_t len = length.Value();
623 LengthCheck(len, Float32x4Array::kMaxElements); 623 LengthCheck(len, Float32x4Array::kMaxElements);
624 simd_value_t* bytes = OS::AllocateAlignedArray<simd_value_t>(len, kAlignment); 624 simd128_value_t* bytes =
625 OS::AllocateAlignedArray<simd128_value_t>(len, kAlignment);
625 const ExternalFloat32x4Array& obj = 626 const ExternalFloat32x4Array& obj =
626 ExternalFloat32x4Array::Handle(ExternalFloat32x4Array::New(bytes, len)); 627 ExternalFloat32x4Array::Handle(ExternalFloat32x4Array::New(bytes, len));
627 obj.AddFinalizer(bytes, PeerFinalizer); 628 obj.AddFinalizer(bytes, PeerFinalizer);
628 return obj.raw(); 629 return obj.raw();
629 } 630 }
630 631
631 632
632 DEFINE_NATIVE_ENTRY(Float32x4Array_getIndexed, 2) { 633 DEFINE_NATIVE_ENTRY(Float32x4Array_getIndexed, 2) {
633 GETTER(Float32x4Array, Float32x4, simd_value_t); 634 GETTER(Float32x4Array, Float32x4, simd128_value_t);
634 } 635 }
635 636
636 637
637 DEFINE_NATIVE_ENTRY(Float32x4Array_setIndexed, 3) { 638 DEFINE_NATIVE_ENTRY(Float32x4Array_setIndexed, 3) {
638 SETTER(Float32x4Array, Float32x4, value, simd_value_t); 639 SETTER(Float32x4Array, Float32x4, value, simd128_value_t);
639 } 640 }
640 641
641 642
642 // Float32Array 643 // Float32Array
643 644
644 DEFINE_NATIVE_ENTRY(Float32Array_new, 1) { 645 DEFINE_NATIVE_ENTRY(Float32Array_new, 1) {
645 GET_NON_NULL_NATIVE_ARGUMENT(Smi, length, arguments->NativeArgAt(0)); 646 GET_NON_NULL_NATIVE_ARGUMENT(Smi, length, arguments->NativeArgAt(0));
646 intptr_t len = length.Value(); 647 intptr_t len = length.Value();
647 LengthCheck(len, Float32Array::kMaxElements); 648 LengthCheck(len, Float32Array::kMaxElements);
648 return Float32Array::New(len); 649 return Float32Array::New(len);
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 810
810 811
811 DEFINE_NATIVE_ENTRY(ExternalUint64Array_setIndexed, 3) { 812 DEFINE_NATIVE_ENTRY(ExternalUint64Array_setIndexed, 3) {
812 SETTER_UINT64(ExternalUint64Array); 813 SETTER_UINT64(ExternalUint64Array);
813 } 814 }
814 815
815 816
816 // ExternalFloat32x4Array 817 // ExternalFloat32x4Array
817 818
818 DEFINE_NATIVE_ENTRY(ExternalFloat32x4Array_getIndexed, 2) { 819 DEFINE_NATIVE_ENTRY(ExternalFloat32x4Array_getIndexed, 2) {
819 GETTER(ExternalFloat32x4Array, Float32x4, simd_value_t); 820 GETTER(ExternalFloat32x4Array, Float32x4, simd128_value_t);
820 } 821 }
821 822
822 823
823 DEFINE_NATIVE_ENTRY(ExternalFloat32x4Array_setIndexed, 3) { 824 DEFINE_NATIVE_ENTRY(ExternalFloat32x4Array_setIndexed, 3) {
824 SETTER(ExternalFloat32x4Array, Float32x4, value, simd_value_t); 825 SETTER(ExternalFloat32x4Array, Float32x4, value, simd128_value_t);
825 } 826 }
826 827
827 828
828 // ExternalFloat32Array 829 // ExternalFloat32Array
829 830
830 DEFINE_NATIVE_ENTRY(ExternalFloat32Array_getIndexed, 2) { 831 DEFINE_NATIVE_ENTRY(ExternalFloat32Array_getIndexed, 2) {
831 GETTER(ExternalFloat32Array, Double, float); 832 GETTER(ExternalFloat32Array, Double, float);
832 } 833 }
833 834
834 835
835 DEFINE_NATIVE_ENTRY(ExternalFloat32Array_setIndexed, 3) { 836 DEFINE_NATIVE_ENTRY(ExternalFloat32Array_setIndexed, 3) {
836 SETTER(ExternalFloat32Array, Double, value, float); 837 SETTER(ExternalFloat32Array, Double, value, float);
837 } 838 }
838 839
839 840
840 // ExternalFloat64Array 841 // ExternalFloat64Array
841 842
842 DEFINE_NATIVE_ENTRY(ExternalFloat64Array_getIndexed, 2) { 843 DEFINE_NATIVE_ENTRY(ExternalFloat64Array_getIndexed, 2) {
843 GETTER(ExternalFloat64Array, Double, double); 844 GETTER(ExternalFloat64Array, Double, double);
844 } 845 }
845 846
846 847
847 DEFINE_NATIVE_ENTRY(ExternalFloat64Array_setIndexed, 3) { 848 DEFINE_NATIVE_ENTRY(ExternalFloat64Array_setIndexed, 3) {
848 SETTER(ExternalFloat64Array, Double, value, double); 849 SETTER(ExternalFloat64Array, Double, value, double);
849 } 850 }
850 851
851 } // namespace dart 852 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/platform/globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698