pike.git / src / peep.in

version» Context lines:

pike.git/src/peep.in:1:   // -*- c -*-   // 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) :   POP_N_ELEMS POP_VALUE : POP_N_ELEMS ($1a + 1)   POP_VALUE POP_VALUE : POP_N_ELEMS (2)   POP_VALUE POP_N_ELEMS : POP_N_ELEMS ($2a + 1)   POP_N_ELEMS POP_N_ELEMS : POP_N_ELEMS ($1a + $2a)   POP_N_ELEMS(1) : POP_VALUE   POP_VALUE POP_TO_MARK : POP_TO_MARK   POP_N_ELEMS POP_TO_MARK : POP_TO_MARK      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:      ASSIGN_GLOBAL POP_VALUE : ASSIGN_GLOBAL_AND_POP($1a)   ASSIGN_LOCAL POP_VALUE : ASSIGN_LOCAL_AND_POP($1a)   RECUR POP_VALUE : RECUR_AND_POP($1a)      // Negation and complement of constants.   NUMBER(0) : CONST0   NUMBER(1) : CONST1
pike.git/src/peep.in:171:   EQ LOR: EQ_OR ($2a)   EQ LAND: EQ_AND ($2a)      EQ NOT: NE   NE NOT: EQ   LT NOT: GE   GT NOT: LE   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   CONST1 CLEAR_STRING_SUBTYPE: CONST1   CONST_1 CLEAR_STRING_SUBTYPE: CONST_1   NUMBER CLEAR_STRING_SUBTYPE: NUMBER($1a)   NEG_NUMBER CLEAR_STRING_SUBTYPE: NEG_NUMBER($1a)      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)   CONST1 INDEX: POS_INT_INDEX (1)   NUMBER INDEX: POS_INT_INDEX ($1a)   NEG_NUMBER INDEX: NEG_INT_INDEX ($1a)      BRANCH_WHEN_ZERO BRANCH LABEL ($1a): BRANCH_WHEN_NON_ZERO($2a) LABEL($1a)   BRANCH_WHEN_NON_ZERO BRANCH LABEL ($1a): BRANCH_WHEN_ZERO($2a) LABEL($1a)   
pike.git/src/peep.in:243:   // This set of optimizations is broken. Consider the case:   // STRING ADD_INT ADD_INT   //   // ADD_INT ADD_INT: ADD_INT ($1a+$2a)   // ADD_NEG_INT ADD_NEG_INT: ADD_NEG_INT ($1a+$2a)   // ADD_NEG_INT ADD_INT [$1a <= $2a]: ADD_INT ($2a-$1a)   // ADD_NEG_INT ADD_INT [$1a > $2a]: ADD_NEG_INT ($1a-$2a)   // 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)   // NUMBER ADD_NEG_INT : NUMBER ($1a-$2a)   // CONST1 ADD_INT : NUMBER(1+$2a)   // CONST1 ADD_NEG_INT : NUMBER(1-$2a)   // CONST_1 ADD_INT : NUMBER($2a-1)   // CONST_1 ADD_NEG_INT : NUMBER(-(1+$2a))      LTOSVAL2 ADD ASSIGN : ADD_TO
pike.git/src/peep.in:301:   CONST0 ADD_NEG_INT : NEG_NUMBER($2a)   CONST1 ADD_INT [($2a+1) > 0] : NUMBER($2a+1)   CONST1 ADD_NEG_INT : NEG_NUMBER($2a-1)   CONST_1 ADD_INT : NUMBER($2a-1)   CONST_1 ADD_NEG_INT [($2a+1) > 0] : NEG_NUMBER($2a)   CONST0 LOCAL ADD_INTS : LOCAL($2a)   CONST0 LOCAL NEGATE ADD_INTS : LOCAL($2a) NEGATE   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)      // Branches that jump to the next instruction   // Basic branches   BRANCH LABEL($1a) : LABEL($1a)   BRANCH_WHEN_ZERO LABEL($1a) : POP_VALUE LABEL($1a)   BRANCH_WHEN_NON_ZERO LABEL($1a) : POP_VALUE LABEL($1a)   BRANCH_WHEN_EQ LABEL($1a) : POP_VALUE POP_VALUE LABEL($1a)   BRANCH_WHEN_NE LABEL($1a) : POP_VALUE POP_VALUE LABEL($1a)
pike.git/src/peep.in:338:   ASSIGN_LOCAL_AND_POP LOCAL($1a) : ASSIGN_LOCAL($1a)   ASSIGN_GLOBAL_AND_POP GLOBAL($1a) : ASSIGN_GLOBAL($1a)   #ifdef EAT_STACK   APPLY_ASSIGN_LOCAL_AND_POP LOCAL ($1b) : APPLY_ASSIGN_LOCAL($1a,$1b)   #endif      DEC_LOCAL_AND_POP MARK_AND_LOCAL ($1a) : DEC_LOCAL ($1a) MARK_X(1)   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      ASSIGN_LOCAL ASSIGN_LOCAL($1a) : ASSIGN_LOCAL($1a)      #if 0   // The following set of rules attempt to push the mark toward the apply.   // The idea is to push it the entire way, to be able to have an apply   // opcode that contains the stack depth, and thus doesn't need the mark
pike.git/src/peep.in:406:   CONST_1 MARK_X [$2a>0] : MARK_X($2a-1) CONST_1   NEG_NUMBER MARK_X [$2a>0] : MARK_X($2a-1) NEG_NUMBER($1a)   GLOBAL MARK_X [$2a>0] : MARK_X($2a-1) GLOBAL($1a)   MARK_APPLY MARK_X [$2a>0] : MARK_X($2a-1) MARK_APPLY($1a)   CONSTANT MARK_X [$2a>0] : MARK_X($2a-1) CONSTANT($1a)   //FLOAT MARK_X [$2a>0] : MARK_X($2a-1) FLOAT($1a)   LFUN MARK_X [$2a>0] : MARK_X($2a-1) LFUN($1a)   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)   NUMBER ASSIGN_LOCAL MARK_X [$3a>0] : MARK_X($3a-1) NUMBER($1a) ASSIGN_LOCAL($2a)   NEG_NUMBER ASSIGN_LOCAL MARK_X [$3a>0] : MARK_X($3a-1) NEG_NUMBER($1a) ASSIGN_LOCAL($2a)      #endif /* 0 */      MARK_X [$1a>0] POP_VALUE : POP_VALUE MARK_X($1a-1)   MARK_X POP_N_ELEMS [$1a >= $2a] : POP_N_ELEMS($2a) MARK_X($1a-$2a)