dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dotgnu-pnet-commits] libjit ChangeLog configure.in jit/jit-reg-alloc.c


From: Aleksey Demakov
Subject: [dotgnu-pnet-commits] libjit ChangeLog configure.in jit/jit-reg-alloc.c
Date: Tue, 04 Jul 2006 17:28:07 +0000

CVSROOT:        /sources/dotgnu-pnet
Module name:    libjit
Changes by:     Aleksey Demakov <avd>   06/07/04 17:28:07

Modified files:
        .              : ChangeLog configure.in 
        jit            : jit-reg-alloc.c 

Log message:
        fix problem with destroying the end register of a long pair;
        make new register allocator the default.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libjit/ChangeLog?cvsroot=dotgnu-pnet&r1=1.240&r2=1.241
http://cvs.savannah.gnu.org/viewcvs/libjit/configure.in?cvsroot=dotgnu-pnet&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/libjit/jit/jit-reg-alloc.c?cvsroot=dotgnu-pnet&r1=1.35&r2=1.36

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/ChangeLog,v
retrieving revision 1.240
retrieving revision 1.241
diff -u -b -r1.240 -r1.241
--- ChangeLog   2 Jul 2006 23:01:24 -0000       1.240
+++ ChangeLog   4 Jul 2006 17:28:07 -0000       1.241
@@ -1,3 +1,10 @@
+2006-07-05  Aleksey Demakov  <address@hidden>
+
+       * configure.in: make new register allocator the default.
+
+       * jit/jit-reg-alloc.c (is_register_alive, compute_spill_cost): fix
+       problem with destroying the end register of a long pair.
+
 2006-07-03  Aleksey Demakov  <address@hidden>
 
        * jit/jit-rules-x86.ins: add JIT_OP_LOW_WORD, JIT_OP_EXPAND_INT,

Index: configure.in
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/configure.in,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- configure.in        18 Apr 2006 09:53:23 -0000      1.20
+++ configure.in        4 Jul 2006 17:28:07 -0000       1.21
@@ -70,7 +70,7 @@
   yes) new_reg_alloc=true ;;
   no)  new_reg_alloc=false ;;
   *) AC_MSG_ERROR(bad value ${enableval} for --enable-new-reg-alloc) ;;
-esac],[new_reg_alloc=false])
+esac],[new_reg_alloc=true])
 if test x$new_reg_alloc = xtrue; then
        AC_DEFINE(USE_NEW_REG_ALLOC, 1, [Define if you want to use new register 
allocator])
 fi

Index: jit/jit-reg-alloc.c
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/jit/jit-reg-alloc.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- jit/jit-reg-alloc.c 16 Jun 2006 18:13:32 -0000      1.35
+++ jit/jit-reg-alloc.c 4 Jul 2006 17:28:07 -0000       1.36
@@ -1714,6 +1714,23 @@
 }
 
 /*
+ * Find the start register of a long pair given the end register.
+ */
+static int
+get_long_pair_start(int other_reg)
+{
+       int reg;
+       for(reg = 0; reg < JIT_NUM_REGS; reg++)
+       {
+               if(other_reg == OTHER_REG(reg))
+               {
+                       return reg;
+               }
+       }
+       return -1;
+}
+
+/*
  * Determine the type of register that we need.
  */
 static int
@@ -1889,6 +1906,10 @@
                {
                        return 1;
                }
+               if(gen->contents[reg].is_long_end)
+               {
+                       reg = get_long_pair_start(reg);
+               }
                for(index = 0; index < gen->contents[reg].num_values; index++)
                {
                        usage = value_usage(regs, 
gen->contents[reg].values[index]);
@@ -2359,7 +2380,7 @@
 }
 
 /*
- * Check to see if loading one input value into the given register
+ * Check to see if an input value loaded into the given register
  * clobbers any other input values.
  */
 static int
@@ -2493,6 +2514,11 @@
        int cost, index, usage;
        jit_value_t value;
 
+       if(gen->contents[reg].is_long_end)
+       {
+               reg = get_long_pair_start(reg);
+       }
+
        cost = 0;
        for(index = 0; index < gen->contents[reg].num_values; index++)
        {
@@ -3469,7 +3495,7 @@
 }
 
 /*
- * Spill regualar (non-stack) register.
+ * Spill regular (non-stack) register.
  */
 static void
 spill_reg(jit_gencode_t gen, _jit_regs_t *regs, int reg)
@@ -3489,13 +3515,7 @@
        else if(gen->contents[reg].is_long_end)
        {
                other_reg = reg;
-               for(reg = 0; reg < JIT_NUM_REGS; ++reg)
-               {
-                       if(other_reg == OTHER_REG(reg))
-                       {
-                               break;
-                       }
-               }
+               reg = get_long_pair_start(reg);
        }
        else
        {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]