diff options
author | Andrew Pinski <apinski@cavium.com> | 2011-11-29 20:28:55 +0000 |
---|---|---|
committer | Andrew Pinski <apinski@cavium.com> | 2011-11-29 20:28:55 +0000 |
commit | dd6a37e700ab12b5f5e89b747992324e74981872 (patch) | |
tree | 85cfdc8abc67b5b005f7bbdeb123bf5730918ae4 /gas/config | |
parent | b3364cb9c21f33b0f0de633d10f6729134b9bd6f (diff) | |
download | gdb-dd6a37e700ab12b5f5e89b747992324e74981872.zip gdb-dd6a37e700ab12b5f5e89b747992324e74981872.tar.gz gdb-dd6a37e700ab12b5f5e89b747992324e74981872.tar.bz2 |
opcode/
2011-11-29 Andrew Pinski <apinski@cavium.com>
* mips-dis.c (mips_arch_choices): Add Octeon+.
* mips-opc.c (IOCT): Include Octeon+.
(IOCTP): New macro.
(mips_builtin_opcodes): Add "saa" and "saad".
bfd/
2011-11-29 Andrew Pinski <apinski@cavium.com>
* archures.c (bfd_mach_mips_octeonp): New macro.
* bfd-in2.h: Regenerate.
* bfd/cpu-mips.c (I_mipsocteonp): New enum value.
(arch_info_struct): Add bfd_mach_mips_octeonp.
* elfxx-mips.c (mips_set_isa_flags): Add bfd_mach_mips_octeonp.
(mips_mach_extensions): Add bfd_mach_mips_octeonp.
include/opcodes/
2011-11-29 Andrew Pinski <apinski@cavium.com>
* mips.h (INSN_CHIP_MASK): Update according to INSN_OCTEONP.
(INSN_OCTEONP): New macro.
(CPU_OCTEONP): New macro.
(OPCODE_IS_MEMBER): Add Octeon+.
(M_SAA_AB, M_SAAD_AB, M_SAA_OB, M_SAAD_OB): New enum values.
gas/
2011-11-29 Andrew Pinski <apinski@cavium.com>
* config/tc-mips.c (CPU_IS_OCTEON): New macro function.
(CPU_HAS_SEQ): Change to use CPU_IS_OCTEON.
(NO_ISA_COP): Likewise.
(macro) <ld_st>: Add support when off0 is true.
Add support for M_SAA_AB, M_SAA_OB, M_SAAD_OB and M_SAAD_AB.
(mips_cpu_info_table): Add octeon+.
* doc/c-mips.texi: Document octeon+ as an acceptable value for -march=.
gas/testsuite/
2011-11-29 Andrew Pinski <apinski@cavium.com>
* gas/mips/mips.exp: Add octeon+ for an architecture.
Run octeon-saa-saad test.
(run_dump_test_arch): For Octeon architectures, also try octeon@.
* gas/mips/octeon-pref.d: Remove -march=octeon from command line.
* gas/mips/octeon.d: Likewise.
* gas/mips/octeon-saa-saad.d: New file.
* gas/mips/octeon-saa-saad.s: New file
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-mips.c | 57 |
1 files changed, 45 insertions, 12 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 34d2df7..2a57393 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -497,13 +497,16 @@ static int mips_32bitmode = 0; /* True if CPU has a ror instruction. */ #define CPU_HAS_ROR(CPU) CPU_HAS_DROR (CPU) +/* True if CPU is in the Octeon family */ +#define CPU_IS_OCTEON(CPU) ((CPU) == CPU_OCTEON || (CPU) == CPU_OCTEONP) + /* True if CPU has seq/sne and seqi/snei instructions. */ -#define CPU_HAS_SEQ(CPU) ((CPU) == CPU_OCTEON) +#define CPU_HAS_SEQ(CPU) (CPU_IS_OCTEON (CPU)) /* True if CPU does not implement the all the coprocessor insns. For these CPUs only those COP insns are accepted that are explicitly marked to be available on the CPU. ISA membership for COP insns is ignored. */ -#define NO_ISA_COP(CPU) ((CPU) == CPU_OCTEON) +#define NO_ISA_COP(CPU) (CPU_IS_OCTEON (CPU)) /* True if mflo and mfhi can be immediately followed by instructions which write to the HI and LO registers. @@ -6261,6 +6264,7 @@ macro (struct mips_cl_insn *ip) int ust = 0; int lp = 0; int ab = 0; + int off0 = 0; int off; offsetT maxnum; bfd_reloc_code_real_type r; @@ -8295,20 +8299,29 @@ macro (struct mips_cl_insn *ip) tempreg, tempreg, breg); breg = tempreg; } - if (!off12) + if (off0) + { + if (offset_expr.X_add_number == 0) + tempreg = breg; + else + macro_build (&offset_expr, ADDRESS_ADDI_INSN, + "t,r,j", tempreg, breg, BFD_RELOC_LO16); + macro_build (NULL, s, fmt, treg, tempreg); + } + else if (!off12) 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) + else if (off12 || off0) { - /* A 12-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 + /* 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 offset_reloc already contains the relocations associated with "o". */ if (ab) @@ -8323,8 +8336,11 @@ macro (struct mips_cl_insn *ip) tempreg, breg, -1, offset_reloc[0], offset_reloc[1], offset_reloc[2]); expr1.X_add_number = 0; - macro_build (NULL, s, fmt, - treg, (unsigned long) expr1.X_add_number, tempreg); + if (off0) + macro_build (NULL, s, fmt, treg, tempreg); + else + macro_build (NULL, s, fmt, + treg, (unsigned long) expr1.X_add_number, tempreg); } else if (mips_pic == NO_PIC) { @@ -9118,6 +9134,22 @@ macro (struct mips_cl_insn *ip) } break; + + case M_SAA_AB: + ab = 1; + case M_SAA_OB: + s = "saa"; + off0 = 1; + fmt = "t,(b)"; + goto ld_st; + case M_SAAD_AB: + ab = 1; + case M_SAAD_OB: + s = "saad"; + off0 = 1; + fmt = "t,(b)"; + goto ld_st; + /* New code added to support COPZ instructions. This code builds table entries out of the macros in mip_opcodes. R4000 uses interlocks to handle coproc delays. @@ -19042,6 +19074,7 @@ static const struct mips_cpu_info mips_cpu_info_table[] = /* Cavium Networks Octeon CPU core */ { "octeon", 0, ISA_MIPS64R2, CPU_OCTEON }, + { "octeon+", 0, ISA_MIPS64R2, CPU_OCTEONP }, /* RMI Xlr */ { "xlr", 0, ISA_MIPS64, CPU_XLR }, |