Branch: Tag:

2013-01-08

2013-01-08 20:01:37 by Arne Goedeke <el@laramies.com>

optimizer: check for overflow more correctly

39:   CONST_1 NEGATE : CONST1   NUMBER NEGATE : NEG_NUMBER($1a)   NEG_NUMBER NEGATE : NUMBER ($1a) - NUMBER [(-$1a) > 0] : NEG_NUMBER (-$1a) - NEG_NUMBER [(-$1a) >= 0] : NUMBER (-$1a) + NUMBER [ $1a < 0 && !INT32_NEG_OVERFLOW($1a) ] : NEG_NUMBER (-$1a) + NEG_NUMBER [ $1a <= 0 && !INT32_NEG_OVERFLOW($1a) ] : NUMBER (-$1a)   NEGATE NEGATE :   COMPL COMPL :   NEGATE CONST_1 ADD_INTS : COMPL
277:   CONST1 INDEX: POS_INT_INDEX (1)   NUMBER INDEX: POS_INT_INDEX ($1a)   NEG_NUMBER INDEX: NEG_INT_INDEX ($1a) - POS_INT_INDEX [$1a < 0]: NEG_INT_INDEX (-$1a) - NEG_INT_INDEX [-$1a >= 0]: POS_INT_INDEX (-$1a) + POS_INT_INDEX [$1a < 0 && !INT32_NEG_OVERFLOW($1a) ]: NEG_INT_INDEX (-$1a) + NEG_INT_INDEX [$1a <= 0 && !INT32_NEG_OVERFLOW($1a) ]: 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)
365:      NUMBER ADD_INT [ !INT32_ADD_OVERFLOW($1a, $2a) ] : NUMBER($1a+$2a)   NUMBER ADD_NEG_INT [ !INT32_SUB_OVERFLOW($1a, $2a) ]: NUMBER($1a-$2a) - NEG_NUMBER ADD_INT [ !INT32_ADD_OVERFLOW(-$1a, $2a) ]: NUMBER(-$1a+$2a) - NEG_NUMBER ADD_NEG_INT [ !INT32_SUB_OVERFLOW(-$1a, $2a) ]: NUMBER(-$1a-$2a) + NEG_NUMBER ADD_INT [ !INT32_SUB_OVERFLOW($2a, $1a) ]: NUMBER($2a-$1a) + NEG_NUMBER ADD_NEG_INT [ !INT32_NEG_OVERFLOW($1a) && !INT32_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+1) + CONST1 ADD_INT [ !INT32_ADD_OVERFLOW($2a, 1) ] : NUMBER($2a+1) + CONST1 ADD_NEG_INT [ !INT32_SUB_OVERFLOW($2a, 1) ] : NEG_NUMBER($2a-1) + CONST_1 ADD_INT [ !INT32_SUB_OVERFLOW($2a, 1) ] : NUMBER($2a-1) + CONST_1 ADD_NEG_INT [ !INT32_ADD_OVERFLOW($2a, 1) && ($2a+1) > 0] : NEG_NUMBER($2a+1)   CONST0 LOCAL ADD_INTS : LOCAL($2a)   CONST0 LOCAL NEGATE ADD_INTS : LOCAL($2a) NEGATE   CONST0 GLOBAL ADD_INTS : GLOBAL($2a)