Branch: Tag:

2003-08-07

2003-08-07 14:45:10 by Marcus Comstedt <marcus@mc.pp.se>

Update PPC backend to OPCODE_RETURN_JUMPADDR interface. (Yay!)

Rev: src/code/ppc32.c:1.32
Rev: src/code/ppc32.h:1.21

2:   || 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: ppc32.h,v 1.20 2002/11/08 18:09:29 marcus Exp $ + || $Id: ppc32.h,v 1.21 2003/08/07 14:45:10 marcus Exp $   */      #define PPC_INSTR_B_FORM(OPCD,BO,BI,BD,AA,LK) \
44:      #define LOW_GET_JUMP() (PROG_COUNTER[0])   #define LOW_SKIPJUMP() (SET_PROG_COUNTER(PROG_COUNTER + 1)) - #ifdef __linux - /* SVR4 ABI */ - #define PROG_COUNTER (((INT32 **)__builtin_frame_address(1))[1]) - #else - /* PowerOpen ABI */ - #define PROG_COUNTER (((INT32 **)__builtin_frame_address(1))[2]) - #endif +       #define SET_REG(REG, X) do { \    INT32 val_ = X; \
249:    "r10", "r11", "r12")      #define OPCODE_INLINE_BRANCH + #define OPCODE_RETURN_JUMPADDR    -  + #ifdef OPCODE_RETURN_JUMPADDR +  + /* Don't need an lvalue in this case. */ + #define PROG_COUNTER ((INT32 *)__builtin_return_address(0)) +  + #define JUMP_EPILOGUE_SIZE 2 + #define JUMP_SET_TO_PC_AT_NEXT(PC) \ +  ((PC) = PROG_COUNTER + JUMP_EPILOGUE_SIZE) +  + #else /* !OPCODE_RETURN_JUMPADDR */ +  + #ifdef __linux + /* SVR4 ABI */ + #define PROG_COUNTER (((INT32 **)__builtin_frame_address(1))[1]) + #else + /* PowerOpen ABI */ + #define PROG_COUNTER (((INT32 **)__builtin_frame_address(1))[2]) + #endif +  + #define JUMP_EPILOGUE_SIZE 0 +  + #endif /* !OPCODE_RETURN_JUMPADDR */ +  +    #ifdef PIKE_DEBUG   void ppc32_disassemble_code(void *addr, size_t bytes);   #define DISASSEMBLE_CODE(ADDR, BYTES) ppc32_disassemble_code(ADDR, BYTES)   #endif