Back to index

cell-binutils  2.17cvs20070401
Defines | Functions | Variables
alpha-opc.c File Reference
#include <stdio.h>
#include "sysdep.h"
#include "opcode/alpha.h"
#include "bfd.h"
#include "opintl.h"

Go to the source code of this file.

Defines

#define UNUSED   0
#define RA   (UNUSED + 1)
#define RB   (RA + 1)
#define RC   (RB + 1)
#define FA   (RC + 1)
#define FB   (FA + 1)
#define FC   (FB + 1)
#define ZA   (FC + 1)
#define ZB   (ZA + 1)
#define ZC   (ZB + 1)
#define PRB   (ZC + 1)
#define CPRB   (PRB + 1)
#define RBA   (CPRB + 1)
#define RCA   (RBA + 1)
#define DRC1   (RCA + 1)
#define DRC2   (DRC1 + 1)
#define DFC1   (DRC2 + 1)
#define DFC2   (DFC1 + 1)
#define LIT   (DFC2 + 1)
#define MDISP   (LIT + 1)
#define BDISP   (MDISP + 1)
#define PALFN   (BDISP + 1)
#define JMPHINT   (PALFN + 1)
#define RETHINT   (JMPHINT + 1)
#define EV4HWDISP   (RETHINT + 1)
#define EV6HWDISP   (EV4HWDISP)
#define EV4HWINDEX   (EV4HWDISP + 1)
#define EV4EXTHWINDEX   (EV4HWINDEX + 1)
#define EV5HWDISP   (EV4EXTHWINDEX + 1)
#define EV5HWINDEX   (EV5HWDISP + 1)
#define EV6HWINDEX   (EV5HWINDEX + 1)
#define EV6HWJMPHINT   (EV6HWINDEX+ 1)
#define OP(x)   (((x) & 0x3F) << 26)
#define OP_MASK   0xFC000000
#define BRA_(oo)   OP(oo)
#define BRA_MASK   OP_MASK
#define BRA(oo)   BRA_(oo), BRA_MASK
#define FP_(oo, fff)   (OP(oo) | (((fff) & 0x7FF) << 5))
#define FP_MASK   (OP_MASK | 0xFFE0)
#define FP(oo, fff)   FP_(oo,fff), FP_MASK
#define MEM_(oo)   OP(oo)
#define MEM_MASK   OP_MASK
#define MEM(oo)   MEM_(oo), MEM_MASK
#define MFC_(oo, ffff)   (OP(oo) | ((ffff) & 0xFFFF))
#define MFC_MASK   (OP_MASK | 0xFFFF)
#define MFC(oo, ffff)   MFC_(oo,ffff), MFC_MASK
#define MBR_(oo, h)   (OP(oo) | (((h) & 3) << 14))
#define MBR_MASK   (OP_MASK | 0xC000)
#define MBR(oo, h)   MBR_(oo,h), MBR_MASK
#define OPR_(oo, ff)   (OP(oo) | (((ff) & 0x7F) << 5))
#define OPRL_(oo, ff)   (OPR_((oo),(ff)) | 0x1000)
#define OPR_MASK   (OP_MASK | 0x1FE0)
#define OPR(oo, ff)   OPR_(oo,ff), OPR_MASK
#define OPRL(oo, ff)   OPRL_(oo,ff), OPR_MASK
#define PCD_(oo)   OP(oo)
#define PCD_MASK   OP_MASK
#define PCD(oo)   PCD_(oo), PCD_MASK
#define SPCD_(oo, ffff)   (OP(oo) | ((ffff) & 0x3FFFFFF))
#define SPCD_MASK   0xFFFFFFFF
#define SPCD(oo, ffff)   SPCD_(oo,ffff), SPCD_MASK
#define EV4HWMEM_(oo, f)   (OP(oo) | (((f) & 0xF) << 12))
#define EV4HWMEM_MASK   (OP_MASK | 0xF000)
#define EV4HWMEM(oo, f)   EV4HWMEM_(oo,f), EV4HWMEM_MASK
#define EV5HWMEM_(oo, f)   (OP(oo) | (((f) & 0x3F) << 10))
#define EV5HWMEM_MASK   (OP_MASK | 0xF800)
#define EV5HWMEM(oo, f)   EV5HWMEM_(oo,f), EV5HWMEM_MASK
#define EV6HWMEM_(oo, f)   (OP(oo) | (((f) & 0xF) << 12))
#define EV6HWMEM_MASK   (OP_MASK | 0xF000)
#define EV6HWMEM(oo, f)   EV6HWMEM_(oo,f), EV6HWMEM_MASK
#define EV6HWMBR_(oo, h)   (OP(oo) | (((h) & 7) << 13))
#define EV6HWMBR_MASK   (OP_MASK | 0xE000)
#define EV6HWMBR(oo, h)   EV6HWMBR_(oo,h), EV6HWMBR_MASK
#define BASE   AXP_OPCODE_BASE
#define EV4   AXP_OPCODE_EV4
#define EV5   AXP_OPCODE_EV5
#define EV6   AXP_OPCODE_EV6
#define BWX   AXP_OPCODE_BWX
#define CIX   AXP_OPCODE_CIX
#define MAX   AXP_OPCODE_MAX
#define ARG_NONE   { 0 }
#define ARG_BRA   { RA, BDISP }
#define ARG_FBRA   { FA, BDISP }
#define ARG_FP   { FA, FB, DFC1 }
#define ARG_FPZ1   { ZA, FB, DFC1 }
#define ARG_MEM   { RA, MDISP, PRB }
#define ARG_FMEM   { FA, MDISP, PRB }
#define ARG_OPR   { RA, RB, DRC1 }
#define ARG_OPRL   { RA, LIT, DRC1 }
#define ARG_OPRZ1   { ZA, RB, DRC1 }
#define ARG_OPRLZ1   { ZA, LIT, RC }
#define ARG_PCD   { PALFN }
#define ARG_EV4HWMEM   { RA, EV4HWDISP, PRB }
#define ARG_EV4HWMPR   { RA, RBA, EV4HWINDEX }
#define ARG_EV5HWMEM   { RA, EV5HWDISP, PRB }
#define ARG_EV6HWMEM   { RA, EV6HWDISP, PRB }

