summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorCalin Juravle <calin@google.com>2014-11-26 19:01:09 +0000
committerCalin Juravle <calin@google.com>2014-11-26 19:01:09 +0000
commit91debbc3da3e3376416e4394155d9f9e355255cb (patch)
treefd2181a2d4b8e7e8d26101a9a87b4f0c34fa990f /test
parentfd861249f31ab360c12dd1ffb131d50f02b0bfc6 (diff)
downloadart-91debbc3da3e3376416e4394155d9f9e355255cb.zip
art-91debbc3da3e3376416e4394155d9f9e355255cb.tar.gz
art-91debbc3da3e3376416e4394155d9f9e355255cb.tar.bz2
Revert "[optimizing compiler] Add CMP{L,G}_{FLOAT,DOUBLE}"
Fails on arm due to missing vmrs op after vcmp. I revert this instead of pushing the fix because I don't understand yet why it compiles with run-test but not with dex2oat. This reverts commit fd861249f31ab360c12dd1ffb131d50f02b0bfc6. Change-Id: Idc2d30f6a0f39ddd3596aa18a532ae90f8aaf62f
Diffstat (limited to 'test')
-rw-r--r--test/432-optimizing-cmp/expected.txt0
-rw-r--r--test/432-optimizing-cmp/info.txt1
-rw-r--r--test/432-optimizing-cmp/smali/cmp.smali33
-rw-r--r--test/432-optimizing-cmp/src/Main.java227
-rw-r--r--test/Android.run-test.mk1
5 files changed, 0 insertions, 262 deletions
diff --git a/test/432-optimizing-cmp/expected.txt b/test/432-optimizing-cmp/expected.txt
deleted file mode 100644
index e69de29..0000000
--- a/test/432-optimizing-cmp/expected.txt
+++ /dev/null
diff --git a/test/432-optimizing-cmp/info.txt b/test/432-optimizing-cmp/info.txt
deleted file mode 100644
index fad6cee..0000000
--- a/test/432-optimizing-cmp/info.txt
+++ /dev/null
@@ -1 +0,0 @@
-Tests for compare operations.
diff --git a/test/432-optimizing-cmp/smali/cmp.smali b/test/432-optimizing-cmp/smali/cmp.smali
deleted file mode 100644
index 470d940..0000000
--- a/test/432-optimizing-cmp/smali/cmp.smali
+++ /dev/null
@@ -1,33 +0,0 @@
-.class public LTestCmp;
-
-.super Ljava/lang/Object;
-
-.method public static $opt$CmpLong(JJ)I
- .registers 5
- cmp-long v0, v1, v3
- return v0
-.end method
-
-.method public static $opt$CmpGtFloat(FF)I
- .registers 3
- cmpg-float v0, v1, v2
- return v0
-.end method
-
-.method public static $opt$CmpLtFloat(FF)I
- .registers 3
- cmpl-float v0, v1, v2
- return v0
-.end method
-
-.method public static $opt$CmpGtDouble(DD)I
- .registers 5
- cmpg-double v0, v1, v3
- return v0
-.end method
-
-.method public static $opt$CmpLtDouble(DD)I
- .registers 5
- cmpl-double v0, v1, v3
- return v0
-.end method
diff --git a/test/432-optimizing-cmp/src/Main.java b/test/432-optimizing-cmp/src/Main.java
deleted file mode 100644
index f45b94d..0000000
--- a/test/432-optimizing-cmp/src/Main.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.lang.reflect.Method;
-
-public class Main {
-
- public static void main(String[] args) throws Exception {
- cmpLong();
- cmpFloat();
- cmpDouble();
- }
-
- private static void cmpLong() throws Exception {
- expectLt(3.1F, 5.1F);
- expectGt(5.1F, 3.1F);
- expectLt(Long.MIN_VALUE, Long.MAX_VALUE);
- expectGt(Long.MAX_VALUE, Long.MIN_VALUE);
-
- expectEquals(0, smaliCmpLong(0L, 0L));
- expectEquals(0, smaliCmpLong(1L, 1L));
- expectEquals(-1, smaliCmpLong(1L, 2L));
- expectEquals(1, smaliCmpLong(2L, 1L));
- expectEquals(-1, smaliCmpLong(Long.MIN_VALUE, Long.MAX_VALUE));
- expectEquals(1, smaliCmpLong(Long.MAX_VALUE, Long.MIN_VALUE));
- expectEquals(0, smaliCmpLong(Long.MIN_VALUE, Long.MIN_VALUE));
- expectEquals(0, smaliCmpLong(Long.MAX_VALUE, Long.MAX_VALUE));
- }
-
- private static void cmpFloat() throws Exception {
- expectLt(3.1F, 5.1F);
- expectGt(5.1F, 3.1F);
- expectLt(Float.MIN_VALUE, Float.MAX_VALUE);
- expectGt(Float.MAX_VALUE, Float.MIN_VALUE);
- expectFalse(3.1F, Float.NaN);
- expectFalse(Float.NaN, 3.1F);
-
- expectEquals(0, smaliCmpGtFloat(0F, 0F));
- expectEquals(0, smaliCmpGtFloat(1F, 1F));
- expectEquals(-1, smaliCmpGtFloat(1.1F, 2.1F));
- expectEquals(1, smaliCmpGtFloat(2.1F, 1.1F));
- expectEquals(-1, smaliCmpGtFloat(Float.MIN_VALUE, Float.MAX_VALUE));
- expectEquals(1, smaliCmpGtFloat(Float.MAX_VALUE, Float.MIN_VALUE));
- expectEquals(0, smaliCmpGtFloat(Float.MIN_VALUE, Float.MIN_VALUE));
- expectEquals(0, smaliCmpGtFloat(Float.MAX_VALUE, Float.MAX_VALUE));
- expectEquals(1, smaliCmpGtFloat(5F, Float.NaN));
- expectEquals(1, smaliCmpGtFloat(Float.NaN, 5F));
-
- expectEquals(0, smaliCmpLtFloat(0F, 0F));
- expectEquals(0, smaliCmpLtFloat(1F, 1F));
- expectEquals(-1, smaliCmpLtFloat(1.1F, 2.1F));
- expectEquals(1, smaliCmpLtFloat(2.1F, 1.1F));
- expectEquals(-1, smaliCmpLtFloat(Float.MIN_VALUE, Float.MAX_VALUE));
- expectEquals(1, smaliCmpLtFloat(Float.MAX_VALUE, Float.MIN_VALUE));
- expectEquals(0, smaliCmpLtFloat(Float.MIN_VALUE, Float.MIN_VALUE));
- expectEquals(0, smaliCmpLtFloat(Float.MAX_VALUE, Float.MAX_VALUE));
- expectEquals(-1, smaliCmpLtFloat(5F, Float.NaN));
- expectEquals(-1, smaliCmpLtFloat(Float.NaN, 5F));
- }
-
- private static void cmpDouble() throws Exception {
- expectLt(3.1D, 5.1D);
- expectGt(5.1D, 3.1D);
- expectLt(Double.MIN_VALUE, Double.MAX_VALUE);
- expectGt(Double.MAX_VALUE, Double.MIN_VALUE);
- expectFalse(3.1D, Double.NaN);
- expectFalse(Double.NaN, 3.1D);
-
- expectEquals(0, smaliCmpGtDouble(0D, 0D));
- expectEquals(0, smaliCmpGtDouble(1D, 1D));
- expectEquals(-1, smaliCmpGtDouble(1.1D, 2.1D));
- expectEquals(1, smaliCmpGtDouble(2.1D, 1.1D));
- expectEquals(-1, smaliCmpGtDouble(Double.MIN_VALUE, Double.MAX_VALUE));
- expectEquals(1, smaliCmpGtDouble(Double.MAX_VALUE, Double.MIN_VALUE));
- expectEquals(0, smaliCmpGtDouble(Double.MIN_VALUE, Double.MIN_VALUE));
- expectEquals(0, smaliCmpGtDouble(Double.MAX_VALUE, Double.MAX_VALUE));
- expectEquals(1, smaliCmpGtDouble(5D, Double.NaN));
- expectEquals(1, smaliCmpGtDouble(Double.NaN, 5D));
-
- expectEquals(0, smaliCmpLtDouble(0D, 0D));
- expectEquals(0, smaliCmpLtDouble(1D, 1D));
- expectEquals(-1, smaliCmpLtDouble(1.1D, 2.1D));
- expectEquals(1, smaliCmpLtDouble(2.1D, 1.1D));
- expectEquals(-1, smaliCmpLtDouble(Double.MIN_VALUE, Double.MAX_VALUE));
- expectEquals(1, smaliCmpLtDouble(Double.MAX_VALUE, Double.MIN_VALUE));
- expectEquals(0, smaliCmpLtDouble(Double.MIN_VALUE, Double.MIN_VALUE));
- expectEquals(0, smaliCmpLtDouble(Double.MAX_VALUE, Double.MAX_VALUE));
- expectEquals(-1, smaliCmpLtDouble(5D, Double.NaN));
- expectEquals(-1, smaliCmpLtDouble(Float.NaN, 5D));
- }
-
- static boolean $opt$lt(long a, long b) {
- return a < b;
- }
-
- static boolean $opt$lt(float a, float b) {
- return a < b;
- }
-
- static boolean $opt$lt(double a, double b) {
- return a < b;
- }
-
- static boolean $opt$gt(long a, long b) {
- return a > b;
- }
-
- static boolean $opt$gt(float a, float b) {
- return a > b;
- }
-
- static boolean $opt$gt(double a, double b) {
- return a > b;
- }
-
- // Wrappers around methods located in file cmp.smali.
-
- private static int smaliCmpLong(long a, long b) throws Exception {
- Class<?> c = Class.forName("TestCmp");
- Method m = c.getMethod("$opt$CmpLong", long.class, long.class);
- int result = (Integer)m.invoke(null, a, b);
- return result;
- }
-
- private static int smaliCmpGtFloat(float a, float b) throws Exception {
- Class<?> c = Class.forName("TestCmp");
- Method m = c.getMethod("$opt$CmpGtFloat", float.class, float.class);
- int result = (Integer)m.invoke(null, a, b);
- return result;
- }
-
- private static int smaliCmpLtFloat(float a, float b) throws Exception {
- Class<?> c = Class.forName("TestCmp");
- Method m = c.getMethod("$opt$CmpLtFloat", float.class, float.class);
- int result = (Integer)m.invoke(null, a, b);
- return result;
- }
-
- private static int smaliCmpGtDouble(double a, double b) throws Exception {
- Class<?> c = Class.forName("TestCmp");
- Method m = c.getMethod("$opt$CmpGtDouble", double.class, double.class);
- int result = (Integer)m.invoke(null, a, b);
- return result;
- }
-
- private static int smaliCmpLtDouble(double a, double b) throws Exception {
- Class<?> c = Class.forName("TestCmp");
- Method m = c.getMethod("$opt$CmpLtDouble", double.class, double.class);
- int result = (Integer)m.invoke(null, a, b);
- return result;
- }
-
- public static void expectEquals(int expected, int result) {
- if (expected != result) {
- throw new Error("Expected: " + expected + ", found: " + result);
- }
- }
-
- public static void expectLt(long a, long b) {
- if (!$opt$lt(a, b)) {
- throw new Error("Expected: " + a + " < " + b);
- }
- }
-
- public static void expectGt(long a, long b) {
- if (!$opt$gt(a, b)) {
- throw new Error("Expected: " + a + " > " + b);
- }
- }
-
- public static void expectLt(float a, float b) {
- if (!$opt$lt(a, b)) {
- throw new Error("Expected: " + a + " < " + b);
- }
- }
-
- public static void expectGt(float a, float b) {
- if (!$opt$gt(a, b)) {
- throw new Error("Expected: " + a + " > " + b);
- }
- }
-
- public static void expectFalse(float a, float b) {
- if ($opt$lt(a, b)) {
- throw new Error("Not expecting: " + a + " < " + b);
- }
- if ($opt$gt(a, b)) {
- throw new Error("Not expecting: " + a + " > " + b);
- }
- }
-
- public static void expectLt(double a, double b) {
- if (!$opt$lt(a, b)) {
- throw new Error("Expected: " + a + " < " + b);
- }
- }
-
- public static void expectGt(double a, double b) {
- if (!$opt$gt(a, b)) {
- throw new Error("Expected: " + a + " > " + b);
- }
- }
-
- public static void expectFalse(double a, double b) {
- if ($opt$lt(a, b)) {
- throw new Error("Not expecting: " + a + " < " + b);
- }
- if ($opt$gt(a, b)) {
- throw new Error("Not expecting: " + a + " > " + b);
- }
- }
-
-}
-
diff --git a/test/Android.run-test.mk b/test/Android.run-test.mk
index d9699bd..47d186a 100644
--- a/test/Android.run-test.mk
+++ b/test/Android.run-test.mk
@@ -331,7 +331,6 @@ TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS := \
428-optimizing-arith-rem \
430-live-register-slow-path \
431-optimizing-arith-shifts \
- 432-optimizing-cmp \
701-easy-div-rem \
800-smali \