Back to index

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

Go to the source code of this file.

Defines

#define UNUSED   0
#define BA   UNUSED + 1
#define BA_MASK   (0x1f << 16)
#define BAT   BA + 1
#define BB   BAT + 1
#define BB_MASK   (0x1f << 11)
#define BBA   BB + 1
#define BD   BBA + 1
#define BDA   BD + 1
#define BDM   BDA + 1
#define BDMA   BDM + 1
#define BDP   BDMA + 1
#define BDPA   BDP + 1
#define BF   BDPA + 1
#define OBF   BF + 1
#define BFA   OBF + 1
#define BI   BFA + 1
#define BI_MASK   (0x1f << 16)
#define BO   BI + 1
#define BO_MASK   (0x1f << 21)
#define BOE   BO + 1
#define BH   BOE + 1
#define BT   BH + 1
#define CR   BT + 1
#define CRB   CR + 1
#define CRFD   CRB + 1
#define CRFS   CRFD + 1
#define CT   CRFS + 1
#define D   CT + 1
#define DE   D + 1
#define DES   DE + 1
#define DQ   DES + 1
#define DS   DQ + 1
#define E   DS + 1
#define FL1   E + 1
#define FL2   FL1 + 1
#define FLM   FL2 + 1
#define FRA   FLM + 1
#define FRA_MASK   (0x1f << 16)
#define FRB   FRA + 1
#define FRB_MASK   (0x1f << 11)
#define FRC   FRB + 1
#define FRC_MASK   (0x1f << 6)
#define FRS   FRC + 1
#define FRT   FRS
#define FXM   FRS + 1
#define FXM_MASK   (0xff << 12)
#define FXM4   FXM + 1
#define L   FXM4 + 1
#define SVC_LEV   L + 1
#define LEV   SVC_LEV + 1
#define LI   LEV + 1
#define LIA   LI + 1
#define LS   LIA + 1
#define MB   LS + 1
#define MB_MASK   (0x1f << 6)
#define ME   MB + 1
#define ME_MASK   (0x1f << 1)
#define MBE   ME + 1
#define MB6   MBE + 2
#define ME6   MB6
#define MB6_MASK   (0x3f << 5)
#define MO   MB6 + 1
#define NB   MO + 1
#define NSI   NB + 1
#define RA   NSI + 1
#define RA_MASK   (0x1f << 16)
#define RA0   RA + 1
#define RAQ   RA0 + 1
#define RAL   RAQ + 1
#define RAM   RAL + 1
#define RAS   RAM + 1
#define RAOPT   RAS + 1
#define RB   RAOPT + 1
#define RB_MASK   (0x1f << 11)
#define RBS   RB + 1
#define RS   RBS + 1
#define RT   RS
#define RT_MASK   (0x1f << 21)
#define RSQ   RS + 1
#define RTQ   RSQ + 1
#define RSO   RTQ + 1
#define RTO   RSO
#define SH   RSO + 1
#define SH_MASK   (0x1f << 11)
#define SH6   SH + 1
#define SH6_MASK   ((0x1f << 11) | (1 << 1))
#define SHO   SH6 + 1
#define SI   SHO + 1
#define SISIGNOPT   SI + 1
#define SPR   SISIGNOPT + 1
#define PMR   SPR
#define SPR_MASK   (0x3ff << 11)
#define SPRBAT   SPR + 1
#define SPRBAT_MASK   (0x3 << 17)
#define SPRG   SPRBAT + 1
#define SR   SPRG + 1
#define STRM   SR + 1
#define STRM_MASK   (0x3 << 21)
#define SV   STRM + 1
#define TBR   SV + 1
#define TO   TBR + 1
#define TO_MASK   (0x1f << 21)
#define U   TO + 1
#define UI   U + 1
#define VA   UI + 1
#define VA_MASK   (0x1f << 16)
#define VB   VA + 1
#define VB_MASK   (0x1f << 11)
#define VC   VB + 1
#define VC_MASK   (0x1f << 6)
#define VD   VC + 1
#define VS   VD
#define VD_MASK   (0x1f << 21)
#define SIMM   VD + 1
#define UIMM   SIMM + 1
#define SHB   UIMM + 1
#define EVUIMM   SHB + 1
#define EVUIMM_2   EVUIMM + 1
#define EVUIMM_4   EVUIMM_2 + 1
#define EVUIMM_8   EVUIMM_4 + 1
#define WS   EVUIMM_8 + 1
#define WS_MASK   (0x7 << 11)
#define MTMSRD_L   WS + 1
#define A_L   MTMSRD_L
#define DCM   MTMSRD_L + 1
#define DGM   DCM + 1
#define TE   DGM + 1
#define RMC   TE + 1
#define R   RMC + 1
#define SP   R + 1
#define S   SP + 1
#define SH16   S + 1
#define XRT_L   SH16 + 1
#define EH   XRT_L + 1
#define TB   (268)
#define OP(x)   ((((unsigned long)(x)) & 0x3f) << 26)
#define OP_MASK   OP (0x3f)
#define OPTO(x, to)   (OP (x) | ((((unsigned long)(to)) & 0x1f) << 21))
#define OPTO_MASK   (OP_MASK | TO_MASK)
#define OPL(x, l)   (OP (x) | ((((unsigned long)(l)) & 1) << 21))
#define OPL_MASK   OPL (0x3f,1)
#define A(op, xop, rc)   (OP (op) | ((((unsigned long)(xop)) & 0x1f) << 1) | (((unsigned long)(rc)) & 1))
#define A_MASK   A (0x3f, 0x1f, 1)
#define AFRB_MASK   (A_MASK | FRB_MASK)
#define AFRC_MASK   (A_MASK | FRC_MASK)
#define AFRAFRC_MASK   (A_MASK | FRA_MASK | FRC_MASK)
#define AFRALFRC_MASK   (AFRAFRC_MASK & ~((unsigned long) 1 << 16))
#define B(op, aa, lk)   (OP (op) | ((((unsigned long)(aa)) & 1) << 1) | ((lk) & 1))
#define B_MASK   B (0x3f, 1, 1)
#define BBO(op, bo, aa, lk)   (B ((op), (aa), (lk)) | ((((unsigned long)(bo)) & 0x1f) << 21))
#define BBO_MASK   BBO (0x3f, 0x1f, 1, 1)
#define Y_MASK   (((unsigned long) 1) << 21)
#define AT1_MASK   (((unsigned long) 3) << 21)
#define AT2_MASK   (((unsigned long) 9) << 21)
#define BBOY_MASK   (BBO_MASK &~ Y_MASK)
#define BBOAT_MASK   (BBO_MASK &~ AT1_MASK)
#define BBOCB(op, bo, cb, aa, lk)   (BBO ((op), (bo), (aa), (lk)) | ((((unsigned long)(cb)) & 0x3) << 16))
#define BBOCB_MASK   BBOCB (0x3f, 0x1f, 0x3, 1, 1)
#define BBOYCB_MASK   (BBOCB_MASK &~ Y_MASK)
#define BBOATCB_MASK   (BBOCB_MASK &~ AT1_MASK)
#define BBOAT2CB_MASK   (BBOCB_MASK &~ AT2_MASK)
#define BBOYBI_MASK   (BBOYCB_MASK | BI_MASK)
#define BBOATBI_MASK   (BBOAT2CB_MASK | BI_MASK)
#define CTX(op, xop)   (OP (op) | (((unsigned long)(xop)) & 0x7))
#define CTX_MASK   CTX(0x3f, 0x7)
#define UCTX(op, xop)   (OP (op) | (((unsigned long)(xop)) & 0x1f))
#define UCTX_MASK   UCTX(0x3f, 0x1f)
#define DRA_MASK   (OP_MASK | RA_MASK)
#define DSO(op, xop)   (OP (op) | ((xop) & 0x3))
#define DS_MASK   DSO (0x3f, 3)
#define DEO(op, xop)   (OP (op) | ((xop) & 0xf))
#define DE_MASK   DEO (0x3e, 0xf)
#define EVSEL(op, xop)   (OP (op) | (((unsigned long)(xop)) & 0xff) << 3)
#define EVSEL_MASK   EVSEL(0x3f, 0xff)
#define M(op, rc)   (OP (op) | ((rc) & 1))
#define M_MASK   M (0x3f, 1)
#define MME(op, me, rc)   (M ((op), (rc)) | ((((unsigned long)(me)) & 0x1f) << 1))
#define MMBME_MASK   (M_MASK | MB_MASK | ME_MASK)
#define MSHME_MASK   (M_MASK | SH_MASK | ME_MASK)
#define MD(op, xop, rc)   (OP (op) | ((((unsigned long)(xop)) & 0x7) << 2) | ((rc) & 1))
#define MD_MASK   MD (0x3f, 0x7, 1)
#define MDMB_MASK   (MD_MASK | MB6_MASK)
#define MDSH_MASK   (MD_MASK | SH6_MASK)
#define MDS(op, xop, rc)   (OP (op) | ((((unsigned long)(xop)) & 0xf) << 1) | ((rc) & 1))
#define MDS_MASK   MDS (0x3f, 0xf, 1)
#define MDSMB_MASK   (MDS_MASK | MB6_MASK)
#define SC(op, sa, lk)   (OP (op) | ((((unsigned long)(sa)) & 1) << 1) | ((lk) & 1))
#define SC_MASK   (OP_MASK | (((unsigned long)0x3ff) << 16) | (((unsigned long)1) << 1) | 1)
#define VX(op, xop)   (OP (op) | (((unsigned long)(xop)) & 0x7ff))
#define VX_MASK   VX(0x3f, 0x7ff)
#define VXA(op, xop)   (OP (op) | (((unsigned long)(xop)) & 0x03f))
#define VXA_MASK   VXA(0x3f, 0x3f)
#define VXR(op, xop, rc)   (OP (op) | (((rc) & 1) << 10) | (((unsigned long)(xop)) & 0x3ff))
#define VXR_MASK   VXR(0x3f, 0x3ff, 1)
#define X(op, xop)   (OP (op) | ((((unsigned long)(xop)) & 0x3ff) << 1))
#define Z(op, xop)   (OP (op) | ((((unsigned long)(xop)) & 0x1ff) << 1))
#define XRC(op, xop, rc)   (X ((op), (xop)) | ((rc) & 1))
#define ZRC(op, xop, rc)   (Z ((op), (xop)) | ((rc) & 1))
#define X_MASK   XRC (0x3f, 0x3ff, 1)
#define Z_MASK   ZRC (0x3f, 0x1ff, 1)
#define XRA_MASK   (X_MASK | RA_MASK)
#define XRB_MASK   (X_MASK | RB_MASK)
#define XRT_MASK   (X_MASK | RT_MASK)
#define XLRT_MASK   (XRT_MASK & ~((unsigned long) 0x3 << 21))
#define XRARB_MASK   (X_MASK | RA_MASK | RB_MASK)
#define XRLARB_MASK   (XRARB_MASK & ~((unsigned long) 1 << 16))
#define XRTRA_MASK   (X_MASK | RT_MASK | RA_MASK)
#define XRTLRA_MASK   (XRTRA_MASK & ~((unsigned long) 1 << 21))
#define XOPL(op, xop, l)   (X ((op), (xop)) | ((((unsigned long)(l)) & 1) << 21))
#define XCMP_MASK   (X_MASK | (((unsigned long)1) << 22))
#define XCMPL_MASK   (XCMP_MASK | (((unsigned long)1) << 21))
#define XTO(op, xop, to)   (X ((op), (xop)) | ((((unsigned long)(to)) & 0x1f) << 21))
#define XTO_MASK   (X_MASK | TO_MASK)
#define XTLB(op, xop, sh)   (X ((op), (xop)) | ((((unsigned long)(sh)) & 0x1f) << 11))
#define XTLB_MASK   (X_MASK | SH_MASK)
#define XSYNC(op, xop, l)   (X ((op), (xop)) | ((((unsigned long)(l)) & 3) << 21))
#define XSYNC_MASK   (0xff9fffff)
#define XEH_MASK   (X_MASK & ~((unsigned long )1))
#define XDSS(op, xop, a)   (X ((op), (xop)) | ((((unsigned long)(a)) & 1) << 25))
#define XDSS_MASK   XDSS(0x3f, 0x3ff, 1)
#define XFL(op, xop, rc)   (OP (op) | ((((unsigned long)(xop)) & 0x3ff) << 1) | (((unsigned long)(rc)) & 1))
#define XFL_MASK   (XFL (0x3f, 0x3ff, 1) | (((unsigned long)1) << 25) | (((unsigned long)1) << 16))
#define XISEL(op, xop)   (OP (op) | ((((unsigned long)(xop)) & 0x1f) << 1))
#define XISEL_MASK   XISEL(0x3f, 0x1f)
#define XL(op, xop)   (OP (op) | ((((unsigned long)(xop)) & 0x3ff) << 1))
#define XLLK(op, xop, lk)   (XL ((op), (xop)) | ((lk) & 1))
#define XL_MASK   XLLK (0x3f, 0x3ff, 1)
#define XLO(op, bo, xop, lk)   (XLLK ((op), (xop), (lk)) | ((((unsigned long)(bo)) & 0x1f) << 21))
#define XLO_MASK   (XL_MASK | BO_MASK)
#define XLYLK(op, xop, y, lk)   (XLLK ((op), (xop), (lk)) | ((((unsigned long)(y)) & 1) << 21))
#define XLYLK_MASK   (XL_MASK | Y_MASK)
#define XLOCB(op, bo, cb, xop, lk)   (XLO ((op), (bo), (xop), (lk)) | ((((unsigned long)(cb)) & 3) << 16))
#define XLOCB_MASK   XLOCB (0x3f, 0x1f, 0x3, 0x3ff, 1)
#define XLBB_MASK   (XL_MASK | BB_MASK)
#define XLYBB_MASK   (XLYLK_MASK | BB_MASK)
#define XLBOCBBB_MASK   (XLOCB_MASK | BB_MASK)
#define XLBH_MASK   (XL_MASK | (0x1c << 11))
#define XLBOBB_MASK   (XL_MASK | BO_MASK | BB_MASK)
#define XLBOBIBB_MASK   (XL_MASK | BO_MASK | BI_MASK | BB_MASK)
#define XO(op, xop, oe, rc)   (OP (op) | ((((unsigned long)(xop)) & 0x1ff) << 1) | ((((unsigned long)(oe)) & 1) << 10) | (((unsigned long)(rc)) & 1))
#define XO_MASK   XO (0x3f, 0x1ff, 1, 1)
#define XORB_MASK   (XO_MASK | RB_MASK)
#define XS(op, xop, rc)   (OP (op) | ((((unsigned long)(xop)) & 0x1ff) << 2) | (((unsigned long)(rc)) & 1))
#define XS_MASK   XS (0x3f, 0x1ff, 1)
#define XFXFXM_MASK   (X_MASK | (1 << 11) | (1 << 20))
#define XFXM(op, xop, fxm, p4)
#define XSPR(op, xop, spr)   (X ((op), (xop)) | ((((unsigned long)(spr)) & 0x1f) << 16) | ((((unsigned long)(spr)) & 0x3e0) << 6))
#define XSPR_MASK   (X_MASK | SPR_MASK)
#define XSPRBAT_MASK   (XSPR_MASK &~ SPRBAT_MASK)
#define XSPRG_MASK   (XSPR_MASK & ~(0x17 << 16))
#define XE_MASK   (0xffff7fff)
#define XUC(op, xop)   (OP (op) | (((unsigned long)(xop)) & 0x1f))
#define XUC_MASK   XUC(0x3f, 0x1f)
#define BODNZF   (0x0)
#define BODNZFP   (0x1)
#define BODZF   (0x2)
#define BODZFP   (0x3)
#define BODNZT   (0x8)
#define BODNZTP   (0x9)
#define BODZT   (0xa)
#define BODZTP   (0xb)
#define BOF   (0x4)
#define BOFP   (0x5)
#define BOFM4   (0x6)
#define BOFP4   (0x7)
#define BOT   (0xc)
#define BOTP   (0xd)
#define BOTM4   (0xe)
#define BOTP4   (0xf)
#define BODNZ   (0x10)
#define BODNZP   (0x11)
#define BODZ   (0x12)
#define BODZP   (0x13)
#define BODNZM4   (0x18)
#define BODNZP4   (0x19)
#define BODZM4   (0x1a)
#define BODZP4   (0x1b)
#define BOU   (0x14)
#define CBLT   (0)
#define CBGT   (1)
#define CBEQ   (2)
#define CBSO   (3)
#define TOLGT   (0x1)
#define TOLLT   (0x2)
#define TOEQ   (0x4)
#define TOLGE   (0x5)
#define TOLNL   (0x5)
#define TOLLE   (0x6)
#define TOLNG   (0x6)
#define TOGT   (0x8)
#define TOGE   (0xc)
#define TONL   (0xc)
#define TOLT   (0x10)
#define TOLE   (0x14)
#define TONG   (0x14)
#define TONE   (0x18)
#define TOU   (0x1f)
#define PPC   PPC_OPCODE_PPC
#define PPCCOM   PPC_OPCODE_PPC | PPC_OPCODE_COMMON
#define NOPOWER4   PPC_OPCODE_NOPOWER4 | PPCCOM
#define POWER4   PPC_OPCODE_POWER4
#define POWER5   PPC_OPCODE_POWER5
#define POWER6   PPC_OPCODE_POWER6
#define CELL   PPC_OPCODE_CELL
#define PPC32   PPC_OPCODE_32 | PPC_OPCODE_PPC
#define PPC64   PPC_OPCODE_64 | PPC_OPCODE_PPC
#define PPC403   PPC_OPCODE_403
#define PPC405   PPC403
#define PPC440   PPC_OPCODE_440
#define PPC750   PPC
#define PPC860   PPC
#define PPCVEC   PPC_OPCODE_ALTIVEC
#define POWER   PPC_OPCODE_POWER
#define POWER2   PPC_OPCODE_POWER | PPC_OPCODE_POWER2
#define PPCPWR2   PPC_OPCODE_PPC | PPC_OPCODE_POWER | PPC_OPCODE_POWER2
#define POWER32   PPC_OPCODE_POWER | PPC_OPCODE_32
#define COM   PPC_OPCODE_POWER | PPC_OPCODE_PPC | PPC_OPCODE_COMMON
#define COM32   PPC_OPCODE_POWER | PPC_OPCODE_PPC | PPC_OPCODE_COMMON | PPC_OPCODE_32
#define M601   PPC_OPCODE_POWER | PPC_OPCODE_601
#define PWRCOM   PPC_OPCODE_POWER | PPC_OPCODE_601 | PPC_OPCODE_COMMON
#define MFDEC1   PPC_OPCODE_POWER
#define MFDEC2   PPC_OPCODE_PPC | PPC_OPCODE_601 | PPC_OPCODE_BOOKE
#define BOOKE   PPC_OPCODE_BOOKE
#define BOOKE64   PPC_OPCODE_BOOKE64
#define CLASSIC   PPC_OPCODE_CLASSIC
#define PPCE300   PPC_OPCODE_E300
#define PPCSPE   PPC_OPCODE_SPE
#define PPCISEL   PPC_OPCODE_ISEL
#define PPCEFS   PPC_OPCODE_EFS
#define PPCBRLK   PPC_OPCODE_BRLOCK
#define PPCPMR   PPC_OPCODE_PMR
#define PPCCHLK   PPC_OPCODE_CACHELCK
#define PPCCHLK64   PPC_OPCODE_CACHELCK | PPC_OPCODE_BOOKE64
#define PPCRFMCI   PPC_OPCODE_RFMCI

