harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r517820 - in /harmony/enhanced/drlvm/trunk/vm: port/src/lil/em64t/pim/include/lil_code_generator_em64t.h port/src/lil/em64t/pim/lil_code_generator_em64t.cpp vmcore/src/jit/compile.cpp
Date Tue, 13 Mar 2007 18:53:23 GMT
Author: gshimansky
Date: Tue Mar 13 11:53:22 2007
New Revision: 517820

URL: http://svn.apache.org/viewvc?view=rev&rev=517820
Log:
Applied HARMONY-3365 [drlvm][winx64] Double.doubleToLongBits(double) produces incorrect results.



Modified:
    harmony/enhanced/drlvm/trunk/vm/port/src/lil/em64t/pim/include/lil_code_generator_em64t.h
    harmony/enhanced/drlvm/trunk/vm/port/src/lil/em64t/pim/lil_code_generator_em64t.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/port/src/lil/em64t/pim/include/lil_code_generator_em64t.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/lil/em64t/pim/include/lil_code_generator_em64t.h?view=diff&rev=517820&r1=517819&r2=517820
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/src/lil/em64t/pim/include/lil_code_generator_em64t.h
(original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/lil/em64t/pim/include/lil_code_generator_em64t.h
Tue Mar 13 11:53:22 2007
@@ -151,11 +151,21 @@
 
     unsigned n_inputs;     // total number of inputs
     unsigned n_gr_inputs;  // total number of GRs reserved for inputs
+#ifdef _WIN64
+    // Windows x64 has 4 slots for both integer and float inputs
+#define n_fr_inputs n_gr_inputs
+#else
     unsigned n_fr_inputs;  // total number of FRs reserved for inputs
+#endif
 
     unsigned n_outputs;    // total number of outputs
     unsigned n_gr_outputs; // total number of GRs reserved for outputs
+#ifdef _WIN64
+    // Windows x64 has 4 slots for both integer and float inputs
+#define n_fr_outputs n_gr_outputs
+#else
     unsigned n_fr_outputs; // total number of FRs reserved for outputs
+#endif
 
     /// Number of GR registers currently allocated for temporary needs.
     unsigned m_tmp_grs_used;

Modified: harmony/enhanced/drlvm/trunk/vm/port/src/lil/em64t/pim/lil_code_generator_em64t.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/lil/em64t/pim/lil_code_generator_em64t.cpp?view=diff&rev=517820&r1=517819&r2=517820
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/src/lil/em64t/pim/lil_code_generator_em64t.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/lil/em64t/pim/lil_code_generator_em64t.cpp Tue
Mar 13 11:53:22 2007
@@ -325,8 +325,12 @@
         }
 #endif
         LilType t;
-        unsigned fp_param_cnt = 0;
         unsigned gp_param_cnt = 0;
+#ifdef _WIN64
+#define fp_param_cnt gp_param_cnt
+#else
+        unsigned fp_param_cnt = 0;
+#endif
         for (unsigned i = 0; i < n; i++) {
             t = lil_sig_get_arg_type(lil_cs_get_sig(cs), i);
             if (context.is_fp_type(t)) {
@@ -348,7 +352,7 @@
                     return new(mem) LcgEM64TLoc(LLK_FStk, offset);
                 } else {
                     return new(mem) LcgEM64TLoc(LLK_Fr,
-                        LcgEM64TContext::FR_OUTPUTS_OFFSET + fp_param_cnt);             
      
+                        LcgEM64TContext::FR_OUTPUTS_OFFSET + fp_param_cnt);
                 }
             } else {
                 unsigned gp_on_stack = gp_param_cnt > LcgEM64TContext::MAX_GR_OUTPUTS
@@ -362,7 +366,10 @@
                 // skip rip
                 offset += LcgEM64TContext::GR_SIZE;
                 // skip size allocated for preceding inputs
-                offset += gp_on_stack + fp_on_stack ;
+                offset += gp_on_stack;
+#ifndef _WIN64
+                offset += fp_on_stack;
+#endif
                 return new(mem) LcgEM64TLoc(LLK_FStk, offset);
             }
         } else { // if (context.is_fp_type(t))
@@ -388,7 +395,10 @@
                 // skip rip
                 offset += LcgEM64TContext::GR_SIZE;
                 // skip size allocated for preceding inputs
-                offset += gp_on_stack + fp_on_stack ;
+                offset += gp_on_stack;
+#ifndef _WIN64
+                offset += fp_on_stack;
+#endif
                 return new(mem) LcgEM64TLoc(LLK_GStk, offset);
             }
         }
