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.70 2004/04/30 20:42:05 grubba Exp $ + // $Id: peep.in,v 1.71 2004/08/23 14:03:36 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:   // 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   NUMBER(-1) : CONST_1   NUMBER (0x7fffffff) : BIGNUM   CONST0 NEGATE : CONST0   CONST1 NEGATE : CONST_1   CONST_1 NEGATE : CONST1   NUMBER NEGATE : NEG_NUMBER($1a) - NUMBER [$1a < 0 && (-$1a)>0] : NEG_NUMBER (-$1a) +    NEG_NUMBER NEGATE : NUMBER ($1a) -  + NUMBER [$1a < 0 && (-$1a)>0] : NEG_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) -  + CONST0 ASSIGN_LOCAL: CLEAR_LOCAL($2a) CONST0      LOCAL_2_LOCAL [$1a == $1b] : -  + GLOBAL ASSIGN_GLOBAL_AND_POP($1a) :    -  +    // Remove clearing of locals from the beginning of functions   // But don't remove clearing of arguments!   BYTE ENTRY START_FUNCTION LABEL(0) CLEAR_LOCAL [$1a <= $5a] : BYTE($1a) ENTRY START_FUNCTION LABEL(0)   BYTE ENTRY START_FUNCTION LABEL(0) CLEAR_2_LOCAL [$1a <= $5a] : BYTE($1a) ENTRY START_FUNCTION LABEL(0)   BYTE ENTRY START_FUNCTION LABEL(0) CLEAR_4_LOCAL [$1a <= $5a] : BYTE($1a) ENTRY START_FUNCTION LABEL(0)      BYTE ENTRY START_FUNCTION CLEAR_LOCAL [$1a <= $4a] : BYTE($1a) ENTRY START_FUNCTION   BYTE ENTRY START_FUNCTION CLEAR_2_LOCAL [$1a <= $4a] : BYTE($1a) ENTRY START_FUNCTION   BYTE ENTRY START_FUNCTION CLEAR_4_LOCAL [$1a <= $4a] : BYTE($1a) ENTRY START_FUNCTION    - CLEAR_LOCAL NUMBER(0) ASSIGN_LOCAL_AND_POP ($1a) : CLEAR_LOCAL($1a) - CLEAR_LOCAL NUMBER(0) ASSIGN_LOCAL_AND_POP ($1a+1) : CLEAR_2_LOCAL($1a) + CLEAR_LOCAL CLEAR_LOCAL($1a) : CLEAR_LOCAL($1a) + CLEAR_LOCAL CLEAR_LOCAL($1a+1) : CLEAR_2_LOCAL($1a)   CLEAR_2_LOCAL CLEAR_2_LOCAL($1a+2) : CLEAR_4_LOCAL($1a)      // CONST_1 MULTIPLY : NEGATE   // CONST0 MULTIPLY : POP_VALUE CONST0   // CONST1 MULTIPLY :   // NUMBER MULTIPLY [!($1a & ($1a - 1))]: NUMBER(my_log2($1a)) LSH      // CONST_1 DIVIDE : NEGATE   // CONST1 DIVIDE :   // NUMBER DIVIDE [!($1a & ($1a - 1))]: NUMBER(my_log2($1a)) RSH
pike.git/src/peep.in:104:   LOCAL_LVALUE INC_AND_POP : INC_LOCAL_AND_POP ($1a)   INC_LOCAL POP_VALUE : INC_LOCAL_AND_POP ($1a)   POST_INC_LOCAL POP_VALUE : INC_LOCAL_AND_POP ($1a)      LOCAL_LVALUE DEC : DEC_LOCAL ($1a)   LOCAL_LVALUE POST_DEC : POST_DEC_LOCAL ($1a)   LOCAL_LVALUE DEC_AND_POP : DEC_LOCAL_AND_POP ($1a)   DEC_LOCAL POP_VALUE : DEC_LOCAL_AND_POP ($1a)   POST_DEC_LOCAL POP_VALUE : DEC_LOCAL_AND_POP ($1a)    - ASSIGN_LOCAL_AND_POP LOCAL ($1a) RETURN: ASSIGN_LOCAL($1a) RETURN - ASSIGN_LOCAL_AND_POP LOCAL ($1a) VOLATILE_RETURN: ASSIGN_LOCAL($1a) VOLATILE_RETURN - ASSIGN_LOCAL_AND_POP LOCAL ($1a) RETURN [!(Pike_compiler->compiler_frame->lexical_scope & SCOPE_SCOPED)]: RETURN - ASSIGN_LOCAL_AND_POP LOCAL ($1a) VOLATILE_RETURN [!(Pike_compiler->compiler_frame->lexical_scope & SCOPE_SCOPED)]: VOLATILE_RETURN + ASSIGN_LOCAL RETURN [!(Pike_compiler->compiler_frame->lexical_scope & SCOPE_SCOPED)]: RETURN + ASSIGN_LOCAL VOLATILE_RETURN [!(Pike_compiler->compiler_frame->lexical_scope & SCOPE_SCOPED)]: VOLATILE_RETURN      ASSIGN_LOCAL BRANCH_WHEN_ZERO LOCAL($1a) RETURN LABEL($2a): ASSIGN_LOCAL($1a) RETURN_IF_TRUE LABEL($2a)   ASSIGN_LOCAL BRANCH_WHEN_ZERO LOCAL($1a) VOLATILE_RETURN LABEL($2a): ASSIGN_LOCAL($1a) RETURN_IF_TRUE LABEL($2a)      ASSIGN_LOCAL BRANCH_WHEN_ZERO LOCAL($1a) RETURN LABEL($2a) [!(Pike_compiler->compiler_frame->lexical_scope & SCOPE_SCOPED)] : RETURN_IF_TRUE ASSIGN_LOCAL($1a) LABEL($2a)   ASSIGN_LOCAL BRANCH_WHEN_ZERO LOCAL($1a) VOLATILE_RETURN LABEL($2a) [!(Pike_compiler->compiler_frame->lexical_scope & SCOPE_SCOPED)] : RETURN_IF_TRUE ASSIGN_LOCAL($1a) LABEL($2a)      ASSIGN_GLOBAL BRANCH_WHEN_ZERO GLOBAL($1a) RETURN LABEL($2a): ASSIGN_GLOBAL($1a) RETURN_IF_TRUE LABEL($2a)   ASSIGN_GLOBAL BRANCH_WHEN_ZERO GLOBAL($1a) VOLATILE_RETURN LABEL($2a): ASSIGN_GLOBAL($1a) RETURN_IF_TRUE LABEL($2a)         GLOBAL_LVALUE INC_AND_POP GLOBAL($1a): GLOBAL_LVALUE($1a) INC   GLOBAL_LVALUE DEC_AND_POP GLOBAL($1a): GLOBAL_LVALUE($1a) DEC      CONST1 BRANCH_WHEN_ZERO:   CONST0 BRANCH_WHEN_ZERO: BRANCH($2a)   CONST1 BRANCH_WHEN_NON_ZERO: BRANCH($2a)   CONST0 BRANCH_WHEN_NON_ZERO: -  + NUMBER [$1a] BRANCH_WHEN_ZERO: + NUMBER [$1a] BRANCH_WHEN_NON_ZERO: BRANCH($2a)      // These optimizations are now handled in optimize_eq   // CONST0 BRANCH_WHEN_EQ: BRANCH_WHEN_ZERO($2a)   // CONST0 BRANCH_WHEN_NE: BRANCH_WHEN_NON_ZERO($2a)   // CONST0 EQ: NOT      EQ BRANCH_WHEN_NON_ZERO: BRANCH_WHEN_EQ ($2a)   NE BRANCH_WHEN_NON_ZERO: BRANCH_WHEN_NE ($2a)   LT BRANCH_WHEN_NON_ZERO: BRANCH_WHEN_LT ($2a)   GT BRANCH_WHEN_NON_ZERO: BRANCH_WHEN_GT ($2a)
pike.git/src/peep.in:184:      LOCAL INDEX: LOCAL_INDEX ($1a)   LOCAL CLEAR_STRING_SUBTYPE INDEX: LOCAL_INDEX ($1a)      LOCAL LOCAL INDEX: LOCAL_LOCAL_INDEX($2a,$1a)   LOCAL LOCAL CLEAR_STRING_SUBTYPE INDEX: LOCAL_LOCAL_INDEX($2a,$1a)      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)    - NUMBER [$1a < 0 && ($1a != -$1a)] INDEX: NEG_INT_INDEX (-$1a) - NUMBER [$1a >= 0] INDEX: POS_INT_INDEX ($1a) - NEG_NUMBER [$1a >= 0] INDEX: NEG_INT_INDEX ($1a) - NEG_NUMBER [$1a < 0 && ($1a != -$1a)] INDEX: POS_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)      BRANCH_WHEN_EQ BRANCH LABEL ($1a) : BRANCH_WHEN_NE($2a) LABEL($1a)   BRANCH_WHEN_NE BRANCH LABEL ($1a) : BRANCH_WHEN_EQ($2a) LABEL($1a)      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 [$1a >= 0] ADD_INTS : ADD_INT ($1a) - NUMBER [$1a < 0 && ($1a != -$1a)] ADD_INTS : ADD_NEG_INT (-$1a) + NUMBER ADD_INTS : ADD_INT ($1a) + NEG_NUMBER ADD_INTS : ADD_NEG_INT ($1a)      CONST0 ADD: ADD_INT (0)   CONST1 ADD: ADD_INT (1)   CONST_1 ADD: ADD_NEG_INT (1) - NUMBER [$1a >= 0] ADD : ADD_INT ($1a) - NUMBER [$1a < 0 && ($1a != -$1a) ] ADD : ADD_NEG_INT (-$1a) + NUMBER ADD : ADD_INT ($1a) + NEG_NUMBER ADD : ADD_NEG_INT ($1a)      CONST0 SUBTRACT: ADD_INT (0)   CONST1 SUBTRACT: ADD_NEG_INT (-1)   CONST_1 SUBTRACT: ADD_INT (1) - NUMBER [$1a >= 0] SUBTRACT : ADD_NEG_INT ($1a) - NUMBER [$1a < 0 && ($1a != -$1a)] SUBTRACT : ADD_INT (-$1a) + NUMBER SUBTRACT : ADD_NEG_INT ($1a) + NEG_NUMBER 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)      CONST0 ADD_INT : NUMBER ($2a) - CONST0 ADD_NEG_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))   
pike.git/src/peep.in:443:      #if 1   OPT_TYPEP(f_intp, T_INT)   OPT_TYPEP(f_stringp, T_STRING)   OPT_TYPEP(f_arrayp, T_ARRAY)   OPT_TYPEP(f_floatp, T_FLOAT)   OPT_TYPEP(f_mappingp, T_MAPPING)   OPT_TYPEP(f_multisetp, T_MULTISET)   #endif    + // Move lvalues up on the stack. + NUMBER ASSIGN_LOCAL_AND_POP LOCAL_LVALUE: LOCAL_LVALUE($3a) NUMBER($1a) ASSIGN_LOCAL_AND_POP($2a) + NEG_NUMBER ASSIGN_LOCAL_AND_POP LOCAL_LVALUE: LOCAL_LVALUE($3a) NEG_NUMBER($1a) ASSIGN_LOCAL_AND_POP($2a) + 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 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 +