Functions

static unsigned long insert_bat (unsigned long, long, int, const char **)
static long extract_bat (unsigned long, int, int *)
static unsigned long insert_bba (unsigned long, long, int, const char **)
static long extract_bba (unsigned long, int, int *)
static unsigned long insert_bd (unsigned long, long, int, const char **)
static long extract_bd (unsigned long, int, int *)
static unsigned long insert_bdm (unsigned long, long, int, const char **)
static long extract_bdm (unsigned long, int, int *)
static unsigned long insert_bdp (unsigned long, long, int, const char **)
static long extract_bdp (unsigned long, int, int *)
static unsigned long insert_bo (unsigned long, long, int, const char **)
static long extract_bo (unsigned long, int, int *)
static unsigned long insert_boe (unsigned long, long, int, const char **)
static long extract_boe (unsigned long, int, int *)
static unsigned long insert_dq (unsigned long, long, int, const char **)
static long extract_dq (unsigned long, int, int *)
static unsigned long insert_ds (unsigned long, long, int, const char **)
static long extract_ds (unsigned long, int, int *)
static unsigned long insert_de (unsigned long, long, int, const char **)
static long extract_de (unsigned long, int, int *)
static unsigned long insert_des (unsigned long, long, int, const char **)
static long extract_des (unsigned long, int, int *)
static unsigned long insert_fxm (unsigned long, long, int, const char **)
static long extract_fxm (unsigned long, int, int *)
static unsigned long insert_li (unsigned long, long, int, const char **)
static long extract_li (unsigned long, int, int *)
static unsigned long insert_mbe (unsigned long, long, int, const char **)
static long extract_mbe (unsigned long, int, int *)
static unsigned long insert_mb6 (unsigned long, long, int, const char **)
static long extract_mb6 (unsigned long, int, int *)
static unsigned long insert_nb (unsigned long, long, int, const char **)
static long extract_nb (unsigned long, int, int *)
static unsigned long insert_nsi (unsigned long, long, int, const char **)
static long extract_nsi (unsigned long, int, int *)
static unsigned long insert_ral (unsigned long, long, int, const char **)
static unsigned long insert_ram (unsigned long, long, int, const char **)
static unsigned long insert_raq (unsigned long, long, int, const char **)
static unsigned long insert_ras (unsigned long, long, int, const char **)
static unsigned long insert_rbs (unsigned long, long, int, const char **)
static long extract_rbs (unsigned long, int, int *)
static unsigned long insert_rsq (unsigned long, long, int, const char **)
static unsigned long insert_rtq (unsigned long, long, int, const char **)
static unsigned long insert_sh6 (unsigned long, long, int, const char **)
static long extract_sh6 (unsigned long, int, int *)
static unsigned long insert_spr (unsigned long, long, int, const char **)
static long extract_spr (unsigned long, int, int *)
static unsigned long insert_sprg (unsigned long, long, int, const char **)
static long extract_sprg (unsigned long, int, int *)
static unsigned long insert_tbr (unsigned long, long, int, const char **)
static long extract_tbr (unsigned long, int, int *)
static unsigned long insert_ev2 (unsigned long, long, int, const char **)
static long extract_ev2 (unsigned long, int, int *)
static unsigned long insert_ev4 (unsigned long, long, int, const char **)
static long extract_ev4 (unsigned long, int, int *)
static unsigned long insert_ev8 (unsigned long, long, int, const char **)
static long extract_ev8 (unsigned long, int, int *)
static unsigned long insert_bat (unsigned long insn, long value ATTRIBUTE_UNUSED, int dialect ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
static long extract_bat (unsigned long insn, int dialect ATTRIBUTE_UNUSED, int *invalid)
static unsigned long insert_bba (unsigned long insn, long value ATTRIBUTE_UNUSED, int dialect ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
static long extract_bba (unsigned long insn, int dialect ATTRIBUTE_UNUSED, int *invalid)
static unsigned long insert_bd (unsigned long insn, long value, int dialect ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
static long extract_bd (unsigned long insn, int dialect ATTRIBUTE_UNUSED, int *invalid ATTRIBUTE_UNUSED)
static unsigned long insert_bdm (unsigned long insn, long value, int dialect, const char **errmsg ATTRIBUTE_UNUSED)
static unsigned long insert_bdp (unsigned long insn, long value, int dialect, const char **errmsg ATTRIBUTE_UNUSED)
static int valid_bo (long value, int dialect, int extract)
static unsigned long insert_dq (unsigned long insn, long value, int dialect ATTRIBUTE_UNUSED, const char **errmsg)
static long extract_dq (unsigned long insn, int dialect ATTRIBUTE_UNUSED, int *invalid ATTRIBUTE_UNUSED)
static unsigned long insert_ev2 (unsigned long insn, long value, int dialect ATTRIBUTE_UNUSED, const char **errmsg)
static long extract_ev2 (unsigned long insn, int dialect ATTRIBUTE_UNUSED, int *invalid ATTRIBUTE_UNUSED)
static unsigned long insert_ev4 (unsigned long insn, long value, int dialect ATTRIBUTE_UNUSED, const char **errmsg)
static long extract_ev4 (unsigned long insn, int dialect ATTRIBUTE_UNUSED, int *invalid ATTRIBUTE_UNUSED)
static unsigned long insert_ev8 (unsigned long insn, long value, int dialect ATTRIBUTE_UNUSED, const char **errmsg)
static long extract_ev8 (unsigned long insn, int dialect ATTRIBUTE_UNUSED, int *invalid ATTRIBUTE_UNUSED)
static unsigned long insert_ds (unsigned long insn, long value, int dialect ATTRIBUTE_UNUSED, const char **errmsg)
static long extract_ds (unsigned long insn, int dialect ATTRIBUTE_UNUSED, int *invalid ATTRIBUTE_UNUSED)
static unsigned long insert_de (unsigned long insn, long value, int dialect ATTRIBUTE_UNUSED, const char **errmsg)
static long extract_de (unsigned long insn, int dialect ATTRIBUTE_UNUSED, int *invalid ATTRIBUTE_UNUSED)
static unsigned long insert_des (unsigned long insn, long value, int dialect ATTRIBUTE_UNUSED, const char **errmsg)
static long extract_des (unsigned long insn, int dialect ATTRIBUTE_UNUSED, int *invalid ATTRIBUTE_UNUSED)
static long extract_fxm (unsigned long insn, int dialect ATTRIBUTE_UNUSED, int *invalid)
static unsigned long insert_li (unsigned long insn, long value, int dialect ATTRIBUTE_UNUSED, const char **errmsg)
static long extract_li (unsigned long insn, int dialect ATTRIBUTE_UNUSED, int *invalid ATTRIBUTE_UNUSED)
static unsigned long insert_mbe (unsigned long insn, long value, int dialect ATTRIBUTE_UNUSED, const char **errmsg)
static long extract_mbe (unsigned long insn, int dialect ATTRIBUTE_UNUSED, int *invalid)
static unsigned long insert_mb6 (unsigned long insn, long value, int dialect ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
static long extract_mb6 (unsigned long insn, int dialect ATTRIBUTE_UNUSED, int *invalid ATTRIBUTE_UNUSED)
static unsigned long insert_nb (unsigned long insn, long value, int dialect ATTRIBUTE_UNUSED, const char **errmsg)
static long extract_nb (unsigned long insn, int dialect ATTRIBUTE_UNUSED, int *invalid ATTRIBUTE_UNUSED)
static unsigned long insert_nsi (unsigned long insn, long value, int dialect ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
static long extract_nsi (unsigned long insn, int dialect ATTRIBUTE_UNUSED, int *invalid)
static unsigned long insert_ral (unsigned long insn, long value, int dialect ATTRIBUTE_UNUSED, const char **errmsg)
static unsigned long insert_ram (unsigned long insn, long value, int dialect ATTRIBUTE_UNUSED, const char **errmsg)
static unsigned long insert_raq (unsigned long insn, long value, int dialect ATTRIBUTE_UNUSED, const char **errmsg)
static unsigned long insert_ras (unsigned long insn, long value, int dialect ATTRIBUTE_UNUSED, const char **errmsg)
static unsigned long insert_rbs (unsigned long insn, long value ATTRIBUTE_UNUSED, int dialect ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
static long extract_rbs (unsigned long insn, int dialect ATTRIBUTE_UNUSED, int *invalid)
static unsigned long insert_rtq (unsigned long insn, long value, int dialect ATTRIBUTE_UNUSED, const char **errmsg)
static unsigned long insert_rsq (unsigned long insn, long value ATTRIBUTE_UNUSED, int dialect ATTRIBUTE_UNUSED, const char **errmsg)
static unsigned long insert_sh6 (unsigned long insn, long value, int dialect ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
static long extract_sh6 (unsigned long insn, int dialect ATTRIBUTE_UNUSED, int *invalid ATTRIBUTE_UNUSED)
static unsigned long insert_spr (unsigned long insn, long value, int dialect ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
static long extract_spr (unsigned long insn, int dialect ATTRIBUTE_UNUSED, int *invalid ATTRIBUTE_UNUSED)
static unsigned long insert_tbr (unsigned long insn, long value, int dialect ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
static long extract_tbr (unsigned long insn, int dialect ATTRIBUTE_UNUSED, int *invalid ATTRIBUTE_UNUSED)

Variables

const int powerpc_num_opcodes
const int powerpc_num_macros

Define Documentation

#define A (   op,
  xop,
  rc 
)    (OP (op) | ((((unsigned long)(xop)) & 0x1f) << 1) | (((unsigned long)(rc)) & 1))

Definition at line 1547 of file ppc-opc.c.

#define A_L   MTMSRD_L
#define A_MASK   A (0x3f, 0x1f, 1)

Definition at line 1548 of file ppc-opc.c.

#define AFRAFRC_MASK   (A_MASK | FRA_MASK | FRC_MASK)

Definition at line 1557 of file ppc-opc.c.

#define AFRALFRC_MASK   (AFRAFRC_MASK & ~((unsigned long) 1 << 16))

Definition at line 1560 of file ppc-opc.c.

#define AFRB_MASK   (A_MASK | FRB_MASK)

Definition at line 1551 of file ppc-opc.c.

#define AFRC_MASK   (A_MASK | FRC_MASK)

Definition at line 1554 of file ppc-opc.c.

#define AT1_MASK   (((unsigned long) 3) << 21)

Definition at line 1574 of file ppc-opc.c.

#define AT2_MASK   (((unsigned long) 9) << 21)

Definition at line 1575 of file ppc-opc.c.

#define B (   op,
  aa,
  lk 
)    (OP (op) | ((((unsigned long)(aa)) & 1) << 1) | ((lk) & 1))

Definition at line 1563 of file ppc-opc.c.

#define B_MASK   B (0x3f, 1, 1)

Definition at line 1564 of file ppc-opc.c.

#define BA   UNUSED + 1
#define BA_MASK   (0x1f << 16)
#define BAT   BA + 1
#define BB   BAT + 1
#define BB_MASK   (0x1f << 11)
#define BBA   BB + 1
#define BBO (   op,
  bo,
  aa,
  lk 
)    (B ((op), (aa), (lk)) | ((((unsigned long)(bo)) & 0x1f) << 21))

Definition at line 1567 of file ppc-opc.c.

#define BBO_MASK   BBO (0x3f, 0x1f, 1, 1)

Definition at line 1568 of file ppc-opc.c.

#define BBOAT2CB_MASK   (BBOCB_MASK &~ AT2_MASK)

Definition at line 1588 of file ppc-opc.c.

#define BBOAT_MASK   (BBO_MASK &~ AT1_MASK)

Definition at line 1577 of file ppc-opc.c.

Definition at line 1592 of file ppc-opc.c.

#define BBOATCB_MASK   (BBOCB_MASK &~ AT1_MASK)

Definition at line 1587 of file ppc-opc.c.

#define BBOCB (   op,
  bo,
  cb,
  aa,
  lk 
)    (BBO ((op), (bo), (aa), (lk)) | ((((unsigned long)(cb)) & 0x3) << 16))

Definition at line 1581 of file ppc-opc.c.

#define BBOCB_MASK   BBOCB (0x3f, 0x1f, 0x3, 1, 1)

Definition at line 1583 of file ppc-opc.c.

#define BBOY_MASK   (BBO_MASK &~ Y_MASK)

Definition at line 1576 of file ppc-opc.c.

#define BBOYBI_MASK   (BBOYCB_MASK | BI_MASK)

Definition at line 1591 of file ppc-opc.c.

#define BBOYCB_MASK   (BBOCB_MASK &~ Y_MASK)

Definition at line 1586 of file ppc-opc.c.

#define BD   BBA + 1
#define BDA   BD + 1
#define BDM   BDA + 1
#define BDMA   BDM + 1
#define BDP   BDMA + 1
#define BDPA   BDP + 1
#define BF   BDPA + 1
#define BFA   OBF + 1
#define BH   BOE + 1
#define BI   BFA + 1
#define BI_MASK   (0x1f << 16)
#define BO   BI + 1
#define BO_MASK   (0x1f << 21)
#define BODNZ   (0x10)

Definition at line 1848 of file ppc-opc.c.

#define BODNZF   (0x0)

Definition at line 1830 of file ppc-opc.c.

#define BODNZFP   (0x1)

Definition at line 1831 of file ppc-opc.c.

#define BODNZM4   (0x18)

Definition at line 1852 of file ppc-opc.c.

#define BODNZP   (0x11)

Definition at line 1849 of file ppc-opc.c.

#define BODNZP4   (0x19)

Definition at line 1853 of file ppc-opc.c.

#define BODNZT   (0x8)

Definition at line 1834 of file ppc-opc.c.

#define BODNZTP   (0x9)

Definition at line 1835 of file ppc-opc.c.

#define BODZ   (0x12)

Definition at line 1850 of file ppc-opc.c.

#define BODZF   (0x2)

Definition at line 1832 of file ppc-opc.c.

#define BODZFP   (0x3)

Definition at line 1833 of file ppc-opc.c.

#define BODZM4   (0x1a)

Definition at line 1854 of file ppc-opc.c.

#define BODZP   (0x13)

Definition at line 1851 of file ppc-opc.c.

#define BODZP4   (0x1b)

Definition at line 1855 of file ppc-opc.c.

#define BODZT   (0xa)

Definition at line 1836 of file ppc-opc.c.

#define BODZTP   (0xb)

Definition at line 1837 of file ppc-opc.c.

#define BOE   BO + 1
#define BOF   (0x4)

Definition at line 1839 of file ppc-opc.c.

#define BOFM4   (0x6)

Definition at line 1841 of file ppc-opc.c.

#define BOFP   (0x5)

Definition at line 1840 of file ppc-opc.c.

#define BOFP4   (0x7)

Definition at line 1842 of file ppc-opc.c.

#define BOOKE   PPC_OPCODE_BOOKE

Definition at line 1911 of file ppc-opc.c.

Definition at line 1912 of file ppc-opc.c.

#define BOT   (0xc)

Definition at line 1843 of file ppc-opc.c.

#define BOTM4   (0xe)

Definition at line 1845 of file ppc-opc.c.

#define BOTP   (0xd)

Definition at line 1844 of file ppc-opc.c.

#define BOTP4   (0xf)

Definition at line 1846 of file ppc-opc.c.

#define BOU   (0x14)

Definition at line 1857 of file ppc-opc.c.

#define BT   BH + 1
#define CBEQ   (2)

Definition at line 1863 of file ppc-opc.c.

#define CBGT   (1)

Definition at line 1862 of file ppc-opc.c.

#define CBLT   (0)

Definition at line 1861 of file ppc-opc.c.

#define CBSO   (3)

Definition at line 1864 of file ppc-opc.c.

#define CELL   PPC_OPCODE_CELL

Definition at line 1892 of file ppc-opc.c.

Definition at line 1913 of file ppc-opc.c.

Definition at line 1905 of file ppc-opc.c.

Definition at line 1906 of file ppc-opc.c.

#define CR   BT + 1
#define CRB   CR + 1
#define CRFD   CRB + 1
#define CRFS   CRFD + 1
#define CT   CRFS + 1
#define CTX (   op,
  xop 
)    (OP (op) | (((unsigned long)(xop)) & 0x7))

Definition at line 1595 of file ppc-opc.c.

#define CTX_MASK   CTX(0x3f, 0x7)

Definition at line 1596 of file ppc-opc.c.

#define D   CT + 1
#define DCM   MTMSRD_L + 1
#define DE   D + 1
#define DE_MASK   DEO (0x3e, 0xf)

Definition at line 1611 of file ppc-opc.c.

#define DEO (   op,
  xop 
)    (OP (op) | ((xop) & 0xf))

Definition at line 1610 of file ppc-opc.c.

#define DES   DE + 1
#define DGM   DCM + 1
#define DQ   DES + 1
#define DRA_MASK   (OP_MASK | RA_MASK)

Definition at line 1603 of file ppc-opc.c.

#define DS   DQ + 1
#define DS_MASK   DSO (0x3f, 3)

Definition at line 1607 of file ppc-opc.c.

#define DSO (   op,
  xop 
)    (OP (op) | ((xop) & 0x3))

Definition at line 1606 of file ppc-opc.c.

#define E   DS + 1
#define EH   XRT_L + 1
#define EVSEL (   op,
  xop 
)    (OP (op) | (((unsigned long)(xop)) & 0xff) << 3)

Definition at line 1614 of file ppc-opc.c.

#define EVSEL_MASK   EVSEL(0x3f, 0xff)

Definition at line 1615 of file ppc-opc.c.

#define EVUIMM   SHB + 1
#define EVUIMM_2   EVUIMM + 1
#define EVUIMM_4   EVUIMM_2 + 1
#define EVUIMM_8   EVUIMM_4 + 1
#define FL1   E + 1
#define FL2   FL1 + 1
#define FLM   FL2 + 1
#define FRA   FLM + 1
#define FRA_MASK   (0x1f << 16)
#define FRB   FRA + 1
#define FRB_MASK   (0x1f << 11)
#define FRC   FRB + 1
#define FRC_MASK   (0x1f << 6)
#define FRS   FRC + 1
#define FRT   FRS
#define FXM   FRS + 1
#define FXM4   FXM + 1
#define FXM_MASK   (0xff << 12)
R3 L   FXM4 + 1

Definition at line 141 of file safe-ctype.c.

#define LEV   SVC_LEV + 1
#define LI   LEV + 1
#define LIA   LI + 1
#define LS   LIA + 1
#define M (   op,
  rc 
)    (OP (op) | ((rc) & 1))

