summaryrefslogtreecommitdiffstats
path: root/test/302-float-conversion
diff options
context:
space:
mode:
authorSerguei Katkov <serguei.i.katkov@intel.com>2014-03-12 15:56:54 +0700
committerSerguei Katkov <serguei.i.katkov@intel.com>2014-03-14 10:26:11 +0700
commite90501da0222717d75c126ebf89569db3976927e (patch)
treedff0aabde02d0790bab3a42738e08a9b27eafb58 /test/302-float-conversion
parent4ee5bd67c7dd1ba42f8187e038cee3f96cc77839 (diff)
downloadart-e90501da0222717d75c126ebf89569db3976927e.tar.gz
art-e90501da0222717d75c126ebf89569db3976927e.tar.bz2
art-e90501da0222717d75c126ebf89569db3976927e.zip
Add dependency for operations with x86 FPU stack
Load Hoisting optimization can re-order operations with FPU stack due to no dependency set. Patch adds resource dependency between these operations. Change-Id: Iccce98c8f3c565903667c03803884d9de1281ea8 Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com>
Diffstat (limited to 'test/302-float-conversion')
-rw-r--r--test/302-float-conversion/expected.txt3
-rw-r--r--test/302-float-conversion/info.txt1
-rw-r--r--test/302-float-conversion/src/Main.java17
3 files changed, 19 insertions, 2 deletions
diff --git a/test/302-float-conversion/expected.txt b/test/302-float-conversion/expected.txt
index 6939a5cccb..7d5c1eba62 100644
--- a/test/302-float-conversion/expected.txt
+++ b/test/302-float-conversion/expected.txt
@@ -1 +1,2 @@
-Result is as expected
+Iteration Result is as expected
+inter4:2.0
diff --git a/test/302-float-conversion/info.txt b/test/302-float-conversion/info.txt
index 2b8bc2174c..eb3d6c43ae 100644
--- a/test/302-float-conversion/info.txt
+++ b/test/302-float-conversion/info.txt
@@ -2,3 +2,4 @@ Tests whether constant conversions of double values to long values are
properly handled by the VM. For example, x86 systems using the x87 stack
should not overflow under constant conversions.
+The second test checks the Load hoisting optimization for float pointing conversion. \ No newline at end of file
diff --git a/test/302-float-conversion/src/Main.java b/test/302-float-conversion/src/Main.java
index dc512c5dcf..afc5e976d9 100644
--- a/test/302-float-conversion/src/Main.java
+++ b/test/302-float-conversion/src/Main.java
@@ -19,6 +19,11 @@ public class Main {
static volatile double negInfinity = Double.NEGATIVE_INFINITY;
public static void main(String args[]) {
+ test1();
+ test2();
+ }
+
+ public static void test1() {
long sumInf = 0;
long sumRes = 0;
@@ -35,9 +40,19 @@ public class Main {
}
if (sumRes == NUM_ITERATIONS / 2) {
- System.out.println("Result is as expected");
+ System.out.println("Iteration Result is as expected");
} else {
System.out.println("Conversions failed over " + NUM_ITERATIONS + " iterations");
}
}
+
+ public static void test2() {
+ long a = 1L;
+ long b = 2L;
+
+ float inter3 = a;
+ float inter4 = b;
+ System.out.println("inter4:" + inter4);
+ }
+
}