Branch: Tag:

2004-08-26

2004-08-26 16:14:24 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Added a few uses of DUP and SWAP.

Rev: src/peep.in:1.74

2:   // This file is part of Pike. For copyright information see COPYRIGHT.   // Pike is distributed under GPL, LGPL and MPL. See the file COPYING   // for more information. - // $Id: peep.in,v 1.73 2004/08/24 16:58:01 grubba Exp $ + // $Id: peep.in,v 1.74 2004/08/26 16:14:24 grubba Exp $      NOP :   POP_N_ELEMS (0) :
16:      MARK MARK: MARK2   MARK POP_MARK: + SWAP SWAP: + DUP POP_VALUE: + DUP POP_N_ELEMS [$2a > 0]: POP_N_ELEMS($2a-1)   // The opcode list is clearer without this.   //SYNCH_MARK POP_SYNCH_MARK:   
178:   LE NOT: GT   GE NOT: LT    - LOCAL LOCAL [$3o != F_SIZEOF && $3o != F_INDEX ]: 2_LOCALS ($1a,$2a) - MARK LOCAL [ $3o != F_SIZEOF && $3o != F_INDEX ]: MARK_AND_LOCAL ($2a) + LOCAL LOCAL : 2_LOCALS ($1a,$2a) + MARK LOCAL : MARK_AND_LOCAL ($2a)   MARK GLOBAL: MARK_AND_GLOBAL ($2a)   MARK STRING : MARK_AND_STRING($2a)   MARK EXTERNAL : MARK_AND_EXTERNAL($2a,$2b)   MARK CONST0 : MARK_AND_CONST0   MARK CONST1 : MARK_AND_CONST1   LOCAL SIZEOF: SIZEOF_LOCAL ($1a) -  + MARK_AND_LOCAL SIZEOF: MARK SIZEOF_LOCAL ($1a) + 2_LOCALS SIZEOF: LOCAL($1a) SIZEOF_LOCAL ($1b)   STRING INDEX: STRING_INDEX ($1a)   INDEX SWITCH: SWITCH_ON_INDEX($2a)   LOCAL SWITCH: SWITCH_ON_LOCAL($1a,$2a) -  + 2_LOCALS SWITCH: LOCAL($1a) SWITCH_ON_LOCAL($1b,$2a)      STRING CLEAR_STRING_SUBTYPE: STRING ($1a)   CONST0 CLEAR_STRING_SUBTYPE: CONST0
199:      LOCAL INDEX: LOCAL_INDEX ($1a)   LOCAL CLEAR_STRING_SUBTYPE INDEX: LOCAL_INDEX ($1a) + MARK_AND_LOCAL INDEX: MARK LOCAL_INDEX ($1a) + MARK_AND_LOCAL CLEAR_STRING_SUBTYPE INDEX: MARK LOCAL_INDEX ($1a) + 2_LOCALS INDEX: LOCAL_LOCAL_INDEX($1b,$1a) + 2_LOCALS CLEAR_STRING_SUBTYPE INDEX: LOCAL_LOCAL_INDEX($1b,$1a)    - LOCAL LOCAL INDEX: LOCAL_LOCAL_INDEX($2a,$1a) - LOCAL LOCAL CLEAR_STRING_SUBTYPE INDEX: LOCAL_LOCAL_INDEX($2a,$1a) + 2_LOCALS [$1a == $1b]: LOCAL($1a) DUP + GLOBAL GLOBAL($1a): GLOBAL($1a) DUP      CONST0 INDEX: POS_INT_INDEX (0)   CONST_1 INDEX: NEG_INT_INDEX (1)
250:   // ADD_INT ADD_NEG_INT [$2a <= $1a]: ADD_INT ($1a-$2a)   // ADD_INT ADD_NEG_INT [$2a > $1a]: ADD_NEG_INT ($2a-$1a)    - CONST0 ADD_INT : NUMBER ($2a) - CONST0 ADD_NEG_INT : NEG_NUMBER($2a) -  +    // FIXME: BIGNUMS?   //   // NUMBER ADD_INT : NUMBER ($1a+$2a)
308:   CONST0 GLOBAL ADD_INTS : GLOBAL($2a)   CONST0 GLOBAL NEGATE ADD_INTS : GLOBAL($2a) NEGATE    + LOCAL ADD_INT LOCAL($1a) : LOCAL($1a) DUP ADD_INT($2a) SWAP + GLOBAL ADD_INT GLOBAL($1a) : GLOBAL($1a) DUP ADD_INT($2a) SWAP + LOCAL ADD_NEG_INT LOCAL($1a) : LOCAL($1a) DUP ADD_NEG_INT($2a) SWAP + GLOBAL ADD_NEG_INT GLOBAL($1a) : GLOBAL($1a) DUP ADD_NEG_INT($2a) SWAP +    LOCAL BRANCH_WHEN_NON_ZERO : BRANCH_IF_LOCAL($1a) POINTER($2a)   LOCAL BRANCH_WHEN_ZERO : BRANCH_IF_NOT_LOCAL($1a) POINTER($2a)   
345:   INC_LOCAL_AND_POP MARK_AND_LOCAL ($1a) : INC_LOCAL ($1a) MARK_X(1)   ASSIGN_GLOBAL_AND_POP MARK GLOBAL($1a) : ASSIGN_GLOBAL($1a) MARK_X(1)   ASSIGN_LOCAL_AND_POP MARK_AND_LOCAL($1a) : ASSIGN_LOCAL($1a) MARK_X(1) + ASSIGN_LOCAL_AND_POP NUMBER LOCAL($1a) : ASSIGN_LOCAL($1a) NUMBER($2a) SWAP + ASSIGN_LOCAL_AND_POP STRING LOCAL($1a) : ASSIGN_LOCAL($1a) STRING($2a) SWAP + ASSIGN_LOCAL_AND_POP MARK_AND_STRING LOCAL($1a) : ASSIGN_LOCAL($1a) STRING($2a) SWAP MARK_X(2) +    #ifdef EAT_STACK   APPLY_ASSIGN_LOCAL_AND_POP MARK_AND_LOCAL ($1b) : APPLY_ASSIGN_LOCAL($1a,$1b) MARK_X(1)   #endif
413:   LTOSVAL MARK_X [$2a>0] : MARK_X($2a-1) LTOSVAL   LOCAL_LVALUE MARK_X [$2a>1] : MARK_X($2a-2) LOCAL_LVALUE($1a)   2_LOCALS MARK_X [$2a>0] : LOCAL($1a) MARK_X($2a-1) LOCAL($1b) + SWAP MARK_X : MARK_X($2a) SWAP + DUP MARK_X [$2a>0] : MARK_X($2a-1) DUP      CONST_1 ASSIGN_LOCAL MARK_X [$3a>0] : MARK_X($3a-1) CONST_1 ASSIGN_LOCAL($2a)   CONST1 ASSIGN_LOCAL MARK_X [$3a>0] : MARK_X($3a-1) CONST1 ASSIGN_LOCAL($2a)