Definition at line 1618 of file ppc-opc.c.

Definition at line 1907 of file ppc-opc.c.

#define M_MASK   M (0x3f, 1)

Definition at line 1619 of file ppc-opc.c.

#define MB   LS + 1
#define MB6   MBE + 2
#define MB6_MASK   (0x3f << 5)
#define MB_MASK   (0x1f << 6)
#define MBE   ME + 1
#define MD (   op,
  xop,
  rc 
)    (OP (op) | ((((unsigned long)(xop)) & 0x7) << 2) | ((rc) & 1))

Definition at line 1631 of file ppc-opc.c.

#define MD_MASK   MD (0x3f, 0x7, 1)

Definition at line 1632 of file ppc-opc.c.

#define MDMB_MASK   (MD_MASK | MB6_MASK)

Definition at line 1635 of file ppc-opc.c.

#define MDS (   op,
  xop,
  rc 
)    (OP (op) | ((((unsigned long)(xop)) & 0xf) << 1) | ((rc) & 1))

Definition at line 1641 of file ppc-opc.c.

#define MDS_MASK   MDS (0x3f, 0xf, 1)

Definition at line 1642 of file ppc-opc.c.

#define MDSH_MASK   (MD_MASK | SH6_MASK)

Definition at line 1638 of file ppc-opc.c.

