This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FW: [PATCH,MIPS] Change the mapping for the 'move' instruction


Apologies for the spam, misspelt the mailing list name.
Simon.

-----Original Message-----
From: Simon Dardis 
Sent: 30 July 2015 15:49
To: Matthew Fortune; 'rdsandiford@googlemail.com'; Maciej Rozycki; 'Moore, Catherine'
Cc: 'binutils@sourcware.org'
Subject: [PATCH,MIPS] Change the mapping for the 'move' instruction

Hello all, 

This patch updates the MIPS move instruction alias so that it is 'or' instead of [d]addu for microMIPS, MIPS32 and MIPS64. The reasoning behind this change was brought up in an earlier RFC from Matthew Fortune: 

http://sourceware.org/ml/binutils/2015-03/msg00001.html

"This issue was identified during performance analysis of a recent 64-bit design by Imagination and the use of addu for 32-bit moves can inhibit some pipeline forwarding optimisations as the addu has to sign extend in 64-bit implementations. I suspect there are ways to deal with this in hardware but regardless it seems sensible to use the same instruction for move in 32-bit and 64-bit code."
	
This patch preserves existing disassembler behavior, e.g assembling 'daddu t7, ra, zero' and then disassembling it gives back 'move t7,ra'.

Tested with no new regression with check-ld, check-gas, check-binutils.

Thanks,
Simon

opcodes/
	* micromips-opc.c (micromips_opcodes): Re-order table so that move
	based on 'or' is first.
	* mips-opc.c (mips_builtin_opcodes): Ditto.

bfd/
	* elfxx-mips.c (STUB_MOVE): Change to use 'or' only.
	(mips_o32_exec_plt0_entry, mipsr6_o32_exec_plt0_entry_compact,
	mips_n32_exec_plt0_entry, mipsr6_n32_exec_plt0_entry_compact,
	mips_n64_exec_plt0_entry, mipsr6_n64_exec_plt0_entry_compact,
	micromipsr6_insn32_o32_exec_plt0_entry,
	micromips_insn32_o32_exec_plt0_entry): Update to use 'or' instead
	of 'addu/daddu'.
	(_bfd_mips_elf_finish_dynamic_symbol): Update usage of STUB_MOVE.

gas/
	* config/tc-mips.c (move_register): change to use 'or' only.
	(s_cpload, s_cpsetup, s_cprestore, s_cpreturn): update to
	use or for move.
	* gas/testsuite/gas/mips/elf-rel23.d: Update test.
	* gas/testsuite/gas/mips/elf-rel23.d: Ditto.
	* gas/testsuite/gas/mips/elf-rel23a.d: Ditto.
	* gas/testsuite/gas/mips/elf-rel23b.d: Ditto.
	* gas/testsuite/gas/mips/elf_e_flags1.d: Ditto.
	* gas/testsuite/gas/mips/elf_e_flags2.d: Ditto.
	* gas/testsuite/gas/mips/elf_e_flags3.d: Ditto.
	* gas/testsuite/gas/mips/elf_e_flags4.d: Ditto.
	* gas/testsuite/gas/mips/loc-swap-dis.d: Ditto.
	* gas/testsuite/gas/mips/micromips-insn32.d: Ditto.
	* gas/testsuite/gas/mips/micromips-noinsn32.d: Ditto.
	* gas/testsuite/gas/mips/micromips-trap.d: Ditto.
	* gas/testsuite/gas/mips/micromips.d: Ditto.
	* gas/testsuite/gas/mips/micromips64-insn32.d: Ditto.
	* gas/testsuite/gas/mips/mips-abi32-pic.d: Ditto.
	* gas/testsuite/gas/mips/mips-abi32.d: Ditto.
	* gas/testsuite/gas/mips/mips-gp32-fp32-pic.d: Ditto.
	* gas/testsuite/gas/mips/mips-gp32-fp32.d: Ditto.
	* gas/testsuite/gas/mips/mips-gp32-fp64-pic.d: Ditto.
	* gas/testsuite/gas/mips/mips-gp32-fp64.d: Ditto.
	* gas/testsuite/gas/mips/mips-gp64-fp32-pic.d: Ditto.
	* gas/testsuite/gas/mips/mips-gp64-fp32.d: Ditto.
	* gas/testsuite/gas/mips/mips-gp64-fp64-pic.d: Ditto.
	* gas/testsuite/gas/mips/mips-gp64-fp64.d: Ditto.
	* gas/testsuite/gas/mips/mipsr6@loc-swap-dis.d: Ditto.
	* gas/testsuite/gas/mips/tls-o32.d: Ditto.
	* gas/testsuite/gas/mips/uld2-eb.d: Ditto.
	* gas/testsuite/gas/mips/uld2-el.d: Ditto.
	* gas/testsuite/gas/mips/ulw2-eb-ilocks.d: Ditto.
	* gas/testsuite/gas/mips/ulw2-eb.d: Ditto.
	* gas/testsuite/gas/mips/ulw2-el-ilocks.d: Ditto.
	* gas/testsuite/gas/mips/ulw2-el.d: Ditto.

gold/
	* mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
	lazy_stub_normal_1, lazy_stub_normal_1_n64,
        lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
        lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
        lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
        lazy_stub_micromips32_big_n64) Update to use 'or' for move instead
	of 'addu/daddu'.

ld/
	*  ld/testsuite/ld-mips-elf/compressed-plt-1-n32-mips16.od: Update test.
	*  ld/testsuite/ld-mips-elf/compressed-plt-1-n32-umips.od: Ditto.
	*  ld/testsuite/ld-mips-elf/compressed-plt-1-o32-mips16-got.od: Ditto.
	*  ld/testsuite/ld-mips-elf/compressed-plt-1-o32-mips16-only.od: Ditto.
	*  ld/testsuite/ld-mips-elf/compressed-plt-1-o32-mips16-word.od: Ditto.
	*  ld/testsuite/ld-mips-elf/compressed-plt-1-o32-mips16.od: Ditto.
	*  ld/testsuite/ld-mips-elf/compressed-plt-1-o32-r6.od: Ditto.
	*  ld/testsuite/ld-mips-elf/compressed-plt-1-o32-se.od: Ditto.
	*  ld/testsuite/ld-mips-elf/compressed-plt-1-o32-umips-got.od: Ditto.
	*  ld/testsuite/ld-mips-elf/compressed-plt-1-o32-umips-word.od: Ditto.
	*  ld/testsuite/ld-mips-elf/compressed-plt-1-o32-umips.od: Ditto.
	*  ld/testsuite/ld-mips-elf/jalx-2.dd: Ditto.
	*  ld/testsuite/ld-mips-elf/mips16-pic-3.dd: Ditto.
	*  ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.dd: Ditto.
	*  ld/testsuite/ld-mips-elf/pic-and-nonpic-3b.dd: Ditto.
	*  ld/testsuite/ld-mips-elf/pic-and-nonpic-5b.dd: Ditto.
	*  ld/testsuite/ld-mips-elf/pic-and-nonpic-6-n32.dd: Ditto.
	*  ld/testsuite/ld-mips-elf/pic-and-nonpic-6-o32.dd: Ditto.
	*  ld/testsuite/ld-mips-elf/stub-dynsym-1-10000.d: Ditto.
	*  ld/testsuite/ld-mips-elf/stub-dynsym-1-2fe80.d: Ditto.
	*  ld/testsuite/ld-mips-elf/stub-dynsym-1-7fff.d: Ditto.
	*  ld/testsuite/ld-mips-elf/stub-dynsym-1-8000.d: Ditto.
	*  ld/testsuite/ld-mips-elf/stub-dynsym-1-fff0.d: Ditto.
	*  ld/testsuite/ld-mips-elf/tlsbin-o32.d: Ditto.
	*  ld/testsuite/ld-mips-elf/tlsdyn-o32-1.d: Ditto.
	*  ld/testsuite/ld-mips-elf/tlsdyn-o32-2.d: Ditto.
	*  ld/testsuite/ld-mips-elf/tlsdyn-o32-3.d: Ditto.
	*  ld/testsuite/ld-mips-elf/tlsdyn-o32.d: Ditto.
	*  ld/testsuite/ld-mips-elf/tlslib-o32.d: Ditto.

Attachment: MIPS-move-as-or.patch
Description: MIPS-move-as-or.patch


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]