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

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

Issue 13936009: Inline Float32x4 constructors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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/lib/typed_data.dart » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "vm/exceptions.h" 7 #include "vm/exceptions.h"
8 #include "vm/native_entry.h" 8 #include "vm/native_entry.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/symbols.h" 10 #include "vm/symbols.h"
11 11
12 namespace dart { 12 namespace dart {
13 13
14 DEFINE_NATIVE_ENTRY(Float32x4_fromDoubles, 5) { 14 DEFINE_NATIVE_ENTRY(Float32x4_fromDoubles, 5) {
15 ASSERT(AbstractTypeArguments::CheckedHandle( 15 ASSERT(AbstractTypeArguments::CheckedHandle(
16 arguments->NativeArgAt(0)).IsNull()); 16 arguments->NativeArgAt(0)).IsNull());
17 GET_NON_NULL_NATIVE_ARGUMENT(Double, x, arguments->NativeArgAt(1)); 17 GET_NON_NULL_NATIVE_ARGUMENT(Double, x, arguments->NativeArgAt(1));
18 GET_NON_NULL_NATIVE_ARGUMENT(Double, y, arguments->NativeArgAt(2)); 18 GET_NON_NULL_NATIVE_ARGUMENT(Double, y, arguments->NativeArgAt(2));
19 GET_NON_NULL_NATIVE_ARGUMENT(Double, z, arguments->NativeArgAt(3)); 19 GET_NON_NULL_NATIVE_ARGUMENT(Double, z, arguments->NativeArgAt(3));
20 GET_NON_NULL_NATIVE_ARGUMENT(Double, w, arguments->NativeArgAt(4)); 20 GET_NON_NULL_NATIVE_ARGUMENT(Double, w, arguments->NativeArgAt(4));
21 float _x = x.value(); 21 float _x = x.value();
22 float _y = y.value(); 22 float _y = y.value();
23 float _z = z.value(); 23 float _z = z.value();
24 float _w = w.value(); 24 float _w = w.value();
25 return Float32x4::New(_x, _y, _z, _w); 25 return Float32x4::New(_x, _y, _z, _w);
26 } 26 }
27 27
28 28
29 DEFINE_NATIVE_ENTRY(Float32x4_splat, 2) {
30 ASSERT(AbstractTypeArguments::CheckedHandle(
31 arguments->NativeArgAt(0)).IsNull());
32 GET_NON_NULL_NATIVE_ARGUMENT(Double, v, arguments->NativeArgAt(1));
33 float _v = v.value();
34 return Float32x4::New(_v, _v, _v, _v);
35 }
36
37
29 DEFINE_NATIVE_ENTRY(Float32x4_zero, 1) { 38 DEFINE_NATIVE_ENTRY(Float32x4_zero, 1) {
30 ASSERT(AbstractTypeArguments::CheckedHandle( 39 ASSERT(AbstractTypeArguments::CheckedHandle(
31 arguments->NativeArgAt(0)).IsNull()); 40 arguments->NativeArgAt(0)).IsNull());
32 return Float32x4::New(0.0f, 0.0f, 0.0f, 0.0f); 41 return Float32x4::New(0.0f, 0.0f, 0.0f, 0.0f);
33 } 42 }
34 43
35 44
36 DEFINE_NATIVE_ENTRY(Float32x4_add, 2) { 45 DEFINE_NATIVE_ENTRY(Float32x4_add, 2) {
37 GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, self, arguments->NativeArgAt(0)); 46 GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, self, arguments->NativeArgAt(0));
38 GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, other, arguments->NativeArgAt(1)); 47 GET_NON_NULL_NATIVE_ARGUMENT(Float32x4, other, arguments->NativeArgAt(1));
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 } 612 }
604 613
605 614
606 DEFINE_NATIVE_ENTRY(Uint32x4_toFloat32x4, 1) { 615 DEFINE_NATIVE_ENTRY(Uint32x4_toFloat32x4, 1) {
607 GET_NON_NULL_NATIVE_ARGUMENT(Uint32x4, v, arguments->NativeArgAt(0)); 616 GET_NON_NULL_NATIVE_ARGUMENT(Uint32x4, v, arguments->NativeArgAt(0));
608 return Float32x4::New(v.value()); 617 return Float32x4::New(v.value());
609 } 618 }
610 619
611 620
612 } // namespace dart 621 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/typed_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698