#define MDSMB_MASK   (MDS_MASK | MB6_MASK)

Definition at line 1645 of file ppc-opc.c.

#define ME   MB + 1
#define ME6   MB6
#define ME_MASK   (0x1f << 1)
#define MFDEC1   PPC_OPCODE_POWER

Definition at line 1909 of file ppc-opc.c.

Definition at line 1910 of file ppc-opc.c.

#define MMBME_MASK   (M_MASK | MB_MASK | ME_MASK)

Definition at line 1625 of file ppc-opc.c.

#define MME (   op,
  me,
  rc 
)    (M ((op), (rc)) | ((((unsigned long)(me)) & 0x1f) << 1))

Definition at line 1622 of file ppc-opc.c.

#define MO   MB6 + 1
#define MSHME_MASK   (M_MASK | SH_MASK | ME_MASK)

Definition at line 1628 of file ppc-opc.c.

#define MTMSRD_L   WS + 1
#define NB   MO + 1

Definition at line 1888 of file ppc-opc.c.

#define NSI   NB + 1
#define OBF   BF + 1
#define OP (   x)    ((((unsigned long)(x)) & 0x3f) << 26)

Definition at line 1531 of file ppc-opc.c.

#define OP_MASK   OP (0x3f)

Definition at line 1532 of file ppc-opc.c.

#define OPL (   x,
  l 
)    (OP (x) | ((((unsigned long)(l)) & 1) << 21))

Definition at line 1543 of file ppc-opc.c.

#define OPL_MASK   OPL (0x3f,1)

Definition at line 1544 of file ppc-opc.c.

#define OPTO (   x,
  to 
)    (OP (x) | ((((unsigned long)(to)) & 0x1f) << 21))

Definition at line 1537 of file ppc-opc.c.

#define OPTO_MASK   (OP_MASK | TO_MASK)

Definition at line 1538 of file ppc-opc.c.

#define PMR   SPR
#define POWER   PPC_OPCODE_POWER

Definition at line 1901 of file ppc-opc.c.

Definition at line 1902 of file ppc-opc.c.

Definition at line 1904 of file ppc-opc.c.

#define POWER4   PPC_OPCODE_POWER4

Definition at line 1889 of file ppc-opc.c.

#define POWER5   PPC_OPCODE_POWER5

Definition at line 1890 of file ppc-opc.c.

#define POWER6   PPC_OPCODE_POWER6

Definition at line 1891 of file ppc-opc.c.

#define PPC   PPC_OPCODE_PPC

Definition at line 1886 of file ppc-opc.c.

Definition at line 1893 of file ppc-opc.c.

#define PPC403   PPC_OPCODE_403

Definition at line 1895 of file ppc-opc.c.

#define PPC405   PPC403

Definition at line 1896 of file ppc-opc.c.

#define PPC440   PPC_OPCODE_440

