harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Varlamov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-1861) [drlvm][jit] Double arithmetic instructions work incorrectly (Jitrino JET)
Date Tue, 15 May 2007 06:36:16 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-1861?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Alexey Varlamov updated HARMONY-1861:
-------------------------------------

    Attachment: H1861.diff

It appeared that "any-size" PUSH/POP abstraction is not feasible: x86_64 does not support
32-bit operands in 64-bit mode (found due to awt/swing tests failed on Win@x86_64).
So I've redone the fix for handling wide types as a special case immediately in reg spilling,
+ added reg test.

> [drlvm][jit] Double arithmetic instructions work incorrectly (Jitrino JET)
> --------------------------------------------------------------------------
>
>                 Key: HARMONY-1861
>                 URL: https://issues.apache.org/jira/browse/HARMONY-1861
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Linux IA-32, Windows IA-32
>            Reporter: Irina Arkhipets
>         Assigned To: Alexey Varlamov
>         Attachments: H1861.diff, H1861.diff, test.java
>
>
> Double arithmetic and compare operations  (instructions: ddiv, drem, dadd, dsub, dcmpl,
dcmpg) return  incorrect result  if the first argument is the value of double non-static field
and the second argument is an element of array of long values.
> I am able to reproduce this bug with Jitrino JET only, the testcase below always passes
with interpreter, opt, client, server and server_static.
> Please, compile and run the following test example with "-Xem:jet" switch to reproduce
the failure:
> ...
> public class test {
>     public static long [] arr = new long [] {6, 25, 50};
>     public static test t = new test();
>     public double d = 30d;
>     public static void main (String [] args)  {
>         double d1= t.d / arr[0];
>         if (d1 == 5.0d) {
>             System.out.println("double/long PASSED");
>         } else { 
>             System.out.println("double/long FAILED: " + d1);
>         }
>         d1= t.d % arr[1];
>         if (d1 == 5.0d) {
>             System.out.println("double%long PASSED");
>         } else { 
>             System.out.println("double%long FAILED: " + d1);
>         }
>         d1= t.d - arr[1];
>         if (d1 == 5.0d) {
>             System.out.println("double-long PASSED");
>         } else { 
>             System.out.println("double-long FAILED: " + d1);
>         } 
>         d1= t.d + arr[0];
>         if (d1 == 36.0d) {
>             System.out.println("double+long PASSED");
>         } else { 
>             System.out.println("double+long FAILED: " + d1);
>         }
>         boolean b = (t.d >= arr[0]);
>         if (b) {
>             System.out.println("double>=long PASSED");
>         } else { 
>             System.out.println("double>=long FAILED: " + b);
>         }
>         b = (t.d < arr[1]);
>         if (!b) {
>             System.out.println("double<long PASSED");
>         } else { 
>             System.out.println("double<long FAILED: " + b);
>         }
>     }
> }
> ...
> Please, note the following:
> 1. Tes output differs on Linux and Windows platforms, and dcmpl, dcmpg testcases even
pass on Linux.
> 2. The test passes with JET if d variable is declared as static (" public static double
d = 30d")
> 3. The test passes with JET if the second arguments for all operations are declared just
as long variables (i.e. not an array memners)
> Sample outpit on Windows is:
> ...
> double/long FAILED: 4.62863868563952E-309
> double%long FAILED: 1.884906858420811E-225
> double-long FAILED: -25.0
> double+long FAILED: 6.0
> double>=long FAILED: false
> double<long FAILED: true
> ...
> Sample output on Linux is:
> ...
> double/long FAILED: -1.980992325586801E147
> double%long FAILED: 16.0
> double-long FAILED: 5.91906791E8
> double+long FAILED: 5.91906822E8
> double>=long PASSED
> double<long PASSED
> ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message