Javac produces both fcmpg and fcmpl instructions for this, verified with
javap.

Signed-off-by: Vegard Nossum <vegard.nos...@gmail.com>
---
 regression/jvm/FloatArithmeticTest.java |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/regression/jvm/FloatArithmeticTest.java 
b/regression/jvm/FloatArithmeticTest.java
index 5632acb..d07e277 100644
--- a/regression/jvm/FloatArithmeticTest.java
+++ b/regression/jvm/FloatArithmeticTest.java
@@ -132,6 +132,26 @@ public class FloatArithmeticTest extends TestCase {
         assertEquals(-3000f, i2f(-3000));
     }
 
+    private static float zero = 0.0f;
+    private static float one = 1.0f;
+
+    public static void testFloatComparison() {
+        assertTrue(zero < one);
+        assertFalse(one < zero);
+        assertFalse(one < one);
+
+        assertTrue(zero <= one);
+        assertTrue(one <= one);
+
+        assertFalse(zero > one);
+        assertTrue(one > zero);
+        assertFalse(one > one);
+
+        assertTrue(one >= zero);
+        assertTrue(one >= one);
+    }
+
+
     public static void main(String[] args) {
         testFloatAddition();
         testFloatAdditionLocalSlot();
@@ -142,5 +162,6 @@ public class FloatArithmeticTest extends TestCase {
         testFloatRemainder();
         testFloatNegation();
         testFloatIntConversion();
+        testFloatComparison();
     }
 }
-- 
1.6.0.6


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to