if it has not been initialized. Changed by `.set mipsN', and the
-mipsN command line option, and the default CPU. */
int isa;
- /* Enabled Application Specific Extensions (ASEs). These are set to -1
- if they have not been initialized. Changed by `.set <asename>', by
- command line options, and based on the default architecture. */
- int ase_mips3d;
- int ase_mdmx;
- int ase_smartmips;
- int ase_dsp;
- int ase_dspr2;
- int ase_mt;
- int ase_mcu;
- int ase_virt;
+ /* Enabled Application Specific Extensions (ASEs). Changed by `.set
+ <asename>', by command line options, and based on the default
+ architecture. */
+ int ase;
/* Whether we are assembling for the mips16 processor. 0 if we are
not, 1 if we are, and -1 if the value has not been initialized.
Changed by `.set mips16' and `.set nomips16', and the -mips16 and
static struct mips_set_options mips_opts =
{
- /* isa */ ISA_UNKNOWN, /* ase_mips3d */ -1, /* ase_mdmx */ -1,
- /* ase_smartmips */ 0, /* ase_dsp */ -1, /* ase_dspr2 */ -1, /* ase_mt */ -1,
- /* ase_mcu */ -1, /* ase_virt */ -1, /* mips16 */ -1,/* micromips */ -1,
+ /* isa */ ISA_UNKNOWN, /* ase */ 0, /* mips16 */ -1, /* micromips */ -1,
/* noreorder */ 0, /* at */ ATREG, /* warn_about_macros */ 0,
/* nomove */ 0, /* nobopt */ 0, /* noautoextend */ 0, /* gp32 */ 0,
/* fp32 */ 0, /* arch */ CPU_UNKNOWN, /* sym32 */ FALSE,
/* soft_float */ FALSE, /* single_float */ FALSE
};
+/* The set of ASEs that were selected on the command line, either
+ explicitly via ASE options or implicitly through things like -march. */
+static unsigned int file_ase;
+
+/* Which bits of file_ase were explicitly set or cleared by ASE options. */
+static unsigned int file_ase_explicit;
+
/* These variables are filled in with the masks of registers used.
The object format code reads them and puts them in the appropriate
place. */
|| ((EXPR)->X_op == O_symbol && (EXPR)->X_add_number == 0))
#endif
-/* True if -mips3d was passed or implied by arguments passed on the
- command line (e.g., by -march). */
-static int file_ase_mips3d;
-
-/* True if -mdmx was passed or implied by arguments passed on the
- command line (e.g., by -march). */
-static int file_ase_mdmx;
-
-/* True if -msmartmips was passed or implied by arguments passed on the
- command line (e.g., by -march). */
-static int file_ase_smartmips;
-
#define ISA_SUPPORTS_SMARTMIPS (mips_opts.isa == ISA_MIPS32 \
|| mips_opts.isa == ISA_MIPS32R2)
-/* True if -mdsp was passed or implied by arguments passed on the
- command line (e.g., by -march). */
-static int file_ase_dsp;
-
#define ISA_SUPPORTS_DSP_ASE (mips_opts.isa == ISA_MIPS32R2 \
|| mips_opts.isa == ISA_MIPS64R2 \
|| mips_opts.micromips)
#define ISA_SUPPORTS_DSP64_ASE (mips_opts.isa == ISA_MIPS64R2)
-/* True if -mdspr2 was passed or implied by arguments passed on the
- command line (e.g., by -march). */
-static int file_ase_dspr2;
-
#define ISA_SUPPORTS_DSPR2_ASE (mips_opts.isa == ISA_MIPS32R2 \
|| mips_opts.isa == ISA_MIPS64R2 \
|| mips_opts.micromips)
-/* True if -mmt was passed or implied by arguments passed on the
- command line (e.g., by -march). */
-static int file_ase_mt;
+#define ISA_SUPPORTS_EVA_ASE (mips_opts.isa == ISA_MIPS32R2 \
+ || mips_opts.isa == ISA_MIPS64R2 \
+ || mips_opts.micromips)
#define ISA_SUPPORTS_MT_ASE (mips_opts.isa == ISA_MIPS32R2 \
|| mips_opts.isa == ISA_MIPS64R2)
|| mips_opts.isa == ISA_MIPS64R2 \
|| mips_opts.micromips)
-/* True if -mvirt was passed or implied by arguments passed on the
- command line (e.g., by -march). */
-static int file_ase_virt;
-
#define ISA_SUPPORTS_VIRT_ASE (mips_opts.isa == ISA_MIPS32R2 \
|| mips_opts.isa == ISA_MIPS64R2 \
|| mips_opts.micromips)
#define ISA_HAS_ROR(ISA) \
((ISA) == ISA_MIPS32R2 \
|| (ISA) == ISA_MIPS64R2 \
- || mips_opts.ase_smartmips \
+ || (mips_opts.ase & ASE_SMARTMIPS) \
|| mips_opts.micromips \
)
#define IS_SEXT_12BIT_NUM(x) \
(((((x) & 0xfff) ^ 0x800LL) - 0x800LL) == (x))
+/* Is the given value a sign-extended 9-bit value? */
+#define IS_SEXT_9BIT_NUM(x) \
+ (((((x) & 0x1ff) ^ 0x100LL) - 0x100LL) == (x))
+
/* Is the given value a zero-extended 32-bit value? Or a negated one? */
#define IS_ZEXT_32BIT_NUM(x) \
(((x) &~ (offsetT) 0xffffffff) == 0 \
struct mips_cpu_info
{
const char *name; /* CPU or ISA name. */
- int flags; /* ASEs available, or ISA flag. */
+ int flags; /* MIPS_CPU_* flags. */
+ int ase; /* Set of ASEs implemented by the CPU. */
int isa; /* ISA level. */
int cpu; /* CPU number (default CPU if ISA). */
};
#define MIPS_CPU_IS_ISA 0x0001 /* Is this an ISA? (If 0, a CPU.) */
-#define MIPS_CPU_ASE_SMARTMIPS 0x0002 /* CPU implements SmartMIPS ASE */
-#define MIPS_CPU_ASE_DSP 0x0004 /* CPU implements DSP ASE */
-#define MIPS_CPU_ASE_MT 0x0008 /* CPU implements MT ASE */
-#define MIPS_CPU_ASE_MIPS3D 0x0010 /* CPU implements MIPS-3D ASE */
-#define MIPS_CPU_ASE_MDMX 0x0020 /* CPU implements MDMX ASE */
-#define MIPS_CPU_ASE_DSPR2 0x0040 /* CPU implements DSP R2 ASE */
-#define MIPS_CPU_ASE_MCU 0x0080 /* CPU implements MCU ASE */
-#define MIPS_CPU_ASE_VIRT 0x0100 /* CPU implements Virtualization ASE */
static const struct mips_cpu_info *mips_parse_cpu (const char *, const char *);
static const struct mips_cpu_info *mips_cpu_info_from_isa (int);
static const struct mips_cpu_info *mips_cpu_info_from_arch (int);
\f
+/* Command-line options. */
+const char *md_shortopts = "O::g::G:";
+
+enum options
+ {
+ OPTION_MARCH = OPTION_MD_BASE,
+ OPTION_MTUNE,
+ OPTION_MIPS1,
+ OPTION_MIPS2,
+ OPTION_MIPS3,
+ OPTION_MIPS4,
+ OPTION_MIPS5,
+ OPTION_MIPS32,
+ OPTION_MIPS64,
+ OPTION_MIPS32R2,
+ OPTION_MIPS64R2,
+ OPTION_MIPS16,
+ OPTION_NO_MIPS16,
+ OPTION_MIPS3D,
+ OPTION_NO_MIPS3D,
+ OPTION_MDMX,
+ OPTION_NO_MDMX,
+ OPTION_DSP,
+ OPTION_NO_DSP,
+ OPTION_MT,
+ OPTION_NO_MT,
+ OPTION_VIRT,
+ OPTION_NO_VIRT,
+ OPTION_SMARTMIPS,
+ OPTION_NO_SMARTMIPS,
+ OPTION_DSPR2,
+ OPTION_NO_DSPR2,
+ OPTION_EVA,
+ OPTION_NO_EVA,
+ OPTION_MICROMIPS,
+ OPTION_NO_MICROMIPS,
+ OPTION_MCU,
+ OPTION_NO_MCU,
+ OPTION_COMPAT_ARCH_BASE,
+ OPTION_M4650,
+ OPTION_NO_M4650,
+ OPTION_M4010,
+ OPTION_NO_M4010,
+ OPTION_M4100,
+ OPTION_NO_M4100,
+ OPTION_M3900,
+ OPTION_NO_M3900,
+ OPTION_M7000_HILO_FIX,
+ OPTION_MNO_7000_HILO_FIX,
+ OPTION_FIX_24K,
+ OPTION_NO_FIX_24K,
+ OPTION_FIX_LOONGSON2F_JUMP,
+ OPTION_NO_FIX_LOONGSON2F_JUMP,
+ OPTION_FIX_LOONGSON2F_NOP,
+ OPTION_NO_FIX_LOONGSON2F_NOP,
+ OPTION_FIX_VR4120,
+ OPTION_NO_FIX_VR4120,
+ OPTION_FIX_VR4130,
+ OPTION_NO_FIX_VR4130,
+ OPTION_FIX_CN63XXP1,
+ OPTION_NO_FIX_CN63XXP1,
+ OPTION_TRAP,
+ OPTION_BREAK,
+ OPTION_EB,
+ OPTION_EL,
+ OPTION_FP32,
+ OPTION_GP32,
+ OPTION_CONSTRUCT_FLOATS,
+ OPTION_NO_CONSTRUCT_FLOATS,
+ OPTION_FP64,
+ OPTION_GP64,
+ OPTION_RELAX_BRANCH,
+ OPTION_NO_RELAX_BRANCH,
+ OPTION_MSHARED,
+ OPTION_MNO_SHARED,
+ OPTION_MSYM32,
+ OPTION_MNO_SYM32,
+ OPTION_SOFT_FLOAT,
+ OPTION_HARD_FLOAT,
+ OPTION_SINGLE_FLOAT,
+ OPTION_DOUBLE_FLOAT,
+ OPTION_32,
+#ifdef OBJ_ELF
+ OPTION_CALL_SHARED,
+ OPTION_CALL_NONPIC,
+ OPTION_NON_SHARED,
+ OPTION_XGOT,
+ OPTION_MABI,
+ OPTION_N32,
+ OPTION_64,
+ OPTION_MDEBUG,
+ OPTION_NO_MDEBUG,
+ OPTION_PDR,
+ OPTION_NO_PDR,
+ OPTION_MVXWORKS_PIC,
+#endif /* OBJ_ELF */
+ OPTION_END_OF_ENUM
+ };
+
+struct option md_longopts[] =
+{
+ /* Options which specify architecture. */
+ {"march", required_argument, NULL, OPTION_MARCH},
+ {"mtune", required_argument, NULL, OPTION_MTUNE},
+ {"mips0", no_argument, NULL, OPTION_MIPS1},
+ {"mips1", no_argument, NULL, OPTION_MIPS1},
+ {"mips2", no_argument, NULL, OPTION_MIPS2},
+ {"mips3", no_argument, NULL, OPTION_MIPS3},
+ {"mips4", no_argument, NULL, OPTION_MIPS4},
+ {"mips5", no_argument, NULL, OPTION_MIPS5},
+ {"mips32", no_argument, NULL, OPTION_MIPS32},
+ {"mips64", no_argument, NULL, OPTION_MIPS64},
+ {"mips32r2", no_argument, NULL, OPTION_MIPS32R2},
+ {"mips64r2", no_argument, NULL, OPTION_MIPS64R2},
+
+ /* Options which specify Application Specific Extensions (ASEs). */
+ {"mips16", no_argument, NULL, OPTION_MIPS16},
+ {"no-mips16", no_argument, NULL, OPTION_NO_MIPS16},
+ {"mips3d", no_argument, NULL, OPTION_MIPS3D},
+ {"no-mips3d", no_argument, NULL, OPTION_NO_MIPS3D},
+ {"mdmx", no_argument, NULL, OPTION_MDMX},
+ {"no-mdmx", no_argument, NULL, OPTION_NO_MDMX},
+ {"mdsp", no_argument, NULL, OPTION_DSP},
+ {"mno-dsp", no_argument, NULL, OPTION_NO_DSP},
+ {"mmt", no_argument, NULL, OPTION_MT},
+ {"mno-mt", no_argument, NULL, OPTION_NO_MT},
+ {"msmartmips", no_argument, NULL, OPTION_SMARTMIPS},
+ {"mno-smartmips", no_argument, NULL, OPTION_NO_SMARTMIPS},
+ {"mdspr2", no_argument, NULL, OPTION_DSPR2},
+ {"mno-dspr2", no_argument, NULL, OPTION_NO_DSPR2},
+ {"meva", no_argument, NULL, OPTION_EVA},
+ {"mno-eva", no_argument, NULL, OPTION_NO_EVA},
+ {"mmicromips", no_argument, NULL, OPTION_MICROMIPS},
+ {"mno-micromips", no_argument, NULL, OPTION_NO_MICROMIPS},
+ {"mmcu", no_argument, NULL, OPTION_MCU},
+ {"mno-mcu", no_argument, NULL, OPTION_NO_MCU},
+ {"mvirt", no_argument, NULL, OPTION_VIRT},
+ {"mno-virt", no_argument, NULL, OPTION_NO_VIRT},
+
+ /* Old-style architecture options. Don't add more of these. */
+ {"m4650", no_argument, NULL, OPTION_M4650},
+ {"no-m4650", no_argument, NULL, OPTION_NO_M4650},
+ {"m4010", no_argument, NULL, OPTION_M4010},
+ {"no-m4010", no_argument, NULL, OPTION_NO_M4010},
+ {"m4100", no_argument, NULL, OPTION_M4100},
+ {"no-m4100", no_argument, NULL, OPTION_NO_M4100},
+ {"m3900", no_argument, NULL, OPTION_M3900},
+ {"no-m3900", no_argument, NULL, OPTION_NO_M3900},
+
+ /* Options which enable bug fixes. */
+ {"mfix7000", no_argument, NULL, OPTION_M7000_HILO_FIX},
+ {"no-fix-7000", no_argument, NULL, OPTION_MNO_7000_HILO_FIX},
+ {"mno-fix7000", no_argument, NULL, OPTION_MNO_7000_HILO_FIX},
+ {"mfix-loongson2f-jump", no_argument, NULL, OPTION_FIX_LOONGSON2F_JUMP},
+ {"mno-fix-loongson2f-jump", no_argument, NULL, OPTION_NO_FIX_LOONGSON2F_JUMP},
+ {"mfix-loongson2f-nop", no_argument, NULL, OPTION_FIX_LOONGSON2F_NOP},
+ {"mno-fix-loongson2f-nop", no_argument, NULL, OPTION_NO_FIX_LOONGSON2F_NOP},
+ {"mfix-vr4120", no_argument, NULL, OPTION_FIX_VR4120},
+ {"mno-fix-vr4120", no_argument, NULL, OPTION_NO_FIX_VR4120},
+ {"mfix-vr4130", no_argument, NULL, OPTION_FIX_VR4130},
+ {"mno-fix-vr4130", no_argument, NULL, OPTION_NO_FIX_VR4130},
+ {"mfix-24k", no_argument, NULL, OPTION_FIX_24K},
+ {"mno-fix-24k", no_argument, NULL, OPTION_NO_FIX_24K},
+ {"mfix-cn63xxp1", no_argument, NULL, OPTION_FIX_CN63XXP1},
+ {"mno-fix-cn63xxp1", no_argument, NULL, OPTION_NO_FIX_CN63XXP1},
+
+ /* Miscellaneous options. */
+ {"trap", no_argument, NULL, OPTION_TRAP},
+ {"no-break", no_argument, NULL, OPTION_TRAP},
+ {"break", no_argument, NULL, OPTION_BREAK},
+ {"no-trap", no_argument, NULL, OPTION_BREAK},
+ {"EB", no_argument, NULL, OPTION_EB},
+ {"EL", no_argument, NULL, OPTION_EL},
+ {"mfp32", no_argument, NULL, OPTION_FP32},
+ {"mgp32", no_argument, NULL, OPTION_GP32},
+ {"construct-floats", no_argument, NULL, OPTION_CONSTRUCT_FLOATS},
+ {"no-construct-floats", no_argument, NULL, OPTION_NO_CONSTRUCT_FLOATS},
+ {"mfp64", no_argument, NULL, OPTION_FP64},
+ {"mgp64", no_argument, NULL, OPTION_GP64},
+ {"relax-branch", no_argument, NULL, OPTION_RELAX_BRANCH},
+ {"no-relax-branch", no_argument, NULL, OPTION_NO_RELAX_BRANCH},
+ {"mshared", no_argument, NULL, OPTION_MSHARED},
+ {"mno-shared", no_argument, NULL, OPTION_MNO_SHARED},
+ {"msym32", no_argument, NULL, OPTION_MSYM32},
+ {"mno-sym32", no_argument, NULL, OPTION_MNO_SYM32},
+ {"msoft-float", no_argument, NULL, OPTION_SOFT_FLOAT},
+ {"mhard-float", no_argument, NULL, OPTION_HARD_FLOAT},
+ {"msingle-float", no_argument, NULL, OPTION_SINGLE_FLOAT},
+ {"mdouble-float", no_argument, NULL, OPTION_DOUBLE_FLOAT},
+
+ /* Strictly speaking this next option is ELF specific,
+ but we allow it for other ports as well in order to
+ make testing easier. */
+ {"32", no_argument, NULL, OPTION_32},
+
+ /* ELF-specific options. */
+#ifdef OBJ_ELF
+ {"KPIC", no_argument, NULL, OPTION_CALL_SHARED},
+ {"call_shared", no_argument, NULL, OPTION_CALL_SHARED},
+ {"call_nonpic", no_argument, NULL, OPTION_CALL_NONPIC},
+ {"non_shared", no_argument, NULL, OPTION_NON_SHARED},
+ {"xgot", no_argument, NULL, OPTION_XGOT},
+ {"mabi", required_argument, NULL, OPTION_MABI},
+ {"n32", no_argument, NULL, OPTION_N32},
+ {"64", no_argument, NULL, OPTION_64},
+ {"mdebug", no_argument, NULL, OPTION_MDEBUG},
+ {"no-mdebug", no_argument, NULL, OPTION_NO_MDEBUG},
+ {"mpdr", no_argument, NULL, OPTION_PDR},
+ {"mno-pdr", no_argument, NULL, OPTION_NO_PDR},
+ {"mvxworks-pic", no_argument, NULL, OPTION_MVXWORKS_PIC},
+#endif /* OBJ_ELF */
+
+ {NULL, no_argument, NULL, 0}
+};
+size_t md_longopts_size = sizeof (md_longopts);
+\f
/* Pseudo-op table.
The following pseudo-ops from the Kane and Heinrich MIPS book
is_opcode_valid (const struct mips_opcode *mo)
{
int isa = mips_opts.isa;
- int ase = 0;
+ int ase = mips_opts.ase;
int fp_s, fp_d;
- if (mips_opts.ase_mdmx)
- ase |= ASE_MDMX;
- if (mips_opts.ase_dsp)
- ase |= ASE_DSP;
- if (mips_opts.ase_dsp && ISA_SUPPORTS_DSP64_ASE)
+ if ((ase & ASE_DSP) && ISA_SUPPORTS_DSP64_ASE)
ase |= ASE_DSP64;
- if (mips_opts.ase_dspr2)
- ase |= ASE_DSPR2;
- if (mips_opts.ase_mt)
- ase |= ASE_MT;
- if (mips_opts.ase_mips3d)
- ase |= ASE_MIPS3D;
- if (mips_opts.ase_smartmips)
- ase |= ASE_SMARTMIPS;
- if (mips_opts.ase_mcu)
- ase |= ASE_MCU;
- if (mips_opts.ase_virt)
- ase |= ASE_VIRT;
- if (mips_opts.ase_virt && ISA_SUPPORTS_VIRT64_ASE)
+ if ((ase & ASE_VIRT) && ISA_SUPPORTS_VIRT64_ASE)
ase |= ASE_VIRT64;
if (!opcode_is_member (mo, isa, ase, mips_opts.arch))
branch_disp = method == APPEND_SWAP ? insn_length (history) : 0;
#ifdef OBJ_ELF
- /* The value passed to dwarf2_emit_insn is the distance between
- the beginning of the current instruction and the address that
- should be recorded in the debug tables. This is normally the
- current address.
-
- For MIPS16/microMIPS debug info we want to use ISA-encoded
- addresses, so we use -1 for an address higher by one than the
- current one.
-
- If the instruction produced is a branch that we will swap with
- the preceding instruction, then we add the displacement by which
- the branch will be moved backwards. This is more appropriate
- and for MIPS16/microMIPS code also prevents a debugger from
- placing a breakpoint in the middle of the branch (and corrupting
- code if software breakpoints are used). */
- dwarf2_emit_insn ((HAVE_CODE_COMPRESSION ? -1 : 0) + branch_disp);
+ dwarf2_emit_insn (0);
+ /* We want MIPS16 and microMIPS debug info to use ISA-encoded addresses,
+ so "move" the instruction address accordingly.
+
+ Also, it doesn't seem appropriate for the assembler to reorder .loc
+ entries. If this instruction is a branch that we are going to swap
+ with the previous instruction, the two instructions should be
+ treated as a unit, and the debug information for both instructions
+ should refer to the start of the branch sequence. Using the
+ current position is certainly wrong when swapping a 32-bit branch
+ and a 16-bit delay slot, since the current position would then be
+ in the middle of a branch. */
+ dwarf2_move_insn ((HAVE_CODE_COMPRESSION ? 1 : 0) - branch_disp);
#endif
relax32 = (mips_relax_branch
INSERT_OPERAND (0, SEQI, insn, va_arg (args, int));
continue;
+ case 'j':
+ INSERT_OPERAND (mips_opts.micromips, EVAOFFSET, insn, va_arg (args, int));
+ continue;
+
default:
abort ();
}
const char *fmt;
int likely = 0;
int coproc = 0;
- int off12 = 0;
+ int offbits = 16;
int call = 0;
int jals = 0;
int dbl = 0;
int ust = 0;
int lp = 0;
int ab = 0;
- int off0 = 0;
int off;
offsetT maxnum;
bfd_reloc_code_real_type r;
break;
+ case M_LBUE_AB:
+ ab = 1;
+ case M_LBUE_OB:
+ s = "lbue";
+ fmt = "t,+j(b)";
+ offbits = 9;
+ goto ld_st;
+ case M_LHUE_AB:
+ ab = 1;
+ case M_LHUE_OB:
+ s = "lhue";
+ fmt = "t,+j(b)";
+ offbits = 9;
+ goto ld_st;
+ case M_LBE_AB:
+ ab = 1;
+ case M_LBE_OB:
+ s = "lbe";
+ fmt = "t,+j(b)";
+ offbits = 9;
+ goto ld_st;
+ case M_LHE_AB:
+ ab = 1;
+ case M_LHE_OB:
+ s = "lhe";
+ fmt = "t,+j(b)";
+ offbits = 9;
+ goto ld_st;
+ case M_LLE_AB:
+ ab = 1;
+ case M_LLE_OB:
+ s = "lle";
+ fmt = "t,+j(b)";
+ offbits = 9;
+ goto ld_st;
+ case M_LWE_AB:
+ ab = 1;
+ case M_LWE_OB:
+ s = "lwe";
+ fmt = "t,+j(b)";
+ offbits = 9;
+ goto ld_st;
+ case M_LWLE_AB:
+ ab = 1;
+ case M_LWLE_OB:
+ s = "lwle";
+ fmt = "t,+j(b)";
+ offbits = 9;
+ goto ld_st;
+ case M_LWRE_AB:
+ ab = 1;
+ case M_LWRE_OB:
+ s = "lwre";
+ fmt = "t,+j(b)";
+ offbits = 9;
+ goto ld_st;
+ case M_SBE_AB:
+ ab = 1;
+ case M_SBE_OB:
+ s = "sbe";
+ fmt = "t,+j(b)";
+ offbits = 9;
+ goto ld_st;
+ case M_SCE_AB:
+ ab = 1;
+ case M_SCE_OB:
+ s = "sce";
+ fmt = "t,+j(b)";
+ offbits = 9;
+ goto ld_st;
+ case M_SHE_AB:
+ ab = 1;
+ case M_SHE_OB:
+ s = "she";
+ fmt = "t,+j(b)";
+ offbits = 9;
+ goto ld_st;
+ case M_SWE_AB:
+ ab = 1;
+ case M_SWE_OB:
+ s = "swe";
+ fmt = "t,+j(b)";
+ offbits = 9;
+ goto ld_st;
+ case M_SWLE_AB:
+ ab = 1;
+ case M_SWLE_OB:
+ s = "swle";
+ fmt = "t,+j(b)";
+ offbits = 9;
+ goto ld_st;
+ case M_SWRE_AB:
+ ab = 1;
+ case M_SWRE_OB:
+ s = "swre";
+ fmt = "t,+j(b)";
+ offbits = 9;
+ goto ld_st;
case M_ACLR_AB:
ab = 1;
case M_ACLR_OB:
s = "aclr";
treg = EXTRACT_OPERAND (mips_opts.micromips, 3BITPOS, *ip);
fmt = "\\,~(b)";
- off12 = 1;
+ offbits = 12;
goto ld_st;
case M_ASET_AB:
ab = 1;
s = "aset";
treg = EXTRACT_OPERAND (mips_opts.micromips, 3BITPOS, *ip);
fmt = "\\,~(b)";
- off12 = 1;
+ offbits = 12;
goto ld_st;
case M_LB_AB:
ab = 1;
case M_LWC2_OB:
s = "lwc2";
fmt = COP12_FMT;
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
/* Itbl support may require additional care here. */
coproc = 1;
goto ld_st;
case M_LWL_OB:
s = "lwl";
fmt = MEM12_FMT;
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
goto ld_st;
case M_LWR_AB:
ab = 1;
case M_LWR_OB:
s = "lwr";
fmt = MEM12_FMT;
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
goto ld_st;
case M_LDC1_AB:
ab = 1;
case M_LDC2_OB:
s = "ldc2";
fmt = COP12_FMT;
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
/* Itbl support may require additional care here. */
coproc = 1;
goto ld_st;
case M_LDL_OB:
s = "ldl";
fmt = MEM12_FMT;
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
goto ld_st;
case M_LDR_AB:
ab = 1;
case M_LDR_OB:
s = "ldr";
fmt = MEM12_FMT;
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
goto ld_st;
case M_LL_AB:
ab = 1;
case M_LL_OB:
s = "ll";
fmt = MEM12_FMT;
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
goto ld;
case M_LLD_AB:
ab = 1;
case M_LLD_OB:
s = "lld";
fmt = MEM12_FMT;
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
goto ld;
case M_LWU_AB:
ab = 1;
case M_LWU_OB:
s = "lwu";
fmt = MEM12_FMT;
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
goto ld;
case M_LWP_AB:
ab = 1;
gas_assert (mips_opts.micromips);
s = "lwp";
fmt = "t,~(b)";
- off12 = 1;
+ offbits = 12;
lp = 1;
goto ld;
case M_LDP_AB:
gas_assert (mips_opts.micromips);
s = "ldp";
fmt = "t,~(b)";
- off12 = 1;
+ offbits = 12;
lp = 1;
goto ld;
case M_LWM_AB:
gas_assert (mips_opts.micromips);
s = "lwm";
fmt = "n,~(b)";
- off12 = 1;
+ offbits = 12;
goto ld_st;
case M_LDM_AB:
ab = 1;
gas_assert (mips_opts.micromips);
s = "ldm";
fmt = "n,~(b)";
- off12 = 1;
+ offbits = 12;
goto ld_st;
ld:
case M_SWC2_OB:
s = "swc2";
fmt = COP12_FMT;
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
/* Itbl support may require additional care here. */
coproc = 1;
goto ld_st;
case M_SWL_OB:
s = "swl";
fmt = MEM12_FMT;
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
goto ld_st;
case M_SWR_AB:
ab = 1;
case M_SWR_OB:
s = "swr";
fmt = MEM12_FMT;
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
goto ld_st;
case M_SC_AB:
ab = 1;
case M_SC_OB:
s = "sc";
fmt = MEM12_FMT;
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
goto ld_st;
case M_SCD_AB:
ab = 1;
case M_SCD_OB:
s = "scd";
fmt = MEM12_FMT;
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
goto ld_st;
case M_CACHE_AB:
ab = 1;
case M_CACHE_OB:
s = "cache";
fmt = mips_opts.micromips ? "k,~(b)" : "k,o(b)";
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
+ goto ld_st;
+ case M_CACHEE_AB:
+ ab = 1;
+ case M_CACHEE_OB:
+ s = "cachee";
+ fmt = "k,+j(b)";
+ offbits = 9;
goto ld_st;
case M_PREF_AB:
ab = 1;
case M_PREF_OB:
s = "pref";
fmt = !mips_opts.micromips ? "k,o(b)" : "k,~(b)";
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
+ goto ld_st;
+ case M_PREFE_AB:
+ ab = 1;
+ case M_PREFE_OB:
+ s = "prefe";
+ fmt = "k,+j(b)";
+ offbits = 9;
goto ld_st;
case M_SDC1_AB:
ab = 1;
case M_SDC2_OB:
s = "sdc2";
fmt = COP12_FMT;
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
/* Itbl support may require additional care here. */
coproc = 1;
goto ld_st;
case M_SDL_OB:
s = "sdl";
fmt = MEM12_FMT;
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
goto ld_st;
case M_SDR_AB:
ab = 1;
case M_SDR_OB:
s = "sdr";
fmt = MEM12_FMT;
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
goto ld_st;
case M_SWP_AB:
ab = 1;
gas_assert (mips_opts.micromips);
s = "swp";
fmt = "t,~(b)";
- off12 = 1;
+ offbits = 12;
goto ld_st;
case M_SDP_AB:
ab = 1;
gas_assert (mips_opts.micromips);
s = "sdp";
fmt = "t,~(b)";
- off12 = 1;
+ offbits = 12;
goto ld_st;
case M_SWM_AB:
ab = 1;
gas_assert (mips_opts.micromips);
s = "swm";
fmt = "n,~(b)";
- off12 = 1;
+ offbits = 12;
goto ld_st;
case M_SDM_AB:
ab = 1;
gas_assert (mips_opts.micromips);
s = "sdm";
fmt = "n,~(b)";
- off12 = 1;
+ offbits = 12;
ld_st:
tempreg = AT;
expr1.X_add_number = offset_expr.X_add_number;
normalize_address_expr (&expr1);
- if (!off12 && !IS_SEXT_16BIT_NUM (expr1.X_add_number))
+ if ((offbits == 0 || offbits == 16)
+ && !IS_SEXT_16BIT_NUM (expr1.X_add_number))
{
expr1.X_add_number = ((expr1.X_add_number + 0x8000)
& ~(bfd_vma) 0xffff);
hipart = 1;
}
- else if (off12 && !IS_SEXT_12BIT_NUM (expr1.X_add_number))
+ else if (offbits == 12 && !IS_SEXT_12BIT_NUM (expr1.X_add_number))
{
expr1.X_add_number = ((expr1.X_add_number + 0x800)
& ~(bfd_vma) 0xfff);
hipart = 1;
}
+ else if (offbits == 9 && !IS_SEXT_9BIT_NUM (expr1.X_add_number))
+ {
+ expr1.X_add_number = ((expr1.X_add_number + 0x100)
+ & ~(bfd_vma) 0x1ff);
+ hipart = 1;
+ }
if (hipart)
{
load_register (tempreg, &expr1, HAVE_64BIT_ADDRESSES);
tempreg, tempreg, breg);
breg = tempreg;
}
- if (off0)
+ if (offbits == 0)
{
if (offset_expr.X_add_number == 0)
tempreg = breg;
"t,r,j", tempreg, breg, BFD_RELOC_LO16);
macro_build (NULL, s, fmt, treg, tempreg);
}
- else if (!off12)
+ else if (offbits == 16)
macro_build (&offset_expr, s, fmt, treg, BFD_RELOC_LO16, breg);
else
macro_build (NULL, s, fmt,
treg, (unsigned long) offset_expr.X_add_number, breg);
}
- else if (off12 || off0)
+ else if (offbits != 16)
{
- /* A 12-bit or 0-bit offset field is too narrow to be used
- for a low-part relocation, so load the whole address into
- the auxillary register. In the case of "A(b)" addresses,
- we first load absolute address "A" into the register and
- then add base register "b". In the case of "o(b)" addresses,
- we simply need to add 16-bit offset "o" to base register "b", and
+ /* The offset field is too narrow to be used for a low-part
+ relocation, so load the whole address into the auxillary
+ register. In the case of "A(b)" addresses, we first load
+ absolute address "A" into the register and then add base
+ register "b". In the case of "o(b)" addresses, we simply
+ need to add 16-bit offset "o" to base register "b", and
offset_reloc already contains the relocations associated
with "o". */
if (ab)
tempreg, breg, -1,
offset_reloc[0], offset_reloc[1], offset_reloc[2]);
expr1.X_add_number = 0;
- if (off0)
+ if (offbits == 0)
macro_build (NULL, s, fmt, treg, tempreg);
else
macro_build (NULL, s, fmt,
ab = 1;
case M_SAA_OB:
s = "saa";
- off0 = 1;
+ offbits = 0;
fmt = "t,(b)";
goto ld_st;
case M_SAAD_AB:
ab = 1;
case M_SAAD_OB:
s = "saad";
- off0 = 1;
+ offbits = 0;
fmt = "t,(b)";
goto ld_st;
case M_ULW:
s = "lwl";
s2 = "lwr";
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
off = 3;
goto uld_st;
case M_ULD_A:
case M_ULD:
s = "ldl";
s2 = "ldr";
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
off = 7;
goto uld_st;
case M_USH_A:
case M_USW:
s = "swl";
s2 = "swr";
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
off = 3;
ust = 1;
goto uld_st;
case M_USD:
s = "sdl";
s2 = "sdr";
- off12 = mips_opts.micromips;
+ offbits = (mips_opts.micromips ? 12 : 16);
off = 7;
ust = 1;
tempreg = treg;
ep = &expr1;
}
- else if (off12
+ else if (offbits == 12
&& (offset_expr.X_op != O_constant
|| !IS_SEXT_12BIT_NUM (offset_expr.X_add_number)
|| !IS_SEXT_12BIT_NUM (offset_expr.X_add_number + off)))
if (!target_big_endian)
ep->X_add_number += off;
- if (!off12)
+ if (offbits != 12)
macro_build (ep, s, "t,o(b)", tempreg, BFD_RELOC_LO16, breg);
else
macro_build (NULL, s, "t,~(b)",
ep->X_add_number -= off;
else
ep->X_add_number += off;
- if (!off12)
+ if (offbits != 12)
macro_build (ep, s2, "t,o(b)", tempreg, BFD_RELOC_LO16, breg);
else
macro_build (NULL, s2, "t,~(b)",
case 'a': USE_BITS (OP_MASK_OFFSET_A, OP_SH_OFFSET_A); break;
case 'b': USE_BITS (OP_MASK_OFFSET_B, OP_SH_OFFSET_B); break;
case 'c': USE_BITS (OP_MASK_OFFSET_C, OP_SH_OFFSET_C); break;
+ case 'j': USE_BITS (OP_MASK_EVAOFFSET, OP_SH_EVAOFFSET); break;
default:
as_bad (_("internal: bad mips opcode (unknown extension operand type `+%c'): %s %s"),
case 'F': USE_BITS (INSMSB); break;
case 'G': USE_BITS (EXTMSBD); break;
case 'H': USE_BITS (EXTMSBD); break;
+ case 'j': USE_BITS (EVAOFFSET); break;
default:
as_bad (_("Internal error: bad mips opcode "
"(unknown extension operand type `%c%c'): %s %s"),
INSERT_OPERAND (0, FZ, *ip, regno);
continue;
+ case 'j':
+ {
+ int shift = 8;
+ size_t i;
+ /* Check whether there is only a single bracketed expression
+ left. If so, it must be the base register and the
+ constant must be zero. */
+ if (*s == '(' && strchr (s + 1, '(') == 0)
+ continue;
+
+ /* If this value won't fit into the offset, then go find
+ a macro that will generate a 16- or 32-bit offset code
+ pattern. */
+ i = my_getSmallExpression (&imm_expr, imm_reloc, s);
+ if ((i == 0 && (imm_expr.X_op != O_constant
+ || imm_expr.X_add_number >= 1 << shift
+ || imm_expr.X_add_number < -1 << shift))
+ || i > 0)
+ {
+ imm_expr.X_op = O_absent;
+ break;
+ }
+ INSERT_OPERAND (mips_opts.micromips, EVAOFFSET, *ip,
+ imm_expr.X_add_number);
+ imm_expr.X_op = O_absent;
+ s = expr_end;
+ }
+ continue;
+
default:
as_bad (_("Internal error: bad %s opcode "
"(unknown extension operand type `+%c'): %s %s"),
case 'V':
rtype = RTYPE_FPU;
if (is_mdmx
- || (mips_opts.ase_mdmx
+ || ((mips_opts.ase & ASE_MDMX)
&& (ip->insn_mo->pinfo & FP_D)
&& (ip->insn_mo->pinfo & (INSN_COPROC_MOVE_DELAY
| INSN_COPROC_MEMORY_DELAY
}
#endif /* OBJ_ELF */
-const char *md_shortopts = "O::g::G:";
-
-enum options
- {
- OPTION_MARCH = OPTION_MD_BASE,
- OPTION_MTUNE,
- OPTION_MIPS1,
- OPTION_MIPS2,
- OPTION_MIPS3,
- OPTION_MIPS4,
- OPTION_MIPS5,
- OPTION_MIPS32,
- OPTION_MIPS64,
- OPTION_MIPS32R2,
- OPTION_MIPS64R2,
- OPTION_MIPS16,
- OPTION_NO_MIPS16,
- OPTION_MIPS3D,
- OPTION_NO_MIPS3D,
- OPTION_MDMX,
- OPTION_NO_MDMX,
- OPTION_DSP,
- OPTION_NO_DSP,
- OPTION_MT,
- OPTION_NO_MT,
- OPTION_VIRT,
- OPTION_NO_VIRT,
- OPTION_SMARTMIPS,
- OPTION_NO_SMARTMIPS,
- OPTION_DSPR2,
- OPTION_NO_DSPR2,
- OPTION_MICROMIPS,
- OPTION_NO_MICROMIPS,
- OPTION_MCU,
- OPTION_NO_MCU,
- OPTION_COMPAT_ARCH_BASE,
- OPTION_M4650,
- OPTION_NO_M4650,
- OPTION_M4010,
- OPTION_NO_M4010,
- OPTION_M4100,
- OPTION_NO_M4100,
- OPTION_M3900,
- OPTION_NO_M3900,
- OPTION_M7000_HILO_FIX,
- OPTION_MNO_7000_HILO_FIX,
- OPTION_FIX_24K,
- OPTION_NO_FIX_24K,
- OPTION_FIX_LOONGSON2F_JUMP,
- OPTION_NO_FIX_LOONGSON2F_JUMP,
- OPTION_FIX_LOONGSON2F_NOP,
- OPTION_NO_FIX_LOONGSON2F_NOP,
- OPTION_FIX_VR4120,
- OPTION_NO_FIX_VR4120,
- OPTION_FIX_VR4130,
- OPTION_NO_FIX_VR4130,
- OPTION_FIX_CN63XXP1,
- OPTION_NO_FIX_CN63XXP1,
- OPTION_TRAP,
- OPTION_BREAK,
- OPTION_EB,
- OPTION_EL,
- OPTION_FP32,
- OPTION_GP32,
- OPTION_CONSTRUCT_FLOATS,
- OPTION_NO_CONSTRUCT_FLOATS,
- OPTION_FP64,
- OPTION_GP64,
- OPTION_RELAX_BRANCH,
- OPTION_NO_RELAX_BRANCH,
- OPTION_MSHARED,
- OPTION_MNO_SHARED,
- OPTION_MSYM32,
- OPTION_MNO_SYM32,
- OPTION_SOFT_FLOAT,
- OPTION_HARD_FLOAT,
- OPTION_SINGLE_FLOAT,
- OPTION_DOUBLE_FLOAT,
- OPTION_32,
-#ifdef OBJ_ELF
- OPTION_CALL_SHARED,
- OPTION_CALL_NONPIC,
- OPTION_NON_SHARED,
- OPTION_XGOT,
- OPTION_MABI,
- OPTION_N32,
- OPTION_64,
- OPTION_MDEBUG,
- OPTION_NO_MDEBUG,
- OPTION_PDR,
- OPTION_NO_PDR,
- OPTION_MVXWORKS_PIC,
-#endif /* OBJ_ELF */
- OPTION_END_OF_ENUM
- };
-
-struct option md_longopts[] =
-{
- /* Options which specify architecture. */
- {"march", required_argument, NULL, OPTION_MARCH},
- {"mtune", required_argument, NULL, OPTION_MTUNE},
- {"mips0", no_argument, NULL, OPTION_MIPS1},
- {"mips1", no_argument, NULL, OPTION_MIPS1},
- {"mips2", no_argument, NULL, OPTION_MIPS2},
- {"mips3", no_argument, NULL, OPTION_MIPS3},
- {"mips4", no_argument, NULL, OPTION_MIPS4},
- {"mips5", no_argument, NULL, OPTION_MIPS5},
- {"mips32", no_argument, NULL, OPTION_MIPS32},
- {"mips64", no_argument, NULL, OPTION_MIPS64},
- {"mips32r2", no_argument, NULL, OPTION_MIPS32R2},
- {"mips64r2", no_argument, NULL, OPTION_MIPS64R2},
-
- /* Options which specify Application Specific Extensions (ASEs). */
- {"mips16", no_argument, NULL, OPTION_MIPS16},
- {"no-mips16", no_argument, NULL, OPTION_NO_MIPS16},
- {"mips3d", no_argument, NULL, OPTION_MIPS3D},
- {"no-mips3d", no_argument, NULL, OPTION_NO_MIPS3D},
- {"mdmx", no_argument, NULL, OPTION_MDMX},
- {"no-mdmx", no_argument, NULL, OPTION_NO_MDMX},
- {"mdsp", no_argument, NULL, OPTION_DSP},
- {"mno-dsp", no_argument, NULL, OPTION_NO_DSP},
- {"mmt", no_argument, NULL, OPTION_MT},
- {"mno-mt", no_argument, NULL, OPTION_NO_MT},
- {"msmartmips", no_argument, NULL, OPTION_SMARTMIPS},
- {"mno-smartmips", no_argument, NULL, OPTION_NO_SMARTMIPS},
- {"mdspr2", no_argument, NULL, OPTION_DSPR2},
- {"mno-dspr2", no_argument, NULL, OPTION_NO_DSPR2},
- {"mmicromips", no_argument, NULL, OPTION_MICROMIPS},
- {"mno-micromips", no_argument, NULL, OPTION_NO_MICROMIPS},
- {"mmcu", no_argument, NULL, OPTION_MCU},
- {"mno-mcu", no_argument, NULL, OPTION_NO_MCU},
- {"mvirt", no_argument, NULL, OPTION_VIRT},
- {"mno-virt", no_argument, NULL, OPTION_NO_VIRT},
-
- /* Old-style architecture options. Don't add more of these. */
- {"m4650", no_argument, NULL, OPTION_M4650},
- {"no-m4650", no_argument, NULL, OPTION_NO_M4650},
- {"m4010", no_argument, NULL, OPTION_M4010},
- {"no-m4010", no_argument, NULL, OPTION_NO_M4010},
- {"m4100", no_argument, NULL, OPTION_M4100},
- {"no-m4100", no_argument, NULL, OPTION_NO_M4100},
- {"m3900", no_argument, NULL, OPTION_M3900},
- {"no-m3900", no_argument, NULL, OPTION_NO_M3900},
-
- /* Options which enable bug fixes. */
- {"mfix7000", no_argument, NULL, OPTION_M7000_HILO_FIX},
- {"no-fix-7000", no_argument, NULL, OPTION_MNO_7000_HILO_FIX},
- {"mno-fix7000", no_argument, NULL, OPTION_MNO_7000_HILO_FIX},
- {"mfix-loongson2f-jump", no_argument, NULL, OPTION_FIX_LOONGSON2F_JUMP},
- {"mno-fix-loongson2f-jump", no_argument, NULL, OPTION_NO_FIX_LOONGSON2F_JUMP},
- {"mfix-loongson2f-nop", no_argument, NULL, OPTION_FIX_LOONGSON2F_NOP},
- {"mno-fix-loongson2f-nop", no_argument, NULL, OPTION_NO_FIX_LOONGSON2F_NOP},
- {"mfix-vr4120", no_argument, NULL, OPTION_FIX_VR4120},
- {"mno-fix-vr4120", no_argument, NULL, OPTION_NO_FIX_VR4120},
- {"mfix-vr4130", no_argument, NULL, OPTION_FIX_VR4130},
- {"mno-fix-vr4130", no_argument, NULL, OPTION_NO_FIX_VR4130},
- {"mfix-24k", no_argument, NULL, OPTION_FIX_24K},
- {"mno-fix-24k", no_argument, NULL, OPTION_NO_FIX_24K},
- {"mfix-cn63xxp1", no_argument, NULL, OPTION_FIX_CN63XXP1},
- {"mno-fix-cn63xxp1", no_argument, NULL, OPTION_NO_FIX_CN63XXP1},
-
- /* Miscellaneous options. */
- {"trap", no_argument, NULL, OPTION_TRAP},
- {"no-break", no_argument, NULL, OPTION_TRAP},
- {"break", no_argument, NULL, OPTION_BREAK},
- {"no-trap", no_argument, NULL, OPTION_BREAK},
- {"EB", no_argument, NULL, OPTION_EB},
- {"EL", no_argument, NULL, OPTION_EL},
- {"mfp32", no_argument, NULL, OPTION_FP32},
- {"mgp32", no_argument, NULL, OPTION_GP32},
- {"construct-floats", no_argument, NULL, OPTION_CONSTRUCT_FLOATS},
- {"no-construct-floats", no_argument, NULL, OPTION_NO_CONSTRUCT_FLOATS},
- {"mfp64", no_argument, NULL, OPTION_FP64},
- {"mgp64", no_argument, NULL, OPTION_GP64},
- {"relax-branch", no_argument, NULL, OPTION_RELAX_BRANCH},
- {"no-relax-branch", no_argument, NULL, OPTION_NO_RELAX_BRANCH},
- {"mshared", no_argument, NULL, OPTION_MSHARED},
- {"mno-shared", no_argument, NULL, OPTION_MNO_SHARED},
- {"msym32", no_argument, NULL, OPTION_MSYM32},
- {"mno-sym32", no_argument, NULL, OPTION_MNO_SYM32},
- {"msoft-float", no_argument, NULL, OPTION_SOFT_FLOAT},
- {"mhard-float", no_argument, NULL, OPTION_HARD_FLOAT},
- {"msingle-float", no_argument, NULL, OPTION_SINGLE_FLOAT},
- {"mdouble-float", no_argument, NULL, OPTION_DOUBLE_FLOAT},
-
- /* Strictly speaking this next option is ELF specific,
- but we allow it for other ports as well in order to
- make testing easier. */
- {"32", no_argument, NULL, OPTION_32},
-
- /* ELF-specific options. */
-#ifdef OBJ_ELF
- {"KPIC", no_argument, NULL, OPTION_CALL_SHARED},
- {"call_shared", no_argument, NULL, OPTION_CALL_SHARED},
- {"call_nonpic", no_argument, NULL, OPTION_CALL_NONPIC},
- {"non_shared", no_argument, NULL, OPTION_NON_SHARED},
- {"xgot", no_argument, NULL, OPTION_XGOT},
- {"mabi", required_argument, NULL, OPTION_MABI},
- {"n32", no_argument, NULL, OPTION_N32},
- {"64", no_argument, NULL, OPTION_64},
- {"mdebug", no_argument, NULL, OPTION_MDEBUG},
- {"no-mdebug", no_argument, NULL, OPTION_NO_MDEBUG},
- {"mpdr", no_argument, NULL, OPTION_PDR},
- {"mno-pdr", no_argument, NULL, OPTION_NO_PDR},
- {"mvxworks-pic", no_argument, NULL, OPTION_MVXWORKS_PIC},
-#endif /* OBJ_ELF */
-
- {NULL, no_argument, NULL, 0}
-};
-size_t md_longopts_size = sizeof (md_longopts);
-
/* Set STRING_PTR (either &mips_arch_string or &mips_tune_string) to
NEW_VALUE. Warn if another value was already specified. Note:
we have to defer parsing the -march and -mtune arguments in order
break;
case OPTION_MDMX:
- mips_opts.ase_mdmx = 1;
+ mips_opts.ase |= ASE_MDMX;
+ file_ase_explicit |= ASE_MDMX;
break;
case OPTION_NO_MDMX:
- mips_opts.ase_mdmx = 0;
+ mips_opts.ase &= ~ASE_MDMX;
+ file_ase_explicit |= ASE_MDMX;
break;
case OPTION_DSP:
- mips_opts.ase_dsp = 1;
- mips_opts.ase_dspr2 = 0;
+ mips_opts.ase |= ASE_DSP;
+ mips_opts.ase &= ~ASE_DSPR2;
+ file_ase_explicit |= ASE_DSP | ASE_DSPR2;
+ break;
+
+ case OPTION_DSPR2:
+ mips_opts.ase |= ASE_DSP | ASE_DSPR2;
+ file_ase_explicit |= ASE_DSP | ASE_DSPR2;
break;
case OPTION_NO_DSP:
- mips_opts.ase_dsp = 0;
- mips_opts.ase_dspr2 = 0;
+ case OPTION_NO_DSPR2:
+ mips_opts.ase &= ~(ASE_DSP | ASE_DSPR2);
+ file_ase_explicit |= ASE_DSP | ASE_DSPR2;
break;
- case OPTION_DSPR2:
- mips_opts.ase_dspr2 = 1;
- mips_opts.ase_dsp = 1;
+ case OPTION_EVA:
+ mips_opts.ase |= ASE_EVA;
+ file_ase_explicit |= ASE_EVA;
break;
- case OPTION_NO_DSPR2:
- mips_opts.ase_dspr2 = 0;
- mips_opts.ase_dsp = 0;
+ case OPTION_NO_EVA:
+ mips_opts.ase &= ~ASE_EVA;
+ file_ase_explicit |= ASE_EVA;
break;
case OPTION_MT:
- mips_opts.ase_mt = 1;
+ mips_opts.ase |= ASE_MT;
+ file_ase_explicit |= ASE_MT;
break;
case OPTION_NO_MT:
- mips_opts.ase_mt = 0;
+ mips_opts.ase &= ~ASE_MT;
+ file_ase_explicit |= ASE_MT;
break;
case OPTION_MCU:
- mips_opts.ase_mcu = 1;
+ mips_opts.ase |= ASE_MCU;
+ file_ase_explicit |= ASE_MCU;
break;
case OPTION_NO_MCU:
- mips_opts.ase_mcu = 0;
+ mips_opts.ase &= ~ASE_MCU;
+ file_ase_explicit |= ASE_MCU;
break;
case OPTION_MICROMIPS:
break;
case OPTION_VIRT:
- mips_opts.ase_virt = 1;
+ mips_opts.ase |= ASE_VIRT;
+ file_ase_explicit |= ASE_VIRT;
break;
case OPTION_NO_VIRT:
- mips_opts.ase_virt = 0;
+ mips_opts.ase &= ~ASE_VIRT;
+ file_ase_explicit |= ASE_VIRT;
break;
case OPTION_MIPS16:
break;
case OPTION_MIPS3D:
- mips_opts.ase_mips3d = 1;
+ mips_opts.ase |= ASE_MIPS3D;
+ file_ase_explicit |= ASE_MIPS3D;
break;
case OPTION_NO_MIPS3D:
- mips_opts.ase_mips3d = 0;
+ mips_opts.ase &= ~ASE_MIPS3D;
+ file_ase_explicit |= ASE_MIPS3D;
break;
case OPTION_SMARTMIPS:
- mips_opts.ase_smartmips = 1;
+ mips_opts.ase |= ASE_SMARTMIPS;
+ file_ase_explicit |= ASE_SMARTMIPS;
break;
case OPTION_NO_SMARTMIPS:
- mips_opts.ase_smartmips = 0;
+ mips_opts.ase &= ~ASE_SMARTMIPS;
+ file_ase_explicit |= ASE_SMARTMIPS;
break;
case OPTION_FIX_24K:
if (file_mips_gp32 == 0)
/* 64-bit integer registers implies 64-bit float registers. */
file_mips_fp32 = 0;
- else if ((mips_opts.ase_mips3d > 0 || mips_opts.ase_mdmx > 0)
+ else if ((mips_opts.ase & (ASE_MIPS3D | ASE_MDMX))
&& ISA_HAS_64BIT_FPRS (mips_opts.isa))
/* -mips3d and -mdmx imply 64-bit float registers, if possible. */
file_mips_fp32 = 0;
mips_opts.mips16 = (CPU_HAS_MIPS16 (file_mips_arch)) ? 1 : 0;
if (mips_opts.micromips == -1)
mips_opts.micromips = (CPU_HAS_MICROMIPS (file_mips_arch)) ? 1 : 0;
- if (mips_opts.ase_mips3d == -1)
- mips_opts.ase_mips3d = ((arch_info->flags & MIPS_CPU_ASE_MIPS3D)
- && file_mips_fp32 == 0) ? 1 : 0;
- if (mips_opts.ase_mips3d && file_mips_fp32 == 1)
+
+ /* MIPS3D and MDMX require 64-bit FPRs, so -mfp32 should stop those
+ ASEs from being selected implicitly. */
+ if (file_mips_fp32 == 1)
+ file_ase_explicit |= ASE_MIPS3D | ASE_MDMX;
+
+ /* If the user didn't explicitly select or deselect a particular ASE,
+ use the default setting for the CPU. */
+ mips_opts.ase |= (arch_info->ase & ~file_ase_explicit);
+
+ if ((mips_opts.ase & ASE_MIPS3D) && file_mips_fp32 == 1)
as_bad (_("-mfp32 used with -mips3d"));
- if (mips_opts.ase_mdmx == -1)
- mips_opts.ase_mdmx = ((arch_info->flags & MIPS_CPU_ASE_MDMX)
- && file_mips_fp32 == 0) ? 1 : 0;
- if (mips_opts.ase_mdmx && file_mips_fp32 == 1)
+ if ((mips_opts.ase & ASE_MDMX) && file_mips_fp32 == 1)
as_bad (_("-mfp32 used with -mdmx"));
- if (mips_opts.ase_smartmips == -1)
- mips_opts.ase_smartmips = (arch_info->flags & MIPS_CPU_ASE_SMARTMIPS) ? 1 : 0;
- if (mips_opts.ase_smartmips && !ISA_SUPPORTS_SMARTMIPS)
+ if ((mips_opts.ase & ASE_SMARTMIPS) && !ISA_SUPPORTS_SMARTMIPS)
as_warn (_("%s ISA does not support SmartMIPS"),
mips_cpu_info_from_isa (mips_opts.isa)->name);
- if (mips_opts.ase_dsp == -1)
- mips_opts.ase_dsp = (arch_info->flags & MIPS_CPU_ASE_DSP) ? 1 : 0;
- if (mips_opts.ase_dsp && !ISA_SUPPORTS_DSP_ASE)
+ if ((mips_opts.ase & ASE_DSP) && !ISA_SUPPORTS_DSP_ASE)
as_warn (_("%s ISA does not support DSP ASE"),
mips_cpu_info_from_isa (mips_opts.isa)->name);
- if (mips_opts.ase_dspr2 == -1)
- {
- mips_opts.ase_dspr2 = (arch_info->flags & MIPS_CPU_ASE_DSPR2) ? 1 : 0;
- mips_opts.ase_dsp = (arch_info->flags & MIPS_CPU_ASE_DSP) ? 1 : 0;
- }
- if (mips_opts.ase_dspr2 && !ISA_SUPPORTS_DSPR2_ASE)
+ if ((mips_opts.ase & ASE_DSPR2) && !ISA_SUPPORTS_DSPR2_ASE)
as_warn (_("%s ISA does not support DSP R2 ASE"),
mips_cpu_info_from_isa (mips_opts.isa)->name);
- if (mips_opts.ase_mt == -1)
- mips_opts.ase_mt = (arch_info->flags & MIPS_CPU_ASE_MT) ? 1 : 0;
- if (mips_opts.ase_mt && !ISA_SUPPORTS_MT_ASE)
+ if ((mips_opts.ase & ASE_EVA) && !ISA_SUPPORTS_EVA_ASE)
+ as_warn (_("%s ISA does not support EVA ASE"),
+ mips_cpu_info_from_isa (mips_opts.isa)->name);
+
+ if ((mips_opts.ase & ASE_MT) && !ISA_SUPPORTS_MT_ASE)
as_warn (_("%s ISA does not support MT ASE"),
mips_cpu_info_from_isa (mips_opts.isa)->name);
- if (mips_opts.ase_mcu == -1)
- mips_opts.ase_mcu = (arch_info->flags & MIPS_CPU_ASE_MCU) ? 1 : 0;
- if (mips_opts.ase_mcu && !ISA_SUPPORTS_MCU_ASE)
- as_warn (_("%s ISA does not support MCU ASE"),
- mips_cpu_info_from_isa (mips_opts.isa)->name);
+ if ((mips_opts.ase & ASE_MCU) && !ISA_SUPPORTS_MCU_ASE)
+ as_warn (_("%s ISA does not support MCU ASE"),
+ mips_cpu_info_from_isa (mips_opts.isa)->name);
- if (mips_opts.ase_virt == -1)
- mips_opts.ase_virt = (arch_info->flags & MIPS_CPU_ASE_VIRT) ? 1 : 0;
- if (mips_opts.ase_virt && !ISA_SUPPORTS_VIRT_ASE)
+ if ((mips_opts.ase & ASE_VIRT) && !ISA_SUPPORTS_VIRT_ASE)
as_warn (_("%s ISA does not support Virtualization ASE"),
mips_cpu_info_from_isa (mips_opts.isa)->name);
file_mips_isa = mips_opts.isa;
- file_ase_mips3d = mips_opts.ase_mips3d;
- file_ase_mdmx = mips_opts.ase_mdmx;
- file_ase_smartmips = mips_opts.ase_smartmips;
- file_ase_dsp = mips_opts.ase_dsp;
- file_ase_dspr2 = mips_opts.ase_dspr2;
- file_ase_mt = mips_opts.ase_mt;
- file_ase_virt = mips_opts.ase_virt;
+ file_ase = mips_opts.ase;
mips_opts.gp32 = file_mips_gp32;
mips_opts.fp32 = file_mips_fp32;
mips_opts.soft_float = file_mips_soft_float;
if (!ISA_SUPPORTS_SMARTMIPS)
as_warn (_("%s ISA does not support SmartMIPS ASE"),
mips_cpu_info_from_isa (mips_opts.isa)->name);
- mips_opts.ase_smartmips = 1;
+ mips_opts.ase |= ASE_SMARTMIPS;
}
else if (strcmp (name, "nosmartmips") == 0)
- mips_opts.ase_smartmips = 0;
+ mips_opts.ase &= ~ASE_SMARTMIPS;
else if (strcmp (name, "mips3d") == 0)
- mips_opts.ase_mips3d = 1;
+ mips_opts.ase |= ASE_MIPS3D;
else if (strcmp (name, "nomips3d") == 0)
- mips_opts.ase_mips3d = 0;
+ mips_opts.ase &= ~ASE_MIPS3D;
else if (strcmp (name, "mdmx") == 0)
- mips_opts.ase_mdmx = 1;
+ mips_opts.ase |= ASE_MDMX;
else if (strcmp (name, "nomdmx") == 0)
- mips_opts.ase_mdmx = 0;
+ mips_opts.ase &= ~ASE_MDMX;
else if (strcmp (name, "dsp") == 0)
{
if (!ISA_SUPPORTS_DSP_ASE)
as_warn (_("%s ISA does not support DSP ASE"),
mips_cpu_info_from_isa (mips_opts.isa)->name);
- mips_opts.ase_dsp = 1;
- mips_opts.ase_dspr2 = 0;
- }
- else if (strcmp (name, "nodsp") == 0)
- {
- mips_opts.ase_dsp = 0;
- mips_opts.ase_dspr2 = 0;
+ mips_opts.ase |= ASE_DSP;
+ mips_opts.ase &= ~ASE_DSPR2;
}
else if (strcmp (name, "dspr2") == 0)
{
if (!ISA_SUPPORTS_DSPR2_ASE)
as_warn (_("%s ISA does not support DSP R2 ASE"),
mips_cpu_info_from_isa (mips_opts.isa)->name);
- mips_opts.ase_dspr2 = 1;
- mips_opts.ase_dsp = 1;
+ mips_opts.ase |= ASE_DSP | ASE_DSPR2;
}
- else if (strcmp (name, "nodspr2") == 0)
+ else if (strcmp (name, "nodsp") == 0
+ || strcmp (name, "nodspr2") == 0)
+ mips_opts.ase &= ~(ASE_DSP | ASE_DSPR2);
+ else if (strcmp (name, "eva") == 0)
{
- mips_opts.ase_dspr2 = 0;
- mips_opts.ase_dsp = 0;
+ if (!ISA_SUPPORTS_EVA_ASE)
+ as_warn (_("%s ISA does not support EVA ASE"),
+ mips_cpu_info_from_isa (mips_opts.isa)->name);
+ mips_opts.ase |= ASE_EVA;
}
+ else if (strcmp (name, "noeva") == 0)
+ mips_opts.ase &= ~ASE_EVA;
else if (strcmp (name, "mt") == 0)
{
if (!ISA_SUPPORTS_MT_ASE)
as_warn (_("%s ISA does not support MT ASE"),
mips_cpu_info_from_isa (mips_opts.isa)->name);
- mips_opts.ase_mt = 1;
+ mips_opts.ase |= ASE_MT;
}
else if (strcmp (name, "nomt") == 0)
- mips_opts.ase_mt = 0;
+ mips_opts.ase &= ~ASE_MT;
else if (strcmp (name, "mcu") == 0)
- mips_opts.ase_mcu = 1;
+ mips_opts.ase |= ASE_MCU;
else if (strcmp (name, "nomcu") == 0)
- mips_opts.ase_mcu = 0;
+ mips_opts.ase &= ~ASE_MCU;
else if (strcmp (name, "virt") == 0)
{
if (!ISA_SUPPORTS_VIRT_ASE)
as_warn (_("%s ISA does not support Virtualization ASE"),
mips_cpu_info_from_isa (mips_opts.isa)->name);
- mips_opts.ase_virt = 1;
+ mips_opts.ase |= ASE_VIRT;
}
else if (strcmp (name, "novirt") == 0)
- mips_opts.ase_virt = 0;
+ mips_opts.ase &= ~ASE_VIRT;
else if (strncmp (name, "mips", 4) == 0 || strncmp (name, "arch=", 5) == 0)
{
int reset = 0;
elf_elfheader (stdoutput)->e_flags |= EF_MIPS_ARCH_ASE_M16;
if (file_ase_micromips)
elf_elfheader (stdoutput)->e_flags |= EF_MIPS_ARCH_ASE_MICROMIPS;
-#if 0 /* XXX FIXME */
- if (file_ase_mips3d)
- elf_elfheader (stdoutput)->e_flags |= ???;
-#endif
- if (file_ase_mdmx)
+ if (file_ase & ASE_MDMX)
elf_elfheader (stdoutput)->e_flags |= EF_MIPS_ARCH_ASE_MDMX;
/* Set the MIPS ELF ABI flags. */
static const struct mips_cpu_info mips_cpu_info_table[] =
{
/* Entries for generic ISAs */
- { "mips1", MIPS_CPU_IS_ISA, ISA_MIPS1, CPU_R3000 },
- { "mips2", MIPS_CPU_IS_ISA, ISA_MIPS2, CPU_R6000 },
- { "mips3", MIPS_CPU_IS_ISA, ISA_MIPS3, CPU_R4000 },
- { "mips4", MIPS_CPU_IS_ISA, ISA_MIPS4, CPU_R8000 },
- { "mips5", MIPS_CPU_IS_ISA, ISA_MIPS5, CPU_MIPS5 },
- { "mips32", MIPS_CPU_IS_ISA, ISA_MIPS32, CPU_MIPS32 },
- { "mips32r2", MIPS_CPU_IS_ISA, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "mips64", MIPS_CPU_IS_ISA, ISA_MIPS64, CPU_MIPS64 },
- { "mips64r2", MIPS_CPU_IS_ISA, ISA_MIPS64R2, CPU_MIPS64R2 },
+ { "mips1", MIPS_CPU_IS_ISA, 0, ISA_MIPS1, CPU_R3000 },
+ { "mips2", MIPS_CPU_IS_ISA, 0, ISA_MIPS2, CPU_R6000 },
+ { "mips3", MIPS_CPU_IS_ISA, 0, ISA_MIPS3, CPU_R4000 },
+ { "mips4", MIPS_CPU_IS_ISA, 0, ISA_MIPS4, CPU_R8000 },
+ { "mips5", MIPS_CPU_IS_ISA, 0, ISA_MIPS5, CPU_MIPS5 },
+ { "mips32", MIPS_CPU_IS_ISA, 0, ISA_MIPS32, CPU_MIPS32 },
+ { "mips32r2", MIPS_CPU_IS_ISA, 0, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "mips64", MIPS_CPU_IS_ISA, 0, ISA_MIPS64, CPU_MIPS64 },
+ { "mips64r2", MIPS_CPU_IS_ISA, 0, ISA_MIPS64R2, CPU_MIPS64R2 },
/* MIPS I */
- { "r3000", 0, ISA_MIPS1, CPU_R3000 },
- { "r2000", 0, ISA_MIPS1, CPU_R3000 },
- { "r3900", 0, ISA_MIPS1, CPU_R3900 },
+ { "r3000", 0, 0, ISA_MIPS1, CPU_R3000 },
+ { "r2000", 0, 0, ISA_MIPS1, CPU_R3000 },
+ { "r3900", 0, 0, ISA_MIPS1, CPU_R3900 },
/* MIPS II */
- { "r6000", 0, ISA_MIPS2, CPU_R6000 },
+ { "r6000", 0, 0, ISA_MIPS2, CPU_R6000 },
/* MIPS III */
- { "r4000", 0, ISA_MIPS3, CPU_R4000 },
- { "r4010", 0, ISA_MIPS2, CPU_R4010 },
- { "vr4100", 0, ISA_MIPS3, CPU_VR4100 },
- { "vr4111", 0, ISA_MIPS3, CPU_R4111 },
- { "vr4120", 0, ISA_MIPS3, CPU_VR4120 },
- { "vr4130", 0, ISA_MIPS3, CPU_VR4120 },
- { "vr4181", 0, ISA_MIPS3, CPU_R4111 },
- { "vr4300", 0, ISA_MIPS3, CPU_R4300 },
- { "r4400", 0, ISA_MIPS3, CPU_R4400 },
- { "r4600", 0, ISA_MIPS3, CPU_R4600 },
- { "orion", 0, ISA_MIPS3, CPU_R4600 },
- { "r4650", 0, ISA_MIPS3, CPU_R4650 },
- { "r5900", 0, ISA_MIPS3, CPU_R5900 },
+ { "r4000", 0, 0, ISA_MIPS3, CPU_R4000 },
+ { "r4010", 0, 0, ISA_MIPS2, CPU_R4010 },
+ { "vr4100", 0, 0, ISA_MIPS3, CPU_VR4100 },
+ { "vr4111", 0, 0, ISA_MIPS3, CPU_R4111 },
+ { "vr4120", 0, 0, ISA_MIPS3, CPU_VR4120 },
+ { "vr4130", 0, 0, ISA_MIPS3, CPU_VR4120 },
+ { "vr4181", 0, 0, ISA_MIPS3, CPU_R4111 },
+ { "vr4300", 0, 0, ISA_MIPS3, CPU_R4300 },
+ { "r4400", 0, 0, ISA_MIPS3, CPU_R4400 },
+ { "r4600", 0, 0, ISA_MIPS3, CPU_R4600 },
+ { "orion", 0, 0, ISA_MIPS3, CPU_R4600 },
+ { "r4650", 0, 0, ISA_MIPS3, CPU_R4650 },
+ { "r5900", 0, 0, ISA_MIPS3, CPU_R5900 },
/* ST Microelectronics Loongson 2E and 2F cores */
- { "loongson2e", 0, ISA_MIPS3, CPU_LOONGSON_2E },
- { "loongson2f", 0, ISA_MIPS3, CPU_LOONGSON_2F },
+ { "loongson2e", 0, 0, ISA_MIPS3, CPU_LOONGSON_2E },
+ { "loongson2f", 0, 0, ISA_MIPS3, CPU_LOONGSON_2F },
/* MIPS IV */
- { "r8000", 0, ISA_MIPS4, CPU_R8000 },
- { "r10000", 0, ISA_MIPS4, CPU_R10000 },
- { "r12000", 0, ISA_MIPS4, CPU_R12000 },
- { "r14000", 0, ISA_MIPS4, CPU_R14000 },
- { "r16000", 0, ISA_MIPS4, CPU_R16000 },
- { "vr5000", 0, ISA_MIPS4, CPU_R5000 },
- { "vr5400", 0, ISA_MIPS4, CPU_VR5400 },
- { "vr5500", 0, ISA_MIPS4, CPU_VR5500 },
- { "rm5200", 0, ISA_MIPS4, CPU_R5000 },
- { "rm5230", 0, ISA_MIPS4, CPU_R5000 },
- { "rm5231", 0, ISA_MIPS4, CPU_R5000 },
- { "rm5261", 0, ISA_MIPS4, CPU_R5000 },
- { "rm5721", 0, ISA_MIPS4, CPU_R5000 },
- { "rm7000", 0, ISA_MIPS4, CPU_RM7000 },
- { "rm9000", 0, ISA_MIPS4, CPU_RM9000 },
+ { "r8000", 0, 0, ISA_MIPS4, CPU_R8000 },
+ { "r10000", 0, 0, ISA_MIPS4, CPU_R10000 },
+ { "r12000", 0, 0, ISA_MIPS4, CPU_R12000 },
+ { "r14000", 0, 0, ISA_MIPS4, CPU_R14000 },
+ { "r16000", 0, 0, ISA_MIPS4, CPU_R16000 },
+ { "vr5000", 0, 0, ISA_MIPS4, CPU_R5000 },
+ { "vr5400", 0, 0, ISA_MIPS4, CPU_VR5400 },
+ { "vr5500", 0, 0, ISA_MIPS4, CPU_VR5500 },
+ { "rm5200", 0, 0, ISA_MIPS4, CPU_R5000 },
+ { "rm5230", 0, 0, ISA_MIPS4, CPU_R5000 },
+ { "rm5231", 0, 0, ISA_MIPS4, CPU_R5000 },
+ { "rm5261", 0, 0, ISA_MIPS4, CPU_R5000 },
+ { "rm5721", 0, 0, ISA_MIPS4, CPU_R5000 },
+ { "rm7000", 0, 0, ISA_MIPS4, CPU_RM7000 },
+ { "rm9000", 0, 0, ISA_MIPS4, CPU_RM9000 },
/* MIPS 32 */
- { "4kc", 0, ISA_MIPS32, CPU_MIPS32 },
- { "4km", 0, ISA_MIPS32, CPU_MIPS32 },
- { "4kp", 0, ISA_MIPS32, CPU_MIPS32 },
- { "4ksc", MIPS_CPU_ASE_SMARTMIPS, ISA_MIPS32, CPU_MIPS32 },
+ { "4kc", 0, 0, ISA_MIPS32, CPU_MIPS32 },
+ { "4km", 0, 0, ISA_MIPS32, CPU_MIPS32 },
+ { "4kp", 0, 0, ISA_MIPS32, CPU_MIPS32 },
+ { "4ksc", 0, ASE_SMARTMIPS, ISA_MIPS32, CPU_MIPS32 },
/* MIPS 32 Release 2 */
- { "4kec", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "4kem", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "4kep", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "4ksd", MIPS_CPU_ASE_SMARTMIPS, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "m4k", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "m4kp", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "m14k", MIPS_CPU_ASE_MCU, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "m14kc", MIPS_CPU_ASE_MCU, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "m14ke", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2 | MIPS_CPU_ASE_MCU,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "m14kec", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2 | MIPS_CPU_ASE_MCU,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "24kc", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "24kf2_1", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "24kf", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "24kf1_1", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "4kec", 0, 0, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "4kem", 0, 0, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "4kep", 0, 0, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "4ksd", 0, ASE_SMARTMIPS, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "m4k", 0, 0, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "m4kp", 0, 0, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "m14k", 0, ASE_MCU, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "m14kc", 0, ASE_MCU, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "m14ke", 0, ASE_DSP | ASE_DSPR2 | ASE_MCU,
+ ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "m14kec", 0, ASE_DSP | ASE_DSPR2 | ASE_MCU,
+ ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "24kc", 0, 0, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "24kf2_1", 0, 0, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "24kf", 0, 0, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "24kf1_1", 0, 0, ISA_MIPS32R2, CPU_MIPS32R2 },
/* Deprecated forms of the above. */
- { "24kfx", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "24kx", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "24kfx", 0, 0, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "24kx", 0, 0, ISA_MIPS32R2, CPU_MIPS32R2 },
/* 24KE is a 24K with DSP ASE, other ASEs are optional. */
- { "24kec", MIPS_CPU_ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "24kef2_1", MIPS_CPU_ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "24kef", MIPS_CPU_ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "24kef1_1", MIPS_CPU_ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "24kec", 0, ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "24kef2_1", 0, ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "24kef", 0, ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "24kef1_1", 0, ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 },
/* Deprecated forms of the above. */
- { "24kefx", MIPS_CPU_ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "24kex", MIPS_CPU_ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "24kefx", 0, ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "24kex", 0, ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 },
/* 34K is a 24K with DSP and MT ASE, other ASEs are optional. */
- { "34kc", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "34kf2_1", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "34kf", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "34kf1_1", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT,
- ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "34kc", 0, ASE_DSP | ASE_MT, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "34kf2_1", 0, ASE_DSP | ASE_MT, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "34kf", 0, ASE_DSP | ASE_MT, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "34kf1_1", 0, ASE_DSP | ASE_MT, ISA_MIPS32R2, CPU_MIPS32R2 },
/* Deprecated forms of the above. */
- { "34kfx", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "34kx", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT,
- ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "34kfx", 0, ASE_DSP | ASE_MT, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "34kx", 0, ASE_DSP | ASE_MT, ISA_MIPS32R2, CPU_MIPS32R2 },
/* 34Kn is a 34kc without DSP. */
- { "34kn", MIPS_CPU_ASE_MT, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "34kn", 0, ASE_MT, ISA_MIPS32R2, CPU_MIPS32R2 },
/* 74K with DSP and DSPR2 ASE, other ASEs are optional. */
- { "74kc", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "74kf2_1", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "74kf", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "74kf1_1", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "74kf3_2", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2,
- ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "74kc", 0, ASE_DSP | ASE_DSPR2, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "74kf2_1", 0, ASE_DSP | ASE_DSPR2, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "74kf", 0, ASE_DSP | ASE_DSPR2, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "74kf1_1", 0, ASE_DSP | ASE_DSPR2, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "74kf3_2", 0, ASE_DSP | ASE_DSPR2, ISA_MIPS32R2, CPU_MIPS32R2 },
/* Deprecated forms of the above. */
- { "74kfx", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "74kx", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2,
- ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "74kfx", 0, ASE_DSP | ASE_DSPR2, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "74kx", 0, ASE_DSP | ASE_DSPR2, ISA_MIPS32R2, CPU_MIPS32R2 },
/* 1004K cores are multiprocessor versions of the 34K. */
- { "1004kc", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "1004kf2_1", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "1004kf", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "1004kf1_1", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT,
- ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "1004kc", 0, ASE_DSP | ASE_MT, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "1004kf2_1", 0, ASE_DSP | ASE_MT, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "1004kf", 0, ASE_DSP | ASE_MT, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "1004kf1_1", 0, ASE_DSP | ASE_MT, ISA_MIPS32R2, CPU_MIPS32R2 },
/* MIPS 64 */
- { "5kc", 0, ISA_MIPS64, CPU_MIPS64 },
- { "5kf", 0, ISA_MIPS64, CPU_MIPS64 },
- { "20kc", MIPS_CPU_ASE_MIPS3D, ISA_MIPS64, CPU_MIPS64 },
- { "25kf", MIPS_CPU_ASE_MIPS3D, ISA_MIPS64, CPU_MIPS64 },
+ { "5kc", 0, 0, ISA_MIPS64, CPU_MIPS64 },
+ { "5kf", 0, 0, ISA_MIPS64, CPU_MIPS64 },
+ { "20kc", 0, ASE_MIPS3D, ISA_MIPS64, CPU_MIPS64 },
+ { "25kf", 0, ASE_MIPS3D, ISA_MIPS64, CPU_MIPS64 },
/* Broadcom SB-1 CPU core */
- { "sb1", MIPS_CPU_ASE_MIPS3D | MIPS_CPU_ASE_MDMX,
- ISA_MIPS64, CPU_SB1 },
+ { "sb1", 0, ASE_MIPS3D | ASE_MDMX, ISA_MIPS64, CPU_SB1 },
/* Broadcom SB-1A CPU core */
- { "sb1a", MIPS_CPU_ASE_MIPS3D | MIPS_CPU_ASE_MDMX,
- ISA_MIPS64, CPU_SB1 },
+ { "sb1a", 0, ASE_MIPS3D | ASE_MDMX, ISA_MIPS64, CPU_SB1 },
- { "loongson3a", 0, ISA_MIPS64, CPU_LOONGSON_3A },
+ { "loongson3a", 0, 0, ISA_MIPS64, CPU_LOONGSON_3A },
/* MIPS 64 Release 2 */
/* Cavium Networks Octeon CPU core */
- { "octeon", 0, ISA_MIPS64R2, CPU_OCTEON },
- { "octeon+", 0, ISA_MIPS64R2, CPU_OCTEONP },
- { "octeon2", 0, ISA_MIPS64R2, CPU_OCTEON2 },
+ { "octeon", 0, 0, ISA_MIPS64R2, CPU_OCTEON },
+ { "octeon+", 0, 0, ISA_MIPS64R2, CPU_OCTEONP },
+ { "octeon2", 0, 0, ISA_MIPS64R2, CPU_OCTEON2 },
/* RMI Xlr */
- { "xlr", 0, ISA_MIPS64, CPU_XLR },
+ { "xlr", 0, 0, ISA_MIPS64, CPU_XLR },
/* Broadcom XLP.
XLP is mostly like XLR, with the prominent exception that it is
MIPS64R2 rather than MIPS64. */
- { "xlp", 0, ISA_MIPS64R2, CPU_XLR },
+ { "xlp", 0, 0, ISA_MIPS64R2, CPU_XLR },
/* End marker */
- { NULL, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};