Definition at line 1897 of file ppc-opc.c.

Definition at line 1894 of file ppc-opc.c.

#define PPC750   PPC

Definition at line 1898 of file ppc-opc.c.

#define PPC860   PPC

Definition at line 1899 of file ppc-opc.c.

#define PPCBRLK   PPC_OPCODE_BRLOCK

Definition at line 1918 of file ppc-opc.c.

Definition at line 1920 of file ppc-opc.c.

Definition at line 1921 of file ppc-opc.c.

Definition at line 1887 of file ppc-opc.c.

#define PPCE300   PPC_OPCODE_E300

Definition at line 1914 of file ppc-opc.c.

#define PPCEFS   PPC_OPCODE_EFS

Definition at line 1917 of file ppc-opc.c.

#define PPCISEL   PPC_OPCODE_ISEL

Definition at line 1916 of file ppc-opc.c.

#define PPCPMR   PPC_OPCODE_PMR

Definition at line 1919 of file ppc-opc.c.

Definition at line 1903 of file ppc-opc.c.

#define PPCRFMCI   PPC_OPCODE_RFMCI

Definition at line 1922 of file ppc-opc.c.

#define PPCSPE   PPC_OPCODE_SPE

Definition at line 1915 of file ppc-opc.c.

#define PPCVEC   PPC_OPCODE_ALTIVEC

Definition at line 1900 of file ppc-opc.c.

Definition at line 1908 of file ppc-opc.c.

#define R   RMC + 1
#define RA   NSI + 1
#define RA0   RA + 1
#define RA_MASK   (0x1f << 16)
#define RAL   RAQ + 1
#define RAM   RAL + 1
#define RAOPT   RAS + 1
#define RAQ   RA0 + 1
#define RAS   RAM + 1
#define RB   RAOPT + 1
#define RB_MASK   (0x1f << 11)
#define RBS   RB + 1
#define RMC   TE + 1
#define RS   RBS + 1
#define RSO   RTQ + 1
#define RSQ   RS + 1
#define RT   RS
#define RT_MASK   (0x1f << 21)
#define RTO   RSO
#define RTQ   RSQ + 1
#define S   SP + 1
#define SC (   op,
  sa,
  lk 
)    (OP (op) | ((((unsigned long)(sa)) & 1) << 1) | ((lk) & 1))

Definition at line 1648 of file ppc-opc.c.

#define SC_MASK   (OP_MASK | (((unsigned long)0x3ff) << 16) | (((unsigned long)1) << 1) | 1)

Definition at line 1649 of file ppc-opc.c.

#define SH   RSO + 1
#define SH16   S + 1
#define SH6   SH + 1
#define SH6_MASK   ((0x1f << 11) | (1 << 1))
#define SH_MASK   (0x1f << 11)
#define SHB   UIMM + 1
#define SHO   SH6 + 1
#define SI   SHO + 1
#define SIMM   VD + 1
#define SISIGNOPT   SI + 1
#define SP   R + 1
#define SPR   SISIGNOPT + 1
#define SPR_MASK   (0x3ff << 11)
#define SPRBAT   SPR + 1
#define SPRBAT_MASK   (0x3 << 17)
#define SPRG   SPRBAT + 1
#define SR   SPRG + 1
#define STRM   SR + 1
#define STRM_MASK   (0x3 << 21)
#define SV   STRM + 1
#define SVC_LEV   L + 1
#define TB   (268)

Definition at line 1502 of file ppc-opc.c.

#define TBR   SV + 1
#define TE   DGM + 1
#define TO   TBR + 1
#define TO_MASK   (0x1f << 21)
#define TOEQ   (0x4)

Definition at line 1869 of file ppc-opc.c.

#define TOGE   (0xc)

Definition at line 1875 of file ppc-opc.c.

#define TOGT   (0x8)

Definition at line 1874 of file ppc-opc.c.

#define TOLE   (0x14)

Definition at line 1878 of file ppc-opc.c.

#define TOLGE   (0x5)

Definition at line 1870 of file ppc-opc.c.

#define TOLGT   (0x1)

Definition at line 1867 of file ppc-opc.c.

#define TOLLE   (0x6)

Definition at line 1872 of file ppc-opc.c.

#define TOLLT   (0x2)

Definition at line 1868 of file ppc-opc.c.

#define TOLNG   (0x6)

Definition at line 1873 of file ppc-opc.c.

#define TOLNL   (0x5)

Definition at line 1871 of file ppc-opc.c.

#define TOLT   (0x10)

Definition at line 1877 of file ppc-opc.c.

#define TONE   (0x18)

Definition at line 1880 of file ppc-opc.c.

#define TONG   (0x14)

Definition at line 1879 of file ppc-opc.c.

#define TONL   (0xc)

Definition at line 1876 of file ppc-opc.c.

#define TOU   (0x1f)

Definition at line 1881 of file ppc-opc.c.

#define U   TO + 1
#define UCTX (   op,
  xop 
)    (OP (op) | (((unsigned long)(xop)) & 0x1f))

Definition at line 1599 of file ppc-opc.c.

#define UCTX_MASK   UCTX(0x3f, 0x1f)

Definition at line 1600 of file ppc-opc.c.

#define UI   U + 1
#define UIMM   SIMM + 1
#define UNUSED   0
#define VA   UI + 1
#define VA_MASK   (0x1f << 16)
#define VB   VA + 1
#define VB_MASK   (0x1f << 11)
#define VC   VB + 1
#define VC_MASK   (0x1f << 6)
#define VD   VC + 1
#define VD_MASK   (0x1f << 21)
#define VS   VD
#define VX (   op,
  xop 
)    (OP (op) | (((unsigned long)(xop)) & 0x7ff))

Definition at line 1652 of file ppc-opc.c.

#define VX_MASK   VX(0x3f, 0x7ff)

Definition at line 1655 of file ppc-opc.c.

#define VXA (   op,
  xop 
)    (OP (op) | (((unsigned long)(xop)) & 0x03f))

Definition at line 1658 of file ppc-opc.c.

#define VXA_MASK   VXA(0x3f, 0x3f)

Definition at line 1661 of file ppc-opc.c.

#define VXR (   op,
  xop,
  rc 
)    (OP (op) | (((rc) & 1) << 10) | (((unsigned long)(xop)) & 0x3ff))

Definition at line 1664 of file ppc-opc.c.

#define VXR_MASK   VXR(0x3f, 0x3ff, 1)

Definition at line 1667 of file ppc-opc.c.

#define WS   EVUIMM_8 + 1
#define WS_MASK   (0x7 << 11)
#define X (   op,
  xop 
)    (OP (op) | ((((unsigned long)(xop)) & 0x3ff) << 1))

Definition at line 1670 of file ppc-opc.c.

#define X_MASK   XRC (0x3f, 0x3ff, 1)

Definition at line 1682 of file ppc-opc.c.

#define XCMP_MASK   (X_MASK | (((unsigned long)1) << 22))

Definition at line 1715 of file ppc-opc.c.

#define XCMPL_MASK   (XCMP_MASK | (((unsigned long)1) << 21))

Definition at line 1719 of file ppc-opc.c.

#define XDSS (   op,
  xop,
  a 
)    (X ((op), (xop)) | ((((unsigned long)(a)) & 1) << 25))

Definition at line 1739 of file ppc-opc.c.

#define XDSS_MASK   XDSS(0x3f, 0x3ff, 1)

Definition at line 1740 of file ppc-opc.c.

#define XE_MASK   (0xffff7fff)

Definition at line 1823 of file ppc-opc.c.

#define XEH_MASK   (X_MASK & ~((unsigned long )1))

Definition at line 1736 of file ppc-opc.c.

#define XFL (   op,
  xop,
  rc 
)    (OP (op) | ((((unsigned long)(xop)) & 0x3ff) << 1) | (((unsigned long)(rc)) & 1))

Definition at line 1743 of file ppc-opc.c.

#define XFL_MASK   (XFL (0x3f, 0x3ff, 1) | (((unsigned long)1) << 25) | (((unsigned long)1) << 16))

Definition at line 1744 of file ppc-opc.c.

#define XFXFXM_MASK   (X_MASK | (1 << 11) | (1 << 20))

Definition at line 1802 of file ppc-opc.c.

#define XFXM (   op,
  xop,
  fxm,
  p4 
)
Value:
(X ((op), (xop)) | ((((unsigned long)(fxm)) & 0xff) << 12) \
   | ((unsigned long)(p4) << 20))

Definition at line 1805 of file ppc-opc.c.

#define XISEL (   op,
  xop 
)    (OP (op) | ((((unsigned long)(xop)) & 0x1f) << 1))

Definition at line 1747 of file ppc-opc.c.

#define XISEL_MASK   XISEL(0x3f, 0x1f)

Definition at line 1748 of file ppc-opc.c.

#define XL (   op,
  xop 
)    (OP (op) | ((((unsigned long)(xop)) & 0x3ff) << 1))

Definition at line 1751 of file ppc-opc.c.

#define XL_MASK   XLLK (0x3f, 0x3ff, 1)

Definition at line 1757 of file ppc-opc.c.

#define XLBB_MASK   (XL_MASK | BB_MASK)

Definition at line 1776 of file ppc-opc.c.

#define XLBH_MASK   (XL_MASK | (0x1c << 11))

Definition at line 1781 of file ppc-opc.c.

#define XLBOBB_MASK   (XL_MASK | BO_MASK | BB_MASK)

Definition at line 1784 of file ppc-opc.c.

Definition at line 1787 of file ppc-opc.c.

#define XLBOCBBB_MASK   (XLOCB_MASK | BB_MASK)

Definition at line 1778 of file ppc-opc.c.

#define XLLK (   op,
  xop,
  lk 
)    (XL ((op), (xop)) | ((lk) & 1))

Definition at line 1754 of file ppc-opc.c.

#define XLO (   op,
  bo,
  xop,
  lk 
)    (XLLK ((op), (xop), (lk)) | ((((unsigned long)(bo)) & 0x1f) << 21))

Definition at line 1760 of file ppc-opc.c.

#define XLO_MASK   (XL_MASK | BO_MASK)

Definition at line 1762 of file ppc-opc.c.

#define XLOCB (   op,
  bo,
  cb,
  xop,
  lk 
)    (XLO ((op), (bo), (xop), (lk)) | ((((unsigned long)(cb)) & 3) << 16))

Definition at line 1771 of file ppc-opc.c.

#define XLOCB_MASK   XLOCB (0x3f, 0x1f, 0x3, 0x3ff, 1)

Definition at line 1773 of file ppc-opc.c.

#define XLRT_MASK   (XRT_MASK & ~((unsigned long) 0x3 << 21))