Functions

static unsigned insert_rba (unsigned insn, int value ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
static int extract_rba (unsigned insn, int *invalid)
static unsigned insert_rca (unsigned insn, int value ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
static int extract_rca (unsigned insn, int *invalid)
static unsigned insert_za (unsigned insn, int value ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
static int extract_za (unsigned insn, int *invalid)
static unsigned insert_zb (unsigned insn, int value ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
static int extract_zb (unsigned insn, int *invalid)
static unsigned insert_zc (unsigned insn, int value ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
static int extract_zc (unsigned insn, int *invalid)
static unsigned insert_bdisp (unsigned insn, int value, const char **errmsg)
static int extract_bdisp (unsigned insn, int *invalid ATTRIBUTE_UNUSED)
static unsigned insert_jhint (unsigned insn, int value, const char **errmsg)
static int extract_jhint (unsigned insn, int *invalid ATTRIBUTE_UNUSED)
static unsigned insert_ev6hwjhint (unsigned insn, int value, const char **errmsg)
static int extract_ev6hwjhint (unsigned insn, int *invalid ATTRIBUTE_UNUSED)

Variables

const unsigned alpha_num_operands = sizeof(alpha_operands)/sizeof(*alpha_operands)
const unsigned alpha_num_opcodes = sizeof(alpha_opcodes)/sizeof(*alpha_opcodes)

Define Documentation

#define ARG_BRA   { RA, BDISP }

Definition at line 410 of file alpha-opc.c.

#define ARG_EV4HWMEM   { RA, EV4HWDISP, PRB }

Definition at line 421 of file alpha-opc.c.

#define ARG_EV4HWMPR   { RA, RBA, EV4HWINDEX }

Definition at line 422 of file alpha-opc.c.

#define ARG_EV5HWMEM   { RA, EV5HWDISP, PRB }

Definition at line 423 of file alpha-opc.c.

#define ARG_EV6HWMEM   { RA, EV6HWDISP, PRB }

Definition at line 424 of file alpha-opc.c.

#define ARG_FBRA   { FA, BDISP }

Definition at line 411 of file alpha-opc.c.

#define ARG_FMEM   { FA, MDISP, PRB }

Definition at line 415 of file alpha-opc.c.

#define ARG_FP   { FA, FB, DFC1 }

Definition at line 412 of file alpha-opc.c.

#define ARG_FPZ1   { ZA, FB, DFC1 }

Definition at line 413 of file alpha-opc.c.

#define ARG_MEM   { RA, MDISP, PRB }

Definition at line 414 of file alpha-opc.c.

#define ARG_NONE   { 0 }

Definition at line 409 of file alpha-opc.c.

#define ARG_OPR   { RA, RB, DRC1 }

Definition at line 416 of file alpha-opc.c.

#define ARG_OPRL   { RA, LIT, DRC1 }

Definition at line 417 of file alpha-opc.c.

#define ARG_OPRLZ1   { ZA, LIT, RC }

Definition at line 419 of file alpha-opc.c.

#define ARG_OPRZ1   { ZA, RB, DRC1 }

Definition at line 418 of file alpha-opc.c.

#define ARG_PCD   { PALFN }

Definition at line 420 of file alpha-opc.c.

#define BASE   AXP_OPCODE_BASE

Definition at line 400 of file alpha-opc.c.

#define BDISP   (MDISP + 1)
#define BRA (   oo)    BRA_(oo), BRA_MASK

Definition at line 342 of file alpha-opc.c.

#define BRA_ (   oo)    OP(oo)

Definition at line 340 of file alpha-opc.c.

#define BRA_MASK   OP_MASK

Definition at line 341 of file alpha-opc.c.

#define BWX   AXP_OPCODE_BWX

Definition at line 404 of file alpha-opc.c.

#define CIX   AXP_OPCODE_CIX

Definition at line 405 of file alpha-opc.c.

#define CPRB   (PRB + 1)
#define DFC1   (DRC2 + 1)
#define DFC2   (DFC1 + 1)
#define DRC1   (RCA + 1)
#define DRC2   (DRC1 + 1)
#define EV4   AXP_OPCODE_EV4

Definition at line 401 of file alpha-opc.c.

#define EV4EXTHWINDEX   (EV4HWINDEX + 1)
#define EV4HWDISP   (RETHINT + 1)
#define EV4HWINDEX   (EV4HWDISP + 1)
#define EV4HWMEM (   oo,
  f 
)    EV4HWMEM_(oo,f), EV4HWMEM_MASK

Definition at line 385 of file alpha-opc.c.

#define EV4HWMEM_ (   oo,
  f 
)    (OP(oo) | (((f) & 0xF) << 12))

Definition at line 383 of file alpha-opc.c.

#define EV4HWMEM_MASK   (OP_MASK | 0xF000)

Definition at line 384 of file alpha-opc.c.

#define EV5   AXP_OPCODE_EV5

Definition at line 402 of file alpha-opc.c.

#define EV5HWDISP   (EV4EXTHWINDEX + 1)
#define EV5HWINDEX   (EV5HWDISP + 1)
#define EV5HWMEM (   oo,
  f 
)    EV5HWMEM_(oo,f), EV5HWMEM_MASK

Definition at line 389 of file alpha-opc.c.

#define EV5HWMEM_ (   oo,
  f 
)    (OP(oo) | (((f) & 0x3F) << 10))

Definition at line 387 of file alpha-opc.c.

#define EV5HWMEM_MASK   (OP_MASK | 0xF800)

Definition at line 388 of file alpha-opc.c.

#define EV6   AXP_OPCODE_EV6

Definition at line 403 of file alpha-opc.c.

#define EV6HWDISP   (EV4HWDISP)
#define EV6HWINDEX   (EV5HWINDEX + 1)
#define EV6HWJMPHINT   (EV6HWINDEX+ 1)
#define EV6HWMBR (   oo,
 
)    EV6HWMBR_(oo,h), EV6HWMBR_MASK

