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

Unified Diff: tests/lib/typed_data/float32x4_unbox_phi_test.dart

Issue 15145002: Unbox phis with Float32x4 or Uint32x4 type (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/typed_data/float32x4_unbox_phi_test.dart
diff --git a/tests/lib/typed_data/float32x4_unbox_phi_test.dart b/tests/lib/typed_data/float32x4_unbox_phi_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..008d9c9b1e8d02edf40bcb6b9ac38bf46f30f2aa
--- /dev/null
+++ b/tests/lib/typed_data/float32x4_unbox_phi_test.dart
@@ -0,0 +1,30 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// 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.
+// VMOptions=--deoptimization_counter_threshold=1000
+
+// Library tag to be able to run in html test framework.
+library float32x4_unbox_regress_test;
+
+import 'package:expect/expect.dart';
+import 'dart:typed_data';
+
+double testUnboxPhi(Float32x4List data) {
+ var res = new Float32x4.zero();
+ for (int i = 0; i < data.length; i++) {
+ res += data[i];
+ }
+ return res.x + res.y + res.z + res.w;
+}
+
+main() {
+ Float32x4List list = new Float32x4List(10);
+ Float32List floatList = new Float32List.view(list);
+ for (int i = 0; i < floatList.length; i++) {
+ floatList[i] = i.toDouble();
+ }
+ for (int i = 0; i < 2000; i++) {
+ double r = testUnboxPhi(list);
+ Expect.equals(780.0, r);
+ }
+}
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698