Definition at line 1697 of file ppc-opc.c.

#define XLYBB_MASK   (XLYLK_MASK | BB_MASK)

Definition at line 1777 of file ppc-opc.c.

#define XLYLK (   op,
  xop,
  y,
  lk 
)    (XLLK ((op), (xop), (lk)) | ((((unsigned long)(y)) & 1) << 21))

Definition at line 1766 of file ppc-opc.c.

#define XLYLK_MASK   (XL_MASK | Y_MASK)

Definition at line 1767 of file ppc-opc.c.

#define XO (   op,
  xop,
  oe,
  rc 
)    (OP (op) | ((((unsigned long)(xop)) & 0x1ff) << 1) | ((((unsigned long)(oe)) & 1) << 10) | (((unsigned long)(rc)) & 1))

Definition at line 1790 of file ppc-opc.c.

#define XO_MASK   XO (0x3f, 0x1ff, 1, 1)

Definition at line 1792 of file ppc-opc.c.

#define XOPL (   op,
  xop,
  l 
)    (X ((op), (xop)) | ((((unsigned long)(l)) & 1) << 21))

Definition at line 1712 of file ppc-opc.c.

#define XORB_MASK   (XO_MASK | RB_MASK)

Definition at line 1795 of file ppc-opc.c.

#define XRA_MASK   (X_MASK | RA_MASK)

Definition at line 1688 of file ppc-opc.c.

#define XRARB_MASK   (X_MASK | RA_MASK | RB_MASK)

Definition at line 1700 of file ppc-opc.c.

#define XRB_MASK   (X_MASK | RB_MASK)

Definition at line 1691 of file ppc-opc.c.

#define XRC (   op,
  xop,
  rc 
)    (X ((op), (xop)) | ((rc) & 1))

Definition at line 1676 of file ppc-opc.c.

#define XRLARB_MASK   (XRARB_MASK & ~((unsigned long) 1 << 16))

Definition at line 1703 of file ppc-opc.c.

#define XRT_L   SH16 + 1
#define XRT_MASK   (X_MASK | RT_MASK)

Definition at line 1694 of file ppc-opc.c.

#define XRTLRA_MASK   (XRTRA_MASK & ~((unsigned long) 1 << 21))

Definition at line 1709 of file ppc-opc.c.

#define XRTRA_MASK   (X_MASK | RT_MASK | RA_MASK)

Definition at line 1706 of file ppc-opc.c.

#define XS (   op,
  xop,
  rc 
)    (OP (op) | ((((unsigned long)(xop)) & 0x1ff) << 2) | (((unsigned long)(rc)) & 1))

Definition at line 1798 of file ppc-opc.c.

#define XS_MASK   XS (0x3f, 0x1ff, 1)

Definition at line 1799 of file ppc-opc.c.

#define XSPR (   op,
  xop,
  spr 
)    (X ((op), (xop)) | ((((unsigned long)(spr)) & 0x1f) << 16) | ((((unsigned long)(spr)) & 0x3e0) << 6))

Definition at line 1810 of file ppc-opc.c.

#define XSPR_MASK   (X_MASK | SPR_MASK)

Definition at line 1812 of file ppc-opc.c.

#define XSPRBAT_MASK   (XSPR_MASK &~ SPRBAT_MASK)

Definition at line 1816 of file ppc-opc.c.

#define XSPRG_MASK   (XSPR_MASK & ~(0x17 << 16))

Definition at line 1820 of file ppc-opc.c.

#define XSYNC (   op,
  xop,
  l 
)    (X ((op), (xop)) | ((((unsigned long)(l)) & 3) << 21))

Definition at line 1730 of file ppc-opc.c.

#define XSYNC_MASK   (0xff9fffff)

Definition at line 1733 of file ppc-opc.c.

#define XTLB (   op,
  xop,
  sh 
)    (X ((op), (xop)) | ((((unsigned long)(sh)) & 0x1f) << 11))

Definition at line 1726 of file ppc-opc.c.

#define XTLB_MASK   (X_MASK | SH_MASK)

Definition at line 1727 of file ppc-opc.c.

#define XTO (   op,
  xop,
  to 
)    (X ((op), (xop)) | ((((unsigned long)(to)) & 0x1f) << 21))

Definition at line 1722 of file ppc-opc.c.

#define XTO_MASK   (X_MASK | TO_MASK)

Definition at line 1723 of file ppc-opc.c.

#define XUC (   op,
  xop 
)    (OP (op) | (((unsigned long)(xop)) & 0x1f))

Definition at line 1826 of file ppc-opc.c.

#define XUC_MASK   XUC(0x3f, 0x1f)

Definition at line 1827 of file ppc-opc.c.

#define Y_MASK   (((unsigned long) 1) << 21)

Definition at line 1573 of file ppc-opc.c.

#define Z (   op,
  xop 
)    (OP (op) | ((((unsigned long)(xop)) & 0x1ff) << 1))

Definition at line 1673 of file ppc-opc.c.

#define Z_MASK   ZRC (0x3f, 0x1ff, 1)

Definition at line 1685 of file ppc-opc.c.

#define ZRC (   op,
  xop,
  rc 
)    (Z ((op), (xop)) | ((rc) & 1))

Definition at line 1679 of file ppc-opc.c.


Function Documentation

static long extract_bat ( unsigned  long,
int  ,
int  
) [static]
static long extract_bat ( unsigned long  insn,
int dialect  ATTRIBUTE_UNUSED,
int invalid 
) [static]

Definition at line 621 of file ppc-opc.c.

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

Definition at line 646 of file ppc-opc.c.

{
  if (((insn >> 16) & 0x1f) != ((insn >> 11) & 0x1f))
    *invalid = 1;
  return 0;
}
static long extract_bd ( unsigned  long,
int  ,
int  
) [static]
static long extract_bd ( unsigned long  insn,
int dialect  ATTRIBUTE_UNUSED,
int *invalid  ATTRIBUTE_UNUSED 
) [static]

Definition at line 668 of file ppc-opc.c.

{
  return ((insn & 0xfffc) ^ 0x8000) - 0x8000;
}
static long extract_bdm ( unsigned long  insn,
int  dialect,
int invalid 
) [static]

Definition at line 714 of file ppc-opc.c.

{
  if ((dialect & PPC_OPCODE_POWER4) == 0)
    {
      if (((insn & (1 << 21)) == 0) != ((insn & (1 << 15)) == 0))
       *invalid = 1;
    }
  else
    {
      if ((insn & (0x17 << 21)) != (0x06 << 21)
         && (insn & (0x1d << 21)) != (0x18 << 21))
       *invalid = 1;
    }

  return ((insn & 0xfffc) ^ 0x8000) - 0x8000;
}
static long extract_bdp ( unsigned long  insn,
int  dialect,
int invalid 
) [static]

Definition at line 759 of file ppc-opc.c.

{
  if ((dialect & PPC_OPCODE_POWER4) == 0)
    {
      if (((insn & (1 << 21)) == 0) == ((insn & (1 << 15)) == 0))
       *invalid = 1;
    }
  else
    {
      if ((insn & (0x17 << 21)) != (0x07 << 21)
         && (insn & (0x1d << 21)) != (0x19 << 21))
       *invalid = 1;
    }

  return ((insn & 0xfffc) ^ 0x8000) - 0x8000;
}
static long extract_bo ( unsigned long  insn,
int  dialect,
int invalid 
) [static]

Definition at line 852 of file ppc-opc.c.

{
  long value;

  value = (insn >> 21) & 0x1f;
  if (!valid_bo (value, dialect, 1))
    *invalid = 1;
  return value;
}

Here is the call graph for this function:

static long extract_boe ( unsigned long  insn,
int  dialect,
int invalid 
) [static]

Definition at line 883 of file ppc-opc.c.

{
  long value;

  value = (insn >> 21) & 0x1f;
  if (!valid_bo (value, dialect, 1))
    *invalid = 1;
  return value & 0x1e;
}

Here is the call graph for this function:

static long extract_de ( unsigned  long,
int  ,
int  
) [static]
static long extract_de ( unsigned long  insn,
int dialect  ATTRIBUTE_UNUSED,
int *invalid  ATTRIBUTE_UNUSED 
) [static]

Definition at line 1016 of file ppc-opc.c.

{
  return (insn & 0xfff0) >> 4;
}
static long extract_des ( unsigned  long,
int  ,
int  
) [static]
static long extract_des ( unsigned long  insn,
int dialect  ATTRIBUTE_UNUSED,
int *invalid  ATTRIBUTE_UNUSED 
) [static]

Definition at line 1039 of file ppc-opc.c.

{
  return (((insn >> 2) & 0x3ffc) ^ 0x2000) - 0x2000;
}
static long extract_dq ( unsigned  long,
int  ,
int  
) [static]
static long extract_dq ( unsigned long  insn,
int dialect  ATTRIBUTE_UNUSED,
int *invalid  ATTRIBUTE_UNUSED 
) [static]

Definition at line 910 of file ppc-opc.c.

{
  return ((insn & 0xfff0) ^ 0x8000) - 0x8000;
}
static long extract_ds ( unsigned  long,
int  ,
int  
) [static]
static long extract_ds ( unsigned long  insn,
int dialect  ATTRIBUTE_UNUSED,
int *invalid  ATTRIBUTE_UNUSED 
) [static]

Definition at line 995 of file ppc-opc.c.

{
  return ((insn & 0xfffc) ^ 0x8000) - 0x8000;
}
static long extract_ev2 ( unsigned  long,
int  ,
int  
) [static]
static long extract_ev2 ( unsigned long  insn,
int dialect  ATTRIBUTE_UNUSED,
int *invalid  ATTRIBUTE_UNUSED 
) [static]

Definition at line 931 of file ppc-opc.c.

{
  return (insn >> 10) & 0x3e;
}
static long extract_ev4 ( unsigned  long,
int  ,
int  
) [static]
static long extract_ev4 ( unsigned long  insn,
int dialect  ATTRIBUTE_UNUSED,
int *invalid  ATTRIBUTE_UNUSED 
) [static]

Definition at line 952 of file ppc-opc.c.

{
  return (insn >> 9) & 0x7c;
}
static long extract_ev8 ( unsigned  long,
int  ,
int  
) [static]
static long extract_ev8 ( unsigned long  insn,
int dialect  ATTRIBUTE_UNUSED,
int *invalid  ATTRIBUTE_UNUSED 
) [static]

Definition at line 973 of file ppc-opc.c.

{
  return (insn >> 8) & 0xf8;
}
static long extract_fxm ( unsigned  long,
int  ,
int  
) [static]
static long extract_fxm ( unsigned long  insn,
int dialect  ATTRIBUTE_UNUSED,
int invalid 
) [static]