Definition at line 397 of file alpha-opc.c.

#define EV6HWMBR_ (   oo,
 
)    (OP(oo) | (((h) & 7) << 13))

Definition at line 395 of file alpha-opc.c.

#define EV6HWMBR_MASK   (OP_MASK | 0xE000)

Definition at line 396 of file alpha-opc.c.

#define EV6HWMEM (   oo,
  f 
)    EV6HWMEM_(oo,f), EV6HWMEM_MASK

Definition at line 393 of file alpha-opc.c.

#define EV6HWMEM_ (   oo,
  f 
)    (OP(oo) | (((f) & 0xF) << 12))

Definition at line 391 of file alpha-opc.c.

#define EV6HWMEM_MASK   (OP_MASK | 0xF000)

Definition at line 392 of file alpha-opc.c.

#define FA   (RC + 1)
#define FB   (FA + 1)
#define FC   (FB + 1)
#define FP (   oo,
  fff 
)    FP_(oo,fff), FP_MASK

Definition at line 347 of file alpha-opc.c.

#define FP_ (   oo,
  fff 
)    (OP(oo) | (((fff) & 0x7FF) << 5))

Definition at line 345 of file alpha-opc.c.

#define FP_MASK   (OP_MASK | 0xFFE0)

Definition at line 346 of file alpha-opc.c.

