/[qemu]/qemu/target-ppc/translate.c
ViewVC logotype

Diff of /qemu/target-ppc/translate.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.25 by bellard, Mon Jan 3 23:42:39 2005 UTC revision 1.26 by bellard, Tue Feb 8 21:24:36 2005 UTC
# Line 179  static void gen_##name (DisasContext *ct Line 179  static void gen_##name (DisasContext *ct
179    
180  typedef struct opcode_t {  typedef struct opcode_t {
181      unsigned char opc1, opc2, opc3;      unsigned char opc1, opc2, opc3;
182    #if HOST_LONG_BITS == 64 /* Explicitely align to 64 bits */
183        unsigned char pad[5];
184    #else
185        unsigned char pad[1];
186    #endif
187      opc_handler_t handler;      opc_handler_t handler;
188  } opcode_t;  } opcode_t;
189    
# Line 192  static inline uint32_t name (uint32_t op Line 197  static inline uint32_t name (uint32_t op
197  #define EXTRACT_SHELPER(name, shift, nb)                                      \  #define EXTRACT_SHELPER(name, shift, nb)                                      \
198  static inline int32_t name (uint32_t opcode)                                  \  static inline int32_t name (uint32_t opcode)                                  \
199  {                                                                             \  {                                                                             \
200      return s_ext16((opcode >> (shift)) & ((1 << (nb)) - 1));                  \      return (int16_t)((opcode >> (shift)) & ((1 << (nb)) - 1));                \
201  }  }
202    
203  /* Opcode part 1 */  /* Opcode part 1 */
# Line 285  static inline uint32_t MASK (uint32_t st Line 290  static inline uint32_t MASK (uint32_t st
290  #endif  #endif
291    
292  #define GEN_OPCODE(name, op1, op2, op3, invl, _typ)                           \  #define GEN_OPCODE(name, op1, op2, op3, invl, _typ)                           \
293  OPCODES_SECTION static opcode_t opc_##name = {                                \  OPCODES_SECTION opcode_t opc_##name = {                                       \
294      .opc1 = op1,                                                              \      .opc1 = op1,                                                              \
295      .opc2 = op2,                                                              \      .opc2 = op2,                                                              \
296      .opc3 = op3,                                                              \      .opc3 = op3,                                                              \
297        .pad  = { 0, },                                                           \
298      .handler = {                                                              \      .handler = {                                                              \
299          .inval   = invl,                                                      \          .inval   = invl,                                                      \
300          .type = _typ,                                                         \          .type = _typ,                                                         \
# Line 297  OPCODES_SECTION static opcode_t opc_##na Line 303  OPCODES_SECTION static opcode_t opc_##na
303  }  }
304    
305  #define GEN_OPCODE_MARK(name)                                                 \  #define GEN_OPCODE_MARK(name)                                                 \
306  OPCODES_SECTION static opcode_t opc_##name = {                                \  OPCODES_SECTION opcode_t opc_##name = {                                       \
307      .opc1 = 0xFF,                                                             \      .opc1 = 0xFF,                                                             \
308      .opc2 = 0xFF,                                                             \      .opc2 = 0xFF,                                                             \
309      .opc3 = 0xFF,                                                             \      .opc3 = 0xFF,                                                             \
310        .pad  = { 0, },                                                           \
311      .handler = {                                                              \      .handler = {                                                              \
312          .inval   = 0x00000000,                                                \          .inval   = 0x00000000,                                                \
313          .type = 0x00,                                                         \          .type = 0x00,                                                         \
# Line 361  GEN_HANDLER(name, opc1, opc2, opc3, inva Line 368  GEN_HANDLER(name, opc1, opc2, opc3, inva
368      gen_op_load_gpr_T1(rB(ctx->opcode));                                      \      gen_op_load_gpr_T1(rB(ctx->opcode));                                      \
369      gen_op_##name();                                                          \      gen_op_##name();                                                          \
370      if (Rc(ctx->opcode) != 0)                                                 \      if (Rc(ctx->opcode) != 0)                                                 \
371          gen_op_set_Rc0_ov();                                                  \          gen_op_set_Rc0();                                                     \
372      gen_op_store_T0_gpr(rD(ctx->opcode));                                     \      gen_op_store_T0_gpr(rD(ctx->opcode));                                     \
373  }  }
374    
# Line 380  GEN_HANDLER(name, opc1, opc2, opc3, 0x00 Line 387  GEN_HANDLER(name, opc1, opc2, opc3, 0x00
387      gen_op_load_gpr_T0(rA(ctx->opcode));                                      \      gen_op_load_gpr_T0(rA(ctx->opcode));                                      \
388      gen_op_##name();                                                          \      gen_op_##name();                                                          \
389      if (Rc(ctx->opcode) != 0)                                                 \      if (Rc(ctx->opcode) != 0)                                                 \
390          gen_op_set_Rc0_ov();                                                  \          gen_op_set_Rc0();                                                     \
391      gen_op_store_T0_gpr(rD(ctx->opcode));                                     \      gen_op_store_T0_gpr(rD(ctx->opcode));                                     \
392  }  }
393    
# Line 1558  static inline void gen_bcond(DisasContex Line 1565  static inline void gen_bcond(DisasContex
1565          gen_op_dec_ctr();                                                              gen_op_dec_ctr();                                                    
1566      switch(type) {      switch(type) {
1567      case BCOND_IM:      case BCOND_IM:
1568          li = s_ext16(BD(ctx->opcode));          li = (int32_t)((int16_t)(BD(ctx->opcode)));
1569          if (AA(ctx->opcode) == 0) {          if (AA(ctx->opcode) == 0) {
1570              target = ctx->nip + li - 4;              target = ctx->nip + li - 4;
1571          } else {          } else {
# Line 2160  GEN_HANDLER(mtspr, 0x1F, 0x13, 0x0E, 0x0 Line 2167  GEN_HANDLER(mtspr, 0x1F, 0x13, 0x0E, 0x0
2167      case DECR:      case DECR:
2168          gen_op_store_decr();          gen_op_store_decr();
2169          break;          break;
 #if 0  
     case HID0:  
         gen_op_store_hid0();  
         break;  
 #endif  
2170      default:      default:
2171          gen_op_store_spr(sprn);          gen_op_store_spr(sprn);
2172          break;          break;
# Line 2894  static ppc_def_t ppc_defs[] = Line 2896  static ppc_def_t ppc_defs[] =
2896    
2897  static int create_ppc_proc (opc_handler_t **ppc_opcodes, unsigned long pvr)  static int create_ppc_proc (opc_handler_t **ppc_opcodes, unsigned long pvr)
2898  {  {
2899      opcode_t *opc;      opcode_t *opc, *start, *end;
2900      int i, flags;      int i, flags;
2901    
2902      fill_new_table(ppc_opcodes, 0x40);      fill_new_table(ppc_opcodes, 0x40);
# Line 2906  static int create_ppc_proc (opc_handler_ Line 2908  static int create_ppc_proc (opc_handler_
2908          }          }
2909      }      }
2910            
2911      for (opc = &opc_start + 1; opc != &opc_end; opc++) {      if (&opc_start < &opc_end) {
2912            start = &opc_start;
2913            end = &opc_end;
2914        } else {
2915            start = &opc_end;
2916            end = &opc_start;
2917        }
2918        for (opc = start + 1; opc != end; opc++) {
2919          if ((opc->handler.type & flags) != 0)          if ((opc->handler.type & flags) != 0)
2920              if (register_insn(ppc_opcodes, opc) < 0) {              if (register_insn(ppc_opcodes, opc) < 0) {
2921                  printf("*** ERROR initializing PPC instruction "                  printf("*** ERROR initializing PPC instruction "

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26