cvsuser     02/01/24 17:27:37

  Modified:    .        core.ops
               Parrot/Jit alphaGeneric.pm i386Generic.pm
               jit/alpha core.jit
               jit/i386 core.jit
               t/op     integer.t number.t
  Log:
  Added Parrot_neg.
  Erase t.s
  
  Revision  Changes    Path
  1.81      +19 -0     parrot/core.ops
  
  Index: core.ops
  ===================================================================
  RCS file: /home/perlcvs/parrot/core.ops,v
  retrieving revision 1.80
  retrieving revision 1.81
  diff -u -w -r1.80 -r1.81
  --- core.ops  19 Jan 2002 07:12:53 -0000      1.80
  +++ core.ops  25 Jan 2002 01:27:29 -0000      1.81
  @@ -1340,6 +1340,25 @@
   
   ########################################
   
  +=item B<not>(out INT, in INT)
  +
  +Set $1 to the negative of $2.
  +
  +=cut
  +
  +inline op neg(out INT, in INT) {
  +  $1 = -($2);
  +  goto NEXT();
  +}
  +
  +inline op neg(out NUM, in NUM) {
  +  $1 = -($2);
  +  goto NEXT();
  +}
  +
  +
  +########################################
  +
   =item B<pow>(out NUM, in INT, in INT)
   
   =item B<pow>(out NUM, in INT, in NUM)
  
  
  
  1.2       +2 -1      parrot/Parrot/Jit/alphaGeneric.pm
  
  Index: alphaGeneric.pm
  ===================================================================
  RCS file: /home/perlcvs/parrot/Parrot/Jit/alphaGeneric.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -r1.1 -r1.2
  --- alphaGeneric.pm   20 Jan 2002 20:52:22 -0000      1.1
  +++ alphaGeneric.pm   25 Jan 2002 01:27:31 -0000      1.2
  @@ -1,7 +1,7 @@
   #
   # Parrot::Jit::alphaGeneric;
   # 
  -# $Id: alphaGeneric.pm,v 1.1 2002/01/20 20:52:22 grunblatt Exp $
  +# $Id: alphaGeneric.pm,v 1.2 2002/01/25 01:27:31 grunblatt Exp $
   #
   
   package Parrot::Jit::alphaGeneric;
  @@ -163,6 +163,7 @@
   
       write_as($assembler,TMP_AS);
       assemble(TMP_AS, TMP_OBJ);
  +    unlink TMP_AS or warn "Could not unlink " . TMP_AS . ": $!";
       return disassemble(TMP_OBJ,\@special_arg,\@special,$ln);
   }
               
  
  
  
  1.2       +2 -1      parrot/Parrot/Jit/i386Generic.pm
  
  Index: i386Generic.pm
  ===================================================================
  RCS file: /home/perlcvs/parrot/Parrot/Jit/i386Generic.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -r1.1 -r1.2
  --- i386Generic.pm    20 Jan 2002 20:52:23 -0000      1.1
  +++ i386Generic.pm    25 Jan 2002 01:27:31 -0000      1.2
  @@ -1,7 +1,7 @@
   #
   # Parrot::Jit::i386Generic;
   #
  -# $Id: i386Generic.pm,v 1.1 2002/01/20 20:52:23 grunblatt Exp $
  +# $Id: i386Generic.pm,v 1.2 2002/01/25 01:27:31 grunblatt Exp $
   #
   
   package Parrot::Jit::i386Generic;
  @@ -110,6 +110,7 @@
   
       write_as($assembler,TMP_AS);
       assemble(TMP_AS, TMP_OBJ);
  +    unlink TMP_AS or warn "Could not unlink " . TMP_AS . ": $!";
       return disassemble(TMP_OBJ,\@special_arg,\@special,$ln);
   }
               
  
  
  
  1.2       +27 -1     parrot/jit/alpha/core.jit
  
  Index: core.jit
  ===================================================================
  RCS file: /home/perlcvs/parrot/jit/alpha/core.jit,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -r1.1 -r1.2
  --- core.jit  20 Jan 2002 20:52:31 -0000      1.1
  +++ core.jit  25 Jan 2002 01:27:33 -0000      1.2
  @@ -1,7 +1,7 @@
   ;
   ;   alpha_core.jit 
   ;
  -; $Id: core.jit,v 1.1 2002/01/20 20:52:31 grunblatt Exp $
  +; $Id: core.jit,v 1.2 2002/01/25 01:27:33 grunblatt Exp $
   ;
   
   Parrot_end {
  @@ -105,6 +105,32 @@
       ldq $3 , &INT_REG[1]
       bne $3 , 0
       JUMP(INT_CONST[2])
  +}
  +
  +Parrot_neg_i_i {
  +    ldq $3 , &INT_REG[2]
  +    neg $3 , $3
  +    stq $3 , &INT_REG[1]
  +}
  +
  +Parrot_neg_i_ic {
  +    ldah $3 , 1($27)
  +    ldq $3 , &INT_CONST[2]
  +    neg $3 , $3
  +    stq $3 , &INT_REG[1]
  +}
  +
  +Parrot_neg_n_n {
  +    ldt $f0 , &NUM_REG[2]
  +    fneg $f0,$f0
  +    stt $f0 , &NUM_REG[1]
  +}
  +
  +Parrot_neg_n_nc {
  +    ldah $7 , 1($27)
  +    ldt $f0 , &NUM_CONST[2]
  +    fneg $f0,$f0
  +    stt $f0 , &NUM_REG[1]
   }
   
   #Parrot_print_sc {
  
  
  
  1.10      +54 -8     parrot/jit/i386/core.jit
  
  Index: core.jit
  ===================================================================
  RCS file: /home/perlcvs/parrot/jit/i386/core.jit,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -w -r1.9 -r1.10
  --- core.jit  12 Jan 2002 00:16:58 -0000      1.9
  +++ core.jit  25 Jan 2002 01:27:35 -0000      1.10
  @@ -1,7 +1,7 @@
   ;
   ;   i386_core.jit 
   ;
  -; $Id: core.jit,v 1.9 2002/01/12 00:16:58 grunblatt Exp $
  +; $Id: core.jit,v 1.10 2002/01/25 01:27:35 grunblatt Exp $
   ;
   
   Parrot_noop {
  @@ -122,8 +122,13 @@
       pushl $0x0
       lea 0x4(%esp,1),%ebx
       subl $0x1,(%ebx)
  -    movl &INT_CONST[1],%eax
       pushl $0xa
  +    movl &INT_CONST[1],%eax
  +    cmp $0,%eax
  +    mov $0,%esi
  +    jge again
  +    neg %eax
  +    movl $1,%esi
   again:    movl %esp,%ecx
       addl $0x1,0x4(%ecx)
       cmp $0xa,%eax
  @@ -139,8 +144,14 @@
       mov (%ebx),%ecx
       addb $0x30,%al
       movb %al,(%ecx)
  -    mov %esp,%ecx
  -    mov 0x4(%ecx),%ecx
  +    cmp $1,%esi
  +    jne print
  +    movl %esp,%ecx
  +    addl $0x1,0x4(%ecx)
  +    subl $0x1,(%ebx)
  +    mov (%ebx),%ecx
  +    movb $0x2d,(%ecx)
  +print:    mov 0x4(%esp),%ecx
       movl %ecx,&TEMP_INT[0]
       mov (%ebx),%ecx
       mov %ecx, &TEMP_INT[1]
  @@ -153,8 +164,13 @@
       pushl $0x0
       lea 0x4(%esp,1),%ebx
       subl $0x1,(%ebx)
  -    movl &INT_REG[1],%eax
       pushl $0xa
  +    movl &INT_REG[1],%eax
  +    cmp $0,%eax
  +    mov $0,%esi
  +    jge again
  +    neg %eax
  +    movl $1,%esi
   again:    movl %esp,%ecx
       addl $0x1,0x4(%ecx)
       cmp $0xa,%eax
  @@ -170,13 +186,43 @@
       mov (%ebx),%ecx
       addb $0x30,%al
       movb %al,(%ecx)
  -    mov %esp,%ecx
  -    mov 0x4(%ecx),%ecx
  +    cmp $1,%esi
  +    jne print
  +    movl %esp,%ecx
  +    addl $0x1,0x4(%ecx)
  +    subl $0x1,(%ebx)
  +    mov (%ebx),%ecx
  +    movb $0x2d,(%ecx)
  +print:    mov 0x4(%esp),%ecx
       movl %ecx,&TEMP_INT[0]
       mov (%ebx),%ecx
       mov %ecx, &TEMP_INT[1]
       movl $1,&TEMP_INT[2]
       SYSTEMCALL(WRITE,3, A&TEMP_INT[2] A&TEMP_INT[1] A&TEMP_INT[0]) 
  +}
  +
  +Parrot_neg_i_i {
  +    movl &INT_REG[2],%eax
  +    neg %eax
  +    movl %eax,&INT_REG[1]
  +}
  +
  +Parrot_neg_i_ic {
  +    movl *INT_CONST[2],%eax
  +    neg %eax
  +    movl %eax,&INT_REG[1]
  +}
  +
  +Parrot_neg_n_n {
  +    fldl &NUM_REG[2]
  +    fchs
  +    fstpl &NUM_REG[1]
  +}
  +
  +Parrot_neg_n_nc {
  +    fldl &NUM_CONST[2]
  +    fchs
  +    fstpl &NUM_REG[1]
   }
   
   ;
  
  
  
  1.17      +11 -1     parrot/t/op/integer.t
  
  Index: integer.t
  ===================================================================
  RCS file: /home/perlcvs/parrot/t/op/integer.t,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -w -r1.16 -r1.17
  --- integer.t 30 Dec 2001 18:41:22 -0000      1.16
  +++ integer.t 25 Jan 2002 01:27:37 -0000      1.17
  @@ -1,6 +1,6 @@
   #! perl -w
   
  -use Parrot::Test tests => 30;
  +use Parrot::Test tests => 31;
   
   output_is(<<CODE, <<OUTPUT, "set_i_ic");
        # XXX: Need a test for writing outside the set of available
  @@ -1010,6 +1010,16 @@
           end
   CODE
   00000000000000000000000000000000
  +OUTPUT
  +
  +output_is(<<CODE, <<OUTPUT, "neg_i");
  +    neg I0,3
  +    neg I0,I0
  +    print I0
  +    print "\\n"
  +    end
  +CODE
  +3
   OUTPUT
   
   1;
  
  
  
  1.12      +13 -1     parrot/t/op/number.t
  
  Index: number.t
  ===================================================================
  RCS file: /home/perlcvs/parrot/t/op/number.t,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -w -r1.11 -r1.12
  --- number.t  30 Dec 2001 18:41:22 -0000      1.11
  +++ number.t  25 Jan 2002 01:27:37 -0000      1.12
  @@ -1,6 +1,6 @@
   #! perl -w
   
  -use Parrot::Test tests => 28;
  +use Parrot::Test tests => 29;
   
   output_is(<<CODE, <<OUTPUT, "set_n_nc");
        set     N0, 1.0
  @@ -855,3 +855,15 @@
   CODE
   
0.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.0000000.000000
   OUTPUT
  +
  +output_is(<<CODE, <<OUTPUT, "neg_n");
  +    neg N0,3.0
  +    neg N0,N0
  +    print N0
  +    print "\\n"
  +    end
  +CODE
  +3.000000
  +OUTPUT
  +
  +
  
  
  


Reply via email to