cvsuser     04/11/05 08:26:29

  Modified:    jit/i386 core.jit
               runtime/parrot/library/Stream Sub.imc
               t/op     jitn.t
  Log:
  JIT/i386: fix binop_n_n_i
  
  [ leo, 4711 ] all untestet opcodes are failing
  
  Revision  Changes    Path
  1.67      +8 -3      parrot/jit/i386/core.jit
  
  Index: core.jit
  ===================================================================
  RCS file: /cvs/public/parrot/jit/i386/core.jit,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- core.jit  1 Nov 2004 15:35:34 -0000       1.66
  +++ core.jit  5 Nov 2004 16:26:27 -0000       1.67
  @@ -1,7 +1,7 @@
   ;
   ; i386/core.jit
   ;
  -; $Id: core.jit,v 1.66 2004/11/01 15:35:34 leo Exp $
  +; $Id: core.jit,v 1.67 2004/11/05 16:26:27 leo Exp $
   ;
   
   # TODO complete this
  @@ -736,8 +736,13 @@
           else {
               jit_emit_mov_RM_n(NATIVECODE, FSR1, ROFFS_NUM(2));
           }
  -        jit_emit_<op>_RM_ni(NATIVECODE, ISR1, ROFFS_INT(3));
  -        jit_emit_mov_MR_n(NATIVECODE, ROFFS_NUM(1), FSR1);
  +        jit_emit_<op>_RM_ni(NATIVECODE, FSR1, ROFFS_INT(3));
  +        if (MAP[1]) {
  +            jit_emit_mov_rr_n(NATIVECODE, MAP[1], FSR1);
  +        }
  +        else {
  +            jit_emit_mov_MR_n(NATIVECODE, ROFFS_NUM(1), FSR1);
  +        }
       }
   }
   
  
  
  
  1.5       +2 -2      parrot/runtime/parrot/library/Stream/Sub.imc
  
  Index: Sub.imc
  ===================================================================
  RCS file: /cvs/public/parrot/runtime/parrot/library/Stream/Sub.imc,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Sub.imc   30 Oct 2004 16:25:40 -0000      1.4
  +++ Sub.imc   5 Nov 2004 16:26:28 -0000       1.5
  @@ -124,7 +124,7 @@
       setattribute self, $I0, $P0
   
       str = temp( self )
  -    
  +
       # sub exited, delete source
       null temp
       self."setSource"( temp )
  @@ -138,7 +138,7 @@
       set temp["_message"], "fatal error in library/Streams/Sub.imc: rawRead()"
       throw temp
       end
  -    
  +
   END:
       # return a null string to indicate end of stream
       null str
  
  
  
  1.7       +75 -12    parrot/t/op/jitn.t
  
  Index: jitn.t
  ===================================================================
  RCS file: /cvs/public/parrot/t/op/jitn.t,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- jitn.t    1 Oct 2004 21:16:49 -0000       1.6
  +++ jitn.t    5 Nov 2004 16:26:29 -0000       1.7
  @@ -1,6 +1,6 @@
   #! perl -w
   # Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -# $Id: jitn.t,v 1.6 2004/10/01 21:16:49 jrieks Exp $
  +# $Id: jitn.t,v 1.7 2004/11/05 16:26:29 leo Exp $
   # test WRT JIT register allocation
   
   =head1 NAME
  @@ -13,13 +13,14 @@
   
   =head1 DESCRIPTION
   
  -Tests JIT register allocation.
  +Tests JIT register allocation. These tests are written for four mappable
  +registers.
   
   =cut
   
  -use Parrot::Test tests => 10;
  +use Parrot::Test tests => 13;
   
  -output_is(<<'CODE', <<'OUTPUT', "sub_i_i_i 1,2,3 mapped");
  +output_is(<<'CODE', <<'OUTPUT', "sub_n_n_n 1,2,3 mapped");
   set N0,0
   set N1,1
   set N2,2
  @@ -37,7 +38,22 @@
   2.000000
   OUTPUT
   
  -output_is(<<'CODE', <<'OUTPUT', "sub_i_i_i 1,2 mapped");
  +output_is(<<'CODE', <<'OUTPUT', "sub_n_n_i 1,2,3 mapped");
  +set N0,0
  +set N1,1
  +set I2,2
  +sub N0,N1,I2
  +print N0
  +print "\n"
  +print N1
  +print "\n"
  +end
  +CODE
  +-1.000000
  +1.000000
  +OUTPUT
  +
  +output_is(<<'CODE', <<'OUTPUT', "sub_n_n_n 1,2 mapped");
   set N0,0
   set N1,1
   set N2,2
  @@ -61,7 +77,7 @@
   4.000000
   OUTPUT
   
  -output_is(<<'CODE', <<'OUTPUT', "sub_i_i_i 1,3 mapped");
  +output_is(<<'CODE', <<'OUTPUT', "sub_n_n_n 1,3 mapped");
   set N0,0
   set N1,1
   set N2,2
  @@ -85,7 +101,29 @@
   1.000000
   OUTPUT
   
  -output_is(<<'CODE', <<'OUTPUT', "sub_i_i_i 2,3 mapped");
  +output_is(<<'CODE', <<'OUTPUT', "sub_n_n_i 1,3 mapped");
  +set N0,0
  +set I1,1
  +set N1,1
  +set N2,2
  +set N3,3
  +set N4,4
  +set N0,N1
  +set N2,N3
  +set N0,N1
  +set N2,N3
  +sub N0,N4,I1
  +print N0
  +print "\n"
  +print N4
  +print "\n"
  +end
  +CODE
  +3.000000
  +4.000000
  +OUTPUT
  +
  +output_is(<<'CODE', <<'OUTPUT', "sub_n_n_n 2,3 mapped");
   set N0,0
   set N1,1
   set N2,2
  @@ -109,7 +147,32 @@
   1.000000
   OUTPUT
   
  -output_is(<<'CODE', <<'OUTPUT', "sub_i_i_i 1 mapped");
  +output_is(<<'CODE', <<'OUTPUT', "sub_n_n_i 2,3 mapped");
  +set N0,0
  +set N1,1
  +set I1,1
  +set N2,2
  +set N3,3
  +set N4,4
  +set N0,N1
  +set N2,N3
  +set N0,N1
  +set N2,N3
  +sub N4,N0,I1
  +print N4
  +print "\n"
  +print N0
  +print "\n"
  +print N1
  +print "\n"
  +end
  +CODE
  +0.000000
  +1.000000
  +1.000000
  +OUTPUT
  +
  +output_is(<<'CODE', <<'OUTPUT', "sub_n_n_n 1 mapped");
   set N0,0
   set N1,1
   set N2,2
  @@ -133,7 +196,7 @@
   4.000000
   OUTPUT
   
  -output_is(<<'CODE', <<'OUTPUT', "sub_i_i_i 2 mapped");
  +output_is(<<'CODE', <<'OUTPUT', "sub_n_n_n 2 mapped");
   set N0,0
   set N1,1
   set N2,2
  @@ -157,7 +220,7 @@
   4.000000
   OUTPUT
   
  -output_is(<<'CODE', <<'OUTPUT', "sub_i_i_i 3 mapped");
  +output_is(<<'CODE', <<'OUTPUT', "sub_n_n_n 3 mapped");
   set N0,0
   set N1,1
   set N2,2
  @@ -181,7 +244,7 @@
   4.000000
   OUTPUT
   
  -output_is(<<'CODE', <<'OUTPUT', "sub_i_i_i 0 mapped");
  +output_is(<<'CODE', <<'OUTPUT', "sub_n_n_n 0 mapped");
   set N0,0
   set N1,1
   set N2,2
  @@ -205,7 +268,7 @@
   4.000000
   OUTPUT
   
  -output_is(<<'CODE', <<'OUTPUT', "sub_i_i_i mapped same");
  +output_is(<<'CODE', <<'OUTPUT', "sub_n_n_n mapped same");
   set N2, 1
   add N2, N2, N2       # reserve first reg
   add N2, N2, N2
  
  
  

Reply via email to