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

Unified Diff: sdk/lib/typeddata/typeddata_simd128.dart

Issue 12534006: Port SIMD types from dart:scalarlist to dart:typeddata. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/typeddata/typeddata_simd128.dart
diff --git a/sdk/lib/scalarlist/simd128.dart b/sdk/lib/typeddata/typeddata_simd128.dart
similarity index 74%
copy from sdk/lib/scalarlist/simd128.dart
copy to sdk/lib/typeddata/typeddata_simd128.dart
index 96349fd9dea001c3a05dc98a4d9aeb8ad0842ed3..96b209fba91d30f803a226b35536cf1096ebff2e 100644
--- a/sdk/lib/scalarlist/simd128.dart
+++ b/sdk/lib/typeddata/typeddata_simd128.dart
@@ -2,10 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-part of dart.scalarlist;
+part of dart.typeddata;
+
/**
- * Interface of Dart Float32x4 and operations.
+ * Interface of Dart Float32x4 immutable value type and operations.
* Float32x4 stores 4 32-bit floating point values in "lanes".
* The lanes are "x", "y", "z", and "w" respectively.
*/
@@ -39,7 +40,7 @@ abstract class Float32x4 {
/// Returns a copy of [this] each lane being scaled by [s].
Float32x4 scale(double s);
- /// Returns the absolute value of this [Simd128Float32].
+ /// Returns the absolute value of this [Float32x4].
Float32x4 abs();
/// Clamps [this] to be in the range [lowerLimit]-[upperLimit].
Float32x4 clamp(Float32x4 lowerLimit,
@@ -152,37 +153,3 @@ abstract class Uint32x4 {
/// Returns a bit-wise copy of [this] as a [Float32x4].
Float32x4 toFloat32x4();
}
-
-/**
- * A fixed-length list of Float32x4 numbers that is viewable as a
- * [ByteArray]. For long lists, this implementation will be considerably more
- * space- and time-efficient than the default [List] implementation.
- */
-abstract class Float32x4List implements List<Float32x4>,
- ByteArrayViewable {
- /**
- * Creates a [Simd128Float32List] of the specified length (in elements),
- * all of whose elements are initially zero.
- */
- external factory Float32x4List(int length);
-
- /**
- * Creates a [Float32x4List] _view_ of the specified region in the
- * specified byte [array]. Changes in the [Float32x4List] will be
- * visible in the byte array and vice versa. If the [start] index of the
- * region is not specified, it defaults to zero (the first byte in the byte
- * array). If the length is not specified, it defaults to null, which
- * indicates that the view extends to the end of the byte array.
- *
- * Throws [ArgumentError] if the length of the specified region is not
- * divisible by 16 (the size of a "Float32x4" in bytes), or if the
- * [start] of the region is not divisible by 16. If, however, [array] is a
- * view of another byte array, this constructor will throw [ArgumentError]
- * if the implicit starting position in the "ultimately backing" byte array
- * is not divisible by 16. In plain terms, this constructor throws
- * [ArgumentError] if the specified region does not contain an integral
- * number of "Float32x4s," or if it is not "Float32x4-aligned."
- */
- external factory Float32x4List.view(ByteArray array,
- [int start = 0, int length]);
-}

Powered by Google App Engine
This is Rietveld 408576698