Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 23521 invoked from network); 15 Aug 2007 07:43:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Aug 2007 07:43:54 -0000 Received: (qmail 97003 invoked by uid 500); 15 Aug 2007 07:43:52 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 96984 invoked by uid 500); 15 Aug 2007 07:43:52 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 96975 invoked by uid 99); 15 Aug 2007 07:43:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Aug 2007 00:43:52 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Aug 2007 07:44:08 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 76FF37141E2 for ; Wed, 15 Aug 2007 00:43:30 -0700 (PDT) Message-ID: <25253123.1187163810467.JavaMail.jira@brutus> Date: Wed, 15 Aug 2007 00:43:30 -0700 (PDT) From: "Mikhail Fursov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Assigned: (HARMONY-3025) [drlvm][jit][opt] Conversion operations return incorrect results on Jitrino OPT In-Reply-To: <31687141.1169197469983.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-3025?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mikhail Fursov reassigned HARMONY-3025: --------------------------------------- Assignee: Mikhail Fursov > [drlvm][jit][opt] Conversion operations return incorrect results on Jitrino OPT > ------------------------------------------------------------------------------- > > Key: HARMONY-3025 > URL: https://issues.apache.org/jira/browse/HARMONY-3025 > Project: Harmony > Issue Type: Bug > Components: DRLVM > Environment: Linux and Windows > Reporter: Vera Petrashkova > Assignee: Mikhail Fursov > > The following test demonstrates that conversion operations return incorrect results on Jitrino OPT > especially when Double, Float, Integer MAX_VALUEs are used in preliminary calculations. > ----------------- > public class testConv { > static double dMAX = Double.MAX_VALUE; > static double dNEG = -1.000000E200; > static float fMAX = Float.MAX_VALUE; > public static void main(String[] args) { > testDMAX(); > testDNEG(); > testByte(); > testShort(); > testChar(); > } > public static void testDMAX() { > System.out.println("Test: long * Double.MAX_VALUE / long"); > long constLong1 = 1000; > long constLong2 = 10; > long result = ((long)(constLong1*dMAX))/constLong2; > if (result == Long.MAX_VALUE/10) { > System.out.println(" Test passed. result: " + result + " equals " + (Long.MAX_VALUE/10)); > } else { > System.out.println(" Test failed. result: " + result + " does not equal " + (Long.MAX_VALUE/10)); > } > } > public static void testDNEG() { > System.out.println("Test: long * -1.000000E200 / long"); > int constInt1 = 800; > int constInt2 = 8; > int result = ((int)(constInt1*dNEG))/constInt2; > if (result == -268435456) { > System.out.println(" Test passed. result: " + result + " equals " + (-268435456)); > } else { > System.out.println(" Test failed. result: " + result + " does not equal " + (-268435456)); > } > } > public static void testByte() { > System.out.println("Test: convert Float.MAX_VALUE)/Integer.MAX_VALUE to byte"); > byte result1 = (byte)(((byte) Float.MAX_VALUE)/Integer.MAX_VALUE); > byte result2 = (byte)(((byte) fMAX)/Integer.MAX_VALUE); > System.out.println("result1 = " + result1); > System.out.println("result2 = " + result2); > if (result1 == result2) { > System.out.println(" Test passed"); > } else { > System.out.println(" Test failed: result != result2"); > } > } > > public static void testShort() { > System.out.println("Test: convert Double.MAX_VALUE)/Integer.MAX_VALUE to short"); > short result1 = (short)(((short) Double.MAX_VALUE)/Integer.MAX_VALUE); > short result2 = (short)(((short) dMAX)/Integer.MAX_VALUE); > System.out.println("result1 = " + result1); > System.out.println("result2 = " + result2); > if (result1 == result2) { > System.out.println(" Test passed"); > } else { > System.out.println(" Test failed: result != result2"); > } > } > public static void testChar() { > System.out.println("Test: convert Float.MAX_VALUE)/Integer.MAX_VALUE to char"); > char result1 = (char)(((char) Float.MAX_VALUE)/Integer.MAX_VALUE); > char result2 = (char)(((char) fMAX)/Integer.MAX_VALUE); > System.out.println("result1 = " + (int) result1); > System.out.println("result2 = " + (int) result2); > if (result1 == result2) { > System.out.println(" Test passed"); > } else { > System.out.println(" Test failed: result != result2"); > } > } > } > ------------------------- > On Ia32 all testcases fail: > Test: long * Double.MAX_VALUE / long > Test failed. result: 0 does not equal 922337203685477580 > Test: long * -1.000000E200 / long > Test failed. result: 0 does not equal -268435456 > Test: convert Float.MAX_VALUE)/Integer.MAX_VALUE to byte > result1 = 0 > result2 = 1 > Test failed: result != result2 > Test: convert Double.MAX_VALUE)/Integer.MAX_VALUE to short > result1 = 0 > result2 = 1 > Test failed: result != result2 > Test: convert Float.MAX_VALUE)/Integer.MAX_VALUE to char > result1 = 0 > result2 = 1 > Test failed: result != result2 > On EM64t output is > Test: long * Double.MAX_VALUE / long > Test passed. result: 922337203685477580 equals 922337203685477580 > Test: long * -1.000000E200 / long > Test passed. result: -268435456 equals -268435456 > Test: convert Float.MAX_VALUE)/Integer.MAX_VALUE to byte > result1 = 0 > result2 = 1 > Test failed: result != result2 > Test: convert Double.MAX_VALUE)/Integer.MAX_VALUE to short > result1 = 0 > result2 = 1 > Test failed: result != result2 > Test: convert Float.MAX_VALUE)/Integer.MAX_VALUE to char > result1 = 0 > result2 = 1 > Test failed: result != result2 > On interpreter and Jitrino/JET all testcase of this test pass. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.