@@ -400,8 +410,12 @@
         assert(n <= context.get_num_outputs());
 
         LilType t;
-        unsigned fp_param_cnt = 0;
         unsigned gp_param_cnt = 0;
+#ifdef _WIN64
+#define fp_param_cnt gp_param_cnt
+#else
+        unsigned fp_param_cnt = 0;
+#endif
         for (unsigned i = 0; i < n; i++) {
             t = lil_sig_get_arg_type(out_sig, i);
             if (context.is_fp_type(t)) {
@@ -425,7 +439,10 @@
                 unsigned fp_on_stack = fp_param_cnt > LcgEM64TContext::MAX_FR_OUTPUTS
                     ? (fp_param_cnt - LcgEM64TContext::MAX_FR_OUTPUTS)
                     * LcgEM64TContext::FR_SIZE : 0;
-                int32 offset = gp_on_stack + fp_on_stack;
+                int32 offset = gp_on_stack;
+#ifndef _WIN64
+                offset += fp_on_stack;
+#endif
                 return new(mem) LcgEM64TLoc(LLK_FStk, offset);
             }
         } else {
@@ -439,7 +456,10 @@
                 unsigned fp_on_stack = fp_param_cnt > LcgEM64TContext::MAX_FR_OUTPUTS
                     ? (fp_param_cnt - LcgEM64TContext::MAX_FR_OUTPUTS)
                     * LcgEM64TContext::FR_SIZE : 0;
-                int32 offset = gp_on_stack + fp_on_stack;
+                int32 offset = gp_on_stack;
+#ifndef _WIN64
+                offset += fp_on_stack;
+#endif
                 return new(mem) LcgEM64TLoc(LLK_GStk, offset);
             }
         }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp?view=diff&rev=517820&r1=517819&r2=517820
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp Tue Mar 13 11:53:22 2007
@@ -345,7 +345,7 @@
     assert(cs);
 
     // Loop over arguments proper, setting rest of outputs
-    POINTER_SIZE_INT arg_base = 1 + (is_static ? 1 : 0);
+    unsigned int arg_base = 1 + (is_static ? 1 : 0);
     hn = 1;
     for(i=(is_static?0:1); i<num_args; i++) {
         if (is_reference(method_args_get_type_info(msh, i))) {
@@ -358,7 +358,7 @@
                                         ":%g;"
                                         "o%4i=0;"
                                         ":%g;",
-                                        (POINTER_SIZE_INT)i,
+                                        i,
                                         VM_Global_State::loader_env->managed_null,
                                         arg_base+i, handle_offset, arg_base+i);
             } else {
@@ -369,13 +369,13 @@
                                         ":%g;"
                                         "o%3i=0;"
                                         ":%g;",
-                                        (POINTER_SIZE_INT)i,
+                                        i,
                                         arg_base+i, handle_offset,
                                         arg_base+i);
             }
             hn++;
         } else {
-            cs = lil_parse_onto_end(cs, "o%0i=i%1i;", arg_base+i, (POINTER_SIZE_INT)i);
+            cs = lil_parse_onto_end(cs, "o%0i=i%1i;", arg_base+i, i);
         }
         assert(cs);
     }



Mime
View raw message