pike.git / src / code / sparc.c

version» Context lines:

pike.git/src/code/sparc.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: sparc.c,v 1.40 2005/06/17 15:34:28 grubba Exp $ + || $Id: sparc.c,v 1.41 2005/06/17 16:56:08 grubba Exp $   */      /*    * Machine code generator for sparc.    *    * Henrik Grubbström 20010720    */      #include "global.h"   #include "svalue.h"
pike.git/src/code/sparc.c:142:   #define SPARC_BNE(DISP22, A) \    add_to_program(0x12800000|((A)<<29)|(((DISP22)>>2)&0x1fffff))      #define SPARC_CALL(DISP30) \    add_to_program(0x40000000 | (((DISP30) >> 2) & 0x3fffffff))         #define SET_REG(REG, X) do { \    INT64 val_ = X; \    INT32 reg_ = REG; \ -  fprintf(stderr, "SET_REG(0x%02x, %p)\n", reg_, (void *)val_); \ +  /*fprintf(stderr, "SET_REG(0x%02x, %p)\n", reg_, (void *)val_);*/ \    if ((-4096 <= val_) && (val_ <= 4095)) { \    /* or %g0, val_, reg */ \    SPARC_OR(reg_, SPARC_REG_G0, val_, 1); \    } else if ((-0x80000000LL <= val_) && (val_ <= 0x7fffffffLL)) { \    /* sethi %hi(val_), reg */ \    SPARC_SETHI(reg_, val_); \    if (val_ & 0x3ff) { \    /* or reg, %lo(val_), reg */ \    SPARC_OR(reg_, reg_, val_ & 0x3ff, 1); \    } \
pike.git/src/code/sparc.c:188:    INT32 off_ = p_->num_program; \    /* noop */ \    INT32 delay_ = 0x01000000; \    \    if (DELAY_OK) { \    /* Move the previous opcode to the delay-slot. */ \    delay_ = p_->program[--off_]; \    } else { \    add_to_program(0); /* Placeholder... */ \    } \ -  fprintf(stderr, "call %p (pc:%p)\n", ptr_, p_->program); \ +  /*fprintf(stderr, "call %p (pc:%p)\n", ptr_, p_->program);*/ \    /* call X */ \    delta_ = ptr_ - (p_->program + off_); \    if ((-0x20000000L <= delta_) && (delta_ <= 0x1fffffff)) { \    p_->program[off_] = 0x40000000 | (delta_ & 0x3fffffff); \    add_to_relocations(off_); \    } else { \    /* NOTE: Assumes top 30 bits are zero! */ \    /* sethi %hi(ptr_>>2), %o7 */ \    p_->program[off_] = \    0x01000000|(SPARC_REG_O7<<25)|((((size_t)ptr_)>>12)&0x3fffff); \
pike.git/src/code/sparc.c:245:   /*    * Code generator state.    */   unsigned INT32 sparc_codegen_state = 0;   ptrdiff_t sparc_last_pc = 0;      #ifdef PIKE_BYTECODE_SPARC64   #define PIKE_LDPTR SPARC_LDX   #define PIKE_STPTR SPARC_STX   #else /* !PIKE_BYTECODE_SPARC64 */ - #error +    #define PIKE_LDPTR SPARC_LDUW   #define PIKE_STPTR SPARC_STW   #endif /* PIKE_BYTECODE_SPARC64 */      #define LOAD_PIKE_INTERPRETER() do { \    if (!(sparc_codegen_state & SPARC_CODEGEN_IP_IS_SET)) { \    SET_REG(SPARC_REG_PIKE_IP, \    ((ptrdiff_t)(&Pike_interpreter))); \    sparc_codegen_state |= SPARC_CODEGEN_IP_IS_SET; \    } \