pike.git / src / code / sparc.c

version» Context lines:

pike.git/src/code/sparc.c:1:   /* -  * $Id: sparc.c,v 1.6 2001/07/21 16:30:50 grubba Exp $ +  * $Id: sparc.c,v 1.7 2001/07/24 12:19:31 grubba Exp $    *    * Machine code generator for sparc.    *    * Henrik Grubbström 20010720    */    -  + #include "operators.h" +    #define ADD_CALL(X, DELAY_OK) do { \    INT32 delta_; \    struct program *p_ = Pike_compiler->new_program; \    INT32 off_ = p_->num_program; \    /* noop */ \    INT32 delay_ = 0x01000000; \    \    if (DELAY_OK) { \    /* Move the previous opcode to the delay-slot. */ \    delay_ = p_->program[--off_]; \
pike.git/src/code/sparc.c:21:    } \    /* call X */ \    delta_ = ((PIKE_OPCODE_T *)(X)) - (p_->program + off_); \    p_->program[off_] = 0x40000000 | (delta_ & 0x3fffffff); \    add_to_relocations(off_); \    add_to_program(delay_); \    } while(0)      static void low_ins_f_byte(unsigned int b, int delay_ok)   { +  void *addr = instrs[b].address; +    #ifdef PIKE_DEBUG    if(store_linenumbers && b<F_MAX_OPCODE)    ADD_COMPILED(b);   #endif /* PIKE_DEBUG */       b-=F_OFFSET;   #ifdef PIKE_DEBUG    if(b>255)    Pike_error("Instruction too big %d\n",b);   #endif
pike.git/src/code/sparc.c:45:    if(last_prog_id != Pike_compiler->new_program->id ||    last_num_linenumbers != Pike_compiler->new_program->num_linenumbers)    {    last_prog_id=Pike_compiler->new_program->id;    last_num_linenumbers = Pike_compiler->new_program->num_linenumbers;    UPDATE_PC();    delay_ok = 1;    }    }    + #ifndef PIKE_DEBUG +  /* This is not very pretty */ +  switch(b) +  { +  case F_MAKE_ITERATOR - F_OFFSET: +  { +  extern void f_Iterator(INT32); +  SET_REG(SPARC_REG_O0, 1); +  delay_ok = 1; +  addr = (void *)f_Iterator; +  } +  break; +  case F_COMPL - F_OFFSET: addr=(void *)o_compl; break; +  case F_LSH - F_OFFSET: addr=(void *)o_lsh; break; +  case F_RSH - F_OFFSET: addr=(void *)o_rsh; break; +  case F_ADD - F_OFFSET: +  SET_REG(SPARC_REG_O0, 2); +  delay_ok = 1; +  addr = (void *)f_add; +  break; +  case F_SUBTRACT - F_OFFSET: addr = (void *)o_subtract; break; +  case F_AND - F_OFFSET: addr=(void *)o_and; break; +  case F_OR - F_OFFSET: addr=(void *)o_or; break; +  case F_XOR - F_OFFSET: addr=(void *)o_xor; break; +  case F_MULTIPLY - F_OFFSET: addr=(void *)o_multiply; break; +  case F_DIVIDE - F_OFFSET: addr=(void *)o_divide; break; +  case F_MOD - F_OFFSET: addr=(void *)o_mod; break; +  case F_CAST - F_OFFSET: addr = (void *)f_cast; break; +  case F_CAST_TO_INT - F_OFFSET: addr = (void *)o_cast_to_int; break; +  case F_CAST_TO_STRING - F_OFFSET: addr = (void *)o_cast_to_string; break; +  case F_RANGE - F_OFFSET: addr = (void *)o_range; break; +  case F_SSCANF - F_OFFSET: addr=(void *)o_sscanf; break; +  } + #endif +     ADD_CALL(instrs[b].address, delay_ok);   }      void ins_f_byte(unsigned int opcode)   {    low_ins_f_byte(opcode, 0);   }      void ins_f_byte_with_arg(unsigned int a,unsigned INT32 b)   {