#define JMPHINT   (PALFN + 1)
#define LIT   (DFC2 + 1)
#define MAX   AXP_OPCODE_MAX

Definition at line 406 of file alpha-opc.c.

#define MBR (   oo,
 
)    MBR_(oo,h), MBR_MASK

Definition at line 362 of file alpha-opc.c.

#define MBR_ (   oo,
 
)    (OP(oo) | (((h) & 3) << 14))

Definition at line 360 of file alpha-opc.c.

#define MBR_MASK   (OP_MASK | 0xC000)

Definition at line 361 of file alpha-opc.c.

#define MDISP   (LIT + 1)
#define MEM (   oo)    MEM_(oo), MEM_MASK

Definition at line 352 of file alpha-opc.c.

#define MEM_ (   oo)    OP(oo)

Definition at line 350 of file alpha-opc.c.

#define MEM_MASK   OP_MASK

Definition at line 351 of file alpha-opc.c.

#define MFC (   oo,
  ffff 
)    MFC_(oo,ffff), MFC_MASK

Definition at line 357 of file alpha-opc.c.

#define MFC_ (   oo,
  ffff 
)    (OP(oo) | ((ffff) & 0xFFFF))

Definition at line 355 of file alpha-opc.c.

#define MFC_MASK   (OP_MASK | 0xFFFF)

Definition at line 356 of file alpha-opc.c.

#define OP (   x)    (((x) & 0x3F) << 26)

Definition at line 336 of file alpha-opc.c.

#define OP_MASK   0xFC000000

Definition at line 337 of file alpha-opc.c.

#define OPR (   oo,
  ff 
)    OPR_(oo,ff), OPR_MASK

Definition at line 369 of file alpha-opc.c.

#define OPR_ (   oo,
  ff 
)    (OP(oo) | (((ff) & 0x7F) << 5))

Definition at line 366 of file alpha-opc.c.

#define OPR_MASK   (OP_MASK | 0x1FE0)

Definition at line 368 of file alpha-opc.c.

#define OPRL (   oo,
  ff 
)    OPRL_(oo,ff), OPR_MASK

Definition at line 370 of file alpha-opc.c.

#define OPRL_ (   oo,
  ff 
)    (OPR_((oo),(ff)) | 0x1000)

Definition at line 367 of file alpha-opc.c.

#define PALFN   (BDISP + 1)
#define PCD (   oo)    PCD_(oo), PCD_MASK

Definition at line 375 of file alpha-opc.c.

#define PCD_ (   oo)    OP(oo)

Definition at line 373 of file alpha-opc.c.

#define PCD_MASK   OP_MASK

Definition at line 374 of file alpha-opc.c.

#define PRB   (ZC + 1)
#define RA   (UNUSED + 1)
#define RB   (RA + 1)
#define RBA   (CPRB + 1)
#define RC   (RB + 1)
#define RCA   (RBA + 1)
#define RETHINT   (JMPHINT + 1)
#define SPCD (   oo,
  ffff 
)    SPCD_(oo,ffff), SPCD_MASK

Definition at line 380 of file alpha-opc.c.

#define SPCD_ (   oo,
  ffff 
)    (OP(oo) | ((ffff) & 0x3FFFFFF))

Definition at line 378 of file alpha-opc.c.

#define SPCD_MASK   0xFFFFFFFF

Definition at line 379 of file alpha-opc.c.

#define UNUSED   0
#define ZA   (FC + 1)
#define ZB   (ZA + 1)
#define ZC   (ZB + 1)

Function Documentation

static int extract_bdisp ( unsigned  insn,
int *invalid  ATTRIBUTE_UNUSED 
) [static]

Definition at line 160 of file alpha-opc.c.

{
  return 4 * (((insn & 0x1FFFFF) ^ 0x100000) - 0x100000);
}
static int extract_ev6hwjhint ( unsigned  insn,
int *invalid  ATTRIBUTE_UNUSED 
) [static]

Definition at line 192 of file alpha-opc.c.

