Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 94620 invoked from network); 13 Oct 2006 03:39:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Oct 2006 03:39:19 -0000 Received: (qmail 40950 invoked by uid 500); 13 Oct 2006 03:39:19 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 40916 invoked by uid 500); 13 Oct 2006 03:39:19 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 40905 invoked by uid 99); 13 Oct 2006 03:39:19 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Oct 2006 20:39:19 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Oct 2006 20:39:18 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0B1A77142F3 for ; Thu, 12 Oct 2006 20:38:35 -0700 (PDT) Message-ID: <7335106.1160710715042.JavaMail.jira@brutus> Date: Thu, 12 Oct 2006 20:38:35 -0700 (PDT) From: "Irina Arkhipets (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Created: (HARMONY-1848) [drlvm][jit] dcmp and fcmp instructions return wrong result when one of the used parameter is NaN MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [drlvm][jit] dcmp and fcmp instructions return wrong result when one of the used parameter is NaN --------------------------------------------------------------------------------------------------------- Key: HARMONY-1848 URL: http://issues.apache.org/jira/browse/HARMONY-1848 Project: Harmony Issue Type: Bug Components: DRLVM Environment: Windows IA-32, Linux IA-32 Reporter: Irina Arkhipets Attachments: test_cmp.j J2SE VM Specification reads about dcmp and fcmp instructions: "If one of value1 or value2 is NaN then dcmpg and fcmpg push the int value 1 onto stack and dcmpl and fcmpl push the int -1" However, Jitrino returns incorrect value in this case sometime. The following test example demonstrates the failure: --------- test.java --------- public class test { public static void main(String [] args) { int ret = test_cmp.test_dcmp1(); System.out.println(ret == 1 ? "dcmp1 test PASSED" : "dcmp1 test FAILED: " + ret); ret = test_cmp.test_fcmp1(); System.out.println(ret == -1 ? "fcmp1 test PASSED" : "fcmp1 test FAILED: " + ret); } } --------- test_cmp.j --------- .class public test_cmp .super java/lang/Object .method public ()V aload_0 invokenonvirtual java/lang/Object/()V return .end method .method public static test_dcmp1()I .limit stack 6 .limit locals 2 ldc2_w -1.0d ldc2_w -0.0d ldc2_w 0.0d ddiv dcmpg ireturn .end method .method public static test_fcmp1()I .limit stack 2 .limit locals 2 ldc -0.0f ldc 0.0f fdiv ldc -3.4028235E39f fcmpl ireturn .end method ---------------------------------- Both testcases passes with reference JDK as well as in default, interpreter, JET, client and server_static modes. dcmp1 test fails in opt mode. Both dcmp1 and fcmp1 tests fail in server mode. Please, compile this test using the following commands: $> java -jar jasmin.jar test_cmp.j $> javac test.java Please, run the following commands to reproduce the failure: $> test $> -Xem:opt test $> -Xem:server test -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira