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

Unified Diff: tests/language/vm/allocation_sinking_vm_test.dart

Issue 25509007: Support unboxed SIMD types in AllocationSinking (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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/language/vm/allocation_sinking_vm_test.dart
diff --git a/tests/language/vm/allocation_sinking_vm_test.dart b/tests/language/vm/allocation_sinking_vm_test.dart
index 24d58950bb9cb832c42ec77b7a200653dae0bf38..619235a6186d882f8e79db5e5da0434499808c7f 100644
--- a/tests/language/vm/allocation_sinking_vm_test.dart
+++ b/tests/language/vm/allocation_sinking_vm_test.dart
@@ -4,6 +4,7 @@
// Test allocation sinking optimization.
// VMOptions=--optimization-counter-threshold=10 --no-use-osr
+import 'dart:typed_data';
import 'package:expect/expect.dart';
class Point {
@@ -21,6 +22,22 @@ class C {
C(this.p);
}
+
+class Pointx4 {
+ var x, y;
+
+ Pointx4(this.x, this.y);
+
+ operator * (other) {
+ return x * other.x + y * other.y;
+ }
+}
+
+class Cx4 {
+ var p;
+ Cx4(this.p);
+}
+
class D {
var p;
D(this.p);
@@ -55,6 +72,13 @@ test1(c, x, y) {
return d * d;
}
+test1x4(c, x, y, z, w) {
+ var a = new Pointx4(x - z, y + w);
+ var b = new Pointx4(x + w, y + z);
+ var d = new Pointx4(c.p * a, c.p * b);
+ return d * d;
+}
+
effects() {
// This function should not be inlinable.
try { } catch (e) { }
@@ -144,12 +168,22 @@ main() {
// Compute initial values.
final x0 = test1(c, 11.11, 22.22);
+ var fc = new Cx4(new Pointx4(new Float32x4(1.0, 1.0, 1.0, 1.0),
+ new Float32x4(1.0, 1.0, 1.0, 1.0)));
+ final fx0 = test1x4(fc, new Float32x4(1.0, 1.0, 1.0, 1.0),
+ new Float32x4(1.0, 1.0, 1.0, 1.0),
+ new Float32x4(1.0, 1.0, 1.0, 1.0),
+ new Float32x4(1.0, 1.0, 1.0, 1.0));
final y0 = testForwardingThroughEffects(c, 11.11, 22.22);
final z0 = testIdentity(c.p);
// Force optimization.
for (var i = 0; i < 100; i++) {
test1(c, i.toDouble(), i.toDouble());
+ test1x4(fc, new Float32x4(1.0, 1.0, 1.0, 1.0),
+ new Float32x4(1.0, 1.0, 1.0, 1.0),
+ new Float32x4(1.0, 1.0, 1.0, 1.0),
+ new Float32x4(1.0, 1.0, 1.0, 1.0));
testForwardingThroughEffects(c, i.toDouble(), i.toDouble());
testIdentity(c.p);
foo2();
« 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