Branch: Tag:

2014-12-04

2014-12-04 19:27:12 by Per Hedbor <ph@opera.com>

Optimized branch optimization somewhat.

204:   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) - // - // This one is not safe. - // 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) - LE BRANCH_WHEN_NON_ZERO: BRANCH_WHEN_LE ($2a) - GE BRANCH_WHEN_NON_ZERO: BRANCH_WHEN_GE ($2a) -  - EQ BRANCH_WHEN_ZERO: BRANCH_WHEN_NE ($2a) - NE BRANCH_WHEN_ZERO: BRANCH_WHEN_EQ ($2a) - // The following only work on total orders. We can't assume that. - // LT BRANCH_WHEN_ZERO: BRANCH_WHEN_GE ($2a) - // GT BRANCH_WHEN_ZERO: BRANCH_WHEN_LE ($2a) - // LE BRANCH_WHEN_ZERO: BRANCH_WHEN_GT ($2a) - // GE BRANCH_WHEN_ZERO: BRANCH_WHEN_LT ($2a) -  +    EQ LOR: EQ_OR ($2a)   EQ LAND: EQ_AND ($2a)   
392:   GE BRANCH_WHEN_ZERO : GE QUICK_BRANCH_WHEN_ZERO($2a)   LT BRANCH_WHEN_ZERO : LT QUICK_BRANCH_WHEN_ZERO($2a)   LE BRANCH_WHEN_ZERO : LE QUICK_BRANCH_WHEN_ZERO($2a) + NE BRANCH_WHEN_ZERO : NE QUICK_BRANCH_WHEN_ZERO($2a) + EQ BRANCH_WHEN_ZERO : EQ QUICK_BRANCH_WHEN_ZERO($2a) +    SIZEOF BRANCH_WHEN_ZERO : SIZEOF($1a) QUICK_BRANCH_WHEN_ZERO($2a)   SIZEOF_LOCAL BRANCH_WHEN_ZERO : SIZEOF_LOCAL($1a) QUICK_BRANCH_WHEN_ZERO($2a)   
399:   GE BRANCH_WHEN_NON_ZERO : GE QUICK_BRANCH_WHEN_NON_ZERO($2a)   LT BRANCH_WHEN_NON_ZERO : LT QUICK_BRANCH_WHEN_NON_ZERO($2a)   LE BRANCH_WHEN_NON_ZERO : LE QUICK_BRANCH_WHEN_NON_ZERO($2a) + NE BRANCH_WHEN_NON_ZERO : NE QUICK_BRANCH_WHEN_NON_ZERO($2a) + EQ BRANCH_WHEN_NON_ZERO : EQ QUICK_BRANCH_WHEN_NON_ZERO($2a) +    SIZEOF BRANCH_WHEN_NON_ZERO : SIZEOF($1a) QUICK_BRANCH_WHEN_NON_ZERO($2a)   SIZEOF_LOCAL BRANCH_WHEN_NON_ZERO : SIZEOF_LOCAL($1a) QUICK_BRANCH_WHEN_NON_ZERO($2a)   
568:   LOCAL ASSIGN_GLOBAL_AND_POP : LOCAL_2_GLOBAL($2a,$1a)      ASSIGN_PRIVATE_GLOBAL_AND_POP PRIVATE_GLOBAL($1a) : ASSIGN_PRIVATE_GLOBAL($1a) + ASSIGN_PRIVATE_TYPED_GLOBAL_AND_POP PRIVATE_TYPED_GLOBAL($1a) : ASSIGN_PRIVATE_TYPED_GLOBAL($1a,$1b)   ASSIGN_GLOBAL_AND_POP GLOBAL($1a) : ASSIGN_GLOBAL($1a)   ASSIGN_LOCAL_AND_POP LOCAL($1a) : ASSIGN_LOCAL($1a)   
589:   //FLOAT POP_VALUE :   CONSTANT POP_VALUE :   LOCAL POP_VALUE : - IDENTIFIER POP_VALUE : + PRIVATE_GLOBAL POP_VALUE : + PRIVATE_TYPED_GLOBAL POP_VALUE :   TRAMPOLINE POP_VALUE :      RECUR RETURN [check_tailrecursion()] : TAIL_RECUR ($1a)      // This doesn't really work - // MARK TAIL_RECUR : BRANCH ($1a) + // MARK TAIL_RECUR : 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) + // + // This one is not safe. + // CONST0 EQ: NOT    -  + BRANCH_WHEN_EQ: EQ QUICK_BRANCH_WHEN_NON_ZERO($1a) + BRANCH_WHEN_NE: EQ QUICK_BRANCH_WHEN_ZERO($1a) + BRANCH_WHEN_LT: LT QUICK_BRANCH_WHEN_NON_ZERO($1a) + BRANCH_WHEN_GT: GT QUICK_BRANCH_WHEN_NON_ZERO($1a) + BRANCH_WHEN_LE: LE QUICK_BRANCH_WHEN_NON_ZERO($1a) + BRANCH_WHEN_GE: GE QUICK_BRANCH_WHEN_NON_ZERO($1a) +    ASSIGN_LOCAL BRANCH_WHEN_ZERO 2_LOCALS(,$1a) BRANCH_WHEN_EQ : ASSIGN_LOCAL($1a) BRANCH_AND_POP_WHEN_ZERO($2a) LOCAL($3a) BRANCH_WHEN_EQ($4a)   ASSIGN_LOCAL BRANCH_WHEN_ZERO 2_LOCALS(,$1a) BRANCH_WHEN_NE : ASSIGN_LOCAL($1a) BRANCH_AND_POP_WHEN_ZERO($2a) LOCAL($3a) BRANCH_WHEN_NE($4a)   
607:   CLEAR_LOCAL MARK LOCAL($1a) : MARK CLEAR_LOCAL($1a) CONST0       -  +    #define LOW_MKCALLOPTS(A) \   A POP_VALUE: A##_AND_POP($1a); \   A [ check_tailrecursion() ] RETURN : A##_AND_RETURN($1a) ; \