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.71 2004/08/23 14:03:36 grubba Exp $ + // $Id: peep.in,v 1.72 2004/08/24 14:15:21 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
pike.git/src/peep.in:27:   NUMBER(0) : CONST0   NUMBER(1) : CONST1   NUMBER(-1) : CONST_1   NUMBER (0x7fffffff) : BIGNUM   CONST0 NEGATE : CONST0   CONST1 NEGATE : CONST_1   CONST_1 NEGATE : CONST1   NUMBER NEGATE : NEG_NUMBER($1a)   NEG_NUMBER NEGATE : NUMBER ($1a)   NUMBER [$1a < 0 && (-$1a)>0] : NEG_NUMBER (-$1a) - NEG_NUMBER [$1a < 0 && (-$1a)>0] : NUMBER (-$1a) + NEG_NUMBER [$1a <= 0 && (-$1a)>=0] : NUMBER (-$1a)   NEGATE NEGATE :   COMPL COMPL :   NEGATE CONST_1 ADD_INTS : COMPL   NEGATE CONST1 SUBTRACT : COMPL   NUMBER ASSIGN_LOCAL NEGATE: NUMBER($1a) ASSIGN_LOCAL_AND_POP($2a) NEG_NUMBER($1a)   NEG_NUMBER ASSIGN_LOCAL NEGATE: NEG_NUMBER($1a) ASSIGN_LOCAL_AND_POP($2a) NUMBER($1a)   CONST1 ASSIGN_LOCAL NEGATE: CONST1 ASSIGN_LOCAL_AND_POP($2a) CONST_1   CONST_1 ASSIGN_LOCAL NEGATE: CONST_1 ASSIGN_LOCAL_AND_POP($2a) CONST1      CONST0 ASSIGN_LOCAL_AND_POP : CLEAR_LOCAL($2a)
pike.git/src/peep.in:213:   BRANCH_WHEN_LT BRANCH LABEL ($1a) : BRANCH_WHEN_GE($2a) LABEL($1a)   BRANCH_WHEN_GE BRANCH LABEL ($1a) : BRANCH_WHEN_LT($2a) LABEL($1a)      BRANCH_WHEN_LE BRANCH LABEL ($1a) : BRANCH_WHEN_GT($2a) LABEL($1a)   BRANCH_WHEN_GT BRANCH LABEL ($1a) : BRANCH_WHEN_LE($2a) LABEL($1a)         CONST0 ADD_INTS: ADD_INT (0)   CONST1 ADD_INTS: ADD_INT (1)   CONST_1 ADD_INTS: ADD_NEG_INT (1) - NUMBER ADD_INTS : ADD_INT ($1a) - NEG_NUMBER ADD_INTS : ADD_NEG_INT ($1a) + NUMBER [$1a >= 0] ADD_INTS : ADD_INT ($1a) + NEG_NUMBER [$1a > 0] ADD_INTS : ADD_NEG_INT ($1a)      CONST0 ADD: ADD_INT (0)   CONST1 ADD: ADD_INT (1)   CONST_1 ADD: ADD_NEG_INT (1) - NUMBER ADD : ADD_INT ($1a) - NEG_NUMBER ADD : ADD_NEG_INT ($1a) + NUMBER [$1a >= 0] ADD : ADD_INT ($1a) + NEG_NUMBER [$1a > 0] ADD : ADD_NEG_INT ($1a)      CONST0 SUBTRACT: ADD_INT (0) - CONST1 SUBTRACT: ADD_NEG_INT (-1) + CONST1 SUBTRACT: ADD_NEG_INT (1)   CONST_1 SUBTRACT: ADD_INT (1) - NUMBER SUBTRACT : ADD_NEG_INT ($1a) - NEG_NUMBER SUBTRACT : ADD_INT ($1a) + NUMBER [$1a >= 0] SUBTRACT : ADD_NEG_INT ($1a) + NEG_NUMBER [$1a > 0] SUBTRACT : ADD_INT ($1a)      // 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)
pike.git/src/peep.in:285:   ASSIGN_LOCAL_AND_POP DEC_LOCAL($1a) : ADD_NEG_INT(1) ASSIGN_LOCAL($1a)      LOCAL RETURN : RETURN_LOCAL($1a)   LOCAL VOLATILE_RETURN : RETURN_LOCAL($1a)      NUMBER ADD_INT [ !INT_TYPE_ADD_OVERFLOW($1a, $2a) ] : NUMBER($1a+$2a)   NUMBER ADD_NEG_INT [ !INT_TYPE_SUB_OVERFLOW($1a, $2a) ]: NUMBER($1a-$2a)   NEG_NUMBER ADD_INT [ !INT_TYPE_ADD_OVERFLOW(-$1a, $2a) ]: NUMBER(-$1a+$2a)   NEG_NUMBER ADD_NEG_INT [ !INT_TYPE_SUB_OVERFLOW(-$1a, $2a) ]: NUMBER(-$1a-$2a)    + CONST0 ADD_INT : NUMBER($2a) + 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 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:318:      OPT_INCDEC(INC)   OPT_INCDEC(DEC)      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) : MARK DEC_LOCAL ($1a) - INC_LOCAL_AND_POP MARK_AND_LOCAL ($1a) : MARK INC_LOCAL ($1a) - ASSIGN_GLOBAL_AND_POP MARK GLOBAL($1a) : MARK_X(1) ASSIGN_GLOBAL($1a) - ASSIGN_LOCAL_AND_POP MARK_AND_LOCAL($1a) : MARK_X(1) ASSIGN_LOCAL($1a) + 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)   #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 + // stack. +  + // MARK rules + MARK LOCAL : LOCAL($2a) MARK_X(1) + MARK STRING : STRING($2a) MARK_X(1) + MARK NUMBER : NUMBER($2a) MARK_X(1) + MARK CONST0 : CONST0 MARK_X(1) + MARK CONST1 : CONST1 MARK_X(1) + MARK CONST_1 : CONST_1 MARK_X(1) + MARK NEG_NUMBER : NEG_NUMBER($2a) MARK_X(1) + MARK GLOBAL : GLOBAL($2a) MARK_X(1) + MARK MARK_APPLY : MARK_APPLY($2a) MARK_X(1) + MARK CONSTANT : CONSTANT($2a) MARK_X(1) + //MARK FLOAT : FLOAT($2a) MARK_X(1) + MARK LFUN : LFUN($2a) MARK_X(1) + MARK LTOSVAL : LTOSVAL MARK_X(1) + MARK LOCAL_LVALUE : LOCAL_LVALUE($2a) MARK_X(2) + MARK 2_LOCALS : 2_LOCALS($2a,$2b) MARK_X(2) + MARK NEGATE : NEGATE MARK +    // MARK_X rules   MARK_X(0) : MARK -  + MARK_X LOCAL : LOCAL($2a) MARK_X($1a+1) + MARK_X STRING : STRING($2a) MARK_X($1a+1) + MARK_X NUMBER : NUMBER($2a) MARK_X($1a+1) + MARK_X CONST0 : CONST0 MARK_X($1a+1) + MARK_X CONST1 : CONST1 MARK_X($1a+1) + MARK_X CONST_1 : CONST_1 MARK_X($1a+1) + MARK_X NEG_NUMBER : NEG_NUMBER($2a) MARK_X($1a+1) + MARK_X GLOBAL : GLOBAL($2a) MARK_X($1a+1) + MARK_X MARK_APPLY : MARK_APPLY($2a) MARK_X($1a+1) + MARK_X CONSTANT : CONSTANT($2a) MARK_X($1a+1) + //MARK_X FLOAT : FLOAT($2a) MARK_X($1a+1) + MARK_X LFUN : LFUN($2a) MARK_X($1a+1) + MARK_X LTOSVAL : LTOSVAL MARK_X($1a+1) + MARK_X LOCAL_LVALUE : LOCAL_LVALUE($2a) MARK_X($1a+2) + MARK_X 2_LOCALS : 2_LOCALS($2a,$2b) MARK_X($1a+2) + MARK_X NEGATE : NEGATE MARK_X($1a) +  + #else /* !0 */ +  + // MARK_X rules + MARK_X(0) : MARK   LOCAL MARK_X [$2a>0] : MARK_X($2a-1) LOCAL($1a)   STRING MARK_X [$2a>0] : MARK_X($2a-1) STRING($1a)   NUMBER MARK_X [$2a>0] : MARK_X($2a-1) NUMBER($1a)   CONST0 MARK_X [$2a>0] : MARK_X($2a-1) CONST0   CONST1 MARK_X [$2a>0] : MARK_X($2a-1) CONST1   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)    -  + 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) +    #define BasicBranch2(Branch,Oper,Pre,Post,Variable) \    Variable Branch Pre Variable ($1a) : Variable ($1a) Oper ($2a) Post ; \    ASSIGN_##Variable Branch Pre Variable ($1a) : ASSIGN_##Variable($1a) Oper ($2a) Post ;      #define BasicBranch1(Branch,Oper,Pre,Post) \    BasicBranch2(Branch,Oper,Pre,Post,LOCAL) \    BasicBranch2(Branch,Oper,Pre,Post,GLOBAL)      #define BasicBranch0(Branch,Oper) \    BasicBranch1(Branch,Oper,MARK,MARK_X(1)) \
pike.git/src/peep.in:463:   CONST0 ASSIGN_LOCAL_AND_POP LOCAL_LVALUE: LOCAL_LVALUE($3a) CLEAR_LOCAL($2a)   CONST1 ASSIGN_LOCAL_AND_POP LOCAL_LVALUE: LOCAL_LVALUE($3a) CONST1 ASSIGN_LOCAL_AND_POP($2a)   CONST_1 ASSIGN_LOCAL_AND_POP LOCAL_LVALUE: LOCAL_LVALUE($3a) CONST_1 ASSIGN_LOCAL_AND_POP($2a)      // Move marks to where they're relevant.   MARK CLEAR_LOCAL: CLEAR_LOCAL($2a) MARK   MARK NUMBER ASSIGN_LOCAL_AND_POP: NUMBER($2a) ASSIGN_LOCAL_AND_POP($3a) MARK   MARK NUMBER ASSIGN_GLOBAL_AND_POP: NUMBER($2a) ASSIGN_GLOBAL_AND_POP($3a) MARK   MARK NEG_NUMBER ASSIGN_LOCAL_AND_POP: NEG_NUMBER($2a) ASSIGN_LOCAL_AND_POP($3a) MARK   MARK NEG_NUMBER ASSIGN_GLOBAL_AND_POP: NEG_NUMBER($2a) ASSIGN_GLOBAL_AND_POP($3a) MARK - MARK CONST1 ASSIGN_LOCAL_AND_POP: CONST1 ASSIGN_LOCAL_AND_POP($3a) MARK - MARK CONST1 ASSIGN_GLOBAL_AND_POP: CONST1 ASSIGN_GLOBAL_AND_POP($3a) MARK + MARK_AND_CONST1 ASSIGN_LOCAL_AND_POP: CONST1 ASSIGN_LOCAL_AND_POP($3a) MARK + MARK_AND_CONST1 ASSIGN_GLOBAL_AND_POP: CONST1 ASSIGN_GLOBAL_AND_POP($3a) MARK   MARK CONST_1 ASSIGN_LOCAL_AND_POP: CONST_1 ASSIGN_LOCAL_AND_POP($3a) MARK   MARK CONST_1 ASSIGN_GLOBAL_AND_POP: CONST_1 ASSIGN_GLOBAL_AND_POP($3a) MARK