Branch: Tag:

2000-05-01

2000-05-01 03:33:47 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

more optimizations (fairly minor)

Rev: src/docode.c:1.72
Rev: src/interpret_functions.h:1.20
Rev: src/language.yacc:1.183
Rev: src/operators.c:1.92
Rev: src/peep.in:1.36

5:   \*/   /**/   #include "global.h" - RCSID("$Id: docode.c,v 1.71 2000/05/01 02:11:25 hubbe Exp $"); + RCSID("$Id: docode.c,v 1.72 2000/05/01 03:33:45 hubbe Exp $");   #include "las.h"   #include "program.h"   #include "language.h"
389:    fatal("HELP! FATAL INTERNAL COMPILER ERROR (7)\n");   #endif    +  if(n->token == F_ADD_EQ && (flags & DO_POP)) +  { +  code_expression(CDR(n), 0, "assignment"); +  emit0(F_ADD_TO_AND_POP); +  return 0; +  } +     if(match_types(CAR(n)->type,array_type_string) ||    match_types(CAR(n)->type,string_type_string) ||    match_types(CAR(n)->type,mapping_type_string) ||
404:       switch(n->token)    { -  case F_ADD_EQ: emit0(F_ADD); break; +  case F_ADD_EQ: +  if(CAR(n)->type == int_type_string && +  CDR(n)->type == int_type_string) +  { +  emit0(F_ADD_INTS); +  } +  else if(CAR(n)->type == float_type_string && +  CDR(n)->type == float_type_string) +  { +  emit0(F_ADD_FLOATS); +  }else{ +  emit0(F_ADD); +  } +  break;    case F_AND_EQ: emit0(F_AND); break;    case F_OR_EQ: emit0(F_OR); break;    case F_XOR_EQ: emit0(F_XOR); break;