Definition at line 1094 of file ppc-opc.c.

{
  long mask = (insn >> 12) & 0xff;

  /* Is this a Power4 insn?  */
  if ((insn & (1 << 20)) != 0)
    {
      /* Exactly one bit of MASK should be set.  */
      if (mask == 0 || (mask & -mask) != mask)
       *invalid = 1;
    }

  /* Check that non-power4 form of mfcr has a zero MASK.  */
  else if ((insn & (0x3ff << 1)) == 19 << 1)
    {
      if (mask != 0)
       *invalid = 1;
    }

  return mask;
}
static long extract_li ( unsigned  long,
int  ,
int  
) [static]
static long extract_li ( unsigned long  insn,
int dialect  ATTRIBUTE_UNUSED,
int *invalid  ATTRIBUTE_UNUSED 
) [static]

Definition at line 1133 of file ppc-opc.c.

{
  return ((insn & 0x3fffffc) ^ 0x2000000) - 0x2000000;
}
static long extract_mb6 ( unsigned  long,
int  ,
int  
) [static]
static long extract_mb6 ( unsigned long  insn,
int dialect  ATTRIBUTE_UNUSED,
int *invalid  ATTRIBUTE_UNUSED 
) [static]

Definition at line 1241 of file ppc-opc.c.

{
  return ((insn >> 6) & 0x1f) | (insn & 0x20);
}
static long extract_mbe ( unsigned  long,
int  ,
int  
) [static]
static long extract_mbe ( unsigned long  insn,
int dialect  ATTRIBUTE_UNUSED,
int invalid 
) [static]

Definition at line 1199 of file ppc-opc.c.

{
  long ret;
  int mb, me;
  int i;

  *invalid = 1;

  mb = (insn >> 6) & 0x1f;
  me = (insn >> 1) & 0x1f;
  if (mb < me + 1)
    {
      ret = 0;
      for (i = mb; i <= me; i++)
       ret |= 1L << (31 - i);
    }
  else if (mb == me + 1)
    ret = ~0;
  else /* (mb > me + 1) */
    {
      ret = ~0;
      for (i = me + 1; i < mb; i++)
       ret &= ~(1L << (31 - i));
    }
  return ret;
}
static long extract_nb ( unsigned  long,
int  ,
int  
) [static]
static long extract_nb ( unsigned long  insn,
int dialect  ATTRIBUTE_UNUSED,
int *invalid  ATTRIBUTE_UNUSED 
) [static]

Definition at line 1265 of file ppc-opc.c.

{
  long ret;

  ret = (insn >> 11) & 0x1f;
  if (ret == 0)
    ret = 32;
  return ret;
}
static long extract_nsi ( unsigned  long,
int  ,
int  
) [static]
static long extract_nsi ( unsigned long  insn,
int dialect  ATTRIBUTE_UNUSED,
int invalid 
) [static]

Definition at line 1292 of file ppc-opc.c.

{
  *invalid = 1;
  return -(((insn & 0xffff) ^ 0x8000) - 0x8000);
}
static long extract_rbs ( unsigned  long,
int  ,
int  
) [static]
static long extract_rbs ( unsigned long  insn,
int dialect  ATTRIBUTE_UNUSED,
int invalid 
) [static]

Definition at line 1377 of file ppc-opc.c.

{
  if (((insn >> 21) & 0x1f) != ((insn >> 11) & 0x1f))
    *invalid = 1;
  return 0;
}
static long extract_sh6 ( unsigned  long,
int  ,
int  
) [static]
static long extract_sh6 ( unsigned long  insn,
int dialect  ATTRIBUTE_UNUSED,
int *invalid  ATTRIBUTE_UNUSED 
) [static]

Definition at line 1426 of file ppc-opc.c.

{
  return ((insn >> 11) & 0x1f) | ((insn << 4) & 0x20);
}
static long extract_spr ( unsigned  long,
int  ,
int  
) [static]
static long extract_spr ( unsigned long  insn,
int dialect  ATTRIBUTE_UNUSED,
int *invalid  ATTRIBUTE_UNUSED 
) [static]

Definition at line 1446 of file ppc-opc.c.

{
  return ((insn >> 16) & 0x1f) | ((insn >> 6) & 0x3e0);
}
static long extract_sprg ( unsigned long  insn,
int  dialect,
int invalid 
) [static]

Definition at line 1478 of file ppc-opc.c.

{
  unsigned long val = (insn >> 16) & 0x1f;

  /* mfsprg can use 260..263 and 272..279.  mtsprg only uses spr 272..279
     If not BOOKE or 405, then both use only 272..275.  */
  if (val <= 3
      || (val < 0x10 && (insn & 0x100) != 0)
      || (val - 0x10 > 3
         && (dialect & (PPC_OPCODE_BOOKE | PPC_OPCODE_403)) == 0))
    *invalid = 1;
  return val & 7;
}
static long extract_tbr ( unsigned  long,
int  ,
int  
) [static]
static long extract_tbr ( unsigned long  insn,
int dialect  ATTRIBUTE_UNUSED,
int *invalid  ATTRIBUTE_UNUSED 
) [static]

Definition at line 1516 of file ppc-opc.c.

{
  long ret;

  ret = ((insn >> 16) & 0x1f) | ((insn >> 6) & 0x3e0);
  if (ret == TB)
    ret = 0;
  return ret;
}
static unsigned long insert_bat ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_bat ( unsigned long  insn,
long value  ATTRIBUTE_UNUSED,
int dialect  ATTRIBUTE_UNUSED,
const char **errmsg  ATTRIBUTE_UNUSED 
) [static]

Definition at line 612 of file ppc-opc.c.

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

Definition at line 637 of file ppc-opc.c.

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

Definition at line 659 of file ppc-opc.c.

{
  return insn | (value & 0xfffc);
}
static unsigned long insert_bdm ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_bdm ( unsigned long  insn,
long  value,
int  dialect,
const char **errmsg  ATTRIBUTE_UNUSED 
) [static]

Definition at line 693 of file ppc-opc.c.

{
  if ((dialect & PPC_OPCODE_POWER4) == 0)
    {
      if ((value & 0x8000) != 0)
       insn |= 1 << 21;
    }
  else
    {
      if ((insn & (0x14 << 21)) == (0x04 << 21))
       insn |= 0x02 << 21;
      else if ((insn & (0x14 << 21)) == (0x10 << 21))
       insn |= 0x08 << 21;
    }
  return insn | (value & 0xfffc);
}
static unsigned long insert_bdp ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_bdp ( unsigned long  insn,
long  value,
int  dialect,
const char **errmsg  ATTRIBUTE_UNUSED 
) [static]

Definition at line 738 of file ppc-opc.c.

{
  if ((dialect & PPC_OPCODE_POWER4) == 0)
    {
      if ((value & 0x8000) == 0)
       insn |= 1 << 21;
    }
  else
    {
      if ((insn & (0x14 << 21)) == (0x04 << 21))
       insn |= 0x03 << 21;
      else if ((insn & (0x14 << 21)) == (0x10 << 21))
       insn |= 0x09 << 21;
    }
  return insn | (value & 0xfffc);
}
static unsigned long insert_bo ( unsigned long  insn,
long  value,
int  dialect,
const char **  errmsg 
) [static]

Definition at line 841 of file ppc-opc.c.

{
  if (!valid_bo (value, dialect, 0))
    *errmsg = _("invalid conditional option");
  return insn | ((value & 0x1f) << 21);
}

Here is the call graph for this function:

static unsigned long insert_boe ( unsigned long  insn,
long  value,
int  dialect,
const char **  errmsg 
) [static]

Definition at line 869 of file ppc-opc.c.

{
  if (!valid_bo (value, dialect, 0))
    *errmsg = _("invalid conditional option");
  else if ((value & 1) != 0)
    *errmsg = _("attempt to set y bit when using + or - modifier");

  return insn | ((value & 0x1f) << 21);
}

Here is the call graph for this function:

static unsigned long insert_de ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_de ( unsigned long  insn,
long  value,
int dialect  ATTRIBUTE_UNUSED,
const char **  errmsg 
) [static]

Definition at line 1005 of file ppc-opc.c.

{
  if (value > 2047 || value < -2048)
    *errmsg = _("offset not between -2048 and 2047");
  return insn | ((value << 4) & 0xfff0);
}
static unsigned long insert_des ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_des ( unsigned long  insn,
long  value,
int dialect  ATTRIBUTE_UNUSED,
const char **  errmsg 
) [static]

Definition at line 1026 of file ppc-opc.c.

{
  if (value > 8191 || value < -8192)
    *errmsg = _("offset not between -8192 and 8191");
  else if ((value & 3) != 0)
    *errmsg = _("offset not a multiple of 4");
  return insn | ((value << 2) & 0xfff0);
}
static unsigned long insert_dq ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_dq ( unsigned long  insn,
long  value,
int dialect  ATTRIBUTE_UNUSED,
const char **  errmsg 
) [static]

Definition at line 899 of file ppc-opc.c.

{
  if ((value & 0xf) != 0)
    *errmsg = _("offset not a multiple of 16");
  return insn | (value & 0xfff0);
}
static unsigned long insert_ds ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_ds ( unsigned long  insn,
long  value,
int dialect  ATTRIBUTE_UNUSED,
const char **  errmsg 
) [static]

Definition at line 984 of file ppc-opc.c.

{
  if ((value & 3) != 0)
    *errmsg = _("offset not a multiple of 4");
  return insn | (value & 0xfffc);
}
static unsigned long insert_ev2 ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_ev2 ( unsigned long  insn,
long  value,
int dialect  ATTRIBUTE_UNUSED,
const char **  errmsg 
) [static]

Definition at line 918 of file ppc-opc.c.

{
  if ((value & 1) != 0)
    *errmsg = _("offset not a multiple of 2");
  if ((value > 62) != 0)
    *errmsg = _("offset greater than 62");
  return insn | ((value & 0x3e) << 10);
}
static unsigned long insert_ev4 ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_ev4 ( unsigned long  insn,
long  value,
int dialect  ATTRIBUTE_UNUSED,
const char **  errmsg 
) [static]

Definition at line 939 of file ppc-opc.c.

{
  if ((value & 3) != 0)
    *errmsg = _("offset not a multiple of 4");
  if ((value > 124) != 0)
    *errmsg = _("offset greater than 124");
  return insn | ((value & 0x7c) << 9);
}
static unsigned long insert_ev8 ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_ev8 ( unsigned long  insn,
long  value,
int dialect  ATTRIBUTE_UNUSED,
const char **  errmsg 
) [static]

