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

6:   /**/   #include "global.h"   #include <math.h> - RCSID("$Id: operators.c,v 1.91 2000/04/20 02:41:45 hubbe Exp $"); + RCSID("$Id: operators.c,v 1.92 2000/05/01 03:33:47 hubbe Exp $");   #include "interpret.h"   #include "svalue.h"   #include "multiset.h"
428:      static int generate_sum(node *n)   { +  node **first_arg, **second_arg;    switch(count_args(CDR(n)))    {    case 1:
435:    return 1;       case 2: +  first_arg=my_get_arg(&_CDR(n), 0); +  second_arg=my_get_arg(&_CDR(n), 1); +     do_docode(CDR(n),DO_NOT_COPY); -  +  if(first_arg[0]->type == float_type_string && +  second_arg[0]->type == float_type_string) +  { +  emit0(F_ADD_FLOATS); +  } +  else if(first_arg[0]->type == int_type_string && +  second_arg[0]->type == int_type_string) +  { +  emit0(F_ADD_INTS); +  } +  else +  {    emit0(F_ADD); -  +  }    return 1;       default: