Commit Graph

5578 Commits

Author SHA1 Message Date
Matthew Fortune 43885403ed [MIPS] Rename COPROC related macros
gas/

	* config/tc-mips.c: Rename INSN_LOAD_COPROC_DELAY to INSN_LOAD_COPROC
	and INSN_COPROC_MOVE_DELAY to INSN_COPROC_MOVE throughout.

include/opcode/

	* mips.h (INSN_LOAD_COPROC_DELAY): Rename to...
	(INSN_LOAD_COPROC): New define.
	(INSN_COPROC_MOVE_DELAY): Rename to...
	(INSN_COPROC_MOVE): New define.

opcodes/

	* micromips-opc.c (COD): Rename throughout to...
	(CM): New define, update to use INSN_COPROC_MOVE.
	(LCD): Rename throughout to...
	(LC): New define, update to use INSN_LOAD_COPROC.
	* mips-opc.c: Likewise.
2014-07-29 13:58:54 +01:00
Matthew Fortune 351cdf24d2 [MIPS] Implement O32 FPXX, FP64 and FP64A ABI extensions
Specification:
https://dmz-portal.mips.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking

include/

	* elf/mips.h (PT_MIPS_ABIFLAGS, SHT_MIPS_ABIFLAGS): Define.
	(Val_GNU_MIPS_ABI_FP_OLD_64): Rename from Val_GNU_MIPS_ABI_FP_64.
	(Val_GNU_MIPS_ABI_FP_64): Redefine.
	(Val_GNU_MIPS_ABI_FP_XX): Define.
	(Elf_External_ABIFlags_v0, Elf_Internal_ABIFlags_v0): New structures.
	(AFL_REG_NONE, AFL_REG_32, AFL_REG_64, AFL_REG_128): Define.
	(AFL_ASE_DSP, AFL_ASE_DSPR2, AFL_ASE_EVA, AFL_ASE_MCU): Likewise.
	(AFL_ASE_MDMX, AFL_ASE_MIPS3D, AFL_ASE_MT, AFL_ASE_SMARTMIPS): Likewise.
	(AFL_ASE_VIRT, AFL_ASE_MSA, AFL_ASE_MIPS16): Likewise.
	(AFL_ASE_MICROMIPS, AFL_ASE_XPA): Likewise.
	(AFL_EXT_XLR, AFL_EXT_OCTEON2, AFL_EXT_OCTEONP): Likewise.
	(AFL_EXT_LOONGSON_3A, AFL_EXT_OCTEON, AFL_EXT_5900): Likewise.
	(AFL_EXT_4650, AFL_EXT_4010, AFL_EXT_4100, AFL_EXT_3900): Likewise.
	(AFL_EXT_10000, AFL_EXT_SB1, AFL_EXT_4111, AFL_EXT_4120): Likewise.
	(AFL_EXT_5400, AFL_EXT_5500, AFL_EXT_LOONGSON_2E): Likewise.
	(AFL_EXT_LOONGSON_2F): Likewise.
	(bfd_mips_elf_swap_abiflags_v0_in): Prototype.
	(bfd_mips_elf_swap_abiflags_v0_out): Likewise.
	(bfd_mips_isa_ext): Likewise.

bfd/

	* elfxx-mips.c (ABI_O32_P, MIPS_ELF_ABIFLAGS_SECTION_NAME_P): New macro.
	(mips_elf_obj_tdata): Add abiflags and abiflags_valid fields.
	(bfd_mips_elf_swap_abiflags_v0_in): New function.
	(bfd_mips_elf_swap_abiflags_v0_out): Likewise.
	(_bfd_mips_elf_section_from_shdr): Handle SHT_MIPS_ABIFLAGS.
	(_bfd_mips_elf_fake_sections): Likewise.
	(_bfd_mips_elf_always_size_sections): Handle .MIPS.abiflags.
	(_bfd_mips_elf_additional_program_headers): Account for new
	PT_MIPS_ABIFLAGS program header.
	(_bfd_mips_elf_modify_segment_map): Create PT_MIPS_ABIFLAGS segment and
	associate with .MIPS.abiflags.
	(_bfd_mips_elf_gc_mark_extra_sections): New function.
	(bfd_mips_isa_ext, update_mips_abiflags_isa): New static function.
	(infer_mips_abiflags): Likewise.
	(_bfd_mips_elf_final_link): Handle .MIPS.abiflags.
	(mips_32bit_flags_p): Moved higher.
	(mips_elf_merge_obj_attributes, _bfd_mips_fp_abi_string): Error
	checking for FP ABIs.
	(_bfd_mips_elf_merge_private_bfd_data): Restructure and add abiflags
	checks.  Check EF_MIPS_FP64 flag consistency.
	(print_mips_ases, print_mips_isa_ext): New static function.
	(print_mips_fp_abi_value, get_mips_reg_size): Likewise.
	(_bfd_mips_elf_print_private_bfd_data): Display abiflags data.
	(_bfd_mips_post_process_headers): Set EI_ABIVERSION = 3 for
	Val_GNU_MIPS_ABI_FP_64 or Val_GNU_MIPS_ABI_FP_64A.
	* elfxx-mips.h (_bfd_mips_elf_gc_mark_extra_sections): New prototype.
	* elf32-mips.c (elf_backend_gc_mark_extra_sections): Implement.
	* elfn32-mips.c (elf_backend_gc_mark_extra_sections): Implement.
	* elf64-mips.c (elf_backend_gc_mark_extra_sections): Implement.

binutils/

	* readelf.c (get_mips_segment_type): Display name for PT_MIPS_ABIFLAGS.
	(get_mips_section_type_name): Display name for SHT_MIPS_ABIFLAGS.
	(display_mips_gnu_attribute): Abstracted fp abi printing to...
	(print_mips_fp_abi_value): New static function. Handle new FP ABIs.
	(print_mips_ases, print_mips_isa_ext): New static functions.
	(get_mips_reg_size): Likewise.
	(process_mips_specific): Display abiflags data.

elfcpp/

	* elfcpp.h (PT_MIPS_ABIFLAGS): New program header type.

gas/

	* config/tc-mips.c (mips_flags_frag): New static global.
	(struct mips_set_options): Add oddspreg field.
	(file_mips_opts, mips_opts): Initialize oddspreg.
	(ISA_HAS_ODD_SINGLE_FPR): Add CPU argument and update for R5900 and
	Loongson-3a.
	(enum options, md_longopts, md_parse_option): Add -mfpxx, -modd-spreg
	and -mno-odd-spreg options.
	(md_begin): Create .MIPS.abiflags section.
	(fpabi_incompatible_with, fpabi_requires): New static function.
	(check_fpabi): Likewise.
	(mips_check_options): Handle fp=xx and oddspreg restrictions.
	(file_mips_check_options): Set oddspreg by default for fp=xx.
	(mips_oddfpreg_ok): Re-write function.
	(check_regno): Check odd numbered registers regardless of FPR size.
	For fp != 32 use as_bad instead of as_warn.
	(match_float_constant): Rewrite check regarding FP register width.  Add
	support for generating constants when MXHC1 is present.  Handle fp=xx
	to comply with the ABI.
	(macro): Update M_LI_DD similarly to match_float_constant.  Generate
	MTHC1 when available.  Check that correct code can be generated for
	fp=xx and fp=64 ABIs.
	(parse_code_option, s_mipsset): Add fp=xx, oddspreg and nooddspreg
	options.
	(mips_convert_ase_flags): New static function.
	(mips_elf_final_processing): Use fpabi == Val_GNU_MIPS_ABI_FP_OLD_64
	to determine when to add the EF_MIPS_FP64 flag.  Populate the
	.MIPS.abiflags section.
	(md_mips_end): Update .gnu_attribute based on command line and .module
	as applicable.  Use check_fpabi to ensure .gnu.attribute and command
	line/.module options are consistent.
	* doc/as.texinfo: Add missing -mgp64/-mfp64 options and document new
	-mfpxx, -modd-spreg and -mno-odd-spreg options.
	* doc/c-mips.texi: Document -mfpxx, -modd-spreg, -mno-odd-spreg,
	gnu_attribute values and FP ABIs.

ld/

	* emulparams/elf32bmip.sh: Add .MIPS.abiflags.
	* emulparams/elf32bmipn32-defs.sh: Likewise.
	* emulparams/elf64bmip-defs.sh: Likewise.

opcodes/

	* micromips-opc.c (COD, LCD) New macros.
	(cfc1, ctc1): Remove FP_S attribute.
	(dmfc1, mfc1, mfhc1): Add LCD attribute.
	(dmtc1, mtc1, mthc1): Add COD attribute.
	* mips-opc.c (cfc1, cftc1, ctc, cttc1): Remove FP_S attribute.

binutils/testsuite/

	* binutils-all/readelf.s: Account for .MIPS.abiflags and
	.gnu.attributes.
	* binutils-all/readelf.ss-tmips: Likewise.
	* binutils-all/strip-3.d: Likewise.

gas/testsuite/

	* gas/mips/attr-gnu-4-0.d: New.
	* gas/mips/attr-gnu-4-0.s: Likewise.
	* gas/mips/attr-gnu-4-1-mfp32.l: Likewise.
	* gas/mips/attr-gnu-4-1-mfp32.s: Likewise.
	* gas/mips/attr-gnu-4-1-mfp64.l: Likewise.
	* gas/mips/attr-gnu-4-1-mfp64.s: Likewise.
	* gas/mips/attr-gnu-4-1-mfpxx.s: Likewise.
	* gas/mips/attr-gnu-4-1-msingle-float.l: Likewise.
	* gas/mips/attr-gnu-4-1-msingle-float.s: Likewise.
	* gas/mips/attr-gnu-4-1-msoft-float.l: Likewise.
	* gas/mips/attr-gnu-4-1-msoft-float.s: Likewise.
	* gas/mips/attr-gnu-4-1.d: Likewise.
	* gas/mips/attr-gnu-4-1.s: Likewise.
	* gas/mips/attr-gnu-4-2-mdouble-float.l: Likewise.
	* gas/mips/attr-gnu-4-2-mdouble-float.s: Likewise.
	* gas/mips/attr-gnu-4-2-msoft-float.l: Likewise.
	* gas/mips/attr-gnu-4-2-msoft-float.s: Likewise.
	* gas/mips/attr-gnu-4-2.d: Likewise.
	* gas/mips/attr-gnu-4-2.s: Likewise.
	* gas/mips/attr-gnu-4-3-mhard-float.l: Likewise.
	* gas/mips/attr-gnu-4-3-mhard-float.s: Likewise.
	* gas/mips/attr-gnu-4-3.d: Likewise.
	* gas/mips/attr-gnu-4-3.s: Likewise.
	* gas/mips/attr-gnu-4-4.l: Likewise.
	* gas/mips/attr-gnu-4-4.s: Likewise.
	* gas/mips/attr-gnu-4-5-64.l: Likewise.
	* gas/mips/attr-gnu-4-5-64.s: Likewise.
	* gas/mips/attr-gnu-4-5.d: Likewise.
	* gas/mips/attr-gnu-4-5.l: Likewise.
	* gas/mips/attr-gnu-4-5.s: Likewise.
	* gas/mips/attr-gnu-4-6-64.l: Likewise.
	* gas/mips/attr-gnu-4-6-64.s: Likewise.
	* gas/mips/attr-gnu-4-6.d: Likewise.
	* gas/mips/attr-gnu-4-6.l: Likewise.
	* gas/mips/attr-gnu-4-6.s: Likewise.
	* gas/mips/attr-gnu-4-6-msingle-float.l: Likewise.
	* gas/mips/attr-gnu-4-6-msingle-float.s: Likewise.
	* gas/mips/attr-gnu-4-6-msoft-float.l: Likewise.
	* gas/mips/attr-gnu-4-6-msoft-float.s: Likewise.
	* gas/mips/attr-gnu-4-6-noodd.l: Likewise.
	* gas/mips/attr-gnu-4-6-noodd.s: Likewise.
	* gas/mips/attr-gnu-4-7-64.l: Likewise.
	* gas/mips/attr-gnu-4-7-64.s: Likewise.
	* gas/mips/attr-gnu-4-7-msingle-float.l: Likewise.
	* gas/mips/attr-gnu-4-7-msingle-float.s: Likewise.
	* gas/mips/attr-gnu-4-7-msoft-float.l: Likewise.
	* gas/mips/attr-gnu-4-7-msoft-float.s: Likewise.
	* gas/mips/attr-gnu-4-7-odd.l: Likewise.
	* gas/mips/attr-gnu-4-7-odd.s: Likewise.
	* gas/mips/attr-gnu-4-7.d: Likewise.
	* gas/mips/attr-gnu-4-7.l: Likewise.
	* gas/mips/attr-gnu-4-7.s: Likewise.
	* gas/mips/attr-none-double.d: Likewise.
	* gas/mips/attr-none-o32-fp64.d: Likewise.
	* gas/mips/attr-none-o32-fp64-nooddspreg.d
	* gas/mips/attr-none-o32-fpxx.d: Likewise.
	* gas/mips/attr-none-single-float.d: Likewise.
	* gas/mips/attr-none-soft-float.d: Likewise.
	* gas/mips/elf_arch_mips32r3.d: Likewise.
	* gas/mips/elf_arch_mips32r5.d: Likewise.
	* gas/mips/elf_arch_mips64r3.d: Likewise.
	* gas/mips/elf_arch_mips64r5.d: Likewise.
	* gas/mips/li-d.d: Likewise.
	* gas/mips/li-d.s: Likewise.
	* gas/mips/module-check-warn.l: Likewise.
	* gas/mips/module-check-warn.s: Likewise.
	* gas/mips/module-check.d: Likewise.
	* gas/mips/module-check.s: Likewise.
	* gas/mips/module-mfp32.d: Likewise.
	* gas/mips/module-mfp32.s: Likewise.
	* gas/mips/module-mfp64.d: Likewise.
	* gas/mips/module-mfp64.s: Likewise.
	* gas/mips/module-mfp64-noodd.d: Likewise.
	* gas/mips/module-mfp64-noodd.s: Likewise.
	* gas/mips/module-mfpxx.d: Likewise.
	* gas/mips/module-mfpxx.s: Likewise.
	* gas/mips/module-msingle-float.d: Likewise.
	* gas/mips/module-msingle-float.s: Likewise.
	* gas/mips/module-msoft-float.d: Likewise.
	* gas/mips/module-msoft-float.s: Likewise.
	* gas/mips/module-set-mfpxx.d: Likewise.
	* gas/mips/module-set-mfpxx.s: Likewise.
	* gas/mips/fpxx-oddfpreg.d: Likewise.
	* gas/mips/fpxx-oddfpreg.l: Likewise.
	* gas/mips/fpxx-oddfpreg.s: Likewise.
	* gas/mips/no-odd-spreg.d: Likewise.
	* gas/mips/odd-spreg.d: Likewise.
	* gas/elf/section2.e-mips: Adjust expected output.
	* gas/mips/attr-gnu-abi-fp-1.d: Likewise.
	* gas/mips/attr-gnu-abi-msa-1.d: Likewise.
	* gas/mips/call-nonpic-1.d: Likewise.
	* gas/mips/elf_arch_mips1.d: Likewise.
	* gas/mips/elf_arch_mips2.d: Likewise.
	* gas/mips/elf_arch_mips3.d: Likewise.
	* gas/mips/elf_arch_mips32.d: Likewise.
	* gas/mips/elf_arch_mips32r2.d: Likewise.
	* gas/mips/elf_arch_mips4.d: Likewise.
	* gas/mips/elf_arch_mips5.d: Likewise.
	* gas/mips/elf_arch_mips64.d: Likewise.
	* gas/mips/elf_arch_mips64r2.d: Likewise.
	* gas/mips/elf_ase_micromips-2.d: Likewise.
	* gas/mips/elf_ase_micromips.d: Likewise.
	* gas/mips/elf_ase_mips16-2.d: Likewise.
	* gas/mips/elf_ase_mips16.d: Likewise.
	* gas/mips/module-defer-warn1.d: Likewise.
	* gas/mips/module-override.d: Likewise.
	* gas/mips/n32-consec.d: Likewise.
	* gas/mips/nan-2008-1.d: Likewise.
	* gas/mips/nan-2008-2.d: Likewise.
	* gas/mips/nan-2008-3.d: Likewise.
	* gas/mips/nan-2008-4.d: Likewise.
	* gas/mips/nan-legacy-1.d: Likewise.
	* gas/mips/nan-legacy-2.d: Likewise.
	* gas/mips/nan-legacy-3.d: Likewise.
	* gas/mips/nan-legacy-4.d: Likewise.
	* gas/mips/nan-legacy-5.d: Likewise.
	* gas/mips/tmips16-e.d: Likewise.
	* gas/mips/tmips16-f.d: Likewise.
	* gas/mips/tmipsel16-e.d: Likewise.
	* gas/mips/tmipsel16-f.d: Likewise.
	* gas/testsuite/gas/mips/mips.exp: Add new tests.

ld/testsuite/

	* ld-mips-elf/abiflags-strip1-ph.d: New.
	* ld-mips-elf/abiflags-strip2-ph.d: Likewise.
	* ld-mips-elf/abiflags-strip3-ph.d: Likewise.
	* ld-mips-elf/abiflags-strip4-ph.d: Likewise.
	* ld-mips-elf/abiflags-strip5-ph.d: Likewise.
	* ld-mips-elf/abiflags-strip6-ph.d: Likewise.
	* ld-mips-elf/abiflags-strip7-ph.d: Likewise.
	* ld-mips-elf/abiflags-strip8-ph.d: Likewise.
	* ld-mips-elf/abiflags-strip9-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-0-n32-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-0-n64-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-0-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-06.d: Likewise.
	* ld-mips-elf/attr-gnu-4-07.d: Likewise.
	* ld-mips-elf/attr-gnu-4-08.d: Likewise.
	* ld-mips-elf/attr-gnu-4-1-n32-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-1-n64-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-1-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-16.d: Likewise.
	* ld-mips-elf/attr-gnu-4-17.d: Likewise.
	* ld-mips-elf/attr-gnu-4-18.d: Likewise.
	* ld-mips-elf/attr-gnu-4-2-n32-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-2-n64-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-2-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-26.d: Likewise.
	* ld-mips-elf/attr-gnu-4-27.d: Likewise.
	* ld-mips-elf/attr-gnu-4-28.d: Likewise.
	* ld-mips-elf/attr-gnu-4-3-n32-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-3-n64-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-3-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-36.d: Likewise.
	* ld-mips-elf/attr-gnu-4-37.d: Likewise.
	* ld-mips-elf/attr-gnu-4-38.d: Likewise.
	* ld-mips-elf/attr-gnu-4-4-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-46.d: Likewise.
	* ld-mips-elf/attr-gnu-4-47.d: Likewise.
	* ld-mips-elf/attr-gnu-4-48.d: Likewise.
	* ld-mips-elf/attr-gnu-4-5-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-50.d: Likewise.
	* ld-mips-elf/attr-gnu-4-52.d: Likewise.
	* ld-mips-elf/attr-gnu-4-53.d: Likewise.
	* ld-mips-elf/attr-gnu-4-54.d: Likewise.
	* ld-mips-elf/attr-gnu-4-55.d: Likewise.
	* ld-mips-elf/attr-gnu-4-56.d: Likewise.
	* ld-mips-elf/attr-gnu-4-57.d: Likewise.
	* ld-mips-elf/attr-gnu-4-58.d: Likewise.
	* ld-mips-elf/attr-gnu-4-6-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-6.s: Likewise.
	* ld-mips-elf/attr-gnu-4-60.d: Likewise.
	* ld-mips-elf/attr-gnu-4-61.d: Likewise.
	* ld-mips-elf/attr-gnu-4-62.d: Likewise.
	* ld-mips-elf/attr-gnu-4-63.d: Likewise.
	* ld-mips-elf/attr-gnu-4-64.d: Likewise.
	* ld-mips-elf/attr-gnu-4-65.d: Likewise.
	* ld-mips-elf/attr-gnu-4-66.d: Likewise.
	* ld-mips-elf/attr-gnu-4-67.d: Likewise.
	* ld-mips-elf/attr-gnu-4-68.d: Likewise.
	* ld-mips-elf/attr-gnu-4-7-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-7.s: Likewise.
	* ld-mips-elf/attr-gnu-4-70.d: Likewise.
	* ld-mips-elf/attr-gnu-4-71.d: Likewise.
	* ld-mips-elf/attr-gnu-4-72.d: Likewise.
	* ld-mips-elf/attr-gnu-4-73.d: Likewise.
	* ld-mips-elf/attr-gnu-4-74.d: Likewise.
	* ld-mips-elf/attr-gnu-4-75.d: Likewise.
	* ld-mips-elf/attr-gnu-4-76.d: Likewise.
	* ld-mips-elf/attr-gnu-4-77.d: Likewise.
	* ld-mips-elf/attr-gnu-4-78.d: Likewise.
	* ld-mips-elf/attr-gnu-4-8.s: Likewise.
	* ld-mips-elf/attr-gnu-4-81.d: Likewise.
	* ld-mips-elf/empty.s: Likewise.
	* ld-mips-elf/attr-gnu-4-00.d: Adjust expected output.
	* ld-mips-elf/attr-gnu-4-01.d: Likewise.
	* ld-mips-elf/attr-gnu-4-02.d: Likewise.
	* ld-mips-elf/attr-gnu-4-03.d: Likewise.
	* ld-mips-elf/attr-gnu-4-04.d: Likewise.
	* ld-mips-elf/attr-gnu-4-05.d: Likewise.
	* ld-mips-elf/attr-gnu-4-10.d: Likewise.
	* ld-mips-elf/attr-gnu-4-11.d: Likewise.
	* ld-mips-elf/attr-gnu-4-14.d: Likewise.
	* ld-mips-elf/attr-gnu-4-15.d: Likewise.
	* ld-mips-elf/attr-gnu-4-2.s: Likewise.
	* ld-mips-elf/attr-gnu-4-20.d: Likewise.
	* ld-mips-elf/attr-gnu-4-22.d: Likewise.
	* ld-mips-elf/attr-gnu-4-24.d: Likewise.
	* ld-mips-elf/attr-gnu-4-25.d: Likewise.
	* ld-mips-elf/attr-gnu-4-3.s: Likewise.
	* ld-mips-elf/attr-gnu-4-30.d: Likewise.
	* ld-mips-elf/attr-gnu-4-33.d: Likewise.
	* ld-mips-elf/attr-gnu-4-34.d: Likewise.
	* ld-mips-elf/attr-gnu-4-35.d: Likewise.
	* ld-mips-elf/attr-gnu-4-40.d: Likewise.
	* ld-mips-elf/attr-gnu-4-41.d: Likewise.
	* ld-mips-elf/attr-gnu-4-42.d: Likewise.
	* ld-mips-elf/attr-gnu-4-43.d: Likewise.
	* ld-mips-elf/attr-gnu-4-44.d: Likewise.
	* ld-mips-elf/attr-gnu-4-45.d: Likewise.
	* ld-mips-elf/attr-gnu-4-5.s: Likewise.
	* ld-mips-elf/attr-gnu-4-51.d: Likewise.
	* ld-mips-elf/attr-gnu-8-00.d: Likewise.
	* ld-mips-elf/attr-gnu-8-01.d: Likewise.
	* ld-mips-elf/attr-gnu-8-02.d: Likewise.
	* ld-mips-elf/attr-gnu-8-10.d: Likewise.
	* ld-mips-elf/attr-gnu-8-11.d: Likewise.
	* ld-mips-elf/attr-gnu-8-20.d: Likewise.
	* ld-mips-elf/attr-gnu-8-22.d: Likewise.
	* ld-mips-elf/jalx-2.dd: Likewise.
	* ld-mips-elf/mips16-pic-1.gd: Likewise.
	* ld-mips-elf/mips16-pic-2.gd: Likewise.
	* ld-mips-elf/mips16-pic-3.gd: Likewise.
	* ld-mips-elf/mips16-pic-4a.gd: Likewise.
	* ld-mips-elf/multi-got-no-shared.d: Likewise.
	* ld-mips-elf/nan-2008.d: Likewise.
	* ld-mips-elf/nan-legacy.d: Rework test.
	* ld-mips-elf/pic-and-nonpic-3a.gd: Likewise.
	* ld-mips-elf/pic-and-nonpic-3b.gd: Likewise.
	* ld-mips-elf/pic-and-nonpic-5b.gd: Likewise.
	* ld-mips-elf/pic-and-nonpic-6.ld: Likewise.
	* ld-mips-elf/rel32-n32.d: Likewise.
	* ld-mips-elf/rel32-o32.d: Likewise.
	* ld-mips-elf/rel64.d: Likewise.
	* ld-mips-elf/tls-multi-got-1.r: Likewise.
	* ld-elf/group.ld: Discard .MIPS.abiflags and .gnu.attributes.
	* ld-elf/orphan-region.ld: Likewise.
	* ld-elf/orphan.ld: Likewise.
	* ld-mips-elf/compressed-plt-1.ld: Likewise.
	* ld-mips-elf/dyn-sec64.ld: Likewise.
	* ld-mips-elf/got-dump-1.ld: Likewise.
	* ld-mips-elf/got-dump-2.ld: Likewise.
	* ld-mips-elf/got-page-1.ld: Likewise.
	* ld-mips-elf/mips-dyn.ld: Likewise.
	* ld-mips-elf/mips-lib.ld: Likewise.
	* ld-mips-elf/pic-and-nonpic-3a.ld: Likewise.
	* ld-mips-elf/pic-and-nonpic-3b.ld: Likewise.
	* ld-mips-elf/pic-and-nonpic-4b.ld: Likewise.
	* ld-mips-elf/pic-and-nonpic-5b.ld: Likewise.
	* ld-mips-elf/region1.t: Likewise.
	* ld-mips-elf/stub-dynsym-1.ld: Likewise.
	* ld-mips-elf/tls-hidden3.ld: Likewise.
	* ld-mips-elf/vxworks1.ld: Likewise.
	* ld-scripts/overlay-size.t: Likewise.
	* ld-mips-elf/elf-rel-got-n32-embed.d: Remove .MIPS.abiflags from
	objects.
	* ld-mips-elf/elf-rel-got-n32.d: Likewise.
	* ld-mips-elf/elf-rel-got-n64-embed.d: Likewise.
	* ld-mips-elf/elf-rel-got-n64-linux.d: Likewise.
	* ld-mips-elf/elf-rel-got-n64.d: Likewise.
	* ld-mips-elf/elf-rel-xgot-n32.d: Likewise.
	* ld-mips-elf/elf-rel-xgot-n32-embed.d: Likewise.
	* ld-mips-elf/elf-rel-xgot-n64.d: Likewise.
	* ld-mips-elf/elf-rel-xgot-n64-linux.d: Likewise.
	* ld-mips-elf/elf-rel-xgot-n64-embed.d: Likewise.
	* ld-mips-elf/mips-elf.exp: Add new tests.
2014-07-29 11:27:59 +01:00
Joel Sherrill 8a196b99a8 or1k: RTEMS target support and simplify matching
* gas/configure.tgt (or1k*-*-rtems*): Ensure a match.
	(or1k*-*-*): Use or1k* to match or1knd and or1kZ.

Signed-off-by: Christian Svensson <blue@cmd.nu>
2014-07-27 18:43:33 +02:00
Anthony Green 48494700d5 Add moxiebox target 2014-07-27 08:51:20 -04:00
Alan Modra e57e6ddc2e Prepare gas for 64-bit obstacks
Use size_t in a few places involved with obstacks, and don't include
obstack.h in files that don't use obstacks.

gas/
	* config/bfin-parse.y: Don't include obstack.h.
	* config/obj-aout.c: Likewise.
	* config/obj-coff.c: Likewise.
	* config/obj-som.c: Likewise.
	* config/tc-bfin.c: Likewise.
	* config/tc-i960.c: Likewise.
	* config/tc-rl78.c: Likewise.
	* config/tc-rx.c: Likewise.
	* config/tc-tic4x.c: Likewise.
	* expr.c: Likewise.
	* listing.c: Likewise.
	* config/obj-elf.c (elf_file_symbol): Make name_length a size_t.
	* config/tc-aarch64.c (symbol_locate): Likewise.
	* config/tc-arm.c (symbol_locate): Likewise.
	* config/tc-mmix.c (mmix_handle_mmixal): Make len_0 a size_t.
	* config/tc-score.c (s3_build_score_ops_hsh): Make len a size_t.
	(s3_build_dependency_insn_hsh): Likewise.
	* config/tc-score7.c (s7_build_score_ops_hsh): Likewise.
	(s7_build_dependency_insn_hsh): Likewise.
	* frags.c (frag_grow): Make parameter a size_t, and use size_t locals.
	(frag_new): Make parameter a size_t.
	(frag_var_init): Make max_chars and var parameters size_t.
	(frag_var, frag_variant): Likewise.
	(frag_room): Return a size_t.
	(frag_align_pattern): Make n_fill parameter a size_t.
	* frags.h: Update function prototypes.
	* symbols.c (save_symbol_name): Make name_length a size_t.
2014-07-26 21:00:50 +09:30
Ilya Tocar 90a915bf0c Add AVX512DQ instructions and their AVX512VL variants.
gas/

	* config/tc-i386.c (cpu_arch): Add .avx512dq, CPU_AVX512DQ_FLAGS.
	* doc/c-i386.texi: Document avx512dq/.avx512dq.

gas/testsuite/

	* gas/i386/avx512dq-intel.d: New.
	* gas/i386/avx512dq.d: New.
	* gas/i386/avx512dq.s: New.
	* gas/i386/avx512dq_vl-intel.d: New.
	* gas/i386/avx512dq_vl.d: New.
	* gas/i386/avx512dq_vl.s: New.
	* gas/i386/i386.exp: Run new AVX-512 tests.
	* gas/i386/x86-64-avx512dq-intel.d: New.
	* gas/i386/x86-64-avx512dq.d: New.
	* gas/i386/x86-64-avx512dq.s: New.
	* gas/i386/x86-64-avx512dq_vl-intel.d: New.
	* gas/i386/x86-64-avx512dq_vl.d: New.
	* gas/i386/x86-64-avx512dq_vl.s: New.

opcodes/

	* i386-dis-evex.h: Updated.
	* i386-dis.c (PREFIX enum): Add PREFIX_EVEX_0F54, PREFIX_EVEX_0F55,
	PREFIX_EVEX_0F56, PREFIX_EVEX_0F57, PREFIX_EVEX_0F3A16,
	PREFIX_EVEX_0F3A22, PREFIX_EVEX_0F3A50, PREFIX_EVEX_0F3A51,
	PREFIX_EVEX_0F3A56, PREFIX_EVEX_0F3A57, PREFIX_EVEX_0F3A66,
	PREFIX_EVEX_0F3A67.
	(VEX_LEN enum): Add VEX_LEN_0F92_P_2, VEX_LEN_0F93_P_2,
	VEX_W_0F92_P_2_LEN_0, VEX_W_0F93_P_2_LEN_0.
	(VEX_W enum): Add EVEX_W_0F54_P_0, EVEX_W_0F54_P_2, EVEX_W_0F55_P_0,
	EVEX_W_0F55_P_2, EVEX_W_0F56_P_0, EVEX_W_0F56_P_2, EVEX_W_0F57_P_0,
	EVEX_W_0F57_P_2, EVEX_W_0F78_P_2, EVEX_W_0F79_P_2, EVEX_W_0F7A_P_2,
	EVEX_W_0F7B_P_2, EVEX_W_0F3838_P_1, EVEX_W_0F3839_P_1,
	EVEX_W_0F3A16_P_2, EVEX_W_0F3A22_P_2, EVEX_W_0F3A50_P_2,
	EVEX_W_0F3A51_P_2, EVEX_W_0F3A56_P_2, EVEX_W_0F3A57_P_2,
	EVEX_W_0F3A66_P_2, EVEX_W_0F3A67_P_2.
	(prefix_table): Add entries for new instructions.
	(vex_len_table): Ditto.
	(vex_w_table): Ditto.
	(OP_E_memory): Update xmmq_mode handling.
	* i386-gen.c (cpu_flag_init): Add CPU_AVX512DQ_FLAGS.
	(cpu_flags): Add CpuAVX512DQ.
	* i386-init.h: Regenerared.
	* i386-opc.h (CpuAVX512DQ): New.
	(i386_cpu_flags): Add cpuavx512dq.
	* i386-opc.tbl: Add AVX512DQ instructions.
	* i386-tbl.h: Regenerate.
2014-07-22 10:23:49 -07:00
Ilya Tocar 1ba585e8f4 Add support for AVX512BW instructions and their AVX512VL versions.
gas/

	* config/tc-i386.c (cpu_arch): Add .avx512bw, CPU_AVX512BW_FLAGS.
	* doc/c-i386.texi: Document avx512bw/.avx512bw.

gas/testsuite/

	* gas/i386/avx512bw-intel.d: New.
	* gas/i386/avx512bw-opts-intel.d: New.
	* gas/i386/avx512bw-opts.d: New.
	* gas/i386/avx512bw-opts.s: New.
	* gas/i386/avx512bw-wig.s: New.
	* gas/i386/avx512bw-wig1-intel.d: New.
	* gas/i386/avx512bw-wig1.d: New.
	* gas/i386/avx512bw.d: New.
	* gas/i386/avx512bw.s: New.
	* gas/i386/avx512bw_vl-intel.d: New.
	* gas/i386/avx512bw_vl-opts-intel.d: New.
	* gas/i386/avx512bw_vl-opts.d: New.
	* gas/i386/avx512bw_vl-opts.s: New.
	* gas/i386/avx512bw_vl-wig.s: New.
	* gas/i386/avx512bw_vl-wig1-intel.d: New.
	* gas/i386/avx512bw_vl-wig1.d: New.
	* gas/i386/avx512bw_vl.d: New.
	* gas/i386/avx512bw_vl.s: New.
	* gas/i386/i386.exp: Run new AVX-512 tests.
	* gas/i386/x86-64-avx512bw-intel.d: New.
	* gas/i386/x86-64-avx512bw-opts-intel.d: New.
	* gas/i386/x86-64-avx512bw-opts.d: New.
	* gas/i386/x86-64-avx512bw-opts.s: New.
	* gas/i386/x86-64-avx512bw-wig.s: New.
	* gas/i386/x86-64-avx512bw-wig1-intel.d: New.
	* gas/i386/x86-64-avx512bw-wig1.d: New.
	* gas/i386/x86-64-avx512bw.d: New.
	* gas/i386/x86-64-avx512bw.s: New.
	* gas/i386/x86-64-avx512bw_vl-intel.d: New.
	* gas/i386/x86-64-avx512bw_vl-opts-intel.d: New.
	* gas/i386/x86-64-avx512bw_vl-opts.d: New.
	* gas/i386/x86-64-avx512bw_vl-opts.s: New.
	* gas/i386/x86-64-avx512bw_vl-wig.s: New.
	* gas/i386/x86-64-avx512bw_vl-wig1-intel.d: New.
	* gas/i386/x86-64-avx512bw_vl-wig1.d: New.
	* gas/i386/x86-64-avx512bw_vl.d: New.
	* gas/i386/x86-64-avx512bw_vl.s: New.

opcodes/

	* i386-dis-evex.h: Add new instructions (prefixes bellow).
	* i386-dis.c (fetch_data): Add EdqwS, Edb, Edw, MaskBDE.
	(enum): Add dqw_swap_mode, db_mode, dw_mode, mask_bd_mode, REG_EVEX_0F71.
	(PREFIX enum): Add PREFIX_VEX_0F4A, PREFIX_VEX_0F99, PREFIX_VEX_0F3A31,
	PREFIX_VEX_0F3A33, PREFIX_EVEX_0F60, PREFIX_EVEX_0F61, PREFIX_EVEX_0F63,
	PREFIX_EVEX_0F64, PREFIX_EVEX_0F65, PREFIX_EVEX_0F67, PREFIX_EVEX_0F68,
	PREFIX_EVEX_0F69, PREFIX_EVEX_0F6B, PREFIX_EVEX_0F71_REG_2, PREFIX_EVEX_0F71_REG_4,
	PREFIX_EVEX_0F71_REG_6, PREFIX_EVEX_0F73_REG_3, PREFIX_EVEX_0F73_REG_7,
	PREFIX_EVEX_0F74, PREFIX_EVEX_0F75, PREFIX_EVEX_0FC4, PREFIX_EVEX_0FC5,
	PREFIX_EVEX_0FD1, PREFIX_EVEX_0FD5, PREFIX_EVEX_0FD8, PREFIX_EVEX_0FD9,
	PREFIX_EVEX_0FDA, PREFIX_EVEX_0FDC, PREFIX_EVEX_0FDD, PREFIX_EVEX_0FDE,
	PREFIX_EVEX_0FE0, PREFIX_EVEX_0FE1, PREFIX_EVEX_0FE3, PREFIX_EVEX_0FE4,
	PREFIX_EVEX_0FE5, PREFIX_EVEX_0FE8, PREFIX_EVEX_0FE9, PREFIX_EVEX_0FEA,
	PREFIX_EVEX_0FEC, PREFIX_EVEX_0FED, PREFIX_EVEX_0FEE, PREFIX_EVEX_0FF1,
	PREFIX_EVEX_0FF5, PREFIX_EVEX_0FF6, PREFIX_EVEX_0FF8, PREFIX_EVEX_0FF9,
	PREFIX_EVEX_0FFC, PREFIX_EVEX_0FFD, PREFIX_EVEX_0F3800, PREFIX_EVEX_0F3804,
	PREFIX_EVEX_0F380B, PREFIX_EVEX_0F3810, PREFIX_EVEX_0F381C, PREFIX_EVEX_0F381D,
	PREFIX_EVEX_0F3820, PREFIX_EVEX_0F3826, PREFIX_EVEX_0F382B, PREFIX_EVEX_0F3830,
	PREFIX_EVEX_0F3838, PREFIX_EVEX_0F383C, PREFIX_EVEX_0F383E, PREFIX_EVEX_0F3866,
	PREFIX_EVEX_0F3875, PREFIX_EVEX_0F3878, PREFIX_EVEX_0F3879, PREFIX_EVEX_0F387A,
	PREFIX_EVEX_0F387B, PREFIX_EVEX_0F387D, PREFIX_EVEX_0F388D, PREFIX_EVEX_0F3A0F,
	PREFIX_EVEX_0F3A14, PREFIX_EVEX_0F3A15, PREFIX_EVEX_0F3A20, PREFIX_EVEX_0F3A3E,
	PREFIX_EVEX_0F3A3F, PREFIX_EVEX_0F3A42.
	(VEX_LEN enum): Add VEX_LEN_0F41_P_2, VEX_LEN_0F42_P_2, VEX_LEN_0F44_P_2,
	VEX_LEN_0F45_P_2, VEX_LEN_0F46_P_2, VEX_LEN_0F47_P_2, VEX_LEN_0F4A_P_0,
	VEX_LEN_0F4A_P_2, VEX_LEN_0F4B_P_0, VEX_LEN_0F90_P_2, VEX_LEN_0F91_P_2,
	VEX_LEN_0F92_P_3, VEX_LEN_0F93_P_3, VEX_LEN_0F98_P_2, VEX_LEN_0F99_P_0,
	VEX_LEN_0F99_P_2, VEX_LEN_0F3A31_P_2, VEX_LEN_0F3A33_P_2, VEX_W_0F41_P_2_LEN_1,
	VEX_W_0F42_P_2_LEN_1, VEX_W_0F44_P_2_LEN_0, VEX_W_0F45_P_2_LEN_1,
	VEX_W_0F46_P_2_LEN_1, VEX_W_0F47_P_2_LEN_1, VEX_W_0F4A_P_0_LEN_1,
	VEX_W_0F4A_P_2_LEN_1, VEX_W_0F4B_P_0_LEN_1, VEX_W_0F90_P_2_LEN_0,
	VEX_W_0F91_P_2_LEN_0, VEX_W_0F92_P_3_LEN_0, VEX_W_0F93_P_3_LEN_0,
	VEX_W_0F98_P_2_LEN_0, VEX_W_0F99_P_0_LEN_0, VEX_W_0F99_P_2_LEN_0,
	VEX_W_0F3A31_P_2_LEN_0, VEX_W_0F3A33_P_2_LEN_0.
	(VEX_W enum): Add EVEX_W_0F6B_P_2, EVEX_W_0F6F_P_3, EVEX_W_0F7F_P_3,
	EVEX_W_0F3810_P_1, EVEX_W_0F3810_P_2, EVEX_W_0F3811_P_2, EVEX_W_0F3812_P_2,
	EVEX_W_0F3820_P_1, EVEX_W_0F3826_P_1, EVEX_W_0F3826_P_2, EVEX_W_0F3828_P_1,
	EVEX_W_0F3829_P_1, EVEX_W_0F382B_P_2, EVEX_W_0F3830_P_1, EVEX_W_0F3866_P_2,
	EVEX_W_0F3875_P_2, EVEX_W_0F3878_P_2, EVEX_W_0F3879_P_2, EVEX_W_0F387A_P_2,
	EVEX_W_0F387B_P_2, EVEX_W_0F387D_P_2, EVEX_W_0F388D_P_2, EVEX_W_0F3A3E_P_2,
	EVEX_W_0F3A3F_P_2, EVEX_W_0F3A42_P_2.
	(prefix_table): Add entries for new instructions.
	(vex_table) : Ditto.
	(vex_len_table): Ditto.
	(vex_w_table): Ditto.
	(intel_operand_size): Add db_mode, dw_mode, dqw_swap_mode,
	mask_bd_mode handling.
	(OP_E_register): Add dqw_swap_mode, dw_mode, db_mode, mask_bd_mode
	handling.
	(OP_E_memory): Add dqw_mode, dw_mode, dqw_swap_mode, dqb_mode, db_mode
	handling.
	(OP_G): Add db_mode, dw_mode, dqw_swap_mode, mask_bd_mode handling.
	(OP_EX): Add dqw_swap_mode handling.
	(OP_VEX): Add mask_bd_mode handling.
	(OP_Mask): Add mask_bd_mode handling.
	* i386-gen.c (cpu_flag_init): Add CPU_AVX512BW_FLAGS.
	(cpu_flags): Add CpuAVX512BW.
	* i386-init.h: Regenerated.
	* i386-opc.h (CpuAVX512BW): New.
	(i386_cpu_flags): Add cpuavx512bw.
	* i386-opc.tbl: Add AVX512BW instructions.
	* i386-tbl.h: Regenerate.
2014-07-22 10:23:44 -07:00
Ilya Tocar b28d1bda54 Add support for AVX512VL. Add AVX512VL versions of AVX512F instructions.
gas/

	* config/tc-i386.c (cpu_arch): Add .avx512vl, CPU_AVX512VL_FLAGS.
	(build_vex_prefix): Don't abort on VEX.W.
	(check_VecOperands): Support BROADCAST_1TO4 and BROADCAST_1TO2.
	(check_VecOperations): Ditto.
	* doc/c-i386.texi: Document avx512vl/.avx512vl.

gas/testsuite/

	* gas/i386/avx512f_vl-intel.d: New.
	* gas/i386/avx512f_vl-opts-intel.d: New.
	* gas/i386/avx512f_vl-opts.d: New.
	* gas/i386/avx512f_vl-opts.s: New.
	* gas/i386/avx512f_vl-wig.s: New.
	* gas/i386/avx512f_vl-wig1-intel.d: New.
	* gas/i386/avx512f_vl-wig1.d: New.
	* gas/i386/avx512f_vl.d: New.
	* gas/i386/avx512f_vl.s: New.
	* gas/i386/i386.exp: Run new AVX-512 tests.
	* gas/i386/x86-64-avx512f_vl-intel.d: New.
	* gas/i386/x86-64-avx512f_vl-opts-intel.d: New.
	* gas/i386/x86-64-avx512f_vl-opts.d: New.
	* gas/i386/x86-64-avx512f_vl-opts.s: New.
	* gas/i386/x86-64-avx512f_vl-wig.s: New.
	* gas/i386/x86-64-avx512f_vl-wig1-intel.d: New.
	* gas/i386/x86-64-avx512f_vl-wig1.d: New.
	* gas/i386/x86-64-avx512f_vl.d: New.
	* gas/i386/x86-64-avx512f_vl.s: New.

opcodes/

	* i386-dis.c (intel_operand_size): Support 128/256 length in
	vex_vsib_q_w_dq_mode.
	(OP_E_memory): Add ymmq_mode handling, handle new broadcast.
	* i386-gen.c (cpu_flag_init): Add CPU_AVX512VL_FLAGS.
	(cpu_flags): Add CpuAVX512VL.
	* i386-init.h: Regenerated.
	* i386-opc.h (CpuAVX512VL): New.
	(i386_cpu_flags): Add cpuavx512vl.
	(BROADCAST_1TO4, BROADCAST_1TO2): Define.
	* i386-opc.tbl: Add AVX512VL instructions.
	* i386-tbl.h: Regenerate.
2014-07-22 10:23:40 -07:00
Joel Sherrill 3d52a869b2 Add or reactivate or1k-*-rtems*
* bfd/config.bfd (or1k-*-rtems*): Reactivate.
	* gas/configure.tgt (or1k-*-rtems*): Add.

Signed-off-by: Christian Svensson <blue@cmd.nu>
2014-07-22 01:15:41 +02:00
Ilya Tocar d3bb6b49b6 Properly handle EVEX register aliases
gas/

	* config/tc-i386.c (parse_register): Set need_vrex.

gas/testsuite/

	* gas/i386/x86-64-equ.d: New.
	* gas/i386/x86-64-equ.s: New.
	* gas/i386/i386.exp: Run x86-64-equ.
2014-07-17 08:54:05 -07:00
Jiong Wang 19f2f6a9c4 [ARM] Fix 32-bit host build failure.
gas/
    * config/tc-arm.c (add_to_lit_pool): Use "inst.operands[1].imm" for * sign
    extension.  Casting the type of imm1 and imm2 to offsetT.  Fix one logic
    error when checking X_op.
2014-07-15 10:15:43 +01:00
Andreas Schwab ea7cc5bfc8 Don't complain about dbCC to long branch conversion
* config/tc-m68k.c (md_convert_frag_1): Don't complain with
--pcrel about TAB (DBCCLBR, LONG) conversion.
2014-07-15 10:11:01 +02:00
Alan Modra 76bd66cfb5 Don't force "set" symbols local for PE
gas/
	* read.c (assign_symbol): Don't force "set" symbols local for PE.
gas/testsuite/
	* gas/pe/set.s, * gas/pe/set.d: New test.
	* gas/pe/pe.exp: Run it.
2014-07-12 18:50:53 +09:30
Jiong Wang 8335d6aa34 Fix PR 16722 by adding support for 8-byte vector constants.
* config/tc-arm.c (literal_pool): New field "alignment".
  (find_or_make_literal_pool): Initialize "alignment" to 2.
  (s_ltorg): Align the pool using value of "alignment"
  (parse_big_immediate): New parameter "in_exp". Return
  parsed expression if "in_exp" is not null.
  (parse_address_main): Invoke "parse_big_immediate" for
  constant parameter.
  (add_to_lit_pool): Add one parameter 'nbytes'.
  Split 8 byte entry into two 4 byte entry.
  Add padding to align 8 byte entry to 8 byte boundary.
  (encode_arm_cp_address): Generate literal pool entry if possible.
  (move_or_literal_pool): Generate entry for vldr case.
  (enum lit_type): New enum type.
  (do_ldst): Use new enum type.
  (do_ldstv4): Likewise.
  (do_t_ldst): Likewise.
  (neon_write_immbits): Support Thumb-2 mode.

  * gas/arm/ldconst.s: Add test cases for symbol literal.
  * gas/arm/ldconst.d: Likewise.
  * gas/arm/vldconst.s: Add test cases for vldr.
  * gas/arm/thumb2_vpool.s: Likewise.
  * gas/arm/vldconst.d: New pattern for little-endian.
  * gas/arm/thumb2_vpool.d: Likewise.
  * gas/arm/vldconst_be.d: New pattern for big-endian.
  * gas/arm/thumb2_vpool_be.d: Likewise.
2014-07-08 12:14:56 +01:00
Barney Stratford 75f580857a Adds support for writing values to AVR system I/O registers.
* elf32-avr.c: Handle R_AVR_PORT5 and R_AVR_PORT6.
	* reloc.c: Add BFD_RELOC_AVR_PORT5 and BFD_RELOC_AVR_PORT6.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.

	* avr.h: Add R_AVR_PORT5 and R_AVR_PORT6.

	* config/tc-avr.c (avr_operand): Permit referring to r26-r31 by
	name as [xyz][hl].  Permit using a symbol whoes name begins with
	`r' to refer to a register.
	Allow arbitrary expressions for the P and p operators.
	(md_apply_fix): Check the BFD_RELOC_AVR_PORT5 and
	BFD_RELOC_AVR_PORT6 relocations.
2014-07-07 16:15:19 +01:00
Alan Modra 1110793abe Update "configure.in" in comments and doco
bfd/
	* Makefile.am: Update "configure.in" comments.
	* PORTING: Likewise.
	* aoutx.h: Likewise.
	* configure.host: Likewise.
	* doc/bfdint.texi: Likewise.
	* targets.c: Likewise.
	* warning.m4: Likewise.
	* Makefile.in: Regenerate.
gas/
	* doc/internals.texi: Update "configure.in" comments.
	* acinclude.m4: Likewise.
	* config/tc-sparc.c: Likewise.
ld/
	* configure.ac: Update "configure.in" comments.
	* configure: Regenerate.
2014-07-04 15:06:40 +09:30
Alan Modra 35eafcc71b Rename configure.in to configure.ac
bfd/
	* configure.ac: Rename from configure.in.
	* Makefile.in: Regenerate.
	* config.in: Regenerate.
	* doc/Makefile.in: Regenerate.
opcodes/
	* configure.ac: Rename from configure.in.
	* Makefile.in: Regenerate.
	* config.in: Regenerate.
binutils/
	* configure.ac: Rename from configure.in.
	* Makefile.in: Regenerate.
	* config.in: Regenerate.
	* doc/Makefile.in: Regenerate.
gas/
	* configure.ac: Rename from configure.in.
	* Makefile.in: Regenerate.
	* config.in: Regenerate.
	* doc/Makefile.in: Regenerate.
gprof/
	* configure.ac: Rename from configure.in.
	* configure.ac: Rename from configure.in.
	* Makefile.in: Regenerate.
	* gconfig.in: Regenerate.
ld/
	* configure.ac: Rename from configure.in.
	* Makefile.in: Regenerate.
	* config.in: Regenerate.
2014-07-04 13:40:28 +09:30
Alan Modra 82b57a900f Remove some more bfd/configure.in dependencies
Missed from 2e98a7bd

bfd/
	* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove configure.in.
	* Makefile.in: Regenerate.
gas/
	* doc/Makefile.am (CONFIG_STATUS_DEPENDENCIES): Delete.
	* doc/Makefile.in: Regenerate.
2014-07-04 13:25:49 +09:30
Alan Modra 2e98a7bd88 Use modern AC_INIT in configure.in
This removes usage of the obsolete AC_INIT and AM_INIT_AUTOMAKE in all
binutils configure.in files.  The BFD version is now in bfd/version.m4
rather than bfd/configure.in, which allows automake to automatically
track this dependency.

bfd/
	* version.m4: New file.
	* configure.in: Include version.m4.
	(AC_INIT): Update.
	* Makefile.am (RELEASE): Delete.
	(bfdver.h): Depend on development.sh, use instead of RELEASE.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
opcodes/
	* configure.in: Include bfd/version.m4.
	(AC_INIT, AM_INIT_AUTOMAKE): Use modern form.
	(BFD_VERSION): Delete.
	* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
binutils/
	* configure.in: Include bfd/version.m4.
	(AC_INIT, AM_INIT_AUTOMAKE): Use modern form.
	(BFD_VERSION): Delete.
	* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
gas/
	* configure.in: Include bfd/version.m4.
	(AC_INIT, AM_INIT_AUTOMAKE): Use modern form.
	(BFD_VERSION): Delete.
	* configure.com: Get bfd version from bfd/version.m4.
	* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
gprof/
	* configure.in: Include bfd/version.m4.
	(AC_INIT, AM_INIT_AUTOMAKE): Use modern form.
	(BFD_VERSION): Delete.
	* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
ld/
	* configure.in: Include bfd/version.m4.
	(AC_INIT, AM_INIT_AUTOMAKE): Use modern form.
	(BFD_VERSION): Delete.
	* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
2014-07-04 12:41:26 +09:30
Barney Stratford f36e88862f Add support for the AVR Tiny series of microcontrollers.
* archures.c: add avrtiny architecture for avr target.
	* bfd-in2.h: Regenerate.
	* cpu-avr.c (arch_info_struct): add avrtiny arch info.
	* elf32-avr.c (elf_avr_howto_table): new relocation R_AVR_LDS_STS_16
	added for 16 bit LDS/STS instruction of avrtiny arch.
	(avr_reloc_map): reloc R_AVR_LDS_STS_16 is mapped to
	BFD_RELOC_AVR_LDS_STS_16.
	(bfd_elf_avr_final_write_processing): select machine number avrtiny arch.
	(elf32_avr_object_p): set machine number for avrtiny arch.
	* libbfd.h: Regenerate.
	* reloc.c: Add documentation for BFD_RELOC_AVR_LDS_STS_16 reloc.

         * config/tc-avr.c (mcu_types): Add avrtiny arch.
	Add avrtiny arch devices attiny4, attiny5, attiny9, attiny10, attiny20
	and attiny40.
	(md_show_usage): Add avrtiny arch in usage message.
	(avr_operand): validate and issue error for invalid register for avrtiny.
	add new reloc exp for 16 bit lds/sts instruction.
	(md_apply_fix): check 16 bit lds/sts operand for out of range and encode.
	(md_assemble): check ISA for arch and issue diagnostic.

	* include/elf/avr.h (E_AVR_MACH_AVRTINY): define avrtiny machine number.
	(R_AVR_LDS_STS_16): define 16 bit lds/sts reloc number.
	* include/opcode/avr.h (AVR_ISA_TINY): define avrtiny specific ISA.
	(AVR_ISA_2xxxa): define ISA without LPM.
	(AVR_ISA_AVRTINY): define avrtiny arch ISA.
	Add doc for contraint used in 16 bit lds/sts.
	Adjust ISA group for icall, ijmp, pop and push.
	Add 16 bit lds/sts encoding and update 32 bit lds/sts constraints.
	* opcodes/avr-dis.c (avr_operand): Handle constraint j for 16 bit lds/sts.
	(print_insn_avr): do not select opcode if insn ISA is avrtiny and machine
	is not avrtiny.

	* Makefile.am (ALL_EMULATION_SOURCES): add avrtiny emulation source.
	(eavrtiny.c): add rules for avrtiny emulation source.
	* Makefile.in: Regenerate.
	* configure.tgt: Add avrtiny to avr target emulations.
	* scripttempl/avrtiny.sc: New file.
	linker script template for avrtiny arch.
	* emulparams/avrtiny.sh: New file.
	emulation parameters for avrtiny arch.
2014-07-01 10:20:17 +01:00
Alan Modra a03f9b1acf Avoid cascading errors due to write_object_file change
* config/obj-macho.c (obj_mach_o_set_symbol_qualifier): Don't set
	SYM_MACHO_FIELDS_NOT_VALIDATED after reporting an error.
	(obj_mach_o_frob_label): Avoid cascading errors.
	(obj_mach_o_frob_symbol): Don't set SYM_MACHO_FIELDS_NOT_VALIDATED.
2014-06-28 00:20:14 +09:30
DJ Delorie 827dfb62b3 [rx] Make .B suffix optional when possible.
* config/rx-parse.y (BSET, BCLR, BTST, BNOT, BMCMD): Make .B
suffix optional.
2014-06-18 17:16:30 -04:00
Hans-Peter Nilsson a968e61d8e GAS: Fix MMIX err-fb-2.s regression caused by recent generic GAS changes. 2014-06-18 00:11:01 +02:00
Chris Metcalf 6d1ace6861 This fixes a bug whereby #line directives inside a macro would be ignored,
thus resulting in bad line debug information.

	PR gas/16908
	* macro.c (buffer_and_nest): Honour #line directives inside
	macros.
2014-06-17 17:21:08 +01:00
Jiong Wang c8de034b6a gas/ARM: Misses deprecated IT instruction warning for ARMv8
Add sp increment and decrement to ARMv8 IT block deprecate
  pattern.

  gas/
    * config/tc-arm.c (depr_it_insns): New check for inc/dec sp.

  gas/testsuite/
    * gas/arm/armv8-a-it-bad.s: New check for inc/dec sp.
    * gas/arm/armv8-a-it-bad.l: Likewise.
2014-06-17 10:12:52 +01:00
Hans-Peter Nilsson 29cf29a2cf GAS: Fix CRIS double-error reports caused by recent generic GAS changes. 2014-06-17 00:56:01 +02:00
Nick Clifton b97e87cc01 Fixes a problem exposed by the aarcg64/illegal.s test case - where the assembler was
generating too many error messages.

	* config/tc-aarch64.c (md_apply_fix): Ignore unused relocs.
2014-06-16 17:40:02 +01:00
Jiong Wang f4c51f600e This fixes the aarch64 assembler so that it will generate error messages when
a syntax error is detected in an optional operand.

  * config/tc-aarch64.c (END_OF_INSN): New macro.
  (parse_operands): Handle operand given and be in wrong
  format when operand is optional.

  * gas/aarch64/diagnostic.s: New test patterns.
  * gas/aarch64/diagnostic.l: Likewise.
2014-06-16 17:22:19 +01:00
Alan Modra 85024cd8bc Run write_object_file after errors
This is to fix unitialised memory access when printing listings.
Many targets don't initialise parts of insn frags or data frags that
have fixups, relying on md_apply_fix to finalise the frag.  Which is
fine normally, but means we need to run write_object_file after
errors, for listings.  Otherwise MALLOC_PERTURB_=1 causes errors like:
x86_64-linux  +FAIL: i386 mpx-inval-1
x86_64-linux  +FAIL: i386 inval-equ-1
x86_64-linux  +FAIL: i386 x86-64-mpx-inval-1

Running write_object_file after errors requires some tweaking to the
testsuite, since we then get extra errors reported from md_apply_fix.

gas/
	* write.h (subsegs_finish): Delete declaration.
	* write.c (subsegs_finish): Make static.
	(write_object_file): Call subsegs_finish from here.  Don't print
	warning and error count here..
	* as.c (main): ..do so here instead.  Remove dead code for "no
	object file generated".  Split out count strings to better support
	internationalisation.  Don't call subsegs_finish. Tidy setting of
	"keep_it".  Run write_object_file even after errors.
	(keep_it): Make static.
	* config/obj-elf.c (elf_frob_symbol): Remove assert.
	(elf_frob_file_before_adjust): Likewise.
gas/testsuite/
	* gas/elf/bad-group.s: Use %function.
	* gas/elf/bad-group.err: Expect correct line number.  Allow
	other errors.
	* gas/elf/bad-size.err: Allow other errors.  Match expected
	error somewhat more rigorously.
	* gas/i386/reloc32.l: Allow other errors.
	* gas/i386/mpx-inval-1.l: Match applied relocs.
	* gas/i386/x86-64-mpx-inval-1.l: Likewise, and nop padding.
	* gas/i386/x86-64-mpx-inval-2.l: Match nop padding, and allow
	other errors.
	* gas/macros/dot.s: Use .balign.
	* gas/macros/dot.l: Update alignment output.
	* gas/symver/symver6.l: Allow other errors.
2014-06-16 12:34:45 +09:30
Alan Modra 97d24fbbf5 Don't leave DLX the_insn uninitialised
In particular the_insn.reloc must be initialised, otherwise the early
exit cases for bad opcodes will result in cascading errors if
write_object_file is called after an error.

	* config/tc-dlx.c (machine_ip): Move initialisation of the_insn
	earlier.
2014-06-16 12:33:42 +09:30
Alan Modra 1ab668bf2a Report an error on x86 pcrel BFD_RELOC_SIZE64
* config/tc-i386.c (reloc): Don't avoid pcrel check for
	BFD_RELOC_SIZE64.  Return NO_RELOC on failing pcrel check.
2014-06-16 12:32:56 +09:30
Alan Modra 7e9def1e93 Fix unintitialised TIC6X data
MALLOC_PERTURB_=1 results in the following fails due to uninitialised
exindx data:

FAIL: C6X unwinding directives 1 (little endian)
FAIL: C6X unwinding directives 2 (big endian)
FAIL: C6X unwinding directives 3 (segment change)
FAIL: ld-tic6x/unwind-1
FAIL: ld-tic6x/unwind-2
FAIL: ld-tic6x/unwind-3
FAIL: ld-tic6x/unwind-4
FAIL: ld-tic6x/unwind-6

	* config/tc-tic6x.c (s_tic6x_ehtype): Clear after frag_more.
	(tic6x_output_exidx_entry): Likewise.
	(md_apply_fix): Simplify 1 byte md_number_to_chars.
2014-06-16 12:31:53 +09:30
Alan Modra 6e210b4129 Fix TIC54X buffer overruns
MALLOC_PERTURB_=1 results in "FAIL: c54x macros".

	* config/tc-tic54x.c (tic54x_mlib): Don't write garbage past
	end of archive to temp file.
	(tic54x_start_line_hook): Start scan for parallel on next line,
	not one char into next line (which may overrun the buffer).
2014-06-16 12:30:53 +09:30
Alan Modra ee0738df02 Fix uninitialised VAX insn
MALLOC_PERTURB_=1 results in "FAIL: VAX ELF relocations", due to object
file being emitted with uninitialised fields.  Since these fields had
RELA relocs the field value won't be used at final link time, so the
problem is only seen in relocatable object files.

This rewrite of md_apply_fix clears all fields with relocs, whereas
before some fields had non-zero values.

gas/
	* config/tc-vax.c (md_apply_fix): Rewrite.
	(tc_gen_reloc, vax_cons, vax_cons_fix_new): Style: Use NO_RELOC
	define rather than the equivalent BFD_RELOC_NONE.
gas/testsuite/
	* gas/vax/elf-rel.d: Update.
2014-06-16 12:29:52 +09:30
Alan Modra 4b1a927e92 Fix uninitialised ARM data
MALLOC_PERTURB_=1 results in "FAIL: PIC" on arm-vxworks, due to garbage
in words with got relocs.

	* config/tc-arm.c (s_arm_elf_cons): Initialise after frag_more.
	(md_apply_fix): Delete now unnecessary zeroing for BFD_RELOC_ARM_GOT*
	and BFD_RELOC_ARM_TLS* relocs.  Simplify BFD_RELOC_8 case.
2014-06-16 12:26:38 +09:30
Alan Modra 44ed9ef26f Fix uninitialised CRIS insn
gas/
	* config/tc-cris.c (md_create_long_jump): Follow "short" jump
	with a nop rather than leaving uninitialised.
gas/testsuite/
	* gas/cris/rd-bkw4v32.d: Update.
2014-06-16 12:23:54 +09:30
Chen Gang f26c187e29 Fix seg-faults when fetching the frags of local symbols.
* config/tc-score7.c: (s7_b32_relax_to_b16): Use symbol_get_frag() to access a symbol's frag.
	* config/tc-score.c (s3_relax_branch_inst16): Likewise.
	(s3_relax_cmpbranch_inst32): Likewise.
2014-06-13 16:07:21 +01:00
Chen Gang 2132b4072f A simple replacement of sprintf (xxx, "%s", xxx) with strcpy.
* config/tc-score7.c: Replace sprintf with strcpy where
	appropriate.
2014-06-13 15:52:55 +01:00
Alan Modra a47622ac1b Allow both signed and unsigned fields in PowerPC cmpli insn
There are legitimate reasons to allow a signed value in a cmpli insn
field, for example to test for a "stw r1,lock@sdarel(r13)" instruction
in user code, a kernel might use
	subis r3,r3,STW_R1_0R13@ha	# subtract off high part
	cmplwi r3,lock@sdarel		# is low part accessing lock?
Since the lock@sdarel may take a range of -32768 to 32767,
the allowed range of cmpli immediate must be at least [-32768,65535].

bfd/
	* elf32-ppc.c (ppc_elf_relocate_section): Treat field of cmpli
	insn as a bitfield; Use complain_overflow_bitfield.
	* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
opcodes/
	* ppc-opc.c (UISIGNOPT): Define and use with cmpli.
gas/
	* config/tc-ppc.c (ppc_insert_operand): Handle PPC_OPERAND_SIGNOPT
	on unsigned fields.  Comment on PPC_OPERAND_SIGNOPT signed fields
	in 64-bit mode.
gold/
	* powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2014-06-07 14:55:11 +09:30
Martin Storsjo 34fd659b79 [AArch64] Fix the documentation on :pg_hi21: 2014-06-06 07:29:19 +01:00
Joel Brobecker 270c993744 Make it easy to make --disable-werror the default for both binutils and gdb
The goal of this patch is to provide an easy way to make
--disable-werror the default when building binutils, or the parts
of binutils that need to get built when building GDB. In development
mode, we want to continue making -Werror the default with GCC.
But, when making releases, I think we want to make it as easy as
possible for regular users to successfully build from sources.

GDB already has this kind of feature to turn -Werror as well as
the use of the libmcheck library. As GDB Release Manager, I take
advantage of it to turn those off after having cut the branch.
I'd like to be able to do the same for the binutils bits. And
perhaps Tristan will want to do the same for his releases too
(not sure, binutils builders might be a little savvier than GDB
builders).

This patch introduces a new file, called development.sh, which
just sets a variable called $development. In our development branches
(Eg. "master"), it's set to true. But setting it to false would allow
us to change the default behavior of various development-related
features to be turned off; in this case, it turns off the use of
-Werror by default (use --enable-werror to turn it back on).

bfd/ChangeLog:

        * development.sh: New file.
        * warning.m4 (AM_BINUTILS_WARNINGS): Source bfd/development.sh.
        Make -Werror the default with GCC only if DEVELOPMENT is true.
        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add
        $(srcdir)/development.sh.
        * Makefile.in, configure: Regenerate.

binutils/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
        bfd's development.sh.
        * Makefile.in, configure: Regenerate.

gas/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
        bfd's development.sh.
        * Makefile.in, configure: Regenerate.

gold/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
        * Makefile.in, configure: Regenerate.

gprof/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
        bfd's development.sh.
        * Makefile.in, configure: Regenerate.

ld/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
        bfd's development.sh.
        * Makefile.in, configure: Regenerate.

opcodes/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
        bfd's development.sh.
        * Makefile.in, configure: Regenerate.

gdb/ChangeLog:

        * development.sh: Delete.
        * Makefile.in (config.status): Adjust dependency on development.sh.
        * configure.ac: Adjust development.sh source call.
        * configure: Regenerate.

gdb/gdbserver/ChangeLog:

        * configure.ac: Adjust development.sh source call.
        * Makefile.in (config.status): Adjust dependency on development.sh.
        * configure: Regenerate.

Tested on x86_64-linux by building two ways: One with DEVELOPMENT
set to true, and one with DEVELOPMENT set to false. In the first
case, I could see the use of -Werror, while it disappeared in
the second case.
2014-06-05 05:47:29 -07:00
Nick Clifton 69227609dc Change -mz command line option to -my for the MSP430 port of GAS.
* config/tc-msp430.c (OPTION_WARN_INTR_NOPS): Use y instead of z.
	(OPTION_NO_WARN_INTR_NOPS): Use Y instead of Z.
	* doc/c-msp430.texi: Update command line option description.

	* gas/msp430/bad.d: Use -my not -mz.
2014-06-03 08:49:02 +01:00
Alan Modra b52855e7a0 Fix whitespace in gas listing errors and warnings
gas/
	* listing.c (listing_warning, listing_error): Add space after colon.
	* messages.c (as_warn_internal, as_bad_internal): Use the same
	string as above.
gas/testsuite/
	* gas/d30v/bittest.l: Update for changed whitespace.
	* gas/d30v/serial.l: Likewise.
	* gas/d30v/serial2.l: Likewise.
	* gas/d30v/serial2O.l: Likewise.
	* gas/d30v/warn_oddreg.l: Likewise.
	* gas/i386/inval-equ-2.l: Likewise.
	* gas/i386/mpx-inval-1.l: Likewise.
	* gas/i386/sse-check-error.l: Likewise.
	* gas/i386/x86-64-mpx-inval-1.l: Likewise.
	* gas/i386/x86-64-mpx-inval-2.l: Likewise.
	* gas/i386/x86-64-size-inval-1.l: Likewise.
	* gas/i386/x86-64-sse-check-error.l: Likewise.
2014-05-22 18:53:22 +09:30
mfortune 9096206c9a Add ChangeLog from previous MIPS .module commit 2014-05-20 23:51:06 +01:00
mfortune 153ff4340d Remove newly introduced whitespace from warnings.
* messages.c (as_warn_internal): Remove extra whitespace from
	warning messages.
2014-05-20 23:40:49 +01:00
mfortune 82bda27b2f Mark MSA as requiring FP64
gas/
	* config/tc-mips.c (FP64_ASES): Add ASE_MSA.
	(mips_after_parse_args): Do not select ASE_MSA without -mfp64.

gas/testsuite/

	* gas/mips/micromips@msa-branch.d: Rework expected output for fp64.
	* gas/mips/msa-branch.d: Likewise.
2014-05-20 23:05:03 +01:00
Mike Stump 39128ec026 * messages.c (as_warn_internal): Ensure we don't interleave output
within a single line when make -j is used.
	(as_bad_internal): Likewise.
2014-05-20 12:45:30 -07:00
Richard Sandiford 9440a90459 gas/
* config/obj-elf.h (obj_elf_seen_attribute): Declare.
	* config/obj-elf.c (recorded_attribute_info): New structure.
	(recorded_attributes): New variable.
	(record_attribute, obj_elf_seen_attribute): New functions.
	(obj_elf_vendor_attribute): Record which attributes have been seen.
2014-05-20 19:02:41 +01:00
Nick Clifton 00b32ff21f Fix MSP430 assembler to support #hi(<symbol>).
* config/tc-msp430.c (CHECK_RELOC_MSP430): Add OP parameter.
	Generate BFD_RELOC_MSP430_ABS_HI16 if vshift is 1.
	(msp430_srcoperand): Store vshift value in operand.

	* msp430.h (struct msp430_operand_s): Add vshift field.

	* gas/elf/struct.d: Expect extra output from some toolchains.
	* gas/symver/symver0.d: Likewise.
	* gas/symver/symver1.d: Likewise.
2014-05-20 10:28:42 +01:00
Nick Clifton 296a868924 Extend the fix already created for PR 16858 so that it works with x86 PE targets as well.
PR gas/16858
	* config/tc-i386.c (md_apply_fix): Improve the detection of code
	symbols for 32-bit PE targets.
2014-05-19 14:29:31 +01:00
Richard Sandiford fd5c94abf6 gas/
* config/tc-mips.c (md_obj_begin): Delete.
	(md_obj_end): Fold into...
	(md_mips_end): ...here.  Move to end of file.
2014-05-18 20:28:04 +01:00
Nick Clifton 77f730a2f5 Prevent the V850 assembler from generating an internal error if it is asked to
handle a ctoff() pseudo-op when running in RH850 ABI mode.

	PR gas/16946
	* config/tc-v850.c (handle_ctoff): Generate an error if called
	when using the RH850 ABI.
2014-05-17 17:48:44 +01:00
Kaushik Phata 856ea05ccf This adds support for marking RL78 binaries as either supporting 32-bit
or 64-bit doubles.  It also makes the linker complain if the user attempts
to link together binaries with different sized doubles.

	* elf32-rl78.c (rl78_elf_merge_private_bfd_data): Complain if
	64-bit doubles objects mix with 32-bit doubles objects.
	(rl78_elf_print_private_bfd_data): Describe 64-bit doubles flag.

	* readelf.c (get_machine_flags): Handle RL78 64-bit doubles flag.

	* config/tc-rl78.c (enum options): Add OPTION_32BIT_DOUBLES
	and OPTION_64BIT_DOUBLES.
	(md_longopts): Add -m32bit-doubles and -m64bit-doubles.
	(md_parse_option): Parse -m32bit-doubles and -m64bit-doubles.
	(md_show_usage): Show all of the RL78 options.
	(rl78_float_cons): New static functions.
	(md_pseudo_table): Update handler for "double".
2014-05-16 14:57:10 +01:00
mfortune bad1aba328 Re-work register size macros for MIPS.
gas/
	* config/tc-mips.c (mips_set_options): Rename gp32 to gp throughout.
	(HAVE_32BIT_GPRS, HAVE_64BIT_GPRS): Remove. Re-implement via GPR_SIZE.
	(HAVE_32BIT_FPRS, HAVE_64BIT_FPRS): Remove. Re-implement via FPR_SIZE.
	(GPR_SIZE, FPR_SIZE): New macros. Use throughout.
2014-05-13 12:03:08 +01:00
mfortune 0ae19f059a Fix references to file_mips_isa missed in previous patch.
gas/
	* config/tc-mips.c (md_parse_option): Update missed file_mips_isa
	references.
2014-05-08 22:07:49 +01:00
mfortune 0b35dfeec6 Consolidate file_mips_xxx variables.
gas/
	* config/tc-mips.c (mips_set_options): Rename fp32 field to fp.
	Update fp32 == 0 to fp == 64 and fp32 == 1 to fp != 64 throughout.
	(file_mips_gp32, file_mips_fp32, file_mips_soft_float,
	file_mips_single_float, file_mips_isa, file_mips_arch): Merge into
	one struct...
	(file_mips_opts): Here. New static global. Update throughout.
	(mips_opts): Update defaults for gp32 and fp.
2014-05-08 21:55:06 +01:00
mfortune 263b257428 Implement CONVERT_SYMBOLIC_ATTRIBUTE for MIPS.
gas/
	* config/tc-mips.c (streq): Define.
	(mips_convert_symbolic_attribute): New function.
	* config/tc-mips.h (CONVERT_SYMBOLIC_ATTRIBUTE): Define.
	(mips_convert_symbolic_attribute): New prototype

gas/testsuite/
	* gas/mips/attr-gnu-abi-fp-1.s: New.
	* gas/mips/attr-gnu-abi-fp-1.d: New.
	* gas/mips/attr-gnu-abi-msa-1.s: New.
	* gas/mips/attr-gnu-abi-msa-1.d: New.
	* gas/mips/mips.exp: Add new tests.
2014-05-08 15:09:35 +01:00
Volodymyr Arbatov 1058c7532d Use signed data type for R_XTENSA_DIFF* relocation offsets.
R_XTENSA_DIFF relocation offsets are in fact signed. Treat them as such.
Add testcase that examines ld behaviour on R_XTENSA_DIFF relocation
changing sign during relaxation.

2014-05-02  Volodymyr Arbatov  <arbatov@cadence.com>
	    David Weatherford  <weath@cadence.com>
	    Max Filippov  <jcmvbkbc@gmail.com>

bfd/
  * elf32-xtensa.c (relax_section): treat R_XTENSA_DIFF* relocations as
  signed.

gas/
  * config/tc-xtensa.c (md_apply_fix): mark BFD_RELOC_XTENSA_DIFF*
  fixups as signed.

ld/testsuite/
  * ld-xtensa/diff_overflow.exp, * ld-xtensa/diff_overflow1.s,
  * ld-xtensa/diff_overflow2.s: Add test for DIFF* relocation
  signedness and overflow checking.
2014-05-08 01:55:41 +04:00
Andrew Bennett ae52f48306 Add MIPS r3 and r5 support.
This patch firstly adds support for mips32r3 mips32r5, mips64r3
and mips64r5.  Secondly it adds support for the eretnc instruction.

ChangeLog:

bfd/
	* aoutx.h (NAME (aout, machine_type)): Add mips32r3, mips64r3,
	mips32r5 and mips64r5.
	* archures.c (bfd_architecture): Likewise.
	* bfd-in2.h (bfd_architecture): Likewise.
	* cpu-mips.c (arch_info_struct): Likewise.
	* elfxx-mips.c (mips_set_isa_flags): Likewise.

gas/
	* tc-mips.c (ISA_SUPPORTS_MIPS16E): Add mips32r3, mips32r5, mips64r3
	and mips64r5.
	(ISA_HAS_64BIT_FPRS): Likewise.
	(ISA_HAS_ROR): Likewise.
	(ISA_HAS_ODD_SINGLE_FPR): Likewise.
	(ISA_HAS_MXHC1): Likewise.
	(hilo_interlocks): Likewise.
	(md_longopts): Likewise.
	(ISA_HAS_64BIT_REGS): Add mips64r3 and mips64r5.
	(ISA_HAS_DROR): Likewise.
	(options): Add OPTION_MIPS32R3, OPTION_MIPS32R5, OPTION_MIPS64R3, and
	OPTION_MIPS64R5.
	(mips_isa_rev): Add support for mips32r3, mips32r5, mips64r3 and
	mips64r5.
	(md_parse_option): Likewise.
	(s_mipsset): Likewise.
	(mips_cpu_info_table): Add entries for mips32r3, mips32r5, mips64r3
	and mips64r5.  Also change p5600 entry to be mips32r5.
	* configure.in: Add support for mips32r3, mips32r5, mips64r3 and
	mips64r5.
	* configure: Regenerate.
	* doc/c-mips.texi: Document the -mips32r3, -mips32r5, -mips64r3 and
	-mips64r5 command line options.
	* doc/as.texinfo: Likewise.

gas/testsuite/
	* gas/mips/mips.exp: Add MIPS32r5 tests.  Also add the mips32r3,
	mips32r5, mips64r3 and mips64r5 isas to the testsuite.
	* gas/mips/r5.s: New test.
	* gas/mips/r5.d: Likewise.

include/opcode/
	* mips.h (INSN_ISA_MASK): Updated.
	(INSN_ISA32R3): New define.
	(INSN_ISA32R5): New define.
	(INSN_ISA64R3): New define.
	(INSN_ISA64R5): New define.
	(INSN_ISA64, INSN_ISA64R2, INSN_ISA3_32, INSN_ISA3_32R2, INSN_ISA4_32
	INSN_ISA4_32R2, INSN_ISA5_32R2): Renumbered.
	(mips_isa_table): Add entries for mips32r3, mips32r5, mips64r3 and
	mips64r5.
	(INSN_UPTO32R3): New define.
	(INSN_UPTO32R5): New define.
	(INSN_UPTO64R3): New define.
	(INSN_UPTO64R5): New define.
	(ISA_MIPS32R3): New define.
	(ISA_MIPS32R5): New define.
	(ISA_MIPS64R3): New define.
	(ISA_MIPS64R5): New define.
	(CPU_MIPS32R3): New define.
	(CPU_MIPS32R5): New define.
	(CPU_MIPS64R3): New define.
	(CPU_MIPS64R5): New define.

opcodes/
	* mips-opc.c (mips_builtin_opcodes): Add MIPS32r5 eretnc instruction.
	(I34): New define.
	(I36): New define.
	(I66): New define.
	(I68): New define.
	* mips-dis.c (mips_arch_choices): Add mips32r3, mips32r5, mips64r3 and
	mips64r5.
	(parse_mips_dis_option): Update MSA and virtualization support to
	allow mips64r3 and mips64r5.
2014-05-07 11:47:29 +01:00
Nick Clifton f01c1a090e This fixes a bootstrapping problem with gcc 4.9 in an x86 PE environment.
The problem was that references to weak function symbols were being
incorrectly biased by definition's offset.

	PR gas/16858
	* config/tc-i386.c (md_apply_fix): Do not adjust value of
	pc-relative fixes against weak symbols.
2014-04-28 14:37:01 +01:00
Alan Modra a9e18c6a3c Regenerate files for openrisk -> or1k change
bfd/
	* po/SRC-POTFILES.in: Regenerate.
	* configure: Regenerate.
gas/
	* po/POTFILES.in: Regenerate.
opcodes/
	* po/POTFILES.in: Regenerate.
2014-04-26 23:03:04 +09:30
Nick Clifton aaca88efb4 Fix a problem building the ARM assembler for non-ELF based toolchains.
* config/tc-arm.c (s_ltorg): Only create a mapping symbol for ELF
	based targets.
2014-04-24 11:35:51 +01:00
Will Newton 47fc6e36e3 gas/arm: Force output of a data mapping symbol for literal pools
If there is a a trailing align statement in a code section we may
output data padding with a data mapping followed by a code alignment
with a code mapping. The literal pool may then be output with a code
mapping symbol which will cause it to be endian swapped in a big-endian
configuration. When outputting a literal pool make sure that a data
mapping symbol is output in all cases.

gas/ChangeLog:

2014-04-23  Will Newton  <will.newton@linaro.org>

	* config/tc-arm.c (s_ltorg): Call make_mapping_symbol
	directly instead of mapping_state.

gas/testsuite/ChangeLog:

2014-04-23  Will Newton  <will.newton@linaro.org>

	* gas/arm/mapmisc.d: Check literal pool mapping with
	a trailing .align statement.
	* gas/arm/mapmisc.s: Likewise.
2014-04-23 13:54:59 +01:00
Andrew Bennett 7d64c587c1 Add support for the MIPS eXtended Physical Address (XPA) ASE.
ChangeLog:

binutils/
	* doc/binutils.texi: Document the disassemble MIPS XPA instructions
	command line option.

gas/
	* config/tc-mips.c (options): Add OPTION_XPA and OPTION_NO_XPA.
 	(md_longopts): Add xpa and no-xpa command line options.
 	(mips_ases): Add MIPS XPA ASE.
 	(mips_cpu_info_table): Update p5600 entry to allow the XPA ASE.
 	* doc/as.texinfo: Document the MIPS XPA command line options.
 	* doc/c-mips.texi: Document the MIPS XPA command line options,
 	and assembler directives.

gas/testsuite/
 	* gas/mips/mips.exp: Add xpa tests.
 	* gas/mips/xpa.s: New test.
 	* gas/mips/xpa.d: Likewise.

include/
 	* opcode/mips.h (ASE_XPA): New define.

opcodes/
 	* mips-dis.c (mips_arch_choices): Update mips32r2 and mips64r2
 	to allow the MIPS XPA ASE.
 	(parse_mips_dis_option): Process the -Mxpa option.
 	* mips-opc.c (XPA): New define.
 	(mips_builtin_opcodes): Add MIPS XPA instructions and move the
 	locations of the ctc0 and cfc0 instructions.
2014-04-23 13:01:18 +01:00
Sandra Loosemore 1547d98f5a Add missing ChangeLog entries for nios2 gas selftest patch. 2014-04-22 19:41:14 -07:00
Max Filippov a35d5e823f Fix alignment for the first section frag on xtensa
Linking object files produced by partial linking with link-time
relaxation enabled sometimes fails with the following error message:

dangerous relocation: call8: misaligned call target: (.text.unlikely+0x63)

This happens because no basic block with an XTENSA_PROP_ALIGN flag in the
property table is generated for the first basic block, even if the
.align directive is present.
It was believed that the first frag alignment could be derived from the
section alignment, but this was not implemented for the partial linking
case: after partial linking first frag of a section may become not
first, but no additional alignment frag is inserted before it.
Basic block for such frag may be merged with previous basic block into
extended basic block during relaxation pass losing its alignment
restrictions.

Fix this by always recording alignment for the first section frag.

2014-04-22  Max Filippov  <jcmvbkbc@gmail.com>

gas/
    * config/tc-xtensa.c (xtensa_handle_align): record alignment for the
    first section frag.

gas/testsuite/
    * gas/xtensa/all.exp: Add test for the first section frag alignment.
    * gas/xtensa/first_frag_align.d: First section frag alignment expected
    dump.
    * gas/xtensa/first_frag_align.s: First section frag alignment test
    source.
2014-04-22 22:53:49 +04:00
Christian Svensson 73589c9dbd Remove support for the (deprecated) openrisc and or32 configurations and replace
with support for the new or1k configuration.
2014-04-22 15:57:47 +01:00
Alan Modra 8e63ef2f25 Fix more fallout from TC_CONS_FIX_NEW change
* config/tc-tilegx.h (TC_CONS_FIX_NEW): Add RELOC arg.
	* config/tc-tilepro.h (TC_CONS_FIX_NEW): Likewise.
2014-04-16 23:00:29 +09:30
Denis Chertykov e4ef1b6c3f bfd/ChangeLog
* elf32-avr.c: Add DIFF relocations for AVR.
	(avr_final_link_relocate): Handle the DIFF relocs.
	(bfd_elf_avr_diff_reloc): New.
	(elf32_avr_is_diff_reloc): New.
	(elf32_avr_adjust_diff_reloc_value): Reduce difference value.
	(elf32_avr_relax_delete_bytes): Recompute difference after deleting
	bytes.

	* reloc.c: Add BFD_RELOC_AVR_DIFF8/16/32 relocations

gas/ChangeLog

	* config/tc-avr.c: Add new flag mlink-relax.
	(md_show_usage): Add flag and help text.
	(md_parse_option): Record whether link relax is turned on.
	(relaxable_section): New.
	(avr_validate_fix_sub): New.
	(avr_force_relocation): New.
	(md_apply_fix): Generate DIFF reloc.
	(avr_allow_local_subtract): New.

	* config/tc-avr.h (TC_LINKRELAX_FIXUP): Define to 0.
	(TC_FORCE_RELOCATION): Define.
	(TC_FORCE_RELOCATION_SUB_SAME): Define.
	(TC_VALIDATE_FIX_SUB): Define.
	(avr_force_relocation): Declare.
	(avr_validate_fix_sub): Declare.
	(md_allow_local_subtract): Define.
	(avr_allow_local_subtract): Declare.

gas/testsuite/ChangeLog

	* gas/avr/diffreloc_withrelax.d: New testcase.
	* gas/avr/noreloc_withoutrelax.d: Likewise.
	* gas/avr/relax.s: Likewise.

include/ChangeLog

	* elf/avr.h: Add new DIFF relocs.

ld/testsuite/ChangeLog

	* ld-avr/norelax_diff.d: New testcase.
	* ld-avr/relax_diff.d: Likewise.
	* ld-avr/relax.s: Likewise.
2014-04-10 19:50:33 +04:00
Andrew Bennett bbaa46c0f3 Add support for the MIPS P5600 family of CPUs.
ChangeLog:

2014-04-10  Andrew Bennett  <andrew.bennett@imgtec.com>

	* config/tc-mips.c (mips_cpu_info_table): Add P5600
	configuation.
	* doc/c-mips.texi: Document p5600.
2014-04-10 10:20:50 +01:00
Nick Clifton 00c06fdc57 Fix a few more targets affected by the change to the TC_CONS_FIX_NEW macro.
* config/tc-rl78.h (TC_CONS_FIX_NEW): Add RELOC parameter.
	* config/tc-z80.h (TC_CONS_FIX_NEW): Discard RELOC parameter.
	* config/tc-aarch64.h (TC_CONS_FIX_NEW): Discard RELOC parameter.
	* read.c (emit_expr_fix): Mark the r parameter as potentially
	unused.
2014-04-09 14:05:58 +01:00
Alan Modra bf7279d535 ppc476 gas warn on data in code sections
* config/tc-ppc.c (warn_476, last_insn, last_seg, last_subseg):
	New static vars.
	(md_longopts, md_parse_option, md_show_usage): Add --ppc476-workaround.
	(ppc_elf_cons_fix_check): New function.
	(md_assemble): Set last_insn, last_seg, last_subseg.
	(ppc_byte, md_apply_fix): Handle warn_476.
	* config/tc-ppc.h (TC_CONS_FIX_CHECK): Define.
	(ppc_elf_cons_fix_check): Declare.
	* read.c (cons_worker): Invoke TC_CONS_FIX_CHECK.
2014-04-09 14:30:38 +09:30
Alan Modra 62ebcb5cbe gas TC_PARSE_CONS_EXPRESSION communication with TC_CONS_FIX_NEW
A number of targets pass extra information from TC_PARSE_CONS_EXPRESSION
to TC_CONS_FIX_NEW via static variables.  That's OK, but not best
practice.  tc-ppc.c goes further in implementing its own replacement
for cons(), because the generic one doesn't allow relocation modifiers
on constants.  This patch fixes both of these warts.

	* gas/config/tc-alpha.h (TC_CONS_FIX_NEW): Add RELOC parameter.
	* gas/config/tc-arc.c (arc_cons_fix_new): Add reloc parameter.
	* gas/config/tc-arc.h (arc_cons_fix_new): Update prototype.
	(TC_CONS_FIX_NEW): Add RELOC parameter.
	* gas/config/tc-arm.c (cons_fix_new_arm): Similarly
	* gas/config/tc-arm.h (cons_fix_new_arm, TC_CONS_FIX_NEW): Similarly.
	* gas/config/tc-cr16.c (cr16_cons_fix_new): Similarly.
	* gas/config/tc-cr16.h (cr16_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
	* gas/config/tc-crx.h (TC_CONS_FIX_NEW): Similarly.
	* gas/config/tc-m32c.c (m32c_cons_fix_new): Similarly.
	* gas/config/tc-m32c.h (m32c_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
	* gas/config/tc-mn10300.c (mn10300_cons_fix_new): Similarly.
	* gas/config/tc-mn10300.h (mn10300_cons_fix_new, TC_CONS_FIX_NEW):
	Similarly.
	* gas/config/tc-ns32k.c (cons_fix_new_ns32k): Similarly.
	* gas/config/tc-ns32k.h (cons_fix_new_ns32k): Similarly.
	* gas/config/tc-pj.c (pj_cons_fix_new_pj): Similarly.
	* gas/config/tc-pj.h (pj_cons_fix_new_pj, TC_CONS_FIX_NEW): Similarly.
	* gas/config/tc-rx.c (rx_cons_fix_new): Similarly.
	* gas/config/tc-rx.h (rx_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
	* gas/config/tc-sh.c (sh_cons_fix_new): Similarly.
	* gas/config/tc-sh.h (sh_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
	* gas/config/tc-tic54x.c (tic54x_cons_fix_new): Similarly.
	* gas/config/tc-tic54x.h (tic54x_cons_fix_new, TC_CONS_FIX_NEW):
	Similarly.
	* gas/config/tc-tic6x.c (tic6x_cons_fix_new): Similarly.
	* gas/config/tc-tic6x.h (tic6x_cons_fix_new, TC_CONS_FIX_NEW):
	Similarly.
	* gas/config/tc-arc.c (arc_parse_cons_expression): Return reloc.
	* gas/config/tc-arc.h (arc_parse_cons_expression): Update proto.
	* gas/config/tc-avr.c (exp_mod_data): Make global.
	(pexp_mod_data): Delete.
	(avr_parse_cons_expression): Return exp_mod_data pointer.
	(avr_cons_fix_new): Add exp_mod_data_t pointer param.
	(exp_mod_data_t): Move typedef..
	* gas/config/tc-avr.h: ..to here.
	(exp_mod_data): Declare.
	(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
	(avr_parse_cons_expression, avr_cons_fix_new): Update prototype.
	(TC_CONS_FIX_NEW): Update.
	* gas/config/tc-hppa.c (hppa_field_selector): Delete static var.
	(cons_fix_new_hppa): Add hppa_field_selector param.
	(fix_new_hppa): Adjust.
	(parse_cons_expression_hppa): Return field selector.
	* gas/config/tc-hppa.h (parse_cons_expression_hppa): Update proto.
	(cons_fix_new_hppa): Likewise.
	(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
	* gas/config/tc-i386.c (got_reloc): Delete static var.
	(x86_cons_fix_new): Add reloc param.
	(x86_cons): Return got reloc.
	* gas/config/tc-i386.h (x86_cons, x86_cons_fix_new): Update proto.
	(TC_CONS_FIX_NEW): Add RELOC param.
	* gas/config/tc-ia64.c (ia64_cons_fix_new): Add reloc param.  Adjust
	calls.
	* gas/config/tc-ia64.h (ia64_cons_fix_new): Update prototype.
	(TC_CONS_FIX_NEW): Add reloc param.
	* gas/config/tc-microblaze.c (parse_cons_expression_microblaze):
	Return reloc.
	(cons_fix_new_microblaze): Add reloc param.
	* gas/config/tc-microblaze.h: Formatting.
	(parse_cons_expression_microblaze): Update proto.
	(cons_fix_new_microblaze): Likewise.
	* gas/config/tc-nios2.c (nios2_tls_ldo_reloc): Delete static var.
	(nios2_cons): Return ldo reloc.
	(nios2_cons_fix_new): Delete.
	* gas/config/tc-nios2.h (nios2_cons): Update prototype.
	(nios2_cons_fix_new, TC_CONS_FIX_NEW): Delete.
	* gas/config/tc-ppc.c (md_pseudo_table): Remove quad, long, word,
	short.  Make llong use cons.
	(ppc_elf_suffix): Return BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
	(ppc_elf_cons): Delete.
	(ppc_elf_parse_cons): New function.
	(ppc_elf_validate_fix): Don't check for BFD_RELOC_UNUSED.
	(md_assemble): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
	* gas/config/tc-ppc.h (TC_PARSE_CONS_EXPRESSION): Define
	(ppc_elf_parse_cons): Declare.
	* gas/config/tc-sparc.c (sparc_cons_special_reloc): Delete static var.
	(sparc_cons): Return reloc specifier.
	(cons_fix_new_sparc): Add reloc specifier param.
	(sparc_cfi_emit_pcrel_expr): Use emit_expr_with_reloc.
	* gas/config/tc-sparc.h (TC_PARSE_CONS_RETURN_TYPE): Define.
	(TC_PARSE_CONS_RETURN_NONE): Define.
	(sparc_cons, cons_fix_new_sparc): Update prototype.
	* gas/config/tc-v850.c (hold_cons_reloc): Delete static var.
	(v850_reloc_prefix): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
	(md_assemble): Likewise.
	(parse_cons_expression_v850): Return reloc.
	(cons_fix_new_v850): Add reloc parameter.
	* gas/config/tc-v850.h (parse_cons_expression_v850): Update proto.
	(cons_fix_new_v850): Likewise.
	* gas/config/tc-vax.c (vax_cons_special_reloc): Delete static var.
	(vax_cons): Return reloc.
	(vax_cons_fix_new): Add reloc parameter.
	* gas/config/tc-vax.h (vax_cons, vax_cons_fix_new): Update proto.
	* gas/config/tc-xstormy16.c (xstormy16_cons_fix_new): Add reloc param.
	* gas/config/tc-xstormy16.h (xstormy16_cons_fix_new): Update proto.
	* gas/dwarf2dbg.c (TC_PARSE_CONS_RETURN_NONE): Provide default.
	(emit_fixed_inc_line_addr): Adjust exmit_expr_fix calls.
	* gas/read.c (TC_PARSE_CONS_EXPRESSION): Return value.
	(do_parse_cons_expression): Adjust.
	(cons_worker): Pass return value from TC_PARSE_CONS_EXPRESSION
	to emit_expr_with_reloc.
	(emit_expr_with_reloc): New function handling reloc, mostly
	extracted from..
	(emit_expr): ..here.
	(emit_expr_fix): Add reloc param.  Adjust TC_CONS_FIX_NEW invocation.
	Handle reloc.
	(parse_mri_cons): Convert to ISO.
	* gas/read.h (TC_PARSE_CONS_RETURN_TYPE): Define.
	(TC_PARSE_CONS_RETURN_NONE): Define.
	(emit_expr_with_reloc): Declare.
	(emit_expr_fix): Update prototype.
	* gas/write.c (write_object_file): Update TC_CONS_FIX_NEW invocation.
2014-04-09 14:29:05 +09:30
Ilya Tocar 2cf200a4c8 Add support for Intel SGX instructions
Add Intel SGX instructions support to assembler and disassembler.

gas/

	* config/tc-i386.c (cpu_arch): Add .se1.
	* doc/c-i386.texi: Document .se1/se1.

gas/testsuite/

	* gas/i386/i386.exp: Run SE1 tests.
	* gas/i386/se1.d: New file.
	* gas/i386/se1.s: Ditto.
	* gas/i386/x86-64-se1.d: Ditto.
	* gas/i386/x86-64-se1.s: Ditto.

opcodes/

	* i386-dis.c (rm_table): Add encls, enclu.
	* i386-gen.c (cpu_flag_init): Add CPU_SE1_FLAGS,
	(cpu_flags): Add CpuSE1.
	* i386-opc.h (enum): Add CpuSE1.
	(i386_cpu_flags): Add cpuse1.
	* i386-opc.tbl: Add encls, enclu.
	* i386-init.h: Regenerated.
	* i386-tbl.h: Likewise.
2014-04-04 08:24:47 -07:00
DJ Delorie 0a899fd5ac Add checks for overfar branches
Check 8 and 16 bit PCREL fixes for overflow, since we bypass the
later overflow checks in write.c.  Direct relocs are left alone,
as gcc has been known to take advantage of the silent overflows
when comparing addresses to constant ranges.
2014-04-02 16:50:29 -04:00
Nick Clifton cad0da33dc This fixes an internal error in GAS, triggered by the test case reported in PR 16765.
The problem was that gcc was generating assembler with missing unwind directives in it,
so that a gas_assert was being triggered.  The patch replaces the assert with an error
message.

	* config/tc-arm.c (create_unwind_entry): Report an error if an
	attempt to recreate an unwind directive is encountered.
2014-04-02 16:29:35 +01:00
Denis Chertykov ed0251d24b * gas/ChangeLog: Revert
* gas/config/tc-avr.c: Revert
	* gas/doc/c-avr.texi: Revert
	* gas/testsuite/ChangeLog: Revert
	* gas/testsuite/gas/avr/avr.exp: Revert
	* gas/testsuite/gas/avr/rmw.d: Revert
	* gas/testsuite/gas/avr/rmw.s: Revert

	This reverts commit d24e46e3e2.
2014-03-29 09:46:33 +04:00
Denis Chertykov d24e46e3e2 * config/tc-avr.c: Add specified_mcu variable for selected mcu.
(enum options): add OPTION_RMW_ISA for -mrmw option.
	(struct option md_longopts): Add mrmw option.
	(md_show_usage): add -mrmw option description.
	(md_parse_option): Update isa details if -mrmw option specified.
	* doc/c-avr.texi: Add doc for new option -mrmw.
	* gas/avr/avr.exp: Run new tests.
	* gas/avr/rmw.d: Add test for additional ISA support.
	* gas/avr/rmw.s: Ditto.
2014-03-29 09:41:32 +04:00
Nick Clifton cb580a265c This fixes a compile time error triggered by -Werror=format-security because
a call to sprintf was being made with a non-constant formatting string.

	* config/tc-score.c (s3_parse_pce_inst): Add "%s" parameter to
	sprintf in order to avoid a compile time warning.
2014-03-27 09:41:06 +00:00
Nick Clifton b3fe4307a6 Add support for %hi8, %hi16 and %lo16 being used when relocation are necessary.
* config/tc-rl78.c (rl78_op): Issue an error message if a 16-bit
	relocation is used on an 8-bit operand or vice versa.
	(tc_gen_reloc): Use the RL78_16U relocation for RL78_CODE.
	(md_apply_fix): Add support for RL78_HI8, RL78_HI16 and RL78_LO16.
2014-03-26 16:34:04 +00:00
Nick Clifton 3c6256d29e This patch adds a new pseudo-op - .seh_code - to structured exception handling
suite of ops.  It changes the current section back to the code section of the
current function.  This is helpful because the code section may not be .text.

	* config/obj-coff-seh.c (obj_coff_seh_code): New function -
	switches the current segment back to the code segment recorded
	when seh_proc was last invoked.
	* config/obj-coff-seh.h (SEH_CMDS): Add seh_code.
2014-03-25 16:50:10 +00:00
Alan Modra 3e60bf4df8 Revert "Remove magic treatment of toc symbols for powerpc ELF"
It turns out that glibc's sysdeps/powerpc/powerpc64/start.S uses this
feature.  :-(

	* config/tc-ppc.c (ppc_is_toc_sym): Revert 2014-03-05.
	(md_assemble): Likewise.  Warn.
2014-03-25 12:01:09 +10:30
David Weatherford a82c7d9030 Add support to the Xtensa target for creating trampolines for out-of-range branches.
* tc-xtensa.c (xtensa_check_frag_count, xtensa_create_trampoline_frag)
    (xtensa_maybe_create_trampoline_frag, init_trampoline_frag)
    (find_trampoline_seg, search_trampolines, get_best_trampoline)
    (check_and_update_trampolines, add_jump_to_trampoline)
    (dump_trampolines): New function.
    (md_parse_option): Add cases for --[no-]trampolines options.
    (md_assemble, finish_vinsn, xtensa_end): Add call to
    xtensa_check_frag_count.
    (xg_assemble_vliw_tokens): Add call to
    xtensa_maybe_create_trampoline_frag.
    (xtensa_relax_frag): Relax fragments with RELAX_TRAMPOLINE state.
    (relax_frag_immed): Relax jump instructions that cannot reach its
    target.
    * tc-xtensa.h (xtensa_relax_statesE::RELAX_TRAMPOLINE): New relax
    state.

    * as.texinfo: Document --[no-]trampolines command-line options.
    * c-xtensa.texi: Document trampolines relaxation and command line
    options.

    * frags.c (get_frag_count, clear_frag_count): New function.
    (frag_alloc): Increment totalfrags counter.
    * frags.h (get_frag_count, clear_frag_count): New function.

    * all.exp: Add test for trampoline relaxation.
    * trampoline.d: Trampoline relaxation expected dump.
    * trampoline.s: Trampoline relaxation test source.
2014-03-21 11:53:42 +00:00
DJ Delorie 0c315784bf Add opcode relaxation for rl78-elf
This patch adds initial in-gas opcode relaxation for the rl78
backend.  Specifically, it checks for conditional branches that
are too far and replaces them with inverted branches around longer
fixed branches.
2014-03-20 17:56:01 -04:00
Richard Sandiford d56a8dda6d gas/
* config/tc-mips.h (DIFF_EXPR_OK, CFI_DIFF_EXPR_OK): Define.
	* config/tc-mips.c (md_pcrel_from): Remove error message.
	(md_apply_fix): Convert PC-relative BFD_RELOC_32s to
	BFD_RELOC_32_PCREL.  Report a specific error message for unhandled
	PC-relative expressions.  Handle BFD_RELOC_8.

gas/testsuite/
	* gas/all/gas.exp: Remove XFAIL of forward.d for MIPS.
	* gas/mips/pcrel-1.s, gas/mips/pcrel-1.d, gas/mips/pcrel-2.s,
	gas/mips/pcrel-2.d, gas/mips/pcrel-3.s, gas/mips/pcrel-3.l,
	gas/mips/pcrel-4.s, gas/mips/pcrel-4-32.d, gas/mips/pcrel-4-n32.d,
	gas/mips/pcrel-4-64.d: New tests.
	* gas/mips/mips.exp: Run them.
	* gas/mips/lui-2.l: Tweak error message for line 7.

ld/testsuite/
	* ld-elf/merge.d: Remove MIPS XFAIL.
2014-03-20 21:18:43 +00:00
Jose E. Marchesi ec92c392f7 This patch adds support for the hyperprivileged registers %hstick_offset
and %hstick_enable to the Sparc assembler.

	* config/tc-sparc.c (hpriv_reg_table): Added entries for
	%hstick_offset and %hstick_enable.
	* doc/c-sparc.texi (Sparc-Regs): Document the %hstick_offset and
	%hstick_enable hyperprivileged registers.

	* sparc-dis.c (v9_hpriv_reg_names): Names for %hstick_offset and
	%hstick_enable added.

	* gas/sparc/rdhpr.s: Test rd %hstick_offset and %hstick_enable.
	* gas/sparc/rdhpr.d: Likewise.

	* gas/sparc/wrhpr.s: Test wr %hstick_offset and %hstick_enable.
	* gas/sparc/wrhpr.d: Likewise.
2014-03-19 16:43:41 +00:00
Nick Clifton 288c6b306e Remove spurious character. 2014-03-19 14:43:00 +00:00
Daniel Gutson 2e6976a881 Add support for ARM assembler produced by CodeCompositor Studio.
* config/tc-arm.c (codecomposer_syntax): New flag that states whether the
	CCS syntax compatibility mode is on or off.
	(asmfunc_states): New enum to represent the asmfunc directive state.
	(asmfunc_state): New variable holding the asmfunc directive state.
	(comment_chars): Rename to arm_comment_chars.
	(line_separator_chars): Rename to arm_line_separator_chars.
	(s_ccs_ref): New function that handles the .ref directive.
	(asmfunc_debug): New function.
	(s_ccs_asmfunc): New function that handles the .asmfunc directive.
	(s_ccs_endasmfunc): New function that handles the .endasmfunc directive.
	(s_ccs_def): New function that handles the .def directive.
	(tc_start_label_without_colon): New function.
	(md_pseudo_table): Added new CCS directives.
	(arm_ccs_mode): New function that handles the -mccs command line option.
	(arm_long_opts): Added new -mccs command line option.
	* config/tc-arm.h (LABELS_WITHOUT_COLONS): New macro.
	(TC_START_LABEL_WITHOUT_COLON): New macro.
	(tc_start_label_without_colon): Added extern function declaration.
	(tc_comment_chars): Define.
	(tc_line_separator_chars): Define.
	* app.c (do_scrub_begin): Use tc_line_separator_chars, if defined.
	* read.c (read_begin): Likewise.
	* doc/as.texinfo: Add documentation for the -mccs command line
	option.
	* doc/c-arm.texi: Likewise.
	* doc/internals.texi: Document tc_line_separator_chars.
	* NEWS: Mention the new feature.

	* gas/arm/ccs.s: New test case.
	* gas/arm/ccs.d: New expected disassembly.
2014-03-19 14:31:25 +00:00
Yufeng Zhang a52e6fd34a Enable verbose error messages by default for AArch64 gas.
gas/

	* config/tc-aarch64.c (aarch64_opts): Add new option
	"mno-verbose-error".
	(verbose_error_p): Initialize to 1.
	* doc/c-aarch64.texi (AArch64 Options): Document -mverbose-error
	and -mno-verbose-error.

gas/testsuite/

	* gas/aarch64/illegal.d: Pass -mno-verbose-error.
	* gas/aarch64/verbose-error.s: Add more verbose message testcases.
	* gas/aarch64/verbose-error.l: Ditto.
2014-03-18 17:41:43 +00:00
Nick Clifton 1f5afe1cc0 Add support for parsing VFP register names in .cfi_offset directives.
PR gas/16694
	* config/tc-arm.c (tc_arm_regname_to_dw2regnum): Parse VFP
	registers as well.

	* gas/cfi/cfi-arm-1.s: Add checks of VFP registers.
	* gas/cfi/cfi-arm-1.d: Update expected output.
2014-03-17 16:30:30 +00:00
Richard Earnshaw df359aa7ab AArch64: Clean up docs and document -mcpu and -march.
2014-03-13  Richard Earnshaw  <rearnsha@arm.com>
	    Jiong Wang  <Jiong.Wang@arm.com>

	* doc/c-aarch64.texi: Clean up some formatting issues.
	(AArch64 Options): Document -mcpu and -march.
	(AArch64 Extensions): New node.
2014-03-13 17:10:04 +00:00
Tristan Gingold 167ad85bf0 Add pe/x86_64 bigobj file format.
bfd/
	* peicode.h (pe_ILF_object_p): Adjust, as the version number
	has been read.
	(pe_bfd_object_p): Also read version number to detect ILF.
	* pe-x86_64.c (COFF_WITH_PE_BIGOBJ): Define.
	(x86_64pe_bigobj_vec): Define
	* coffcode.h (bfd_coff_backend_data): Add _bfd_coff_max_nscns field.
	(bfd_coff_max_nscns): New macro.
	(coff_compute_section_file_positions): Use unsigned int for
	target_index.  Compare with bfd_coff_max_nscns.
	(bfd_coff_std_swap_table, ticoff0_swap_table, ticoff1_swap_table):
	Set a value for _bfd_coff_max_nscns.
	(header_bigobj_classid): New constant.
	(coff_bigobj_swap_filehdr_in, coff_bigobj_swap_filehdr_out)
	(coff_bigobj_swap_sym_in, coff_bigobj_swap_sym_out)
	(coff_bigobj_swap_aux_in, coff_bigobj_swap_aux_out): New
	functions.
	(bigobj_swap_table): New table.
	* libcoff.h: Regenerate.
	* coff-sh.c (bfd_coff_small_swap_table): Likewise.
	* coff-alpha.c (alpha_ecoff_backend_data): Add value for
	_bfd_coff_max_nscns.
	* coff-mips.c (mips_ecoff_backend_data): Likewise.
	* coff-rs6000.c (bfd_xcoff_backend_data)
	(bfd_pmac_xcoff_backend_data): Likewise.
	* coff64-rs6000.c (bfd_xcoff_backend_data)
	(bfd_xcoff_aix5_backend_data): Likewise.
	* targets.c (x86_64pe_bigobj_vec): Declare.
	* configure.in (x86_64pe_bigobj_vec): New vector.
	* configure: Regenerate.
	* config.bfd: Add bigobj object format for Windows targets.

gas/
	* config/tc-i386.c (use_big_obj): Declare.
	(OPTION_MBIG_OBJ): Define.
	(md_longopts): Add -mbig-obj option.
	(md_parse_option): Handle it.
	(md_show_usage): Display help for this option.
	(i386_target_format): Use bigobj for x86-64 if -mbig-obj.
	* doc/c-i386.texi: Document the option.

gas/testsuite/
	* gas/pe/big-obj.d, gas/pe/big-obj.s: Add test.
	* gas/pe/pe.exp: Add test.

include/coff/
	* pe.h (struct external_ANON_OBJECT_HEADER_BIGOBJ): Declare.
	(FILHSZ_BIGOBJ): Define.
	(struct external_SYMBOL_EX): Declare.
	(SYMENT_BIGOBJ, SYMESZ_BIGOBJ): Define.
	(union external_AUX_SYMBOL_EX): Declare.
	(AUXENT_BIGOBJ, AUXESZ_BIGOBJ): Define.
	* internal.h (struct internal_filehdr): Change type
	of f_nscns.
2014-03-13 09:33:07 +01:00
Nick Clifton 55d9b4c146 The value of a bignum expression is held in a single global array. This means
that if multiple bignum values are encountered only the most recent is valid.
If such expressions are cached, eg to be emitted into a literal pool later on
in the assembly, then only one expression - the last - will be correct.  This
patch fixes the problem for the AArch64 target by caching each bignum value
locally.

	PR gas/16688
	* config/tc-aarch64.c (literal_expression): New structure.
	(literal_pool): Replace exp array with literal_expression array.
	(add_to_lit_pool): When adding a bignum cache the big value.
	(s_ltorg): When emitting a bignum initialise the global bignum
	array from the cached value.

	* gas/aarch64/litpool.s: New test case.
	* gas/aarch64/litpool.d: Expected disassembly.
2014-03-12 15:50:49 +00:00
Alan Modra fa47fa9246 autoreconf
Regenerate Makefile.in in bfd, binutils, gas, gold, gprof, ld, opcodes.
Regenerate gas/config.in.
2014-03-12 15:02:00 +10:30
Denis Chertykov 255d9eec05 * gas/tc-avr.c: Add new devices
avr25: ata5272, attiny828
	avr35: ata5505, attiny1634
	avr4: atmega8a, ata6285, ata6286, atmega48pa
	avr5: at90pwm161, ata5790, ata5795, atmega164pa, atmega165pa,
	atmega168pa, atmega32a, atmega64rfr2, atmega644rfr2, atmega64a,
	atmega16hva2
	avr51: atmega128a, atmega1284
	avrxmega2: atxmega16a4u, atxmega16c4, atxmega32a4u, atxmega32c4,
	atxmega32e5, atxmega16e5, atxmega8e5
	avrxmega4: atxmega64a3u, atxmega64a4u, atxmega64b1, atxmega64b3,
	atxmega64c3, atxmega64d4
	avrxmega6: atxmega128a3u, atxmega128b3, atxmega128c3,
	atxmega128d4, atxmega192a3u, atxmega192c3, atxmega256a3u,
	atxmega256c3, atxmega384c3, atxmega384d3
	avrxmega7: atxmega128a4u
	* doc/c-avr.texi: Ditto.
2014-03-06 18:59:05 +04:00
Alan Modra 4b95cf5c0c Update copyright years 2014-03-05 22:16:15 +10:30
Alan Modra 45965137be Support R_PPC64_ADDR64_LOCAL
This adds support for "func@localentry", an expression that returns the
ELFv2 local entry point address of function "func".  I've excluded
dynamic relocation support because that obviously would require glibc
changes.

include/elf/
	* ppc64.h (R_PPC64_REL24_NOTOC, R_PPC64_ADDR64_LOCAL): Define.
bfd/
	* elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_ADDR64_LOCAL entry.
	(ppc64_elf_reloc_type_lookup): Support R_PPC64_ADDR64_LOCAL.
	(ppc64_elf_check_relocs): Likewise.
	(ppc64_elf_relocate_section): Likewise.
	* Add BFD_RELOC_PPC64_ADDR64_LOCAL.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.
gas/
	* config/tc-ppc.c (ppc_elf_suffix): Support @localentry.
	(md_apply_fix): Support R_PPC64_ADDR64_LOCAL.
ld/testsuite/
	* ld-powerpc/elfv2-2a.s, ld-powerpc/elfv2-2b.s: New files.
	* ld-powerpc/elfv2-2exe.d, ld-powerpc/elfv2-2so.d: New files.
	* ld-powerpc/powerpc.exp: Run new test.
elfcpp/
	* powerpc.h (R_PPC64_REL24_NOTOC, R_PPC64_ADDR64_LOCAL): Define.
gold/
	* powerpc.cc (Target_powerpc::Scan::local, global): Support
	R_PPC64_ADDR64_LOCAL.
	(Target_powerpc::Relocate::relocate): Likewise.
2014-03-05 19:57:39 +10:30
Alan Modra a0593ad956 Support more relocs on 16-bit insn fields
This patch allows gas to assemble a testcase like
	li 3,ext_sym
which oddly was not accepted while the following is OK:
	li 3,ext_sym@l

	* config/tc-ppc.c (md_assemble): Move code adjusting reloc types
	later.  Merge absolute and relative branch reloc selection.
	Generate 16-bit relocs for most 16-bit insn fields given a
	non-constant expression.
2014-03-05 19:31:45 +10:30
Alan Modra f50c47f118 Remove magic treatment of toc symbols for powerpc ELF
The XCOFF assembler does some wierd things with instructions like
`lwz 9,sym(30'.  See the comment in md_apply_fix.  From an ELF
perspective, it's weird even to magically select a TOC16 reloc
when a symbol is in the TOC/GOT.  ELF assemblers generally use
modifiers like @toc to select relocs, so remove this "feature"
for ELF.  I believe this was to support gcc -m32 -mcall-aixdesc
but that combination of gcc options has been broken for a long
time.

	* config/tc-ppc.c (ppc_is_toc_sym): Remove OBJ_ELF support.
	(md_assemble): Don't call ppc_is_toc_sym for ELF.
2014-03-05 19:27:57 +10:30
Richard Sandiford cd0c81e90f Fix changelog formatting in last commit -- sorry 2014-03-04 21:30:39 +00:00
Richard Sandiford 4ba154f579 bfd/
2014-02-04  Heiher <r@hev.cc>

	* elfxx-mips.c (mips_set_isa_flags): Use E_MIPS_ARCH_64R2 for
	Loongson-3A.
	(mips_mach_extensions): Make bfd_mach_mips_loongson_3a an
	extension of bfd_mach_mipsisa64r2.

opcodes/
2014-02-04  Heiher <r@hev.cc>

	* mips-dis.c (mips_arch_choices): Usee ISA_MIPS64R2 for Loongson-3A.

gas/
2014-02-04  Heiher <r@hev.cc>

	* config/tc-mips.c (mips_cpu_info_table): Use ISA_MIPS64R2 for
	Loongson-3A.
2014-03-04 21:18:02 +00:00
Nick Clifton 65d7bab591 This patch enhances the MSP430 port of GAS so that, if requested, it will
generate warning messages about an instruction that changes the interrupt
state not being followed by a NOP instruction.

	* config/msp430/msp430.c: Replace known mcu array with known
	msp430 ISA mcu name array.
	Accept any name for -mmcu option.
	Add -mz option to warn about missing NOP following an interrupt
	status change.
	(check_for_nop): New.
	(msp430_operands): Emit a warning, if requested, when an interrupt
	changing instruction is not followed by a NOP.
	* doc/c-msp430.c: Document -mz option.

	* gas/msp430/bad.d: Add -mz option.
	* gas/msp430/bad.s: Add more cases where warnings should be
	generated.
	* gas/msp430/bad.l: Add expected warning messages.
2014-03-03 17:27:55 +00:00
Alan Modra c1a3e85c37 More copyright fixes
* config/obj-fdpicelf.c: Correct copyright date.
	* config/obj-fdpicelf.h: Likewise.
2014-03-03 14:06:56 +10:30
Alan Modra 2c80b75360 Fix various copyright issues
binutils/
	* README: Add "Copyright Notices" paragraph.
gas/
	* config/bfin-lex-wrapper.c: Correct copyright date.
	* config/tc-frv.c: Correct copyright punctuation.
	* config/tc-ip2k.c: Likewise.
	* config/tc-iq2000.c: Likewise.
	* config/tc-mep.c: Likewise.
	* config/tc-tic4x.c: Likewise.
	* config/tc-tic4x.h: Likewise.
ld/testsuite/
	* ld-scripts/phdrs2.exp: Correct copyright punctuation.
	* ld-v850/v850.exp: Correct copyright typo.
opcodes/
	* i386-gen.c (process_copyright): Emit copyright notice on one line.
gold/
	* dwp.cc (print_version): Update copyright year to current.
2014-03-03 11:03:08 +10:30
Denis Chertykov 83046454b5 * config/tc-avr.c: Remove atxmega16x1. 2014-03-01 13:12:49 +04:00
Alan Modra 02fe846e43 Incorrect .debug_line prologue header length for 64-bit DWARF
Don't be clever, calculate the length directly as the difference of
two symbols.

	* dwarf2dbg.c (out_debug_line): Correct .debug_line header_length
	field for 64-bit dwarf.
2014-02-28 15:09:32 +10:30
Ilya Tocar dcf893b581 Add support for CPUID PREFETCHWT1
Latest AVX512 spec
http://download-software.intel.com/sites/default/files/managed/50/1a/319433-018.pdf
Has CPUID PREFETCHWT1 for prefetchwt1 instruction, which we list as AVX512PF.
This patch introduces CPUID PREFETCHWT1.

gas/

        * config/tc-i386.c (cpu_arch): Add .prefetchwt1.
        * doc/c-i386.texi: Document .prefetchwt1/prefetchwt1.

opcodes/

        * i386-gen.c (cpu_flag_init): Add CPU_PREFETCHWT1_FLAGS/
        (cpu_flags): Add CpuPREFETCHWT1.
        * i386-init.h: Regenerate.
        * i386-opc.h (CpuPREFETCHWT1): New.
        (i386_cpu_flags): Add cpuprefetchwt1.
        * i386-opc.tbl: Cahnge CPU of prefetchwt1 from CpuAVX512PF to CpuPREFETCHWT1.
        * i386-tbl.h: Regenerate.

gas/testsuite

        * gas/i386/avx512pf-intel.d: Remove prefetchwt1.
        * gas/i386/avx512pf.s: Ditto.
        * gas/i386/avx512pf.d: Ditto.
        * gas/i386/x86-64-avx512pf-intel.d: Ditto.
        * gas/i386/x86-64-avx512pf.s: Ditto.
        * gas/i386/x86-64-avx512pf.d: Ditto.
        * gas/i386/prefetchwt1-intel.d: New file.
        * gas/i386/prefetchwt1.s: Ditto.
        * gas/i386/prefetchwt1.d: Ditto.
        * gas/i386/x86-64-prefetchwt1-intel.d: Ditto.
        * gas/i386/x86-64-prefetchwt1.s: Ditto.
        * gas/i386/x86-64-prefetchwt1.d: Ditto.
2014-02-21 08:04:00 -08:00
Ilya Tocar 963f35869d Add clflushopt, xsaves, xsavec, xrstors
gas/

2014-02-12  Ilya Tocar  <ilya.tocar@intel.com>

	* config/tc-i386.c (cpu_arch): Add .clflushopt, .xsavec, .xsaves.
	* doc/c-i386.texi: Document .xsavec/xsavec/.xsaves/xsaves/
	clflushopt/.clfushopt.

gas/testsuite/

2014-02-12  Ilya Tocar  <ilya.tocar@intel.com>

	* gas/i386/clflushopt-intel.d: New.
	* gas/i386/clflushopt.d: Ditto.
	* gas/i386/clflushopt.s: Ditto.
	* gas/i386/i386.exp: Run new tests.
	* gas/i386/x86-64-clflushopt-intel.d: New.
	* gas/i386/x86-64-clflushopt.d: Ditto.
	* gas/i386/x86-64-clflushopt.s: Ditto.
	* gas/i386/x86-64-xsavec-intel.d: Ditto.
	* gas/i386/x86-64-xsavec.d: Ditto.
	* gas/i386/x86-64-xsavec.s: Ditto.
	* gas/i386/x86-64-xsaves-intel.d: Ditto.
	* gas/i386/x86-64-xsaves.d: Ditto.
	* gas/i386/x86-64-xsaves.s: Ditto.
	* gas/i386/xsavec-intel.d: Ditto.
	* gas/i386/xsavec.d: Ditto.
	* gas/i386/xsavec.s: Ditto.
	* gas/i386/xsaves-intel.d: Ditto.
	* gas/i386/xsaves.d: Ditto.
	* gas/i386/xsaves.s: Ditto.

opcodes/

2014-02-12  Ilya Tocar  <ilya.tocar@intel.com>

	* i386-dis.c (MOD enum): Add MOD_0FC7_REG_3, MOD_0FC7_REG_4,
	MOD_0FC7_REG_5.
	(PREFIX enum): Add PREFIX_0FAE_REG_7.
	(reg_table): Add MOD_0FC7_REG_3, MOD_0FC7_REG_4 MOD_0FC7_REG_5.
	(prefix_table): Add clflusopt.
	(mod_table): Add xrstors, xsavec, xsaves.
	* i386-gen.c (cpu_flag_init): Add CPU_CLFLUSHOPT_FLAGS,
	CPU_XSAVES_FLAGS, CPU_XSAVEC_FLAGS.
	(cpu_flags): Add CpuClflushOpt, CpuXSAVES, CpuXSAVEC.
	* i386-init.h: Regenerate.
	* i386-opc.tbl: Add clflushopt, xrstors, xrstors64, xsaves,
	xsaves64, xsavec, xsavec64.
	* i386-tbl.h: Regenerate.
2014-02-12 07:50:24 -08:00
Alan Modra c1c69e839e binutils potfiles regen
Adds nds32 files to POTFILES.in
2014-02-10 09:59:35 +10:30
Sandra Loosemore 1c2de46353 Nios II large-GOT relocations
2014-02-03  Sandra Loosemore  <sandra@codesourcery.com>

	include/elf/
	* nios2.h (R_NIOS2_GOT_LO, R_NIOS2_GOT_HA): New.
	(R_NIOS2_CALL_LO, R_NIOS2_CALL_HA): New.
	(R_NIOS2_ILLEGAL): Adjust.

	gas/
	* config/tc-nios2.c (md_apply_fix): Test for new relocs.
	(nios2_special_reloc): Add %call_lo, %call_hiadj, %got_lo,
	%got_hiadj relocation operators.  Sort table and add comment
	to explain ordering.
	(nios2_fix_adjustable): Test for new relocs.
	* doc/c-nios2.texi (Nios II Relocations): Document new relocation
	operators.

	bfd/
	* reloc.c (BFD_RELOC_NIOS2_GOT_LO, BFD_RELOC_NIOS2_GOT_HA): New.
	(BFD_RELOC_NIOS2_CALL_LO, BFD_RELOC_NIOS2_CALL_HA): New.
	* libbfd.h: Regenerated.
	* bfd-in2.h: Regenerated.
	* elf32-nios2.c (elf_nios2_howto_table_rel): Add new relocations.
	(nios2_reloc_map): Likewise.
	(GOT_USED, CALL_USED): Renamed from GOT16_USED and CALL16_USED.
	Fixed all references.
	(nios2_elf32_relocate_section): Add new relocations.
	(nios2_elf32_check_relocs): Likewise.
	(nios2_elf32_gc_sweep_hook): Likewise.
2014-02-03 08:42:42 -08:00
Sandra Loosemore 78058a5e4f Nios II CALL26 linker relaxation
2014-01-30  Sandra Loosemore  <sandra@codesourcery.com>

	bfd/
	* bfd-in2.h: Update from reloc.c.
	* elf32-nios2.c: Include elf32-nios2.h.
	(elf_nios2_howto_table_rel): Add entry for R_NIOS2_CALL26_NOAT.
	(nios2_reloc_map): Likewise.
	(enum elf32_nios2_stub_type): Declare.
	(struct elf32_nios2_stub_hash_entry): Declare.
	(nios2_stub_hash_entry, nios2_stub_hash_lookup): New macros.
	(struct elf32_nios2_link_hash_entry): Add hsh_cache field.
	(struct elf32_nios2_link_hash_table): Add new fields bstab,
	stub_bfd, add_stub_section, layout_sections_again, stub_group,
	bfd_count, top_index, input_list, all_local_syms.
	(nios2_call26_stub_entry): New.
	(nios2_elf32_install_imm16): Move up in file.
	(nios2_elf32_install_data): Move up in file.
	(hiadj): Move up in file.
	(stub_hash_newfunc): New.
	(link_hash_newfunc): Initialize hsh_cache field.
	(STUB_SUFFIX): New.
	(nios2_stub_name): New.
	(nios2_get_stub_entry): New.
	(nios2_add_stub): New.
	(nios2_elf32_setup_section_lists): New.
	(nios2_elf32_next_input_section): New.
	(CALL26_SEGMENT): New.
	(MAX_STUB_SECTION_SIZE): New.
	(group_sections): New.
	(nios2_type_of_stub): New.
	(nios2_build_one_stub): New.
	(nios2_size_one_stub): New.
	(get_local_syms): New.
	(nios2_elf32_size_stubs): New.
	(nios2_elf32_build_stubs): New.
	(nios2_elf32_do_call26_relocate): Correct CALL26 overflow test.
	(nios2_elf32_relocate_section): Handle R_NIOS2_CALL26_NOAT.  Add
	trampolines for R_NIOS2_CALL26 stubs.
	(nios2_elf32_check_relocs): Handle R_NIOS2_CALL26_NOAT.
	(nios2_elf32_gc_sweep_hook): Likewise.
	(nios2_elf32_link_hash_table_create): Initialize the stub hash table.
	(nios2_elf32_link_hash_table_free): New.
	(bfd_elf32_bfd_link_hash_table_free): Define.
	* elf32-nios2.h: New file.
	* libbfd.h: Update from reloc.c.
	* reloc.c (BFD_RELOC_NIOS2_CALL26_NOAT): New.

	gas/
	* config/tc-nios2.c (md_apply_fix): Handle BFD_RELOC_NIOS2_CALL26_NOAT.
	(nios2_assemble_args_m): Likewise.
	(md_assemble): Likewise.

	gas/testsuite/
	* gas/nios2/call26_noat.d: New.
	* gas/nios2/call26_noat.s: New.
	* gas/nios2/call_noat.d: New.
	* gas/nios2/call_noat.s: New.

	include/elf/
	* nios2.h (elf_nios2_reloc_type): Add R_NIOS2_CALL26_NOAT.

	ld/
	* Makefile.am (enios2elf.c, enios2linux.c): Update dependencies.
	* Makefile.in: Regenerated.
	* emulparams/nios2elf.sh (EXTRA_EM_FILE): Set.
	* emulparams/nios2linux.sh (EXTRA_EM_FILE): Set.
	* emultempl/nios2elf.em: New file.
	* gen-doc.texi (NIOSII): Set.
	* ld.texinfo (NIOSII): Set.

	ld/testsuite/
	* ld-nios2/relax_call26.s: New.
	* ld-nios2/relax_call26_boundary.ld: New.
	* ld-nios2/relax_call26_boundary.s: New.
	* ld-nios2/relax_call26_boundary_c8.d: New.
	* ld-nios2/relax_call26_boundary_cc.d: New.
	* ld-nios2/relax_call26_boundary_d0.d: New.
	* ld-nios2/relax_call26_boundary_d4.d: New.
	* ld-nios2/relax_call26_boundary_d8.d: New.
	* ld-nios2/relax_call26_boundary_dc.d: New.
	* ld-nios2/relax_call26_boundary_f0.d: New.
	* ld-nios2/relax_call26_boundary_f4.d: New.
	* ld-nios2/relax_call26_boundary_f8.d: New.
	* ld-nios2/relax_call26_boundary_fc.d: New.
	* ld-nios2/relax_call26_cache.d: New.
	* ld-nios2/relax_call26_cache.ld: New.
	* ld-nios2/relax_call26_cache.s: New.
	* ld-nios2/relax_call26_multi.d: New.
	* ld-nios2/relax_call26_multi.ld: New.
	* ld-nios2/relax_call26_norelax.d: New.
	* ld-nios2/relax_call26_shared.d: New.
	* ld-nios2/relax_call26_shared.ld: New.
2014-01-30 17:47:07 -08:00
DJ Delorie 34b822e3bc Add .data and .bss refsym symbols
For each object, if it has a nonempty .data or .bss section,
emit a symbol that could cause the startup code to selectively
link in the code to initialize those sections.

* config/tc-msp430.c (msp430_section): Always flag data sections,
regardless of -md.
(msp430_frob_section): New.  Make sure all sections are noticed if
they have content.
(msp430_lcomm): New.  Flag bss if .lcomm is seen.
(msp430_comm): New.  Likewise.
(md_pseudo_table): Add them.
* config/tc-msp430.h (msp430_frob_section): Declare.
(tc_frob_section): Define.
2014-01-24 14:43:58 -05:00
Nick Clifton 8e75a78f36 Remove the display of known MCU names from the MSP430 port of GAS.
New MSP430 MCU parts are being created by TI all the time and the
list is basically always out of date.  Instead any name will be
accepted by the -mmcu= command line option.  ISA selection is now
based upon the -mcpu= command line option, just as is done for GCC.

gas/ChangeLog
	* config/tc-msp430.c (show_mcu_list): Delete.
	(md_parse_option): Accept any MCU name.  Accept several more
	variants for the -mcpu option.
	(md_show_usage): Do not call show_mcu_list.
2014-01-23 17:08:24 +00:00
DJ Delorie 96b961024c Add .refsym to msp430 backend
* config/tc-msp430.c (msp430_refsym): New: ".refsym <symbol>"
* doc/c-msp430.texi (MSP430 Directives): Document it.

The purpose of this patch is to provide a way for one object file
to require the inclusion of another object, without having to
allocate space for a .word address reference.
2014-01-22 16:41:13 -05:00
Michael Zolotukhin 7c84a0ca90 Remove regzmm from AVX2 gather assert
Since regzmm can't be used in AVX2 gather instructions, there is no need
to check regzmm in AVX2 gather assert.

2014-01-22  Michael Zolotukhin  <michael.v.zolotukhin@gmail.com>

	* config/tc-i386.c (check_VecOperands): Remove regzmm from AVX2
	gather assert.
2014-01-22 11:39:02 -08:00
Michael Zolotukhin 8444f82a1d Add check for invalid register in AVX512 gathers
AVX512 gather instructions shouldn't accept the same register for both
destination and index.

gas/

2014-01-22  Michael Zolotukhin  <michael.v.zolotukhin@gmail.com>

	PR gas/16489
	* config/tc-i386.c (check_VecOperands): Add check for invalid
	register set in AVX512 gathers.

gas/testsuite/

2014-01-22  Michael Zolotukhin  <michael.v.zolotukhin@gmail.com>

	PR gas/16489
	* gas/i386/vgather-check.s: Add tests for AVX512 gathers.
	* gas/i386/x86-64-vgather-check.s: Likewise.
	* gas/i386/vgather-check-error.l: Update correspondingly.
	* gas/i386/vgather-check-none.d: Likewise.
	* gas/i386/vgather-check-warn.d: Likewise.
	* gas/i386/vgather-check-warn.e: Likewise.
	* gas/i386/vgather-check.d: Likewise.
	* gas/i386/x86-64-vgather-check-error.l: Likewise.
	* gas/i386/x86-64-vgather-check-none.d: Likewise.
	* gas/i386/x86-64-vgather-check-warn.d: Likewise.
	* gas/i386/x86-64-vgather-check-warn.e: Likewise.
	* gas/i386/x86-64-vgather-check.d: Likewise.
2014-01-22 10:01:12 -08:00
Alan Modra cda796e168 Fix gas build breakage
* config/tc-tic4x.c (md_shortopts): s/CONST/const/.
2014-01-22 16:21:34 +10:30
DJ Delorie c9d665580e Ensure that %func() expressions are outermost terms
This is to avoid expressions like:  %hi(foo) + 1, which will
not do what you expect.  The complex relocations can handle it,
but the internal fixups can't.
2014-01-21 15:12:19 -05:00
Will Newton 827f64ffb5 gas: ARM: Fix encoding of VCVTr.s32.f64 instructions
The direct rounding floating-point VCVT instructions introduced in
ARMv8 encode the s32.f64 variant incorrectly. The op bit should be
set to 1 for all signed conversions.

gas/ChangeLog:

2014-01-17  Will Newton  <will.newton@linaro.org>

	* config/tc-arm.c (do_vfp_nsyn_cvt_fpv8): Set OP to 1
	for the s32.f64 flavours of VCVT.

gas/testsuite/ChangeLog:

2014-01-17  Will Newton  <will.newton@linaro.org>

	* gas/arm/armv8-a+fp.d: Correct encoding of vcvta.s32.f64.
2014-01-17 15:34:56 +00:00
Nick Clifton 73812f599c PR gas/16434
* config/tc-z80.c (wrong_match): Provide format string to
	as_warn.
	(parse_exp_not_indexed): Delete unused variable dummy.
	(emit_byte): Delete unused variable fixp.
2014-01-14 12:39:45 +00:00
H.J. Lu 143e9f4a65 Remove regbnd and vec_disp8
* config/tc-i386.c (regbnd): Removed.
	(vec_disp8): Likewise.
2014-01-08 08:22:35 -08:00
H.J. Lu 221fd5d598 Update copyright year to 2014
binutils/

	* version.c (print_version): Update copyright year to 2014.

gas/

	* as.c (parse_args): Update copyright year to 2014.

gold/

	* version.cc (print_version): Update copyright year to 2014.

ld/

	* ldver.c (ldversion): Update copyright year to 2014.

opcodes/

	* i386-gen.c (process_copyright): Update copyright year to 2014.
2014-01-08 05:48:12 -08:00
H.J. Lu 5fb776a637 New Year - binutils ChangeLog rotation 2014-01-08 05:32:12 -08:00
Tom Tromey 1651e569b4 remove VA_* from binutils
This removes the last uses of the obsolete VA_* macros from binutils.

All the binutils and bfd changes were tested by rebuilding.
I didn't rebuild the gas change but I think it is obviously correct.

2014-01-07  Tom Tromey  <tromey@redhat.com>

	* elf32-xtensa.c (vsprint_msg): Don't use old VA_* compatibility
	wrappers.

2014-01-07  Tom Tromey  <tromey@redhat.com>

	* bucomm.c (fatal, non_fatal): Replace obsolete VA_* macros with
	stdarg macros.
	* dlltool.c (inform): Replace obsolete VA_* macros with stdarg
	macros.
	* dllwrap.c (inform, warn): Replace obsolete VA_* macros with
	stdarg macros.

2014-01-07  Tom Tromey  <tromey@redhat.com>

	* config/tc-tic30.c (debug): Avoid old VA_* compatibility
	wrappers.
2014-01-07 09:17:05 -07:00
Tom Tromey b51f1626f6 remove uses of PARAMS from binutils
This removes the last uses of PARAMS from binutils.

The two changes in binutils were tested by rebuilding.
I didn't rebuild the gas change but I think it is obviously correct.

2014-01-07  Tom Tromey  <tromey@redhat.com>

	* coffgrok.h (coff_ofile): Don't use PARAMS.
	* nlmheader.y (strerror): Don't use PARAMS.

2014-01-07  Tom Tromey  <tromey@redhat.com>

	* config/tc-microblaze.h (parse_cons_expression_microblaze): Don't
	use PARAMS.
2014-01-07 09:17:04 -07:00
Tom Tromey 3cea37c40c remove ANSI_PROTOTYPES
This removes the last use of ANSI_PROTOTYPES in the tree.
It appears in gas.

I didn't even rebuild this but I think it is obviously correct.

2014-01-07  Tom Tromey  <tromey@redhat.com>

	* config/tc-xc16x.h: Don't use ANSI_PROTOTYPES.
2014-01-07 09:17:04 -07:00
Philipp Tomsich 9877c63c84 [AArch64] Add GAS recognition for "xgene-1"
* config/tc-aarch64.c (aarch64_cpus): Add entry for "xgene-1"

This adds support for the AppliedMicro X-Gene 1 processor to the
assembler.
2014-01-07 12:27:24 +00:00
Tristan Gingold ea4cff4f1f Remove duplicated entry for .pad in c-arm.texi
* doc/c-arm.texi (ARM Directives): Remove duplicate .pad entry.
2013-12-20 12:38:14 +01:00
Yufeng Zhang 3f06bfce70 gas/
* config/tc-aarch64.c (md_assemble): Defer the feature checking until
	do_encode () succeeds.

gas/testsuite/

	* gas/aarch64/rm-simd-ext.d: New file.
	* gas/aarch64/rm-simd-ext.l: Likewise.
	* gas/aarch64/rm-simd-ext.s: Likewise.
2013-12-18 19:15:57 +00:00
Nick Clifton 720fbed62e * config/tc-rx.c (rx_include): Rename 'eof' to 'last_char' in
order to avoid conflict with same named variable in MinGW system
	header file.
2013-12-18 11:51:25 +00:00
Nick Clifton a75555d13b * config/tc-msp430.c (mcu_types): Add some more 430X mcu names.
(OPTION_INTR_NOPS): Define.
	(gen_interrupt_nops): Default to FALSE.
	(md_parse_opton): Add support for OPTION_INTR_NOPS.
	(md_longopts): Add -mn.
	(md_show_usage): Add -mn.
	(msp430_operands): Generate NOPs for all MCUs not just 430Xv2.
	* doc/c-msp430.c: Document -mn.
2013-12-13 12:32:21 +00:00
Kuan-Lin Chen 35c081572f Add support for Andes NDS32:
BFD:
	* Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Add nds32
	files.
	* Makefile.in: Regenerate.
	* archures.c (bfd_nds32_arch): Add nds32 target.
	* bfd-in2.h: Regenerate.
	* config.bfd (nds32*le-*-linux): Add bfd_elf32_nds32lelin_vec
	and bfd_elf32_nds32belin_vec.
	(nds32*be-*-linux*): Likewise.
	(nds32*le-*-*): Add bfd_elf32_nds32le_vec and bfd_elf32_nds32be_vec.
	(nds32*be-*-*): Likewise.
	* configure.in (bfd_elf32_nds32be_vec): Add elf32-nds32.lo.
	(bfd_elf32_nds32le_vec): Likewise.
	(bfd_elf32_nds32belin_vec): Likewise.
	(bfd_elf32_nds32lelin_vec): Likewise.
	* configure: Regenerate.
	* cpu-nds32.c: New file for nds32.
	* elf-bfd.h: Add NDS32_ELF_DATA.
	* elf32-nds32.c: New file for nds32.
	* elf32-nds32.h: New file for nds32.
	* libbfd.h: Regenerate.
	* reloc.c: Add relocations for nds32.
	* targets.c (bfd_elf32_nds32be_vec): New declaration for nds32.
	(bfd_elf32_nds32le_vec): Likewise.
	(bfd_elf32_nds32belin_vec): Likewise.
	(bfd_elf32_nds32lelin_vec): Likewise.

BINUTILS:
	* readelf.c: Include elf/nds32.h
	(guess_is_rela): Add case for EM_NDS32.
	(dump_relocations): Add case for EM_NDS32.
	(decode_NDS32_machine_flags): New.
	(get_machine_flags): Add case for EM_NDS32.
	(is_32bit_abs_reloc): Likewise.
	(is_16bit_abs_reloc): Likewise.
	(process_nds32_specific): New.
	(process_arch_specific): Add case for EM_NDS32.
	* NEWS: Announce Andes nds32 support.
	* MAINTAINERS: Add nds32 maintainers.
  TESTSUITE:
	* binutils-all/objdump.exp: Add NDS32 cpu.
	* binutils-all/readelf.r: Skip extra reloc created by NDS32.

GAS:
	* Makefile.am (TARGET_CPU_CFILES): Add config/tc-nds32.c.
	(TARGET_CPU_HFILES): Add config/tc-nds32.h.
	* Makefile.in: Regenerate.
	* configure.in (nds32): Add nds32 target extension config support.
	* configure.tgt : Add case for nds32-*-elf* and nds32-*-linux*.
	* configure: Regenerate.
	* config/tc-nds32.c: New file for nds32.
	* config/tc-nds32.h: New file for nds32.
	* doc/Makefile.am (CPU_DOCS): Add c-nds32.texi.
	* doc/Makefile.in: Regenerate.
	* doc/as.texinfo: Add nds32 options.
	* doc/all.texi: Set NDS32.
	* doc/c-nds32.texi: New file dor nds32 document.
	* NEWS: Announce Andes nds32 support.
  TESTSUITE:
	* gas/all/gas.exp: Add expected failures for NDS32.
	* gas/elf/elf.exp: Likewise.
	* gas/lns/lns.exp: Use alternate test.
	* gas/macros/irp.d: Skip for NDS32.
	* gas/macros/macros.exp: Skip some tests for the NDS32.
	* gas/macros/rept.d: Skip for NDS32.
	* gas/macros/test3.d: Skip for NDS32.
	* gas/nds32: New directory.
	* gas/nds32/alu-1.s: New test.
	* gas/nds32/alu-1.d: Likewise.
	* gas/nds32/alu-2.s: Likewise.
	* gas/nds32/alu-2.d: Likewise.
	* gas/nds32/br-1.d: Likewise.
	* gas/nds32/br-1.s: Likewise.
	* gas/nds32/br-2.d: Likewise.
	* gas/nds32/br-2.s: Likewise.
	* gas/nds32/ji-jr.d: Likewise.
	* gas/nds32/ji-jr.s: Likewise.
	* gas/nds32/ls.d: Likewise.
	* gas/nds32/ls.s: Likewise.
	* gas/nds32/lsi.d: Likewise.
	* gas/nds32/lsi.s: Likewise.
	* gas/nds32/to-16bit-v1.d: Likewise.
	* gas/nds32/to-16bit-v1.s: Likewise.
	* gas/nds32/to-16bit-v2.d: Likewise.
	* gas/nds32/to-16bit-v2.s: Likewise.
	* gas/nds32/to-16bit-v3.d: Likewise.
	* gas/nds32/to-16bit-v3.s: Likewise.
	* gas/nds32/nds32.exp: New test driver.

LD:
	* Makefile.am (ALL_EMULATION_SOURCES): Add nds32 target.
	* Makefile.in: Regenerate.
	* configure.tgt: Add case for nds32*le-*-elf*, nds32*be-*-elf*,
	nds32*le-*-linux-gnu*, and nds32*be-*-linux-gnu*.
	* emulparams/nds32belf.sh: New file for nds32.
	* emulparams/nds32belf_linux.sh: Likewise.
	* emulparams/nds32belf16m.sh: Likewise.
	* emulparams/nds32elf.sh: Likewise.
	* emulparams/nds32elf_linux.sh: Likewise.
	* emulparams/nds32elf16m.sh: Likewise.
	* emultempl/nds32elf.em: Likewise.
	* scripttempl/nds32elf.sc}: Likewise.
	* gen-doc.texi: Set NDS32.
	* ld.texinfo: Set NDS32.
	* NEWS: Announce Andes nds32 support.
  TESTSUITE:
	* lib/ld-lib.exp: Add NDS32 to list of targets that do not support
	shared library generation.
	* ld-nds32: New directory.
	* ld-nds32/branch.d: New test.
	* ld-nds32/branch.ld: New test.
	* ld-nds32/branch.s: New test.
	* ld-nds32/diff.d: New test.
	* ld-nds32/diff.ld: New test.
	* ld-nds32/diff.s: New test.
	* ld-nds32/gp.d: New test.
	* ld-nds32/gp.ld: New test.
	* ld-nds32/gp.s: New test.
	* ld-nds32/imm.d: New test.
	* ld-nds32/imm.ld: New test.
	* ld-nds32/imm.s: New test.
	* ld-nds32/imm_symbol.s: New test.
	* ld-nds32/relax_jmp.d: New test.
	* ld-nds32/relax_jmp.ld: New test.
	* ld-nds32/relax_jmp.s: New test.
	* ld-nds32/relax_load_store.d: New test.
	* ld-nds32/relax_load_store.ld: New test.
	* ld-nds32/relax_load_store.s: New test.
	* ld-nds32/nds32.exp: New file.

OPCODES:
	* Makefile.am (TARGET_LIBOPCODES_CFILES): Add nds32-asm.c
	and nds32-dis.c.
	* Makefile.in: Regenerate.
	* configure.in: Add case for bfd_nds32_arch.
	* configure: Regenerate.
	* disassemble.c (ARCH_nds32): Define.
	* nds32-asm.c: New file for nds32.
	* nds32-asm.h: New file for nds32.
	* nds32-dis.c: New file for nds32.
	* nds32-opc.h: New file for nds32.

INCLUDE:
	* dis-asm.h (print_insn_nds32): Add nds32 target.
	* elf/nds32.h: New file for nds32.
	* opcode/nds32.h: New file for nds32.
2013-12-13 11:52:32 +00:00
Roland McGrath f2c7d7ee5b Use $(INSTALL_PROGRAM_ENV) consistently.
binutils/
	* Makefile.am (install-exec-local): Prefix libtool invocation with
	$(INSTALL_PROGRAM_ENV).
	* Makefile.in: Regenerate.

gas/
	* Makefile.am (install-exec-bindir): Prefix libtool invocation
	with $(INSTALL_PROGRAM_ENV).
	(install-exec-tooldir): Likewise.
	* Makefile.in: Regenerate.

gold/
	* Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
	with $(INSTALL_PROGRAM_ENV).
	* Makefile.in: Regenerate.

ld/
	* Makefile.am (install-exec-local): Prefix libtool invocation with
	$(INSTALL_PROGRAM_ENV).
	* Makefile.in: Regenerate.
2013-12-10 15:19:50 -08:00
Mike Frysinger 594d8fa8e9 strip off +x bits on non-executable/script files
These files are source files and have no business being +x.  We couldn't
easily fix it in CVS (you need login+write access to the raw rcs files),
but we can fix this w/git.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-12-07 02:03:03 -05:00
Tristan Gingold c2a5914e1b Fix crash on intelbad.
gas/
2013-12-03  Tristan Gingold  <gingold@adacore.com>

	* config/tc-i386-intel.c (i386_intel_simplify): Avoid arithmetic
	overflow on pointers.
2013-12-03 17:31:46 +01:00
Yufeng Zhang 9a73e520da Revert "Do not issue error messages when parsing a PSTATE register".
This reverts commit 03e621be97.
2013-11-20 11:22:53 +00:00
Nick Clifton 03e621be97 * config/tc-aarch64.c (parse_sys_reg): Do not issue error messages
for deprecated system registers when parsing pstate fields.
2013-11-19 17:40:31 +00:00
Catherine Moore a8d14a8892 2013-11-19 Catherine Moore <clm@codesourcery.com>
gas/
	* config/tc-mips.c (mips_fix_pmc_rm7000): Declare.
	(options): Add OPTION_FIX_PMC_RM7000 and OPTION_NO_FIX_PMC_RM7000.
	(md_longopts): Add mfix-pmc-rm7000 and mno-fix-pmc-rm7000.
	(INSN_DMULT): Define.
	(INSN_DMULTU): Define.
	(insns_between): Detect PMC RM7000 errata.
	(md_parse_option): Supprt OPTION_FIX_PMC_RM7000 and
	OPTION_NO_FIX_PMC_RM7000.
	* doc/as.texinfo: Document new options.
	* doc/c-mips.texi: Likewise.

	gas/testsuite/
	* gas/mips/fix-pmc-rm7000-1.d: New.
	* gas/mips/fix-pmc-rm7000-1.s: New.
	* gas/mips/fix-pmc-rm7000-2.d: New.
	* gas/mips/fix-pmc-rm7000-2.s: New.
	* gas/mips/micromips@fix-pmc-rm7000-1.d: New.
	* gas/mips/micromips@fix-pmc-rm7000-2.d: New.
	* gas/mips/mips.exp: Run new tests.
2013-11-19 05:07:54 -08:00
Alexey Makhalov cf3f45fad7 PR gas/16109
* app.c (do_scrub_chars): Only insert a newline character if
	end-of-file has been reached.
2013-11-19 08:19:21 +00:00
H.J. Lu c06ec7240f Add a dummy "int bnd_prefix" argument
* config/tc-i386.c (lex_got): Add a dummy "int bnd_prefix"
	argument.
2013-11-18 12:16:16 -08:00
Yufeng Zhang c9fb6e5814 Add support for armv7ve to gas.
gas/

	* config/tc-arm.c (arm_archs): New armv7ve architecture option.
	(arm_cpus): Replace ARM_ARCH_V7A_IDIV_MP_SEC_VIRT with
	ARM_ARCH_V7VE for cortex-a7, cortex-a12 and cortex-a15.
	(cpu_arch_ver): Likewise.
	* doc/c-arm.texi: Document armv7ve.

gas/testsuite/

	* gas/arm/attr-march-armv7ve.d: New test case for armv7ve.

include/opcode/

	* arm.h (ARM_AEXT_V7VE): New define.
	(ARM_ARCH_V7VE): New define.
	(ARM_ARCH_V7A_IDIV_MP_SEC_VIRT): Removed.
2013-11-18 17:23:33 +00:00
Yufeng Zhang 18cf6de400 gas/
* config/tc-aarch64.c (parse_sys_reg): Support
	S2_<op1>_<Cn>_<Cm>_<op2>.

gas/testsuite/

	* gas/testsuite/sysreg.s: Add test.
	* gas/testsuite/sysreg.d: Update.
2013-11-18 11:42:42 +00:00
Yufeng Zhang a203d9b72f Revert "Add support for AArch64 trace unit registers."
This reverts commit 75468c93c1.
2013-11-18 11:42:41 +00:00
H.J. Lu c33205431a Add R_X86_64_PC32_BND and R_X86_64_PLT32_BND
bfd/

	* elf64-x86-64.c (x86_64_elf_howto_table): Add R_X86_64_PC32_BND
	and R_X86_64_PLT32_BND.
	(R_X86_64_standard): Replace R_X86_64_RELATIVE64 with
	R_X86_64_PLT32_BND.
	(IS_X86_64_PCREL_TYPE): Add R_X86_64_PLT32_BND.
	(x86_64_reloc_map): Add BFD_RELOC_X86_64_PC32_BND and
	BFD_RELOC_X86_64_PLT32_BND.
	(elf_x86_64_check_relocs): Handle R_X86_64_PC32_BND and
	R_X86_64_PLT32_BND.
	(elf_x86_64_gc_sweep_hook): Likewise.
	(elf_x86_64_relocate_section): Likewise.
	* reloc.c (bfd_reloc_code_real): Add BFD_RELOC_X86_64_PC32_BND
	and BFD_RELOC_X86_64_PLT32_BND.
	* bfd-in2.h: Regenerated.
	* libbfd.h: Likewise.

gas/

	* config/tc-i386.c (reloc): Add an argument, bnd_prefix, to
	indicate if instruction has the BND prefix.  Return
	BFD_RELOC_X86_64_PC32_BND instead of BFD_RELOC_32_PCREL if
	bnd_prefix isn't zero.
	(output_branch): Pass BFD_RELOC_X86_64_PC32_BND to frag_var
	if needed.
	(output_jump): Update reloc call.
	(output_interseg_jump): Likewise.
	(output_disp): Likewise.
	(output_imm): Likewise.
	(x86_cons_fix_new): Likewise.
	(lex_got): Add an argument, bnd_prefix, to indicate if
	instruction has the BND prefix.  Use BFD_RELOC_X86_64_PLT32_BND
	if needed.
	(x86_cons): Update lex_got call.
	(i386_immediate): Likewise.
	(i386_displacement): Likewise.
	(md_apply_fix): Handle BFD_RELOC_X86_64_PC32_BND and
	BFD_RELOC_X86_64_PLT32_BND.
	(tc_gen_reloc): Likewise.
	* config/tc-i386-intel.c (i386_operator): Update lex_got call.

gas/testsuite/

	* gas/i386/i386.exp: Run x86-64-mpx-branch-1 and
	x86-64-mpx-branch-2 on 64-bit ELF targets.
	* gas/i386/x86-64-mpx-branch-1.d: New file.
	* gas/i386/x86-64-mpx-branch-1.s: Likewise.
	* gas/i386/x86-64-mpx-branch-2.d: Likewise.
	* gas/i386/x86-64-mpx-branch-2.s: Likewise.

include/elf/

	* x86-64.h: Add R_X86_64_PC32_BND and R_X86_64_PLT32_BND.

ld/testsuite/

	* ld-x86-64/mpx.exp: New file.
	* ld-x86-64/mpx1.out: Likewise.
	* ld-x86-64/mpx1a.c: Likewise.
	* ld-x86-64/mpx1a.rd: Likewise.
	* ld-x86-64/mpx1b.c: Likewise.
	* ld-x86-64/mpx1c.c: Likewise.
	* ld-x86-64/mpx1c.rd: Likewise.
2013-11-17 08:57:56 -08:00
Yufeng Zhang 75468c93c1 gas/
* config/tc-aarch64.c (set_other_error): New function.
	(parse_sys_reg): Add new parameter 'sys_reg' and if non-NULL set
	the variable to which it points with 'o'.
	(parse_operands): Update; check for write to read-only system
	registers or read from write-only ones.

gas/testsuite/

	* gas/aarch64/diagnostic.s: Add tests.
	* gas/aarch64/diagnostic.l: Update.
	* gas/aarch64/tracereg-illegal.d: New file.
	* gas/aarch64/tracereg-illegal.l: Ditto.
	* gas/aarch64/tracereg-illegal.s: Ditto.
	* gas/aarch64/tracereg.d: Ditto.
	* gas/aarch64/tracereg.s: Ditto.

include/opcode

	* aarch64.h (aarch64_sys_reg_readonly_p): New declaration.
	(aarch64_sys_reg_writeonly_p): Ditto.

opcodes/

	* aarch64-opc.c (CPENT): New define.
	(F_READONLY, F_WRITEONLY): Likewise.
	(aarch64_sys_regs): Add trace unit registers.
	(aarch64_sys_reg_readonly_p): New function.
	(aarch64_sys_reg_writeonly_p): Ditto.
2013-11-15 23:40:34 +00:00
Michael Zolotukhin ad8ecc8114 Reorder invalid default mask check
gas/

2013-11-15  Michael Zolotukhin  <michael.v.zolotukhin@gmail.com>

	* config/tc-i386.c (check_VecOperands): Reorder checks.

gas/testsuite/

2013-11-15  Michael Zolotukhin  <michael.v.zolotukhin@gmail.com>

	* gas/i386/inval-avx512f.s: Add invalid test for gather instruction
	with default mask.
	* gas/i386/inval-avx512f.l: Update correspondingly.
2013-11-15 05:22:32 -08:00
Catherine Moore b83a9376e9 Fix ChangeLog entries from earlier commit. 2013-11-11 15:34:48 -08:00
Jan-Benedict Glaw e2b5892e6e 2013-11-08 Jan-Benedict Glaw <jbglaw@lug-owl.de
* config/tc-ppc.c (ppc_elf_localentry): Add cast.

[BR]: https://sourceware.org/ml/binutils/2013-11/msg00064.html
2013-11-11 09:35:51 +01:00
Yufeng Zhang 49eec19300 gas/
* config/tc-aarch64.c (parse_sys_reg): Update to use aarch64_sys_reg;
	call aarch64_sys_reg_deprecated_p and warn about the deprecated
	system registers.

gas/testsuite/

	* gas/aarch64/deprecated.d: New file.
	* gas/aarch64/deprecated.l: New file.
	* gas/aarch64/deprecated.s: New file.
	* gas/aarch64/sysreg-1.s: Add tests.
	* gas/aarch64/sysreg-1.d: Add tests.

include/opcode/

	* aarch64.h (aarch64_sys_reg): New typedef.
	(aarch64_sys_regs): Change to define with the new type.
	(aarch64_sys_reg_deprecated_p): Declare.

opcodes/

	* aarch64-opc.c (F_DEPRECATED): New macro.
	(aarch64_sys_regs): Update; flag "spsr_svc" and "spsr_hyp" with
	F_DEPRECATED.
	(aarch64_print_operand): Call aarch64_sys_reg_deprecated_p on
	AARCH64_OPND_SYSREG.
2013-11-05 20:54:22 +00:00
Yufeng Zhang 68a6428382 gas/
* config/tc-aarch64.c (parse_operands): Handle AARCH64_OPND_COND1.

gas/testsuite/

	* gas/aarch64/alias.s: Add tests.
	* gas/aarch64/alias.d: Update.
	* gas/aarch64/no-aliases.d: Update.
	* gas/aarch64/diagnostic.s: Add tests.
	* gas/aarch64/diagnostic.l: Update.
	* gas/aarch64/illegal.s: Add tests.
	* gas/aarch64/illegal.l: Update.

include/opcode/

	* aarch64.h (enum aarch64_operand_class): Add AARCH64_OPND_CLASS_COND.
	(enum aarch64_opnd): Add AARCH64_OPND_COND1.

opcodes/

	* aarch64-dis.c (convert_ubfm_to_lsl): Check for cond != '111x'.
	(convert_from_csel): Likewise.
	* aarch64-opc.c (operand_general_constraint_met_p): Handle
	AARCH64_OPND_CLASS_COND and AARCH64_OPND_COND1.
	(aarch64_print_operand): Handle AARCH64_OPND_COND1.
	* aarch64-tbl.h (aarch64_opcode_table): Use COND1 instead of
	COND for cinc, cset, cinv, csetm and cneg.
	(AARCH64_OPERANDS): Add entry for AARCH64_OPND_COND1.
	* aarch64-asm-2.c: Re-generated.
	* aarch64-dis-2.c: Ditto.
	* aarch64-opc-2.c: Ditto.
2013-11-05 20:50:18 +00:00
Will Newton 8db49cc2de config/tc-aarch64.c: Avoid trying to parse a vector mov as immediate.
Parsing a vector mov instruction currently leads to a phantom undefined
symbol being added to the symbol table. e.g.:

       .text
       mov     x0, v0.D[0]

Produces an undefined symbol called "v0.D".

gas/ChangeLog:

2013-11-05  Will Newton  <will.newton@linaro.org>

	PR gas/16103
	* config/tc-aarch64.c (parse_operands): Avoid trying to
	parse a vector register as an immediate.

gas/testsuite/ChangeLog:

2013-11-05  Will Newton  <will.newton@linaro.org>

	* gas/aarch64/advsimd-mov-bad.d: New file.
	* gas/aarch64/advsimd-mov-bad.s: Likewise.
2013-11-05 14:28:30 +00:00
Jan Beulich e4630f71b2 x86-64/gas: fix an asymmetry in suffix/register checking
Without this, constructs like "orw %rax, (%rax)" aren't being rejected
(other than any other wrong suffix/register combination).

gas/
2013-11-04  Jan Beulich <jbeulich@suse.com>

	* config/tc-i386.c (check_long_reg): Correct comment indentation.
	(check_qword_reg): Correct comment and its indentation.
	(check_word_reg): Extend comment and correct its indentation. Also
	check for 64-bit register.

gas/testsuite/
2013-11-04  Jan Beulich <jbeulich@suse.com>

	* gas/i386/x86-64-suffix-bad.[sl]: New.
	* gas/i386/i386.exp: Run new test.
2013-11-04 16:05:39 +01:00
Alan Modra 6911b7dcb8 Add ELFv2 .localentry support.
This defines the ELF symbol st_other field used to encode the number
of instructions between a function "global entry" and its "local entry",
and adds support related to the local entry offset.

include/elf/
	* ppc64.h (STO_PPC64_LOCAL_BIT, STO_PPC64_LOCAL_MASK): Define.
	(ppc64_decode_local_entry, ppc64_encode_local_entry): New functions.
	(PPC64_LOCAL_ENTRY_OFFSET, PPC64_SET_LOCAL_ENTRY_OFFSET): Define.
bfd/
	* elf64-ppc.c (struct ppc_stub_hash_entry): Add "other".
	(stub_hash_newfunc): Init new ppc_stub_hash_entry field, and one
	we forgot, "plt_ent".
	(ppc64_elf_add_symbol_hook): Check ELFv1 objects don't have
	st_other bits only valid in ELFv2.
	(ppc64_elf_merge_symbol_attribute): New function.
	(ppc_type_of_stub): Add local_off param to test branch range.
	(ppc_build_one_stub): Adjust destinations for ELFv2 locals.
	(ppc_size_one_stub, toc_adjusting_stub_needed): Similarly.
	(ppc64_elf_size_stubs): Pass local_off to ppc_type_of_stub.
	Set "other" field.
	(ppc64_elf_relocate_section): Adjust destination for ELFv2 local
	calls.
gas/
	* config/tc-ppc.c (md_pseudo_table): Add .localentry.
	(ppc_elf_localentry): New function.
	(ppc_force_relocation): Force relocs on all branches to localenty
	symbols.
	(ppc_fix_adjustable): Don't reduce such symbols to section+offset.
binutils/
	* readelf.c (get_ppc64_symbol_other): New function.
	(get_symbol_other): Use it for EM_PPC64.
2013-10-30 13:40:21 +10:30
Alan Modra ee67d69a3f Add .abiversion related support for ELFv2
Defines bits in ELF e_flags to differentiate ELFv2 objects from ELFv2,
adds .abiversion directive to explicitly choose the ABI, and code to
check and automatically select ABI.

include/elf/
	* ppc64.h (EF_PPC64_ABI): Define.
bfd/
	* elf64-ppc.c (abiversion, set_abiversion): New functions.
	(ppc64_elf_get_synthetic_symtab): Handle ELFv2 objects without .opd.
	(struct ppc_link_hash_table): Add opd_abi.
	(ppc64_elf_check_relocs): Check no .opd with ELFv2.
	(ppc64_elf_merge_private_bfd_data): New function.
	(ppc64_elf_print_private_bfd_data): New function.
	(ppc64_elf_tls_setup): Set htab->opd_abi.
	(ppc64_elf_size_dynamic_sections): Don't emit OPD related dynamic
	tags for ELFv2.
	(ppc_build_one_stub): Use R_PPC64_IRELATIVE for ELFv2 ifunc.
	(ppc64_elf_finish_dynamic_symbol): Likewise
binutils/
	* readelf.c (get_machine_flags): Display ABI version for EM_PPC64.
gas/
	* config/tc-ppc.c: Include elf/ppc64.h.
	(ppc_abiversion): New variable.
	(md_pseudo_table): Add .abiversion.
	(ppc_elf_abiversion, ppc_elf_end): New functions.
	* config/tc-ppc.h (md_end): Define.
2013-10-30 13:37:47 +10:30
Alan Modra f9c6b9078c Report overflow on PowerPC64 @h and @ha relocations.
This changes the behaviour of @h and @ha on PowerPC64 to report errors
on 32-bit overflow.  The motivation for this change is that on
PowerPC64, most uses of @h and @ha modifiers and their corresponding
relocations are to build up 32-bit offsets.  We'd like to know when
such offsets overflow.  Only rarely do people use @h or @ha with the
high 32-bit modifiers to build a 64-bit constant.  Those uses will now
need to use two new modifiers, @high and @higha, if the constant isn't
known at assembly time.  For now, we won't report overflow at assembly
time..

This also fixes an error when applying some of the HIGHER and HIGHEST
relocations.

include/elf/
	* ppc64.h (R_PPC64_ADDR16_HIGH, R_PPC64_ADDR16_HIGHA,
	R_PPC64_TPREL16_HIGH, R_PPC64_TPREL16_HIGHA,
	R_PPC64_DTPREL16_HIGH, R_PPC64_DTPREL16_HIGHA): New.
	(IS_PPC64_TLS_RELOC): Match new tls relocs.
bfd/
	* reloc.c (BFD_RELOC_PPC64_ADDR16_HIGH, BFD_RELOC_PPC64_ADDR16_HIGHA,
	BFD_RELOC_PPC64_TPREL16_HIGH, BFD_RELOC_PPC64_TPREL16_HIGHA,
	BFD_RELOC_PPC64_DTPREL16_HIGH, BFD_RELOC_PPC64_DTPREL16_HIGHA): New.
	* elf64-ppc.c (ppc64_elf_howto_raw): Add entries for new relocs.
	Make all _HA and _HI relocs report signed overflow.
	(ppc64_elf_reloc_type_lookup): Handle new relocs.
	(must_be_dyn_reloc, ppc64_elf_check_relocs): Likewise.
	(dec_dynrel_count, ppc64_elf_relocate_section): Likewise.
	(ppc64_elf_relocate_section): Don't apply 0x8000 adjust to
	R_PPC64_TPREL16_HIGHER, R_PPC64_TPREL16_HIGHEST,
	R_PPC64_DTPREL16_HIGHER, and R_PPC64_DTPREL16_HIGHEST.
	* libbfd.h: Regenerate.
	* bfd-in2.h: Regenerate.
gas/
	* config/tc-ppc.c (SEX16): Don't mask.
	(REPORT_OVERFLOW_HI): Define as zero.
	(ppc_elf_suffix): Support @high, @higha, @dtprel@high, @dtprel@higha,
	@tprel@high, and @tprel@higha modifiers.
	(md_assemble): Ignore X_unsigned when applying 16-bit insn fields.
	Add (disabled) code to check @h and @ha reloc overflow for powerpc64.
	Handle new relocs.
	(md_apply_fix): Similarly.
elfcpp/
	* powerpc.h (R_PPC64_ADDR16_HIGH, R_PPC64_ADDR16_HIGHA,
	R_PPC64_TPREL16_HIGH, R_PPC64_TPREL16_HIGHA,
	R_PPC64_DTPREL16_HIGH, R_PPC64_DTPREL16_HIGHA): Define.
gold/
	* powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
	(Target_powerpc::Scan::global, local): Likewise.
	(Target_powerpc::Relocate::relocate): Likewise.  Check for overflow
	on all ppc64 @h and @ha relocs.
2013-10-30 13:33:15 +10:30
Chao-ying Fu 9d5de888d6 2013-10-18 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
* config/tc-mips.c (fpr_read_mask): Test MSA registers.
	(fpr_write_mask): Test MSA registers.
	(can_swap_branch_p): Check fpr write followed by fpr read.
2013-10-18 21:14:25 +00:00
Nick Clifton 3fc1d03899 * config/tc-tic6x.c (tic6x_parse_operand): Revert previous delta. 2013-10-18 14:08:00 +00:00
Chao-ying Fu 56d438b172 2013-10-14 Richard Sandiford <rdsandiford@googlemail.com>
Chao-ying Fu  <Chao-ying.Fu@imgtec.com>

	* config/tc-mips.c (options): Add OPTION_MSA and OPTION_NO_MSA.
	(md_longopts): Add mmsa and mno-msa.
	(mips_ases): Add msa.
	(RTYPE_MASK): Update.
	(RTYPE_MSA): New define.
	(OT_REG_ELEMENT): Replace with...
	(OT_INTEGER_INDEX, OT_REG_INDEX): ...these new operand types.
	(mips_operand_token): Replace reg_element with index.
	(mips_parse_argument_token): Treat vector indices as separate tokens.
	Handle register indices.
	(md_begin): Add MSA register names.
	(operand_reg_mask): Handle cases for OP_IMM_INDEX and OP_REG_INDEX.
	(convert_reg_type): Handle cases for OP_REG_MSA and OP_REG_MSA_CTRL.
	(match_mdmx_imm_reg_operand): Update accordingly.
	(match_imm_index_operand): New function.
	(match_reg_index_operand): New function.
	(match_operand): Handle cases for OP_IMM_INDEX and OP_REG_INDEX.
	(md_convert_frag): Convert bz.b/h/w/d, bnz.b/h/w/d, bz.v bnz.v.
	(md_show_usage): Print -mmsa and -mno-msa.
	* doc/as.texinfo: Document -mmsa and -mno-msa.
	* doc/c-mips.texi: Document -mmsa and -mno-msa.
	Document .set msa and .set nomsa.
2013-10-14 18:50:54 +00:00
Nick Clifton b2e951ec58 * gen-aout.c (main): Fix formatting. Close file.
* emultempl/aix.em (_read_file): Close file at end of function.

	* gas/all/itbl-test.c (main): Close fas.

	* read.c (add_include_dir): Use xrealloc.
	* config/tc-score.c (do_macro_bcmp): Initialise inst_main.
	* config/tc-tic6x.c (tic6x_parse_operand): Initialise second_reg.

	* readelf.c (decode_arm_unwind): Initialise addr structure.
	(process_symbol_table): Free lengths.
	* srcconv.c (wr_sc): Free info.

	* chew.c (perform): Free next.
2013-10-14 09:15:09 +00:00
Sandra Loosemore ae335a4e26 2013-10-13 Sandra Loosemore <sandra@codesourcery.com>
opcodes/
	* nios2-opc.c (nios2_builtin_reg): Use "sstatus" rather than "ba"
	as the primary name of r30.

	gas/
	* config/tc-nios2.c (nios2_consume_arg): Make the "ba" warning
	also test/refer to "sstatus".  Reformat the warning message.

	gas/testsuite/
	* gas/nios2/warn_nobreak.l: Update text of warning messages.
	* gas/nios2/registers.s: Use "sstatus" rather than "ba"
	as the primary name of r30.
	* gas/nios2/registers.d: Likewise.
2013-10-14 00:42:28 +00:00
Sean Keys 0e1c243401 * Removed short_hand field from opcode table and
refactored assembler/disassember accordingly.
     Testsuite checkout OK.
2013-10-11 04:55:42 +00:00
Jan Beulich 47cd3fa7ee gas/
2013-10-10  Jan Beulich <jbeulich@suse.com>

	* tc-i386-intel.c (i386_intel_simplify_register): Suppress base/index
	swapping for bndmk, bndldx, and bndstx.
2013-10-10 12:22:41 +00:00
Nick Clifton b7b2bb1d1c PR gas/16025
* config/tc-epiphany.c (md_convert_frag): Add missing break
	statement.
2013-10-09 16:10:11 +00:00
Nick Clifton 6085f85378 PR gas/16026
* config/tc-mn10200.c (md_convert_frag): Add missing break
	statement.
2013-10-09 15:52:32 +00:00
Jan Beulich cecf14249d gas/
2013-10-08  Jan Beulich <jbeulich@suse.com>

	* tc-i386.c (check_word_reg): Remove misplaced "else".
	(check_long_reg): Restore symmetry with check_word_reg.
2013-10-08 15:21:58 +00:00
Jan Beulich d3bfe16eaf gas/
2013-10-08  Jan Beulich <jbeulich@suse.com>

	* gas/config/tc-arm.c (do_t_push_pop): Honor inst.size_req. Simplify
	LR/PC check.

gas/testsuite/
2013-10-08  Jan Beulich <jbeulich@suse.com>

	* gas/arm/thumb-w-good.s: Add PUSH.W and POP.W tests.
	* gas/arm/thumb-w-good.d: Update accordingly.
2013-10-08 08:55:41 +00:00
Nick Clifton 38d7754573 * config/tc-msp430.c (msp430_operands): Accept "<foo>.a" as an alias
for "<foo>a".  Issue error messages for unrecognised or corrrupt
	size extensions.

	* gas/msp430/bad.s: New test: Checks erroneous size extensions.
	* gas/msp430/bad.d: New test command file.
	* gas/msp430/bad.l: New file: Expected error messages.
	* gas/msp430/msp430.exp: Run the new test.
	* gas/msp430/msp430x.s: Add "<foo>.a" aliases of "<foo>a"
	instructions.
	* gas/msp430/msp430x.d: Update expected disassembly.
2013-10-08 08:06:35 +00:00
Kyrylo Tkachov fe8b4cc358 [gas/]
2013-10-04  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	* config/tc-arm.c (do_t_mvn_tst): Use narrow form for tst when
	possible.


[gas/testsuite/]
2013-10-04  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	* gas/arm/thumb2_it.s: Add test for narrow tst.
	* gas/arm/thumb2_it.d: Update expected output.
	* gas/arm/thumb2_it_auto.d: Likewise.
2013-10-04 15:26:18 +00:00
Saravanan Ekanathan c7b0bd56ce Add AMD bdver4 support.
gas/
	* config/tc-i386.c (cpu_arch): Add CPU_BDVER4_FLAGS.
	* doc/c-i386.texi: Add -march=bdver4 option.

gas/testsuite/
	* gas/i386/i386.exp: Run bdver4 test cases.
	* gas/i386/nops-1-bdver4.d: New.
	* gas/i386/arch-10-bdver4.d: New.
	* gas/i386/x86-64-nops-1-bdver4.d: New.
	* gas/i386/x86-64-arch-2-bdver4.d: New.

opcodes/
	* i386-gen.c (cpu_flag_init): Add CPU_BDVER4_FLAGS.
	* i386-init.h: Regenerated.
2013-09-30 17:02:07 +00:00
Alan Modra cc9afea3e4 * libtool.m4 (_LT_ENABLE_LOCK <ld -m flags>): Remove non-canonical
ppc host match.  Support little-endian powerpc linux hosts.
Regenerate binutils configure files.
2013-09-20 09:51:25 +00:00
Tristan Gingold 58ca03a25d binutils/
2013-09-18  Tristan Gingold  <gingold@adacore.com>

	* NEWS: Add marker for 2.24.

gas/
2013-09-18  Tristan Gingold  <gingold@adacore.com>

	* NEWS: Add marker for 2.24.

ld/
2013-09-18  Tristan Gingold  <gingold@adacore.com>

	* NEWS: Add marker for 2.24.
2013-09-18 10:39:38 +00:00
Nick Clifton ab90591541 * config/tc-msp430.c (OPTION_MOVE_DATA): Define.
(move_data): New variable.
	(md_parse_option): Parse -md.
	(msp430_section): New function.  Catch references to the .bss or
	.data sections and generate a special symbol for use by the libcrt
	library.
	(md_pseudo_table): Intercept .section directives.
	(md_longopt): Add -md
	(md_show_usage): Likewise.
	(msp430_operands): Generate a warning message if a NOP is inserted
	into the instruction stream.
	* doc/c-msp430.texi (node MSP430 Options): Document -md option.
2013-09-18 07:50:34 +00:00
Steve Ellcey f1c38003e7 2013-09-17 Doug Gilmore <Doug.Gilmore@imgtec.com>
* config/tc-mips.c (mips_elf_final_processing): Set
	EF_MIPS_FP64 for -mgp32 -mfp64, removing old FIXME.
2013-09-17 21:08:30 +00:00
Will Newton 1d50d57ca2 gas/config/tc-arm.c: Fix parsing of NEON load/store element sizes.
The existing code would accept VLD2.64 and similar undefined
instructions.

gas/ChangeLog:

2013-09-16  Will Newton  <will.newton@linaro.org>

	* config/tc-arm.c (do_neon_ld_st_interleave): Add constraint
	disallowing element size 64 with interleave other than 1.

gas/testsuite/ChangeLog:

2013-09-16  Will Newton  <will.newton@linaro.org>

	* gas/arm/neon-ldst-es.d: Add VLD1.64 instructions.
	* gas/arm/neon-ldst-es.s: Likewise.
	* testsuite/gas/arm/neon-ldst-es-bad.d: New file.
	* testsuite/gas/arm/neon-ldst-es-bad.l: Likewise.
	* testsuite/gas/arm/neon-ldst-es-bad.s: Likewise.
2013-09-16 09:34:30 +00:00
Chao-ying Fu 173d34478a 2013-09-12 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
* config/tc-mips.c (match_insn): Set error when $31 is used for
	bltzal* and bgezal*.
2013-09-12 21:41:09 +00:00
Tristan Gingold ac21e7da5d gas/
* config/tc-ppc.c (md_apply_fix): Handle defined after use toc
	symbols.

gas/testsuite/
	* gas/ppc/aix.exp: Run xcoff-toc-1 test.
	* gas/ppc/xcoff-toc-1.s, gas/ppc/xcoff-toc-1.d: New test.
2013-09-04 12:28:11 +00:00
Nick Clifton 74db7efbe3 PR gas/15914
* config/tc-arm.c (T16_32_TAB): Add _udf.
	(do_t_udf): New function.
	(insns): Add "udf".

	* gas/arm/udf-bad.s: New file.
	* gas/arm/udf-bad.d: New file.
	* gas/arm/udf-bad.l: New file.
	* gas/arm/udf.s: New file.
	* gas/arm/udf.d: New file.
	* gas/arm/udf.l: New file.

	* arm-dis.c (arm_opcodes): Add udf.
	(thumb_opcodes): Use "udf" mnemonic rather than UNDEFINED_INSTRUCTION.
	(thumb32_opcodes): Add udf.w.
	(print_insn_thumb32): Handle %H as the thumb32_opcodes comment says.
2013-09-04 07:59:33 +00:00
DJ Delorie 664a88c6c2 * config/rx-parse.y: Rearrange the components of a bison grammar to issue
assembler errors at correct position.
2013-08-23 21:29:27 +00:00
Nick Clifton 9aff4b7ac1 PR binutils/15834
Fix typos:
---
 bfd/bfdio.c                                  |  2 +-
 bfd/elf32-spu.c                              |  2 +-
 bfd/elfnn-aarch64.c                          |  2 +-
 binutils/od-xcoff.c                          |  2 +-
 config/tcl.m4                                |  2 +-
 gas/config/tc-ia64.c                         |  2 +-
 gas/config/tc-sparc.c                        |  2 +-
 gas/config/tc-z80.c                          | 12 ++++++------
 gas/doc/c-i386.texi                          |  6 +++---
 gas/doc/c-m32r.texi                          |  2 +-
 gas/testsuite/gas/d10v/instruction_packing.d |  2 +-
 gas/testsuite/gas/z80/atend.d                |  2 +-
 gold/object.h                                |  2 +-
 include/gdb/remote-sim.h                     |  2 +-
 include/opcode/ChangeLog                     |  2 +-
 include/opcode/i960.h                        |  2 +-
 ld/testsuite/ld-mips-elf/mips16-pic-1.inc    |  2 +-
 opcodes/aarch64-asm.c                        |  2 +-
 opcodes/aarch64-dis.c                        |  2 +-
 opcodes/msp430-dis.c                         |  2 +-
2013-08-23 07:54:19 +00:00
Will Newton 4f2374c7fa gas/config/tc-arm.c: Improve validation of NEON addressing modes.
NEON vector load and store instructions do not accept immediates
or pre-indexed base plus offset addressing modes, so make sure that
the assembler enforces this.

gas/ChangeLog:

2013-08-23  Will Newton  <will.newton@linaro.org>

	* config/tc-arm.c (do_neon_ldx_stx): Add extra constraints
	for pre-indexed addressing modes.
	* testsuite/gas/arm/neon-addressing-bad.l: Add test for
	VLDn and VSTn instructions.
	* testsuite/gas/arm/neon-addressing-bad.s: Likewise.

gas/testsuite/ChangeLog:

2013-08-23  Will Newton  <will.newton@linaro.org>

	* testsuite/gas/arm/neon-addressing-bad.l: Add test for
	VLDn and VSTn instructions.
	* testsuite/gas/arm/neon-addressing-bad.s: Likewise.
2013-08-23 07:16:56 +00:00
Alan Modra b4e6cb8052 * symbols.c (fb_label_instance_inc, fb_label_instance): Properly
range check label number for use with fb_low_counter array.
2013-08-21 05:55:13 +00:00
Richard Sandiford 1661c76c19 gas/
* config/tc-mips.c (mips_check_isa_supports_ase, reg_lookup)
	(mips_parse_argument_token, validate_micromips_insn, md_begin)
	(check_regno, match_float_constant, check_completed_insn, append_insn)
	(match_insn, match_mips16_insn, match_insns, macro_start)
	(macro_build_ldst_constoffset, load_register, macro, mips_ip)
	(mips16_ip, mips_set_option_string, md_parse_option)
	(mips_after_parse_args, mips_after_parse_args, md_pcrel_from)
	(md_apply_fix, s_align, s_option, s_mipsset, s_tls_rel_directive)
	(s_gpword, s_gpdword, s_ehword, s_nan, tc_gen_reloc, md_convert_frag)
	(s_mips_end, s_mips_ent, s_mips_frame, s_mips_mask, mips_parse_cpu):
	Start error messages with a lower-case letter.  Do not end error
	messages with a period.  Wrap long messages to 80 character-lines.
	Use "cannot" instead of "can't" and "can not".

gas/testsuite/
	* gas/mips/ase-errors-1.l, gas/mips/ase-errors-2.l,
	gas/mips/ase-errors-3.l, gas/mips/ase-errors-4.l, gas/mips/at-2.l,
	gas/mips/baddata1.l, gas/mips/elf-rel30.l, gas/mips/illegal.l,
	gas/mips/jalr.l, gas/mips/ldstla-32-1.l, gas/mips/ldstla-32-mips3-1.l,
	gas/mips/lui-1.l, gas/mips/macro-warn-1.l, gas/mips/macro-warn-1-n32.l,
	gas/mips/macro-warn-2.l, gas/mips/macro-warn-3.l,
	gas/mips/macro-warn-4.l, gas/mips/micromips-branch-delay.l,
	gas/mips/micromips-branch-relax.l,
	gas/mips/micromips-branch-relax-pic.l, gas/mips/micromips-ill.l,
	gas/mips/micromips.l, gas/mips/micromips-size-0.l,
	gas/mips/micromips-size-1.l, gas/mips/micromips-warn-branch-delay.l,
	gas/mips/micromips-warn.l, gas/mips/mips16e-64.l,
	gas/mips/mips16e-save-err.l, gas/mips/mips1-fp.l,
	gas/mips/mips32r2-fp32.l, gas/mips/mips32r2-ill.l,
	gas/mips/mips32-sf32.l, gas/mips/mips4-branch-likely.l,
	gas/mips/mips4-fp.l, gas/mips/mips5-fp.l, gas/mips/mips64-mips3d.l,
	gas/mips/mips-double-float-flag.l, gas/mips/mips-gp64-fp32.l,
	gas/mips/mips-gp64-fp64.l, gas/mips/mips-hard-float-flag.l,
	gas/mips/mips-macro-ill-nofp.l, gas/mips/mips-macro-ill-sfp.l,
	gas/mips/nan-error-1.l, gas/mips/nan-error-2.l, gas/mips/noat-2.l,
	gas/mips/noat-3.l, gas/mips/noat-4.l, gas/mips/noat-5.l,
	gas/mips/noat-6.l, gas/mips/noat-7.l, gas/mips/octeon-ill.l,
	gas/mips/r5900-error-vu0.l, gas/mips/r5900-nollsc.l,
	gas/mips/relax-bc1any.l, gas/mips/relax-bposge.l, gas/mips/relax.l,
	gas/mips/relax-swap1.l, gas/mips/relax-swap2.l, gas/mips/set-arch.l,
	gas/mips/tls-ill.l, gas/mips/vr5400-ill.l: Adjust expected output.
2013-08-19 20:07:10 +00:00
Richard Sandiford b0e6f033d5 gas/
* config/tc-mips.c (imm_expr): Expand comment.
	(set_at, macro, mips16_macro): Expect imm_expr to be O_constant
	when populated.
2013-08-19 19:58:47 +00:00
Richard Sandiford e423441da4 include/opcode/
* mips.h: Remove references to "+I" and imm2_expr.

gas/
	* config/tc-mips.c (imm2_expr): Delete.
	(md_assemble, match_insn, imm2_expr.X_op, mips_ip): Update accordingly.
2013-08-19 19:56:44 +00:00
Richard Sandiford 5e0dc5bae9 include/opcode/
* mips.h (M_DEXT, M_DINS): Delete.

opcodes/
	* micromips-opc.c (micromips_opcodes): Replace "dext" and "dins"
	macro entries with "dextm", "dextu", "dinsm" and "dinsu" aliases.
	Use +H rather than +C for the real "dext".
	* mips-opc.c (mips_builtin_opcodes): Likewise.

gas/
	* config/tc-mips.c (report_bad_range, report_bad_field): Delete.
	(macro): Remove M_DEXT and M_DINS handling.

gas/testsuite/
	* gas/mips/ext-ill.l, gas/mips/mips64r2-ill.l: Expect DEXT and DINS
	error messages to have the same form as the EXT and INS ones.
	* gas/mips/micromips-insn32.d, gas/mips/micromips-noinsn32.d,
	gas/mips/micromips-trap.d, gas/mips/micromips.d,
	gas/mips/micromips@mips64r2.d, gas/mips/mips64r2.d: Expect
	"dext" and "dins" instead of "dextm", "dextu", "dinsm" and "dinsu".
2013-08-19 19:54:41 +00:00
Richard Sandiford 60f20e8ba8 gas/
* config/tc-mips.c (mips_arg_info): Replace allow_nonconst and
	lax_max with lax_match.
	(match_int_operand): Update accordingly.  Don't report an error
	for !lax_match-only cases.
	(match_insn): Replace more_alts with lax_match and use it to
	initialize the mips_arg_info field.  Add a complete_p parameter.
	Handle implicit VU0 suffixes here.
	(match_invalid_for_isa, match_insns, match_mips16_insns): New
	functions.
	(mips_ip, mips16_ip): Use them.
2013-08-19 19:42:50 +00:00
Richard Sandiford d436c1c2e8 gas/
* config/tc-mips.c (match_expression):  Report uses of registers here.
	Add a "must be an immediate expression" error.  Handle elided offsets
	here rather than...
	(match_int_operand): ...here.

gas/testsuite/
	* gas/mips/octeon-ill.l: Adjust expected output.
	* gas/mips/lui-1.l, gas/mips/lui-1.s: Add more cases.
2013-08-19 19:30:37 +00:00
Richard Sandiford 1a00e61226 gas/
* config/tc-mips.c (mips_arg_info): Remove soft_match.
	(match_out_of_range, match_not_constant): New functions.
	(match_const_int): Remove fallback parameter and check for soft_match.
	Use match_not_constant.
	(match_mapped_int_operand, match_addiusp_operand)
	(match_perf_reg_operand, match_save_restore_list_operand)
	(match_mdmx_imm_reg_operand): Update accordingly.  Use
	match_out_of_range and set_insn_error* instead of as_bad.
	(match_int_operand): Likewise.  Use match_not_constant in the
	!allows_nonconst case.
	(match_float_constant): Report invalid float constants.
	(match_insn, match_mips16_insn): Remove soft_match code.  Rely on
	match_float_constant to check for invalid constants.  Fail the
	match if match_const_int or match_float_constant return false.
	(mips_ip): Update accordingly.
	(mips16_ip): Likewise.  Undo null termination of instruction name
	once lookup is complete.

gas/testsuite/
	* gas/mips/ext-ill.l, gas/mips/lui-1.l, gas/mips/mips16e-64.l,
	gas/mips/mips32r2-ill-fp64.l, gas/mips/mips32r2-ill-nofp.l,
	gas/mips/mips32r2-ill.l, gas/mips/mips64r2-ill.l,
	gas/mips/octeon-ill.l, gas/mips/r5900-error-vu0.l,
	gas/mips/vr5400-ill.l: Adjust expected errors.
	* gas/mips/micromips-size-0.l,
	gas/mips/micromips-size-0.s: Likewise.  Add new tests.
	* gas/mips/mips16e-save-err.s, gas/mips/mips16e-save-err.l: New test.
	* gas/mips/mips.exp: Run it.
2013-08-19 19:26:11 +00:00
Richard Sandiford e3de51ce11 gas/
* config/tc-mips.c (mips_insn_error_format): New enum.
	(mips_insn_error): New struct.
	(insn_error): Change to a mips_insn_error.
	(clear_insn_error, set_insn_error_format, set_insn_error)
	(set_insn_error_i, set_insn_error_ss, report_insn_error): New
	functions.
	(mips_parse_argument_token, md_assemble, match_insn)
	(match_mips16_insn): Use them instead of manipulating insn_error
	directly.
	(mips_ip, mips16_ip): Likewise.  Simplify control flow.

gas/testsuite/
	* gas/mips/micromips-ill.l: Expect "floating-point expression required"
2013-08-19 19:09:01 +00:00
Richard Sandiford 97d874919c gas/
* config/tc-mips.c (normalize_constant_expr): Move further up file.
	(normalize_address_expr): Likewise.
	(match_insn, match_mips16_insn): New functions, split out from...
	(mips_ip, mips16_ip): ...here.
2013-08-19 19:00:32 +00:00
Richard Sandiford 0f35dbc4d9 include/opcode/
* mips.h (OP_OPTIONAL_REG): New mips_operand_type.
	(mips_optional_operand_p): New function.

opcodes/
	* mips-formats.h (OPTIONAL_REG, OPTIONAL_MAPPED_REG): New macros.
	* micromips-opc.c (decode_micromips_operand): Use OPTIONAL_REG
	and OPTIONAL_MAPPED_REG.
	* mips-opc.c (decode_mips_operand): Likewise.
	* mips16-opc.c (decode_mips16_operand): Likewise.
	* mips-dis.c (print_insn_arg): Handle OP_OPTIONAL_REG.

gas/
	* config/tc-mips.c (operand_reg_mask, match_operand): Handle
	OP_OPTIONAL_REG.
	(mips_ip, mips16_ip): Use mips_optional_operand_p to check
	for optional operands.
2013-08-19 18:57:00 +00:00
Alan Modra 27285eedbd * config/tc-ppc.c (ppc_elf_cons): Allow @l and other reloc
modifiers generally.
2013-08-16 12:59:32 +00:00
Alan Modra cbe02d4f39 * config/tc-ppc.c (ppc_elf_lcomm): Use subsection 1. 2013-08-16 12:34:46 +00:00
David Edelsohn 3c02c47f97 * config/tc-ppc.c (ppc_comm): Accept optional fourth .lcomm
argument as alignment.
2013-08-14 20:52:55 +00:00
Nick Clifton 4046d87a36 * elf32-rl78.c (rl78_elf_merge_private_bfd_data): Complain if G10
flag bits do not match.
	(rl78_elf_print_private_bfd_data): Describe G10 flag.

	* readelf.c (get_machine_flags): Handle RL78 G10 flag.

	* config/tc-rl78.c (elf_flags): New variable.
	(enum options): Add OPTION_G10.
	(md_longopts): Add mg10.
	(md_parse_option): Parse -mg10.
	(rl78_elf_final_processing): New function.
	* config/tc-rl78.c (tc_final_processing): Define.
	* doc/c-rl78.texi: Document -mg10 option.

	* rl78.c (E_FLAG_RL78_G10): Define.

	* lib/ld-lib.exp (check_shared_lib_support): Note that the RL78
	does not support shared library generation.
2013-08-09 10:40:04 +00:00
Richard Sandiford ee5734f078 opcodes/
2013-08-06  Jürgen Urban  <JuergenUrban@gmx.de>

	* mips-opc.c (mips_builtin_opcodes): Add a suffixless version of
	VCLIPW.

gas/
2013-08-06  Jürgen Urban  <JuergenUrban@gmx.de>

	* config/tc-mips.c (match_vu0_suffix_operand): Allow single-channel
	suffixes to be elided too.
	(mips_lookup_insn): Don't reject INSN2_VU0_CHANNEL_SUFFIX here.
	(mips_ip): Assume .xyzw if no VU0 suffix is specified.  Allow +N
	to be omitted too.

gas/testsuite/
2013-08-06  Jürgen Urban  <JuergenUrban@gmx.de>

	* gas/mips/r5900-error-vu0.s, gas/mips/r5900-error-vu0.l,
	gas/mips/r5900-full-vu0.s, gas/mips/r5900-full-vu0.d: Allow
	single-channel suffixes to be elided.
2013-08-06 19:27:07 +00:00
Richard Sandiford 138964030f bfd/
2013-08-05  John Tytgat  <john@bass-software.com>

	* po/BLD-POTFILES.in: Regenerate.
	* po/SRC-POTFILES.in: Likewise.

gas/
2013-08-05  John Tytgat  <john@bass-software.com>

	* po/POTFILES.in: Regenerate.

gprof/
2013-08-05  John Tytgat  <john@bass-software.com>

	* po/POTFILES.in: Regenerate.
2013-08-05 21:58:23 +00:00
Eric Botcazou d6787ef95c gas/
* config/tc-sparc.c (sparc_arch_types): Add leon.
	(sparc_arch): Move sparc4 around and add leon.
	(sparc_target_format): Document -Aleon.
	* doc/c-sparc.texi: Likewise.
include/
	* opcode/sparc.h (sparc_opcode_arch_val): Add SPARC_OPCODE_ARCH_LEON.
opcodes/
	* sparc-dis.c (compute_arch_mask): Set SPARC_OPCODE_ARCH_LEON bit for
	bfd_mach_sparc.
	* sparc-opc.c (MASK_LEON): Define.
	(v6, v6notlet, v7, v8, v6notv9): Add MASK_LEON.
	(letandleon): New macro.
	(v9andleon): Likewise.
	(sparc_opc): Add leon.
	(umac): Enable for letandleon.
	(smac): Likewise.
	(casa): Enable for v9andleon.
	(cas): Likewise.
	(casl): Likewise.
2013-08-05 16:11:07 +00:00
Richard Sandiford da8bca9157 gas/
* config/tc-mips.c (mips_lookup_insn): Make length and opend signed.
2013-08-05 08:31:48 +00:00
Richard Sandiford 14daeee3ae include/opcode/
2013-08-04  Jürgen Urban  <JuergenUrban@gmx.de>
	    Richard Sandiford  <rdsandiford@googlemail.com>

	* mips.h: Document new VU0 operand characters.
	(OP_VU0_SUFFIX, OP_VU0_MATCH_SUFFIX): New mips_operand_types.
	(OP_REG_VF, OP_REG_VI, OP_REG_R5900_I, OP_REG_R5900_Q, OP_REG_R5900_R)
	(OP_REG_R5900_ACC): New mips_reg_operand_types.
	(INSN2_VU0_CHANNEL_SUFFIX): New macro.
	(mips_vu0_channel_mask): Declare.

opcodes/
2013-08-04  Jürgen Urban  <JuergenUrban@gmx.de>
	    Richard Sandiford  <rdsandiford@googlemail.com>

	* mips-dis.c (print_reg): Handle OP_REG_VI, OP_REG_VF, OP_REG_R5900_I,
	OP_REG_R5900_Q, OP_REG_R5900_R and OP_REG_R5900_ACC.
	(print_vu0_channel): New function.
	(print_insn_arg): Handle OP_VU0_SUFFIX and OP_VU0_MATCH_SUFFIX.
	(print_insn_args): Handle '#'.
	(print_insn_mips): Handle INSN2_VU0_CHANNEL_SUFFIX.
	* mips-opc.c (mips_vu0_channel_mask): New constant.
	(decode_mips_operand): Handle new VU0 operand types.
	(VU0, VU0CH): New macros.
	(mips_builtin_opcodes): Add VU0 opcodes.  Use "+7" rather than "E"
	for LQC2 and SQC2.  Use "+9" rather than "G" for EE CFC2 and CTC2.
	Use "+6" rather than "G" for QMFC2 and QMTC2.

gas/
2013-08-04  Jürgen Urban  <JuergenUrban@gmx.de>
	    Richard Sandiford  <rdsandiford@googlemail.com>

	* config/tc-mips.c (MAX_OPERANDS): Bump to 6.
	(RWARN): Bump to 0x8000000.
	(RTYPE_VI, RTYPE_VF, RTYPE_R5900_I, RTYPE_R5900_Q, RTYPE_R5900_R)
	(RTYPE_R5900_ACC): New register types.
	(RTYPE_MASK): Include them.
	(R5900_I_NAMES, R5900_Q_NAMES, R5900_R_NAMES, R5900_ACC_NAMES): New
	macros.
	(reg_names): Include them.
	(mips_parse_register_1): New function, split out from...
	(mips_parse_register): ...here.  Add a channels_ptr parameter.
	Look for VU0 channel suffixes when nonnull.
	(reg_lookup): Update the call to mips_parse_register.
	(mips_parse_vu0_channels): New function.
	(OT_CHANNELS, OT_DOUBLE_CHAR): New mips_operand_token_types.
	(mips_operand_token): Add a "channels" field to the union.
	Extend the comment above "ch" to OT_DOUBLE_CHAR.
	(mips_parse_base_start): Match -- and ++.  Handle channel suffixes.
	(mips_parse_argument_token): Handle channel suffixes here too.
	(validate_mips_insn): Handle INSN2_VU0_CHANNEL_SUFFIX.
	Ignore OP_VU0_MATCH_SUFFIX when calculating the used bits.
	Handle '#' formats.
	(md_begin): Register $vfN and $vfI registers.
	(operand_reg_mask): Handle OP_VU0_SUFFIX and OP_VU0_MATCH_SUFFIX.
	(convert_reg_type): Handle OP_REG_VI, OP_REG_VF, OP_REG_R5900_I,
	OP_REG_R5900_Q, OP_REG_R5900_R and OP_REG_R5900_ACC.
	(match_vu0_suffix_operand): New function.
	(match_operand): Handle OP_VU0_SUFFIX and OP_VU0_MATCH_SUFFIX.
	(macro): Use "+7" rather than "E" for LDQ2 and STQ2.
	(mips_lookup_insn): New function.
	(mips_ip): Use it.  Allow "+K" operands to be elided at the end
	of an instruction.  Handle '#' sequences.

gas/testsuite/
2013-08-04  Jürgen Urban  <JuergenUrban@gmx.de>

	* gas/mips/r5900-vu0.d: Expect $vfN and $viN instead of numeric
	coprocessor registers.
	* gas/mips/r5900-all-vu0.s, gas/mips/r5900-all-vu0.d,
	gas/mips/r5900-full-vu0.s, gas/mips/r5900-full-vu0.d,
	gas/mips/r5900-error-vu0.s, gas/mips/r5900-error-vu0.l: New tests.
	* gas/mips/mips.exp: Run them.
2013-08-04 07:31:39 +00:00
Richard Sandiford c0ebe87429 gas/
* config/tc-mips.c (macro, mips16_macro): Create an array of operand
	values and use it instead of sreg, treg, xreg, etc.
2013-08-03 11:11:46 +00:00
Richard Sandiford 3ccad066ac include/opcode/
* mips.h (mips_pcrel_operand): Inherit from mips_int_operand.
	(mips_int_operand_min, mips_int_operand_max): New functions.
	(mips_decode_pcrel_operand): Use mips_decode_int_operand.

opcodes/
	* mips-formats.h (PCREL): Reorder parameters and update the definition
	to match new mips_pcrel_operand layout.
	(JUMP, JALX, BRANCH): Update accordingly.
	* mips16-opc.c (decode_mips16_operand): Likewise.

gas/
	* config/tc-mips.c (match_int_operand): Use mips_int_operand_min
	and mips_int_operand_max.
	(mips16_immed_operand, mips16_immed_operands, MIPS16_NUM_IMMED):
	Delete.
	(mips16_immed_operand, mips16_immed_in_range_p): New functions.
	(mips16_immed, mips16_extended_frag): Use them.  Use mips_int_operand
	instead of mips16_immed_operand.
2013-08-03 10:49:48 +00:00
Richard Sandiford 0acfaea6cd gas/
* config/tc-mips.c (mips16_macro): Don't use move_register.
	(mips16_ip): Allow macros to use 'p'.

gas/testsuite/
	* gas/mips/mips16-macro.s, gas/mips/mips16-macro.d: New test.
	* gas/mips/mips.exp: Run it.
2013-08-03 10:41:13 +00:00
Richard Sandiford fc76e73056 include/opcode/
* mips.h (mips_decode_reg_operand): New function.
	(INSN_WRITE_SHIFT, INSN_WRITE_1, INSN_WRITE_2, INSN_WRITE_ALL)
	(INSN_READ_SHIFT, INSN_READ_1, INSN_READ_2, INSN_READ_3, INSN_READ_4)
	(INSN_READ_ALL, INSN_READ_GPR_24, INSN_WRITE_GPR_24, INSN_UDI):
	New macros.
	(INSN_WRITE_GPR_D, INSN_WRITE_GPR_T, INSN_WRITE_FPR_D)
	(INSN_WRITE_FPR_S, INSN_WRITE_FPR_T, INSN_READ_GPR_S, INSN_READ_GPR_T)
	(INSN_READ_FPR_S, INSN_READ_FPR_T, INSN_READ_FPR_R, INSN_WRITE_GPR_S)
	(INSN2_WRITE_GPR_Z, INSN2_WRITE_FPR_Z, INSN2_READ_GPR_Z)
	(INSN2_READ_FPR_Z, INSN2_READ_GPR_D, INSN2_READ_FPR_D)
	(INSN2_WRITE_GPR_MB, INSN2_READ_GPR_MC, INSN2_MOD_GPR_MD)
	(INSN2_READ_GPR_ME, INSN2_MOD_GPR_MF, INSN2_READ_GPR_MG)
	(INSN2_READ_GPR_MJ, INSN2_WRITE_GPR_MJ, INSN2_READ_GPR_MP)
	(INSN2_WRITE_GPR_MP, INSN2_READ_GPR_MQ, INSN2_READ_GP)
	(INSN2_WRITE_GPR_MH, INSN2_READ_GPR_MMN): Delete.  Renumber other
	macros to cover the gaps.
	(INSN2_MOD_SP): Replace with...
	(INSN2_WRITE_SP, INSN2_READ_SP): ...these new macros.
	(MIPS16_INSN_WRITE_X, MIPS16_INSN_WRITE_Y, MIPS16_INSN_WRITE_Z)
	(MIPS16_INSN_WRITE_T, MIPS16_INSN_WRITE_31, MIPS16_INSN_WRITE_GPR_Y)
	(MIPS16_INSN_READ_X, MIPS16_INSN_READ_Y, MIPS16_INSN_READ_Z)
	(MIPS16_INSN_READ_T, MIPS16_INSN_READ_SP, MIPS16_INSN_READ_GPR_X):
	Delete.

opcodes/
	* mips-opc.c (WR_1, WR_2, RD_1, RD_2, RD_3, RD_4, MOD_1, MOD_2, UDI):
	New macros.
	(WR_d, WR_t, WR_D, WR_T, WR_S, RD_s, RD_b, RD_t, RD_S, RD_T, RD_R)
	(WR_z, WR_Z, RD_z, RD_Z, RD_d): Delete.
	(mips_builtin_opcodes): Use the new position-based read-write flags
	instead of field-based ones.  Use UDI for "udi..." instructions.
	* mips16-opc.c (WR_1, WR_2, RD_1, RD_2, RD_3, RD_4, MOD_1, MOD_2):
	New macros.
	(WR_x, WR_y, WR_z, WR_Y, RD_x, RD_y, RD_Z, RD_X): Delete.
	(RD_T, WR_T, WR_31): Redefine using generic INSN_* flags.
	(WR_SP, RD_16): New macros.
	(RD_SP): Redefine as an INSN2_* flag.
	(MOD_SP): Redefine in terms of RD_SP and WR_SP.
	(mips16_opcodes): Use the new position-based read-write flags
	instead of field-based ones.  Use RD_16 for "nop".  Move RD_SP to
	pinfo2 field.
	* micromips-opc.c (WR_1, WR_2, RD_1, RD_2, RD_3, RD_4, MOD_1, MOD_2):
	New macros.
	(WR_mb, RD_mc, RD_md, WR_md, RD_me, RD_mf, WR_mf, RD_mg, WR_mh, RD_mj)
	(WR_mj, RD_ml, RD_mmn, RD_mp, WR_mp, RD_mq, RD_gp, WR_d, WR_t, WR_D)
	(WR_T, WR_S, RD_s, RD_b, RD_t, RD_T, RD_S, RD_R, RD_D): Delete.
	(RD_sp, WR_sp): Redefine to INSN2_READ_SP and INSN2_WRITE_SP.
	(micromips_opcodes): Use the new position-based read-write flags
	instead of field-based ones.
	* mips-dis.c (print_insn_arg): Use mips_decode_reg_operand.
	(print_insn_mips, print_insn_micromips): Use INSN_WRITE_1 instead
	of field-based flags.

gas/
	* config/tc-mips.c (MAX_OPERANDS): New macro.
	(mips_operand_array): New structure.
	(mips_operands, mips16_operands, micromips_operands): New arrays.
	(micromips_to_32_reg_b_map, micromips_to_32_reg_c_map)
	(micromips_to_32_reg_e_map, micromips_to_32_reg_f_map)
	(micromips_to_32_reg_g_map, micromips_to_32_reg_l_map)
	(micromips_to_32_reg_q_map): Delete.
	(insn_operands, insn_opno, insn_extract_operand): New functions.
	(validate_mips_insn): Take a mips_operand_array as argument and
	use it to build up a list of operands.  Extend to handle INSN_MACRO
	and MIPS16.
	(validate_mips16_insn): New function.
	(validate_micromips_insn): Take a mips_operand_array as argument.
	Handle INSN_MACRO.
	(md_begin): Initialize mips_operands, mips16_operands and
	micromips_operands.  Call validate_mips_insn and
	validate_micromips_insn for macro instructions too.
	Call validate_mips16_insn for MIPS16 instructions.
	(insn_read_mask, insn_write_mask, operand_reg_mask, insn_reg_mask):
	New functions.
	(gpr_read_mask, gpr_write_mask, fpr_read_mask, fpr_write_mask): Use
	them.  Handle INSN_UDI.
	(get_append_method): Use gpr_read_mask.
2013-08-01 20:55:25 +00:00
Richard Sandiford 265459441c include/opcode/
* mips.h (MIPS16_INSN_WRITE_SP, MIPS16_INSN_READ_31)
	(MIPS16_INSN_READ_PC, MIPS16_INSN_UNCOND_BRANCH)
	(MIPS16_INSN_COND_BRANCH): Delete.

opcodes/
	* mips16-opc.c (UBR, CBR, RD_31, RD_PC): Redefine as INSN2_* flags.
	(WR_SP): Replace with...
	(MOD_SP): ...this.
	(mips16_opcodes): Update accordingly.
	* mips-dis.c (print_insn_mips16): Likewise.

gas/
	* config/tc-mips.c (compact_branch_p, uncond_branch_p): Use the same
	flags for MIPS16 and non-MIPS16 instructions.
	(gpr_mod_mask): Move the INSN2_MOD_SP case outside the micromips block.
	(gpr_read_mask): Use INSN2_READ_GPR_31 for MIPS16 instructions too.
	(gpr_write_mask): Remove MIPS16_INSN_WRITE_SP handling.
	(can_swap_branch_p, get_append_method): Use the same flags for MIPS16
	and non-MIPS16 instructions.  Fix formatting.
2013-08-01 20:40:24 +00:00
Richard Sandiford 85fcb30faa gas/
* config/tc-mips.c (reg_needs_delay): Move later in file.
	Use gpr_write_mask.
	(insns_between): Use gpr_read_mask instead of EXTRACT_OPERAND.
2013-08-01 20:32:59 +00:00
H.J. Lu 43234a1e14 Add Intel AVX-512 support
binutils/

2013-07-26  Sergey Guriev  <sergey.s.guriev@intel.com>
	    Alexander Ivchenko  <alexander.ivchenko@intel.com>
	    Maxim Kuznetsov  <maxim.kuznetsov@intel.com>
	    Sergey Lega  <sergey.s.lega@intel.com>
	    Anna Tikhonova  <anna.tikhonova@intel.com>
	    Ilya Tocar  <ilya.tocar@intel.com>
	    Andrey Turetskiy  <andrey.turetskiy@intel.com>
	    Ilya Verbin  <ilya.verbin@intel.com>
	    Kirill Yukhin  <kirill.yukhin@intel.com>
	    Michael Zolotukhin  <michael.v.zolotukhin@intel.com>

	* dwarf.c (dwarf_regnames_i386): Add k0-k7 registers and
	numeration in comments.
	(dwarf_regnames_x86_64): Add xmm16-31 and k0-k7 registers to
	dwarf table.

gas/

2013-07-26  Sergey Guriev  <sergey.s.guriev@intel.com>
	    Alexander Ivchenko  <alexander.ivchenko@intel.com>
	    Maxim Kuznetsov  <maxim.kuznetsov@intel.com>
	    Sergey Lega  <sergey.s.lega@intel.com>
	    Anna Tikhonova  <anna.tikhonova@intel.com>
	    Ilya Tocar  <ilya.tocar@intel.com>
	    Andrey Turetskiy  <andrey.turetskiy@intel.com>
	    Ilya Verbin  <ilya.verbin@intel.com>
	    Kirill Yukhin  <kirill.yukhin@intel.com>
	    Michael Zolotukhin  <michael.v.zolotukhin@intel.com>

	* config/tc-i386-intel.c (O_zmmword_ptr): New.
	(i386_types): Add zmmword.
	(i386_intel_simplify_register): Allow regzmm.
	(i386_intel_simplify): Handle zmmwords.
	(i386_intel_operand): Handle RC/SAE, vector operations and
	zmmwords.
	* config/tc-i386.c (ZMMWORD_MNEM_SUFFIX): New.
	(struct RC_Operation): New.
	(struct Mask_Operation): New.
	(struct Broadcast_Operation): New.
	(vex_prefix): Size of bytes increased to 4 to support EVEX
	encoding.
	(enum i386_error): Add new error codes: unsupported_broadcast,
	broadcast_not_on_src_operand, broadcast_needed,
	unsupported_masking, mask_not_on_destination, no_default_mask,
	unsupported_rc_sae, rc_sae_operand_not_last_imm,
	invalid_register_operand, try_vector_disp8.
	(struct _i386_insn): Add new fields vrex, need_vrex, mask,
	rounding, broadcast, memshift.
	(struct RC_name): New.
	(RC_NamesTable): New.
	(evexlig): New.
	(evexwig): New.
	(extra_symbol_chars): Add '{'.
	(cpu_arch): Add AVX512F, AVX512CD, AVX512ER and AVX512PF.
	(i386_operand_type): Add regzmm, regmask and vec_disp8.
	(match_mem_size): Handle zmmwords.
	(operand_type_match): Handle zmm-registers.
	(mode_from_disp_size): Handle vec_disp8.
	(fits_in_vec_disp8): New.
	(md_begin): Handle {} properly.
	(type_names): Add "rZMM", "Mask reg" and "Vector d8".
	(build_vex_prefix): Handle vrex.
	(build_evex_prefix): New.
	(process_immext): Adjust to properly handle EVEX.
	(md_assemble): Add EVEX encoding support.
	(swap_2_operands): Correctly handle operands with masking,
	broadcasting or RC/SAE.
	(check_VecOperands): Support EVEX features.
	(VEX_check_operands): Properly handle 16 upper [xyz]mm registers.
	(match_template): Support regzmm and handle new error codes.
	(process_suffix): Handle zmmwords and zmm-registers.
	(check_byte_reg): Extend to zmm-registers.
	(process_operands): Extend to zmm-registers.
	(build_modrm_byte): Handle EVEX.
	(output_insn): Adjust to properly handle EVEX case.
	(disp_size): Handle vec_disp8.
	(output_disp): Support compressed disp8*N evex feature.
	(output_imm): Handle RC/SAE immediates properly.
	(check_VecOperations): New.
	(i386_immediate): Handle EVEX features.
	(i386_index_check): Handle zmmwords and zmm-registers.
	(RC_SAE_immediate): New.
	(i386_att_operand): Handle EVEX features.
	(parse_real_register): Add a check for ZMM/Mask registers.
	(OPTION_MEVEXLIG): New.
	(OPTION_MEVEXWIG): New.
	(md_longopts): Add mevexlig and mevexwig.
	(md_parse_option): Handle mevexlig and mevexwig options.
	(md_show_usage): Add description for mevexlig and mevexwig.
	* doc/c-i386.texi: Document avx512f/.avx512f, avx512cd/.avx512cd,
	avx512er/.avx512er, avx512pf/.avx512pf, mevexlig and mevexwig.

gas/testsuite/

2013-07-26  Sergey Guriev  <sergey.s.guriev@intel.com>
	    Alexander Ivchenko  <alexander.ivchenko@intel.com>
	    Maxim Kuznetsov  <maxim.kuznetsov@intel.com>
	    Sergey Lega  <sergey.s.lega@intel.com>
	    Anna Tikhonova  <anna.tikhonova@intel.com>
	    Ilya Tocar  <ilya.tocar@intel.com>
	    Andrey Turetskiy  <andrey.turetskiy@intel.com>
	    Ilya Verbin  <ilya.verbin@intel.com>
	    Kirill Yukhin  <kirill.yukhin@intel.com>
	    Michael Zolotukhin  <michael.v.zolotukhin@intel.com>

	* gas/cfi/cfi-i386.s: Add tests for k0-k7.
	* gas/cfi/cfi-i386.d: Change to reflect above mentioned changes.
	* gas/cfi/cfi-x86_64.s: Add tests for xmm16-31, k0-7.
	* gas/cfi/cfi-x86_64.d: Change to reflect above mentioned changes.
	* gas/i386/ilp32/cfi/cfi-x86_64.d: Ditto.
	* gas/i386/intel-regs.s: Add tests for zmm0 and xmm16 registers.
	* gas/i386/intel-regs.d: Change correspondingly.
	* gas/i386/prefetch-intel.d: Reflect implementation of prefetchwt1.
	* gas/i386/prefetch.d: Ditto.
	* gas/i386/x86-64-prefetch-intel.d: Ditto.
	* gas/i386/x86-64-prefetch.d: Ditto.
	* gas/i386/avx512f-intel.d: New.
	* gas/i386/avx512f-nondef.d: New.
	* gas/i386/avx512f-nondef.s: New.
	* gas/i386/avx512f-opts-intel.d: New.
	* gas/i386/avx512f-opts.d: New.
	* gas/i386/avx512f-opts.s: New.
	* gas/i386/avx512f.d: New.
	* gas/i386/avx512f.s: New.
	* gas/i386/avx512cd-intel.d: New.
	* gas/i386/avx512cd.d: New.
	* gas/i386/avx512cd.s: New.
	* gas/i386/avx512er-intel.d: New.
	* gas/i386/avx512er.d: New.
	* gas/i386/avx512er.s: New.
	* gas/i386/avx512pf-intel.d: New.
	* gas/i386/avx512pf.d: New.
	* gas/i386/avx512pf.s: New.
	* gas/i386/evex-lig.s: New.
	* gas/i386/evex-lig256-intel.d: New.
	* gas/i386/evex-lig256.d: New.
	* gas/i386/evex-lig512-intel.d: New.
	* gas/i386/evex-lig512.d: New.
	* gas/i386/evex-wig.s: New.
	* gas/i386/evex-wig1-intel.d: New.
	* gas/i386/evex-wig1.d: New.
	* gas/i386/inval-avx512f.l: New.
	* gas/i386/inval-avx512f.s: New.
	* gas/i386/x86-64-avx512f-intel.d: New.
	* gas/i386/x86-64-avx512f-nondef.d: New.
	* gas/i386/x86-64-avx512f-nondef.s: New.
	* gas/i386/x86-64-avx512f-opts-intel.d: New.
	* gas/i386/x86-64-avx512f-opts.d: New.
	* gas/i386/x86-64-avx512f-opts.s: New.
	* gas/i386/x86-64-avx512f.d: New.
	* gas/i386/x86-64-avx512f.s: New.
	* gas/i386/x86-64-avx512cd-intel.d: New.
	* gas/i386/x86-64-avx512cd.d: New.
	* gas/i386/x86-64-avx512cd.s: New.
	* gas/i386/x86-64-avx512er-intel.d: New.
	* gas/i386/x86-64-avx512er.d: New.
	* gas/i386/x86-64-avx512er.s: New.
	* gas/i386/x86-64-avx512pf-intel.d: New.
	* gas/i386/x86-64-avx512pf.d: New.
	* gas/i386/x86-64-avx512pf.s: New.
	* gas/i386/x86-64-evex-lig.s: New.
	* gas/i386/x86-64-evex-lig256-intel.d: New.
	* gas/i386/x86-64-evex-lig256.d: New.
	* gas/i386/x86-64-evex-lig512-intel.d: New.
	* gas/i386/x86-64-evex-lig512.d: New.
	* gas/i386/x86-64-evex-wig.s: New.
	* gas/i386/x86-64-evex-wig1-intel.d: New.
	* gas/i386/x86-64-evex-wig1.d: New.
	* gas/i386/x86-64-inval-avx512f.l: New.
	* gas/i386/x86-64-inval-avx512f.s: New.
	* gas/i386/i386.exp: Run new AVX-512 tests.

opcodes/

2013-07-26  Sergey Guriev  <sergey.s.guriev@intel.com>
	    Alexander Ivchenko  <alexander.ivchenko@intel.com>
	    Maxim Kuznetsov  <maxim.kuznetsov@intel.com>
	    Sergey Lega  <sergey.s.lega@intel.com>
	    Anna Tikhonova  <anna.tikhonova@intel.com>
	    Ilya Tocar  <ilya.tocar@intel.com>
	    Andrey Turetskiy  <andrey.turetskiy@intel.com>
	    Ilya Verbin  <ilya.verbin@intel.com>
	    Kirill Yukhin  <kirill.yukhin@intel.com>
	    Michael Zolotukhin  <michael.v.zolotukhin@intel.com>

	* i386-dis-evex.h: New.
	* i386-dis.c (OP_Rounding): New.
	(VPCMP_Fixup): New.
	(OP_Mask): New.
	(Rdq): New.
	(XMxmmq): New.
	(EXdScalarS): New.
	(EXymm): New.
	(EXEvexHalfBcstXmmq): New.
	(EXxmm_mdq): New.
	(EXEvexXGscat): New.
	(EXEvexXNoBcst): New.
	(VPCMP): New.
	(EXxEVexR): New.
	(EXxEVexS): New.
	(XMask): New.
	(MaskG): New.
	(MaskE): New.
	(MaskR): New.
	(MaskVex): New.
	(modes enum): Add evex_x_gscat_mode, evex_x_nobcst_mode,
	evex_half_bcst_xmmq_mode, xmm_mdq_mode, ymm_mode,
	evex_rounding_mode, evex_sae_mode, mask_mode.
	(USE_EVEX_TABLE): New.
	(EVEX_TABLE): New.
	(EVEX enum): New.
	(REG enum): Add REG_EVEX_0F72, REG_EVEX_0F73, REG_EVEX_0F38C6,
	REG_EVEX_0F38C7.
	(MOD enum): Add MOD_EVEX_0F10_PREFIX_1, MOD_EVEX_0F10_PREFIX_3,
	MOD_EVEX_0F11_PREFIX_1, MOD_EVEX_0F11_PREFIX_3,
	MOD_EVEX_0F12_PREFIX_0, MOD_EVEX_0F16_PREFIX_0, MOD_EVEX_0F38C6_REG_1,
	MOD_EVEX_0F38C6_REG_2, MOD_EVEX_0F38C6_REG_5, MOD_EVEX_0F38C6_REG_6,
	MOD_EVEX_0F38C7_REG_1, MOD_EVEX_0F38C7_REG_2,  MOD_EVEX_0F38C7_REG_5,
	MOD_EVEX_0F38C7_REG_6.
	(PREFIX enum): Add PREFIX_VEX_0F41, PREFIX_VEX_0F42, PREFIX_VEX_0F44,
	PREFIX_VEX_0F45, PREFIX_VEX_0F46, PREFIX_VEX_0F47, PREFIX_VEX_0F4B,
	PREFIX_VEX_0F90, PREFIX_VEX_0F91, PREFIX_VEX_0F92, PREFIX_VEX_0F93,
	PREFIX_VEX_0F98, PREFIX_VEX_0F3A30, PREFIX_VEX_0F3A32,
	PREFIX_VEX_0F3AF0, PREFIX_EVEX_0F10, PREFIX_EVEX_0F11,
	PREFIX_EVEX_0F12, PREFIX_EVEX_0F13, PREFIX_EVEX_0F14,
	PREFIX_EVEX_0F15, PREFIX_EVEX_0F16, PREFIX_EVEX_0F17,
	PREFIX_EVEX_0F28, PREFIX_EVEX_0F29, PREFIX_EVEX_0F2A,
	PREFIX_EVEX_0F2B, PREFIX_EVEX_0F2C, PREFIX_EVEX_0F2D,
	PREFIX_EVEX_0F2E, PREFIX_EVEX_0F2F, PREFIX_EVEX_0F51,
	PREFIX_EVEX_0F58, PREFIX_EVEX_0F59, PREFIX_EVEX_0F5A,
	PREFIX_EVEX_0F5B, PREFIX_EVEX_0F5C, PREFIX_EVEX_0F5D,
	PREFIX_EVEX_0F5E, PREFIX_EVEX_0F5F, PREFIX_EVEX_0F62,
	PREFIX_EVEX_0F66, PREFIX_EVEX_0F6A, PREFIX_EVEX_0F6C,
	PREFIX_EVEX_0F6D, PREFIX_EVEX_0F6E, PREFIX_EVEX_0F6F,
	PREFIX_EVEX_0F70, PREFIX_EVEX_0F72_REG_0, PREFIX_EVEX_0F72_REG_1,
	PREFIX_EVEX_0F72_REG_2, PREFIX_EVEX_0F72_REG_4,
	PREFIX_EVEX_0F72_REG_6, PREFIX_EVEX_0F73_REG_2,
	PREFIX_EVEX_0F73_REG_6, PREFIX_EVEX_0F76, PREFIX_EVEX_0F78,
	PREFIX_EVEX_0F79, PREFIX_EVEX_0F7A, PREFIX_EVEX_0F7B,
	PREFIX_EVEX_0F7E, PREFIX_EVEX_0F7F, PREFIX_EVEX_0FC2,
	PREFIX_EVEX_0FC6, PREFIX_EVEX_0FD2, PREFIX_EVEX_0FD3,
	PREFIX_EVEX_0FD4, PREFIX_EVEX_0FD6, PREFIX_EVEX_0FDB,
	PREFIX_EVEX_0FDF, PREFIX_EVEX_0FE2, PREFIX_EVEX_0FE6 PREFIX_EVEX_0FE7,
	PREFIX_EVEX_0FEB, PREFIX_EVEX_0FEF, PREFIX_EVEX_0FF2,
	PREFIX_EVEX_0FF3, PREFIX_EVEX_0FF4, PREFIX_EVEX_0FFA, PREFIX_EVEX_0FFB,
	PREFIX_EVEX_0FFE, PREFIX_EVEX_0F380C, PREFIX_EVEX_0F380D,
	PREFIX_EVEX_0F3811, PREFIX_EVEX_0F3812, PREFIX_EVEX_0F3813,
	PREFIX_EVEX_0F3814, PREFIX_EVEX_0F3815, PREFIX_EVEX_0F3816,
	PREFIX_EVEX_0F3818, PREFIX_EVEX_0F3819, PREFIX_EVEX_0F381A,
	PREFIX_EVEX_0F381B, PREFIX_EVEX_0F381E, PREFIX_EVEX_0F381F,
	PREFIX_EVEX_0F3821, PREFIX_EVEX_0F3822, PREFIX_EVEX_0F3823,
	PREFIX_EVEX_0F3824, PREFIX_EVEX_0F3825, PREFIX_EVEX_0F3827,
	PREFIX_EVEX_0F3828, PREFIX_EVEX_0F3829, PREFIX_EVEX_0F382A,
	PREFIX_EVEX_0F382C, PREFIX_EVEX_0F382D, PREFIX_EVEX_0F3831,
	PREFIX_EVEX_0F3832, PREFIX_EVEX_0F3833, PREFIX_EVEX_0F3834,
	PREFIX_EVEX_0F3835, PREFIX_EVEX_0F3836, PREFIX_EVEX_0F3837,
	PREFIX_EVEX_0F3839, PREFIX_EVEX_0F383A, PREFIX_EVEX_0F383B,
	PREFIX_EVEX_0F383D, PREFIX_EVEX_0F383F, PREFIX_EVEX_0F3840,
	PREFIX_EVEX_0F3842, PREFIX_EVEX_0F3843, PREFIX_EVEX_0F3844,
	PREFIX_EVEX_0F3845, PREFIX_EVEX_0F3846, PREFIX_EVEX_0F3847,
	PREFIX_EVEX_0F384C, PREFIX_EVEX_0F384D, PREFIX_EVEX_0F384E,
	PREFIX_EVEX_0F384F, PREFIX_EVEX_0F3858, PREFIX_EVEX_0F3859,
	PREFIX_EVEX_0F385A, PREFIX_EVEX_0F385B, PREFIX_EVEX_0F3864,
	PREFIX_EVEX_0F3865, PREFIX_EVEX_0F3876, PREFIX_EVEX_0F3877,
	PREFIX_EVEX_0F387C, PREFIX_EVEX_0F387E, PREFIX_EVEX_0F387F,
	PREFIX_EVEX_0F3888, PREFIX_EVEX_0F3889, PREFIX_EVEX_0F388A,
	PREFIX_EVEX_0F388B, PREFIX_EVEX_0F3890, PREFIX_EVEX_0F3891,
	PREFIX_EVEX_0F3892, PREFIX_EVEX_0F3893, PREFIX_EVEX_0F3896,
	PREFIX_EVEX_0F3897, PREFIX_EVEX_0F3898, PREFIX_EVEX_0F3899,
	PREFIX_EVEX_0F389A, PREFIX_EVEX_0F389B, PREFIX_EVEX_0F389C,
	PREFIX_EVEX_0F389D, PREFIX_EVEX_0F389E, PREFIX_EVEX_0F389F,
	PREFIX_EVEX_0F38A0, PREFIX_EVEX_0F38A1, PREFIX_EVEX_0F38A2,
	PREFIX_EVEX_0F38A3, PREFIX_EVEX_0F38A6, PREFIX_EVEX_0F38A7,
	PREFIX_EVEX_0F38A8, PREFIX_EVEX_0F38A9, PREFIX_EVEX_0F38AA,
	PREFIX_EVEX_0F38AB, PREFIX_EVEX_0F38AC, PREFIX_EVEX_0F38AD,
	PREFIX_EVEX_0F38AE, PREFIX_EVEX_0F38AF, PREFIX_EVEX_0F38B6,
	PREFIX_EVEX_0F38B7, PREFIX_EVEX_0F38B8, PREFIX_EVEX_0F38B9,
	PREFIX_EVEX_0F38BA, PREFIX_EVEX_0F38BB, PREFIX_EVEX_0F38BC,
	PREFIX_EVEX_0F38BD, PREFIX_EVEX_0F38BE, PREFIX_EVEX_0F38BF,
	PREFIX_EVEX_0F38C4, PREFIX_EVEX_0F38C6_REG_1,
	PREFIX_EVEX_0F38C6_REG_2, PREFIX_EVEX_0F38C6_REG_5,
	PREFIX_EVEX_0F38C6_REG_6, PREFIX_EVEX_0F38C7_REG_1,
	PREFIX_EVEX_0F38C7_REG_2, PREFIX_EVEX_0F38C7_REG_5,
	PREFIX_EVEX_0F38C7_REG_6, PREFIX_EVEX_0F38C8, PREFIX_EVEX_0F38CA,
	PREFIX_EVEX_0F38CB, PREFIX_EVEX_0F38CC, PREFIX_EVEX_0F38CD,
	PREFIX_EVEX_0F3A00,  PREFIX_EVEX_0F3A01, PREFIX_EVEX_0F3A03,
	PREFIX_EVEX_0F3A04, PREFIX_EVEX_0F3A05, PREFIX_EVEX_0F3A08,
	PREFIX_EVEX_0F3A09, PREFIX_EVEX_0F3A0A, PREFIX_EVEX_0F3A0B,
	PREFIX_EVEX_0F3A17, PREFIX_EVEX_0F3A18, PREFIX_EVEX_0F3A19,
	PREFIX_EVEX_0F3A1A, PREFIX_EVEX_0F3A1B, PREFIX_EVEX_0F3A1D,
	PREFIX_EVEX_0F3A1E, PREFIX_EVEX_0F3A1F, PREFIX_EVEX_0F3A21,
	PREFIX_EVEX_0F3A23, PREFIX_EVEX_0F3A25, PREFIX_EVEX_0F3A26,
	PREFIX_EVEX_0F3A27, PREFIX_EVEX_0F3A38, PREFIX_EVEX_0F3A39,
	PREFIX_EVEX_0F3A3A, PREFIX_EVEX_0F3A3B, PREFIX_EVEX_0F3A3E,
	PREFIX_EVEX_0F3A3F, PREFIX_EVEX_0F3A43, PREFIX_EVEX_0F3A54,
	PREFIX_EVEX_0F3A55.
	(VEX_LEN enum): Add VEX_LEN_0F41_P_0, VEX_LEN_0F42_P_0, VEX_LEN_0F44_P_0,
	VEX_LEN_0F45_P_0, VEX_LEN_0F46_P_0, VEX_LEN_0F47_P_0,
	VEX_LEN_0F4B_P_2, VEX_LEN_0F90_P_0, VEX_LEN_0F91_P_0,
	VEX_LEN_0F92_P_0, VEX_LEN_0F93_P_0, VEX_LEN_0F98_P_0,
	VEX_LEN_0F3A30_P_2, VEX_LEN_0F3A32_P_2, VEX_W_0F41_P_0_LEN_1,
	VEX_W_0F42_P_0_LEN_1, VEX_W_0F44_P_0_LEN_0, VEX_W_0F45_P_0_LEN_1,
	VEX_W_0F46_P_0_LEN_1, VEX_W_0F47_P_0_LEN_1, VEX_W_0F4B_P_2_LEN_1,
	VEX_W_0F90_P_0_LEN_0, VEX_W_0F91_P_0_LEN_0, VEX_W_0F92_P_0_LEN_0,
	VEX_W_0F93_P_0_LEN_0, VEX_W_0F98_P_0_LEN_0, VEX_W_0F3A30_P_2_LEN_0,
	VEX_W_0F3A32_P_2_LEN_0.
	(VEX_W enum): Add EVEX_W_0F10_P_0, EVEX_W_0F10_P_1_M_0,
	EVEX_W_0F10_P_1_M_1, EVEX_W_0F10_P_2, EVEX_W_0F10_P_3_M_0,
	EVEX_W_0F10_P_3_M_1, EVEX_W_0F11_P_0, EVEX_W_0F11_P_1_M_0,
	EVEX_W_0F11_P_1_M_1, EVEX_W_0F11_P_2, EVEX_W_0F11_P_3_M_0,
	EVEX_W_0F11_P_3_M_1, EVEX_W_0F12_P_0_M_0, EVEX_W_0F12_P_0_M_1,
	EVEX_W_0F12_P_1, EVEX_W_0F12_P_2, EVEX_W_0F12_P_3, EVEX_W_0F13_P_0,
	EVEX_W_0F13_P_2, EVEX_W_0F14_P_0, EVEX_W_0F14_P_2, EVEX_W_0F15_P_0,
	EVEX_W_0F15_P_2, EVEX_W_0F16_P_0_M_0, EVEX_W_0F16_P_0_M_1,
	EVEX_W_0F16_P_1, EVEX_W_0F16_P_2, EVEX_W_0F17_P_0, EVEX_W_0F17_P_2,
	EVEX_W_0F28_P_0, EVEX_W_0F28_P_2, EVEX_W_0F29_P_0, EVEX_W_0F29_P_2,
	EVEX_W_0F2A_P_1, EVEX_W_0F2A_P_3, EVEX_W_0F2B_P_0, EVEX_W_0F2B_P_2,
	EVEX_W_0F2E_P_0, EVEX_W_0F2E_P_2, EVEX_W_0F2F_P_0, EVEX_W_0F2F_P_2,
	EVEX_W_0F51_P_0, EVEX_W_0F51_P_1, EVEX_W_0F51_P_2, EVEX_W_0F51_P_3,
	EVEX_W_0F58_P_0, EVEX_W_0F58_P_1, EVEX_W_0F58_P_2, EVEX_W_0F58_P_3,
	EVEX_W_0F59_P_0, EVEX_W_0F59_P_1, EVEX_W_0F59_P_2, EVEX_W_0F59_P_3,
	EVEX_W_0F5A_P_0, EVEX_W_0F5A_P_1, EVEX_W_0F5A_P_2, EVEX_W_0F5A_P_3,
	EVEX_W_0F5B_P_0, EVEX_W_0F5B_P_1, EVEX_W_0F5B_P_2, EVEX_W_0F5C_P_0,
	EVEX_W_0F5C_P_1, EVEX_W_0F5C_P_2, EVEX_W_0F5C_P_3, EVEX_W_0F5D_P_0,
	EVEX_W_0F5D_P_1, EVEX_W_0F5D_P_2, EVEX_W_0F5D_P_3, EVEX_W_0F5E_P_0,
	EVEX_W_0F5E_P_1, EVEX_W_0F5E_P_2, EVEX_W_0F5E_P_3, EVEX_W_0F5F_P_0,
	EVEX_W_0F5F_P_1, EVEX_W_0F5F_P_2, EVEX_W_0F5F_P_3, EVEX_W_0F62_P_2,
	EVEX_W_0F66_P_2, EVEX_W_0F6A_P_2, EVEX_W_0F6C_P_2, EVEX_W_0F6D_P_2,
	EVEX_W_0F6E_P_2, EVEX_W_0F6F_P_1, EVEX_W_0F6F_P_2, EVEX_W_0F70_P_2,
	EVEX_W_0F72_R_2_P_2, EVEX_W_0F72_R_6_P_2, EVEX_W_0F73_R_2_P_2,
	EVEX_W_0F73_R_6_P_2, EVEX_W_0F76_P_2, EVEX_W_0F78_P_0,
	EVEX_W_0F79_P_0, EVEX_W_0F7A_P_1, EVEX_W_0F7A_P_3, EVEX_W_0F7B_P_1,
	EVEX_W_0F7B_P_3, EVEX_W_0F7E_P_1, EVEX_W_0F7E_P_2, EVEX_W_0F7F_P_1,
	EVEX_W_0F7F_P_2, EVEX_W_0FC2_P_0, EVEX_W_0FC2_P_1, EVEX_W_0FC2_P_2,
	EVEX_W_0FC2_P_3, EVEX_W_0FC6_P_0, EVEX_W_0FC6_P_2, EVEX_W_0FD2_P_2,
	EVEX_W_0FD3_P_2, EVEX_W_0FD4_P_2, EVEX_W_0FD6_P_2, EVEX_W_0FE6_P_1,
	EVEX_W_0FE6_P_2, EVEX_W_0FE6_P_3, EVEX_W_0FE7_P_2, EVEX_W_0FF2_P_2,
	EVEX_W_0FF3_P_2, EVEX_W_0FF4_P_2, EVEX_W_0FFA_P_2, EVEX_W_0FFB_P_2,
	EVEX_W_0FFE_P_2, EVEX_W_0F380C_P_2, EVEX_W_0F380D_P_2,
	EVEX_W_0F3811_P_1, EVEX_W_0F3812_P_1, EVEX_W_0F3813_P_1,
	EVEX_W_0F3813_P_2, EVEX_W_0F3814_P_1, EVEX_W_0F3815_P_1,
	EVEX_W_0F3818_P_2, EVEX_W_0F3819_P_2, EVEX_W_0F381A_P_2,
	EVEX_W_0F381B_P_2, EVEX_W_0F381E_P_2, EVEX_W_0F381F_P_2,
	EVEX_W_0F3821_P_1, EVEX_W_0F3822_P_1, EVEX_W_0F3823_P_1,
	EVEX_W_0F3824_P_1, EVEX_W_0F3825_P_1, EVEX_W_0F3825_P_2,
	EVEX_W_0F3828_P_2, EVEX_W_0F3829_P_2, EVEX_W_0F382A_P_1,
	EVEX_W_0F382A_P_2, EVEX_W_0F3831_P_1, EVEX_W_0F3832_P_1,
	EVEX_W_0F3833_P_1, EVEX_W_0F3834_P_1, EVEX_W_0F3835_P_1,
	EVEX_W_0F3835_P_2, EVEX_W_0F3837_P_2, EVEX_W_0F383A_P_1,
	EVEX_W_0F3840_P_2, EVEX_W_0F3858_P_2, EVEX_W_0F3859_P_2,
	EVEX_W_0F385A_P_2, EVEX_W_0F385B_P_2, EVEX_W_0F3891_P_2,
	EVEX_W_0F3893_P_2, EVEX_W_0F38A1_P_2, EVEX_W_0F38A3_P_2,
	EVEX_W_0F38C7_R_1_P_2, EVEX_W_0F38C7_R_2_P_2, EVEX_W_0F38C7_R_5_P_2,
	EVEX_W_0F38C7_R_6_P_2, EVEX_W_0F3A00_P_2, EVEX_W_0F3A01_P_2,
	EVEX_W_0F3A04_P_2, EVEX_W_0F3A05_P_2, EVEX_W_0F3A08_P_2,
	EVEX_W_0F3A09_P_2, EVEX_W_0F3A0A_P_2, EVEX_W_0F3A0B_P_2,
	EVEX_W_0F3A18_P_2, EVEX_W_0F3A19_P_2, EVEX_W_0F3A1A_P_2,
	EVEX_W_0F3A1B_P_2, EVEX_W_0F3A1D_P_2, EVEX_W_0F3A21_P_2,
	EVEX_W_0F3A23_P_2, EVEX_W_0F3A38_P_2, EVEX_W_0F3A39_P_2,
	EVEX_W_0F3A3A_P_2, EVEX_W_0F3A3B_P_2, EVEX_W_0F3A43_P_2.
	(struct vex): Add fields evex, r, v, mask_register_specifier,
	zeroing, ll, b.
	(intel_names_xmm): Add upper 16 registers.
	(att_names_xmm): Ditto.
	(intel_names_ymm): Ditto.
	(att_names_ymm): Ditto.
	(names_zmm): New.
	(intel_names_zmm): Ditto.
	(att_names_zmm): Ditto.
	(names_mask): Ditto.
	(intel_names_mask): Ditto.
	(att_names_mask): Ditto.
	(names_rounding): Ditto.
	(names_broadcast): Ditto.
	(x86_64_table): Add escape to evex-table.
	(reg_table): Include reg_table evex-entries from
	i386-dis-evex.h.  Fix prefetchwt1 instruction.
	(prefix_table): Add entries for new instructions.
	(vex_table): Ditto.
	(vex_len_table): Ditto.
	(vex_w_table): Ditto.
	(mod_table): Ditto.
	(get_valid_dis386): Properly handle new instructions.
	(print_insn): Handle zmm and mask registers, print mask operand.
	(intel_operand_size): Support EVEX, new modes and sizes.
	(OP_E_register): Handle new modes.
	(OP_E_memory): Ditto.
	(OP_G): Ditto.
	(OP_XMM): Ditto.
	(OP_EX): Ditto.
	(OP_VEX): Ditto.
	* i386-gen.c (cpu_flag_init): Update CPU_ANY_SSE_FLAGS and
	CPU_ANY_AVX_FLAGS.  Add CPU_AVX512F_FLAGS, CPU_AVX512CD_FLAGS,
	CPU_AVX512ER_FLAGS and CPU_AVX512PF_FLAGS.
	(cpu_flags): Add CpuAVX512F, CpuAVX512CD, CpuAVX512ER,
	CpuAVX512PF and CpuVREX.
	(operand_type_init): Add OPERAND_TYPE_REGZMM,
	OPERAND_TYPE_REGMASK and OPERAND_TYPE_VEC_DISP8.
	(opcode_modifiers): Add EVex, Masking, VecESize, Broadcast,
	StaticRounding, SAE, Disp8MemShift, NoDefMask.
	(operand_types): Add RegZMM, RegMask, Vec_Disp8, Zmmword.
	* i386-init.h: Regenerate.
	* i386-opc.h (CpuAVX512F): New.
	(CpuAVX512CD): New.
	(CpuAVX512ER): New.
	(CpuAVX512PF): New.
	(CpuVREX): New.
	(i386_cpu_flags): Add cpuavx512f, cpuavx512cd, cpuavx512er,
	cpuavx512pf and cpuvrex fields.
	(VecSIB): Add VecSIB512.
	(EVex): New.
	(Masking): New.
	(VecESize): New.
	(Broadcast): New.
	(StaticRounding): New.
	(SAE): New.
	(Disp8MemShift): New.
	(NoDefMask): New.
	(i386_opcode_modifier): Add evex, masking, vecesize, broadcast,
	staticrounding, sae, disp8memshift and nodefmask.
	(RegZMM): New.
	(Zmmword): Ditto.
	(Vec_Disp8): Ditto.
	(i386_operand_type): Add regzmm, regmask, zmmword and vec_disp8
	fields.
	(RegVRex): New.
	* i386-opc.tbl: Add AVX512 instructions.
	* i386-reg.tbl: Add 16 upper XMM and YMM registers, 32 new ZMM
	registers, mask registers.
	* i386-tbl.h: Regenerate.
2013-07-26 17:20:25 +00:00
H.J. Lu a004640857 Support Intel SHA
gas/

2013-07-25  Michael Zolotukhin  <michael.v.zolotukhin@intel.com>

	* config/tc-i386.c (cpu_arch): Add .sha.
	* doc/c-i386.texi: Document sha/.sha.

gas/testsuite/

2013-07-25  Michael Zolotukhin  <michael.v.zolotukhin@intel.com>

	* gas/i386/sha.d: New.
	* gas/i386/sha.s: New.
	* gas/i386/x86-64-sha.d: New.
	* gas/i386/x86-64-sha.s: New.
	* gas/i386/i386.exp: Run new SHA tests.

opcodes/

2013-07-25  Michael Zolotukhin  <michael.v.zolotukhin@intel.com>

	* i386-dis.c (PREFIX enum): Add PREFIX_0F38C8, PREFIX_0F38C9,
	PREFIX_0F38CA, PREFIX_0F38CB, PREFIX_0F38CC, PREFIX_0F38CD,
	PREFIX_0F3ACC.
	(prefix_table): Updated.
	(three_byte_table): Likewise.
	* i386-gen.c (cpu_flag_init): Add CPU_SHA_FLAGS.
	(cpu_flags): Add CpuSHA.
	(i386_cpu_flags): Add cpusha.
	* i386-init.h: Regenerate.
	* i386-opc.h (CpuSHA): New.
	(CpuUnused): Restored.
	(i386_cpu_flags): Add cpusha.
	* i386-opc.tbl: Add SHA instructions.
	* i386-tbl.h: Regenerate.
2013-07-25 16:16:35 +00:00
H.J. Lu 7e8b059be6 Support Intel MPX
gas/

2013-07-24  Anna Tikhonova  <anna.tikhonova@intel.com>
	    Kirill Yukhin  <kirill.yukhin@intel.com>
	    Michael Zolotukhin  <michael.v.zolotukhin@intel.com>

	* config/tc-i386.c (BND_PREFIX): New.
	(struct _i386_insn): Add new field bnd_prefix.
	(add_bnd_prefix): New.
	(cpu_arch): Add MPX.
	(i386_operand_type): Add regbnd.
	(md_assemble): Handle BND prefixes.
	(parse_insn): Likewise.
	(output_branch): Likewise.
	(output_jump): Likewise.
	(build_modrm_byte): Handle regbnd.
	(OPTION_MADD_BND_PREFIX): New.
	(md_longopts): Add entry for 'madd-bnd-prefix'.
	(md_parse_option): Handle madd-bnd-prefix option.
	(md_show_usage): Add description for madd-bnd-prefix
	option.
	* doc/c-i386.texi: Document mpx/.mpx and -madd-bnd-prefix.

gas/testsuite/

2013-07-24  Anna Tikhonova  <anna.tikhonova@intel.com>
	    Kirill Yukhin  <kirill.yukhin@intel.com>
	    Michael Zolotukhin  <michael.v.zolotukhin@intel.com>

	* gas/i386/mpx-add-bnd-prefix.s: New.
	* gas/i386/mpx-add-bnd-prefix.d: New.
	* gas/i386/mpx-inval-1.l: New.
	* gas/i386/mpx-inval-1.s: New.
	* gas/i386/mpx.d: New.
	* gas/i386/mpx.s: New.
	* gas/i386/x86-64-mpx-add-bnd-prefix.d: New.
	* gas/i386/x86-64-mpx-add-bnd-prefix.s: New.
	* gas/i386/x86-64-mpx-addr32.d: New.
	* gas/i386/x86-64-mpx-addr32.s: New.
	* gas/i386/x86-64-mpx-inval-1.l: New.
	* gas/i386/x86-64-mpx-inval-1.s: New.
	* gas/i386/x86-64-mpx-inval-2.l: New.
	* gas/i386/x86-64-mpx-inval-2.s: New.
	* gas/i386/x86-64-mpx.d: New.
	* gas/i386/x86-64-mpx.s: New.
	* gas/i386/nops.d: Adjust to MPX changes.
	* gas/i386/nops.s: Likewise.
	* gas/i386/x86-64-nops.d: Likewise.
	* gas/i386/x86-64-nops.s: Likewise.
	* gas/i386/ilp32/x86-64-nops.d: Likewise.
	* gas/i386/i386.exp: Run new MPX tests.

include/opcode/

2013-07-24  Anna Tikhonova  <anna.tikhonova@intel.com>
	    Kirill Yukhin  <kirill.yukhin@intel.com>
	    Michael Zolotukhin  <michael.v.zolotukhin@intel.com>

	* i386.h (BND_PREFIX_OPCODE): New.

opcodes/

2013-07-24  Anna Tikhonova  <anna.tikhonova@intel.com>
	    Kirill Yukhin  <kirill.yukhin@intel.com>
	    Michael Zolotukhin  <michael.v.zolotukhin@intel.com>

	* i386-dis.c (BND_Fixup): New.
	(Ebnd): New.
	(Ev_bnd): New.
	(Gbnd): New.
	(BND): New.
	(v_bnd_mode): New.
	(bnd_mode): New.
	(MOD enum): Add new entries.
	(PREFIX enum): Likewise.
	(dis tables): Replace XX with BND for near branch and call
	instructions.
	(prefix_table): Add new entries.
	(mod_table): Likewise.
	(names_bnd): New.
	(intel_names_bnd): New.
	(att_names_bnd): New.
	(BND_PREFIX): New.
	(prefix_name): Handle BND_PREFIX.
	(print_insn): Initialize names_bnd.
	(intel_operand_size): Handle new modes.
	(OP_E_register): Likewise.
	(OP_E_memory): Likewise.
	(OP_G): Likewise.
	* i386-gen.c (cpu_flag_init): Add CpuMPX.
	(cpu_flags): Add CpuMPX.
	(operand_type_init): Add RegBND.
	(opcode_modifiers): Add BNDPrefixOk.
	(operand_types): Add RegBND.
	* i386-init.h: Regenerate.
	* i386-opc.h (CpuMPX): New.
	(CpuUnused): Comment out.
	(i386_cpu_flags): Add cpumpx.
	(BNDPrefixOk): New.
	(i386_opcode_modifier): Add bndprefixok.
	(RegBND): New.
	(i386_operand_type): Add regbnd.
	* i386-opc.tbl: Add BNDPrefixOk to near jumps, calls and rets.
	Add MPX instructions and bnd prefix.
	* i386-reg.tbl: Add bnd0-bnd3 registers.
	* i386-tbl.h: Regenerate.
2013-07-24 15:47:25 +00:00
Tristan Gingold 7fa9fcb6db bfd/
2013-07-24  Tristan Gingold  <gingold@adacore.com>

        * coff-rs6000.c (xcoff_howto_table): Fix masks and pc_relative for
        R_RBR.  Add numbers in comments.
        (_bfd_xcoff_reloc_type_lookup): Handle BFD_RELOC_PPC_B16.
        * coff64-rs6000.c: Likewise.

gas/
2013-07-24  Tristan Gingold  <gingold@adacore.com>

        * config/tc-ppc.c (md_apply_fix): Adjust BFD_RELOC_PPC_B16 on
        xcoff targets.

gas/testsuite/
2013-07-24  Tristan Gingold  <gingold@adacore.com>

        * gas/ppc/test2xcoff32.s, gas/ppc/test2xcoff32.d: New files
        * gas/ppc/ppc.exp: Add new test.
        * gas/ppc/xcoff-br16-1.s, gas/ppc/xcoff-br16-1.d,
        gas/ppc/xcoff-br16-2.s, gas/ppc/xcoff-br16-2.d: New files
        * gas/ppc/aix.exp: Add new tests.
2013-07-24 14:12:41 +00:00
Andreas Krebbel 614eb2779c 2013-07-24 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/tc-s390.c (s390_machine): Don't force the .machine
	argument to lower case.
2013-07-24 09:02:45 +00:00
Kyrylo Tkachov e673710a22 2013-07-22 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/tc-arm.c (s_arm_arch_extension): Improve error message
	for invalid extension.
2013-07-22 09:05:04 +00:00
Yufeng Zhang 69091a2cc4 [AArch64, ILP32] Retire -milp32 and -mlp64; use -mabi=ilp32 and -mabi=lp64.
gas/

	* config/tc-aarch64.c (enum aarch64_abi_type): New enumeration tag.
	(AARCH64_ABI_LP64, AARCH64_ABI_ILP32): New enumerators.
	(aarch64_abi): New variable.
	(ilp32_p): Change to be a macro.
	(aarch64_opts): Remove the support for option -milp32 and -mlp64.
	(struct aarch64_option_abi_value_table): New struct.
	(aarch64_abis): New table.
	(aarch64_parse_abi): New function.
	(aarch64_long_opts): Add entry for -mabi=.
	* doc/as.texinfo (Target AArch64 options): Document -mabi.
	* doc/c-aarch64.texi: Likewise.

gas/testsuite/

	* gas/aarch64/ilp32-basic.d (#as): Update to use -mabi=ilp32
2013-07-19 16:25:54 +00:00
Nick Clifton faf786e668 * ar.c (usage): Fix C conformance issue.
* config/tc-i386-intel.c (i386_intel_operand): Fixed signed vs
	unsigned comparison.
2013-07-18 16:12:35 +00:00
Nick Clifton f0c0028234 * config/rx-defs.h: Add macros for RX100, RX200, RX600, and
RX610.
        * config/rx-parse.y: (rx_check_float_support): Add function to
	check floating point operation support for target RX100 and
	RX200.
        * config/tc-rx.c: Add CPU options RX100, RX200, RX600, and RX610.
        * doc/c-rx.texi: Add -mcpu option to recognize macros for RX100,
        RX200, RX600, and RX610
2013-07-18 12:15:15 +00:00
Nick Clifton 8c997c2767 * config/tc-avr.c (md_show_usage): Add avrxmega2 to help text 2013-07-18 11:52:47 +00:00
Nick Clifton 8be59acb82 * config/tc-avr.c: Make ata6289's ISA to AVR_ISA_AVR4.
* doc/c-avr.texi: Likewise.
2013-07-18 11:47:30 +00:00
Richard Sandiford 4a06e5a292 gas/
* config/tc-mips.c (match_save_restore_list_operand): Avoid -Wformat
	error with older GCCs.
	(mips16_macro_build): Dereference args.
2013-07-15 18:36:57 +00:00
Richard Sandiford a92713e60e gas/
* config/tc-mips.c (mips_prefer_vec_regno, mips_parse_register):
	New functions, split out from...
	(reg_lookup): ...here.  Remove itbl support.
	(reglist_lookup): Delete.
	(mips_operand_token_type): New enum.
	(mips_operand_token): New structure.
	(mips_operand_tokens): New variable.
	(mips_add_token, mips_parse_base_start, mips_parse_argument_token)
	(mips_parse_arguments): New functions.
	(md_begin): Initialize mips_operand_tokens.
	(mips_arg_info): Add a token field.  Remove optional_reg field.
	(match_char, match_expression): New functions.
	(match_const_int): Use match_expression.  Remove "s" argument
	and return a boolean result.  Remove O_register handling.
	(match_regno, match_reg, match_reg_range): New functions.
	(match_int_operand, match_mapped_int_operand, match_msb_operand)
	(match_reg_operand, match_reg_pair_operand, match_perf_reg_operand)
	(match_addiusp_operand, match_clo_clz_dest_operand)
	(match_lwm_swm_list_operand, match_entry_exit_operand)
	(match_save_restore_list_operand, match_mdmx_imm_reg_operand)
	(match_tied_reg_operand): Remove "s" argument and return a boolean
	result.  Match tokens rather than text.  Update calls to
	match_const_int.  Rely on match_regno to call check_regno.
	(match_pcrel_operand, match_pc_operand): Replace "s" argument with
	"arg" argument.  Return a boolean result.
	(parse_float_constant): Replace with...
	(match_float_constant): ...this new function.
	(match_operand): Remove "s" argument and return a boolean result.
	Update calls to subfunctions.
	(mips_ip, mips16_ip): Call mips_parse_arguments.  Use match routines
	rather than string-parsing routines.  Update handling of optional
	registers for token scheme.

gas/testsuite/
	* gas/mips/vr5400-ill.s, gas/mips/vr5400-ill.l: Add some more cases.
	* gas/mips/micromips-ill.s, gas/mips/micromips-ill.l: New test.
	* gas/mips/mips.exp: Run it.
2013-07-14 14:16:03 +00:00
Richard Sandiford 89565f1b17 gas/
* config/tc-mips.c (parse_float_constant): Split out from...
	(mips_ip): ...here.
2013-07-14 13:53:47 +00:00
Richard Sandiford 3c14a432f2 gas/
* config/tc-mips.c (INSERT_BITS, INSERT_OPERAND, MIPS16_INSERT_OPERAND):
	Delete.
2013-07-14 13:52:52 +00:00
Richard Sandiford 364215c845 gas/
* config/tc-mips.c (mips32_to_16_reg_map): Delete.
	(match_entry_exit_operand): New function.
	(match_save_restore_list_operand): Likewise.
	(match_operand): Use them.
	(check_absolute_expr): Delete.
	(mips16_ip): Rewrite main parsing loop to use mips_operands.
2013-07-14 13:51:52 +00:00
Richard Sandiford 9e12b7a2b0 gas/
* config/tc-mips.c: Enable functions commented out in previous patch.
	(SKIP_SPACE_TABS): Move further up file.
	(mips32_to_micromips_reg_b_map, mips32_to_micromips_reg_c_map)
	(mips32_to_micromips_reg_d_map, mips32_to_micromips_reg_e_map)
	(ips32_to_micromips_reg_f_map, mips32_to_micromips_reg_g_map)
	(mips32_to_micromips_reg_l_map, mips32_to_micromips_reg_m_map)
	(mips32_to_micromips_reg_q_map, mips32_to_micromips_reg_n_map)
	(micromips_imm_b_map, micromips_imm_c_map): Delete.
	(mips_lookup_reg_pair): Delete.
	(macro): Use report_bad_range and report_bad_field.
	(mips_immed, expr_const_in_range): Delete.
	(mips_ip): Rewrite main parsing loop to use new functions.

gas/testsuite/
	* gas/mips/at-2.l: Remove duplicated $at warnings.
	* gas/mips/ext-ill.l, gas/mips/lui-1.l, gas/mips/mips32r2-ill.l,
	gas/mips/mips32r2-ill-nofp.l, gas/mips/mips32r2-ill-fp64.l,
	gas/mips/mips64r2-ill.l, gas/mips/octeon-ill.l: Update error
	messages.  Expect negative numbers to be printed as such,
	rather than as large unsigned positive numbers.
2013-07-14 13:49:14 +00:00
Richard Sandiford a1d785644e gas/
* config/tc-mips.c (mips_oddfpreg_ok): Move further up file.
	Change return type to bfd_boolean.
	(report_bad_range, report_bad_field): New functions.
	(mips_arg_info): New structure.
	(match_const_int, convert_reg_type, check_regno, match_int_operand)
	(match_mapped_int_operand, match_msb_operand, match_reg_operand)
	(match_reg_pair_operand, match_pcrel_operand, match_perf_reg_operand)
	(match_addiusp_operand, match_clo_clz_dest_operand)
	(match_lwm_swm_list_operand, match_mdmx_imm_reg_operand)
	(match_pc_operand, match_tied_reg_operand, match_operand)
	(check_completed_insn): New functions, commented out for now.
2013-07-14 13:44:25 +00:00
Richard Sandiford e077a1c8de gas/
* config/tc-mips.c (insn_insert_operand): New function.
	(macro_build, mips16_macro_build): Put null character check
	in the for loop and convert continues to breaks.  Use operand
	structures to handle constant operands.
2013-07-14 13:37:51 +00:00
Richard Sandiford ab90248154 include/opcode/
* mips.h (mips_operand_type, mips_reg_operand_type): New enums.
	(mips_operand, mips_int_operand, mips_mapped_int_operand)
	(mips_msb_operand, mips_reg_operand, mips_reg_pair_operand)
	(mips_pcrel_operand): New structures.
	(mips_insert_operand, mips_extract_operand, mips_signed_operand)
	(mips_decode_int_operand, mips_decode_pcrel_operand): New functions.
	(decode_mips_operand, decode_micromips_operand): Declare.

opcodes/
	* mips-formats.h: New file.
	* mips-opc.c: Include mips-formats.h.
	(reg_0_map): New static array.
	(decode_mips_operand): New function.
	* micromips-opc.c: Remove <stdio.h> include.  Include mips-formats.h.
	(reg_0_map, reg_28_map, reg_29_map, reg_31_map, reg_m16_map)
	(reg_mn_map, reg_q_map, reg_h_map1, reg_h_map2, int_b_map)
	(int_c_map): New static arrays.
	(decode_micromips_operand): New function.
	* mips-dis.c (micromips_to_32_reg_b_map, micromips_to_32_reg_c_map)
	(micromips_to_32_reg_d_map, micromips_to_32_reg_e_map)
	(micromips_to_32_reg_f_map, micromips_to_32_reg_g_map)
	(micromips_to_32_reg_h_map1, micromips_to_32_reg_h_map2)
	(micromips_to_32_reg_l_map, micromips_to_32_reg_m_map)
	(micromips_to_32_reg_n_map, micromips_to_32_reg_q_map)
	(micromips_imm_b_map, micromips_imm_c_map): Delete.
	(print_reg): New function.
	(mips_print_arg_state): New structure.
	(init_print_arg_state, print_insn_arg): New functions.
	(print_insn_args): Change interface and use mips_operand structures.
	Delete GET_OP_S.  Move GET_OP definition to...
	(print_insn_mips): ...here.  Update the call to print_insn_args.
	(print_insn_micromips): Use print_insn_args.

gas/
	* config/tc-mips.c (validate_mips_insn): Move further up file.
	Add insn_bits and decode_operand arguments.  Use the mips_operand
	fields to work out which bits an operand occupies.  Detect double
	definitions.
	(validate_micromips_insn): Move further up file.  Call into
	validate_mips_insn.
2013-07-14 13:28:56 +00:00
Richard Sandiford 2f8b73cc2b gas/
* config/tc-mips.c (mips16_macro_build): Remove 'Y' case.
2013-07-14 13:17:55 +00:00
Richard Sandiford c82767616f gas/
* config/tc-mips.c (macro_build): Take an int for "C", "k", "\\"
	and "~".
	(macro): Update accordingly.
2013-07-14 13:15:25 +00:00
Richard Sandiford 77bd434602 gas/
* config/tc-mips.c (imm_expr, imm2_expr, offset_expr): Tweak commentary.
	(imm_reloc): Delete.
	(md_assemble): Remove imm_reloc handling.
	(mips_ip): Update commentary.  Use offset_expr and offset_reloc
	rather than imm_expr and imm_reloc for 'i', 'j' and 'u'.
	Use a temporary array rather than imm_reloc when parsing
	constant expressions.  Remove imm_reloc initialization.
	(mips16_ip): Update commentary.  Use offset_expr and offset_reloc
	for the relaxable field.  Use a relax_char variable to track the
	type of this field.  Remove imm_reloc initialization.
2013-07-14 13:13:43 +00:00
Richard Sandiford cc537e567a include/opcode/
* mips.h: Document MIPS16 "I" opcode.

opcodes/
	* mips16-opc.c (mips16_opcodes): Use "I" for immediate operands
	in macros.

gas/
	* config/tc-mips.c (mips16_ip): Handle "I".
2013-07-14 13:11:03 +00:00
Maciej W. Rozycki ba92f88752 include/elf/
* mips.h (EF_MIPS_NAN2008): New macro.

	bfd/
	* elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Handle
	EF_MIPS_NAN2008.
	(_bfd_mips_elf_print_private_bfd_data): Likewise.

	binutils/
	* readelf.c (get_machine_flags): Handle EF_MIPS_NAN2008.

	gas/
	* config/tc-mips.c (mips_flag_nan2008): New variable.
	(options): Add OPTION_NAN enum value.
	(md_longopts): Handle it.
	(md_parse_option): Likewise.
	(s_nan): New function.
	(mips_elf_final_processing): Handle EF_MIPS_NAN2008.
	(md_show_usage): Add -mnan.

	* doc/as.texinfo (Overview): Add -mnan.
	* doc/c-mips.texi (MIPS Opts): Document -mnan.
	(MIPS NaN Encodings): New node.  Document .nan directive.
	(MIPS-Dependent): List the new node.

	gas/testsuite/
	* gas/mips/nan-2008-1.d: New test.
	* gas/mips/nan-2008-2.d: New test.
	* gas/mips/nan-2008-3.d: New test.
	* gas/mips/nan-2008-4.d: New test.
	* gas/mips/nan-legacy-1.d: New test.
	* gas/mips/nan-legacy-2.d: New test.
	* gas/mips/nan-legacy-3.d: New test.
	* gas/mips/nan-legacy-4.d: New test.
	* gas/mips/nan-legacy-5.d: New test.
	* gas/mips/nan-error-1.l: New list test.
	* gas/mips/nan-error-2.l: New list test.
	* gas/mips/nan-2008-override.s: New test source.
	* gas/mips/nan-2008.s: New test source.
	* gas/mips/nan-legacy-override.s: New test source.
	* gas/mips/nan-legacy.s: New test source.
	* gas/mips/nan-error-1.s: New test source.
	* gas/mips/nan-error-2.s: New test source.
	* gas/mips/mips.exp: Run the new tests.

	ld/testsuite/
	* ld-mips-elf/nan-2008.d: New test.
	* ld-mips-elf/nan-legacy.d: New test.
	* ld-mips-elf/nan-mixed-1.d: New test.
	* ld-mips-elf/nan-mixed-2.d: New test.
	* ld-mips-elf/nan-2008.s: New test source.
	* ld-mips-elf/nan-legacy.s: New test source.
2013-07-12 15:58:15 +00:00
Tristan Gingold c10947349e binutils/
2013-07-09  Tristan Gingold  <gingold@adacore.com>

	* configure.com: Add new defines to match changes in configure.


gas/
2013-07-09  Tristan Gingold  <gingold@adacore.com>

	* configure.com: Define HAVE_SYS_TYPES_H and HAVE_UNISTD_H
2013-07-09 07:32:14 +00:00
Richard Sandiford 0cbbe1b85e gas/
* config/tc-mips.c (mips_ip): Unconditionally parse an expression
	for 'A' and assume that the constant has been elided if the result
	is an O_register.

gas/testsuite/
	* gas/mips/la.s, gas/mips/la.d, gas/mips/la-svr4pic.d,
	gas/mips/la-xgot.d: Add tests for bracketed addresses.
2013-07-08 08:39:32 +00:00
Richard Sandiford f2ae14a1cc include/opcode/
* mips.h (M_ACLR_OB, M_ASET_OB, M_CACHE_OB, M_CACHEE_OB, M_L_DOB)
	(M_LB_A, M_LBE_OB, M_LBU_A, M_LBUE_OB, M_LD_A, M_LD_OB, M_LDC2_OB)
	(M_LDL_OB, M_LDM_OB, M_LDP_OB, M_LDR_OB, M_LH_A, M_LHE_OB, M_LHU_A)
	(M_LHUE_OB, M_LL_OB, M_LLD_OB, M_LLE_OB, M_LS_A, M_LW_A, M_LWE_OB)
	(M_LWC0_A, M_LWC1_A, M_LWC2_A, M_LWC2_OB, M_LWC3_A, M_LWL_A, M_LWL_OB)
	(M_LWLE_OB, M_LWM_OB, M_LWP_OB, M_LWR_A, M_LWR_OB, M_LWRE_OB, M_LWU_OB)
	(M_PREF_OB, M_PREFE_OB, M_S_DOB, M_SAA_OB, M_SAAD_OB, M_SC_OB)
	(M_SCD_OB, M_SCE_OB, M_SD_A, M_SD_OB, M_SDC2_OB, M_SDL_OB, M_SDM_OB)
	(M_SDP_OB, M_SDR_OB, M_SB_A, M_SBE_OB, M_SH_A, M_SHE_OB, M_SW_A)
	(M_SWE_OB, M_SWC0_A, M_SWC1_A, M_SWC2_A, M_SWC2_OB, M_SWC3_A, M_SWL_A)
	(M_SWL_OB, M_SWLE_OB, M_SWM_OB, M_SWP_OB, M_SWR_A, M_SWR_OB, M_SWRE_OB)
	(M_ULD, M_ULH, M_ULHU, M_ULW, M_USH, M_USW, M_USD): Delete.
	(M_ULD_A, M_ULH_A, M_ULHU_A, M_ULW_A, M_USH_A, M_USW_A, M_USD_A):
	Rename to...
	(M_ULD_AB, M_ULH_AB, M_ULHU_AB, M_ULW_AB, M_USH_AB, M_USW_AB)
	(M_USD_AB): ...these.

opcodes/
	* mips-opc.c (mips_builtin_opcodes): Remove o(b) macros.  Move LD
	and SD A(B) macros up.
	* micromips-opc.c (micromips_opcodes): Likewise.

gas/
	* config/tc-mips.c (gprel16_reloc_p): New function.
	(macro_read_relocs): Assume BFD_RELOC_LO16 if all relocs are
	BFD_RELOC_UNUSED.
	(offset_high_part, small_offset_p): New functions.
	(nacro): Use them.  Remove *_OB and *_DOB cases.  For single-
	register load and store macros, handle the 16-bit offset case first.
	If a 16-bit offset is not suitable for the instruction we're
	generating, load it into the temporary register using
	ADDRESS_ADDI_INSN.  Make the M_LI_DD code fall through into the
	M_L_DAB code once the address has been constructed.  For double load
	and store macros, again handle the 16-bit offset case first.
	If the second register cannot be accessed from the same high
	part as the first, load it into AT using ADDRESS_ADDI_INSN.
	Fix the handling of LD in cases where the first register is the
	same as the base.  Also handle the case where the offset is
	not 16 bits and the second register cannot be accessed from the
	same high part as the first.  For unaligned loads and stores,
	fuse the offbits == 12 and old "ab" handling.  Apply this handling
	whenever the second offset needs a different high part from the first.
	Construct the offset using ADDRESS_ADDI_INSN where possible,
	for offbits == 16 as well as offbits == 12.  Use offset_reloc
	when constructing the individual loads and stores.
	(mips_ip): Set up imm_expr, imm2_expr, offset_expr, imm_reloc
	and offset_reloc before matching against a particular opcode.
	Handle elided 'A' constants.  Allow 'A' constants to use
	relocation operators.

gas/testsuite/
	* gas/mips/ldstla-32.d: Avoid "lui at,0x0" sequences for
	truncated constants.
	* gas/mips/ldstla-32-shared.d: Likewise.
	* gas/mips/mcu.d: Use ADDIU in preference to LI+ADDU when adding
	16-bit constants to the base.
	* gas/mips/micromips@mcu.d: Likewise.
	* gas/mips/micromips@cache.d: Likewise.
	* gas/mips/micromips@pref.d: Likewise.
	* gas/mips/micromips.d, gas/mips/micromips-insn32.d,
	gas/mips/micromips-noinsn32.d, gas/mips/micromips-trap.d: Likewise.
	Allow the full 16-bit offset range to be used for SB, LB and LBU in
	USH and ULH sequences.  Fix the expected output for LD and SD when
	the two LW and SW offsets need different high parts.
	* gas/mips/eva.s: Test PREFE with relocation operators.
	* gas/mips/eva.d: Use ADDIU in preference to LI+ADDU for 16-bit
	constants.  Update after eva.s change.
	* gas/mips/micromips@eva.d: Likewise.
	* gas/mips/ld-reloc.s, gas/mips/ld-reloc.d, gas/mips/l_d-reloc.s,
	gas/mips/l_d-reloc.d, gas/mips/ulw-reloc.s, gas/mips/ulw-reloc.d,
	gas/mips/micromips@ulw-reloc.d, gas/mips/ulh-reloc.s,
	gas/mips/ulh-reloc.d: New tests.
	* gas/mips/mips.exp: Run them.
2013-07-07 11:32:32 +00:00
Richard Sandiford 5c324c169b include/opcode/
* mips.h: Remove documentation of "[" and "]".  Update documentation
	of "k" and the MDMX formats.

opcodes/
	* mips-opc.c (mips_builtin_opcodes): Use "Q" for the INSN_5400
	MDMX-like instructions.
	* mips-dis.c (print_insn_arg): Use "$f" rather than "$v" when
	printing "Q" operands for INSN_5400 instructions.

gas/
	* config/tc-mips.c (validate_mips_insn): Remove "[" and "]" handling.
	(mips_ip): Likewise.  Do not set is_mdmx for INSN_5400 instructions.
	Check constraints on the VR5400 RZU.OB, SLL.OB and SRL.OB instructions.

gas/testsuite/
	* gas/mips/vr5400-ill.s, gas/mips/vr5400-ill.l: New test.
	* gas/mips/mips.exp: Run it.
2013-07-07 10:15:09 +00:00
Richard Sandiford 23e69e47b4 include/opcode/
* mips.h: Update documentation of "+s" and "+S".

opcodes/
	* mips-opc.c (mips_builtin_opcodes): Use "+s" for "cins32" and
	"+S" for "cins".
	* mips-dis.c (print_mips_arg): Update "+s" and "+S" comments.
	Combine cases.

gas/
	* config/tc-mips.c (mips_ip): Preserve the real bit number for "+p".
	Require the msb to be <= 31 for "+s".  Check that the size is <= 31
	for both "+s" and "+S".
2013-07-07 10:00:43 +00:00
Richard Sandiford 27c5c572c9 include/opcode/
* mips.h: Document "+i".

opcodes/
	* mips-opc.c (mips_builtin_opcodes): Use "+i" rather than "a" for
	"jalx".
	* mips16-opc.c (mips16_opcodes): Likewise.
	* micromips-opc.c (micromips_opcodes): Likewise.
	* mips-dis.c (print_insn_args, print_mips16_insn_arg)
	(print_insn_mips16): Handle "+i".
	(print_insn_micromips): Likewise.  Conditionally preserve the
	ISA bit for "a" but not for "+i".

gas/
	* config/tc-mips.c (validate_mips_insn, validate_micromips_insn):
	(mips_ip, mips16_ip): Handle "+i".
2013-07-07 09:50:43 +00:00
Richard Sandiford e76ff5abe3 include/opcode/
* mips.h: Remove "mi" documentation.  Update "mh" documentation.
	(OP_MASK_MI, OP_SH_MI, MICROMIPSOP_MASK_MI, MICROMIPSOP_MASK_MI):
	Delete.
	(INSN2_WRITE_GPR_MHI): Rename to...
	(INSN2_WRITE_GPR_MH): ...this.

opcodes/
	* micromips-opc.c (WR_mhi): Rename to..
	(WR_mh): ...this.
	(micromips_opcodes): Update "movep" entry accordingly.  Replace
	"mh,mi" with "mh".
	* mips-dis.c (micromips_to_32_reg_h_map): Rename to...
	(micromips_to_32_reg_h_map1): ...this.
	(micromips_to_32_reg_i_map): Rename to...
	(micromips_to_32_reg_h_map2): ...this.
	(print_micromips_insn): Remove "mi" case.  Print both registers
	in the pair for "mh".

gas/
	* config/tc-mips.c (mips32_to_micromips_reg_h_map): Delete.
	(micromips_to_32_reg_h_map): Rename to...
	(micromips_to_32_reg_h_map1): ...this.
	(micromips_to_32_reg_i_map): Rename to...
	(micromips_to_32_reg_h_map2): ...this.
	(mips_lookup_reg_pair): New function.
	(gpr_write_mask, macro): Adjust after above renaming.
	(validate_micromips_insn): Remove "mi" handling.
	(mips_ip): Likewise.  Parse both registers in a pair for "mh".
2013-07-07 09:41:04 +00:00
Richard Sandiford fa7616a4c7 include/opcode/
* mips.h: Remove documentation of "+D" and "+T".

opcodes/
	* mips-opc.c (mips_builtin_opcodes): Remove "+D" and "+T" entries.
	* micromips-opc.c (micromips_opcodes): Likewise.
	* mips-dis.c (print_insn_args, print_insn_micromips): Remove "+D"
	and "+T" handling.  Check for a "0" suffix when deciding whether to
	use coprocessor 0 names.  In that case, also check for ",H" selectors.

gas/
	* config/tc-mips.c (validate_mips_insn, validate_micromips_insn)
	(mips_ip): Remove "+D" and "+T" handling.

gas/testsuite/
	* gas/mips/lb.d, gas/mips/sb.d: Use coprocessor register names
	for LWC0 and SWC0.
2013-07-07 09:32:55 +00:00
Andreas Krebbel fb798c50b2 2013-07-05 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
opcodes/
	    * s390-opc.c (J12_12, J24_24): New macros.
	    (INSTR_MII_UPI): Rename to INSTR_MII_UPP.
	    (MASK_MII_UPI): Rename to MASK_MII_UPP.
	    * s390-opc.txt: Rename MII_UPI to MII_UPP for bprp instruction.

include/elf/
	    * s390.h: Add new relocs R_390_PC12DBL, R_390_PLT12DBL,
	    R_390_PC24DBL, and R_390_PLT24DBL.

gas/testsuite/
	    * gas/s390/zarch-zEC12.s: Change bprp second operand and add
	    variants requiring relocations.
	    * gas/s390/zarch-zEC12.d: Likewise.

gas/
	    * config/tc-s390.c (md_gather_operands, md_apply_fix): Support new
	    relocs.
bfd/
	    * elf32-s390.c: Add new relocation definitions R_390_PC12DBL,
	    R_390_PLT12DBL, R_390_PC24DBL, and R_390_PLT24DBL.
	    (elf_s390_reloc_type_lookup, elf_s390_check_relocs)
	    (elf_s390_gc_sweep_hook, elf_s390_relocate_section): Support new
	    relocations.
	    * elf64-s390.c: See elf32-s390.c
	    * bfd-in2.h: Add new relocs to enum bfd_reloc_code_real.
	    * libbfd.h: Add new reloc strings.
2013-07-05 09:45:44 +00:00
Marcus Shawcroft 4aa2c5e2cb [PATCH, COMMITTED] [AArch64] Replace the :got_prel19: address modifier with :got: 2013-07-03 17:26:36 +00:00
Marcus Shawcroft 2c0a3565e5 [AArch64] Tidy up switch statement in GAS. 2013-07-03 17:25:17 +00:00
Alan Modra f40da81ba5 bfd/
* elf64-ppc.c (ppc64_elf_relocate_section): Set "relocation" for
	.TOC. after relocatable check.
gas/
	* config/tc-ppc.c (ppc_elf_adjust_symtab): Don't make .TOC. weak.
2013-07-02 00:25:08 +00:00
Maciej W. Rozycki 81566a9b78 * doc/as.texinfo (Overview): Remove @samp from MIPS ISA names.
* doc/c-mips.texi (MIPS Options): Remove @sc from MIPS ISA names.
	Replace @sc{mips16} with literal `MIPS16'.
	(MIPS ISA): Replace @sc{mips3} with literal `MIPS III'.
2013-06-26 12:15:43 +00:00
Yufeng Zhang a6bb11b2df [AArch64, ILP32] 3/6 Support for ELF32 relocs and refactor reloc handling
bfd/

	* bfd-in2.h: Re-generated.
	* elfnn-aarch64.c (HOWTO64, HOWTO32): New define.
	(IS_AARCH64_TLS_RELOC): Change to be based on the
	bfd reloc enumerators.
	(IS_AARCH64_TLSDESC_RELOC): Likewise.
	(PG, PG_OFFSET): Cast literal to bfd_vma.
	(elf64_aarch64_howto_table): Removed.
	(elf64_aarch64_howto_dynrelocs): Removed.
	(elf64_aarch64_tls_howto_table): Removed.
	(elf64_aarch64_tlsdesc_howto_table): Removed.
	(elfNN_aarch64_howto_table): New table to host all howto entires..
	(R_AARCH64_*): Replaced by AARCH64_R (*) and AARCH64_R_STR (*).
	(elfNN_aarch64_bfd_reloc_from_howto): New function.
	(elfNN_aarch64_bfd_reloc_from_type): Ditto.
	(struct elf_aarch64_reloc_map): New.
	(elf_aarch64_reloc_map): New table.
	(elfNN_aarch64_howto_from_bfd_reloc): New function.
	(elfNN_aarch64_howto_from_type): Update to look up the new table
	elfNN_aarch64_howto_table.
	(struct elf64_aarch64_reloc_map): Remove.
	(elf64_aarch64_reloc_map): Remove.
	(elfNN_aarch64_reloc_type_lookup): Change to call
	elfNN_aarch64_howto_from_bfd_reloc.
	(elfNN_aarch64_reloc_name_lookup): Change to look up the new table
	elfNN_aarch64_howto_table.
	(aarch64_resolve_relocation): Refactor to switch on the bfd
	reloc enumerators.
	(bfd_elf_aarch64_put_addend): Likewise.
	(elfNN_aarch64_final_link_relocate): Likewise.
	(aarch64_tls_transition_without_check): Likewise.
	(aarch64_reloc_got_type): Likewise.
	(aarch64_can_relax_tls): Likewise.
	(aarch64_tls_transition): Likewise.
	(elfNN_aarch64_tls_relax): Likewise.
	(elfNN_aarch64_final_link_relocate): Likewise.
	(elfNN_aarch64_relocate_section): Likewise.
	(elfNN_aarch64_gc_sweep_hook): Likewise.
	(elfNN_aarch64_check_relocs): Likewise.
	(aarch64_tls_transition): Change to return a bfd reloc enumerator.
	* libbfd.h: Re-generated.
	* reloc.c: Re-order the AArch64 bfd reloc enumerators.
	(BFD_RELOC_AARCH64_RELOC_START)
	(BFD_RELOC_AARCH64_RELOC_END)
	(BFD_RELOC_AARCH64_LD_GOT_LO12_NC)
	(BFD_RELOC_AARCH64_LD32_GOT_LO12_NC)
	(BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC)
	(BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC)
	(BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC)
	(BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC)
	(BFD_RELOC_AARCH64_IRELATIVE): New relocs.

gas/

	* config/tc-aarch64.c (reloc_table): Replace
	BFD_RELOC_AARCH64_LD64_GOT_LO12_NC with
	BFD_RELOC_AARCH64_LD_GOT_LO12_NC; likewise to
	BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC and
	BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC.
	(md_apply_fix): Handle BFD_RELOC_AARCH64_LD_GOT_LO12_NC,
	BFD_RELOC_AARCH64_LD32_GOT_LO12_NC,
	BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC,
	BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC,
	BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC and
	BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC.
	(aarch64_force_relocation): Likewise.

gas/testsuite/

	* gas/aarch64/ilp32-basic.d: New file.
	* gas/aarch64/ilp32-basic.s: New file.

include/elf/

	* aarch64.h: Add ELF32 reloc codes and remove fake ELF64 ones.
	(R_AARCH64_IRELATIVE): New reloc.
2013-06-26 10:47:06 +00:00
Yufeng Zhang cec5225bd8 [AArch64, ILP32] 2/6 Parametrize elfnn-aarch64.c and add basic support in ld
and gas.

bfd/

	* Makefile.am (BFD64_BACKENDS): Add elf32-aarch64.lo.
	(BUILD_CFILES): Add elf32-aarch64.c.
	(elf32-aarch64.c): New rule for generating from elfnn-aarch64.c.
	* Makefile.in: Re-generated.
	* archures.c (bfd_mach_aarch64_ilp32): New define.
	* bfd-in.h (bfd_elf32_aarch64_init_maps): New declaration.
	(bfd_elf32_aarch64_set_options): Ditto.
	(elf32_aarch64_setup_section_lists): Ditto.
	(elf32_aarch64_next_input_section): Ditto.
	(elf32_aarch64_size_stubs): Ditto.
	(elf32_aarch64_build_stubs): Ditto.
	* bfd-in2.h: Re-generated.
	* config.bfd (aarch64-*-elf): Add bfd_elf32_littleaarch64_vec
	and bfd_elf32_bigaarch64_vec.
	(aarch64-*-linux*): Likewise.
	(aarch64_be-*-elf): Likewise.
	(aarch64_be-*-linux*): Likewise.
	* configure.in (bfd_elf32_bigaarch64_vec)
	(bfd_elf32_littleaarch64_vec): New.
	* configure: Re-generated.
	* cpu-aarch64.c (compatible): Don't allow mixing ilp32 objects with
	lp64 ones.
	(bfd_aarch64_arch_ilp32): New.
	(bfd_aarch64_arch): Link to bfd_aarch64_arch_ilp32.
	* elfnn-aarch64.c (ARCH_SIZE): New define.
	(AARCH64_R, AARCH64_R_STR, LOG_FILE_ALIGN): New defines.
	(GOT_ENTRY_SIZE): Re-define as (ARCH_SIZE / 8).
	(elf64_aarch64_*): Rename to elfNN_aarch64_*.
	(ELF64_R_*): Rename to ELFNN_R_*.
	Plus other paramaterization.
	* targets.c (bfd_elf32_bigaarch64_vec, bfd_elf32_littleaarch64_vec):
	New declarations.
	(_bfd_target_vector): Add bfd_elf32_bigaarch64_vec and
	bfd_elf32_littleaarch64_vec.

gas/

	* config/tc-aarch64.c (ilp32_p): New static variable.
	(elf64_aarch64_target_format): Return the target according to the
	value of 'ilp32_p'.
	(md_begin): Determine 'mach' according to the value of 'ilp32_p'.
	(aarch64_opts): Add support for options '-milp32' and '-mlp64'.
	(aarch64_dwarf2_addr_size): New function.
	* config/tc-aarch64.h (aarch64_dwarf2_addr_size): New declaration.
	(DWARF2_ADDR_SIZE): New define.

ld/

	* Makefile.am (ALL_64_EMULATION_SOURCES): Add eaarch64elf32.c.
	(eaarch64elf32.c): New dependency and rule.
	* Makefile.in: Re-generated.
	* configure.tgt (aarch64-*-elf): Add aarch64elf32.
	(aarch64_be-*-elf, aarch64_be-*-linux*, aarch64-*-linux*): Likewise.
	* emulparams/aarch64elf32.sh: New file.
2013-06-26 10:41:42 +00:00
Richard Sandiford e335d9cbd8 gas/
* doc/c-mips.texi: Use ISA instead of @sc{isa}.
2013-06-26 08:04:00 +00:00
Richard Sandiford 18870af79b include/opcode/
* mips.h: Fix comment for "1": it is now STYPE rather than SHAMT.
	Use "source" rather than "destination" for microMIPS "G".

gas/
	* config/tc-mips.c (validate_mips_insn): Use STYPE rather than SHAMT.
2013-06-26 07:04:57 +00:00
Maciej W. Rozycki 833794fc12 bfd/
* elfxx-mips.h (_bfd_mips_elf_insn32): New prototype.
	* elfxx-mips.c (mips_elf_link_hash_table): Add insn32 member.
	(STUB_MOVE32_MICROMIPS, STUB_JALR32_MICROMIPS): New macros.
	(MICROMIPS_INSN32_FUNCTION_STUB_NORMAL_SIZE): Likewise.
	(MICROMIPS_INSN32_FUNCTION_STUB_BIG_SIZE): Likewise.
	(micromips_insn32_o32_exec_plt0_entry): New variable.
	(micromips_insn32_o32_exec_plt_entry): Likewise.
	(_bfd_mips_elf_adjust_dynamic_symbol): Handle insn32 mode.
	(mips_elf_estimate_stub_size): Likewise.
	(_bfd_mips_elf_size_dynamic_sections): Likewise.
	(_bfd_mips_elf_finish_dynamic_symbol): Likewise.
	(mips_finish_exec_plt): Likewise.
	(_bfd_mips_elf_relax_section): Likewise.
	(_bfd_mips_elf_insn32): New function.
	(_bfd_mips_elf_get_synthetic_symtab): Handle insn32 PLT.

	gas/
	* config/tc-mips.c (mips_set_options): Add insn32 member.
	(mips_opts): Initialize it.
	(NOP_INSN, NOP_INSN_SIZE): Handle insn32 mode.
	(options): Add OPTION_INSN32 and OPTION_NO_INSN32 enum values.
	(md_longopts): Add "minsn32" and "mno-insn32" options.
	(is_size_valid): Handle insn32 mode.
	(md_assemble): Pass instruction string down to macro.
	(brk_fmt): Add second dimension and insn32 mode initializers.
	(mfhl_fmt): Likewise.
	(BRK_FMT, MFHL_FMT): Handle insn32 mode.
	(macro_build) <'c'>: Handle microMIPS 32-bit BREAK encoding.
	(macro_build_jalr, move_register): Handle insn32 mode.
	(macro_build_branch_rs): Likewise.
	(macro): Handle insn32 mode.
	<M_JRADDIUSP>, <M_JRC>, <M_MOVEP>: New cases.
	(mips_ip): Handle insn32 mode.
	(md_parse_option): Handle OPTION_INSN32 and OPTION_NO_INSN32.
	(s_mipsset): Handle "insn32" and "noinsn32" pseudo-ops.
	(mips_handle_align): Handle insn32 mode.
	(md_show_usage): Add -minsn32 and -mno-insn32.

	* doc/as.texinfo (Target MIPS options): Add -minsn32 and
	-mno-insn32 options.
	(-minsn32, -mno-insn32): New options.
	* doc/c-mips.texi (MIPS Opts): Add -minsn32 and -mno-insn32
	options.
	(MIPS assembly options): New node.  Document .set insn32 and
	.set noinsn32.
	(MIPS-Dependent): List the new node.

	gas/testsuite/
	* gas/mips/micromips-insn32.d: New test.
	* gas/mips/micromips-noinsn32.d: Likewise.
	* gas/mips/micromips.l: Rename to...
	* gas/mips/micromips-warn.l: ... this.
	* gas/mips/micromips.d: Update accordingly.
	* gas/mips/micromips-trap.d: Likewise.
	* gas/mips/micromips.l: New list test.
	* gas/mips/micromips.s: Add conditionals.
	* gas/mips/mips.exp: Run the new tests.

	include/opcode/
	* mips.h: Add M_JRADDIUSP, M_JRC and M_MOVEP anonymous enum
	values.

	ld/
	* emultempl/mipself.em (insn32): New variable.
	(mips_create_output_section_statements): Handle insn32 mode.
	(PARSE_AND_LIST_PROLOGUE): New macro.
	(PARSE_AND_LIST_LONGOPTS): Likewise.
	(PARSE_AND_LIST_OPTIONS): Likewise.

	* gen-doc.texi: Set MIPS.
	* ld.texinfo: Likewise.
	(Options specific to MIPS targets): New section.
	(ld and MIPS family): New node.
	(Top, Machine Dependent): List the new node.

	opcodes/
	* micromips-opc.c (micromips_opcodes): Add "jraddiusp", "jrc"
	and "movep" macros.
2013-06-25 18:02:34 +00:00
Nick Clifton d1706f383d * config/tc-msp430.c (msp430_srcoperand): Do not allow the use of
the PC in indirect addressing on 430xv2 parts.
	(msp430_operands): Add version test to hardware bug encoding
	restrictions.
2013-06-25 08:21:43 +00:00
Roland McGrath d996d9708a gas/
* config/tc-arm.c (parse_reg_list): Use skip_past_char for '}',
	so it skips whitespace before it.
	(s_arm_unwind_save_mmxwr, s_arm_unwind_save_mmxwcg): Likewise.

gas/testsuite/
	* gas/arm/macro-vld1.s: Add a case with whitespace before '}'.
	* gas/arm/macro-vld1.d: Update.
2013-06-24 23:13:00 +00:00
Roland McGrath 477330fc7d gas/
* config/tc-arm.c (arm_symbol_chars): Include '{' and '}'.
	(arm_reg_parse_multi): Skip whitespace first.
	(parse_reg_list): Likewise.
	(parse_vfp_reg_list): Likewise.
	(s_arm_unwind_save_mmxwcg): Likewise.

gas/testsuite/
	* gas/arm/macro-pld.s: Add a 'push {r0}' case.
	* gas/arm/macro-pld.d: Update expected output.
	* gas/arm/macro-vld1.s: New file.
	* gas/arm/macro-vld1.d: New file.
2013-06-24 21:05:30 +00:00
Nick Clifton 243821998e PR gas/15623
* config/tc-arm.c (do_t_smc): Mark as ending an IT block.
2013-06-24 15:38:53 +00:00
Richard Sandiford c3678916c6 include/opcode/
* mips.h: Fix comment typo: "G" is _RS rather than _RD for microMIPS.

gas/
	* config/tc-mips.c (mips_ip): Fix swapped bit numbers in comments.
2013-06-23 20:12:53 +00:00
Richard Sandiford 42429eacb4 bfd/
* Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Move MIPS ELF
	files to...
	(BFD64_BACKENDS, BFD64_BACKENDS_CFILES): ...here.
	* Makefile.in: Regenerate.
	* config.bfd: Enclose all MIPS ELF targets in #ifdef BFD64.
	Set want64 to true for them at the end.
	* targets.c (_bfd_target_vector): Protect MIPS ELF targets with
	#ifdef BFD64.

gas/
	* config/tc-mips.c: Assert that offsetT and valueT are at least
	8 bytes in size.
	(GPR_SMIN, GPR_SMAX): New macros.
	(macro, mips_ip): Remove code for 4-byte valueT and offsetT.

ld/
	* Makefile.am (ALL_EMULATION_SOURCES): Move MIPS ELF emulations to...
	(ALL_64_EMULATION_SOURCES): ...here.
	* Makefile.in: Regenerate.
2013-06-23 20:08:23 +00:00
Richard Sandiford f3ded42a5d gas/
* config/tc-mips.c: Remove OBJ_ELF, OBJ_MAYBE_ELF and IS_ELF
	conditions.  Remove any code deselected by them.
	(s_mips_frame, s_mips_mask): Handle ECOFF_DEBUGGING case first.
2013-06-22 16:49:08 +00:00
Richard Sandiford e8044f355d * configure.ac (mips*-*-bsd*, mips*-*-ultrix*, mips*-*-osf*)
(mips*-*-ecoff*, mips*-*-pe*, mips*-*-irix* [v4 and earlier])
	(mips*-*-lnews*, mips*-*-riscos*): Add gas and ld to noconfigdirs.
	* configure: Regenerate.

gas/
	* NEWS: Note removal of ECOFF support.
	* doc/as.texinfo (--emulation): Update for the removal of MIPS ECOFF.
	* Makefile.am (TARG_ENV_HFILES): Remove config/te-lnews.h.
	(MULTI_CFILES): Remove config/e-mipsecoff.c.
	* Makefile.in: Regenerate.
	* configure.in: Remove MIPS ECOFF references.
	(mips-sony-bsd*, mips-*-bsd*, mips-*-lnews*-ecoff, mips-*-*-ecoff):
	Delete cases.
	(mips-*-irix5*-*, mips*-*-linux*-*, mips*-*-freebsd*)
	(mips*-*-kfreebsd*-gnu, mips-*-*-elf): Fold into...
	(mips-*-*): ...this single case.
	(mipsbecoff, mipslecoff, mipsecoff): Remove emulations.  Expect
	MIPS emulations to be e-mipself*.
	* configure: Regenerate.
	* configure.tgt (mips-sony-bsd*, mips-*-ultrix*, mips-*-osf*)
	(mips-*-ecoff*, mips-*-pe*, mips-*-irix*, ips-*-lnews*, mips-*-riscos*)
	(mips-*-sysv*): Remove coff and ecoff cases.
	* as.c (mipsbecoff, mipslecoff, mipsecoff): Remove.
	* ecoff.c: Remove reference to MIPS ECOFF.
	* config/e-mipsecoff.c, config/te-lnews.h: Delete files.
	* config/tc-mips.c (ECOFF_LITTLE_FORMAT): Delete.
	(RDATA_SECTION_NAME, mips_target_form): Remove COFF and ECOFF cases.
	(mips_hi_fixup): Tweak comment.
	(append_insn): Require a howto.
	(mips_after_parse_args): Remove OBJ_MAYBE_ECOFF code.

gas/testsuite/
	* gas/all/gas.exp: Remove reference to mips-ecoff.
	* gas/mips/branch-misc-1.d, gas/mips/branch-misc-2.d,
	gas/mips/branch-misc-2-64.d, gas/mips/branch-misc-2pic.d,
	gas/mips/branch-misc-2pic-64.d, gas/mips/branch-swap.d: Remove
	skips for mips-*-ecoff.

ld/
	* NEWS: Document the removal of MIPS ECOFF targets.
	* ld.texinfo (--gpsize=@var{value}): Use MIPS ELF rather than
	MIPS ECOFF as an example of a target that supports small data.
	* ldmain.c (g_switch_value): Likewise.
	* configure.tgt (mips*-*-pe, mips*-dec-ultrix*, mips*-dec-osf*)
	(mips*-sgi-irix* [v4 and earlier], mips*el-*-ecoff*, mips*-*-ecoff*)
	(mips*-*-bsd*, mips*-*-lnews*): Remove cases.
	* Makefile.am (ALL_EMULATION_SOURCES): Remove emipsbig.c, emipsbsd.c,
	emipsidt.c, emipsidtl.c, emipslit.c, emipslnews.c and emipspe.c.
	(emipsbig.c, emipsbsd.c, emipsidt.c, emipsidtl.c, emipslit.c)
	(emipslnews.c, emipspe.c): Delete rules.
	* Makefile.in: Regenerate.
	* emulparams/mipsbig.sh, emulparams/mipsbsd.sh, emulparams/mipsidt.sh,
	emulparams/mipsidtl.sh, emulparams/mipslit.sh, emulparams/mipslnews.sh,
	emulparams/mipspe.sh, emultempl/mipsecoff.em: Delete.
	* emultempl/m68kcoff.em: Update comment to say that MIPS ECOFF support
	has now been removed.
	* emultempl/pe.em: Remove TARGET_IS_mipspe checks.
2013-06-22 16:44:16 +00:00
Richard Sandiford 98508b2a6e gas/
* doc/as.texinfo: Use MIPS rather than @sc{mips} throughout.
	Use "CPU" instead of "cpu".
	* doc/c-mips.texi: Likewise.
	(MIPS Opts): Rename to MIPS Options.
	(MIPS option stack): Rename to MIPS Option Stack.
	(MIPS ASE instruction generation overrides): Rename to
	MIPS ASE Instruction Generation Overrides (for now).
	(MIPS floating-point): Rename to MIPS Floating-Point.
2013-06-22 16:18:45 +00:00
Richard Sandiford fc16f8cc9b gas/
* doc/c-mips.texi (MIPS Macros): New section.
	(MIPS Object): Replace with...
	(MIPS Small Data): ...this new section.
2013-06-22 16:09:55 +00:00
Richard Sandiford 5a7560b5ec gas/
* doc/c-mips.texi (MIPS symbol sizes): Move section further up file.
	Capitalize name.  Use @kindex instead of @cindex for .set entries.
2013-06-22 16:02:24 +00:00
Richard Sandiford a1b86ab7ac gas/
* doc/c-mips.texi (MIPS Stabs): Remove section.
2013-06-22 15:58:59 +00:00
Richard Sandiford c62781705e gas/
* config/tc-mips.c (ISA_SUPPORTS_SMARTMIPS, ISA_SUPPORTS_DSP_ASE)
	(ISA_SUPPORTS_DSP64_ASE, ISA_SUPPORTS_DSPR2_ASE, ISA_SUPPORTS_EVA_ASE)
	(ISA_SUPPORTS_MT_ASE, ISA_SUPPORTS_MCU_ASE, ISA_SUPPORTS_VIRT_ASE)
	(ISA_SUPPORTS_VIRT64_ASE): Delete.
	(mips_ase): New structure.
	(mips_ases): New table.
	(FP64_ASES): New macro.
	(mips_ase_groups): New array.
	(mips_isa_rev, mips_ase_mask, mips_check_isa_supports_ase)
	(mips_check_isa_supports_ases, mips_set_ase, mips_lookup_ase): New
	functions.
	(is_opcode_valid): Use mips_ases to get the 64-bit ASE flags.
	(md_parse_option): Use mips_ases and mips_set_ase instead of
	separate case statements for each ASE option.
	(mips_after_parse_args): Use FP64_ASES.  Use
	mips_check_isa_supports_ases to check the ASEs against
	other options.
	(s_mipsset): Use mips_ases and mips_set_ase instead of
	separate if statements for each ASE option.  Use
	mips_check_isa_supports_ases, even when a non-ASE option
	is specified.

gas/testsuite/
	* gas/mips/ase-errors-1.s, gas/mips/ase-errors-1.l,
	gas/mips/ase-errors-2.s, gas/mips/ase-errors-2.l,
	gas/mips/ase-errors-3.s, gas/mips/ase-errors-3.l,
	gas/mips/ase-errors-4.s, gas/mips/ase-errors-4.l: New tests.
	* gas/mips/mips.exp: Run them.
2013-06-20 19:25:20 +00:00
Kyrylo Tkachov 63a4bc21e4 2013-06-19 Greta Yorsh <Greta.Yorsh@arm.com>
* config/tc-arm.c (arm_cpus): Add support for Cortex-A12.
2013-06-19 13:26:04 +00:00
Richard Sandiford c31f39360b gas/
* config/tc-mips.c (md_shortopts, options, md_longopts)
	(md_longopts_size): Move earlier in file.
2013-06-18 19:38:48 +00:00
Richard Sandiford 846ef2d02c gas/
* config/tc-mips.c (mips_set_options): Replace separate "ase_*" fields
	with a single "ase" bitmask.
	(mips_opts): Update accordingly.
	(file_ase, file_ase_explicit): New variables.
	(file_ase_mips3d, file_ase_mdmx, file_ase_smartmips, file_ase_dsp)
	(file_ase_dspr2, file_ase_eva, file_ase_mt, file_ase_virt): Delete.
	(ISA_HAS_ROR): Adjust for mips_set_options change.
	(is_opcode_valid): Take the base ase mask directly from mips_opts.
	(mips_ip): Adjust for mips_set_options change.
	(md_parse_option): Likewise.  Update file_ase_explicit.
	(mips_after_parse_args): Adjust for mips_set_options change.
	Use bitmask operations to select the default ASEs.  Set file_ase
	rather than individual per-ASE variables.
	(s_mipsset): Adjust for mips_set_options change.
	(mips_elf_final_processing): Test file_ase rather than
	file_ase_mdmx.  Remove commented-out code.
2013-06-18 19:37:21 +00:00
Richard Sandiford d16afab6dd gas/
* config/tc-mips.c (mips_cpu_info): Add an "ase" field.
	(MIPS_CPU_ASE_SMARTMIPS, MIPS_CPU_ASE_DSP, MIPS_CPU_ASE_MT)
	(MIPS_CPU_ASE_MIPS3D, MIPS_CPU_ASE_MDMX, MIPS_CPU_ASE_DSPR2)
	(MIPS_CPU_ASE_MCU, MIPS_CPU_ASE_VIRT, MIPS_CPU_ASE_EVA): Delete.
	(mips_after_parse_args): Use the new "ase" field to choose
	the default ASEs.
	(mips_cpu_info_table): Move ASEs from the "flags" field to the
	"ase" field.
2013-06-18 19:34:17 +00:00
Richard Earnshaw e83a675fce * config/tc-arm.c (symbol_preemptible): New function.
(relax_branch): Use it.
2013-06-18 14:41:09 +00:00
Catherine Moore 7f3c40729d 2013-06-17 Catherine Moore <clm@codesourcery.com>
Maciej W. Rozycki  <macro@codesourcery.com>
	    Chao-Ying Fu  <fu@mips.com>

	gas/testsuite/
	* gas/mips/mips.exp: Run new tests.
	* gas/mips/eva.d: New.
	* gas/mips/eva.s: New.
	* gas/mips/micromips@eva.d: New.

	gas/
	* config/tc-mips.c (mips_set_options): Add ase_eva.
	(mips_set_options mips_opts): Add ase_eva.
	(file_ase_eva): Declare.
	(ISA_SUPPORTS_EVA_ASE): Define.
	(IS_SEXT_9BIT_NUM): Define.
	(MIPS_CPU_ASE_EVA): Define.
	(is_opcode_valid): Add support for ase_eva.
	(macro_build): Likewise.
	(macro): Likewise.
	(validate_mips_insn): Likewise.
	(validate_micromips_insn): Likewise.
	(mips_ip): Likewise.
	(options): Add OPTION_EVA and OPTION_NO_EVA.
	(md_longopts): Add -meva and -mno-eva.
	(md_parse_option): Process new options.
	(mips_after_parse_args): Check for valid EVA combinations.
	(s_mipsset): Likewise.

	include/
	* opcode/mips.h (OP_SH_EVAOFFSET): Define.
	(OP_MASK_EVAOFFSET): Define.
	(INSN_ASE_MASK): Delete.
	(ASE_EVA): Define.
	(M_CACHEE_AB, M_CACHEE_OB): New.
	(M_LBE_OB, M_LBE_AB): New.
	(M_LBUE_OB, M_LBUE_AB): New.
	(M_LHE_OB, M_LHE_AB): New.
	(M_LHUE_OB, M_LHUE_AB): New.
	(M_LLE_AB, M_LLE_OB): New.
	(M_LWE_OB, M_LWE_AB): New.
	(M_LWLE_AB, M_LWLE_OB): New.
	(M_LWRE_AB, M_LWRE_OB): New.
	(M_PREFE_AB, M_PREFE_OB): New.
	(M_SCE_AB, M_SCE_OB): New.
	(M_SBE_OB, M_SBE_AB): New.
	(M_SHE_OB, M_SHE_AB): New.
	(M_SWE_OB, M_SWE_AB): New.
	(M_SWLE_AB, M_SWLE_OB): New.
	(M_SWRE_AB, M_SWRE_OB): New.
	(MICROMIPSOP_SH_EVAOFFSET): Define.
	(MICROMIPSOP_MASK_EVAOFFSET): Define.

	opcodes/
	* micromips-opc.c (EVA): Define.
	(TLBINV): Define.
	(micromips_opcodes): Add EVA opcodes.
	* mips-dis.c (mips_arch_choices): Update for ASE_EVA.
	(print_insn_args): Handle EVA offsets.
	(print_insn_micromips): Likewise.
	* mips-opc.c (EVA): Define.
	(TLBINV): Define.
	(mips_builtin_opcodes): Add EVA opcodes.
2013-06-17 22:59:10 +00:00
Richard Sandiford e410add415 gas/
* dwarf2dbg.h (dwarf2_move_insn): Declare.
	* dwarf2dbg.c (line_subseg): Add pmove_tail.
	(get_line_subseg): Add create_p argument.  Initialize pmove_tail.
	(dwarf2_gen_line_info_1): Update call accordingly.
	(dwarf2_move_insn): New function.
	* config/tc-mips.c (append_insn): Use dwarf2_move_insn.

gas/testsuite/
	* gas/mips/loc-swap-3.d, gas/mips/loc-swap-3.s: New test.
	* gas/mips/mips.exp: Run it.
2013-06-14 13:30:28 +00:00
Richard Sandiford 6a50d470b7 gas/
Revert:

	2011-09-05  Richard Sandiford  <rdsandiford@googlemail.com>

	PR gas/13024
	* dwarf2dbg.c (pending_lines, pending_lines_tail): New variables.
	(dwarf2_gen_line_info_1): Delete.
	(dwarf2_push_line, dwarf2_flush_pending_lines): New functions.
	(dwarf2_gen_line_info, dwarf2_emit_label): Use them.
	(dwarf2_consume_line_info): Call dwarf2_flush_pending_lines.
	(dwarf2_directive_loc): Push previous .locs instead of generating
	them immediately.
2013-06-14 13:24:41 +00:00
Chao-ying Fu f122319e0a 2013-06-13 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
* config/tc-mips.c (ISA_SUPPORTS_VIRT_ASE): Support micromips.
	(ISA_SUPPORTS_VIRT64_ASE): Support 64-bit micromips.
2013-06-13 20:58:44 +00:00
Nick Clifton 909c7f9cbf PR gas/15602
* config/tc-m68k.h (TC_CHECK_ADJUSTED_BROKEN_DOT_WORD): Define.
	* config/tc-m68k.c (tc_m68k_check_adjusted_broken_word): New
	function.  Generates an error if the adjusted offset is out of a
	16-bit range.
2013-06-13 08:53:35 +00:00
Sandra Loosemore 5d5755a724 2013-06-12 Sandra Loosemore <sandra@codesourcery.com>
gas/
	* config/tc-nios2.c (md_apply_fix):  Mask constant
	BFD_RELOC_NIOS2_HIADJ16 value to 16 bits.

	gas/testsuite/
	* gas/nios2/movia.s: Add additional test case with negative
	constant value.
	* gas/nios2/movia.d: Likewise.
2013-06-12 23:11:57 +00:00
Maciej W. Rozycki 3bf0dbfb15 gas/
* config/tc-mips.c (append_insn): Don't do branch relaxation for
	MIPS-3D instructions either.
	(md_convert_frag): Update the COPx branch mask accordingly.

	* config/tc-mips.c (md_show_usage): Document --[no-]relax-branch
	option.
	* doc/as.texinfo (Overview): Add --relax-branch and
	--no-relax-branch.
	* doc/c-mips.texi (MIPS Opts): Document --relax-branch and
	--no-relax-branch.

	gas/testsuite/
	* gas/mips/relax-bc1any.l: New test.
	* gas/mips/relax-bc1any.s: New test source.
	* gas/mips/mips.exp: Run the new test.
2013-06-10 18:15:48 +00:00
Sandra Loosemore 9daf7bab4f 2013-06-09 Sandra Loosemore <sandra@codesourcery.com>
opcodes/
	* nios2-opc.c (nios2_builtin_opcodes): Give "trap" a type-"b"
	argument.

	gas/
	* config/tc-nios2.c (nios2_parse_args):  Allow trap argument to
	omitted.

	gas/testsuite/
	* gas/nios2/trap.s: Add additional test cases for optional
	argument.
	* gas/nios2/trap.d: Likewise.
2013-06-10 01:04:42 +00:00
Richard Sandiford d301a56b40 gas/
2013-06-08  Catherine Moore  <clm@codesourcery.com>

	* config/tc-mips.c (is_opcode_valid):  Build ASE mask.
	(is_opcode_valid_16): Pass ase value to opcode_is_member.
	(append_insn): Change INSN_xxxx to ASE_xxxx.

include/
2013-06-08  Catherine Moore  <clm@codesourcery.com>

	* opcode/mips.h (mips_opcode): Add ase field.
	(INSN_ASE_MASK): Delete.
	(INSN_DSP): Rename to ASE_DSP.  Provide new value.
	(INSN_DSPR2): Rename to ASE_DSPR2.  Provide new value.
	(INSN_MCU): Rename to ASE_MCU.  Provide new value.
	(INSN_MDMX): Rename to ASE_MDMX.  Provide new value.
	(INSN_MIPS3d): Rename to ASE_MIPS3D.  Provide new value.
	(INSN_MT): Rename to ASE_MT.  Provide new value.
	(INSN_SMARTMIPS): Rename to ASE_SMARTMIPS.  Provide new value.
	(INSN_VIRT): Rename to ASE_VIRT.  Provide new value.
	(INSN_VIRT64): Rename to ASE_VIRT64.  Provide new value.
	(opcode_is_member): Add ase argument.  Check ase.

opcodes/
2013-06-08  Catherine Moore  <clm@codesourcery.com>
	    Richard Sandiford  <rdsandiford@googlemail.com>

	* micromips-opc.c (D32, D33, MC): Update definitions.
 	(micromips_opcodes):  Initialize ase field.
	* mips-dis.c (mips_arch_choice): Add ase field.
	(mips_arch_choices): Initialize ase field.
	(set_default_mips_dis_options): Declare and setup mips_ase.
	* mips-opc.c (M3D, SMT, MX, IVIRT, IVIRT64, D32, D33, D64,
	MT32, MC): Update definitions.
	(mips_builtin_opcodes): Initialize ase field.
2013-06-08 10:22:55 +00:00
Denis Chertykov 7bab763496 * gas/config/tc-avr.c: Change ISA for devices with USB support to
AVR_ISA_XMEGAU

	* include/opcode/avr.h: Rename AVR_ISA_XCH to AVR_ISA_RMW. Remove
	from AVR_ISA_XMEGA and add new AVR_ISA_XMEGAU
2013-06-01 07:14:44 +00:00
H.J. Lu f60cf82f20 Don't align text/data/bss sections for ELF
binutils/testsuite/

	* binutils-all/i386/compressed-1b.d: Updated for text/data/bss
	section alignment change.
	* binutils-all/i386/compressed-1c.d: Likewise.
	* binutils-all/x86-64/compressed-1b.d: Likewise.
	* binutils-all/x86-64/compressed-1c.d: Likewise.

gas/

	* config/tc-i386.c (md_begin): Don't align text/data/bss sections
	for ELF.

gas/testsuite/

	* gas/i386/size-3.d: Updated for text/data/bss section alignment
	change.
	* gas/i386/x86-64-size-1.d: Likewise.
	* gas/i386/x86-64-unwind.d: Likewise.
	* gas/i386/ilp32/x86-64-size-1.d: Likewise.
	* gas/i386/ilp32/x86-64-size-5.d: Likewise.
	* gas/i386/ilp32/x86-64-unwind.d: Likewise.

ld/testsuite/

	* ld-i386/pr12718.d: Updated for text/data/bss section alignment
	change.
	* ld-i386/tlsbindesc.dd: Likewise.
	* ld-i386/tlsbindesc.rd: Likewise.
	* ld-i386/tlsnopic.dd: Likewise.
	* ld-i386/tlspic.dd: Likewise.
	* ld-x86-64/ilp32-4.d: Likewise.
	* ld-x86-64/pr12718.d: Likewise.
	* ld-x86-64/split-by-file.rd: Likewise.
	* ld-x86-64/tlsbin.dd: Likewise.
	* ld-x86-64/tlsbin.rd: Likewise.
	* ld-x86-64/tlsbindesc.dd: Likewise.
	* ld-x86-64/tlsbindesc.rd: Likewise.
	* ld-x86-64/tlsdesc.dd: Likewise.
	* ld-x86-64/tlsdesc.rd: Likewise.
	* ld-x86-64/tlspic.dd: Likewise.
	* ld-x86-64/tlspic.rd: Likewise.
2013-05-31 17:27:28 +00:00
Catherine Moore a3f278e22a 2013-05-31 Paul Brook <paul@codesourcery.com>
gas/
	* config/tc-mips.c (s_ehword): New.


2013-05-31  Catherine Moore  <clm@codesourcery.com>

	gas/testsuite/
	* gas/mips/ehword.d: New.
	* gas/mips/ehword.s: New.
	* gas/mips/mips.exp: Run ehword test.
2013-05-31 17:04:53 +00:00
Catherine Moore 067ec077d7 2013-05-30 Paul Brook <paul@codesourcery.com>
bfd/
	* bfd-in2.h: Regenerate.
	* elf32-mips.c (elf_mips_eh_howto): New.
	(bfd_elf32_bfd_reloc_type_lookup ): Support BFD_RELOC_MIPS_EH.
	(bfd_elf32_bfd_reloc_name_lookup): Likewise.
	(mips_elf32_rtype_to_howto): Support R_MIPS_EH.
	* elf64-mips.c (elf_mips_eh_howto): New.
	(bfd_elf64_bfd_reloc_type_lookup): Support BFD_RELOC_MIPS_EH.
	(bfd_elf64_bfd_reloc_name_lookup): Likewise.
	(mips_elf64_rtype_to_howto): Support R_MIPS_EH.
	* libbfd.h: Regenerate.
	* reloc.c (BFD_RELOC_MIPS_EH): New.

	gas/
	* config/tc-mips.c (md_apply_fix): Support BFD_RELOC_MIPS_EH.

	include/elf
	* mips.h (R_MIPS_EH): New.
2013-05-30 20:27:21 +00:00
Maciej W. Rozycki d6101ac200 gas/
* write.c (resolve_reloc_expr_symbols): On REL targets don't
	convert relocs who have no relocatable field either.  Rephrase
	the conditional so that the PC-relative check is only applied
	for REL targets.

	gas/testsuite/
	* gas/mips/jalr3.d: New test.
	* gas/mips/jalr3-n32.d: New test.
	* gas/mips/jalr3-n64.d: New test.
	* gas/mips/jalr3.s: New test source.
	* gas/mips/mips.exp: Run the new tests.

	ld/testsuite/
	* ld-mips-elf/jalr3.dd: New test.
	* ld-mips-elf/jalr3.ld: New test linker script.
	* ld-mips-elf/mips-elf.exp: Run the new test.
2013-05-29 16:22:14 +00:00
Maciej W. Rozycki f19ccbda97 gas/
* config/tc-mips.c (macro) <ld>: Don't use $zero for address
	calculation.

	gas/testsuite/
	* gas/mips/ld-zero.d: New test.
	* gas/mips/ld-zero-2.d: New test.
	* gas/mips/ld-zero-3.d: New test.
	* gas/mips/ld-zero-q.d: New test.
	* gas/mips/ld-zero-u.d: New test.
	* gas/mips/ecoff@ld-zero-3.d: New test.
	* gas/mips/micromips@ld-zero-2.d: New test.
	* gas/mips/micromips@ld-zero-3.d: New test.
	* gas/mips/ld-zero.s: New test source.
	* gas/mips/ld-zero-2.s: New test source.
	* gas/mips/ld-zero-3.s: New test source.
	* gas/mips/ld-zero-q.s: New test source.
	* gas/mips/ld-zero-u.s: New test source.
	* gas/mips/mips.exp: Run the new tests.
2013-05-28 22:19:34 +00:00
Yufeng Zhang 418009c200 Correct the relocation names for R_AARCH64_TLSDESC_LD_PREL19 and R_AARCH64_TLSDESC_ADR_PAGE21. 2013-05-28 16:39:51 +00:00
Kyrylo Tkachov 0a8897c77c gas/
2013-05-28  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	* config/tc-arm.c (it_fsm_post_encode): Improve
	warning messages about deprecated IT block formats.

gas/testsuite
2013-05-28  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	* gas/arm/armv8-a-bad.l: Update expected warning message.
	* gas/arm/armv8-a-it-bad.l: Likewise.
2013-05-28 14:58:52 +00:00
Marcus Shawcroft 89d2a2a39e [AArch64] Range check only resolved relocations.
2013-05-28  Marcus Shawcroft  <marcus.shawcroft@arm.com>

        * config/tc-aarch64.c (md_apply_fix): Move value range checking
        inside fx_done condition.

2013-05-28  Marcus Shawcroft  <marcus.shawcroft@arm.com>

        * gas/aarch64/adr_1.d: New file.
        * gas/aarch64/adr_1.s: New file.
        * gas/aarch64/b_1.d: New file.
        * gas/aarch64/b_1.s: New file.
        * gas/aarch64/beq_1.d: New file.
        * gas/aarch64/beq_1.s: New file.
        * gas/aarch64/ldr_1.d: New file.
        * gas/aarch64/ldr_1.s: New file.
        * gas/aarch64/tbz_1.d: New file.
        * gas/aarch64/tbz_1.s: New file.
2013-05-28 09:43:42 +00:00
Richard Sandiford c77c0862b2 include/opcode/
2013-05-22  Jürgen Urban  <JuergenUrban@gmx.de>

	* mips.h (M_LQC2_AB, M_SQC2_AB): New macros.

opcodes/
2013-05-22  Jürgen Urban  <JuergenUrban@gmx.de>

	* mips-opc.c (mips_builtin_opcodes): Add R5900 VU0 instructions.

gas/
2013-05-22  Jürgen Urban  <JuergenUrban@gmx.de>

	* config/tc-mips.c (macro): Handle M_LQC2_AB and M_SQC2_AB.

gas/testsuite/
2013-05-22  Jürgen Urban  <JuergenUrban@gmx.de>

	* gas/mips/r5900-full.s, gas/mips/r5900-full.d: Add tests for LQ
	and SQ macros.
	* gas/mips/r5900-vu0.s, gas/mips/r5900-vu0.d: New test.
	* gas/mips/mips.exp: Run it.
2013-05-22 18:08:26 +00:00
Peter Bergner c0637f3af6 opcodes/
* ppc-dis.c (powerpc_init_dialect): Set default dialect to power8.
	* ppc-opc.c (BHRBE, ST, SIX, PS, SXL, VXPS_MASK, XX1RB_MASK,
	XLS_MASK, PPCVSX2): New defines.
	(powerpc_opcodes) <bcdadd., bcdsub., bctar, bctar, bctarl, clrbhrb,
	fmrgew, fmrgow, lqarx, lxsiwax, lxsiwzx, lxsspx, mfbhrbe,
	mffprd, mffprwz, mfvrd, mfvrwz, mfvsrd, mfvsrwz, msgclrp, msgsndp,
	mtfprd, mtfprwa, mtfprwz, mtsle, mtvrd, mtvrwa, mtvrwz, mtvsrd,
	mtvsrwa, mtvsrwz, pbt., rfebb, stqcx., stxsiwx, stxsspx,
	vaddcuq, vaddecuq, vaddeuqm, vaddudm, vadduqm, vbpermq, vcipher,
	vcipherlast, vclzb, vclzd, vclzh, vclzw, vcmpequd, vcmpequd.,
	vcmpgtsd, vcmpgtsd., vcmpgtud, vcmpgtud., veqv, vgbbd, vmaxsd,
	vmaxud, vminsd, vminud, vmrgew, vmrgow, vmulesw, vmuleuw, vmulosw,
	vmulouw, vmuluwm, vnand, vncipher, vncipherlast, vorc, vpermxor,
	vpksdss, vpksdus, vpkudum, vpkudus, vpmsumb, vpmsumd, vpmsumh,
	vpmsumw, vpopcntb, vpopcntd, vpopcnth, vpopcntw, vrld, vsbox,
	vshasigmad, vshasigmaw, vsld, vsrad, vsrd, vsubcuq, vsubecuq,
	vsubeuqm, vsubudm, vsubuqm, vupkhsw, vupklsw, waitasec, xsaddsp,
	xscvdpspn, xscvspdpn, xscvsxdsp, xscvuxdsp, xsdivsp, xsmaddasp,
	xsmaddmsp, xsmsubasp, xsmsubmsp, xsmulsp, xsnmaddasp, xsnmaddmsp,
	xsnmsubasp, xsnmsubmsp, xsresp, xsrsp, xsrsqrtesp, xssqrtsp,
	xssubsp, xxleqv, xxlnand, xxlorc>: New instructions.
	<lxvx, stxvx>: New extended mnemonics.

gas/
	* config/tc-ppc.c (ppc_setup_opcodes): Use new_seg to fix error
	and clean up warning when using PRINT_OPCODE_TABLE.

gas/testsuite/
	* gas/ppc/altivec2.d <bcdadd., bcdadd., vaddcuq, vaddecuq, vaddeuqm,
	vaddudm, vadduqm, vbpermq, vcipher, vcipherlast, vclzb, vclzd, vclzh,
	vclzw, vcmpequd, vcmpequd., vcmpgtsd, vcmpgtsd., vcmpgtud, vcmpgtud.,
	veqv, vgbbd, vmaxsd, vmaxud, vminsd, vminud, vmrgew, vmrgow, vmulesw,
	vmuleuw, vmulosw, vmulouw, vmuluwm, vnand, vncipher, vncipherlast,
	vorc, vpermxor, vpksdss, vpksdus, vpkudum, vpkudus, vpmsumb, vpmsumd,
	vpmsumh, vpmsumw, vpopcntb, vpopcntd, vpopcnth, vpopcntw, vrld, vsbox,
	vshasigmad, vshasigmaw, vsld, vsrad, vsrd, vsubcuq, vsubecuq, vsubeuqm,
	vsubudm, vsubuqm, vupkhsw, vupklsw>: Add new tests.
	* gas/ppc/altivec2.s: Likewise.
	* gas/ppc/power8.d <bcdadd., bcdsub., bctar, bctarl, clrbhrb, fmrgew,
	fmrgow, lqarx, lxsiwax, lxsiwzx, lxsspx, mfbhrbe, mfvsrd, mfvsrwz,
	msgclrp, msgsndp, mtsle, mtvsrd, mtvsrwa, mtvsrwz, pbt., rfebb,
	stqcx., stxsiwx, stxsspx, vaddcuq, vaddecuq, vaddeuqm, vaddudm,
	vadduqm, vbpermq, vcipher, vcipherlast, vclzb, vclzd, vclzh, vclzw,
	vcmpequd, vcmpequd., vcmpgtsd, vcmpgtsd., vcmpgtud, vcmpgtud., veqv,
	vgbbd, vmaxsd, vmaxud, vminsd, vminud, vmrgow, vmulesw, vmuleuw,
	vmulosw, vmulouw, vmuluwm, vnand, vncipher, vncipherlast, vorc,
	vpermxor, vpksdss, vpksdus, vpkudum, vpkudus, vpmsumb, vpmsumd,
	vpmsumh, vpmsumw, vpopcntb, vpopcntd, vpopcnth, vpopcntw, vrld, vsbox,
	vshasigmad, vshasigmaw, vsld, vsrad, vsrd, vsubcuq, vsubecuq, vsubeuqm,
	vsubuqm, vupkhsw, vupklsw, waitasec, xsaddsp, xscvdpspn, xscvspdpn,
	xscvsxdsp, xscvuxdsp, xsdivsp, xsmaddasp, xsmaddmsp, xsmsubasp,
	xsmsubmsp, xsmulsp, xsnmaddasp, xsnmaddmsp, xsnmsubasp, xsnmsubmsp,
	xsresp, xsrsp, xsrsqrtesp, xssqrtsp, xssubsp, xxleqv, xxlnand,
	xxlorc>: Add new tests.
	* gas/ppc/power8.s Likewise.
	* gas/ppc/vsx.d <lxvd2x, stxvd2x>: Add new tests.
	* gas/ppc/vsx.s Likewise.
	* gas/ppc/vsx2.d: New test file.
	* gas/ppc/vsx2.s: Likewise.
	* gas/ppc/ppc.exp: Run it.
2013-05-21 01:36:46 +00:00
Alan Modra 5656a9815d * config/tc-ppc.c (md_apply_fix): Hoist code common to insn
and data fixups performing shift/high adjust/sign extension on
	fieldval.  Sink fx_pcrel handling and checks.  Use fixP->fx_size
	when writing data fixups rather than recalculating size.
2013-05-20 10:16:31 +00:00
Jan-Benedict Glaw 997b26e88c * doc/c-msp430.texi: Fix typo.
also:	* ChangeLog: Fix entry.
2013-05-16 16:47:14 +00:00
Tristan Gingold 9f6e76f4ea bfd/
2013-05-16  Tristan Gingold  <gingold@adacore.com>

	* coff-rs6000.c (_bfd_xcoff_reloc_type_lookup): Handle BFD_RELOC_16.
	* coff64-rs6000.c (xcoff64_reloc_type_lookup): Likewise.


gas/
2013-05-16  Tristan Gingold  <gingold@adacore.com>

	* config/tc-ppc.c (ppc_is_toc_sym): Symbols of class XMC_TC
	are also TOC symbols.
2013-05-16 15:41:40 +00:00
Nick Clifton 638d380363 * config/tc-msp430.c: Make -mmcu recognise more part numbers.
Add -mcpu command to specify core type.
	* doc/c-msp430.c: Update documentation.
	* gas/msp430/opcodes.s: Use correct value for .arch pseudo.
	* gas/msp430/msp430x.d: Use correct value for -mcpu option.
2013-05-16 13:19:40 +00:00
Yufeng Zhang f50909cf22 Corrected the changelog entry in the previous commit. 2013-05-13 22:33:54 +00:00
Yufeng Zhang d2865ed314 gas/
* testsuite/gas/aarch64/diagnostic.s: Update.
	* testsuite/gas/aarch64/diagnostic.l: Ditto.
	* testsuite/gas/aarch64/movi.s: Add new tests.
	* testsuite/gas/aarch64/movi.d: Update.

opcodes/

	* aarch64-asm.c (aarch64_ins_advsimd_imm_modified): Remove assertion.
	* aarch64-opc.c (operand_general_constraint_met_p): Relax the range
	check from [0, 255] to [-128, 255].
2013-05-13 22:28:27 +00:00
Andrew Pinski b015e599c7 binutils/ChangeLog:
* doc/binutils.texi: Document -Mvirt disassembler option.

gas/ChangeLog:
* config/tc-mips.c (struct mips_set_options): New ase_virt field.
(mips_opts): Update for the new field.
(file_ase_virt): New variable.
(ISA_SUPPORTS_VIRT_ASE): New macro.
(ISA_SUPPORTS_VIRT64_ASE): New macro.
(MIPS_CPU_ASE_VIRT): New define.
(is_opcode_valid): Handle ase_virt.
(macro_build): Handle "+J".
(validate_mips_insn): Likewise.
(mips_ip): Likewise.
(enum options): Add OPTION_VIRT and OPTION_NO_VIRT.
(md_longopts): Add mvirt and mnovirt
(md_parse_option): Handle OPTION_VIRT and OPTION_NO_VIRT.
(mips_after_parse_args): Handle ase_virt field.
(s_mipsset): Handle "virt" and "novirt".
(mips_elf_final_processing): Add a comment about virt ASE might need a new flag.
(md_show_usage): Print out the usage of -mvirt and mno-virt options.
* doc/c-mips.texi: Document -mvirt and -mno-virt.
Document ".set virt" and ".set novirt".

gas/testsuite/ChangeLog:
* gas/mips/mips.exp: Run virt and virt64 testcases.
* gas/mips/virt.d: New file.
* gas/mips/virt.s: New file.
* gas/mips/virt64.d: New file.
* gas/mips/virt64.s: New file.

include/opcode/ChangeLog:
* mips.h (OP_MASK_CODE10): Correct definition.
(OP_SH_CODE10): Likewise.
Add a comment that "+J" is used now for OP_*CODE10.
(INSN_ASE_MASK): Update.
(INSN_VIRT): New macro.
(INSN_VIRT64): New macro

opcodes/ChangeLog:
* mips-dis.c (mips_arch_choices): Add INSN_VIRT to mips32r2 .
Add INSN_VIRT and INSN_VIRT64 to mips64r2.
(parse_mips_dis_option): Handle the virt option.
(print_insn_args): Handle "+J".
(print_mips_disassembler_options): Print out message about virt64.
* mips-opc.c (IVIRT): New define.
(IVIRT64): New define.
(mips_builtin_opcodes): Add dmfgc0, dmtgc0, hypcall, mfgc0, mtgc0,
tlbgr, tlbgwi, tlbginv, tlbginvf, tlbgwr, tlbgp VIRT instructions.
Move rfe to the bottom as it conflicts with tlbgp.
2013-05-10 01:08:48 +00:00
Alan Modra da8094d796 * config/tc-ppc.c (md_apply_fix): Sign extend fieldval under
control of operand flag bits.
2013-05-09 04:01:53 +00:00
Alan Modra c5f8c20532 * config/tc-ppc.c (PPC_VLE_SPLIT16A): Delete unused macro.
(PPC_VLE_SPLIT16D, PPC_VLE_LO16A, PPC_VLE_LO16D): Likewise.
	(PPC_VLE_HI16A, PPC_VLE_HI16D): Likewise.
	(PPC_VLE_HA16A, PPC_VLE_HA16D): Likewise.
	(md_apply_fix): Set fx_no_overflow for assorted relocations.
	Shift and sign-extend fieldval for use by some VLE reloc
	operand->insert functions.
2013-05-06 23:36:48 +00:00
Catherine Moore b47468a6db 2013-05-06 Paul Brook <paul@codesourcery.com>
include/elf/
        * mips.h (R_MIPS_PC32): Update comment.

        * elf64-mips.c (elf_mips_gnu_pcrel32): New.
        (bfd_elf64_bfd_reloc_type_lookup, bfd_elf64_bfd_reloc_name_lookup,
        mips_elf64_rtype_to_howto): Handle R_MIPS_PC32.
        * elfn32-mips.c (elf_mips_gnu_pcrel32): New.
        (bfd_elfn32_bfd_reloc_type_lookup, bfd_elfn32_bfd_reloc_name_lookup,
        mips_elfn32_rtype_to_howto): Handle R_MIPS_PC32.

2013-05-06  Paul Brook  <paul@codesourcery.com>
	    Catherine Moore  <clm@codesourcery.com>

        gas/
        * config/tc-mips.c (md_pcrel_from): Handle BFD_RELOC_32_PCREL.
        (limited_pcrel_reloc_p): Likewise.
	(md_apply_fix): Likewise.
	(tc_gen_reloc): Likewise.
2013-05-06 15:25:45 +00:00
Catherine Moore 2de39019a2 2013-05-06 Richard Sandiford <rdsandiford@googlemail.com>
* config/tc-mips.c (limited_pcrel_reloc_p): New function.
	(mips_fix_adjustable): Adjust pc-relative check to use
	limited_pc_reloc_p.
2013-05-06 15:00:01 +00:00
Richard Sandiford 754e2bb948 gas/
* config/tc-mips.c (mips_pseudo_table): Add stabd and stabs entries.
	(s_mips_stab): Do not restrict to stabn only.

gas/testsuite/
	* gas/mips/mips16-stabs.s, gas/mips/mips16-stabs.d: New test.
	* gas/mips/mips.exp: Run it.
2013-05-02 22:30:11 +00:00
Nick Clifton 13761a1136 * archures.c: Add some more MSP430 machine numbers.
* config.bfd (msp430): Define targ_selvecs.
	* configure.in: Add bfd_elf32_msp430_ti_vec.
	* cpu-msp430.c: Add some more MSP430 machine numbers.
	* elf32-msp430.c Add support for MSP430X relocations.
	Add support for TI compiler generated relocations.
	Add support for sym_diff relocations.
	Add support for relaxing out of range short branches into long
	branches.
	Add support for MSP430 attribute section.
	* reloc.c: Add MSP430X relocations.
	* targets.c: Add bfd_elf32_msp430_ti_vec.
	* bfd-in2.h: Regenerate.
	* configure: Regenerate.
	* libbfd.h: Regenerate.

	* readelf.c: Add support for MSP430X architecture.

	* readelf.exp: Expect -wi test to fail for the MSP430.

	* config/tc-msp430.c: Add support for the MSP430X architecture.
	Add code to insert a NOP instruction after any instruction that
	might change the interrupt state.
	Add support for the LARGE memory model.
	Add code to initialise the .MSP430.attributes section.
	* config/tc-msp430.h: Add support for the MSP430X architecture.
	* doc/c-msp430.texi: Document the new -mL and -mN command line
	options.
	* NEWS: Mention support for the MSP430X architecture.

	* gas/all/gas.exp: Skip the DIFF1 test for the MSP430.
	Expect the FORWARD test to pass for the MSP430.
	Skip the REDEF tests for the MSP430.
	Expect the 930509A test to fail for the MSP430.
	* gas/all/sleb128-4.d: Skip for the MSP430.
	* gas/elf/elf.exp: Set target_machine to msp430 for the MSP430.
	Skip the EHOPT0 test for the MSP430.
	Skip the REDEF and EQU-RELOC tests for the MSP430.
	* gas/elf/section2.e-msp430: New file.
	* gas/lns/lns-big-delta.d: Remove expectation of 20-bit
	addresses.
	* gas/lns/lns.exp: Use alternate LNS COMMON test for the MSP430.
	* gas/msp430/msp430x.s: New test.
	* gas/msp430/msp430x.d: Expected disassembly.
	* gas/msp430/msp430.exp: Run new test.
	* gas/msp430/opcode.d: Update expected disassembly.

	* msp430.h: Add MSP430X relocs.
	Add some more MSP430 machine numbers.
	Add values used by .MSP430.attributes section.

	* msp430.h: Add patterns for MSP430X instructions.

	* Makefile.am: Add emsp430X.c
	* Makefine.in: Regenerate.
	* configure.tgt (msp430): Add msp430X emulation.
	* ldmain.c (multiple_definition): Only disable relaxation if it
	was enabled by the user.
	* ldmain.h (RELAXATION_ENABLED_BY_USER): New macro.
	* emulparams/msp430all.sh: Add support for MSP430X.
	* emultempl/generic.em: (before_parse): Enable relaxation for the
	MSP430.
	* scripttempl/msp430.sc: Reorganize sections.  Add .rodata
	section.
	* scripttempl/msp430_3.sc: Likewise.
	* NEWS: Mention support for MSP430X.

	* ld-elf/flags1.d: Expect this test to pass on the MSP430.
	* ld-elf/init-fini-arrays.d: Expect this test to fail on the
	MSP430.
	* ld-elf/merge.d: Expect this test to pass on the MSP430.
	* ld-elf/sec64k.exp: Skip these tests for the MSP430.
	* ld-gc/pr13683.d: Expect this test to fail on the MSP430.
	* ld-srec/srec.exp: Expect these tests to fail on the MSP430.
	* ld-undefined/undefined.exp: Expect the UNDEFINED LINE test to
	fail on the MSP430.

	* msp430-dis.c: Add support for MSP430X instructions.
2013-05-02 21:06:15 +00:00
Maciej W. Rozycki df26367c79 bfd/
* config.bfd: Replace alpha*-*-linuxecoff* pattern with
	alpha*-*-linux*ecoff*.

	binutils/testsuite/
	* lib/binutils-common.exp (is_elf_format): Also exclude
	*-*-linux*ecoff*.

	gas/
	* configure.tgt: Replace alpha*-*-linuxecoff* pattern with
	alpha*-*-linux*ecoff*.

	ld/
	* configure.tgt: Replace alpha*-*-linuxecoff* pattern with
	alpha*-*-linux*ecoff*.  Update the `sed' pattern used to convert
	from alpha*-*-linux-* to alpha*-*-linux*ecoff*.
2013-05-01 17:27:46 +00:00
Chao-ying Fu f02d83189e 2013-04-30 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
* config/tc-mips.c (mips_ip): Add sizelo.
	For "+C", "+G", and "+H", set sizelo and compare against it.
2013-05-01 01:02:01 +00:00
Nick Clifton b40bf0a255 * elflink.c (_bfd_elf_gc_mark_extra_sections): Remove mark from
fragmented .debug_line sections associated with unmarked code
	sections.

	* dwarf.c (read_debug_line_header): New function.  Reads in a
	header in a .debug_line section.
	(display_debug_lines_raw): Use new function.  Handle fragmentary
	.debug_line sections.
	(display_debug_lines_decoded): Likewise.
	* readelf.c (process_section_headers): Handle fragmenatry
	.debug_line sections.
	(display_debug_section): Likewise.

	* as.c (Options): Add -gdwarf-sections.
	(parse_args): Likewise.
	* as.h (flag_dwarf_sections): Declare.
	* dwarf2dbg.c (emit_fixed_inc_line_addr): Skip section changes.
	(process_entries): When -gdwarf-sections is enabled generate
	fragmentary .debug_line sections.
	(out_debug_line): Set the section for the .debug_line section end
	symbol.
	* doc/as.texinfo: Document -gdwarf-sections.
	* NEWS: Mention -gdwarf-sections.

	* gas/elf/dwarf2-3.d: Fix expected readelf output.

	* scripttempl/DWARF.sc: Add support for .debug_line.* and
	.debug_line_end.
2013-04-29 13:38:59 +00:00
Christian Groessler 8eeccb77c3 fix changelog entry: we still have 2013, not 2014 2013-04-26 19:31:15 +00:00
Christian Groessler 00a3147e7e * config/tc-z8k.c (md_parse_option): Set z8k_target_from_cmdline
according to the target parameter.  Don't call s_segm since s_segm
	calls bfd_set_arch_mach using stdoutput, but stdoutput isn't
	initialized yet.
	(md_begin): Call s_segm according to target parameter from command
	line.
2013-04-26 19:21:25 +00:00
Alan Modra 49926cd0c8 bfd/
* config.bfd: Add powerpc64le-linux.
gas/
	* configure.in: Allow little-endian linux.
	* configure: Regenerate.
gold/
	* configure.tgt: Add powerpcle and powerpc64le.
ld/
	* Makefile.am (ALL_EMULATION_SOURCES): Add eelf32lppclinux.c.
	(eelf32lppclinux.c): New rule.
	* Makefile.in: Regenerate.
	* configure.tgt: Merge powerpc-linux and other powerpc-elf targets
	with corresponding little-endian targets.
	* emulparams/elf32lppc.sh: Update comment.
	* emulparams/elf32lppclinux.sh: New.
2013-04-25 13:22:52 +00:00
Sandra Loosemore e3031850bc 2013-04-24 Sandra Loosemore <sandra@codesourcery.com>
gas/
	* config/tc-nios2.c (nios2_control_register_arg_p): Rename
	"fstatus" control register to "eccinj".

	opcodes/
	* nios2-opc.c (nios2_builtin_reg): Rename "fstatus" control register
	to "eccinj".
2013-04-24 20:51:58 +00:00
Kai Tietz cb948fc00e * configure.tgt (i386-*-cygwin): Handle x86_64 cygwin. 2013-04-19 09:10:28 +00:00
Julian Brown 4455e9aded gas/
* expr.c (add_to_result, subtract_from_result): Make global.
    * expr.h (add_to_result, subtract_from_result): Add prototypes.
    * config/tc-sh.c (sh_optimize_expr): Use add_to_result,
    subtract_from_result to handle extra bit of precision for .sleb128
    directive operands.

    gas/testsuite/
    * gas/all/gas.exp (sleb128-7): Don't run for tic4x, tic54x.
    * gas/all/sleb128-2.s: Reformat, use _ at start of labels, remove
    cruft.
    * gas/all/sleb128-3.s: Likewise.
    * gas/all/sleb128-4.s: Likewise.
    * gas/all/sleb128-5.s: Likewise.
    * gas/all/sleb128-7.s: Likewise.
    * gas/all/sleb128-2.d: Handle data sections named $DATA$.
    * gas/all/sleb128-3.d: Likewise.
    * gas/all/sleb128-4.d: Likewise.
    * gas/all/sleb128-5.d: Likewise.
    * gas/all/sleb128-7.d: Likewise.
2013-04-15 10:30:23 +00:00
Julian Brown 956a6ba3fe gas/
* read.c (convert_to_bignum): Add sign parameter. Use it
    instead of X_unsigned to determine sign of resulting bignum.
    (emit_expr): Pass extra argument to convert_to_bignum.
    (emit_leb128_expr): Use X_extrabit instead of X_unsigned. Pass
    X_extrabit to convert_to_bignum.
    (parse_bitfield_cons): Set X_extrabit.
    * expr.c (make_expr_symbol, expr_build_uconstant, operand):
    Initialise X_extrabit field as appropriate.
    (add_to_result): New.
    (subtract_from_result): New.
    (expr): Use above.
    * expr.h (expressionS): Add X_extrabit field.

    gas/testsuite/
    * gas/all/sleb128-2.s: New test.
    * gas/all/sleb128-3.s: Likewise.
    * gas/all/sleb128-4.s: Likewise.
    * gas/all/sleb128-5.s: Likewise.
    * gas/all/sleb128-7.s: Likewise.
    * gas/all/sleb128-2.d: New.
    * gas/all/sleb128-3.d: New.
    * gas/all/sleb123-4.d: New.
    * gas/all/sleb123-5.d: New.
    * gas/all/sleb123-7.d: New.
    * gas/all/gas.exp (sleb128-2, sleb128-3, sleb128-4, sleb128-5)
    (sleb128-7): Run new tests.
2013-04-11 10:54:13 +00:00
Jan Beulich eb9f3f001f gas/
2013-04-10  Jan Beulich <jbeulich@suse.com>

	* gas/config/tc-arm.c (encode_arm_addr_mode_3): Only reject base
	register being PC when is_t or writeback, and use distinct
	diagnostic for the latter case.

gas/testsuite/
2013-04-10  Jan Beulich <jbeulich@suse.com>

	* gas/testsuite/gas/arm/ldst-pc.s: Add index, non-writeback
	forms of various loads and stores with PC as base.
	* gas/testsuite/gas/arm/ldst-pc.d: Update accordingly.
2013-04-10 13:20:05 +00:00
Jan Beulich ccb84d658f gas/
2013-04-10  Jan Beulich <jbeulich@suse.com>

	* gas/config/tc-arm.c (parse_operands): Re-write
	po_barrier_or_imm().
	(do_barrier): Remove bogus constraint().
	(do_t_barrier): Remove.

gas/testsuite/
2013-04-10  Jan Beulich <jbeulich@suse.com>

	* gas/arm/barrier-bad.d: Change title.
	* gas/arm/barrier-bad.s: Add immediate form of ISB and DSB as
	well as one symbolic form of DSB.
	* gas/arm/barrier-bad.l: Update accordingly.
	* gas/arm/barrier-bad-thumb.d: Adjust title. Use barrier-bad.s as
	source. Pass -mthumb to gas.
	* gas/arm/barrier-bad-thumb.l: Remove.
	* gas/arm/barrier-bad-thumb.s: Remove.
	* gas/arm/barrier-thumb.d: Adjust title. Use barrier.s as source.
	Pass -mthumb to gas.
	* gas/arm/barrier-thumb.s: Remove.
2013-04-10 13:18:33 +00:00
Nick Clifton 4d13caa0b9 * gas/config/tc-avr.c (mcu_types): Add ATmega64RFR2,
ATmega644RFR2, ATmega128RFR2, ATmega1284RFR2, ATmega256RFR2,
	ATmega2564RFR2
	* gas/doc/c-avr.texi (-mmcu documentation): Likewise.
2013-04-09 15:39:37 +00:00
Jan Beulich 16d02dc907 gas/
2013-04-09  Jan Beulich <jbeulich@suse.com>

	* gas/config/tc-arm.c (do_vmrs): Accept all control registers.
	Use local variable Rt in more places.
	(do_vmsr): Accept all control registers.

gas/testsuite/
2013-04-09  Jan Beulich <jbeulich@suse.com>

	* gas/arm/vfp1xD.s: Add VMRS/VMSR tests with FPINST, FPINST2,
	and C15.
	* gas/arm/vfp1xD.d: Update accordingly.
2013-04-09 11:07:06 +00:00
Jan Beulich 05ac0ffbb5 gas/
2013-04-09  Jan Beulich <jbeulich@suse.com>

	* gas/config/tc-arm.c (do_neon_mov): Fake an instruction suffix
	if there was none specified for moves between scalar and core
	register.

gas/testsuite/
2013-04-09  Jan Beulich <jbeulich@suse.com>

	* gas/arm/neon-omit.s: Add tests for suffix less VMOV.
	* gas/arm/neon-omit.d: Update accordingly.
2013-04-09 11:05:45 +00:00
Jan Beulich 2d51fb7431 gas/
2013-04-09  Jan Beulich <jbeulich@suse.com>

	* gas/config/tc-arm.c (do_neon_ldx_stx): Reject VSTn in the
	NEON_ALL_LANES case.

gas/testsuite/
2013-04-09  Jan Beulich <jbeulich@suse.com>

	* gas/arm/neon-addressing-bad.s: Add test for further invalid VST
	operands.
	* gas/arm/neon-addressing-bad.l: Update accordingly.
2013-04-09 11:04:24 +00:00
Jan Beulich 94dcf8bfcd gas/
2013-04-08  Jan Beulich <jbeulich@suse.com>

	* gas/config/tc-arm.c (do_neon_ldr_str): Correct disgnostics for
	PC-relative VSTR.
2013-04-08 11:07:38 +00:00
Jan Beulich 1472d06fd6 gas/
2013-04-08  Jan Beulich <jbeulich@suse.com>

	* gas/config/tc-arm.c (reg_names): Convert duplicate SP_fiq
	entry to sp_fiq.
2013-04-08 11:06:30 +00:00
Alan Modra 0c76cae8b2 * doc/as.texinfo: Add support to generate man options for h8300.
* doc/c-h8300.texi: Likewise.
2013-04-03 02:48:37 +00:00
Ramana Radhakrishnan 92eb40d9df Add support for Cortex-A53 and Cortex-A57. 2013-03-28 11:00:15 +00:00
Nick Clifton 51dcdd4d3e PR binutils/15068
* tic6x-dis.c: Add support for displaying 16-bit insns.
	* tic6xc-insn-formats.h (FLD): Add use of bitfield array.
	Add 16-bit opcodes.
	* tic6xc-opcode-table.h: Add 16-bit insns.
	* tic6x.h: Add support for 16-bit insns.
	* config/tc-tic6x.c (tic6x_try_encode): Add use of bitfields array.
	* gas/tic6x/insns16-d-unit.s: New test.
	* gas/tic6x/insns16-d-unit.d: Expected disassembly.
	* gas/tic6x/insns16-ddec.s: New test.
	* gas/tic6x/insns16-ddec.d: Expected disassembly.
	* gas/tic6x/insns16-dinc.s: New test.
	* gas/tic6x/insns16-dinc.d: Expected disassembly.
	* gas/tic6x/insns16-dind.s: New test.
	* gas/tic6x/insns16-dind.d: Expected disassembly.
	* gas/tic6x/insns16-doff4.s: New test.
	* gas/tic6x/insns16-doff4.d: Expected disassembly.
	* gas/tic6x/insns16-l-unit.s: New test.
	* gas/tic6x/insns16-l-unit.d: Expected disassembly.
	* gas/tic6x/insns16-lsd-unit.s: New test.
	* gas/tic6x/insns16-lsd-unit.d: Expected disassembly.
	* gas/tic6x/insns16-m-unit.s: New test.
	* gas/tic6x/insns16-m-unit.d: Expected disassembly.
	* gas/tic6x/insns16-s-unit-pcrel.s: New test.
	* gas/tic6x/insns16-s-unit-pcrel.d: Expected disassembly.
	* gas/tic6x/insns16-s-unit: New test.
	* gas/tic6x/insns16-s-unit.d: Expected disassembly.
2013-03-27 11:43:37 +00:00
Nick Clifton 9b97828214 PR gas/15295
* listing.c (rebuffer_line): Rewrite to avoid seeking back to the
	start of the file each time.
2013-03-26 14:16:59 +00:00
Nick Clifton c5d685bf3a PR gas/15178
* config/tc-sparc.h (ELF_TARGET_FORMAT): Set to elf32-sparc for
	FreeBSD targets.
2013-03-26 13:49:12 +00:00
Tristan Gingold 9699c8332a gas/
2013-03-26  Douglas B Rupp  <rupp@gnat.com>

	* config/tc-ia64.c (emit_one_bundle): Move last_slot adjustment
	after fixup.

gas/testsuite/
2013-03-26  Douglas B Rupp  <rupp@adacore.com

	* gas/ia64/ia64.exp: Add new test reloc-mlx
	* gas/ia64/reloc-mlx.[sd]: New test for X-unit reloc.
	* gas/ia64/pcrel.d: Fix output for X-unit reloc.
2013-03-26 09:13:17 +00:00
Will Newton 4755303e50 gas/ChangeLog:
2013-03-21  Will Newton  <will.newton@linaro.org>

	* config/tc-arm.c (encode_thumb32_addr_mode): Emit an error for all
	pc-relative str instructions in Thumb mode.

gas/testsuite/ChangeLog:

2013-03-21  Will Newton  <will.newton@linaro.org>

	* gas/arm/thumb2_relax.d: Strip out invalid pc-relative strs.
	* gas/arm/thumb2_relax.s: Likewise.
	* gas/arm/thumb32.d: Likewise.
	* gas/arm/thumb32.l: Likewise.
	* gas/arm/thumb32.s: Likewise.
	* gas/arm/thumb2_str-bad.d: New file.
	* gas/arm/thumb2_str-bad.l: Likewise.
	* gas/arm/thumb2_str-bad.s: Likewise.
2013-03-21 18:39:35 +00:00
Nick Clifton 81f5558e3d * elf32-h8300 (h8_relax_section): Add new relaxation of mov
@(disp:32,ERx) to mov @(disp:16,ERx).
	(R_H8_DISP32A16): New reloc.
	Comments added and corrected.
	* reloc.c (BFD_RELOC_H8_DISP32A16): New reloc.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.

	* ld.texinfo (H8/300): Add description of relaxation of
	mov @(disp:32,ERx) to mov @(disp:16,ERx).

	* ld-h8300/h8300.exp: Add new relax-7 test on ELF.
	* ld-h8300/relax-2.s: Add other direction and .w/.l variants of
	mov insns.
	* ld-h8300/relax-2.d: Update expected disassembly.
	* ld-h8300/relax-7a.s: New: tests for mov @(disp:32,ERx) -> mov
	@(disp:16,ERx).
	* ld-h8300/relax-7b.s: New: Likewise.
	* ld-h8300/relax-7.d: New: expected disassembly.

	* config/tc-h8300.c (do_a_fix_imm): Add relaxation of mov
	@(disp:32,ERx) to mov @(disp:16,ERx) insns by new reloc
	R_H8_DISP32A16.
	* config/tc-h8300.h: Remove duplicated defines.
2013-03-21 16:08:07 +00:00
Nick Clifton 71863e733e PR gas/15282
* tc-avr.c (mcu_has_3_byte_pc): New function.
	(tc_cfi_frame_initial_instructions): Call it to find return
	address size.
2013-03-21 14:47:34 +00:00
Nick Clifton 795b8e6bf3 * include/opcode/tic6x.h: add tic6x_coding_dreg_(msb|lsb) field coding type in
order to encode separately the msb and lsb of a register pair ; this will be
needed to encode the opcodes the same
way as Ti assembler does.

* gas/config/tc-tic6x.c: handle tic6x_coding_dreg_(msb|lsb)  field coding types
and use it to encode register pair numbers when required.

* opcodes/tic6x-dis.c: decodes opcodes that have individual msb and lsb halves
in src1 & src2 fields ; discard the src1 (lsb) value and only use src2 (msb),
discarding bit 0, to follow what Ti SDK does in that case as any value in the
src1 field yields the same output with SDK disassembler.

* include/opcode/tic6x-opcode-table.h: modify absdp, dpint, dpsp, dptrunc,
rcpdp and rsqrdp opcodes to use the new field coding types.

* gas/testsuite/gas/tic6x/insns-c674x.d, gas/testsuite/gas/tic6x/insns-c674x.s
: add test case for the newly generated opcode but keep the old ones as they
seem legit as per Ti disassembler output.
2013-03-20 16:36:34 +00:00
Will Newton ba86b375f0 gas/ChangeLog:
2013-03-12  Will Newton  <will.newton@linaro.org>

	* config/tc-arm.c (do_neon_ldr_str): Fix error check for PC register
	in vstr in Thumb mode for pre-ARMv7 cores.

gas/testsuite/ChangeLog:

2013-03-12  Will Newton  <will.newton@linaro.org>

	* gas/arm/vstr-thumb-bad.d: Assemble with -mcpu=arm1156t2f-s.
2013-03-15 15:53:39 +00:00
Andreas Schwab 9e6f381133 * doc/c-arc.texi (ARC Directives): Revert last change and use
@itemize instead of @table.
* doc/c-arm.texi (ARM-Instruction-Set): Likewise.
2013-03-14 16:17:45 +00:00
Nick Clifton b10bf8c587 PR gas/15273
* config/tc-arm.c (do_co_reg): Do not call check_obsolete with a
	NULL message, instead just check ARM_CPU_IS_ANY directly.
2013-03-14 10:23:13 +00:00
Nick Clifton ba724cfc0c PR gas/15212
* doc/c-arc.texi (ARC Directives): Use @code instead of @bullte
	for table format.
	* doc/c-arm.texi (ARM-Instruction-Set): Likewise.  Also add text
	to the @item directives.
	(ARM-Neon-Alignment): Move to correct place in the document.
	* doc/c-cr16.texi (CR16 Operand Qualifiers): Fix up table
	formatting.
	* doc/c-tic54x.texi (TIC54X-Subsyms): Correct use of
	@smallexample.
2013-03-14 10:00:46 +00:00
Sandra Loosemore 531a94fdb5 2013-03-12 Sebastian Huber <sebastian.huber@embedded-brains.de>
include/
	* opcode/nios2.h: Edit comment.

	gas/
	* config/tc-nios2.c (nios2_consume_arg): Delete 'k' case.  Add 'o'
	case.  Add default BAD_CASE to switch.

	gas/testsuite/
	* gas/nios2/break.d: Check instruction values.
2013-03-12 19:18:57 +00:00
Sandra Loosemore dad60f8e13 2013-03-11 Sebastian Huber <sebastian.huber@embedded-brains.de>
include/
	* opcode/nios2.h (OPX_WRPRS): New define.
	(OP_MATCH_WRPRS): Likewise.

	opcodes/
	* nios2-opc.c (nios2_builtin_opcodes): Add entry for wrprs.

	gas/
	* config/tc-nios2.c (nios2_assemble_args_ds): New function.
	(nios2_arg_info_structs): Add "d,s" and "d,s,E" entries.

	gas/testsuite/
	* gas/nios2/nios2.exp: Run wrprs.
	* gas/nios2/wrprs.d: New file.
	* gas/nios2/wrprs.s: Likewise.
2013-03-12 02:41:26 +00:00
Kyrylo Tkachov dd5181d57f Add support for AArch32 CRC instruction in ARMv8.
gas/ChangeLog
2013-03-11  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	* config/tc-arm.c (crc_ext_armv8): New feature set.
	(UNPRED_REG): New macro.
	(do_crc32_1): New function.
	(do_crc32b, do_crc32h, do_crc32w, do_crc32cb,
	do_crc32ch, do_crc32cw): Likewise.
	(TUEc): New macro.
	(insns): Add entries for crc32 mnemonics.
	(arm_extensions): Add entry for crc.

include/opcode/ChangeLog
2013-03-11  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	* arm.h (CRC_EXT_ARMV8): New constant.
	(ARCH_CRC_ARMV8): New macro.

opcodes/ChangeLog
2013-03-11  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	* arm-dis.c (arm_opcodes): Add entries for CRC instructions.
	(thumb32_opcodes): Likewise.
	(print_insn_thumb32): Handle 'S' control char.

gas/testsuite/ChangeLog
2013-03-11  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	* gas/arm/crc32-bad.d: New file.
	* gas/arm/crc32-bad.l: Likewise.
	* gas/arm/crc32-bad.s: Likewise.
	* gas/arm/crc32.d: Likewise.
	* gas/arm/crc32.s: Likewise.
2013-03-11 11:09:33 +00:00
Chung-Lin Tang 8e723a1045 2013-03-08 Chung-Lin Tang <cltang@codesourcery.com>
* write.h (struct fix): Add fx_dot_frag field.
	(dot_frag): Declare.
	* write.c (dot_frag): New variable.
	(fix_new_internal): Set fx_dot_frag field with dot_frag.
	(fixup_segment): Base calculation of fx_offset with fx_dot_frag.
	* expr.c (expr): Save value of frag_now in dot_frag when setting
	dot_value.
	* read.c (emit_expr): Likewise. Delete comments.
2013-03-08 10:17:00 +00:00
H.J. Lu be05d20139 Rewrote i386_index_check
* config/tc-i386.c (flag_code_names): Removed.
	(i386_index_check): Rewrote.
2013-03-07 21:40:06 +00:00
Yufeng Zhang 62b0d0d5f3 Add to the AArch64 GAS the missing support for hexadecimal-format
floating-point literal in the FMOV instruction.

gas/

	* config/tc-aarch64.c (aarch64_imm_float_p): Rename 'e' to 'pattern';
	add comment.
	(aarch64_double_precision_fmovable): New function.
	(parse_aarch64_imm_float): Add parameter 'dp_p'; call the new
	function; handle hexadecimal representation of IEEE754 encoding.
	(parse_operands): Update the call to parse_aarch64_imm_float.

gas/testsuite/

	* gas/aarch64/diagnostic.s: Add test.
	* gas/aarch64/diagnostic.l: Update.
	* gas/aarch64/illegal.s: Add test.
	* gas/aarch64/illegal.l: Update.
	* gas/aarch64/fpmov.s: New file.
	* gas/aarch64/fpmov.d: New file.
2013-03-05 16:31:44 +00:00
H.J. Lu 165de32ac8 Replace have_hle with hle_prefix
* config/tc-i386.c (_i386_insn): Replace have_hle with hle_prefix.
	(check_hle): Updated.
	(md_assemble): Likewise.
	(parse_insn): Likewise.
2013-02-28 21:08:04 +00:00
H.J. Lu d5de92cf93 Optimize REP prefix check
gas/

	* config/tc-i386.c (_i386_insn): Add rep_prefix.
	(md_assemble): Check if REP prefix is OK.
	(parse_insn): Remove expecting_string_instruction.  Set
	i.rep_prefix.

gas/testsuite/

	* gas/i386/i386.exp: Run inval-rep and x86-64-inval-rep.

	* gas/i386/inval-rep.l: New file.
	* gas/i386/inval-rep.s: Likewise.
	* gas/i386/x86-64-inval-rep.l: Likewise.
	* gas/i386/x86-64-inval-rep.s: Likewise.
2013-02-28 20:50:19 +00:00
Yufeng Zhang e60bb1dd35 include/opcode/
* aarch64.h (AARCH64_FEATURE_CRC): New macro.

opcodes/

	* aarch64-tbl.h (QL_I3SAMEW, QL_I3WWX): New macros.
	(aarch64_feature_crc): New static.
	(CRC): New macro.
	(aarch64_opcode_table): Add entries for the crc32b, crc32h, crc32w,
	crc32x, crc32cb, crc32ch, crc32cw and crc32cx instructions.
	* aarch64-asm-2.c: Re-generate.
	* aarch64-dis-2.c: Ditto.
	* aarch64-opc-2.c: Ditto.

gas/

	* config/tc-aarch64.c (aarch64_features): Add the 'crc' option.

gas/testsuite/

	* gas/aarch64/crc32.s: New test.
	* gas/aarch64/crc32.d: Ditto.
2013-02-28 19:18:40 +00:00
Yufeng Zhang aeebdd9b12 gas/
* config/tc-aarch64.c (parse_sys_reg): Allow the full range of CRn
	for system registers.

gas/testsuite/

	* gas/aarch64/illegal.l: Delete the error message for
	msr S3_1_C13_C15_1,x7.
	* gas/aarch64/sysreg.s: Add new tests.
	* gas/aarch64/sysreg.d: Update.
2013-02-28 18:51:05 +00:00
DJ Delorie 4107ae2218 * reloc.c (BFD_RELOC_RL78_CODE): Add.
* libbfd.h: Regenerate.
* bfd-in2.h: Regenerate.
* elf32-rl78.c (rl78_elf_relocate_section): Handle weak code
references in compuated relocs.

* config/tc-rl78.c (reloc_function): Add %code -> BFD_RELOC_RL78_CODE.
(rl78_op): Handle %code().
(rl78_cons_fix_new): Likewise, but ignore for 20-bit operands.
(tc_gen_reloc): Likwise; convert to a computed reloc.
(md_apply_fix): Likewise.
2013-02-27 21:39:20 +00:00
Nick Clifton 151fa98f80 * rl78-decode.opc: Fix encoding of DIVWU insn.
* rl78-decode.c: Regenerate.

	* config/rl78-parse.y: Fix encoding of DIVWU insn.
2013-02-25 18:41:06 +00:00
xuepeng guo 70a8bc5bb9 2013-02-25 Terry Guo <terry.guo@arm.com>
* config/tc-arm.c (arm_cpus): Add cortex-r7 entry.
	* doc/c-arm.texi: Add cortex-r7 and missing cortex-r5 to
	list of accepted CPUs.
2013-02-25 02:53:41 +00:00
H.J. Lu 5c111e3769 Implement Intel SMAP instructions
gas/

	PR gas/15159
	* config/tc-i386.c (cpu_arch): Add ".smap".

	* doc/c-i386.texi: Document smap.

gas/testsuite/

	PR gas/15159
	* gas/i386/i386.exp: Run smap and x86-64-smap.

	* gas/i386/smap.d: New file.
	* gas/i386/smap.s: likewise.
	* gas/i386/x86-64-smap.d: likewise.

opcodes/

	PR gas/15159
	* i386-dis.c (rm_table): Add clac and stac to RM_0F01_REG_1.

	* i386-gen.c (cpu_flag_init): Add CPU_SMAP_FLAGS.
	(cpu_flags): Add CpuSMAP.

	* i386-opc.h (CpuSMAP): New.
	(i386_cpu_flags): Add cpusmap.

	* i386-opc.tbl: Add clac and stac.

	* i386-init.h: Regenerated.
	* i386-tbl.h: Likewise.
2013-02-19 19:10:31 +00:00
Maciej W. Rozycki 8a75745d31 * config/tc-mips.c (s_cpload): Call mips_mark_labels and set
mips_assembling_insn appropriately.
	(s_cpsetup, s_cprestore, s_cpreturn, s_cpadd): Likewise.
2013-02-18 23:27:23 +00:00
Maciej W. Rozycki cf29fc6188 Fix ChangeLog typo. 2013-02-18 14:02:47 +00:00
Maciej W. Rozycki 79850f2618 * config/tc-mips.c (append_insn): Correcting indentation, remove
extraneous braces.
2013-02-18 14:02:02 +00:00
Nick Clifton 4c261dff51 * gas/arm/neon-vmov-bad.d: New file.
* gas/arm/neon-vmov-bad.s: Likewise.
        * gas/arm/neon-vmov-bad.l: Likewise.

        * config/tc-arm.c (do_neon_mov): Break on NS_NULL.
2013-02-15 10:07:47 +00:00