[patch] Thumb-2 coprocessor support

Paul Brook paul@codesourcery.com
Wed Aug 31 16:08:00 GMT 2005


The attached patch adds assembler and disassembler support for Thumb-2 
coprocessor instructions.

Conveniently these use the same encoding (except the condition code field) in 
both Arm and Thumb mode.

The assembly support is straightforward as we already use a common opcode 
table. All that's needed is tweak the definitions to include teh thumb 
encoding, and an extra bit of logic to disable coprocessor instructions on 
Thumb-1 devices.

For the disassembler I pulled out disassembly of coprocessor instructions into 
a common table/routine.

There's a slight overlap between this and my previous Thumb-2 relaxation 
patch. They both define put_thumb2_insn. I'll fix this up when applying the 
patches.

Tested with cross to arm-none-eabi.
Ok?

Paul

2005-08-31  Paul Brook  <paul@codesourcery.com>

bfd/
	* libbdf.h: Regenerate.
	* bfd-in2.h: Regenerate.
	* reloc.c: Add BFD_RELOC_ARM_T32_CP_OFF_IMM and
	BFD_RELOC_ARM_T32_CP_OFF_IMM_S2.
gas/
	* config/tc-arm.c (encode_arm_cp_address): Use
	BFD_RELOC_ARM_T32_CP_OFF_IMM in thumb mode.
	(do_iwmmxt_wldstbh): Use BFD_RELOC_ARM_T32_CP_OFF_IMM_S2 in thumb
	mode.
	(md_assemble): Only allow coprocessor instructions when Thumb-2 is
	available.
	(cCE, cC3): Define.
	(insns): Use them for coprocessor instructions.
	(md_pcrel_from_section): Handle BFD_RELOC_ARM_T32_CP_OFF_IMM.
	(get_thumb32_insn): New function.
	(put_thumb32_insn): New function.
	(md_apply_fix): Handle BFD_RELOC_ARM_T32_CP_OFF_IMM and
	BFD_RELOC_ARM_T32_CP_OFF_IMM_S2.
gas/testsuite/
	* gas/arm/vfp-bad_t2.d, gas/arm/vfp-bad_t2.l, arm/vfp-bad_t2.s,
	gas/arm/vfp1_t2.d, gas/arm/vfp1_t2.s, gas/arm/vfp1xD_t2.d,
	gas/arm/vfp1xD_t2.s, gas/arm/vfp2_t2.d, gas/arm/vfp2_t2.s): New files.
opcodes/
	* arm-dis.c (coprocessor_opcodes): New.
	(arm_opcodes, thumb32_opcodes): Remove coprocessor insns.
	(print_insn_coprocessor): New function.
	(print_insn_arm): Use print_insn_coprocessor.  Remove coprocessor
	format characters.
	(print_insn_thumb32): Use print_insn_coprocessor.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.t2_coproc.gz
Type: application/x-gzip
Size: 36106 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20050831/ddf8c02b/attachment.bin>


More information about the Binutils mailing list