{
  return 4 * (((insn & 0x1FFF) ^ 0x1000) - 0x1000);
}
static int extract_jhint ( unsigned  insn,
int *invalid  ATTRIBUTE_UNUSED 
) [static]

Definition at line 176 of file alpha-opc.c.

{
  return 4 * (((insn & 0x3FFF) ^ 0x2000) - 0x2000);
}
static int extract_rba ( unsigned  insn,
int invalid 
) [static]

Definition at line 71 of file alpha-opc.c.

{
  if (invalid != (int *) NULL
      && ((insn >> 21) & 0x1f) != ((insn >> 16) & 0x1f))
    *invalid = 1;
  return 0;
}
static int extract_rca ( unsigned  insn,
int invalid 
) [static]

Definition at line 90 of file alpha-opc.c.

{
  if (invalid != (int *) NULL
      && ((insn >> 21) & 0x1f) != (insn & 0x1f))
    *invalid = 1;
  return 0;
}
static int extract_za ( unsigned  insn,
int invalid 
) [static]

Definition at line 109 of file alpha-opc.c.

{
  if (invalid != (int *) NULL && ((insn >> 21) & 0x1f) != 31)
    *invalid = 1;
  return 0;
}
static int extract_zb ( unsigned  insn,
int invalid 
) [static]

Definition at line 125 of file alpha-opc.c.

{
  if (invalid != (int *) NULL && ((insn >> 16) & 0x1f) != 31)
    *invalid = 1;
  return 0;
}
static int extract_zc ( unsigned  insn,
int invalid 
) [static]

Definition at line 141 of file alpha-opc.c.

{
  if (invalid != (int *) NULL && (insn & 0x1f) != 31)
    *invalid = 1;
  return 0;
}
static unsigned insert_bdisp ( unsigned  insn,
int  value,
const char **  errmsg 
) [static]

Definition at line 152 of file alpha-opc.c.

{
  if (errmsg != (const char **)NULL && (value & 3))
    *errmsg = _("branch operand unaligned");
  return insn | ((value / 4) & 0x1FFFFF);
}
static unsigned insert_ev6hwjhint ( unsigned  insn,
int  value,
const char **  errmsg 
) [static]

Definition at line 184 of file alpha-opc.c.

{
  if (errmsg != (const char **)NULL && (value & 3))
    *errmsg = _("jump hint unaligned");
  return insn | ((value / 4) & 0x1FFF);
}
static unsigned insert_jhint ( unsigned  insn,
int  value,
const char **  errmsg 
) [static]

Definition at line 168 of file alpha-opc.c.

{
  if (errmsg != (const char **)NULL && (value & 3))
    *errmsg = _("jump hint unaligned");
  return insn | ((value / 4) & 0x3FFF);
}
static unsigned insert_rba ( unsigned  insn,
int value  ATTRIBUTE_UNUSED,
const char **errmsg  ATTRIBUTE_UNUSED 
) [static]

Definition at line 63 of file alpha-opc.c.

{
  return insn | (((insn >> 21) & 0x1f) << 16);
}
static unsigned insert_rca ( unsigned  insn,
int value  ATTRIBUTE_UNUSED,
const char **errmsg  ATTRIBUTE_UNUSED 
) [static]

Definition at line 82 of file alpha-opc.c.

{
  return insn | ((insn >> 21) & 0x1f);
}
static unsigned insert_za ( unsigned  insn,
int value  ATTRIBUTE_UNUSED,
const char **errmsg  ATTRIBUTE_UNUSED 
) [static]

Definition at line 101 of file alpha-opc.c.

{
  return insn | (31 << 21);
}
static unsigned insert_zb ( unsigned  insn,
int value  ATTRIBUTE_UNUSED,
const char **errmsg  ATTRIBUTE_UNUSED 
) [static]

Definition at line 117 of file alpha-opc.c.

{
  return insn | (31 << 16);
}
static unsigned insert_zc ( unsigned  insn,
int value  ATTRIBUTE_UNUSED,
const char **errmsg  ATTRIBUTE_UNUSED 
) [static]

Definition at line 133 of file alpha-opc.c.

{
  return insn | 31;
}

Variable Documentation

const unsigned alpha_num_opcodes = sizeof(alpha_opcodes)/sizeof(*alpha_opcodes)

Definition at line 1498 of file alpha-opc.c.

const unsigned alpha_num_operands = sizeof(alpha_operands)/sizeof(*alpha_operands)

Definition at line 330 of file alpha-opc.c.