Definition at line 960 of file ppc-opc.c.

{
  if ((value & 7) != 0)
    *errmsg = _("offset not a multiple of 8");
  if ((value > 248) != 0)
    *errmsg = _("offset greater than 248");
  return insn | ((value & 0xf8) << 8);
}
static unsigned long insert_fxm ( unsigned long  insn,
long  value,
int  dialect,
const char **  errmsg 
) [static]

Definition at line 1049 of file ppc-opc.c.

{
  /* If we're handling the mfocrf and mtocrf insns ensure that exactly
     one bit of the mask field is set.  */
  if ((insn & (1 << 20)) != 0)
    {
      if (value == 0 || (value & -value) != value)
       {
         *errmsg = _("invalid mask field");
         value = 0;
       }
    }

  /* If the optional field on mfcr is missing that means we want to use
     the old form of the instruction that moves the whole cr.  In that
     case we'll have VALUE zero.  There doesn't seem to be a way to
     distinguish this from the case where someone writes mfcr %r3,0.  */
  else if (value == 0)
    ;

  /* If only one bit of the FXM field is set, we can use the new form
     of the instruction, which is faster.  Unlike the Power4 branch hint
     encoding, this is not backward compatible.  Do not generate the
     new form unless -mpower4 has been given, or -many and the two
     operand form of mfcr was used.  */
  else if ((value & -value) == value
          && ((dialect & PPC_OPCODE_POWER4) != 0
              || ((dialect & PPC_OPCODE_ANY) != 0
                 && (insn & (0x3ff << 1)) == 19 << 1)))
    insn |= 1 << 20;

  /* Any other value on mfcr is an error.  */
  else if ((insn & (0x3ff << 1)) == 19 << 1)
    {
      *errmsg = _("ignoring invalid mfcr mask");
      value = 0;
    }

  return insn | ((value & 0xff) << 12);
}
static unsigned long insert_li ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_li ( unsigned long  insn,
long  value,
int dialect  ATTRIBUTE_UNUSED,
const char **  errmsg 
) [static]

Definition at line 1122 of file ppc-opc.c.

{
  if ((value & 3) != 0)
    *errmsg = _("ignoring least significant bits in branch offset");
  return insn | (value & 0x3fffffc);
}
static unsigned long insert_mb6 ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_mb6 ( unsigned long  insn,
long  value,
int dialect  ATTRIBUTE_UNUSED,
const char **errmsg  ATTRIBUTE_UNUSED 
) [static]

Definition at line 1232 of file ppc-opc.c.

{
  return insn | ((value & 0x1f) << 6) | (value & 0x20);
}
static unsigned long insert_mbe ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_mbe ( unsigned long  insn,
long  value,
int dialect  ATTRIBUTE_UNUSED,
const char **  errmsg 
) [static]

Definition at line 1146 of file ppc-opc.c.

{
  unsigned long uval, mask;
  int mb, me, mx, count, last;

  uval = value;

  if (uval == 0)
    {
      *errmsg = _("illegal bitmask");
      return insn;
    }

  mb = 0;
  me = 32;
  if ((uval & 1) != 0)
    last = 1;
  else
    last = 0;
  count = 0;

  /* mb: location of last 0->1 transition */
  /* me: location of last 1->0 transition */
  /* count: # transitions */

  for (mx = 0, mask = 1L << 31; mx < 32; ++mx, mask >>= 1)
    {
      if ((uval & mask) && !last)
       {
         ++count;
         mb = mx;
         last = 1;
       }
      else if (!(uval & mask) && last)
       {
         ++count;
         me = mx;
         last = 0;
       }
    }
  if (me == 0)
    me = 32;

  if (count != 2 && (count != 0 || ! last))
    *errmsg = _("illegal bitmask");

  return insn | (mb << 6) | ((me - 1) << 1);
}

Here is the call graph for this function:

static unsigned long insert_nb ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_nb ( unsigned long  insn,
long  value,
int dialect  ATTRIBUTE_UNUSED,
const char **  errmsg 
) [static]

Definition at line 1252 of file ppc-opc.c.

{
  if (value < 0 || value > 32)
    *errmsg = _("value out of range");
  if (value == 32)
    value = 0;
  return insn | ((value & 0x1f) << 11);
}
static unsigned long insert_nsi ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_nsi ( unsigned long  insn,
long  value,
int dialect  ATTRIBUTE_UNUSED,
const char **errmsg  ATTRIBUTE_UNUSED 
) [static]

Definition at line 1283 of file ppc-opc.c.

{
  return insn | (-value & 0xffff);
}
static unsigned long insert_ral ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_ral ( unsigned long  insn,
long  value,
int dialect  ATTRIBUTE_UNUSED,
const char **  errmsg 
) [static]

Definition at line 1305 of file ppc-opc.c.

{
  if (value == 0
      || (unsigned long) value == ((insn >> 21) & 0x1f))
    *errmsg = "invalid register operand when updating";
  return insn | ((value & 0x1f) << 16);
}
static unsigned long insert_ram ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_ram ( unsigned long  insn,
long  value,
int dialect  ATTRIBUTE_UNUSED,
const char **  errmsg 
) [static]

Definition at line 1320 of file ppc-opc.c.

{
  if ((unsigned long) value >= ((insn >> 21) & 0x1f))
    *errmsg = _("index register in load range");
  return insn | ((value & 0x1f) << 16);
}
static unsigned long insert_raq ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_raq ( unsigned long  insn,
long  value,
int dialect  ATTRIBUTE_UNUSED,
const char **  errmsg 
) [static]

Definition at line 1334 of file ppc-opc.c.

{
  long rtvalue = (insn & RT_MASK) >> 21;

  if (value == rtvalue)
    *errmsg = _("source and target register operands must be different");
  return insn | ((value & 0x1f) << 16);
}
static unsigned long insert_ras ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_ras ( unsigned long  insn,
long  value,
int dialect  ATTRIBUTE_UNUSED,
const char **  errmsg 
) [static]

Definition at line 1351 of file ppc-opc.c.

{
  if (value == 0)
    *errmsg = _("invalid register operand when updating");
  return insn | ((value & 0x1f) << 16);
}
static unsigned long insert_rbs ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_rbs ( unsigned long  insn,
long value  ATTRIBUTE_UNUSED,
int dialect  ATTRIBUTE_UNUSED,
const char **errmsg  ATTRIBUTE_UNUSED 
) [static]

Definition at line 1368 of file ppc-opc.c.

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

Definition at line 1404 of file ppc-opc.c.

{
  if ((value & 1) != 0)
    *errmsg = _("source register operand must be even");
  return insn | ((value & 0x1f) << 21);
}
static unsigned long insert_rtq ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_rtq ( unsigned long  insn,
long  value,
int dialect  ATTRIBUTE_UNUSED,
const char **  errmsg 
) [static]

Definition at line 1390 of file ppc-opc.c.

{
  if ((value & 1) != 0)
    *errmsg = _("target register operand must be even");
  return insn | ((value & 0x1f) << 21);
}
static unsigned long insert_sh6 ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_sh6 ( unsigned long  insn,
long  value,
int dialect  ATTRIBUTE_UNUSED,
const char **errmsg  ATTRIBUTE_UNUSED 
) [static]

Definition at line 1417 of file ppc-opc.c.

{
  return insn | ((value & 0x1f) << 11) | ((value & 0x20) >> 4);
}
static unsigned long insert_spr ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_spr ( unsigned long  insn,
long  value,
int dialect  ATTRIBUTE_UNUSED,
const char **errmsg  ATTRIBUTE_UNUSED 
) [static]

Definition at line 1437 of file ppc-opc.c.

{
  return insn | ((value & 0x1f) << 16) | ((value & 0x3e0) << 6);
}
static unsigned long insert_sprg ( unsigned long  insn,
long  value,
int  dialect,
const char **  errmsg 
) [static]

Definition at line 1456 of file ppc-opc.c.

{
  /* This check uses PPC_OPCODE_403 because PPC405 is later defined
     as a synonym.  If ever a 405 specific dialect is added this
     check should use that instead.  */
  if (value > 7
      || (value > 3
         && (dialect & (PPC_OPCODE_BOOKE | PPC_OPCODE_403)) == 0))
    *errmsg = _("invalid sprg number");

  /* If this is mfsprg4..7 then use spr 260..263 which can be read in
     user mode.  Anything else must use spr 272..279.  */
  if (value <= 3 || (insn & 0x100) != 0)
    value |= 0x10;

  return insn | ((value & 0x17) << 16);
}
static unsigned long insert_tbr ( unsigned  long,
long  ,
int  ,
const char **   
) [static]
static unsigned long insert_tbr ( unsigned long  insn,
long  value,
int dialect  ATTRIBUTE_UNUSED,
const char **errmsg  ATTRIBUTE_UNUSED 
) [static]

Definition at line 1505 of file ppc-opc.c.

{
  if (value == 0)
    value = TB;
  return insn | ((value & 0x1f) << 16) | ((value & 0x3e0) << 6);
}
static int valid_bo ( long  value,
int  dialect,
int  extract 
) [static]

Definition at line 781 of file ppc-opc.c.

{
  if ((dialect & PPC_OPCODE_POWER4) == 0)
    {
      int valid;
      /* Certain encodings have bits that are required to be zero.
        These are (z must be zero, y may be anything):
            001zy
            011zy
            1z00y
            1z01y
            1z1zz
      */
      switch (value & 0x14)
       {
       default:
       case 0:
         valid = 1;
         break;
       case 0x4:
         valid = (value & 0x2) == 0;
         break;
       case 0x10:
         valid = (value & 0x8) == 0;
         break;
       case 0x14:
         valid = value == 0x14;
         break;
       }
      /* When disassembling with -Many, accept power4 encodings too.  */
      if (valid
         || (dialect & PPC_OPCODE_ANY) == 0
         || !extract)
       return valid;
    }

  /* Certain encodings have bits that are required to be zero.
     These are (z must be zero, a & t may be anything):
        0000z
        0001z
        0100z
        0101z
        001at
        011at
        1a00t
        1a01t
        1z1zz
  */
  if ((value & 0x14) == 0)
    return (value & 0x1) == 0;
  else if ((value & 0x14) == 0x14)
    return value == 0x14;
  else
    return 1;
}

Here is the caller graph for this function:


Variable Documentation

Initial value:
  sizeof (powerpc_macros) / sizeof (powerpc_macros[0])

Definition at line 5002 of file ppc-opc.c.

Initial value:
  sizeof (powerpc_opcodes) / sizeof (powerpc_opcodes[0])

Definition at line 4945 of file ppc-opc.c.